From e26a35246321699cd0ff5132830ce92220a79d91 Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Thu, 24 Sep 2026 05:33:54 +0000 Subject: [PATCH] Releasing v4.17.0 --- CHANGELOG.md | 190 ++ VERSION | 2 +- build.gradle.kts | 2 +- .../chargebee/v4/client/ClientMethods.java | 822 ++++---- .../v4/client/ClientMethodsImpl.java | 638 ++++--- .../chargebee/v4/client/ServiceRegistry.java | 1686 +++++++++-------- .../AppliedBusinessRule.java | 157 ++ .../v4/models/appliedRule/AppliedRule.java | 125 ++ .../v4/models/applyRule/ApplyRule.java | 242 +++ .../v4/models/businessRule/BusinessRule.java | 227 +++ .../BusinessRuleActivateRuleParams.java | 39 + .../params/BusinessRuleApplyRulesParams.java | 161 ++ .../params/BusinessRuleCreateParams.java | 162 ++ .../BusinessRuleDeactivateRuleParams.java | 39 + .../params/BusinessRuleDeleteDraftParams.java | 39 + .../params/BusinessRuleDeleteParams.java | 39 + .../params/BusinessRuleListParams.java | 163 ++ .../params/BusinessRuleReleaseRuleParams.java | 39 + .../BusinessRuleRetrieveDraftParams.java | 50 + .../params/BusinessRuleRetrieveParams.java | 50 + .../params/BusinessRuleUpdateDraftParams.java | 195 ++ .../BusinessRuleActivateRuleResponse.java | 99 + .../BusinessRuleApplyRulesResponse.java | 99 + .../responses/BusinessRuleCreateResponse.java | 99 + .../BusinessRuleDeactivateRuleResponse.java | 99 + .../BusinessRuleDeleteDraftResponse.java | 99 + .../responses/BusinessRuleDeleteResponse.java | 99 + .../responses/BusinessRuleListResponse.java | 209 ++ .../BusinessRuleReleaseRuleResponse.java | 99 + .../BusinessRuleRetrieveDraftResponse.java | 99 + .../BusinessRuleRetrieveResponse.java | 99 + .../BusinessRuleUpdateDraftResponse.java | 99 + .../businessRuleset/BusinessRuleset.java | 208 ++ .../params/BusinessRulesetActivateParams.java | 39 + .../params/BusinessRulesetAddRulesParams.java | 114 ++ .../params/BusinessRulesetCreateParams.java | 174 ++ .../BusinessRulesetDeactivateParams.java | 39 + .../params/BusinessRulesetDeleteParams.java | 39 + .../params/BusinessRulesetListParams.java | 113 ++ .../BusinessRulesetListRulesParams.java | 113 ++ .../BusinessRulesetRemoveRulesParams.java | 114 ++ .../params/BusinessRulesetRetrieveParams.java | 50 + .../params/BusinessRulesetUpdateParams.java | 206 ++ .../BusinessRulesetActivateResponse.java | 99 + .../BusinessRulesetAddRulesResponse.java | 99 + .../BusinessRulesetCreateResponse.java | 99 + .../BusinessRulesetDeactivateResponse.java | 99 + .../BusinessRulesetDeleteResponse.java | 99 + .../BusinessRulesetListResponse.java | 212 +++ .../BusinessRulesetListRulesResponse.java | 100 + .../BusinessRulesetRemoveRulesResponse.java | 99 + .../BusinessRulesetRetrieveResponse.java | 99 + .../BusinessRulesetUpdateResponse.java | 99 + .../BusinessRulesetRule.java | 64 + .../com/chargebee/v4/models/card/Card.java | 2 + .../CardSwitchGatewayForCustomerParams.java | 2 + .../params/UpdateCardForCustomerParams.java | 4 + .../v4/models/creditNote/CreditNote.java | 13 + .../params/CreditNoteRecordRefundParams.java | 12 +- .../params/CreditNoteSendEmailParams.java | 39 + .../params/ImportCreditNoteParams.java | 52 +- .../CreditNoteSendEmailResponse.java | 99 + .../customDataSchema/CustomDataSchema.java | 264 +++ .../v4/models/customer/Customer.java | 43 + .../params/CustomerCollectPaymentParams.java | 54 + .../customer/params/CustomerCreateParams.java | 80 + .../customer/params/CustomerListParams.java | 10 + .../CustomerRecordExcessPaymentParams.java | 12 +- .../CustomerSendPaymentRequestParams.java | 39 + .../customer/params/CustomerUpdateParams.java | 2 + .../CustomerUpdatePaymentMethodParams.java | 28 + .../CustomerSendPaymentRequestResponse.java | 99 + .../chargebee/v4/models/dispute/Dispute.java | 268 +++ .../dispute/params/DisputeListParams.java | 559 ++++++ .../dispute/params/DisputeRetrieveParams.java | 50 + .../responses/DisputeListResponse.java | 209 ++ .../responses/DisputeRetrieveResponse.java | 99 + .../v4/models/einvoice/Einvoice.java | 328 +++- .../params/EinvoiceRetrieveParams.java | 50 + .../einvoice/params/ListEinvoicesParams.java | 195 ++ .../responses/EinvoiceRetrieveResponse.java | 99 + .../responses/ListEinvoicesResponse.java | 211 +++ .../v4/models/emailLog/EmailLog.java | 224 +++ .../params/EmailLogsForCustomerParams.java | 96 + .../EmailLogsForCustomerResponse.java | 218 +++ .../v4/models/estimate/Estimate.java | 12 +- .../CreateSubscriptionItemEstimateParams.java | 22 + ...criptionItemForCustomerEstimateParams.java | 20 + .../EstimateCreateSubscriptionParams.java | 2 + ...stimateGiftSubscriptionForItemsParams.java | 26 + .../EstimateGiftSubscriptionParams.java | 26 + ...imateUpdateSubscriptionForItemsParams.java | 22 + .../EstimateUpdateSubscriptionParams.java | 2 + .../event/BusinessRuleActivatedEvent.java | 183 ++ .../event/BusinessRuleCreatedEvent.java | 183 ++ .../event/BusinessRuleDeactivatedEvent.java | 183 ++ .../event/BusinessRuleDeletedEvent.java | 183 ++ .../event/BusinessRuleReleasedEvent.java | 183 ++ .../event/BusinessRuleUpdatedEvent.java | 183 ++ .../event/BusinessRulesAppliedEvent.java | 184 ++ .../event/BusinessRulesetActivatedEvent.java | 183 ++ .../event/BusinessRulesetCreatedEvent.java | 183 ++ .../BusinessRulesetDeactivatedEvent.java | 183 ++ .../event/BusinessRulesetDeletedEvent.java | 183 ++ .../event/BusinessRulesetUpdatedEvent.java | 183 ++ .../v4/models/event/EinvoiceCreatedEvent.java | 183 ++ .../v4/models/event/EinvoiceUpdatedEvent.java | 183 ++ .../com/chargebee/v4/models/event/Event.java | 39 + .../models/event/params/EventListParams.java | 140 ++ .../export/params/ExportCustomersParams.java | 2 + .../params/ExportDeferredRevenueParams.java | 2 + .../ExportRevenueRecognitionParams.java | 2 + .../params/ExportTransactionsParams.java | 28 + .../GatewayPaymentMethodToken.java | 2 + .../gift/params/GiftCreateForItemsParams.java | 26 + .../models/gift/params/GiftCreateParams.java | 26 + .../v4/models/grantBlock/GrantBlock.java | 317 +++- .../v4/models/hostedPage/HostedPage.java | 11 + .../params/HostedPageAcceptQuoteParams.java | 20 + ...tedPageCheckoutExistingForItemsParams.java | 22 + .../HostedPageCheckoutExistingParams.java | 2 + .../HostedPageCheckoutGiftForItemsParams.java | 20 + .../HostedPageCheckoutNewForItemsParams.java | 24 + .../params/HostedPageCheckoutNewParams.java | 4 + ...stedPageCheckoutOneTimeForItemsParams.java | 24 + .../HostedPageCheckoutOneTimeParams.java | 4 + .../params/HostedPageClaimGiftParams.java | 20 + .../params/HostedPageCollectNowParams.java | 22 + .../HostedPageExtendSubscriptionParams.java | 20 + .../HostedPageManagePaymentSourcesParams.java | 22 + .../params/HostedPagePreCancelParams.java | 20 + .../params/HostedPageUpdateCardParams.java | 2 + .../HostedPageUpdatePaymentMethodParams.java | 2 + .../chargebee/v4/models/invoice/Invoice.java | 13 + .../invoice/params/ImportInvoiceParams.java | 52 +- ...eCreateForChargeItemsAndChargesParams.java | 58 + .../invoice/params/InvoiceCreateParams.java | 58 + .../params/InvoiceRecordPaymentParams.java | 12 +- .../params/InvoiceRecordRefundParams.java | 12 +- .../params/InvoiceSendEmailParams.java | 39 + .../responses/InvoiceSendEmailResponse.java | 99 + .../v4/models/ledgerEntry/LedgerEntry.java | 50 +- .../ledgerOperation/LedgerOperation.java | 2 + .../params/LedgerOperationAllocateParams.java | 50 + .../params/ListLedgerOperationsParams.java | 6 + .../LedgerOperationAuthorizeResponse.java | 25 +- ...OperationCaptureAuthorizationResponse.java | 25 +- .../LedgerOperationCaptureResponse.java | 25 +- ...OperationReleaseAuthorizationResponse.java | 25 +- .../OmnichannelSubscription.java | 2 + .../OmnichannelSubscriptionItem.java | 2 + .../models/paymentIntent/PaymentIntent.java | 89 + .../params/PaymentIntentCreateParams.java | 46 + .../params/PaymentIntentUpdateParams.java | 26 + .../paymentSchedule/PaymentSchedule.java | 167 +- .../params/PaymentScheduleListParams.java | 94 + .../PaymentScheduleListResponse.java | 212 +++ .../PaymentScheduleEstimate.java | 12 +- .../PaymentScheduleSchemeListParams.java | 85 + .../PaymentScheduleSchemeListResponse.java | 225 +++ .../models/paymentSource/PaymentSource.java | 109 +- .../CreateVoucherPaymentSourceParams.java | 20 + .../PaymentSourceCreateBankAccountParams.java | 20 + .../params/PaymentSourceCreateCardParams.java | 22 + ...tSourceCreateUsingPaymentIntentParams.java | 46 + ...SourceCreateUsingPermanentTokenParams.java | 46 + ...ymentSourceCreateUsingTempTokenParams.java | 46 + .../PaymentSourceCreateUsingTokenParams.java | 20 + .../params/PaymentSourceListParams.java | 130 ++ .../params/PaymentSourceUpdateCardParams.java | 74 + .../models/paymentVoucher/PaymentVoucher.java | 2 + ...SessionCreateForNewSubscriptionParams.java | 20 + .../params/PromotionalGrantsParams.java | 50 + .../purchase/params/PurchaseCreateParams.java | 26 + .../params/PurchaseEstimateParams.java | 2 + .../QuotedSubscription.java | 15 +- .../com/chargebee/v4/models/ramp/Ramp.java | 59 + .../RampCreateForSubscriptionParams.java | 73 + .../models/ramp/params/RampUpdateParams.java | 73 + .../v4/models/salesOrder/SalesOrder.java | 15 +- .../v4/models/subscription/Subscription.java | 28 +- .../params/ImportSubscriptionParams.java | 46 +- .../SubscriptionCreateForCustomerParams.java | 46 + .../params/SubscriptionCreateParams.java | 80 + .../SubscriptionCreateWithItemsParams.java | 66 + .../SubscriptionImportForCustomerParams.java | 12 +- .../SubscriptionImportForItemsParams.java | 32 +- .../params/SubscriptionReactivateParams.java | 26 + .../params/SubscriptionResumeParams.java | 26 + .../SubscriptionUpdateForItemsParams.java | 78 + .../params/SubscriptionUpdateParams.java | 58 + .../ThirdPartyPaymentMethod.java | 48 +- .../com/chargebee/v4/models/token/Token.java | 28 + .../v4/models/transaction/Transaction.java | 108 +- .../params/TransactionListParams.java | 140 ++ .../params/TransactionRecordRefundParams.java | 12 +- .../VirtualBankAccount.java | 2 + .../v4/services/BusinessRuleService.java | 450 +++++ .../v4/services/BusinessRulesetService.java | 583 ++++++ .../v4/services/CreditNoteService.java | 27 + .../v4/services/CustomerService.java | 30 + .../chargebee/v4/services/DisputeService.java | 124 ++ .../v4/services/EinvoiceService.java | 133 ++ .../v4/services/EmailLogService.java | 127 ++ .../chargebee/v4/services/InvoiceService.java | 23 + .../PaymentScheduleSchemeService.java | 72 + .../v4/services/PaymentScheduleService.java | 118 ++ .../v4/telemetry/SdkTelemetryState.java | 4 +- .../v4/telemetry/TelemetryExecutor.java | 4 +- 209 files changed, 18935 insertions(+), 1596 deletions(-) create mode 100644 src/main/java/com/chargebee/v4/models/appliedBusinessRule/AppliedBusinessRule.java create mode 100644 src/main/java/com/chargebee/v4/models/appliedRule/AppliedRule.java create mode 100644 src/main/java/com/chargebee/v4/models/applyRule/ApplyRule.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/BusinessRule.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleActivateRuleParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleApplyRulesParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleCreateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeactivateRuleParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteDraftParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleReleaseRuleParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveDraftParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleUpdateDraftParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleActivateRuleResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleApplyRulesResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleCreateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeactivateRuleResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteDraftResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleListResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleReleaseRuleResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveDraftResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleUpdateDraftResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/BusinessRuleset.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetActivateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetAddRulesParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetCreateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeactivateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeleteParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListRulesParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRemoveRulesParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetUpdateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetActivateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetAddRulesResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetCreateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeactivateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeleteResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListRulesResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRemoveRulesResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetUpdateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/businessRulesetRule/BusinessRulesetRule.java create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEmailParams.java create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEmailResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/customDataSchema/CustomDataSchema.java create mode 100644 src/main/java/com/chargebee/v4/models/customer/params/CustomerSendPaymentRequestParams.java create mode 100644 src/main/java/com/chargebee/v4/models/customer/responses/CustomerSendPaymentRequestResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/dispute/Dispute.java create mode 100644 src/main/java/com/chargebee/v4/models/dispute/params/DisputeListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/dispute/params/DisputeRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/dispute/responses/DisputeListResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/dispute/responses/DisputeRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/einvoice/params/EinvoiceRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/einvoice/params/ListEinvoicesParams.java create mode 100644 src/main/java/com/chargebee/v4/models/einvoice/responses/EinvoiceRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/einvoice/responses/ListEinvoicesResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/emailLog/EmailLog.java create mode 100644 src/main/java/com/chargebee/v4/models/emailLog/params/EmailLogsForCustomerParams.java create mode 100644 src/main/java/com/chargebee/v4/models/emailLog/responses/EmailLogsForCustomerResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleActivatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleCreatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleDeactivatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleDeletedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleReleasedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRuleUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesAppliedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesetActivatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesetCreatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeactivatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeletedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/BusinessRulesetUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/EinvoiceCreatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/EinvoiceUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSendEmailParams.java create mode 100644 src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSendEmailResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSchedule/params/PaymentScheduleListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSchedule/responses/PaymentScheduleListResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeListResponse.java create mode 100644 src/main/java/com/chargebee/v4/services/BusinessRuleService.java create mode 100644 src/main/java/com/chargebee/v4/services/BusinessRulesetService.java create mode 100644 src/main/java/com/chargebee/v4/services/DisputeService.java create mode 100644 src/main/java/com/chargebee/v4/services/EinvoiceService.java create mode 100644 src/main/java/com/chargebee/v4/services/EmailLogService.java create mode 100644 src/main/java/com/chargebee/v4/services/PaymentScheduleService.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a32d77e9..a48d15a46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,193 @@ +### v4.17.0 (2026-09-24) +* * * +### New Resources: +- [`AppliedBusinessRule`](https://apidocs.chargebee.com/docs/api/applied_business_rules) has been added. +- [`AppliedRule`](https://apidocs.chargebee.com/docs/api/applied_rules) has been added. +- [`ApplyRule`](https://apidocs.chargebee.com/docs/api/apply_rules) has been added. +- [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules) has been added. +- [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets) has been added. +- [`BusinessRulesetRule`](https://apidocs.chargebee.com/docs/api/business_ruleset_rules) has been added. +- [`CustomDataSchema`](https://apidocs.chargebee.com/docs/api/custom_data_schemas) has been added. +- [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes) has been added. +- [`EmailLog`](https://apidocs.chargebee.com/docs/api/email_logs) has been added. + + +### New Actions: +- [`send_credit_note_email`](https://apidocs.chargebee.com/docs/api/credit_notes/send-credit-note-email) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`send_payment_request_email`](https://apidocs.chargebee.com/docs/api/customers/send-payment-request-email) has been added to [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`retrieve_an_e-invoice`](https://apidocs.chargebee.com/docs/api/einvoices/retrieve-an-e-invoice) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`send_invoice_email`](https://apidocs.chargebee.com/docs/api/invoices/send-invoice-email) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) has been added to [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) has been added to [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). + + +### New Attributes: +- [`brand_id`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#brand_id) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/customers/customer-object#brand_id) has been added to [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`entity_type`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_type) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`entity_id`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_id) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`created_at`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#created_at) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`resource_version`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#resource_version) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#updated_at) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`deleted`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#deleted) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`business_entity_id`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#business_entity_id) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`artifacts`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#artifacts) has been added to [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`site_id`](https://apidocs.chargebee.com/docs/api/events/event-object#site_id) has been added to [`Event`](https://apidocs.chargebee.com/docs/api/events). +- [`provisioned_block_balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#provisioned_block_balance) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`overdraft_block_balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#overdraft_block_balance) has been added to [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/hosted-page-object#brand_id) has been added to [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/invoices/invoice-object#brand_id) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#brand_id) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`reference_transactions`](https://apidocs.chargebee.com/docs/api/payment_schedules/payment-schedule-object#reference_transactions) has been added to [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#brand_id) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#network_transaction_reference) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/ramp-object#billing_configuration) has been added to [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/subscription-object#brand_id) has been added to [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/third_party_payment_methods/third-party-payment-method-object#network_transaction_reference) has been added to [`ThirdPartyPaymentMethod`](https://apidocs.chargebee.com/docs/api/third_party_payment_methods). +- [`network_transaction_details`](https://apidocs.chargebee.com/docs/api/transactions/transaction-object#network_transaction_details) has been added to [`Transaction`](https://apidocs.chargebee.com/docs/api/transactions). + + +### New Parameters: +- [`limit`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#limit) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`offset`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#offset) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`reference_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#reference_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#updated_at) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`sort_by`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#sort_by) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`invoice_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#invoice_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`credit_note_id`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices#credit_note_id) has been added as query parameter to [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#limit) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#offset) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`invoice_id`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#invoice_id) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`id`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#id) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules#updated_at) has been added as query parameter to [`list_payment_schedules`](https://apidocs.chargebee.com/docs/api/payment_schedules/list-payment-schedules) in [`PaymentSchedule`](https://apidocs.chargebee.com/docs/api/payment_schedules). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#limit) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#offset) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`id`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#id) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`updated_at`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes#updated_at) has been added as query parameter to [`list_payment_schedule_schemes`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes/list-payment-schedule-schemes) in [`PaymentScheduleScheme`](https://apidocs.chargebee.com/docs/api/payment_schedule_schemes). +- [`line_items.is_partial_tax_applied`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_is_partial_tax_applied) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`line_items.taxable_amount`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_taxable_amount) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer#brand_id) has been added as request body parameter to [`create_a_customer`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer) in [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-customer-and-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_creating_a_customer_and_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-customer-and-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-updating-a-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_updating_a_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-updating-a-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-subscription#subscription_items_description) has been added as request body parameter to [`estimate_for_creating_a_subscription`](https://apidocs.chargebee.com/docs/api/estimates/estimate-for-creating-a-subscription) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges#brand_id) has been added as request body parameter to [`checkout_charge-items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/extend-subscription#brand_id) has been added as request body parameter to [`extend_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/extend-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items#brand_id) has been added as request body parameter to [`checkout_gift_subscription_for_items`](https://apidocs.chargebee.com/docs/api/hosted_pages/checkout-gift-subscription-for-items) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/collect-now#brand_id) has been added as request body parameter to [`collect_now`](https://apidocs.chargebee.com/docs/api/hosted_pages/collect-now) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/accept-a-quote#brand_id) has been added as request body parameter to [`accept_a_quote`](https://apidocs.chargebee.com/docs/api/hosted_pages/accept-a-quote) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-for-a-new-subscription#brand_id) has been added as request body parameter to [`create_checkout_for_a_new_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-for-a-new-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/claim-a-gift-subscription#brand_id) has been added as request body parameter to [`claim_a_gift_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/claim-a-gift-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-to-update-a-subscription#brand_id) has been added as request body parameter to [`create_checkout_to_update_a_subscription`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-checkout-to-update-a-subscription) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page#brand_id) has been added as request body parameter to [`create_a_pre-cancel_hosted_page`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources#brand_id) has been added as request body parameter to [`manage_payment_sources`](https://apidocs.chargebee.com/docs/api/hosted_pages/manage-payment-sources) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`line_items.is_partial_tax_applied`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_is_partial_tax_applied) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`line_items.taxable_amount`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_taxable_amount) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`id`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#id) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`effective_from`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate#effective_from) has been added as request body parameter to [`allocate`](https://apidocs.chargebee.com/docs/api/ledger_operations/allocate) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#brand_id) 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). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token#brand_id) has been added as request body parameter to [`create_using_permanent_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source#brand_id) has been added as request body parameter to [`create_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-payment-intent#brand_id) has been added as request body parameter to [`create_using_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-payment-intent) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-voucher-payment-method#brand_id) has been added as request body parameter to [`create_a_voucher_payment_method`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-voucher-payment-method) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-gateway-temporary-token#brand_id) has been added as request body parameter to [`create_using_gateway_temporary_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-gateway-temporary-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`network_transaction_reference`](https://apidocs.chargebee.com/docs/api/payment_sources/update-a-card-payment-source#network_transaction_reference) has been added as request body parameter to [`update_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/update-a-card-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token#brand_id) has been added as request body parameter to [`create_using_chargebee_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-chargebee-token) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-bank-account-payment-source#brand_id) has been added as request body parameter to [`create_a_bank_account_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-bank-account-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription#brand_id) has been added as request body parameter to [`create_pricing_page_for_new_subscription`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions/create-pricing-page-for-new-subscription) in [`PricingPageSession`](https://apidocs.chargebee.com/docs/api/pricing_page_sessions). +- [`id`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant#id) has been added as request body parameter to [`create_promotional_grant`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant) in [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants). +- [`effective_from`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant#effective_from) has been added as request body parameter to [`create_promotional_grant`](https://apidocs.chargebee.com/docs/api/promotional_grants/create-promotional-grant) in [`PromotionalGrant`](https://apidocs.chargebee.com/docs/api/promotional_grants). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp#billing_configuration) has been added as request body parameter to [`create_a_ramp`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`billing_configuration`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp#billing_configuration) has been added as request body parameter to [`update_a_subscription_ramp`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items#subscription_items_description) has been added as request body parameter to [`update_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription#brand_id) has been added as request body parameter to [`create_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-customer#brand_id) has been added as request body parameter to [`create_subscription_for_customer`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-customer) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/import-subscription-for-items#subscription_items_description) has been added as request body parameter to [`import_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/import-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items#subscription_items_description) has been added as request body parameter to [`create_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`brand_id`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items#brand_id) has been added as request body parameter to [`create_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/create-subscription-for-items) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + +### New Events: +- [`business_rule_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_deleted) has been added. +- [`business_rules_applied`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rules_applied) has been added. +- [`business_ruleset_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_updated) has been added. +- [`business_rule_created`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_created) has been added. +- [`einvoice_created`](https://apidocs.chargebee.com/docs/api/events/webhook/einvoice_created) has been added. +- [`business_ruleset_deactivated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_deactivated) has been added. +- [`business_ruleset_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_deleted) has been added. +- [`business_ruleset_created`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_created) has been added. +- [`business_ruleset_activated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_ruleset_activated) has been added. +- [`business_rule_deactivated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_deactivated) has been added. +- [`einvoice_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/einvoice_updated) has been added. +- [`business_rule_released`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_released) has been added. +- [`business_rule_activated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_activated) has been added. +- [`business_rule_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/business_rule_updated) has been added. + + +### New Enums: +- `business_ruleset` and `price_ramp` have been added as new values enum `EntityType`. +- `einvoice_created`, `einvoice_updated`, `business_rule_created`, `business_rule_updated`, `business_rule_activated`, `business_rule_deactivated`, `business_rule_deleted`, `business_rule_released`, `business_rules_applied`, `business_ruleset_created`, `business_ruleset_updated`, `business_ruleset_activated`, `business_ruleset_deactivated`, and `business_ruleset_deleted` have been added as new values enum `EventType`. +- `payu` has been added as a new value enum `Gateway`. +- `payu` has been added as a new value enum `GatewayName`. +- `blik`, `fpx`, `wero`, `p24`, `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `PaymentMethod`. +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `PaymentMethodType`. +- `rescheduled`, `succeeded`, `failed`, `deferred`, `delivered`, `opened`, `bounced`, and `dropped` have been added as new values enum `Status`. +- `zero_rated` has been added as a new value enum `Taxability`. +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` have been added as new values enum `Type`. +- `cpq_quote` has been added as a new value to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/applied_business_rules/applied-business-rule-object#entity_type) in [`AppliedBusinessRule`](https://apidocs.chargebee.com/docs/api/applied_business_rules). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum attribute [`execute_mode`](https://apidocs.chargebee.com/docs/api/business_rulesets/business-ruleset-object#execute_mode) in [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `active` and `archived` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/custom_data_schemas/custom-data-schema-object#status) in [`CustomDataSchema`](https://apidocs.chargebee.com/docs/api/custom_data_schemas). +- `initiated`, `funds_withdrawn`, `in_review`, `cancelled`, `lost`, and `won` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/disputes/dispute-object#status) in [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `chargeback` and `inquiry` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/disputes/dispute-object#type) in [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `invoice` and `credit_note` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/einvoices/einvoice-object#entity_type) in [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `overdraft_settlement` has been added as a new value to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/ledger_operations/ledger-operation-object#type) in [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `subscription_not_found_in_source` has been added as a new value to enum attribute [`expiration_reason`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items/omnichannel-subscription-item-object#expiration_reason) in [`OmnichannelSubscriptionItem`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_items). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` 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). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` 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). +- `true` and `false` have been added as new values to enum query parameter `draft.is` in [`list_business_rules`](https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules) of [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_business_rules`](https://apidocs.chargebee.com/docs/api/business_rules/list-business-rules) of [`BusinessRule`](https://apidocs.chargebee.com/docs/api/business_rules). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum request body parameter `execute_mode` in [`update_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/update-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_rules_in_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/list-rules-in-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `true` and `false` have been added as new values to enum query parameter `active.is` in [`list_business_rulesets`](https://apidocs.chargebee.com/docs/api/business_rulesets/list-business-rulesets) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `stop_on_first_true`, `stop_on_first_false`, `execute_all`, and `execute_all_true` have been added as new values to enum request body parameter `execute_mode` in [`create_a_business_ruleset`](https://apidocs.chargebee.com/docs/api/business_rulesets/create-a-business-ruleset) of [`BusinessRuleset`](https://apidocs.chargebee.com/docs/api/business_rulesets). +- `dankort` has been added as a new value to enum request body parameter `preferred_scheme` in [`update_card_for_a_customer`](https://apidocs.chargebee.com/docs/api/cards/update-card-for-a-customer) of [`Card`](https://apidocs.chargebee.com/docs/api/cards). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_customer`](https://apidocs.chargebee.com/docs/api/customers/create-a-customer) of [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`collect_payment_for_customer`](https://apidocs.chargebee.com/docs/api/customers/collect-payment-for-customer) of [`Customer`](https://apidocs.chargebee.com/docs/api/customers). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.is` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.is_not` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `initiated`, `in_review`, `lost`, `funds_withdrawn`, `won`, and `cancelled` have been added as new values to enum query parameter `status.not_in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.is` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.is_not` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `inquiry` and `chargeback` have been added as new values to enum query parameter `type.not_in` in [`list_disputes`](https://apidocs.chargebee.com/docs/api/disputes/list-disputes) of [`Dispute`](https://apidocs.chargebee.com/docs/api/disputes). +- `updated_at` has been added as a new value to enum query parameter `sort_by.asc` in [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) of [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `updated_at` has been added as a new value to enum query parameter `sort_by.desc` in [`list_e-invoices`](https://apidocs.chargebee.com/docs/api/einvoices/list-e-invoices) of [`Einvoice`](https://apidocs.chargebee.com/docs/api/einvoices). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_an_invoice`](https://apidocs.chargebee.com/docs/api/invoices/create-an-invoice) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `overdraft_settlement` has been added as a new value to enum query parameter `type.is` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `overdraft_settlement` has been added as a new value to enum query parameter `type.in` in [`list_ledger_operations`](https://apidocs.chargebee.com/docs/api/ledger_operations/list-ledger-operations) of [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` 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). +- `ovo`, `momo`, `mercado_pago`, `nequi`, `nupay`, `picpay`, `thai_qr`, `blik`, `fpx`, `wero`, `p24`, `affirm_pay`, and `rakuten_pay` 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). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_card_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/create-a-card-payment-source) of [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`update_subscription_for_items`](https://apidocs.chargebee.com/docs/api/subscriptions/update-subscription-for-items) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`create_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/create-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`update_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/update-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- `dankort` has been added as a new value to enum request body parameter `card.preferred_scheme` in [`import_a_subscription`](https://apidocs.chargebee.com/docs/api/subscriptions/import-a-subscription) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + +### Deprecated Attributes: +- [`granted_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#granted_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`balance`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#balance) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`hold_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#hold_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`used_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#used_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`expired_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#expired_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`rolled_over_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#rolled_over_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). +- [`voided_amount`](https://apidocs.chargebee.com/docs/api/grant_blocks/grant-block-object#voided_amount) has been deprecated in [`GrantBlock`](https://apidocs.chargebee.com/docs/api/grant_blocks). + + + ### v4.16.0 (2026-09-08) * * * diff --git a/VERSION b/VERSION index ecbc3b030..43b582715 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.16.0 +4.17.0 diff --git a/build.gradle.kts b/build.gradle.kts index e50427425..638300ce2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.16.0" +version = "4.17.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 24af43916..906516fb1 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -4,50 +4,126 @@ import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.services.QuoteEntitlementService; - import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.services.TimeMachineService; - import com.chargebee.v4.services.BusinessEntityService; import com.chargebee.v4.services.OfferEventService; import com.chargebee.v4.services.PromotionalGrantService; -import com.chargebee.v4.services.InAppSubscriptionService; - import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.services.CreditNoteService; - -import com.chargebee.v4.services.CouponSetService; - import com.chargebee.v4.services.LedgerAccountBalanceService; import com.chargebee.v4.services.QuoteService; +import com.chargebee.v4.services.EstimateService; + +import com.chargebee.v4.services.PaymentSourceService; + +import com.chargebee.v4.services.PlanService; + +import com.chargebee.v4.services.OrderService; + +import com.chargebee.v4.services.ItemService; + +import com.chargebee.v4.services.RampService; + +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; + +import com.chargebee.v4.services.DifferentialPriceService; + +import com.chargebee.v4.services.AdditionalBillingLogiqService; + +import com.chargebee.v4.services.SiteMigrationDetailService; + +import com.chargebee.v4.services.PaymentScheduleSchemeService; + +import com.chargebee.v4.services.CardService; + +import com.chargebee.v4.services.FullExportService; + +import com.chargebee.v4.services.VirtualBankAccountService; + +import com.chargebee.v4.services.EmailLogService; + +import com.chargebee.v4.services.PricingPageSessionService; + +import com.chargebee.v4.services.SubscriptionService; + +import com.chargebee.v4.services.PromotionalCreditService; + +import com.chargebee.v4.services.BrandConfigurationService; + +import com.chargebee.v4.services.FeatureService; + +import com.chargebee.v4.services.UnbilledChargesSettingService; + +import com.chargebee.v4.services.CurrencyService; + +import com.chargebee.v4.services.EventService; + +import com.chargebee.v4.services.UsageFileService; + +import com.chargebee.v4.services.NonSubscriptionService; + +import com.chargebee.v4.services.DisputeService; + +import com.chargebee.v4.services.ResourceMigrationService; + +import com.chargebee.v4.services.ProductService; + +import com.chargebee.v4.services.CouponCodeService; + +import com.chargebee.v4.services.AddressService; + +import com.chargebee.v4.services.CouponService; + +import com.chargebee.v4.services.ItemPriceService; + +import com.chargebee.v4.services.OfferFulfillmentService; + +import com.chargebee.v4.services.PaymentVoucherService; + +import com.chargebee.v4.services.ThirdPartyEntityMappingService; + +import com.chargebee.v4.services.VaultedPaymentMethodService; + +import com.chargebee.v4.services.UsageChargeService; + +import com.chargebee.v4.services.ThirdPartyConfigurationService; + +import com.chargebee.v4.services.UnbilledChargeService; + +import com.chargebee.v4.services.TransactionService; + +import com.chargebee.v4.services.ThirdPartySyncDetailService; + +import com.chargebee.v4.services.EinvoiceService; + +import com.chargebee.v4.services.QuoteEntitlementService; + +import com.chargebee.v4.services.TimeMachineService; + +import com.chargebee.v4.services.InAppSubscriptionService; + +import com.chargebee.v4.services.CreditNoteService; + +import com.chargebee.v4.services.CouponSetService; + import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.services.EstimateService; +import com.chargebee.v4.services.BusinessRuleService; import com.chargebee.v4.services.VariantService; import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.services.PaymentSourceService; - import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.services.PlanService; - import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.services.OrderService; - -import com.chargebee.v4.services.ItemService; - import com.chargebee.v4.services.CustomerEntitlementService; import com.chargebee.v4.services.PersonalizedOfferService; @@ -58,32 +134,20 @@ import com.chargebee.v4.services.MeterService; -import com.chargebee.v4.services.RampService; - -import com.chargebee.v4.services.OmnichannelOneTimeOrderService; - -import com.chargebee.v4.services.DifferentialPriceService; - import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.services.AdditionalBillingLogiqService; - import com.chargebee.v4.services.LedgerOperationService; +import com.chargebee.v4.services.PaymentScheduleService; + import com.chargebee.v4.services.UsageSummaryService; import com.chargebee.v4.services.AlertStatusService; import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.services.SiteMigrationDetailService; - import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.services.PaymentScheduleSchemeService; - -import com.chargebee.v4.services.CardService; - import com.chargebee.v4.services.AttachedItemService; import com.chargebee.v4.services.UsageEventService; @@ -92,9 +156,7 @@ import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.services.FullExportService; - -import com.chargebee.v4.services.VirtualBankAccountService; +import com.chargebee.v4.services.BusinessRulesetService; import com.chargebee.v4.services.GrantBlockService; @@ -104,86 +166,36 @@ import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.services.PricingPageSessionService; - import com.chargebee.v4.services.Pc2MigrationItemPriceService; import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.services.SubscriptionService; - import com.chargebee.v4.services.MediaService; import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.services.PromotionalCreditService; - -import com.chargebee.v4.services.BrandConfigurationService; - import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.services.FeatureService; - -import com.chargebee.v4.services.UnbilledChargesSettingService; - import com.chargebee.v4.services.AlertService; -import com.chargebee.v4.services.CurrencyService; - -import com.chargebee.v4.services.EventService; - -import com.chargebee.v4.services.UsageFileService; - -import com.chargebee.v4.services.NonSubscriptionService; - -import com.chargebee.v4.services.ResourceMigrationService; - -import com.chargebee.v4.services.ProductService; - -import com.chargebee.v4.services.CouponCodeService; - -import com.chargebee.v4.services.AddressService; - -import com.chargebee.v4.services.CouponService; - import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.services.ItemPriceService; - import com.chargebee.v4.services.CreditUnitService; -import com.chargebee.v4.services.OfferFulfillmentService; - import com.chargebee.v4.services.HostedPageService; import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.services.PaymentVoucherService; - import com.chargebee.v4.services.ItemFamilyService; import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.services.ThirdPartyEntityMappingService; - -import com.chargebee.v4.services.VaultedPaymentMethodService; - -import com.chargebee.v4.services.UsageChargeService; - import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.services.ThirdPartyConfigurationService; - -import com.chargebee.v4.services.UnbilledChargeService; - import com.chargebee.v4.services.CommentService; import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.services.TransactionService; - -import com.chargebee.v4.services.ThirdPartySyncDetailService; - import com.chargebee.v4.services.CustomerService; import com.chargebee.v4.services.ItemEntitlementService; @@ -208,13 +220,6 @@ public interface ClientMethods { */ CsvTaxRuleService csvTaxRules(); - /** - * Access quote_entitlement-related operations. - * - * @return QuoteEntitlementService instance for fluent API access - */ - QuoteEntitlementService quoteEntitlements(); - /** * Access usage-related operations. * @@ -222,13 +227,6 @@ public interface ClientMethods { */ UsageService usages(); - /** - * Access time_machine-related operations. - * - * @return TimeMachineService instance for fluent API access - */ - TimeMachineService timeMachines(); - /** * Access business_entity-related operations. * @@ -250,13 +248,6 @@ public interface ClientMethods { */ PromotionalGrantService promotionalGrants(); - /** - * Access in_app_subscription-related operations. - * - * @return InAppSubscriptionService instance for fluent API access - */ - InAppSubscriptionService inAppSubscriptions(); - /** * Access pc2_migration-related operations. * @@ -264,20 +255,6 @@ public interface ClientMethods { */ Pc2MigrationService pc2Migrations(); - /** - * Access credit_note-related operations. - * - * @return CreditNoteService instance for fluent API access - */ - CreditNoteService creditNotes(); - - /** - * Access coupon_set-related operations. - * - * @return CouponSetService instance for fluent API access - */ - CouponSetService couponSets(); - /** * Access ledger_account_balance-related operations. * @@ -293,74 +270,375 @@ public interface ClientMethods { QuoteService quotes(); /** - * Access pc2_migration_item-related operations. + * Access estimate-related operations. * - * @return Pc2MigrationItemService instance for fluent API access + * @return EstimateService instance for fluent API access */ - Pc2MigrationItemService pc2MigrationItems(); + EstimateService estimates(); /** - * Access estimate-related operations. + * Access payment_source-related operations. * - * @return EstimateService instance for fluent API access + * @return PaymentSourceService instance for fluent API access */ - EstimateService estimates(); + PaymentSourceService paymentSources(); /** - * Access variant-related operations. + * Access plan-related operations. * - * @return VariantService instance for fluent API access + * @return PlanService instance for fluent API access */ - VariantService variants(); + PlanService plans(); /** - * Access pc2_migration_item_family-related operations. + * Access order-related operations. * - * @return Pc2MigrationItemFamilyService instance for fluent API access + * @return OrderService instance for fluent API access */ - Pc2MigrationItemFamilyService pc2MigrationItemFamilies(); + OrderService orders(); /** - * Access payment_source-related operations. + * Access item-related operations. * - * @return PaymentSourceService instance for fluent API access + * @return ItemService instance for fluent API access */ - PaymentSourceService paymentSources(); + ItemService items(); /** - * Access recorded_purchase-related operations. + * Access ramp-related operations. * - * @return RecordedPurchaseService instance for fluent API access + * @return RampService instance for fluent API access */ - RecordedPurchaseService recordedPurchases(); + RampService ramps(); /** - * Access plan-related operations. + * Access omnichannel_one_time_order-related operations. * - * @return PlanService instance for fluent API access + * @return OmnichannelOneTimeOrderService instance for fluent API access + */ + OmnichannelOneTimeOrderService omnichannelOneTimeOrders(); + + /** + * Access differential_price-related operations. + * + * @return DifferentialPriceService instance for fluent API access + */ + DifferentialPriceService differentialPrices(); + + /** + * Access additional_billing_logiq-related operations. + * + * @return AdditionalBillingLogiqService instance for fluent API access + */ + AdditionalBillingLogiqService additionalBillingLogiqs(); + + /** + * Access site_migration_detail-related operations. + * + * @return SiteMigrationDetailService instance for fluent API access + */ + SiteMigrationDetailService siteMigrationDetails(); + + /** + * Access payment_schedule_scheme-related operations. + * + * @return PaymentScheduleSchemeService instance for fluent API access + */ + PaymentScheduleSchemeService paymentScheduleSchemes(); + + /** + * Access card-related operations. + * + * @return CardService instance for fluent API access + */ + CardService cards(); + + /** + * Access full_export-related operations. + * + * @return FullExportService instance for fluent API access + */ + FullExportService fullExports(); + + /** + * Access virtual_bank_account-related operations. + * + * @return VirtualBankAccountService instance for fluent API access + */ + VirtualBankAccountService virtualBankAccounts(); + + /** + * Access email_log-related operations. + * + * @return EmailLogService instance for fluent API access + */ + EmailLogService emailLogs(); + + /** + * Access pricing_page_session-related operations. + * + * @return PricingPageSessionService instance for fluent API access + */ + PricingPageSessionService pricingPageSessions(); + + /** + * Access subscription-related operations. + * + * @return SubscriptionService instance for fluent API access + */ + SubscriptionService subscriptions(); + + /** + * Access promotional_credit-related operations. + * + * @return PromotionalCreditService instance for fluent API access + */ + PromotionalCreditService promotionalCredits(); + + /** + * Access brand_configuration-related operations. + * + * @return BrandConfigurationService instance for fluent API access + */ + BrandConfigurationService brandConfigurations(); + + /** + * Access feature-related operations. + * + * @return FeatureService instance for fluent API access + */ + FeatureService features(); + + /** + * Access unbilled_charges_setting-related operations. + * + * @return UnbilledChargesSettingService instance for fluent API access + */ + UnbilledChargesSettingService unbilledChargesSettings(); + + /** + * Access currency-related operations. + * + * @return CurrencyService instance for fluent API access + */ + CurrencyService currencies(); + + /** + * Access event-related operations. + * + * @return EventService instance for fluent API access + */ + EventService events(); + + /** + * Access usage_file-related operations. + * + * @return UsageFileService instance for fluent API access + */ + UsageFileService usageFiles(); + + /** + * Access non_subscription-related operations. + * + * @return NonSubscriptionService instance for fluent API access + */ + NonSubscriptionService nonSubscriptions(); + + /** + * Access dispute-related operations. + * + * @return DisputeService instance for fluent API access + */ + DisputeService disputes(); + + /** + * Access resource_migration-related operations. + * + * @return ResourceMigrationService instance for fluent API access + */ + ResourceMigrationService resourceMigrations(); + + /** + * Access product-related operations. + * + * @return ProductService instance for fluent API access + */ + ProductService products(); + + /** + * Access coupon_code-related operations. + * + * @return CouponCodeService instance for fluent API access + */ + CouponCodeService couponCodes(); + + /** + * Access address-related operations. + * + * @return AddressService instance for fluent API access + */ + AddressService addresses(); + + /** + * Access coupon-related operations. + * + * @return CouponService instance for fluent API access + */ + CouponService coupons(); + + /** + * Access item_price-related operations. + * + * @return ItemPriceService instance for fluent API access + */ + ItemPriceService itemPrices(); + + /** + * Access offer_fulfillment-related operations. + * + * @return OfferFulfillmentService instance for fluent API access + */ + OfferFulfillmentService offerFulfillments(); + + /** + * Access payment_voucher-related operations. + * + * @return PaymentVoucherService instance for fluent API access + */ + PaymentVoucherService paymentVouchers(); + + /** + * Access third_party_entity_mapping-related operations. + * + * @return ThirdPartyEntityMappingService instance for fluent API access + */ + ThirdPartyEntityMappingService thirdPartyEntityMappings(); + + /** + * Access vaulted_payment_method-related operations. + * + * @return VaultedPaymentMethodService instance for fluent API access + */ + VaultedPaymentMethodService vaultedPaymentMethods(); + + /** + * Access usage_charge-related operations. + * + * @return UsageChargeService instance for fluent API access + */ + UsageChargeService usageCharges(); + + /** + * Access third_party_configuration-related operations. + * + * @return ThirdPartyConfigurationService instance for fluent API access + */ + ThirdPartyConfigurationService thirdPartyConfigurations(); + + /** + * Access unbilled_charge-related operations. + * + * @return UnbilledChargeService instance for fluent API access + */ + UnbilledChargeService unbilledCharges(); + + /** + * Access transaction-related operations. + * + * @return TransactionService instance for fluent API access + */ + TransactionService transactions(); + + /** + * Access third_party_sync_detail-related operations. + * + * @return ThirdPartySyncDetailService instance for fluent API access + */ + ThirdPartySyncDetailService thirdPartySyncDetails(); + + /** + * Access einvoice-related operations. + * + * @return EinvoiceService instance for fluent API access + */ + EinvoiceService einvoices(); + + /** + * Access quote_entitlement-related operations. + * + * @return QuoteEntitlementService instance for fluent API access + */ + QuoteEntitlementService quoteEntitlements(); + + /** + * Access time_machine-related operations. + * + * @return TimeMachineService instance for fluent API access + */ + TimeMachineService timeMachines(); + + /** + * Access in_app_subscription-related operations. + * + * @return InAppSubscriptionService instance for fluent API access + */ + InAppSubscriptionService inAppSubscriptions(); + + /** + * Access credit_note-related operations. + * + * @return CreditNoteService instance for fluent API access + */ + CreditNoteService creditNotes(); + + /** + * Access coupon_set-related operations. + * + * @return CouponSetService instance for fluent API access + */ + CouponSetService couponSets(); + + /** + * Access pc2_migration_item-related operations. + * + * @return Pc2MigrationItemService instance for fluent API access + */ + Pc2MigrationItemService pc2MigrationItems(); + + /** + * Access business_rule-related operations. + * + * @return BusinessRuleService instance for fluent API access + */ + BusinessRuleService businessRules(); + + /** + * Access variant-related operations. + * + * @return VariantService instance for fluent API access */ - PlanService plans(); + VariantService variants(); /** - * Access export-related operations. + * Access pc2_migration_item_family-related operations. * - * @return ExportService instance for fluent API access + * @return Pc2MigrationItemFamilyService instance for fluent API access */ - ExportService exports(); + Pc2MigrationItemFamilyService pc2MigrationItemFamilies(); /** - * Access order-related operations. + * Access recorded_purchase-related operations. * - * @return OrderService instance for fluent API access + * @return RecordedPurchaseService instance for fluent API access */ - OrderService orders(); + RecordedPurchaseService recordedPurchases(); /** - * Access item-related operations. + * Access export-related operations. * - * @return ItemService instance for fluent API access + * @return ExportService instance for fluent API access */ - ItemService items(); + ExportService exports(); /** * Access customer_entitlement-related operations. @@ -397,27 +675,6 @@ public interface ClientMethods { */ MeterService meters(); - /** - * Access ramp-related operations. - * - * @return RampService instance for fluent API access - */ - RampService ramps(); - - /** - * Access omnichannel_one_time_order-related operations. - * - * @return OmnichannelOneTimeOrderService instance for fluent API access - */ - OmnichannelOneTimeOrderService omnichannelOneTimeOrders(); - - /** - * Access differential_price-related operations. - * - * @return DifferentialPriceService instance for fluent API access - */ - DifferentialPriceService differentialPrices(); - /** * Access entitlement-related operations. * @@ -426,18 +683,18 @@ public interface ClientMethods { EntitlementService entitlements(); /** - * Access additional_billing_logiq-related operations. + * Access ledger_operation-related operations. * - * @return AdditionalBillingLogiqService instance for fluent API access + * @return LedgerOperationService instance for fluent API access */ - AdditionalBillingLogiqService additionalBillingLogiqs(); + LedgerOperationService ledgerOperations(); /** - * Access ledger_operation-related operations. + * Access payment_schedule-related operations. * - * @return LedgerOperationService instance for fluent API access + * @return PaymentScheduleService instance for fluent API access */ - LedgerOperationService ledgerOperations(); + PaymentScheduleService paymentSchedules(); /** * Access usage_summary-related operations. @@ -460,13 +717,6 @@ public interface ClientMethods { */ SubscriptionSettingService subscriptionSettings(); - /** - * Access site_migration_detail-related operations. - * - * @return SiteMigrationDetailService instance for fluent API access - */ - SiteMigrationDetailService siteMigrationDetails(); - /** * Access payment_intent-related operations. * @@ -474,20 +724,6 @@ public interface ClientMethods { */ PaymentIntentService paymentIntents(); - /** - * Access payment_schedule_scheme-related operations. - * - * @return PaymentScheduleSchemeService instance for fluent API access - */ - PaymentScheduleSchemeService paymentScheduleSchemes(); - - /** - * Access card-related operations. - * - * @return CardService instance for fluent API access - */ - CardService cards(); - /** * Access attached_item-related operations. * @@ -517,18 +753,11 @@ public interface ClientMethods { PriceVariantService priceVariants(); /** - * Access full_export-related operations. - * - * @return FullExportService instance for fluent API access - */ - FullExportService fullExports(); - - /** - * Access virtual_bank_account-related operations. + * Access business_ruleset-related operations. * - * @return VirtualBankAccountService instance for fluent API access + * @return BusinessRulesetService instance for fluent API access */ - VirtualBankAccountService virtualBankAccounts(); + BusinessRulesetService businessRulesets(); /** * Access grant_block-related operations. @@ -558,13 +787,6 @@ public interface ClientMethods { */ ConfigurationService configurations(); - /** - * Access pricing_page_session-related operations. - * - * @return PricingPageSessionService instance for fluent API access - */ - PricingPageSessionService pricingPageSessions(); - /** * Access pc2_migration_item_price-related operations. * @@ -579,13 +801,6 @@ public interface ClientMethods { */ RuleService rules(); - /** - * Access subscription-related operations. - * - * @return SubscriptionService instance for fluent API access - */ - SubscriptionService subscriptions(); - /** * Access media-related operations. * @@ -600,20 +815,6 @@ public interface ClientMethods { */ BusinessProfileService businessProfiles(); - /** - * Access promotional_credit-related operations. - * - * @return PromotionalCreditService instance for fluent API access - */ - PromotionalCreditService promotionalCredits(); - - /** - * Access brand_configuration-related operations. - * - * @return BrandConfigurationService instance for fluent API access - */ - BrandConfigurationService brandConfigurations(); - /** * Access webhook_endpoint-related operations. * @@ -621,20 +822,6 @@ public interface ClientMethods { */ WebhookEndpointService webhookEndpoints(); - /** - * Access feature-related operations. - * - * @return FeatureService instance for fluent API access - */ - FeatureService features(); - - /** - * Access unbilled_charges_setting-related operations. - * - * @return UnbilledChargesSettingService instance for fluent API access - */ - UnbilledChargesSettingService unbilledChargesSettings(); - /** * Access alert-related operations. * @@ -642,69 +829,6 @@ public interface ClientMethods { */ AlertService alerts(); - /** - * Access currency-related operations. - * - * @return CurrencyService instance for fluent API access - */ - CurrencyService currencies(); - - /** - * Access event-related operations. - * - * @return EventService instance for fluent API access - */ - EventService events(); - - /** - * Access usage_file-related operations. - * - * @return UsageFileService instance for fluent API access - */ - UsageFileService usageFiles(); - - /** - * Access non_subscription-related operations. - * - * @return NonSubscriptionService instance for fluent API access - */ - NonSubscriptionService nonSubscriptions(); - - /** - * Access resource_migration-related operations. - * - * @return ResourceMigrationService instance for fluent API access - */ - ResourceMigrationService resourceMigrations(); - - /** - * Access product-related operations. - * - * @return ProductService instance for fluent API access - */ - ProductService products(); - - /** - * Access coupon_code-related operations. - * - * @return CouponCodeService instance for fluent API access - */ - CouponCodeService couponCodes(); - - /** - * Access address-related operations. - * - * @return AddressService instance for fluent API access - */ - AddressService addresses(); - - /** - * Access coupon-related operations. - * - * @return CouponService instance for fluent API access - */ - CouponService coupons(); - /** * Access portal_session-related operations. * @@ -712,13 +836,6 @@ public interface ClientMethods { */ PortalSessionService portalSessions(); - /** - * Access item_price-related operations. - * - * @return ItemPriceService instance for fluent API access - */ - ItemPriceService itemPrices(); - /** * Access credit_unit-related operations. * @@ -726,13 +843,6 @@ public interface ClientMethods { */ CreditUnitService creditUnits(); - /** - * Access offer_fulfillment-related operations. - * - * @return OfferFulfillmentService instance for fluent API access - */ - OfferFulfillmentService offerFulfillments(); - /** * Access hosted_page-related operations. * @@ -747,13 +857,6 @@ public interface ClientMethods { */ PurchaseService purchases(); - /** - * Access payment_voucher-related operations. - * - * @return PaymentVoucherService instance for fluent API access - */ - PaymentVoucherService paymentVouchers(); - /** * Access item_family-related operations. * @@ -768,27 +871,6 @@ public interface ClientMethods { */ SubscriptionEntitlementService subscriptionEntitlements(); - /** - * Access third_party_entity_mapping-related operations. - * - * @return ThirdPartyEntityMappingService instance for fluent API access - */ - ThirdPartyEntityMappingService thirdPartyEntityMappings(); - - /** - * Access vaulted_payment_method-related operations. - * - * @return VaultedPaymentMethodService instance for fluent API access - */ - VaultedPaymentMethodService vaultedPaymentMethods(); - - /** - * Access usage_charge-related operations. - * - * @return UsageChargeService instance for fluent API access - */ - UsageChargeService usageCharges(); - /** * Access entitlement_override-related operations. * @@ -796,20 +878,6 @@ public interface ClientMethods { */ EntitlementOverrideService entitlementOverrides(); - /** - * Access third_party_configuration-related operations. - * - * @return ThirdPartyConfigurationService instance for fluent API access - */ - ThirdPartyConfigurationService thirdPartyConfigurations(); - - /** - * Access unbilled_charge-related operations. - * - * @return UnbilledChargeService instance for fluent API access - */ - UnbilledChargeService unbilledCharges(); - /** * Access comment-related operations. * @@ -824,20 +892,6 @@ public interface ClientMethods { */ InvoiceService invoices(); - /** - * Access transaction-related operations. - * - * @return TransactionService instance for fluent API access - */ - TransactionService transactions(); - - /** - * Access third_party_sync_detail-related operations. - * - * @return ThirdPartySyncDetailService instance for fluent API access - */ - ThirdPartySyncDetailService thirdPartySyncDetails(); - /** * Access customer-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 79dcf2b7e..328d0b6d3 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -4,50 +4,126 @@ import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.services.QuoteEntitlementService; - import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.services.TimeMachineService; - import com.chargebee.v4.services.BusinessEntityService; import com.chargebee.v4.services.OfferEventService; import com.chargebee.v4.services.PromotionalGrantService; -import com.chargebee.v4.services.InAppSubscriptionService; - import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.services.CreditNoteService; - -import com.chargebee.v4.services.CouponSetService; - import com.chargebee.v4.services.LedgerAccountBalanceService; import com.chargebee.v4.services.QuoteService; +import com.chargebee.v4.services.EstimateService; + +import com.chargebee.v4.services.PaymentSourceService; + +import com.chargebee.v4.services.PlanService; + +import com.chargebee.v4.services.OrderService; + +import com.chargebee.v4.services.ItemService; + +import com.chargebee.v4.services.RampService; + +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; + +import com.chargebee.v4.services.DifferentialPriceService; + +import com.chargebee.v4.services.AdditionalBillingLogiqService; + +import com.chargebee.v4.services.SiteMigrationDetailService; + +import com.chargebee.v4.services.PaymentScheduleSchemeService; + +import com.chargebee.v4.services.CardService; + +import com.chargebee.v4.services.FullExportService; + +import com.chargebee.v4.services.VirtualBankAccountService; + +import com.chargebee.v4.services.EmailLogService; + +import com.chargebee.v4.services.PricingPageSessionService; + +import com.chargebee.v4.services.SubscriptionService; + +import com.chargebee.v4.services.PromotionalCreditService; + +import com.chargebee.v4.services.BrandConfigurationService; + +import com.chargebee.v4.services.FeatureService; + +import com.chargebee.v4.services.UnbilledChargesSettingService; + +import com.chargebee.v4.services.CurrencyService; + +import com.chargebee.v4.services.EventService; + +import com.chargebee.v4.services.UsageFileService; + +import com.chargebee.v4.services.NonSubscriptionService; + +import com.chargebee.v4.services.DisputeService; + +import com.chargebee.v4.services.ResourceMigrationService; + +import com.chargebee.v4.services.ProductService; + +import com.chargebee.v4.services.CouponCodeService; + +import com.chargebee.v4.services.AddressService; + +import com.chargebee.v4.services.CouponService; + +import com.chargebee.v4.services.ItemPriceService; + +import com.chargebee.v4.services.OfferFulfillmentService; + +import com.chargebee.v4.services.PaymentVoucherService; + +import com.chargebee.v4.services.ThirdPartyEntityMappingService; + +import com.chargebee.v4.services.VaultedPaymentMethodService; + +import com.chargebee.v4.services.UsageChargeService; + +import com.chargebee.v4.services.ThirdPartyConfigurationService; + +import com.chargebee.v4.services.UnbilledChargeService; + +import com.chargebee.v4.services.TransactionService; + +import com.chargebee.v4.services.ThirdPartySyncDetailService; + +import com.chargebee.v4.services.EinvoiceService; + +import com.chargebee.v4.services.QuoteEntitlementService; + +import com.chargebee.v4.services.TimeMachineService; + +import com.chargebee.v4.services.InAppSubscriptionService; + +import com.chargebee.v4.services.CreditNoteService; + +import com.chargebee.v4.services.CouponSetService; + import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.services.EstimateService; +import com.chargebee.v4.services.BusinessRuleService; import com.chargebee.v4.services.VariantService; import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.services.PaymentSourceService; - import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.services.PlanService; - import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.services.OrderService; - -import com.chargebee.v4.services.ItemService; - import com.chargebee.v4.services.CustomerEntitlementService; import com.chargebee.v4.services.PersonalizedOfferService; @@ -58,32 +134,20 @@ import com.chargebee.v4.services.MeterService; -import com.chargebee.v4.services.RampService; - -import com.chargebee.v4.services.OmnichannelOneTimeOrderService; - -import com.chargebee.v4.services.DifferentialPriceService; - import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.services.AdditionalBillingLogiqService; - import com.chargebee.v4.services.LedgerOperationService; +import com.chargebee.v4.services.PaymentScheduleService; + import com.chargebee.v4.services.UsageSummaryService; import com.chargebee.v4.services.AlertStatusService; import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.services.SiteMigrationDetailService; - import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.services.PaymentScheduleSchemeService; - -import com.chargebee.v4.services.CardService; - import com.chargebee.v4.services.AttachedItemService; import com.chargebee.v4.services.UsageEventService; @@ -92,9 +156,7 @@ import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.services.FullExportService; - -import com.chargebee.v4.services.VirtualBankAccountService; +import com.chargebee.v4.services.BusinessRulesetService; import com.chargebee.v4.services.GrantBlockService; @@ -104,166 +166,326 @@ import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.services.PricingPageSessionService; - import com.chargebee.v4.services.Pc2MigrationItemPriceService; import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.services.SubscriptionService; - import com.chargebee.v4.services.MediaService; import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.services.PromotionalCreditService; +import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.services.BrandConfigurationService; +import com.chargebee.v4.services.AlertService; -import com.chargebee.v4.services.WebhookEndpointService; +import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.services.FeatureService; +import com.chargebee.v4.services.CreditUnitService; -import com.chargebee.v4.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.HostedPageService; -import com.chargebee.v4.services.AlertService; +import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.services.CurrencyService; +import com.chargebee.v4.services.ItemFamilyService; -import com.chargebee.v4.services.EventService; +import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.services.UsageFileService; +import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.services.NonSubscriptionService; +import com.chargebee.v4.services.CommentService; -import com.chargebee.v4.services.ResourceMigrationService; +import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.services.ProductService; +import com.chargebee.v4.services.CustomerService; -import com.chargebee.v4.services.CouponCodeService; +import com.chargebee.v4.services.ItemEntitlementService; -import com.chargebee.v4.services.AddressService; +/** + * Auto-generated implementation of ClientMethods interface. This class provides the actual service + * method implementations that delegate to ServiceRegistry. + */ +abstract class ClientMethodsImpl implements ClientMethods { -import com.chargebee.v4.services.CouponService; + protected abstract ServiceRegistry getServiceRegistry(); -import com.chargebee.v4.services.PortalSessionService; + @Override + public GiftService gifts() { + return getServiceRegistry().gifts(); + } -import com.chargebee.v4.services.ItemPriceService; + @Override + public CsvTaxRuleService csvTaxRules() { + return getServiceRegistry().csvTaxRules(); + } -import com.chargebee.v4.services.CreditUnitService; + @Override + public UsageService usages() { + return getServiceRegistry().usages(); + } -import com.chargebee.v4.services.OfferFulfillmentService; + @Override + public BusinessEntityService businessEntities() { + return getServiceRegistry().businessEntities(); + } -import com.chargebee.v4.services.HostedPageService; + @Override + public OfferEventService offerEvents() { + return getServiceRegistry().offerEvents(); + } -import com.chargebee.v4.services.PurchaseService; + @Override + public PromotionalGrantService promotionalGrants() { + return getServiceRegistry().promotionalGrants(); + } -import com.chargebee.v4.services.PaymentVoucherService; + @Override + public Pc2MigrationService pc2Migrations() { + return getServiceRegistry().pc2Migrations(); + } -import com.chargebee.v4.services.ItemFamilyService; + @Override + public LedgerAccountBalanceService ledgerAccountBalances() { + return getServiceRegistry().ledgerAccountBalances(); + } -import com.chargebee.v4.services.SubscriptionEntitlementService; + @Override + public QuoteService quotes() { + return getServiceRegistry().quotes(); + } -import com.chargebee.v4.services.ThirdPartyEntityMappingService; + @Override + public EstimateService estimates() { + return getServiceRegistry().estimates(); + } -import com.chargebee.v4.services.VaultedPaymentMethodService; + @Override + public PaymentSourceService paymentSources() { + return getServiceRegistry().paymentSources(); + } -import com.chargebee.v4.services.UsageChargeService; + @Override + public PlanService plans() { + return getServiceRegistry().plans(); + } -import com.chargebee.v4.services.EntitlementOverrideService; + @Override + public OrderService orders() { + return getServiceRegistry().orders(); + } -import com.chargebee.v4.services.ThirdPartyConfigurationService; + @Override + public ItemService items() { + return getServiceRegistry().items(); + } -import com.chargebee.v4.services.UnbilledChargeService; + @Override + public RampService ramps() { + return getServiceRegistry().ramps(); + } -import com.chargebee.v4.services.CommentService; + @Override + public OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { + return getServiceRegistry().omnichannelOneTimeOrders(); + } -import com.chargebee.v4.services.InvoiceService; + @Override + public DifferentialPriceService differentialPrices() { + return getServiceRegistry().differentialPrices(); + } -import com.chargebee.v4.services.TransactionService; + @Override + public AdditionalBillingLogiqService additionalBillingLogiqs() { + return getServiceRegistry().additionalBillingLogiqs(); + } -import com.chargebee.v4.services.ThirdPartySyncDetailService; + @Override + public SiteMigrationDetailService siteMigrationDetails() { + return getServiceRegistry().siteMigrationDetails(); + } -import com.chargebee.v4.services.CustomerService; + @Override + public PaymentScheduleSchemeService paymentScheduleSchemes() { + return getServiceRegistry().paymentScheduleSchemes(); + } -import com.chargebee.v4.services.ItemEntitlementService; + @Override + public CardService cards() { + return getServiceRegistry().cards(); + } -/** - * Auto-generated implementation of ClientMethods interface. This class provides the actual service - * method implementations that delegate to ServiceRegistry. - */ -abstract class ClientMethodsImpl implements ClientMethods { + @Override + public FullExportService fullExports() { + return getServiceRegistry().fullExports(); + } + + @Override + public VirtualBankAccountService virtualBankAccounts() { + return getServiceRegistry().virtualBankAccounts(); + } + + @Override + public EmailLogService emailLogs() { + return getServiceRegistry().emailLogs(); + } + + @Override + public PricingPageSessionService pricingPageSessions() { + return getServiceRegistry().pricingPageSessions(); + } + + @Override + public SubscriptionService subscriptions() { + return getServiceRegistry().subscriptions(); + } + + @Override + public PromotionalCreditService promotionalCredits() { + return getServiceRegistry().promotionalCredits(); + } + + @Override + public BrandConfigurationService brandConfigurations() { + return getServiceRegistry().brandConfigurations(); + } + + @Override + public FeatureService features() { + return getServiceRegistry().features(); + } + + @Override + public UnbilledChargesSettingService unbilledChargesSettings() { + return getServiceRegistry().unbilledChargesSettings(); + } + + @Override + public CurrencyService currencies() { + return getServiceRegistry().currencies(); + } + + @Override + public EventService events() { + return getServiceRegistry().events(); + } + + @Override + public UsageFileService usageFiles() { + return getServiceRegistry().usageFiles(); + } + + @Override + public NonSubscriptionService nonSubscriptions() { + return getServiceRegistry().nonSubscriptions(); + } + + @Override + public DisputeService disputes() { + return getServiceRegistry().disputes(); + } + + @Override + public ResourceMigrationService resourceMigrations() { + return getServiceRegistry().resourceMigrations(); + } + + @Override + public ProductService products() { + return getServiceRegistry().products(); + } + + @Override + public CouponCodeService couponCodes() { + return getServiceRegistry().couponCodes(); + } + + @Override + public AddressService addresses() { + return getServiceRegistry().addresses(); + } + + @Override + public CouponService coupons() { + return getServiceRegistry().coupons(); + } - protected abstract ServiceRegistry getServiceRegistry(); + @Override + public ItemPriceService itemPrices() { + return getServiceRegistry().itemPrices(); + } @Override - public GiftService gifts() { - return getServiceRegistry().gifts(); + public OfferFulfillmentService offerFulfillments() { + return getServiceRegistry().offerFulfillments(); } @Override - public CsvTaxRuleService csvTaxRules() { - return getServiceRegistry().csvTaxRules(); + public PaymentVoucherService paymentVouchers() { + return getServiceRegistry().paymentVouchers(); } @Override - public QuoteEntitlementService quoteEntitlements() { - return getServiceRegistry().quoteEntitlements(); + public ThirdPartyEntityMappingService thirdPartyEntityMappings() { + return getServiceRegistry().thirdPartyEntityMappings(); } @Override - public UsageService usages() { - return getServiceRegistry().usages(); + public VaultedPaymentMethodService vaultedPaymentMethods() { + return getServiceRegistry().vaultedPaymentMethods(); } @Override - public TimeMachineService timeMachines() { - return getServiceRegistry().timeMachines(); + public UsageChargeService usageCharges() { + return getServiceRegistry().usageCharges(); } @Override - public BusinessEntityService businessEntities() { - return getServiceRegistry().businessEntities(); + public ThirdPartyConfigurationService thirdPartyConfigurations() { + return getServiceRegistry().thirdPartyConfigurations(); } @Override - public OfferEventService offerEvents() { - return getServiceRegistry().offerEvents(); + public UnbilledChargeService unbilledCharges() { + return getServiceRegistry().unbilledCharges(); } @Override - public PromotionalGrantService promotionalGrants() { - return getServiceRegistry().promotionalGrants(); + public TransactionService transactions() { + return getServiceRegistry().transactions(); } @Override - public InAppSubscriptionService inAppSubscriptions() { - return getServiceRegistry().inAppSubscriptions(); + public ThirdPartySyncDetailService thirdPartySyncDetails() { + return getServiceRegistry().thirdPartySyncDetails(); } @Override - public Pc2MigrationService pc2Migrations() { - return getServiceRegistry().pc2Migrations(); + public EinvoiceService einvoices() { + return getServiceRegistry().einvoices(); } @Override - public CreditNoteService creditNotes() { - return getServiceRegistry().creditNotes(); + public QuoteEntitlementService quoteEntitlements() { + return getServiceRegistry().quoteEntitlements(); } @Override - public CouponSetService couponSets() { - return getServiceRegistry().couponSets(); + public TimeMachineService timeMachines() { + return getServiceRegistry().timeMachines(); } @Override - public LedgerAccountBalanceService ledgerAccountBalances() { - return getServiceRegistry().ledgerAccountBalances(); + public InAppSubscriptionService inAppSubscriptions() { + return getServiceRegistry().inAppSubscriptions(); } @Override - public QuoteService quotes() { - return getServiceRegistry().quotes(); + public CreditNoteService creditNotes() { + return getServiceRegistry().creditNotes(); + } + + @Override + public CouponSetService couponSets() { + return getServiceRegistry().couponSets(); } @Override @@ -272,8 +494,8 @@ public Pc2MigrationItemService pc2MigrationItems() { } @Override - public EstimateService estimates() { - return getServiceRegistry().estimates(); + public BusinessRuleService businessRules() { + return getServiceRegistry().businessRules(); } @Override @@ -286,36 +508,16 @@ public Pc2MigrationItemFamilyService pc2MigrationItemFamilies() { return getServiceRegistry().pc2MigrationItemFamilies(); } - @Override - public PaymentSourceService paymentSources() { - return getServiceRegistry().paymentSources(); - } - @Override public RecordedPurchaseService recordedPurchases() { return getServiceRegistry().recordedPurchases(); } - @Override - public PlanService plans() { - return getServiceRegistry().plans(); - } - @Override public ExportService exports() { return getServiceRegistry().exports(); } - @Override - public OrderService orders() { - return getServiceRegistry().orders(); - } - - @Override - public ItemService items() { - return getServiceRegistry().items(); - } - @Override public CustomerEntitlementService customerEntitlements() { return getServiceRegistry().customerEntitlements(); @@ -341,34 +543,19 @@ public MeterService meters() { return getServiceRegistry().meters(); } - @Override - public RampService ramps() { - return getServiceRegistry().ramps(); - } - - @Override - public OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { - return getServiceRegistry().omnichannelOneTimeOrders(); - } - - @Override - public DifferentialPriceService differentialPrices() { - return getServiceRegistry().differentialPrices(); - } - @Override public EntitlementService entitlements() { return getServiceRegistry().entitlements(); } @Override - public AdditionalBillingLogiqService additionalBillingLogiqs() { - return getServiceRegistry().additionalBillingLogiqs(); + public LedgerOperationService ledgerOperations() { + return getServiceRegistry().ledgerOperations(); } @Override - public LedgerOperationService ledgerOperations() { - return getServiceRegistry().ledgerOperations(); + public PaymentScheduleService paymentSchedules() { + return getServiceRegistry().paymentSchedules(); } @Override @@ -386,26 +573,11 @@ public SubscriptionSettingService subscriptionSettings() { return getServiceRegistry().subscriptionSettings(); } - @Override - public SiteMigrationDetailService siteMigrationDetails() { - return getServiceRegistry().siteMigrationDetails(); - } - @Override public PaymentIntentService paymentIntents() { return getServiceRegistry().paymentIntents(); } - @Override - public PaymentScheduleSchemeService paymentScheduleSchemes() { - return getServiceRegistry().paymentScheduleSchemes(); - } - - @Override - public CardService cards() { - return getServiceRegistry().cards(); - } - @Override public AttachedItemService attachedItems() { return getServiceRegistry().attachedItems(); @@ -427,13 +599,8 @@ public PriceVariantService priceVariants() { } @Override - public FullExportService fullExports() { - return getServiceRegistry().fullExports(); - } - - @Override - public VirtualBankAccountService virtualBankAccounts() { - return getServiceRegistry().virtualBankAccounts(); + public BusinessRulesetService businessRulesets() { + return getServiceRegistry().businessRulesets(); } @Override @@ -456,11 +623,6 @@ public ConfigurationService configurations() { return getServiceRegistry().configurations(); } - @Override - public PricingPageSessionService pricingPageSessions() { - return getServiceRegistry().pricingPageSessions(); - } - @Override public Pc2MigrationItemPriceService pc2MigrationItemPrices() { return getServiceRegistry().pc2MigrationItemPrices(); @@ -471,11 +633,6 @@ public RuleService rules() { return getServiceRegistry().rules(); } - @Override - public SubscriptionService subscriptions() { - return getServiceRegistry().subscriptions(); - } - @Override public MediaService medias() { return getServiceRegistry().medias(); @@ -486,101 +643,26 @@ public BusinessProfileService businessProfiles() { return getServiceRegistry().businessProfiles(); } - @Override - public PromotionalCreditService promotionalCredits() { - return getServiceRegistry().promotionalCredits(); - } - - @Override - public BrandConfigurationService brandConfigurations() { - return getServiceRegistry().brandConfigurations(); - } - @Override public WebhookEndpointService webhookEndpoints() { return getServiceRegistry().webhookEndpoints(); } - @Override - public FeatureService features() { - return getServiceRegistry().features(); - } - - @Override - public UnbilledChargesSettingService unbilledChargesSettings() { - return getServiceRegistry().unbilledChargesSettings(); - } - @Override public AlertService alerts() { return getServiceRegistry().alerts(); } - @Override - public CurrencyService currencies() { - return getServiceRegistry().currencies(); - } - - @Override - public EventService events() { - return getServiceRegistry().events(); - } - - @Override - public UsageFileService usageFiles() { - return getServiceRegistry().usageFiles(); - } - - @Override - public NonSubscriptionService nonSubscriptions() { - return getServiceRegistry().nonSubscriptions(); - } - - @Override - public ResourceMigrationService resourceMigrations() { - return getServiceRegistry().resourceMigrations(); - } - - @Override - public ProductService products() { - return getServiceRegistry().products(); - } - - @Override - public CouponCodeService couponCodes() { - return getServiceRegistry().couponCodes(); - } - - @Override - public AddressService addresses() { - return getServiceRegistry().addresses(); - } - - @Override - public CouponService coupons() { - return getServiceRegistry().coupons(); - } - @Override public PortalSessionService portalSessions() { return getServiceRegistry().portalSessions(); } - @Override - public ItemPriceService itemPrices() { - return getServiceRegistry().itemPrices(); - } - @Override public CreditUnitService creditUnits() { return getServiceRegistry().creditUnits(); } - @Override - public OfferFulfillmentService offerFulfillments() { - return getServiceRegistry().offerFulfillments(); - } - @Override public HostedPageService hostedPages() { return getServiceRegistry().hostedPages(); @@ -591,11 +673,6 @@ public PurchaseService purchases() { return getServiceRegistry().purchases(); } - @Override - public PaymentVoucherService paymentVouchers() { - return getServiceRegistry().paymentVouchers(); - } - @Override public ItemFamilyService itemFamilies() { return getServiceRegistry().itemFamilies(); @@ -606,36 +683,11 @@ public SubscriptionEntitlementService subscriptionEntitlements() { return getServiceRegistry().subscriptionEntitlements(); } - @Override - public ThirdPartyEntityMappingService thirdPartyEntityMappings() { - return getServiceRegistry().thirdPartyEntityMappings(); - } - - @Override - public VaultedPaymentMethodService vaultedPaymentMethods() { - return getServiceRegistry().vaultedPaymentMethods(); - } - - @Override - public UsageChargeService usageCharges() { - return getServiceRegistry().usageCharges(); - } - @Override public EntitlementOverrideService entitlementOverrides() { return getServiceRegistry().entitlementOverrides(); } - @Override - public ThirdPartyConfigurationService thirdPartyConfigurations() { - return getServiceRegistry().thirdPartyConfigurations(); - } - - @Override - public UnbilledChargeService unbilledCharges() { - return getServiceRegistry().unbilledCharges(); - } - @Override public CommentService comments() { return getServiceRegistry().comments(); @@ -646,16 +698,6 @@ public InvoiceService invoices() { return getServiceRegistry().invoices(); } - @Override - public TransactionService transactions() { - return getServiceRegistry().transactions(); - } - - @Override - public ThirdPartySyncDetailService thirdPartySyncDetails() { - return getServiceRegistry().thirdPartySyncDetails(); - } - @Override public CustomerService customers() { return getServiceRegistry().customers(); diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index 6d315d58a..df2eddf5d 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -4,50 +4,126 @@ import com.chargebee.v4.services.CsvTaxRuleService; -import com.chargebee.v4.services.QuoteEntitlementService; - import com.chargebee.v4.services.UsageService; -import com.chargebee.v4.services.TimeMachineService; - import com.chargebee.v4.services.BusinessEntityService; import com.chargebee.v4.services.OfferEventService; import com.chargebee.v4.services.PromotionalGrantService; -import com.chargebee.v4.services.InAppSubscriptionService; - import com.chargebee.v4.services.Pc2MigrationService; -import com.chargebee.v4.services.CreditNoteService; - -import com.chargebee.v4.services.CouponSetService; - import com.chargebee.v4.services.LedgerAccountBalanceService; import com.chargebee.v4.services.QuoteService; +import com.chargebee.v4.services.EstimateService; + +import com.chargebee.v4.services.PaymentSourceService; + +import com.chargebee.v4.services.PlanService; + +import com.chargebee.v4.services.OrderService; + +import com.chargebee.v4.services.ItemService; + +import com.chargebee.v4.services.RampService; + +import com.chargebee.v4.services.OmnichannelOneTimeOrderService; + +import com.chargebee.v4.services.DifferentialPriceService; + +import com.chargebee.v4.services.AdditionalBillingLogiqService; + +import com.chargebee.v4.services.SiteMigrationDetailService; + +import com.chargebee.v4.services.PaymentScheduleSchemeService; + +import com.chargebee.v4.services.CardService; + +import com.chargebee.v4.services.FullExportService; + +import com.chargebee.v4.services.VirtualBankAccountService; + +import com.chargebee.v4.services.EmailLogService; + +import com.chargebee.v4.services.PricingPageSessionService; + +import com.chargebee.v4.services.SubscriptionService; + +import com.chargebee.v4.services.PromotionalCreditService; + +import com.chargebee.v4.services.BrandConfigurationService; + +import com.chargebee.v4.services.FeatureService; + +import com.chargebee.v4.services.UnbilledChargesSettingService; + +import com.chargebee.v4.services.CurrencyService; + +import com.chargebee.v4.services.EventService; + +import com.chargebee.v4.services.UsageFileService; + +import com.chargebee.v4.services.NonSubscriptionService; + +import com.chargebee.v4.services.DisputeService; + +import com.chargebee.v4.services.ResourceMigrationService; + +import com.chargebee.v4.services.ProductService; + +import com.chargebee.v4.services.CouponCodeService; + +import com.chargebee.v4.services.AddressService; + +import com.chargebee.v4.services.CouponService; + +import com.chargebee.v4.services.ItemPriceService; + +import com.chargebee.v4.services.OfferFulfillmentService; + +import com.chargebee.v4.services.PaymentVoucherService; + +import com.chargebee.v4.services.ThirdPartyEntityMappingService; + +import com.chargebee.v4.services.VaultedPaymentMethodService; + +import com.chargebee.v4.services.UsageChargeService; + +import com.chargebee.v4.services.ThirdPartyConfigurationService; + +import com.chargebee.v4.services.UnbilledChargeService; + +import com.chargebee.v4.services.TransactionService; + +import com.chargebee.v4.services.ThirdPartySyncDetailService; + +import com.chargebee.v4.services.EinvoiceService; + +import com.chargebee.v4.services.QuoteEntitlementService; + +import com.chargebee.v4.services.TimeMachineService; + +import com.chargebee.v4.services.InAppSubscriptionService; + +import com.chargebee.v4.services.CreditNoteService; + +import com.chargebee.v4.services.CouponSetService; + import com.chargebee.v4.services.Pc2MigrationItemService; -import com.chargebee.v4.services.EstimateService; +import com.chargebee.v4.services.BusinessRuleService; import com.chargebee.v4.services.VariantService; import com.chargebee.v4.services.Pc2MigrationItemFamilyService; -import com.chargebee.v4.services.PaymentSourceService; - import com.chargebee.v4.services.RecordedPurchaseService; -import com.chargebee.v4.services.PlanService; - import com.chargebee.v4.services.ExportService; -import com.chargebee.v4.services.OrderService; - -import com.chargebee.v4.services.ItemService; - import com.chargebee.v4.services.CustomerEntitlementService; import com.chargebee.v4.services.PersonalizedOfferService; @@ -58,32 +134,20 @@ import com.chargebee.v4.services.MeterService; -import com.chargebee.v4.services.RampService; - -import com.chargebee.v4.services.OmnichannelOneTimeOrderService; - -import com.chargebee.v4.services.DifferentialPriceService; - import com.chargebee.v4.services.EntitlementService; -import com.chargebee.v4.services.AdditionalBillingLogiqService; - import com.chargebee.v4.services.LedgerOperationService; +import com.chargebee.v4.services.PaymentScheduleService; + import com.chargebee.v4.services.UsageSummaryService; import com.chargebee.v4.services.AlertStatusService; import com.chargebee.v4.services.SubscriptionSettingService; -import com.chargebee.v4.services.SiteMigrationDetailService; - import com.chargebee.v4.services.PaymentIntentService; -import com.chargebee.v4.services.PaymentScheduleSchemeService; - -import com.chargebee.v4.services.CardService; - import com.chargebee.v4.services.AttachedItemService; import com.chargebee.v4.services.UsageEventService; @@ -92,9 +156,7 @@ import com.chargebee.v4.services.PriceVariantService; -import com.chargebee.v4.services.FullExportService; - -import com.chargebee.v4.services.VirtualBankAccountService; +import com.chargebee.v4.services.BusinessRulesetService; import com.chargebee.v4.services.GrantBlockService; @@ -104,86 +166,36 @@ import com.chargebee.v4.services.ConfigurationService; -import com.chargebee.v4.services.PricingPageSessionService; - import com.chargebee.v4.services.Pc2MigrationItemPriceService; import com.chargebee.v4.services.RuleService; -import com.chargebee.v4.services.SubscriptionService; - import com.chargebee.v4.services.MediaService; import com.chargebee.v4.services.BusinessProfileService; -import com.chargebee.v4.services.PromotionalCreditService; - -import com.chargebee.v4.services.BrandConfigurationService; - import com.chargebee.v4.services.WebhookEndpointService; -import com.chargebee.v4.services.FeatureService; - -import com.chargebee.v4.services.UnbilledChargesSettingService; - import com.chargebee.v4.services.AlertService; -import com.chargebee.v4.services.CurrencyService; - -import com.chargebee.v4.services.EventService; - -import com.chargebee.v4.services.UsageFileService; - -import com.chargebee.v4.services.NonSubscriptionService; - -import com.chargebee.v4.services.ResourceMigrationService; - -import com.chargebee.v4.services.ProductService; - -import com.chargebee.v4.services.CouponCodeService; - -import com.chargebee.v4.services.AddressService; - -import com.chargebee.v4.services.CouponService; - import com.chargebee.v4.services.PortalSessionService; -import com.chargebee.v4.services.ItemPriceService; - import com.chargebee.v4.services.CreditUnitService; -import com.chargebee.v4.services.OfferFulfillmentService; - import com.chargebee.v4.services.HostedPageService; import com.chargebee.v4.services.PurchaseService; -import com.chargebee.v4.services.PaymentVoucherService; - import com.chargebee.v4.services.ItemFamilyService; import com.chargebee.v4.services.SubscriptionEntitlementService; -import com.chargebee.v4.services.ThirdPartyEntityMappingService; - -import com.chargebee.v4.services.VaultedPaymentMethodService; - -import com.chargebee.v4.services.UsageChargeService; - import com.chargebee.v4.services.EntitlementOverrideService; -import com.chargebee.v4.services.ThirdPartyConfigurationService; - -import com.chargebee.v4.services.UnbilledChargeService; - import com.chargebee.v4.services.CommentService; import com.chargebee.v4.services.InvoiceService; -import com.chargebee.v4.services.TransactionService; - -import com.chargebee.v4.services.ThirdPartySyncDetailService; - import com.chargebee.v4.services.CustomerService; import com.chargebee.v4.services.ItemEntitlementService; @@ -199,130 +211,62 @@ final class ServiceRegistry { private volatile CsvTaxRuleService csvTaxRuleService; - private volatile QuoteEntitlementService quoteEntitlementService; - private volatile UsageService usageService; - private volatile TimeMachineService timeMachineService; - private volatile BusinessEntityService businessEntityService; private volatile OfferEventService offerEventService; private volatile PromotionalGrantService promotionalGrantService; - private volatile InAppSubscriptionService inAppSubscriptionService; - private volatile Pc2MigrationService pc2MigrationService; - private volatile CreditNoteService creditNoteService; - - private volatile CouponSetService couponSetService; - private volatile LedgerAccountBalanceService ledgerAccountBalanceService; private volatile QuoteService quoteService; - private volatile Pc2MigrationItemService pc2MigrationItemService; - private volatile EstimateService estimateService; - private volatile VariantService variantService; - - private volatile Pc2MigrationItemFamilyService pc2MigrationItemFamilyService; - private volatile PaymentSourceService paymentSourceService; - private volatile RecordedPurchaseService recordedPurchaseService; - private volatile PlanService planService; - private volatile ExportService exportService; - private volatile OrderService orderService; private volatile ItemService itemService; - private volatile CustomerEntitlementService customerEntitlementService; - - private volatile PersonalizedOfferService personalizedOfferService; - - private volatile OmnichannelSubscriptionService omnichannelSubscriptionService; - - private volatile OmnichannelSubscriptionItemService omnichannelSubscriptionItemService; - - private volatile MeterService meterService; - private volatile RampService rampService; private volatile OmnichannelOneTimeOrderService omnichannelOneTimeOrderService; private volatile DifferentialPriceService differentialPriceService; - private volatile EntitlementService entitlementService; - private volatile AdditionalBillingLogiqService additionalBillingLogiqService; - private volatile LedgerOperationService ledgerOperationService; - - private volatile UsageSummaryService usageSummaryService; - - private volatile AlertStatusService alertStatusService; - - private volatile SubscriptionSettingService subscriptionSettingService; - private volatile SiteMigrationDetailService siteMigrationDetailService; - private volatile PaymentIntentService paymentIntentService; - private volatile PaymentScheduleSchemeService paymentScheduleSchemeService; private volatile CardService cardService; - private volatile AttachedItemService attachedItemService; - - private volatile UsageEventService usageEventService; - - private volatile MeteredFeatureService meteredFeatureService; - - private volatile PriceVariantService priceVariantService; - private volatile FullExportService fullExportService; private volatile VirtualBankAccountService virtualBankAccountService; - private volatile GrantBlockService grantBlockService; - - private volatile AddonService addonService; - - private volatile TpSiteUserService tpSiteUserService; - - private volatile ConfigurationService configurationService; + private volatile EmailLogService emailLogService; private volatile PricingPageSessionService pricingPageSessionService; - private volatile Pc2MigrationItemPriceService pc2MigrationItemPriceService; - - private volatile RuleService ruleService; - private volatile SubscriptionService subscriptionService; - private volatile MediaService mediaService; - - private volatile BusinessProfileService businessProfileService; - private volatile PromotionalCreditService promotionalCreditService; private volatile BrandConfigurationService brandConfigurationService; - private volatile WebhookEndpointService webhookEndpointService; - private volatile FeatureService featureService; private volatile UnbilledChargesSettingService unbilledChargesSettingService; - private volatile AlertService alertService; - private volatile CurrencyService currencyService; private volatile EventService eventService; @@ -331,6 +275,8 @@ final class ServiceRegistry { private volatile NonSubscriptionService nonSubscriptionService; + private volatile DisputeService disputeService; + private volatile ResourceMigrationService resourceMigrationService; private volatile ProductService productService; @@ -341,44 +287,122 @@ final class ServiceRegistry { private volatile CouponService couponService; - private volatile PortalSessionService portalSessionService; - private volatile ItemPriceService itemPriceService; - private volatile CreditUnitService creditUnitService; - private volatile OfferFulfillmentService offerFulfillmentService; - private volatile HostedPageService hostedPageService; - - private volatile PurchaseService purchaseService; - private volatile PaymentVoucherService paymentVoucherService; - private volatile ItemFamilyService itemFamilyService; - - private volatile SubscriptionEntitlementService subscriptionEntitlementService; - private volatile ThirdPartyEntityMappingService thirdPartyEntityMappingService; private volatile VaultedPaymentMethodService vaultedPaymentMethodService; private volatile UsageChargeService usageChargeService; - private volatile EntitlementOverrideService entitlementOverrideService; - private volatile ThirdPartyConfigurationService thirdPartyConfigurationService; private volatile UnbilledChargeService unbilledChargeService; - private volatile CommentService commentService; - - private volatile InvoiceService invoiceService; - private volatile TransactionService transactionService; private volatile ThirdPartySyncDetailService thirdPartySyncDetailService; + private volatile EinvoiceService einvoiceService; + + private volatile QuoteEntitlementService quoteEntitlementService; + + private volatile TimeMachineService timeMachineService; + + private volatile InAppSubscriptionService inAppSubscriptionService; + + private volatile CreditNoteService creditNoteService; + + private volatile CouponSetService couponSetService; + + private volatile Pc2MigrationItemService pc2MigrationItemService; + + private volatile BusinessRuleService businessRuleService; + + private volatile VariantService variantService; + + private volatile Pc2MigrationItemFamilyService pc2MigrationItemFamilyService; + + private volatile RecordedPurchaseService recordedPurchaseService; + + private volatile ExportService exportService; + + private volatile CustomerEntitlementService customerEntitlementService; + + private volatile PersonalizedOfferService personalizedOfferService; + + private volatile OmnichannelSubscriptionService omnichannelSubscriptionService; + + private volatile OmnichannelSubscriptionItemService omnichannelSubscriptionItemService; + + private volatile MeterService meterService; + + private volatile EntitlementService entitlementService; + + private volatile LedgerOperationService ledgerOperationService; + + private volatile PaymentScheduleService paymentScheduleService; + + private volatile UsageSummaryService usageSummaryService; + + private volatile AlertStatusService alertStatusService; + + private volatile SubscriptionSettingService subscriptionSettingService; + + private volatile PaymentIntentService paymentIntentService; + + private volatile AttachedItemService attachedItemService; + + private volatile UsageEventService usageEventService; + + private volatile MeteredFeatureService meteredFeatureService; + + private volatile PriceVariantService priceVariantService; + + private volatile BusinessRulesetService businessRulesetService; + + private volatile GrantBlockService grantBlockService; + + private volatile AddonService addonService; + + private volatile TpSiteUserService tpSiteUserService; + + private volatile ConfigurationService configurationService; + + private volatile Pc2MigrationItemPriceService pc2MigrationItemPriceService; + + private volatile RuleService ruleService; + + private volatile MediaService mediaService; + + private volatile BusinessProfileService businessProfileService; + + private volatile WebhookEndpointService webhookEndpointService; + + private volatile AlertService alertService; + + private volatile PortalSessionService portalSessionService; + + private volatile CreditUnitService creditUnitService; + + private volatile HostedPageService hostedPageService; + + private volatile PurchaseService purchaseService; + + private volatile ItemFamilyService itemFamilyService; + + private volatile SubscriptionEntitlementService subscriptionEntitlementService; + + private volatile EntitlementOverrideService entitlementOverrideService; + + private volatile CommentService commentService; + + private volatile InvoiceService invoiceService; + private volatile CustomerService customerService; private volatile ItemEntitlementService itemEntitlementService; @@ -417,21 +441,6 @@ CsvTaxRuleService csvTaxRules() { return csvTaxRuleService; } - /** - * Get or create the QuoteEntitlementService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - QuoteEntitlementService quoteEntitlements() { - if (quoteEntitlementService == null) { - synchronized (this) { - if (quoteEntitlementService == null) { - quoteEntitlementService = new QuoteEntitlementService(client); - } - } - } - return quoteEntitlementService; - } - /** * Get or create the UsageService instance. Thread-safe lazy initialization using double-checked * locking. @@ -447,21 +456,6 @@ UsageService usages() { return usageService; } - /** - * Get or create the TimeMachineService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - TimeMachineService timeMachines() { - if (timeMachineService == null) { - synchronized (this) { - if (timeMachineService == null) { - timeMachineService = new TimeMachineService(client); - } - } - } - return timeMachineService; - } - /** * Get or create the BusinessEntityService instance. Thread-safe lazy initialization using * double-checked locking. @@ -507,21 +501,6 @@ PromotionalGrantService promotionalGrants() { return promotionalGrantService; } - /** - * Get or create the InAppSubscriptionService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - InAppSubscriptionService inAppSubscriptions() { - if (inAppSubscriptionService == null) { - synchronized (this) { - if (inAppSubscriptionService == null) { - inAppSubscriptionService = new InAppSubscriptionService(client); - } - } - } - return inAppSubscriptionService; - } - /** * Get or create the Pc2MigrationService instance. Thread-safe lazy initialization using * double-checked locking. @@ -537,36 +516,6 @@ Pc2MigrationService pc2Migrations() { return pc2MigrationService; } - /** - * Get or create the CreditNoteService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - CreditNoteService creditNotes() { - if (creditNoteService == null) { - synchronized (this) { - if (creditNoteService == null) { - creditNoteService = new CreditNoteService(client); - } - } - } - return creditNoteService; - } - - /** - * Get or create the CouponSetService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - CouponSetService couponSets() { - if (couponSetService == null) { - synchronized (this) { - if (couponSetService == null) { - couponSetService = new CouponSetService(client); - } - } - } - return couponSetService; - } - /** * Get or create the LedgerAccountBalanceService instance. Thread-safe lazy initialization using * double-checked locking. @@ -597,21 +546,6 @@ QuoteService quotes() { return quoteService; } - /** - * Get or create the Pc2MigrationItemService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - Pc2MigrationItemService pc2MigrationItems() { - if (pc2MigrationItemService == null) { - synchronized (this) { - if (pc2MigrationItemService == null) { - pc2MigrationItemService = new Pc2MigrationItemService(client); - } - } - } - return pc2MigrationItemService; - } - /** * Get or create the EstimateService instance. Thread-safe lazy initialization using * double-checked locking. @@ -627,36 +561,6 @@ EstimateService estimates() { return estimateService; } - /** - * Get or create the VariantService instance. Thread-safe lazy initialization using double-checked - * locking. - */ - VariantService variants() { - if (variantService == null) { - synchronized (this) { - if (variantService == null) { - variantService = new VariantService(client); - } - } - } - return variantService; - } - - /** - * Get or create the Pc2MigrationItemFamilyService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - Pc2MigrationItemFamilyService pc2MigrationItemFamilies() { - if (pc2MigrationItemFamilyService == null) { - synchronized (this) { - if (pc2MigrationItemFamilyService == null) { - pc2MigrationItemFamilyService = new Pc2MigrationItemFamilyService(client); - } - } - } - return pc2MigrationItemFamilyService; - } - /** * Get or create the PaymentSourceService instance. Thread-safe lazy initialization using * double-checked locking. @@ -672,21 +576,6 @@ PaymentSourceService paymentSources() { return paymentSourceService; } - /** - * Get or create the RecordedPurchaseService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - RecordedPurchaseService recordedPurchases() { - if (recordedPurchaseService == null) { - synchronized (this) { - if (recordedPurchaseService == null) { - recordedPurchaseService = new RecordedPurchaseService(client); - } - } - } - return recordedPurchaseService; - } - /** * Get or create the PlanService instance. Thread-safe lazy initialization using double-checked * locking. @@ -702,21 +591,6 @@ PlanService plans() { return planService; } - /** - * Get or create the ExportService instance. Thread-safe lazy initialization using double-checked - * locking. - */ - ExportService exports() { - if (exportService == null) { - synchronized (this) { - if (exportService == null) { - exportService = new ExportService(client); - } - } - } - return exportService; - } - /** * Get or create the OrderService instance. Thread-safe lazy initialization using double-checked * locking. @@ -748,738 +622,1128 @@ ItemService items() { } /** - * Get or create the CustomerEntitlementService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the RampService instance. Thread-safe lazy initialization using double-checked + * locking. */ - CustomerEntitlementService customerEntitlements() { - if (customerEntitlementService == null) { + RampService ramps() { + if (rampService == null) { synchronized (this) { - if (customerEntitlementService == null) { - customerEntitlementService = new CustomerEntitlementService(client); + if (rampService == null) { + rampService = new RampService(client); } } } - return customerEntitlementService; + return rampService; } /** - * Get or create the PersonalizedOfferService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the OmnichannelOneTimeOrderService instance. Thread-safe lazy initialization + * using double-checked locking. */ - PersonalizedOfferService personalizedOffers() { - if (personalizedOfferService == null) { + OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { + if (omnichannelOneTimeOrderService == null) { synchronized (this) { - if (personalizedOfferService == null) { - personalizedOfferService = new PersonalizedOfferService(client); + if (omnichannelOneTimeOrderService == null) { + omnichannelOneTimeOrderService = new OmnichannelOneTimeOrderService(client); } } } - return personalizedOfferService; + return omnichannelOneTimeOrderService; } /** - * Get or create the OmnichannelSubscriptionService instance. Thread-safe lazy initialization - * using double-checked locking. + * Get or create the DifferentialPriceService instance. Thread-safe lazy initialization using + * double-checked locking. */ - OmnichannelSubscriptionService omnichannelSubscriptions() { - if (omnichannelSubscriptionService == null) { + DifferentialPriceService differentialPrices() { + if (differentialPriceService == null) { synchronized (this) { - if (omnichannelSubscriptionService == null) { - omnichannelSubscriptionService = new OmnichannelSubscriptionService(client); + if (differentialPriceService == null) { + differentialPriceService = new DifferentialPriceService(client); } } } - return omnichannelSubscriptionService; + return differentialPriceService; } /** - * Get or create the OmnichannelSubscriptionItemService instance. Thread-safe lazy initialization - * using double-checked locking. + * Get or create the AdditionalBillingLogiqService instance. Thread-safe lazy initialization using + * double-checked locking. */ - OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { - if (omnichannelSubscriptionItemService == null) { + AdditionalBillingLogiqService additionalBillingLogiqs() { + if (additionalBillingLogiqService == null) { synchronized (this) { - if (omnichannelSubscriptionItemService == null) { - omnichannelSubscriptionItemService = new OmnichannelSubscriptionItemService(client); + if (additionalBillingLogiqService == null) { + additionalBillingLogiqService = new AdditionalBillingLogiqService(client); } } } - return omnichannelSubscriptionItemService; + return additionalBillingLogiqService; } /** - * Get or create the MeterService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the SiteMigrationDetailService instance. Thread-safe lazy initialization using + * double-checked locking. */ - MeterService meters() { - if (meterService == null) { + SiteMigrationDetailService siteMigrationDetails() { + if (siteMigrationDetailService == null) { synchronized (this) { - if (meterService == null) { - meterService = new MeterService(client); + if (siteMigrationDetailService == null) { + siteMigrationDetailService = new SiteMigrationDetailService(client); } } } - return meterService; + return siteMigrationDetailService; } /** - * Get or create the RampService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the PaymentScheduleSchemeService instance. Thread-safe lazy initialization using + * double-checked locking. */ - RampService ramps() { - if (rampService == null) { + PaymentScheduleSchemeService paymentScheduleSchemes() { + if (paymentScheduleSchemeService == null) { synchronized (this) { - if (rampService == null) { - rampService = new RampService(client); + if (paymentScheduleSchemeService == null) { + paymentScheduleSchemeService = new PaymentScheduleSchemeService(client); } } } - return rampService; + return paymentScheduleSchemeService; } /** - * Get or create the OmnichannelOneTimeOrderService instance. Thread-safe lazy initialization - * using double-checked locking. + * Get or create the CardService instance. Thread-safe lazy initialization using double-checked + * locking. */ - OmnichannelOneTimeOrderService omnichannelOneTimeOrders() { - if (omnichannelOneTimeOrderService == null) { + CardService cards() { + if (cardService == null) { synchronized (this) { - if (omnichannelOneTimeOrderService == null) { - omnichannelOneTimeOrderService = new OmnichannelOneTimeOrderService(client); + if (cardService == null) { + cardService = new CardService(client); } } } - return omnichannelOneTimeOrderService; + return cardService; } /** - * Get or create the DifferentialPriceService instance. Thread-safe lazy initialization using + * Get or create the FullExportService instance. Thread-safe lazy initialization using * double-checked locking. */ - DifferentialPriceService differentialPrices() { - if (differentialPriceService == null) { + FullExportService fullExports() { + if (fullExportService == null) { synchronized (this) { - if (differentialPriceService == null) { - differentialPriceService = new DifferentialPriceService(client); + if (fullExportService == null) { + fullExportService = new FullExportService(client); } } } - return differentialPriceService; + return fullExportService; } /** - * Get or create the EntitlementService instance. Thread-safe lazy initialization using + * Get or create the VirtualBankAccountService instance. Thread-safe lazy initialization using * double-checked locking. */ - EntitlementService entitlements() { - if (entitlementService == null) { + VirtualBankAccountService virtualBankAccounts() { + if (virtualBankAccountService == null) { synchronized (this) { - if (entitlementService == null) { - entitlementService = new EntitlementService(client); + if (virtualBankAccountService == null) { + virtualBankAccountService = new VirtualBankAccountService(client); } } } - return entitlementService; + return virtualBankAccountService; } /** - * Get or create the AdditionalBillingLogiqService instance. Thread-safe lazy initialization using + * Get or create the EmailLogService instance. Thread-safe lazy initialization using * double-checked locking. */ - AdditionalBillingLogiqService additionalBillingLogiqs() { - if (additionalBillingLogiqService == null) { + EmailLogService emailLogs() { + if (emailLogService == null) { synchronized (this) { - if (additionalBillingLogiqService == null) { - additionalBillingLogiqService = new AdditionalBillingLogiqService(client); + if (emailLogService == null) { + emailLogService = new EmailLogService(client); } } } - return additionalBillingLogiqService; + return emailLogService; } /** - * Get or create the LedgerOperationService instance. Thread-safe lazy initialization using + * Get or create the PricingPageSessionService instance. Thread-safe lazy initialization using * double-checked locking. */ - LedgerOperationService ledgerOperations() { - if (ledgerOperationService == null) { + PricingPageSessionService pricingPageSessions() { + if (pricingPageSessionService == null) { synchronized (this) { - if (ledgerOperationService == null) { - ledgerOperationService = new LedgerOperationService(client); + if (pricingPageSessionService == null) { + pricingPageSessionService = new PricingPageSessionService(client); } } } - return ledgerOperationService; + return pricingPageSessionService; } /** - * Get or create the UsageSummaryService instance. Thread-safe lazy initialization using + * Get or create the SubscriptionService instance. Thread-safe lazy initialization using * double-checked locking. */ - UsageSummaryService usageSummaries() { - if (usageSummaryService == null) { + SubscriptionService subscriptions() { + if (subscriptionService == null) { synchronized (this) { - if (usageSummaryService == null) { - usageSummaryService = new UsageSummaryService(client); + if (subscriptionService == null) { + subscriptionService = new SubscriptionService(client); } } } - return usageSummaryService; + return subscriptionService; } /** - * Get or create the AlertStatusService instance. Thread-safe lazy initialization using + * Get or create the PromotionalCreditService instance. Thread-safe lazy initialization using * double-checked locking. */ - AlertStatusService alertStatuses() { - if (alertStatusService == null) { + PromotionalCreditService promotionalCredits() { + if (promotionalCreditService == null) { synchronized (this) { - if (alertStatusService == null) { - alertStatusService = new AlertStatusService(client); + if (promotionalCreditService == null) { + promotionalCreditService = new PromotionalCreditService(client); } } } - return alertStatusService; + return promotionalCreditService; } /** - * Get or create the SubscriptionSettingService instance. Thread-safe lazy initialization using + * Get or create the BrandConfigurationService instance. Thread-safe lazy initialization using * double-checked locking. */ - SubscriptionSettingService subscriptionSettings() { - if (subscriptionSettingService == null) { + BrandConfigurationService brandConfigurations() { + if (brandConfigurationService == null) { synchronized (this) { - if (subscriptionSettingService == null) { - subscriptionSettingService = new SubscriptionSettingService(client); + if (brandConfigurationService == null) { + brandConfigurationService = new BrandConfigurationService(client); } } } - return subscriptionSettingService; + return brandConfigurationService; } /** - * Get or create the SiteMigrationDetailService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the FeatureService instance. Thread-safe lazy initialization using double-checked + * locking. */ - SiteMigrationDetailService siteMigrationDetails() { - if (siteMigrationDetailService == null) { + FeatureService features() { + if (featureService == null) { synchronized (this) { - if (siteMigrationDetailService == null) { - siteMigrationDetailService = new SiteMigrationDetailService(client); + if (featureService == null) { + featureService = new FeatureService(client); } } } - return siteMigrationDetailService; + return featureService; } /** - * Get or create the PaymentIntentService instance. Thread-safe lazy initialization using + * Get or create the UnbilledChargesSettingService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentIntentService paymentIntents() { - if (paymentIntentService == null) { + UnbilledChargesSettingService unbilledChargesSettings() { + if (unbilledChargesSettingService == null) { synchronized (this) { - if (paymentIntentService == null) { - paymentIntentService = new PaymentIntentService(client); + if (unbilledChargesSettingService == null) { + unbilledChargesSettingService = new UnbilledChargesSettingService(client); } } } - return paymentIntentService; + return unbilledChargesSettingService; } /** - * Get or create the PaymentScheduleSchemeService instance. Thread-safe lazy initialization using + * Get or create the CurrencyService instance. Thread-safe lazy initialization using * double-checked locking. */ - PaymentScheduleSchemeService paymentScheduleSchemes() { - if (paymentScheduleSchemeService == null) { + CurrencyService currencies() { + if (currencyService == null) { synchronized (this) { - if (paymentScheduleSchemeService == null) { - paymentScheduleSchemeService = new PaymentScheduleSchemeService(client); + if (currencyService == null) { + currencyService = new CurrencyService(client); } } } - return paymentScheduleSchemeService; + return currencyService; } /** - * Get or create the CardService instance. Thread-safe lazy initialization using double-checked + * Get or create the EventService instance. Thread-safe lazy initialization using double-checked * locking. */ - CardService cards() { - if (cardService == null) { + EventService events() { + if (eventService == null) { synchronized (this) { - if (cardService == null) { - cardService = new CardService(client); + if (eventService == null) { + eventService = new EventService(client); } } } - return cardService; + return eventService; } /** - * Get or create the AttachedItemService instance. Thread-safe lazy initialization using + * Get or create the UsageFileService instance. Thread-safe lazy initialization using * double-checked locking. */ - AttachedItemService attachedItems() { - if (attachedItemService == null) { + UsageFileService usageFiles() { + if (usageFileService == null) { synchronized (this) { - if (attachedItemService == null) { - attachedItemService = new AttachedItemService(client); + if (usageFileService == null) { + usageFileService = new UsageFileService(client); } } } - return attachedItemService; + return usageFileService; } /** - * Get or create the UsageEventService instance. Thread-safe lazy initialization using + * Get or create the NonSubscriptionService instance. Thread-safe lazy initialization using * double-checked locking. */ - UsageEventService usageEvents() { - if (usageEventService == null) { + NonSubscriptionService nonSubscriptions() { + if (nonSubscriptionService == null) { synchronized (this) { - if (usageEventService == null) { - usageEventService = new UsageEventService(client); + if (nonSubscriptionService == null) { + nonSubscriptionService = new NonSubscriptionService(client); } } } - return usageEventService; + return nonSubscriptionService; } /** - * Get or create the MeteredFeatureService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the DisputeService instance. Thread-safe lazy initialization using double-checked + * locking. */ - MeteredFeatureService meteredFeatures() { - if (meteredFeatureService == null) { + DisputeService disputes() { + if (disputeService == null) { synchronized (this) { - if (meteredFeatureService == null) { - meteredFeatureService = new MeteredFeatureService(client); + if (disputeService == null) { + disputeService = new DisputeService(client); } } } - return meteredFeatureService; + return disputeService; } /** - * Get or create the PriceVariantService instance. Thread-safe lazy initialization using + * Get or create the ResourceMigrationService instance. Thread-safe lazy initialization using * double-checked locking. */ - PriceVariantService priceVariants() { - if (priceVariantService == null) { + ResourceMigrationService resourceMigrations() { + if (resourceMigrationService == null) { synchronized (this) { - if (priceVariantService == null) { - priceVariantService = new PriceVariantService(client); + if (resourceMigrationService == null) { + resourceMigrationService = new ResourceMigrationService(client); } } } - return priceVariantService; + return resourceMigrationService; } /** - * Get or create the FullExportService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the ProductService instance. Thread-safe lazy initialization using double-checked + * locking. */ - FullExportService fullExports() { - if (fullExportService == null) { + ProductService products() { + if (productService == null) { synchronized (this) { - if (fullExportService == null) { - fullExportService = new FullExportService(client); + if (productService == null) { + productService = new ProductService(client); } } } - return fullExportService; + return productService; } /** - * Get or create the VirtualBankAccountService instance. Thread-safe lazy initialization using + * Get or create the CouponCodeService instance. Thread-safe lazy initialization using * double-checked locking. */ - VirtualBankAccountService virtualBankAccounts() { - if (virtualBankAccountService == null) { + CouponCodeService couponCodes() { + if (couponCodeService == null) { synchronized (this) { - if (virtualBankAccountService == null) { - virtualBankAccountService = new VirtualBankAccountService(client); + if (couponCodeService == null) { + couponCodeService = new CouponCodeService(client); } } } - return virtualBankAccountService; + return couponCodeService; } /** - * Get or create the GrantBlockService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the AddressService instance. Thread-safe lazy initialization using double-checked + * locking. */ - GrantBlockService grantBlocks() { - if (grantBlockService == null) { + AddressService addresses() { + if (addressService == null) { synchronized (this) { - if (grantBlockService == null) { - grantBlockService = new GrantBlockService(client); + if (addressService == null) { + addressService = new AddressService(client); } } } - return grantBlockService; + return addressService; } /** - * Get or create the AddonService instance. Thread-safe lazy initialization using double-checked + * Get or create the CouponService instance. Thread-safe lazy initialization using double-checked * locking. */ - AddonService addons() { - if (addonService == null) { + CouponService coupons() { + if (couponService == null) { synchronized (this) { - if (addonService == null) { - addonService = new AddonService(client); + if (couponService == null) { + couponService = new CouponService(client); } } } - return addonService; + return couponService; } /** - * Get or create the TpSiteUserService instance. Thread-safe lazy initialization using + * Get or create the ItemPriceService instance. Thread-safe lazy initialization using * double-checked locking. */ - TpSiteUserService tpSiteUsers() { - if (tpSiteUserService == null) { + ItemPriceService itemPrices() { + if (itemPriceService == null) { synchronized (this) { - if (tpSiteUserService == null) { - tpSiteUserService = new TpSiteUserService(client); + if (itemPriceService == null) { + itemPriceService = new ItemPriceService(client); } } } - return tpSiteUserService; + return itemPriceService; } /** - * Get or create the ConfigurationService instance. Thread-safe lazy initialization using + * Get or create the OfferFulfillmentService instance. Thread-safe lazy initialization using * double-checked locking. */ - ConfigurationService configurations() { - if (configurationService == null) { + OfferFulfillmentService offerFulfillments() { + if (offerFulfillmentService == null) { synchronized (this) { - if (configurationService == null) { - configurationService = new ConfigurationService(client); + if (offerFulfillmentService == null) { + offerFulfillmentService = new OfferFulfillmentService(client); } } } - return configurationService; + return offerFulfillmentService; } /** - * Get or create the PricingPageSessionService instance. Thread-safe lazy initialization using + * Get or create the PaymentVoucherService instance. Thread-safe lazy initialization using * double-checked locking. */ - PricingPageSessionService pricingPageSessions() { - if (pricingPageSessionService == null) { + PaymentVoucherService paymentVouchers() { + if (paymentVoucherService == null) { synchronized (this) { - if (pricingPageSessionService == null) { - pricingPageSessionService = new PricingPageSessionService(client); + if (paymentVoucherService == null) { + paymentVoucherService = new PaymentVoucherService(client); } } } - return pricingPageSessionService; + return paymentVoucherService; } /** - * Get or create the Pc2MigrationItemPriceService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the ThirdPartyEntityMappingService instance. Thread-safe lazy initialization + * using double-checked locking. */ - Pc2MigrationItemPriceService pc2MigrationItemPrices() { - if (pc2MigrationItemPriceService == null) { + ThirdPartyEntityMappingService thirdPartyEntityMappings() { + if (thirdPartyEntityMappingService == null) { synchronized (this) { - if (pc2MigrationItemPriceService == null) { - pc2MigrationItemPriceService = new Pc2MigrationItemPriceService(client); + if (thirdPartyEntityMappingService == null) { + thirdPartyEntityMappingService = new ThirdPartyEntityMappingService(client); } } } - return pc2MigrationItemPriceService; + return thirdPartyEntityMappingService; } /** - * Get or create the RuleService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the VaultedPaymentMethodService instance. Thread-safe lazy initialization using + * double-checked locking. */ - RuleService rules() { - if (ruleService == null) { + VaultedPaymentMethodService vaultedPaymentMethods() { + if (vaultedPaymentMethodService == null) { synchronized (this) { - if (ruleService == null) { - ruleService = new RuleService(client); + if (vaultedPaymentMethodService == null) { + vaultedPaymentMethodService = new VaultedPaymentMethodService(client); } } } - return ruleService; + return vaultedPaymentMethodService; } /** - * Get or create the SubscriptionService instance. Thread-safe lazy initialization using + * Get or create the UsageChargeService instance. Thread-safe lazy initialization using * double-checked locking. */ - SubscriptionService subscriptions() { - if (subscriptionService == null) { + UsageChargeService usageCharges() { + if (usageChargeService == null) { synchronized (this) { - if (subscriptionService == null) { - subscriptionService = new SubscriptionService(client); + if (usageChargeService == null) { + usageChargeService = new UsageChargeService(client); } } } - return subscriptionService; + return usageChargeService; } /** - * Get or create the MediaService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the ThirdPartyConfigurationService instance. Thread-safe lazy initialization + * using double-checked locking. */ - MediaService medias() { - if (mediaService == null) { + ThirdPartyConfigurationService thirdPartyConfigurations() { + if (thirdPartyConfigurationService == null) { synchronized (this) { - if (mediaService == null) { - mediaService = new MediaService(client); + if (thirdPartyConfigurationService == null) { + thirdPartyConfigurationService = new ThirdPartyConfigurationService(client); } } } - return mediaService; + return thirdPartyConfigurationService; } /** - * Get or create the BusinessProfileService instance. Thread-safe lazy initialization using + * Get or create the UnbilledChargeService instance. Thread-safe lazy initialization using * double-checked locking. */ - BusinessProfileService businessProfiles() { - if (businessProfileService == null) { + UnbilledChargeService unbilledCharges() { + if (unbilledChargeService == null) { synchronized (this) { - if (businessProfileService == null) { - businessProfileService = new BusinessProfileService(client); + if (unbilledChargeService == null) { + unbilledChargeService = new UnbilledChargeService(client); } } } - return businessProfileService; + return unbilledChargeService; } /** - * Get or create the PromotionalCreditService instance. Thread-safe lazy initialization using + * Get or create the TransactionService instance. Thread-safe lazy initialization using * double-checked locking. */ - PromotionalCreditService promotionalCredits() { - if (promotionalCreditService == null) { + TransactionService transactions() { + if (transactionService == null) { synchronized (this) { - if (promotionalCreditService == null) { - promotionalCreditService = new PromotionalCreditService(client); + if (transactionService == null) { + transactionService = new TransactionService(client); } } } - return promotionalCreditService; + return transactionService; } /** - * Get or create the BrandConfigurationService instance. Thread-safe lazy initialization using + * Get or create the ThirdPartySyncDetailService instance. Thread-safe lazy initialization using * double-checked locking. */ - BrandConfigurationService brandConfigurations() { - if (brandConfigurationService == null) { + ThirdPartySyncDetailService thirdPartySyncDetails() { + if (thirdPartySyncDetailService == null) { synchronized (this) { - if (brandConfigurationService == null) { - brandConfigurationService = new BrandConfigurationService(client); + if (thirdPartySyncDetailService == null) { + thirdPartySyncDetailService = new ThirdPartySyncDetailService(client); } } } - return brandConfigurationService; + return thirdPartySyncDetailService; } /** - * Get or create the WebhookEndpointService instance. Thread-safe lazy initialization using + * Get or create the EinvoiceService instance. Thread-safe lazy initialization using * double-checked locking. */ - WebhookEndpointService webhookEndpoints() { - if (webhookEndpointService == null) { + EinvoiceService einvoices() { + if (einvoiceService == null) { synchronized (this) { - if (webhookEndpointService == null) { - webhookEndpointService = new WebhookEndpointService(client); + if (einvoiceService == null) { + einvoiceService = new EinvoiceService(client); } } } - return webhookEndpointService; + return einvoiceService; } /** - * Get or create the FeatureService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the QuoteEntitlementService instance. Thread-safe lazy initialization using + * double-checked locking. */ - FeatureService features() { - if (featureService == null) { + QuoteEntitlementService quoteEntitlements() { + if (quoteEntitlementService == null) { synchronized (this) { - if (featureService == null) { - featureService = new FeatureService(client); + if (quoteEntitlementService == null) { + quoteEntitlementService = new QuoteEntitlementService(client); } } } - return featureService; + return quoteEntitlementService; } /** - * Get or create the UnbilledChargesSettingService instance. Thread-safe lazy initialization using + * Get or create the TimeMachineService instance. Thread-safe lazy initialization using * double-checked locking. */ - UnbilledChargesSettingService unbilledChargesSettings() { - if (unbilledChargesSettingService == null) { + TimeMachineService timeMachines() { + if (timeMachineService == null) { synchronized (this) { - if (unbilledChargesSettingService == null) { - unbilledChargesSettingService = new UnbilledChargesSettingService(client); + if (timeMachineService == null) { + timeMachineService = new TimeMachineService(client); } } } - return unbilledChargesSettingService; + return timeMachineService; } /** - * Get or create the AlertService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the InAppSubscriptionService instance. Thread-safe lazy initialization using + * double-checked locking. */ - AlertService alerts() { - if (alertService == null) { + InAppSubscriptionService inAppSubscriptions() { + if (inAppSubscriptionService == null) { synchronized (this) { - if (alertService == null) { - alertService = new AlertService(client); + if (inAppSubscriptionService == null) { + inAppSubscriptionService = new InAppSubscriptionService(client); } } } - return alertService; + return inAppSubscriptionService; } /** - * Get or create the CurrencyService instance. Thread-safe lazy initialization using + * Get or create the CreditNoteService instance. Thread-safe lazy initialization using * double-checked locking. */ - CurrencyService currencies() { - if (currencyService == null) { + CreditNoteService creditNotes() { + if (creditNoteService == null) { synchronized (this) { - if (currencyService == null) { - currencyService = new CurrencyService(client); + if (creditNoteService == null) { + creditNoteService = new CreditNoteService(client); + } + } + } + return creditNoteService; + } + + /** + * Get or create the CouponSetService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + CouponSetService couponSets() { + if (couponSetService == null) { + synchronized (this) { + if (couponSetService == null) { + couponSetService = new CouponSetService(client); + } + } + } + return couponSetService; + } + + /** + * Get or create the Pc2MigrationItemService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + Pc2MigrationItemService pc2MigrationItems() { + if (pc2MigrationItemService == null) { + synchronized (this) { + if (pc2MigrationItemService == null) { + pc2MigrationItemService = new Pc2MigrationItemService(client); + } + } + } + return pc2MigrationItemService; + } + + /** + * Get or create the BusinessRuleService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + BusinessRuleService businessRules() { + if (businessRuleService == null) { + synchronized (this) { + if (businessRuleService == null) { + businessRuleService = new BusinessRuleService(client); + } + } + } + return businessRuleService; + } + + /** + * Get or create the VariantService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + VariantService variants() { + if (variantService == null) { + synchronized (this) { + if (variantService == null) { + variantService = new VariantService(client); + } + } + } + return variantService; + } + + /** + * Get or create the Pc2MigrationItemFamilyService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + Pc2MigrationItemFamilyService pc2MigrationItemFamilies() { + if (pc2MigrationItemFamilyService == null) { + synchronized (this) { + if (pc2MigrationItemFamilyService == null) { + pc2MigrationItemFamilyService = new Pc2MigrationItemFamilyService(client); + } + } + } + return pc2MigrationItemFamilyService; + } + + /** + * Get or create the RecordedPurchaseService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + RecordedPurchaseService recordedPurchases() { + if (recordedPurchaseService == null) { + synchronized (this) { + if (recordedPurchaseService == null) { + recordedPurchaseService = new RecordedPurchaseService(client); + } + } + } + return recordedPurchaseService; + } + + /** + * Get or create the ExportService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + ExportService exports() { + if (exportService == null) { + synchronized (this) { + if (exportService == null) { + exportService = new ExportService(client); + } + } + } + return exportService; + } + + /** + * Get or create the CustomerEntitlementService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + CustomerEntitlementService customerEntitlements() { + if (customerEntitlementService == null) { + synchronized (this) { + if (customerEntitlementService == null) { + customerEntitlementService = new CustomerEntitlementService(client); + } + } + } + return customerEntitlementService; + } + + /** + * Get or create the PersonalizedOfferService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + PersonalizedOfferService personalizedOffers() { + if (personalizedOfferService == null) { + synchronized (this) { + if (personalizedOfferService == null) { + personalizedOfferService = new PersonalizedOfferService(client); + } + } + } + return personalizedOfferService; + } + + /** + * Get or create the OmnichannelSubscriptionService instance. Thread-safe lazy initialization + * using double-checked locking. + */ + OmnichannelSubscriptionService omnichannelSubscriptions() { + if (omnichannelSubscriptionService == null) { + synchronized (this) { + if (omnichannelSubscriptionService == null) { + omnichannelSubscriptionService = new OmnichannelSubscriptionService(client); + } + } + } + return omnichannelSubscriptionService; + } + + /** + * Get or create the OmnichannelSubscriptionItemService instance. Thread-safe lazy initialization + * using double-checked locking. + */ + OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { + if (omnichannelSubscriptionItemService == null) { + synchronized (this) { + if (omnichannelSubscriptionItemService == null) { + omnichannelSubscriptionItemService = new OmnichannelSubscriptionItemService(client); + } + } + } + return omnichannelSubscriptionItemService; + } + + /** + * Get or create the MeterService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + MeterService meters() { + if (meterService == null) { + synchronized (this) { + if (meterService == null) { + meterService = new MeterService(client); + } + } + } + return meterService; + } + + /** + * Get or create the EntitlementService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + EntitlementService entitlements() { + if (entitlementService == null) { + synchronized (this) { + if (entitlementService == null) { + entitlementService = new EntitlementService(client); + } + } + } + return entitlementService; + } + + /** + * Get or create the LedgerOperationService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + LedgerOperationService ledgerOperations() { + if (ledgerOperationService == null) { + synchronized (this) { + if (ledgerOperationService == null) { + ledgerOperationService = new LedgerOperationService(client); + } + } + } + return ledgerOperationService; + } + + /** + * Get or create the PaymentScheduleService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + PaymentScheduleService paymentSchedules() { + if (paymentScheduleService == null) { + synchronized (this) { + if (paymentScheduleService == null) { + paymentScheduleService = new PaymentScheduleService(client); + } + } + } + return paymentScheduleService; + } + + /** + * Get or create the UsageSummaryService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + UsageSummaryService usageSummaries() { + if (usageSummaryService == null) { + synchronized (this) { + if (usageSummaryService == null) { + usageSummaryService = new UsageSummaryService(client); + } + } + } + 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. + */ + SubscriptionSettingService subscriptionSettings() { + if (subscriptionSettingService == null) { + synchronized (this) { + if (subscriptionSettingService == null) { + subscriptionSettingService = new SubscriptionSettingService(client); + } + } + } + return subscriptionSettingService; + } + + /** + * Get or create the PaymentIntentService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + PaymentIntentService paymentIntents() { + if (paymentIntentService == null) { + synchronized (this) { + if (paymentIntentService == null) { + paymentIntentService = new PaymentIntentService(client); + } + } + } + return paymentIntentService; + } + + /** + * Get or create the AttachedItemService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + AttachedItemService attachedItems() { + if (attachedItemService == null) { + synchronized (this) { + if (attachedItemService == null) { + attachedItemService = new AttachedItemService(client); + } + } + } + return attachedItemService; + } + + /** + * Get or create the UsageEventService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + UsageEventService usageEvents() { + if (usageEventService == null) { + synchronized (this) { + if (usageEventService == null) { + usageEventService = new UsageEventService(client); + } + } + } + return usageEventService; + } + + /** + * Get or create the MeteredFeatureService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + MeteredFeatureService meteredFeatures() { + if (meteredFeatureService == null) { + synchronized (this) { + if (meteredFeatureService == null) { + meteredFeatureService = new MeteredFeatureService(client); + } + } + } + return meteredFeatureService; + } + + /** + * Get or create the PriceVariantService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + PriceVariantService priceVariants() { + if (priceVariantService == null) { + synchronized (this) { + if (priceVariantService == null) { + priceVariantService = new PriceVariantService(client); + } + } + } + return priceVariantService; + } + + /** + * Get or create the BusinessRulesetService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + BusinessRulesetService businessRulesets() { + if (businessRulesetService == null) { + synchronized (this) { + if (businessRulesetService == null) { + businessRulesetService = new BusinessRulesetService(client); + } + } + } + return businessRulesetService; + } + + /** + * Get or create the GrantBlockService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + GrantBlockService grantBlocks() { + if (grantBlockService == null) { + synchronized (this) { + if (grantBlockService == null) { + grantBlockService = new GrantBlockService(client); + } + } + } + return grantBlockService; + } + + /** + * Get or create the AddonService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + AddonService addons() { + if (addonService == null) { + synchronized (this) { + if (addonService == null) { + addonService = new AddonService(client); } } } - return currencyService; + return addonService; } /** - * Get or create the EventService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the TpSiteUserService instance. Thread-safe lazy initialization using + * double-checked locking. */ - EventService events() { - if (eventService == null) { + TpSiteUserService tpSiteUsers() { + if (tpSiteUserService == null) { synchronized (this) { - if (eventService == null) { - eventService = new EventService(client); + if (tpSiteUserService == null) { + tpSiteUserService = new TpSiteUserService(client); } } } - return eventService; + return tpSiteUserService; } /** - * Get or create the UsageFileService instance. Thread-safe lazy initialization using + * Get or create the ConfigurationService instance. Thread-safe lazy initialization using * double-checked locking. */ - UsageFileService usageFiles() { - if (usageFileService == null) { + ConfigurationService configurations() { + if (configurationService == null) { synchronized (this) { - if (usageFileService == null) { - usageFileService = new UsageFileService(client); + if (configurationService == null) { + configurationService = new ConfigurationService(client); } } } - return usageFileService; + return configurationService; } /** - * Get or create the NonSubscriptionService instance. Thread-safe lazy initialization using + * Get or create the Pc2MigrationItemPriceService instance. Thread-safe lazy initialization using * double-checked locking. */ - NonSubscriptionService nonSubscriptions() { - if (nonSubscriptionService == null) { + Pc2MigrationItemPriceService pc2MigrationItemPrices() { + if (pc2MigrationItemPriceService == null) { synchronized (this) { - if (nonSubscriptionService == null) { - nonSubscriptionService = new NonSubscriptionService(client); + if (pc2MigrationItemPriceService == null) { + pc2MigrationItemPriceService = new Pc2MigrationItemPriceService(client); } } } - return nonSubscriptionService; + return pc2MigrationItemPriceService; } /** - * Get or create the ResourceMigrationService instance. Thread-safe lazy initialization using - * double-checked locking. + * Get or create the RuleService instance. Thread-safe lazy initialization using double-checked + * locking. */ - ResourceMigrationService resourceMigrations() { - if (resourceMigrationService == null) { + RuleService rules() { + if (ruleService == null) { synchronized (this) { - if (resourceMigrationService == null) { - resourceMigrationService = new ResourceMigrationService(client); + if (ruleService == null) { + ruleService = new RuleService(client); } } } - return resourceMigrationService; + return ruleService; } /** - * Get or create the ProductService instance. Thread-safe lazy initialization using double-checked + * Get or create the MediaService instance. Thread-safe lazy initialization using double-checked * locking. */ - ProductService products() { - if (productService == null) { + MediaService medias() { + if (mediaService == null) { synchronized (this) { - if (productService == null) { - productService = new ProductService(client); + if (mediaService == null) { + mediaService = new MediaService(client); } } } - return productService; + return mediaService; } /** - * Get or create the CouponCodeService instance. Thread-safe lazy initialization using + * Get or create the BusinessProfileService instance. Thread-safe lazy initialization using * double-checked locking. */ - CouponCodeService couponCodes() { - if (couponCodeService == null) { + BusinessProfileService businessProfiles() { + if (businessProfileService == null) { synchronized (this) { - if (couponCodeService == null) { - couponCodeService = new CouponCodeService(client); + if (businessProfileService == null) { + businessProfileService = new BusinessProfileService(client); } } } - return couponCodeService; + return businessProfileService; } /** - * Get or create the AddressService instance. Thread-safe lazy initialization using double-checked - * locking. + * Get or create the WebhookEndpointService instance. Thread-safe lazy initialization using + * double-checked locking. */ - AddressService addresses() { - if (addressService == null) { + WebhookEndpointService webhookEndpoints() { + if (webhookEndpointService == null) { synchronized (this) { - if (addressService == null) { - addressService = new AddressService(client); + if (webhookEndpointService == null) { + webhookEndpointService = new WebhookEndpointService(client); } } } - return addressService; + return webhookEndpointService; } /** - * Get or create the CouponService instance. Thread-safe lazy initialization using double-checked + * Get or create the AlertService instance. Thread-safe lazy initialization using double-checked * locking. */ - CouponService coupons() { - if (couponService == null) { + AlertService alerts() { + if (alertService == null) { synchronized (this) { - if (couponService == null) { - couponService = new CouponService(client); + if (alertService == null) { + alertService = new AlertService(client); } } } - return couponService; + return alertService; } /** @@ -1497,21 +1761,6 @@ PortalSessionService portalSessions() { return portalSessionService; } - /** - * Get or create the ItemPriceService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - ItemPriceService itemPrices() { - if (itemPriceService == null) { - synchronized (this) { - if (itemPriceService == null) { - itemPriceService = new ItemPriceService(client); - } - } - } - return itemPriceService; - } - /** * Get or create the CreditUnitService instance. Thread-safe lazy initialization using * double-checked locking. @@ -1527,21 +1776,6 @@ CreditUnitService creditUnits() { return creditUnitService; } - /** - * Get or create the OfferFulfillmentService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - OfferFulfillmentService offerFulfillments() { - if (offerFulfillmentService == null) { - synchronized (this) { - if (offerFulfillmentService == null) { - offerFulfillmentService = new OfferFulfillmentService(client); - } - } - } - return offerFulfillmentService; - } - /** * Get or create the HostedPageService instance. Thread-safe lazy initialization using * double-checked locking. @@ -1572,21 +1806,6 @@ PurchaseService purchases() { return purchaseService; } - /** - * Get or create the PaymentVoucherService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - PaymentVoucherService paymentVouchers() { - if (paymentVoucherService == null) { - synchronized (this) { - if (paymentVoucherService == null) { - paymentVoucherService = new PaymentVoucherService(client); - } - } - } - return paymentVoucherService; - } - /** * Get or create the ItemFamilyService instance. Thread-safe lazy initialization using * double-checked locking. @@ -1617,51 +1836,6 @@ SubscriptionEntitlementService subscriptionEntitlements() { return subscriptionEntitlementService; } - /** - * Get or create the ThirdPartyEntityMappingService instance. Thread-safe lazy initialization - * using double-checked locking. - */ - ThirdPartyEntityMappingService thirdPartyEntityMappings() { - if (thirdPartyEntityMappingService == null) { - synchronized (this) { - if (thirdPartyEntityMappingService == null) { - thirdPartyEntityMappingService = new ThirdPartyEntityMappingService(client); - } - } - } - return thirdPartyEntityMappingService; - } - - /** - * Get or create the VaultedPaymentMethodService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - VaultedPaymentMethodService vaultedPaymentMethods() { - if (vaultedPaymentMethodService == null) { - synchronized (this) { - if (vaultedPaymentMethodService == null) { - vaultedPaymentMethodService = new VaultedPaymentMethodService(client); - } - } - } - return vaultedPaymentMethodService; - } - - /** - * Get or create the UsageChargeService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - UsageChargeService usageCharges() { - if (usageChargeService == null) { - synchronized (this) { - if (usageChargeService == null) { - usageChargeService = new UsageChargeService(client); - } - } - } - return usageChargeService; - } - /** * Get or create the EntitlementOverrideService instance. Thread-safe lazy initialization using * double-checked locking. @@ -1677,36 +1851,6 @@ EntitlementOverrideService entitlementOverrides() { return entitlementOverrideService; } - /** - * Get or create the ThirdPartyConfigurationService instance. Thread-safe lazy initialization - * using double-checked locking. - */ - ThirdPartyConfigurationService thirdPartyConfigurations() { - if (thirdPartyConfigurationService == null) { - synchronized (this) { - if (thirdPartyConfigurationService == null) { - thirdPartyConfigurationService = new ThirdPartyConfigurationService(client); - } - } - } - return thirdPartyConfigurationService; - } - - /** - * Get or create the UnbilledChargeService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - UnbilledChargeService unbilledCharges() { - if (unbilledChargeService == null) { - synchronized (this) { - if (unbilledChargeService == null) { - unbilledChargeService = new UnbilledChargeService(client); - } - } - } - return unbilledChargeService; - } - /** * Get or create the CommentService instance. Thread-safe lazy initialization using double-checked * locking. @@ -1737,36 +1881,6 @@ InvoiceService invoices() { return invoiceService; } - /** - * Get or create the TransactionService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - TransactionService transactions() { - if (transactionService == null) { - synchronized (this) { - if (transactionService == null) { - transactionService = new TransactionService(client); - } - } - } - return transactionService; - } - - /** - * Get or create the ThirdPartySyncDetailService instance. Thread-safe lazy initialization using - * double-checked locking. - */ - ThirdPartySyncDetailService thirdPartySyncDetails() { - if (thirdPartySyncDetailService == null) { - synchronized (this) { - if (thirdPartySyncDetailService == null) { - thirdPartySyncDetailService = new ThirdPartySyncDetailService(client); - } - } - } - return thirdPartySyncDetailService; - } - /** * Get or create the CustomerService instance. Thread-safe lazy initialization using * double-checked locking. diff --git a/src/main/java/com/chargebee/v4/models/appliedBusinessRule/AppliedBusinessRule.java b/src/main/java/com/chargebee/v4/models/appliedBusinessRule/AppliedBusinessRule.java new file mode 100644 index 000000000..9ef5d90c5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/appliedBusinessRule/AppliedBusinessRule.java @@ -0,0 +1,157 @@ +/* + * 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.appliedBusinessRule; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class AppliedBusinessRule { + + private String handle; + private EntityType entityType; + private Long entityId; + private Integer entityVersion; + private String ruleId; + private Integer version; + private Timestamp createdAt; + private Timestamp modifiedAt; + + public String getHandle() { + return handle; + } + + public EntityType getEntityType() { + return entityType; + } + + public Long getEntityId() { + return entityId; + } + + public Integer getEntityVersion() { + return entityVersion; + } + + public String getRuleId() { + return ruleId; + } + + public Integer getVersion() { + return version; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getModifiedAt() { + return modifiedAt; + } + + public enum EntityType { + CPQ_QUOTE("cpq_quote"), + + /** 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 AppliedBusinessRule fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AppliedBusinessRule fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static AppliedBusinessRule fromJson(JsonObject jsonObj) { + AppliedBusinessRule obj = new AppliedBusinessRule(); + + obj.handle = JsonUtil.getString(jsonObj, "handle"); + + obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + + obj.entityId = JsonUtil.getLong(jsonObj, "entity_id"); + + obj.entityVersion = JsonUtil.getInteger(jsonObj, "entity_version"); + + obj.ruleId = JsonUtil.getString(jsonObj, "rule_id"); + + obj.version = JsonUtil.getInteger(jsonObj, "version"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + + return obj; + } + + @Override + public String toString() { + return "AppliedBusinessRule{" + + "handle=" + + handle + + ", entityType=" + + entityType + + ", entityId=" + + entityId + + ", entityVersion=" + + entityVersion + + ", ruleId=" + + ruleId + + ", version=" + + version + + ", createdAt=" + + createdAt + + ", modifiedAt=" + + modifiedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AppliedBusinessRule that = (AppliedBusinessRule) o; + return java.util.Objects.equals(handle, that.handle) + && java.util.Objects.equals(entityType, that.entityType) + && java.util.Objects.equals(entityId, that.entityId) + && java.util.Objects.equals(entityVersion, that.entityVersion) + && java.util.Objects.equals(ruleId, that.ruleId) + && java.util.Objects.equals(version, that.version) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(modifiedAt, that.modifiedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + handle, entityType, entityId, entityVersion, ruleId, version, createdAt, modifiedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/appliedRule/AppliedRule.java b/src/main/java/com/chargebee/v4/models/appliedRule/AppliedRule.java new file mode 100644 index 000000000..1a99afe3b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/appliedRule/AppliedRule.java @@ -0,0 +1,125 @@ +/* + * 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.appliedRule; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.util.List; + +public class AppliedRule { + + private String id; + private Integer version; + private String name; + private String description; + private Boolean evaluationResult; + private String errorMessage; + private List actions; + + public String getId() { + return id; + } + + public Integer getVersion() { + return version; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Boolean getEvaluationResult() { + return evaluationResult; + } + + public String getErrorMessage() { + return errorMessage; + } + + public List getActions() { + return actions; + } + + public static AppliedRule fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AppliedRule fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static AppliedRule fromJson(JsonObject jsonObj) { + AppliedRule obj = new AppliedRule(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.version = JsonUtil.getInteger(jsonObj, "version"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.evaluationResult = JsonUtil.getBoolean(jsonObj, "evaluation_result"); + + obj.errorMessage = JsonUtil.getString(jsonObj, "error_message"); + + JsonArray __actionsArr = JsonUtil.getJsonArray(jsonObj, "actions"); + if (__actionsArr != null) { + obj.actions = JsonUtil.mapArrayToObjects(__actionsArr); + } + + return obj; + } + + @Override + public String toString() { + return "AppliedRule{" + + "id=" + + id + + ", version=" + + version + + ", name=" + + name + + ", description=" + + description + + ", evaluationResult=" + + evaluationResult + + ", errorMessage=" + + errorMessage + + ", actions=" + + actions + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AppliedRule that = (AppliedRule) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(version, that.version) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(evaluationResult, that.evaluationResult) + && java.util.Objects.equals(errorMessage, that.errorMessage) + && java.util.Objects.equals(actions, that.actions); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, version, name, description, evaluationResult, errorMessage, actions); + } +} diff --git a/src/main/java/com/chargebee/v4/models/applyRule/ApplyRule.java b/src/main/java/com/chargebee/v4/models/applyRule/ApplyRule.java new file mode 100644 index 000000000..54aac4309 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/applyRule/ApplyRule.java @@ -0,0 +1,242 @@ +/* + * 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.applyRule; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.util.List; + +public class ApplyRule { + + private Boolean evaluate; + private String ruleId; + private String rulesetId; + private Boolean skipFailedRules; + private java.util.Map structuredExpression; + private java.util.Map context; + private List rules; + + public Boolean getEvaluate() { + return evaluate; + } + + public String getRuleId() { + return ruleId; + } + + public String getRulesetId() { + return rulesetId; + } + + public Boolean getSkipFailedRules() { + return skipFailedRules; + } + + public java.util.Map getStructuredExpression() { + return structuredExpression; + } + + public java.util.Map getContext() { + return context; + } + + public List getRules() { + return rules; + } + + public static ApplyRule fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ApplyRule fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ApplyRule fromJson(JsonObject jsonObj) { + ApplyRule obj = new ApplyRule(); + + obj.evaluate = JsonUtil.getBoolean(jsonObj, "evaluate"); + + obj.ruleId = JsonUtil.getString(jsonObj, "rule_id"); + + obj.rulesetId = JsonUtil.getString(jsonObj, "ruleset_id"); + + obj.skipFailedRules = JsonUtil.getBoolean(jsonObj, "skip_failed_rules"); + + JsonObject __structuredExpressionObj = JsonUtil.getJsonObject(jsonObj, "structured_expression"); + obj.structuredExpression = + __structuredExpressionObj != null + ? JsonUtil.parseJsonObjectToMap(__structuredExpressionObj) + : new java.util.HashMap<>(); + + JsonObject __contextObj = JsonUtil.getJsonObject(jsonObj, "context"); + obj.context = + __contextObj != null + ? JsonUtil.parseJsonObjectToMap(__contextObj) + : new java.util.HashMap<>(); + + obj.rules = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "rules"), Rules::fromJson); + + return obj; + } + + @Override + public String toString() { + return "ApplyRule{" + + "evaluate=" + + evaluate + + ", ruleId=" + + ruleId + + ", rulesetId=" + + rulesetId + + ", skipFailedRules=" + + skipFailedRules + + ", structuredExpression=" + + structuredExpression + + ", context=" + + context + + ", rules=" + + rules + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ApplyRule that = (ApplyRule) o; + return java.util.Objects.equals(evaluate, that.evaluate) + && java.util.Objects.equals(ruleId, that.ruleId) + && java.util.Objects.equals(rulesetId, that.rulesetId) + && java.util.Objects.equals(skipFailedRules, that.skipFailedRules) + && java.util.Objects.equals(structuredExpression, that.structuredExpression) + && java.util.Objects.equals(context, that.context) + && java.util.Objects.equals(rules, that.rules); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + evaluate, ruleId, rulesetId, skipFailedRules, structuredExpression, context, rules); + } + + public static class Rules { + + private String id; + private Integer version; + private String name; + private String description; + private Boolean evaluationResult; + private String errorMessage; + private List actions; + + public String getId() { + return id; + } + + public Integer getVersion() { + return version; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Boolean getEvaluationResult() { + return evaluationResult; + } + + public String getErrorMessage() { + return errorMessage; + } + + public List getActions() { + return actions; + } + + public static Rules fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Rules fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Rules fromJson(JsonObject jsonObj) { + Rules obj = new Rules(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.version = JsonUtil.getInteger(jsonObj, "version"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.evaluationResult = JsonUtil.getBoolean(jsonObj, "evaluation_result"); + + obj.errorMessage = JsonUtil.getString(jsonObj, "error_message"); + + JsonArray __actionsArr = JsonUtil.getJsonArray(jsonObj, "actions"); + if (__actionsArr != null) { + obj.actions = JsonUtil.mapArrayToObjects(__actionsArr); + } + + return obj; + } + + @Override + public String toString() { + return "Rules{" + + "id=" + + id + + ", version=" + + version + + ", name=" + + name + + ", description=" + + description + + ", evaluationResult=" + + evaluationResult + + ", errorMessage=" + + errorMessage + + ", actions=" + + actions + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Rules that = (Rules) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(version, that.version) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(evaluationResult, that.evaluationResult) + && java.util.Objects.equals(errorMessage, that.errorMessage) + && java.util.Objects.equals(actions, that.actions); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, version, name, description, evaluationResult, errorMessage, actions); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/BusinessRule.java b/src/main/java/com/chargebee/v4/models/businessRule/BusinessRule.java new file mode 100644 index 000000000..836f886d8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/BusinessRule.java @@ -0,0 +1,227 @@ +/* + * 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.businessRule; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.sql.Timestamp; +import java.util.List; + +public class BusinessRule { + + private String id; + private String name; + private String description; + private Integer latestVersion; + private Boolean active; + private Timestamp releasedAt; + private String releasedBy; + private Timestamp updatedAt; + private String updatedBy; + private String createdBy; + private Timestamp createdAt; + private List tags; + private java.util.Map structuredExpression; + private List actionsOnSuccess; + private Long resourceVersion; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Integer getLatestVersion() { + return latestVersion; + } + + public Boolean getActive() { + return active; + } + + public Timestamp getReleasedAt() { + return releasedAt; + } + + public String getReleasedBy() { + return releasedBy; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public String getCreatedBy() { + return createdBy; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public List getTags() { + return tags; + } + + public java.util.Map getStructuredExpression() { + return structuredExpression; + } + + public List getActionsOnSuccess() { + return actionsOnSuccess; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public static BusinessRule fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRule fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRule fromJson(JsonObject jsonObj) { + BusinessRule obj = new BusinessRule(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.latestVersion = JsonUtil.getInteger(jsonObj, "latest_version"); + + obj.active = JsonUtil.getBoolean(jsonObj, "active"); + + obj.releasedAt = JsonUtil.getTimestamp(jsonObj, "released_at"); + + obj.releasedBy = JsonUtil.getString(jsonObj, "released_by"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.updatedBy = JsonUtil.getString(jsonObj, "updated_by"); + + obj.createdBy = JsonUtil.getString(jsonObj, "created_by"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + JsonArray __tagsArr = JsonUtil.getJsonArray(jsonObj, "tags"); + if (__tagsArr != null) { + obj.tags = JsonUtil.mapArrayToObjects(__tagsArr); + } + + JsonObject __structuredExpressionObj = JsonUtil.getJsonObject(jsonObj, "structured_expression"); + obj.structuredExpression = + __structuredExpressionObj != null + ? JsonUtil.parseJsonObjectToMap(__structuredExpressionObj) + : new java.util.HashMap<>(); + + JsonArray __actionsOnSuccessArr = JsonUtil.getJsonArray(jsonObj, "actions_on_success"); + if (__actionsOnSuccessArr != null) { + obj.actionsOnSuccess = JsonUtil.mapArrayToObjects(__actionsOnSuccessArr); + } + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + return obj; + } + + @Override + public String toString() { + return "BusinessRule{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", latestVersion=" + + latestVersion + + ", active=" + + active + + ", releasedAt=" + + releasedAt + + ", releasedBy=" + + releasedBy + + ", updatedAt=" + + updatedAt + + ", updatedBy=" + + updatedBy + + ", createdBy=" + + createdBy + + ", createdAt=" + + createdAt + + ", tags=" + + tags + + ", structuredExpression=" + + structuredExpression + + ", actionsOnSuccess=" + + actionsOnSuccess + + ", resourceVersion=" + + resourceVersion + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRule that = (BusinessRule) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(latestVersion, that.latestVersion) + && java.util.Objects.equals(active, that.active) + && java.util.Objects.equals(releasedAt, that.releasedAt) + && java.util.Objects.equals(releasedBy, that.releasedBy) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(updatedBy, that.updatedBy) + && java.util.Objects.equals(createdBy, that.createdBy) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(tags, that.tags) + && java.util.Objects.equals(structuredExpression, that.structuredExpression) + && java.util.Objects.equals(actionsOnSuccess, that.actionsOnSuccess) + && java.util.Objects.equals(resourceVersion, that.resourceVersion); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + name, + description, + latestVersion, + active, + releasedAt, + releasedBy, + updatedAt, + updatedBy, + createdBy, + createdAt, + tags, + structuredExpression, + actionsOnSuccess, + resourceVersion); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleActivateRuleParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleActivateRuleParams.java new file mode 100644 index 000000000..cd5072c57 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleActivateRuleParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleActivateRuleParams { + + private BusinessRuleActivateRuleParams(BusinessRuleActivateRuleBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRuleActivateRuleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleActivateRuleBuilder builder() { + return new BusinessRuleActivateRuleBuilder(); + } + + public static final class BusinessRuleActivateRuleBuilder { + + private BusinessRuleActivateRuleBuilder() {} + + public BusinessRuleActivateRuleParams build() { + return new BusinessRuleActivateRuleParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleApplyRulesParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleApplyRulesParams.java new file mode 100644 index 000000000..0ddd9f2da --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleApplyRulesParams.java @@ -0,0 +1,161 @@ +/* + * 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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleApplyRulesParams { + + private final Boolean evaluate; + + private final String ruleId; + + private final String rulesetId; + + private final Boolean skipFailedRules; + + private final java.util.Map structuredExpression; + + private final java.util.Map context; + + private BusinessRuleApplyRulesParams(BusinessRuleApplyRulesBuilder builder) { + + this.evaluate = builder.evaluate; + + this.ruleId = builder.ruleId; + + this.rulesetId = builder.rulesetId; + + this.skipFailedRules = builder.skipFailedRules; + + this.structuredExpression = builder.structuredExpression; + + this.context = builder.context; + } + + public Boolean getEvaluate() { + return evaluate; + } + + public String getRuleId() { + return ruleId; + } + + public String getRulesetId() { + return rulesetId; + } + + public Boolean getSkipFailedRules() { + return skipFailedRules; + } + + public java.util.Map getStructuredExpression() { + return structuredExpression; + } + + public java.util.Map getContext() { + return context; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.evaluate != null) { + + formData.put("evaluate", this.evaluate); + } + + if (this.ruleId != null) { + + formData.put("rule_id", this.ruleId); + } + + if (this.rulesetId != null) { + + formData.put("ruleset_id", this.rulesetId); + } + + if (this.skipFailedRules != null) { + + formData.put("skip_failed_rules", this.skipFailedRules); + } + + if (this.structuredExpression != null) { + + formData.put("structured_expression", JsonUtil.toJson(this.structuredExpression)); + } + + if (this.context != null) { + + formData.put("context", JsonUtil.toJson(this.context)); + } + + return formData; + } + + /** Create a new builder for BusinessRuleApplyRulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleApplyRulesBuilder builder() { + return new BusinessRuleApplyRulesBuilder(); + } + + public static final class BusinessRuleApplyRulesBuilder { + + private Boolean evaluate; + + private String ruleId; + + private String rulesetId; + + private Boolean skipFailedRules; + + private java.util.Map structuredExpression; + + private java.util.Map context; + + private BusinessRuleApplyRulesBuilder() {} + + public BusinessRuleApplyRulesBuilder evaluate(Boolean value) { + this.evaluate = value; + return this; + } + + public BusinessRuleApplyRulesBuilder ruleId(String value) { + this.ruleId = value; + return this; + } + + public BusinessRuleApplyRulesBuilder rulesetId(String value) { + this.rulesetId = value; + return this; + } + + public BusinessRuleApplyRulesBuilder skipFailedRules(Boolean value) { + this.skipFailedRules = value; + return this; + } + + public BusinessRuleApplyRulesBuilder structuredExpression(java.util.Map value) { + this.structuredExpression = value; + return this; + } + + public BusinessRuleApplyRulesBuilder context(java.util.Map value) { + this.context = value; + return this; + } + + public BusinessRuleApplyRulesParams build() { + return new BusinessRuleApplyRulesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleCreateParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleCreateParams.java new file mode 100644 index 000000000..be64d148b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleCreateParams.java @@ -0,0 +1,162 @@ +/* + * 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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRuleCreateParams { + + private final String id; + + private final String name; + + private final String description; + + private final List tags; + + private final java.util.Map structuredExpression; + + private final List actionsOnSuccess; + + private BusinessRuleCreateParams(BusinessRuleCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.tags = builder.tags; + + this.structuredExpression = builder.structuredExpression; + + this.actionsOnSuccess = builder.actionsOnSuccess; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public List getTags() { + return tags; + } + + public java.util.Map getStructuredExpression() { + return structuredExpression; + } + + public List getActionsOnSuccess() { + return actionsOnSuccess; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.tags != null) { + + formData.put("tags", JsonUtil.toJson(this.tags)); + } + + if (this.structuredExpression != null) { + + formData.put("structured_expression", JsonUtil.toJson(this.structuredExpression)); + } + + if (this.actionsOnSuccess != null) { + + formData.put("actions_on_success", JsonUtil.toJson(this.actionsOnSuccess)); + } + + return formData; + } + + /** Create a new builder for BusinessRuleCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleCreateBuilder builder() { + return new BusinessRuleCreateBuilder(); + } + + public static final class BusinessRuleCreateBuilder { + + private String id; + + private String name; + + private String description; + + private List tags; + + private java.util.Map structuredExpression; + + private List actionsOnSuccess; + + private BusinessRuleCreateBuilder() {} + + public BusinessRuleCreateBuilder id(String value) { + this.id = value; + return this; + } + + public BusinessRuleCreateBuilder name(String value) { + this.name = value; + return this; + } + + public BusinessRuleCreateBuilder description(String value) { + this.description = value; + return this; + } + + public BusinessRuleCreateBuilder tags(List value) { + this.tags = value; + return this; + } + + public BusinessRuleCreateBuilder structuredExpression(java.util.Map value) { + this.structuredExpression = value; + return this; + } + + public BusinessRuleCreateBuilder actionsOnSuccess(List value) { + this.actionsOnSuccess = value; + return this; + } + + public BusinessRuleCreateParams build() { + return new BusinessRuleCreateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeactivateRuleParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeactivateRuleParams.java new file mode 100644 index 000000000..c0877f70d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeactivateRuleParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleDeactivateRuleParams { + + private BusinessRuleDeactivateRuleParams(BusinessRuleDeactivateRuleBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRuleDeactivateRuleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleDeactivateRuleBuilder builder() { + return new BusinessRuleDeactivateRuleBuilder(); + } + + public static final class BusinessRuleDeactivateRuleBuilder { + + private BusinessRuleDeactivateRuleBuilder() {} + + public BusinessRuleDeactivateRuleParams build() { + return new BusinessRuleDeactivateRuleParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteDraftParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteDraftParams.java new file mode 100644 index 000000000..130945122 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteDraftParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleDeleteDraftParams { + + private BusinessRuleDeleteDraftParams(BusinessRuleDeleteDraftBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRuleDeleteDraftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleDeleteDraftBuilder builder() { + return new BusinessRuleDeleteDraftBuilder(); + } + + public static final class BusinessRuleDeleteDraftBuilder { + + private BusinessRuleDeleteDraftBuilder() {} + + public BusinessRuleDeleteDraftParams build() { + return new BusinessRuleDeleteDraftParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteParams.java new file mode 100644 index 000000000..f5d6d846f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleDeleteParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleDeleteParams { + + private BusinessRuleDeleteParams(BusinessRuleDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRuleDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleDeleteBuilder builder() { + return new BusinessRuleDeleteBuilder(); + } + + public static final class BusinessRuleDeleteBuilder { + + private BusinessRuleDeleteBuilder() {} + + public BusinessRuleDeleteParams build() { + return new BusinessRuleDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleListParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleListParams.java new file mode 100644 index 000000000..515449459 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleListParams.java @@ -0,0 +1,163 @@ +/* + * 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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.BooleanFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleListParams { + + private final Map queryParams; + + private BusinessRuleListParams(BusinessRuleListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRuleListBuilder toBuilder() { + BusinessRuleListBuilder builder = new BusinessRuleListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRuleListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleListBuilder builder() { + return new BusinessRuleListBuilder(); + } + + public static final class BusinessRuleListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRuleListBuilder() {} + + public BusinessRuleListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public BusinessRuleListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public DraftFilter draft() { + return new DraftFilter("draft", this, queryParams); + } + + public ActiveFilter active() { + return new ActiveFilter("active", this, queryParams); + } + + public BusinessRuleListParams build() { + return new BusinessRuleListParams(this); + } + + public static final class DraftFilter extends BooleanFilter { + DraftFilter(String fieldName, BusinessRuleListBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .draft().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public BusinessRuleListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } + + public static final class ActiveFilter extends BooleanFilter { + ActiveFilter(String fieldName, BusinessRuleListBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .active().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public BusinessRuleListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } + } + + public enum DraftIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that DraftIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DraftIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DraftIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (DraftIs enumValue : DraftIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ActiveIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that ActiveIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActiveIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActiveIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActiveIs enumValue : ActiveIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleReleaseRuleParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleReleaseRuleParams.java new file mode 100644 index 000000000..967440536 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleReleaseRuleParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleReleaseRuleParams { + + private BusinessRuleReleaseRuleParams(BusinessRuleReleaseRuleBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRuleReleaseRuleParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleReleaseRuleBuilder builder() { + return new BusinessRuleReleaseRuleBuilder(); + } + + public static final class BusinessRuleReleaseRuleBuilder { + + private BusinessRuleReleaseRuleBuilder() {} + + public BusinessRuleReleaseRuleParams build() { + return new BusinessRuleReleaseRuleParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveDraftParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveDraftParams.java new file mode 100644 index 000000000..91a950678 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveDraftParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleRetrieveDraftParams { + + private final Map queryParams; + + private BusinessRuleRetrieveDraftParams(BusinessRuleRetrieveDraftBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRuleRetrieveDraftBuilder toBuilder() { + BusinessRuleRetrieveDraftBuilder builder = new BusinessRuleRetrieveDraftBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRuleRetrieveDraftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleRetrieveDraftBuilder builder() { + return new BusinessRuleRetrieveDraftBuilder(); + } + + public static final class BusinessRuleRetrieveDraftBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRuleRetrieveDraftBuilder() {} + + public BusinessRuleRetrieveDraftParams build() { + return new BusinessRuleRetrieveDraftParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveParams.java new file mode 100644 index 000000000..60b46f4b8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleRetrieveParams.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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRuleRetrieveParams { + + private final Map queryParams; + + private BusinessRuleRetrieveParams(BusinessRuleRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRuleRetrieveBuilder toBuilder() { + BusinessRuleRetrieveBuilder builder = new BusinessRuleRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRuleRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleRetrieveBuilder builder() { + return new BusinessRuleRetrieveBuilder(); + } + + public static final class BusinessRuleRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRuleRetrieveBuilder() {} + + public BusinessRuleRetrieveParams build() { + return new BusinessRuleRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleUpdateDraftParams.java b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleUpdateDraftParams.java new file mode 100644 index 000000000..4fa1e297f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/params/BusinessRuleUpdateDraftParams.java @@ -0,0 +1,195 @@ +/* + * 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.businessRule.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRuleUpdateDraftParams { + + private final String name; + + private final String description; + + private final List tags; + + private final java.util.Map structuredExpression; + + private final List actionsOnSuccess; + + private final Map customFields; + + private BusinessRuleUpdateDraftParams(BusinessRuleUpdateDraftBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.tags = builder.tags; + + this.structuredExpression = builder.structuredExpression; + + this.actionsOnSuccess = builder.actionsOnSuccess; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public List getTags() { + return tags; + } + + public java.util.Map getStructuredExpression() { + return structuredExpression; + } + + public List getActionsOnSuccess() { + return actionsOnSuccess; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.tags != null) { + + formData.put("tags", JsonUtil.toJson(this.tags)); + } + + if (this.structuredExpression != null) { + + formData.put("structured_expression", JsonUtil.toJson(this.structuredExpression)); + } + + if (this.actionsOnSuccess != null) { + + formData.put("actions_on_success", JsonUtil.toJson(this.actionsOnSuccess)); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for BusinessRuleUpdateDraftParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRuleUpdateDraftBuilder builder() { + return new BusinessRuleUpdateDraftBuilder(); + } + + public static final class BusinessRuleUpdateDraftBuilder { + + private String name; + + private String description; + + private List tags; + + private java.util.Map structuredExpression; + + private List actionsOnSuccess; + + private Map customFields = new LinkedHashMap<>(); + + private BusinessRuleUpdateDraftBuilder() {} + + public BusinessRuleUpdateDraftBuilder name(String value) { + this.name = value; + return this; + } + + public BusinessRuleUpdateDraftBuilder description(String value) { + this.description = value; + return this; + } + + public BusinessRuleUpdateDraftBuilder tags(List value) { + this.tags = value; + return this; + } + + public BusinessRuleUpdateDraftBuilder structuredExpression( + java.util.Map value) { + this.structuredExpression = value; + return this; + } + + public BusinessRuleUpdateDraftBuilder actionsOnSuccess(List value) { + this.actionsOnSuccess = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public BusinessRuleUpdateDraftBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public BusinessRuleUpdateDraftBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public BusinessRuleUpdateDraftParams build() { + return new BusinessRuleUpdateDraftParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleActivateRuleResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleActivateRuleResponse.java new file mode 100644 index 000000000..3d7e145eb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleActivateRuleResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleActivateRule operation. Contains the response data from + * the API. + */ +public final class BusinessRuleActivateRuleResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleActivateRuleResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleActivateRuleResponse object. */ + public static BusinessRuleActivateRuleResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleActivateRuleResponse object with HTTP response. */ + public static BusinessRuleActivateRuleResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleActivateRuleResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleActivateRuleResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleActivateRuleResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleActivateRuleResponse build() { + return new BusinessRuleActivateRuleResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleActivateRuleResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleActivateRuleResponse that = (BusinessRuleActivateRuleResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleApplyRulesResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleApplyRulesResponse.java new file mode 100644 index 000000000..ce8d99c55 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleApplyRulesResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.applyRule.ApplyRule; + +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 BusinessRuleApplyRules operation. Contains the response data from + * the API. + */ +public final class BusinessRuleApplyRulesResponse extends BaseResponse { + private final ApplyRule applyRule; + + private BusinessRuleApplyRulesResponse(Builder builder) { + super(builder.httpResponse); + + this.applyRule = builder.applyRule; + } + + /** Parse JSON response into BusinessRuleApplyRulesResponse object. */ + public static BusinessRuleApplyRulesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleApplyRulesResponse object with HTTP response. */ + public static BusinessRuleApplyRulesResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __applyRuleObj = JsonUtil.getJsonObject(jsonObj, "apply_rule"); + if (__applyRuleObj != null) { + builder.applyRule(ApplyRule.fromJson(__applyRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleApplyRulesResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleApplyRulesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleApplyRulesResponse. */ + public static class Builder { + + private ApplyRule applyRule; + + private Response httpResponse; + + private Builder() {} + + public Builder applyRule(ApplyRule applyRule) { + this.applyRule = applyRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleApplyRulesResponse build() { + return new BusinessRuleApplyRulesResponse(this); + } + } + + /** Get the applyRule from the response. */ + public ApplyRule getApplyRule() { + return applyRule; + } + + @Override + public String toString() { + return "BusinessRuleApplyRulesResponse{" + "applyRule=" + applyRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleApplyRulesResponse that = (BusinessRuleApplyRulesResponse) o; + return java.util.Objects.equals(applyRule, that.applyRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(applyRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleCreateResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleCreateResponse.java new file mode 100644 index 000000000..01597e7dd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleCreateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleCreate operation. Contains the response data from the + * API. + */ +public final class BusinessRuleCreateResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleCreateResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleCreateResponse object. */ + public static BusinessRuleCreateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleCreateResponse object with HTTP response. */ + public static BusinessRuleCreateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleCreateResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleCreateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleCreateResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleCreateResponse build() { + return new BusinessRuleCreateResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleCreateResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleCreateResponse that = (BusinessRuleCreateResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeactivateRuleResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeactivateRuleResponse.java new file mode 100644 index 000000000..9eefd75bb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeactivateRuleResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleDeactivateRule operation. Contains the response data + * from the API. + */ +public final class BusinessRuleDeactivateRuleResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleDeactivateRuleResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleDeactivateRuleResponse object. */ + public static BusinessRuleDeactivateRuleResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleDeactivateRuleResponse object with HTTP response. */ + public static BusinessRuleDeactivateRuleResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleDeactivateRuleResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleDeactivateRuleResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleDeactivateRuleResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleDeactivateRuleResponse build() { + return new BusinessRuleDeactivateRuleResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleDeactivateRuleResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleDeactivateRuleResponse that = (BusinessRuleDeactivateRuleResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteDraftResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteDraftResponse.java new file mode 100644 index 000000000..cd25b2f57 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteDraftResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleDeleteDraft operation. Contains the response data from + * the API. + */ +public final class BusinessRuleDeleteDraftResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleDeleteDraftResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleDeleteDraftResponse object. */ + public static BusinessRuleDeleteDraftResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleDeleteDraftResponse object with HTTP response. */ + public static BusinessRuleDeleteDraftResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleDeleteDraftResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleDeleteDraftResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleDeleteDraftResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleDeleteDraftResponse build() { + return new BusinessRuleDeleteDraftResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleDeleteDraftResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleDeleteDraftResponse that = (BusinessRuleDeleteDraftResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteResponse.java new file mode 100644 index 000000000..f718519f5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleDeleteResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleDelete operation. Contains the response data from the + * API. + */ +public final class BusinessRuleDeleteResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleDeleteResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleDeleteResponse object. */ + public static BusinessRuleDeleteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleDeleteResponse object with HTTP response. */ + public static BusinessRuleDeleteResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleDeleteResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleDeleteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleDeleteResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleDeleteResponse build() { + return new BusinessRuleDeleteResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleDeleteResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleDeleteResponse that = (BusinessRuleDeleteResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleListResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleListResponse.java new file mode 100644 index 000000000..c011a4109 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleListResponse.java @@ -0,0 +1,209 @@ +package com.chargebee.v4.models.businessRule.responses; + +import java.util.List; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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.BusinessRuleService; +import com.chargebee.v4.models.businessRule.params.BusinessRuleListParams; + +/** Immutable response object for BusinessRuleList operation. Contains paginated list data. */ +public final class BusinessRuleListResponse { + + private final List list; + + private final String nextOffset; + + private final BusinessRuleService service; + private final BusinessRuleListParams originalParams; + private final Response httpResponse; + + private BusinessRuleListResponse( + List list, + String nextOffset, + BusinessRuleService service, + BusinessRuleListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into BusinessRuleListResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static BusinessRuleListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), BusinessRuleListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new BusinessRuleListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleListResponse from JSON", e); + } + } + + /** + * Parse JSON response into BusinessRuleListResponse object with service context for pagination + * (enables nextPage()). + */ + public static BusinessRuleListResponse fromJson( + String json, + BusinessRuleService service, + BusinessRuleListParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), BusinessRuleListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new BusinessRuleListResponse(list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleListResponse 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 BusinessRuleListResponse 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)."); + } + + BusinessRuleListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : BusinessRuleListParams.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 "BusinessRuleListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleListResponse that = (BusinessRuleListResponse) 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 BusinessRuleListItem { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static BusinessRuleListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleListItem fromJson(JsonObject jsonObj) { + BusinessRuleListItem item = new BusinessRuleListItem(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + item.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return item; + } + + @Override + public String toString() { + return "BusinessRuleListItem{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleListItem that = (BusinessRuleListItem) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleReleaseRuleResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleReleaseRuleResponse.java new file mode 100644 index 000000000..0c501279f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleReleaseRuleResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleReleaseRule operation. Contains the response data from + * the API. + */ +public final class BusinessRuleReleaseRuleResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleReleaseRuleResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleReleaseRuleResponse object. */ + public static BusinessRuleReleaseRuleResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleReleaseRuleResponse object with HTTP response. */ + public static BusinessRuleReleaseRuleResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleReleaseRuleResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleReleaseRuleResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleReleaseRuleResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleReleaseRuleResponse build() { + return new BusinessRuleReleaseRuleResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleReleaseRuleResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleReleaseRuleResponse that = (BusinessRuleReleaseRuleResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveDraftResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveDraftResponse.java new file mode 100644 index 000000000..2cf4eb5ca --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveDraftResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleRetrieveDraft operation. Contains the response data + * from a single resource get operation. + */ +public final class BusinessRuleRetrieveDraftResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleRetrieveDraftResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleRetrieveDraftResponse object. */ + public static BusinessRuleRetrieveDraftResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleRetrieveDraftResponse object with HTTP response. */ + public static BusinessRuleRetrieveDraftResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleRetrieveDraftResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleRetrieveDraftResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleRetrieveDraftResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleRetrieveDraftResponse build() { + return new BusinessRuleRetrieveDraftResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleRetrieveDraftResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleRetrieveDraftResponse that = (BusinessRuleRetrieveDraftResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveResponse.java new file mode 100644 index 000000000..599a916de --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleRetrieveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class BusinessRuleRetrieveResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleRetrieveResponse object. */ + public static BusinessRuleRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleRetrieveResponse object with HTTP response. */ + public static BusinessRuleRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleRetrieveResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleRetrieveResponse build() { + return new BusinessRuleRetrieveResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleRetrieveResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleRetrieveResponse that = (BusinessRuleRetrieveResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleUpdateDraftResponse.java b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleUpdateDraftResponse.java new file mode 100644 index 000000000..d1e6f1dc4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRule/responses/BusinessRuleUpdateDraftResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRule.responses; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +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 BusinessRuleUpdateDraft operation. Contains the response data from + * the API. + */ +public final class BusinessRuleUpdateDraftResponse extends BaseResponse { + private final BusinessRule businessRule; + + private BusinessRuleUpdateDraftResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRule = builder.businessRule; + } + + /** Parse JSON response into BusinessRuleUpdateDraftResponse object. */ + public static BusinessRuleUpdateDraftResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRuleUpdateDraftResponse object with HTTP response. */ + public static BusinessRuleUpdateDraftResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + builder.businessRule(BusinessRule.fromJson(__businessRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRuleUpdateDraftResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRuleUpdateDraftResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRuleUpdateDraftResponse. */ + public static class Builder { + + private BusinessRule businessRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRule(BusinessRule businessRule) { + this.businessRule = businessRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRuleUpdateDraftResponse build() { + return new BusinessRuleUpdateDraftResponse(this); + } + } + + /** Get the businessRule from the response. */ + public BusinessRule getBusinessRule() { + return businessRule; + } + + @Override + public String toString() { + return "BusinessRuleUpdateDraftResponse{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleUpdateDraftResponse that = (BusinessRuleUpdateDraftResponse) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/BusinessRuleset.java b/src/main/java/com/chargebee/v4/models/businessRuleset/BusinessRuleset.java new file mode 100644 index 000000000..79bfa8477 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/BusinessRuleset.java @@ -0,0 +1,208 @@ +/* + * 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.businessRuleset; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.sql.Timestamp; +import java.util.List; + +public class BusinessRuleset { + + private String id; + private String name; + private String description; + private Boolean active; + private ExecuteMode executeMode; + private Timestamp updatedAt; + private String updatedBy; + private String createdBy; + private Timestamp createdAt; + private List rules; + private Long resourceVersion; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Boolean getActive() { + return active; + } + + public ExecuteMode getExecuteMode() { + return executeMode; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public String getCreatedBy() { + return createdBy; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public List getRules() { + return rules; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public enum ExecuteMode { + STOP_ON_FIRST_TRUE("stop_on_first_true"), + + STOP_ON_FIRST_FALSE("stop_on_first_false"), + + EXECUTE_ALL("execute_all"), + + EXECUTE_ALL_TRUE("execute_all_true"), + + /** An enum member indicating that ExecuteMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExecuteMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExecuteMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExecuteMode enumValue : ExecuteMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static BusinessRuleset fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleset fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleset fromJson(JsonObject jsonObj) { + BusinessRuleset obj = new BusinessRuleset(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.active = JsonUtil.getBoolean(jsonObj, "active"); + + obj.executeMode = ExecuteMode.fromString(JsonUtil.getString(jsonObj, "execute_mode")); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.updatedBy = JsonUtil.getString(jsonObj, "updated_by"); + + obj.createdBy = JsonUtil.getString(jsonObj, "created_by"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + JsonArray __rulesArr = JsonUtil.getJsonArray(jsonObj, "rules"); + if (__rulesArr != null) { + obj.rules = JsonUtil.mapArrayToObjects(__rulesArr); + } + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleset{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", active=" + + active + + ", executeMode=" + + executeMode + + ", updatedAt=" + + updatedAt + + ", updatedBy=" + + updatedBy + + ", createdBy=" + + createdBy + + ", createdAt=" + + createdAt + + ", rules=" + + rules + + ", resourceVersion=" + + resourceVersion + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleset that = (BusinessRuleset) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(active, that.active) + && java.util.Objects.equals(executeMode, that.executeMode) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(updatedBy, that.updatedBy) + && java.util.Objects.equals(createdBy, that.createdBy) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(rules, that.rules) + && java.util.Objects.equals(resourceVersion, that.resourceVersion); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + name, + description, + active, + executeMode, + updatedAt, + updatedBy, + createdBy, + createdAt, + rules, + resourceVersion); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetActivateParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetActivateParams.java new file mode 100644 index 000000000..e0848f097 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetActivateParams.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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetActivateParams { + + private BusinessRulesetActivateParams(BusinessRulesetActivateBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRulesetActivateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetActivateBuilder builder() { + return new BusinessRulesetActivateBuilder(); + } + + public static final class BusinessRulesetActivateBuilder { + + private BusinessRulesetActivateBuilder() {} + + public BusinessRulesetActivateParams build() { + return new BusinessRulesetActivateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetAddRulesParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetAddRulesParams.java new file mode 100644 index 000000000..aa355076f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetAddRulesParams.java @@ -0,0 +1,114 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRulesetAddRulesParams { + + private final List rules; + + private final Map customFields; + + private BusinessRulesetAddRulesParams(BusinessRulesetAddRulesBuilder builder) { + + this.rules = builder.rules; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public List getRules() { + return rules; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.rules != null) { + + formData.put("rules", JsonUtil.toJson(this.rules)); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for BusinessRulesetAddRulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetAddRulesBuilder builder() { + return new BusinessRulesetAddRulesBuilder(); + } + + public static final class BusinessRulesetAddRulesBuilder { + + private List rules; + + private Map customFields = new LinkedHashMap<>(); + + private BusinessRulesetAddRulesBuilder() {} + + public BusinessRulesetAddRulesBuilder rules(List value) { + this.rules = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public BusinessRulesetAddRulesBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public BusinessRulesetAddRulesBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public BusinessRulesetAddRulesParams build() { + return new BusinessRulesetAddRulesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetCreateParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetCreateParams.java new file mode 100644 index 000000000..c09e9a1b3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetCreateParams.java @@ -0,0 +1,174 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRulesetCreateParams { + + private final String id; + + private final String name; + + private final String description; + + private final ExecuteMode executeMode; + + private final List rules; + + private BusinessRulesetCreateParams(BusinessRulesetCreateBuilder builder) { + + this.id = builder.id; + + this.name = builder.name; + + this.description = builder.description; + + this.executeMode = builder.executeMode; + + this.rules = builder.rules; + } + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public ExecuteMode getExecuteMode() { + return executeMode; + } + + public List getRules() { + return rules; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.id != null) { + + formData.put("id", this.id); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.executeMode != null) { + + formData.put("execute_mode", this.executeMode); + } + + if (this.rules != null) { + + formData.put("rules", JsonUtil.toJson(this.rules)); + } + + return formData; + } + + /** Create a new builder for BusinessRulesetCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetCreateBuilder builder() { + return new BusinessRulesetCreateBuilder(); + } + + public static final class BusinessRulesetCreateBuilder { + + private String id; + + private String name; + + private String description; + + private ExecuteMode executeMode; + + private List rules; + + private BusinessRulesetCreateBuilder() {} + + public BusinessRulesetCreateBuilder id(String value) { + this.id = value; + return this; + } + + public BusinessRulesetCreateBuilder name(String value) { + this.name = value; + return this; + } + + public BusinessRulesetCreateBuilder description(String value) { + this.description = value; + return this; + } + + public BusinessRulesetCreateBuilder executeMode(ExecuteMode value) { + this.executeMode = value; + return this; + } + + public BusinessRulesetCreateBuilder rules(List value) { + this.rules = value; + return this; + } + + public BusinessRulesetCreateParams build() { + return new BusinessRulesetCreateParams(this); + } + } + + public enum ExecuteMode { + STOP_ON_FIRST_TRUE("stop_on_first_true"), + + STOP_ON_FIRST_FALSE("stop_on_first_false"), + + EXECUTE_ALL("execute_all"), + + EXECUTE_ALL_TRUE("execute_all_true"), + + /** An enum member indicating that ExecuteMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExecuteMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExecuteMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExecuteMode enumValue : ExecuteMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeactivateParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeactivateParams.java new file mode 100644 index 000000000..20c05a574 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeactivateParams.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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetDeactivateParams { + + private BusinessRulesetDeactivateParams(BusinessRulesetDeactivateBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRulesetDeactivateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetDeactivateBuilder builder() { + return new BusinessRulesetDeactivateBuilder(); + } + + public static final class BusinessRulesetDeactivateBuilder { + + private BusinessRulesetDeactivateBuilder() {} + + public BusinessRulesetDeactivateParams build() { + return new BusinessRulesetDeactivateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeleteParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeleteParams.java new file mode 100644 index 000000000..93206703e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetDeleteParams.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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetDeleteParams { + + private BusinessRulesetDeleteParams(BusinessRulesetDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for BusinessRulesetDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetDeleteBuilder builder() { + return new BusinessRulesetDeleteBuilder(); + } + + public static final class BusinessRulesetDeleteBuilder { + + private BusinessRulesetDeleteBuilder() {} + + public BusinessRulesetDeleteParams build() { + return new BusinessRulesetDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListParams.java new file mode 100644 index 000000000..cb4088a74 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListParams.java @@ -0,0 +1,113 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.BooleanFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetListParams { + + private final Map queryParams; + + private BusinessRulesetListParams(BusinessRulesetListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRulesetListBuilder toBuilder() { + BusinessRulesetListBuilder builder = new BusinessRulesetListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRulesetListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetListBuilder builder() { + return new BusinessRulesetListBuilder(); + } + + public static final class BusinessRulesetListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRulesetListBuilder() {} + + public BusinessRulesetListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public BusinessRulesetListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ActiveFilter active() { + return new ActiveFilter("active", this, queryParams); + } + + public BusinessRulesetListParams build() { + return new BusinessRulesetListParams(this); + } + + public static final class ActiveFilter extends BooleanFilter { + ActiveFilter( + String fieldName, BusinessRulesetListBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .active().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public BusinessRulesetListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } + } + + public enum ActiveIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that ActiveIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActiveIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActiveIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActiveIs enumValue : ActiveIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListRulesParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListRulesParams.java new file mode 100644 index 000000000..946f36103 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetListRulesParams.java @@ -0,0 +1,113 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.BooleanFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetListRulesParams { + + private final Map queryParams; + + private BusinessRulesetListRulesParams(BusinessRulesetListRulesBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRulesetListRulesBuilder toBuilder() { + BusinessRulesetListRulesBuilder builder = new BusinessRulesetListRulesBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRulesetListRulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetListRulesBuilder builder() { + return new BusinessRulesetListRulesBuilder(); + } + + public static final class BusinessRulesetListRulesBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRulesetListRulesBuilder() {} + + public BusinessRulesetListRulesBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public BusinessRulesetListRulesBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ActiveFilter active() { + return new ActiveFilter("active", this, queryParams); + } + + public BusinessRulesetListRulesParams build() { + return new BusinessRulesetListRulesParams(this); + } + + public static final class ActiveFilter extends BooleanFilter { + ActiveFilter( + String fieldName, BusinessRulesetListRulesBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .active().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public BusinessRulesetListRulesBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } + } + + public enum ActiveIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that ActiveIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActiveIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActiveIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActiveIs enumValue : ActiveIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRemoveRulesParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRemoveRulesParams.java new file mode 100644 index 000000000..fb35af30a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRemoveRulesParams.java @@ -0,0 +1,114 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRulesetRemoveRulesParams { + + private final List rules; + + private final Map customFields; + + private BusinessRulesetRemoveRulesParams(BusinessRulesetRemoveRulesBuilder builder) { + + this.rules = builder.rules; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public List getRules() { + return rules; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.rules != null) { + + formData.put("rules", JsonUtil.toJson(this.rules)); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for BusinessRulesetRemoveRulesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetRemoveRulesBuilder builder() { + return new BusinessRulesetRemoveRulesBuilder(); + } + + public static final class BusinessRulesetRemoveRulesBuilder { + + private List rules; + + private Map customFields = new LinkedHashMap<>(); + + private BusinessRulesetRemoveRulesBuilder() {} + + public BusinessRulesetRemoveRulesBuilder rules(List value) { + this.rules = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public BusinessRulesetRemoveRulesBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public BusinessRulesetRemoveRulesBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public BusinessRulesetRemoveRulesParams build() { + return new BusinessRulesetRemoveRulesParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRetrieveParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRetrieveParams.java new file mode 100644 index 000000000..e100a4d4f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetRetrieveParams.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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BusinessRulesetRetrieveParams { + + private final Map queryParams; + + private BusinessRulesetRetrieveParams(BusinessRulesetRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public BusinessRulesetRetrieveBuilder toBuilder() { + BusinessRulesetRetrieveBuilder builder = new BusinessRulesetRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for BusinessRulesetRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetRetrieveBuilder builder() { + return new BusinessRulesetRetrieveBuilder(); + } + + public static final class BusinessRulesetRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private BusinessRulesetRetrieveBuilder() {} + + public BusinessRulesetRetrieveParams build() { + return new BusinessRulesetRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetUpdateParams.java b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetUpdateParams.java new file mode 100644 index 000000000..6596c5683 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/params/BusinessRulesetUpdateParams.java @@ -0,0 +1,206 @@ +/* + * 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.businessRuleset.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class BusinessRulesetUpdateParams { + + private final String name; + + private final String description; + + private final ExecuteMode executeMode; + + private final List rules; + + private final Map customFields; + + private BusinessRulesetUpdateParams(BusinessRulesetUpdateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.executeMode = builder.executeMode; + + this.rules = builder.rules; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public ExecuteMode getExecuteMode() { + return executeMode; + } + + public List getRules() { + return rules; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.executeMode != null) { + + formData.put("execute_mode", this.executeMode); + } + + if (this.rules != null) { + + formData.put("rules", JsonUtil.toJson(this.rules)); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for BusinessRulesetUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BusinessRulesetUpdateBuilder builder() { + return new BusinessRulesetUpdateBuilder(); + } + + public static final class BusinessRulesetUpdateBuilder { + + private String name; + + private String description; + + private ExecuteMode executeMode; + + private List rules; + + private Map customFields = new LinkedHashMap<>(); + + private BusinessRulesetUpdateBuilder() {} + + public BusinessRulesetUpdateBuilder name(String value) { + this.name = value; + return this; + } + + public BusinessRulesetUpdateBuilder description(String value) { + this.description = value; + return this; + } + + public BusinessRulesetUpdateBuilder executeMode(ExecuteMode value) { + this.executeMode = value; + return this; + } + + public BusinessRulesetUpdateBuilder rules(List value) { + this.rules = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public BusinessRulesetUpdateBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public BusinessRulesetUpdateBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public BusinessRulesetUpdateParams build() { + return new BusinessRulesetUpdateParams(this); + } + } + + public enum ExecuteMode { + STOP_ON_FIRST_TRUE("stop_on_first_true"), + + STOP_ON_FIRST_FALSE("stop_on_first_false"), + + EXECUTE_ALL("execute_all"), + + EXECUTE_ALL_TRUE("execute_all_true"), + + /** An enum member indicating that ExecuteMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExecuteMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExecuteMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExecuteMode enumValue : ExecuteMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetActivateResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetActivateResponse.java new file mode 100644 index 000000000..c3a1ce6cc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetActivateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetActivate operation. Contains the response data from + * the API. + */ +public final class BusinessRulesetActivateResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetActivateResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetActivateResponse object. */ + public static BusinessRulesetActivateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetActivateResponse object with HTTP response. */ + public static BusinessRulesetActivateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetActivateResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetActivateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetActivateResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetActivateResponse build() { + return new BusinessRulesetActivateResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetActivateResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetActivateResponse that = (BusinessRulesetActivateResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetAddRulesResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetAddRulesResponse.java new file mode 100644 index 000000000..1b735c9e3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetAddRulesResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetAddRules operation. Contains the response data from + * the API. + */ +public final class BusinessRulesetAddRulesResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetAddRulesResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetAddRulesResponse object. */ + public static BusinessRulesetAddRulesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetAddRulesResponse object with HTTP response. */ + public static BusinessRulesetAddRulesResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetAddRulesResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetAddRulesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetAddRulesResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetAddRulesResponse build() { + return new BusinessRulesetAddRulesResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetAddRulesResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetAddRulesResponse that = (BusinessRulesetAddRulesResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetCreateResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetCreateResponse.java new file mode 100644 index 000000000..436dc7e59 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetCreateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetCreate operation. Contains the response data from + * the API. + */ +public final class BusinessRulesetCreateResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetCreateResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetCreateResponse object. */ + public static BusinessRulesetCreateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetCreateResponse object with HTTP response. */ + public static BusinessRulesetCreateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetCreateResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetCreateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetCreateResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetCreateResponse build() { + return new BusinessRulesetCreateResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetCreateResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetCreateResponse that = (BusinessRulesetCreateResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeactivateResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeactivateResponse.java new file mode 100644 index 000000000..293a433cd --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeactivateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetDeactivate operation. Contains the response data + * from the API. + */ +public final class BusinessRulesetDeactivateResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetDeactivateResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetDeactivateResponse object. */ + public static BusinessRulesetDeactivateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetDeactivateResponse object with HTTP response. */ + public static BusinessRulesetDeactivateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetDeactivateResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetDeactivateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetDeactivateResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetDeactivateResponse build() { + return new BusinessRulesetDeactivateResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetDeactivateResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetDeactivateResponse that = (BusinessRulesetDeactivateResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeleteResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeleteResponse.java new file mode 100644 index 000000000..37b069c4d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetDeleteResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetDelete operation. Contains the response data from + * the API. + */ +public final class BusinessRulesetDeleteResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetDeleteResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetDeleteResponse object. */ + public static BusinessRulesetDeleteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetDeleteResponse object with HTTP response. */ + public static BusinessRulesetDeleteResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetDeleteResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetDeleteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetDeleteResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetDeleteResponse build() { + return new BusinessRulesetDeleteResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetDeleteResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetDeleteResponse that = (BusinessRulesetDeleteResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListResponse.java new file mode 100644 index 000000000..7ad9e463a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListResponse.java @@ -0,0 +1,212 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import java.util.List; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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.BusinessRulesetService; +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetListParams; + +/** Immutable response object for BusinessRulesetList operation. Contains paginated list data. */ +public final class BusinessRulesetListResponse { + + private final List list; + + private final String nextOffset; + + private final BusinessRulesetService service; + private final BusinessRulesetListParams originalParams; + private final Response httpResponse; + + private BusinessRulesetListResponse( + List list, + String nextOffset, + BusinessRulesetService service, + BusinessRulesetListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into BusinessRulesetListResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static BusinessRulesetListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), BusinessRulesetListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new BusinessRulesetListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetListResponse from JSON", e); + } + } + + /** + * Parse JSON response into BusinessRulesetListResponse object with service context for pagination + * (enables nextPage()). + */ + public static BusinessRulesetListResponse fromJson( + String json, + BusinessRulesetService service, + BusinessRulesetListParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), BusinessRulesetListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new BusinessRulesetListResponse( + list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetListResponse 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 BusinessRulesetListResponse 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)."); + } + + BusinessRulesetListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : BusinessRulesetListParams.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 "BusinessRulesetListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetListResponse that = (BusinessRulesetListResponse) 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 BusinessRulesetListItem { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static BusinessRulesetListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetListItem fromJson(JsonObject jsonObj) { + BusinessRulesetListItem item = new BusinessRulesetListItem(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + item.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return item; + } + + @Override + public String toString() { + return "BusinessRulesetListItem{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetListItem that = (BusinessRulesetListItem) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListRulesResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListRulesResponse.java new file mode 100644 index 000000000..23f1644b6 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetListRulesResponse.java @@ -0,0 +1,100 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRulesetRule.BusinessRulesetRule; + +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 BusinessRulesetListRules operation. Contains the response data from + * a single resource get operation. + */ +public final class BusinessRulesetListRulesResponse extends BaseResponse { + private final BusinessRulesetRule businessRulesetRule; + + private BusinessRulesetListRulesResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRulesetRule = builder.businessRulesetRule; + } + + /** Parse JSON response into BusinessRulesetListRulesResponse object. */ + public static BusinessRulesetListRulesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetListRulesResponse object with HTTP response. */ + public static BusinessRulesetListRulesResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetRuleObj = + JsonUtil.getJsonObject(jsonObj, "business_ruleset_rule"); + if (__businessRulesetRuleObj != null) { + builder.businessRulesetRule(BusinessRulesetRule.fromJson(__businessRulesetRuleObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetListRulesResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetListRulesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetListRulesResponse. */ + public static class Builder { + + private BusinessRulesetRule businessRulesetRule; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRulesetRule(BusinessRulesetRule businessRulesetRule) { + this.businessRulesetRule = businessRulesetRule; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetListRulesResponse build() { + return new BusinessRulesetListRulesResponse(this); + } + } + + /** Get the businessRulesetRule from the response. */ + public BusinessRulesetRule getBusinessRulesetRule() { + return businessRulesetRule; + } + + @Override + public String toString() { + return "BusinessRulesetListRulesResponse{" + "businessRulesetRule=" + businessRulesetRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetListRulesResponse that = (BusinessRulesetListRulesResponse) o; + return java.util.Objects.equals(businessRulesetRule, that.businessRulesetRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRulesetRule); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRemoveRulesResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRemoveRulesResponse.java new file mode 100644 index 000000000..6fa0ed7b1 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRemoveRulesResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetRemoveRules operation. Contains the response data + * from the API. + */ +public final class BusinessRulesetRemoveRulesResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetRemoveRulesResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetRemoveRulesResponse object. */ + public static BusinessRulesetRemoveRulesResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetRemoveRulesResponse object with HTTP response. */ + public static BusinessRulesetRemoveRulesResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetRemoveRulesResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetRemoveRulesResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetRemoveRulesResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetRemoveRulesResponse build() { + return new BusinessRulesetRemoveRulesResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetRemoveRulesResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetRemoveRulesResponse that = (BusinessRulesetRemoveRulesResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRetrieveResponse.java new file mode 100644 index 000000000..a59693310 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetRetrieveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetRetrieve operation. Contains the response data from + * a single resource get operation. + */ +public final class BusinessRulesetRetrieveResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetRetrieveResponse object. */ + public static BusinessRulesetRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetRetrieveResponse object with HTTP response. */ + public static BusinessRulesetRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetRetrieveResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetRetrieveResponse build() { + return new BusinessRulesetRetrieveResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetRetrieveResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetRetrieveResponse that = (BusinessRulesetRetrieveResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetUpdateResponse.java b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetUpdateResponse.java new file mode 100644 index 000000000..02ec8cf25 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRuleset/responses/BusinessRulesetUpdateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.businessRuleset.responses; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +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 BusinessRulesetUpdate operation. Contains the response data from + * the API. + */ +public final class BusinessRulesetUpdateResponse extends BaseResponse { + private final BusinessRuleset businessRuleset; + + private BusinessRulesetUpdateResponse(Builder builder) { + super(builder.httpResponse); + + this.businessRuleset = builder.businessRuleset; + } + + /** Parse JSON response into BusinessRulesetUpdateResponse object. */ + public static BusinessRulesetUpdateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into BusinessRulesetUpdateResponse object with HTTP response. */ + public static BusinessRulesetUpdateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + builder.businessRuleset(BusinessRuleset.fromJson(__businessRulesetObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse BusinessRulesetUpdateResponse from JSON", e); + } + } + + /** Create a new builder for BusinessRulesetUpdateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for BusinessRulesetUpdateResponse. */ + public static class Builder { + + private BusinessRuleset businessRuleset; + + private Response httpResponse; + + private Builder() {} + + public Builder businessRuleset(BusinessRuleset businessRuleset) { + this.businessRuleset = businessRuleset; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public BusinessRulesetUpdateResponse build() { + return new BusinessRulesetUpdateResponse(this); + } + } + + /** Get the businessRuleset from the response. */ + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + @Override + public String toString() { + return "BusinessRulesetUpdateResponse{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetUpdateResponse that = (BusinessRulesetUpdateResponse) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } +} diff --git a/src/main/java/com/chargebee/v4/models/businessRulesetRule/BusinessRulesetRule.java b/src/main/java/com/chargebee/v4/models/businessRulesetRule/BusinessRulesetRule.java new file mode 100644 index 000000000..3962483e7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/businessRulesetRule/BusinessRulesetRule.java @@ -0,0 +1,64 @@ +/* + * 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.businessRulesetRule; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +public class BusinessRulesetRule { + + private String ruleId; + private Integer priority; + + public String getRuleId() { + return ruleId; + } + + public Integer getPriority() { + return priority; + } + + public static BusinessRulesetRule fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetRule fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetRule fromJson(JsonObject jsonObj) { + BusinessRulesetRule obj = new BusinessRulesetRule(); + + obj.ruleId = JsonUtil.getString(jsonObj, "rule_id"); + + obj.priority = JsonUtil.getInteger(jsonObj, "priority"); + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetRule{" + "ruleId=" + ruleId + ", priority=" + priority + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetRule that = (BusinessRulesetRule) o; + return java.util.Objects.equals(ruleId, that.ruleId) + && java.util.Objects.equals(priority, that.priority); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(ruleId, priority); + } +} 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 9c981ae2e..403f3aab2 100644 --- a/src/main/java/com/chargebee/v4/models/card/Card.java +++ b/src/main/java/com/chargebee/v4/models/card/Card.java @@ -305,6 +305,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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/card/params/CardSwitchGatewayForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java index ae1441218..bef5de6ff 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 @@ -188,6 +188,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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 6c4c9b266..3cba08563 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 @@ -545,6 +545,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -575,6 +577,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java index 426884eb9..22437f2aa 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java @@ -51,6 +51,7 @@ public class CreditNote { private String createReasonCode; private String vatNumberPrefix; private String businessEntityId; + private String brandId; private List lineItems; private List lineItemTiers; private List lineItemDiscounts; @@ -209,6 +210,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public List getLineItems() { return lineItems; } @@ -540,6 +545,8 @@ public static CreditNote fromJson(JsonObject jsonObj) { knownFields.add("business_entity_id"); + knownFields.add("brand_id"); + knownFields.add("line_items"); knownFields.add("line_item_tiers"); @@ -643,6 +650,8 @@ public static CreditNote fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + obj.lineItems = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "line_items"), LineItems::fromJson); @@ -782,6 +791,8 @@ public String toString() { + vatNumberPrefix + ", businessEntityId=" + businessEntityId + + ", brandId=" + + brandId + ", lineItems=" + lineItems + ", lineItemTiers=" @@ -858,6 +869,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(createReasonCode, that.createReasonCode) && java.util.Objects.equals(vatNumberPrefix, that.vatNumberPrefix) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(lineItems, that.lineItems) && java.util.Objects.equals(lineItemTiers, that.lineItemTiers) && java.util.Objects.equals(lineItemDiscounts, that.lineItemDiscounts) @@ -915,6 +927,7 @@ public int hashCode() { createReasonCode, vatNumberPrefix, businessEntityId, + brandId, lineItems, lineItemTiers, lineItemDiscounts, diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java index 09c97bdef..c184c48dd 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteRecordRefundParams.java @@ -268,14 +268,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEmailParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEmailParams.java new file mode 100644 index 000000000..0f417454f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteSendEmailParams.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.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteSendEmailParams { + + private CreditNoteSendEmailParams(CreditNoteSendEmailBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for CreditNoteSendEmailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteSendEmailBuilder builder() { + return new CreditNoteSendEmailBuilder(); + } + + public static final class CreditNoteSendEmailBuilder { + + private CreditNoteSendEmailBuilder() {} + + public CreditNoteSendEmailParams build() { + return new CreditNoteSendEmailParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java index d00c728bb..61559b837 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java @@ -732,6 +732,10 @@ public static final class LineItemsParams { private final Long tax10Amount; + private final Boolean isPartialTaxApplied; + + private final Long taxableAmount; + private final ProrationMode prorationMode; private LineItemsParams(LineItemsBuilder builder) { @@ -812,6 +816,10 @@ private LineItemsParams(LineItemsBuilder builder) { this.tax10Amount = builder.tax10Amount; + this.isPartialTaxApplied = builder.isPartialTaxApplied; + + this.taxableAmount = builder.taxableAmount; + this.prorationMode = builder.prorationMode; } @@ -967,6 +975,14 @@ public Long getTax10Amount() { return tax10Amount; } + public Boolean getIsPartialTaxApplied() { + return isPartialTaxApplied; + } + + public Long getTaxableAmount() { + return taxableAmount; + } + public ProrationMode getProrationMode() { return prorationMode; } @@ -1165,6 +1181,16 @@ public Map toFormData() { formData.put("tax10_amount", this.tax10Amount); } + if (this.isPartialTaxApplied != null) { + + formData.put("is_partial_tax_applied", this.isPartialTaxApplied); + } + + if (this.taxableAmount != null) { + + formData.put("taxable_amount", this.taxableAmount); + } + if (this.prorationMode != null) { formData.put("proration_mode", this.prorationMode); @@ -1257,6 +1283,10 @@ public static final class LineItemsBuilder { private Long tax10Amount; + private Boolean isPartialTaxApplied; + + private Long taxableAmount; + private ProrationMode prorationMode; private LineItemsBuilder() {} @@ -1451,6 +1481,16 @@ public LineItemsBuilder tax10Amount(Long value) { return this; } + public LineItemsBuilder isPartialTaxApplied(Boolean value) { + this.isPartialTaxApplied = value; + return this; + } + + public LineItemsBuilder taxableAmount(Long value) { + this.taxableAmount = value; + return this; + } + public LineItemsBuilder prorationMode(ProrationMode value) { this.prorationMode = value; return this; @@ -2340,14 +2380,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEmailResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEmailResponse.java new file mode 100644 index 000000000..952664e44 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteSendEmailResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.creditNote.responses; + +import java.util.List; + +import com.chargebee.v4.models.emailLog.EmailLog; + +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 CreditNoteSendEmail operation. Contains the response data from the + * API. + */ +public final class CreditNoteSendEmailResponse extends BaseResponse { + private final List emailLogs; + + private CreditNoteSendEmailResponse(Builder builder) { + super(builder.httpResponse); + + this.emailLogs = builder.emailLogs; + } + + /** Parse JSON response into CreditNoteSendEmailResponse object. */ + public static CreditNoteSendEmailResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreditNoteSendEmailResponse object with HTTP response. */ + public static CreditNoteSendEmailResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + builder.emailLogs( + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "email_logs"), EmailLog::fromJson)); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNoteSendEmailResponse from JSON", e); + } + } + + /** Create a new builder for CreditNoteSendEmailResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreditNoteSendEmailResponse. */ + public static class Builder { + + private List emailLogs; + + private Response httpResponse; + + private Builder() {} + + public Builder emailLogs(List emailLogs) { + this.emailLogs = emailLogs; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreditNoteSendEmailResponse build() { + return new CreditNoteSendEmailResponse(this); + } + } + + /** Get the emailLogs from the response. */ + public List getEmailLogs() { + return emailLogs; + } + + @Override + public String toString() { + return "CreditNoteSendEmailResponse{" + "emailLogs=" + emailLogs + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CreditNoteSendEmailResponse that = (CreditNoteSendEmailResponse) o; + return java.util.Objects.equals(emailLogs, that.emailLogs); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(emailLogs); + } +} diff --git a/src/main/java/com/chargebee/v4/models/customDataSchema/CustomDataSchema.java b/src/main/java/com/chargebee/v4/models/customDataSchema/CustomDataSchema.java new file mode 100644 index 000000000..3ee23d483 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customDataSchema/CustomDataSchema.java @@ -0,0 +1,264 @@ +/* + * 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.customDataSchema; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class CustomDataSchema { + + private String id; + private String displayName; + private EntityType entityType; + private String schemaDefinition; + private Status status; + private Timestamp createdAt; + private Timestamp modifiedAt; + private Timestamp updatedAt; + + public String getId() { + return id; + } + + public String getDisplayName() { + return displayName; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getSchemaDefinition() { + return schemaDefinition; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getModifiedAt() { + return modifiedAt; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + INVOICE("invoice"), + + QUOTE("quote"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + ORDER("order"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + PLAN_ITEM("plan_item"), + + ADDON_ITEM("addon_item"), + + CHARGE_ITEM("charge_item"), + + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + CHARGE_PRICE("charge_price"), + + DIFFERENTIAL_PRICE("differential_price"), + + ATTACHED_ITEM("attached_item"), + + FEATURE("feature"), + + SUBSCRIPTION_ENTITLEMENT("subscription_entitlement"), + + ITEM_ENTITLEMENT("item_entitlement"), + + BUSINESS_ENTITY("business_entity"), + + PRICE_VARIANT("price_variant"), + + OMNICHANNEL_SUBSCRIPTION("omnichannel_subscription"), + + OMNICHANNEL_SUBSCRIPTION_ITEM("omnichannel_subscription_item"), + + OMNICHANNEL_TRANSACTION("omnichannel_transaction"), + + RECORDED_PURCHASE("recorded_purchase"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CHANGE( + "omnichannel_subscription_item_scheduled_change"), + + SALES_ORDER("sales_order"), + + OMNICHANNEL_ONE_TIME_ORDER("omnichannel_one_time_order"), + + OMNICHANNEL_ONE_TIME_ORDER_ITEM("omnichannel_one_time_order_item"), + + USAGE_FILE("usage_file"), + + BUSINESS_RULE("business_rule"), + + BUSINESS_RULESET("business_ruleset"), + + ALERT_STATUS("alert_status"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_METRIC("omnichannel_subscription_item_metric"), + + PRICE_RAMP("price_ramp"), + + /** 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 enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** 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 CustomDataSchema fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static CustomDataSchema fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static CustomDataSchema fromJson(JsonObject jsonObj) { + CustomDataSchema obj = new CustomDataSchema(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.displayName = JsonUtil.getString(jsonObj, "display_name"); + + obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + + obj.schemaDefinition = JsonUtil.getString(jsonObj, "schema_definition"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + return obj; + } + + @Override + public String toString() { + return "CustomDataSchema{" + + "id=" + + id + + ", displayName=" + + displayName + + ", entityType=" + + entityType + + ", schemaDefinition=" + + schemaDefinition + + ", status=" + + status + + ", createdAt=" + + createdAt + + ", modifiedAt=" + + modifiedAt + + ", updatedAt=" + + updatedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CustomDataSchema that = (CustomDataSchema) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(displayName, that.displayName) + && java.util.Objects.equals(entityType, that.entityType) + && java.util.Objects.equals(schemaDefinition, that.schemaDefinition) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(modifiedAt, that.modifiedAt) + && java.util.Objects.equals(updatedAt, that.updatedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, displayName, entityType, schemaDefinition, status, createdAt, modifiedAt, updatedAt); + } +} 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 96e7b7ac8..2428140bc 100644 --- a/src/main/java/com/chargebee/v4/models/customer/Customer.java +++ b/src/main/java/com/chargebee/v4/models/customer/Customer.java @@ -71,6 +71,7 @@ public class Customer { private String vatNumberPrefix; private String entityIdentifierScheme; private String entityIdentifierStandard; + private String brandId; private BillingAddress billingAddress; private List referralUrls; private List contacts; @@ -311,6 +312,10 @@ public String getEntityIdentifierStandard() { return entityIdentifierStandard; } + public String getBrandId() { + return brandId; + } + public BillingAddress getBillingAddress() { return billingAddress; } @@ -522,6 +527,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1016,6 +1023,8 @@ public static Customer fromJson(JsonObject jsonObj) { knownFields.add("entity_identifier_standard"); + knownFields.add("brand_id"); + knownFields.add("billing_address"); knownFields.add("referral_urls"); @@ -1163,6 +1172,8 @@ public static Customer fromJson(JsonObject jsonObj) { obj.entityIdentifierStandard = JsonUtil.getString(jsonObj, "entity_identifier_standard"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + JsonObject __billingAddressObj = JsonUtil.getJsonObject(jsonObj, "billing_address"); if (__billingAddressObj != null) { obj.billingAddress = BillingAddress.fromJson(__billingAddressObj); @@ -1327,6 +1338,8 @@ public String toString() { + entityIdentifierScheme + ", entityIdentifierStandard=" + entityIdentifierStandard + + ", brandId=" + + brandId + ", billingAddress=" + billingAddress + ", referralUrls=" @@ -1417,6 +1430,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(vatNumberPrefix, that.vatNumberPrefix) && java.util.Objects.equals(entityIdentifierScheme, that.entityIdentifierScheme) && java.util.Objects.equals(entityIdentifierStandard, that.entityIdentifierStandard) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(billingAddress, that.billingAddress) && java.util.Objects.equals(referralUrls, that.referralUrls) && java.util.Objects.equals(contacts, that.contacts) @@ -1491,6 +1505,7 @@ public int hashCode() { vatNumberPrefix, entityIdentifierScheme, entityIdentifierStandard, + brandId, billingAddress, referralUrls, contacts, @@ -2161,6 +2176,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2305,6 +2346,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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 97b61fd0b..858c3d99a 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 @@ -598,6 +598,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -976,6 +1002,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1273,6 +1301,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 fe3114f5c..8ec3b9689 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 @@ -80,6 +80,8 @@ public final class CustomerCreateParams { private final String businessEntityId; + private final String brandId; + private final String createdFromIp; private final String invoiceNotes; @@ -168,6 +170,8 @@ private CustomerCreateParams(CustomerCreateBuilder builder) { this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.createdFromIp = builder.createdFromIp; this.invoiceNotes = builder.invoiceNotes; @@ -325,6 +329,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public String getCreatedFromIp() { return createdFromIp; } @@ -533,6 +541,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.createdFromIp != null) { formData.put("created_from_ip", this.createdFromIp); @@ -702,6 +715,8 @@ public static final class CustomerCreateBuilder { private String businessEntityId; + private String brandId; + private String createdFromIp; private String invoiceNotes; @@ -886,6 +901,11 @@ public CustomerCreateBuilder businessEntityId(String value) { return this; } + public CustomerCreateBuilder brandId(String value) { + this.brandId = value; + return this; + } + @Deprecated public CustomerCreateBuilder createdFromIp(String value) { this.createdFromIp = value; @@ -1089,6 +1109,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1820,6 +1842,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1850,6 +1874,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2611,6 +2637,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2753,6 +2805,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3050,6 +3104,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java index 08c8b63e6..9242a8f8d 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java @@ -764,6 +764,8 @@ public enum TaxabilityIs { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that TaxabilityIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -792,6 +794,8 @@ public enum TaxabilityIsNot { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that TaxabilityIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -820,6 +824,8 @@ public enum TaxabilityIn { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that TaxabilityIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -848,6 +854,8 @@ public enum TaxabilityNotIn { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that TaxabilityNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1320,6 +1328,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java index dd24927f8..1cfa00662 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerRecordExcessPaymentParams.java @@ -335,14 +335,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerSendPaymentRequestParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerSendPaymentRequestParams.java new file mode 100644 index 000000000..2f1bd6787 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerSendPaymentRequestParams.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.customer.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CustomerSendPaymentRequestParams { + + private CustomerSendPaymentRequestParams(CustomerSendPaymentRequestBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for CustomerSendPaymentRequestParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CustomerSendPaymentRequestBuilder builder() { + return new CustomerSendPaymentRequestBuilder(); + } + + public static final class CustomerSendPaymentRequestBuilder { + + private CustomerSendPaymentRequestBuilder() {} + + public CustomerSendPaymentRequestParams build() { + return new CustomerSendPaymentRequestParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java index 31483a644..129e2d2a0 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdateParams.java @@ -683,6 +683,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String 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 5f5bb2d2b..13dbafc31 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 @@ -408,6 +408,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -550,6 +576,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/responses/CustomerSendPaymentRequestResponse.java b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerSendPaymentRequestResponse.java new file mode 100644 index 000000000..fce625a2e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/customer/responses/CustomerSendPaymentRequestResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.customer.responses; + +import java.util.List; + +import com.chargebee.v4.models.emailLog.EmailLog; + +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 CustomerSendPaymentRequest operation. Contains the response data + * from the API. + */ +public final class CustomerSendPaymentRequestResponse extends BaseResponse { + private final List emailLogs; + + private CustomerSendPaymentRequestResponse(Builder builder) { + super(builder.httpResponse); + + this.emailLogs = builder.emailLogs; + } + + /** Parse JSON response into CustomerSendPaymentRequestResponse object. */ + public static CustomerSendPaymentRequestResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CustomerSendPaymentRequestResponse object with HTTP response. */ + public static CustomerSendPaymentRequestResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + builder.emailLogs( + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "email_logs"), EmailLog::fromJson)); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CustomerSendPaymentRequestResponse from JSON", e); + } + } + + /** Create a new builder for CustomerSendPaymentRequestResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CustomerSendPaymentRequestResponse. */ + public static class Builder { + + private List emailLogs; + + private Response httpResponse; + + private Builder() {} + + public Builder emailLogs(List emailLogs) { + this.emailLogs = emailLogs; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CustomerSendPaymentRequestResponse build() { + return new CustomerSendPaymentRequestResponse(this); + } + } + + /** Get the emailLogs from the response. */ + public List getEmailLogs() { + return emailLogs; + } + + @Override + public String toString() { + return "CustomerSendPaymentRequestResponse{" + "emailLogs=" + emailLogs + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CustomerSendPaymentRequestResponse that = (CustomerSendPaymentRequestResponse) o; + return java.util.Objects.equals(emailLogs, that.emailLogs); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(emailLogs); + } +} diff --git a/src/main/java/com/chargebee/v4/models/dispute/Dispute.java b/src/main/java/com/chargebee/v4/models/dispute/Dispute.java new file mode 100644 index 000000000..935216112 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/dispute/Dispute.java @@ -0,0 +1,268 @@ +/* + * 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.dispute; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class Dispute { + + private String id; + private String customerId; + private String transactionId; + private String gatewayAccountId; + private String idAtGateway; + private String currencyCode; + private Long amount; + private String reason; + private Status status; + private Type type; + private Boolean isPartialDispute; + private Timestamp createdAt; + private Long resourceVersion; + private Timestamp updatedAt; + + public String getId() { + return id; + } + + public String getCustomerId() { + return customerId; + } + + public String getTransactionId() { + return transactionId; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public String getIdAtGateway() { + return idAtGateway; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public Long getAmount() { + return amount; + } + + public String getReason() { + return reason; + } + + public Status getStatus() { + return status; + } + + public Type getType() { + return type; + } + + public Boolean getIsPartialDispute() { + return isPartialDispute; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public enum Status { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** 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 { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** 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 Dispute fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Dispute fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Dispute fromJson(JsonObject jsonObj) { + Dispute obj = new Dispute(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.transactionId = JsonUtil.getString(jsonObj, "transaction_id"); + + obj.gatewayAccountId = JsonUtil.getString(jsonObj, "gateway_account_id"); + + obj.idAtGateway = JsonUtil.getString(jsonObj, "id_at_gateway"); + + obj.currencyCode = JsonUtil.getString(jsonObj, "currency_code"); + + obj.amount = JsonUtil.getLong(jsonObj, "amount"); + + obj.reason = JsonUtil.getString(jsonObj, "reason"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.type = Type.fromString(JsonUtil.getString(jsonObj, "type")); + + obj.isPartialDispute = JsonUtil.getBoolean(jsonObj, "is_partial_dispute"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + return obj; + } + + @Override + public String toString() { + return "Dispute{" + + "id=" + + id + + ", customerId=" + + customerId + + ", transactionId=" + + transactionId + + ", gatewayAccountId=" + + gatewayAccountId + + ", idAtGateway=" + + idAtGateway + + ", currencyCode=" + + currencyCode + + ", amount=" + + amount + + ", reason=" + + reason + + ", status=" + + status + + ", type=" + + type + + ", isPartialDispute=" + + isPartialDispute + + ", createdAt=" + + createdAt + + ", resourceVersion=" + + resourceVersion + + ", updatedAt=" + + updatedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Dispute that = (Dispute) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(transactionId, that.transactionId) + && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) + && java.util.Objects.equals(idAtGateway, that.idAtGateway) + && java.util.Objects.equals(currencyCode, that.currencyCode) + && java.util.Objects.equals(amount, that.amount) + && java.util.Objects.equals(reason, that.reason) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(isPartialDispute, that.isPartialDispute) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(resourceVersion, that.resourceVersion) + && java.util.Objects.equals(updatedAt, that.updatedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + customerId, + transactionId, + gatewayAccountId, + idAtGateway, + currencyCode, + amount, + reason, + status, + type, + isPartialDispute, + createdAt, + resourceVersion, + updatedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/dispute/params/DisputeListParams.java b/src/main/java/com/chargebee/v4/models/dispute/params/DisputeListParams.java new file mode 100644 index 000000000..81c4c1688 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/dispute/params/DisputeListParams.java @@ -0,0 +1,559 @@ +/* + * 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.dispute.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.NumberFilter; +import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DisputeListParams { + + private final Map queryParams; + + private DisputeListParams(DisputeListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public DisputeListBuilder toBuilder() { + DisputeListBuilder builder = new DisputeListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for DisputeListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DisputeListBuilder builder() { + return new DisputeListBuilder(); + } + + public static final class DisputeListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private DisputeListBuilder() {} + + public DisputeListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public DisputeListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public IdFilter id() { + return new IdFilter("id", this, queryParams); + } + + public StatusFilter status() { + return new StatusFilter("status", this, queryParams); + } + + public TypeFilter type() { + return new TypeFilter("type", this, queryParams); + } + + public CustomerIdFilter customerId() { + return new CustomerIdFilter("customer_id", this, queryParams); + } + + public TransactionIdFilter transactionId() { + return new TransactionIdFilter("transaction_id", this, queryParams); + } + + public AmountFilter amount() { + return new AmountFilter("amount", this, queryParams); + } + + public CreatedAtFilter createdAt() { + return new CreatedAtFilter("created_at", this, queryParams); + } + + public DisputeListParams build() { + return new DisputeListParams(this); + } + + public static final class IdFilter extends StringFilter { + IdFilter(String fieldName, DisputeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class StatusFilter extends EnumFilter { + StatusFilter(String fieldName, DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class TypeFilter extends EnumFilter { + TypeFilter(String fieldName, DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder 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 DisputeListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class CustomerIdFilter extends StringFilter { + CustomerIdFilter(String fieldName, DisputeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class TransactionIdFilter extends StringFilter { + TransactionIdFilter( + String fieldName, DisputeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class AmountFilter extends NumberFilter { + AmountFilter(String fieldName, DisputeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class CreatedAtFilter extends TimestampFilter { + CreatedAtFilter(String fieldName, DisputeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } + + public enum StatusIs { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** 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 StatusIsNot { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** An enum member indicating that StatusIsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIsNot enumValue : StatusIsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusIn { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** An enum member indicating that StatusIn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIn fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIn enumValue : StatusIn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusNotIn { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** An enum member indicating that StatusNotIn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusNotIn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusNotIn fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusNotIn enumValue : StatusNotIn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TypeIs { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** 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 TypeIsNot { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TypeIsNot(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TypeIsNot fromString(String value) { + if (value == null) return _UNKNOWN; + for (TypeIsNot enumValue : TypeIsNot.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TypeIn { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TypeIn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TypeIn fromString(String value) { + if (value == null) return _UNKNOWN; + for (TypeIn enumValue : TypeIn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TypeNotIn { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** An enum member indicating that TypeNotIn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TypeNotIn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TypeNotIn fromString(String value) { + if (value == null) return _UNKNOWN; + for (TypeNotIn enumValue : TypeNotIn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + INITIATED("initiated"), + + FUNDS_WITHDRAWN("funds_withdrawn"), + + IN_REVIEW("in_review"), + + CANCELLED("cancelled"), + + LOST("lost"), + + WON("won"), + + /** 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 { + CHARGEBACK("chargeback"), + + INQUIRY("inquiry"), + + /** 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/dispute/params/DisputeRetrieveParams.java b/src/main/java/com/chargebee/v4/models/dispute/params/DisputeRetrieveParams.java new file mode 100644 index 000000000..5fec2fc13 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/dispute/params/DisputeRetrieveParams.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.dispute.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class DisputeRetrieveParams { + + private final Map queryParams; + + private DisputeRetrieveParams(DisputeRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public DisputeRetrieveBuilder toBuilder() { + DisputeRetrieveBuilder builder = new DisputeRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for DisputeRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static DisputeRetrieveBuilder builder() { + return new DisputeRetrieveBuilder(); + } + + public static final class DisputeRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private DisputeRetrieveBuilder() {} + + public DisputeRetrieveParams build() { + return new DisputeRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeListResponse.java b/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeListResponse.java new file mode 100644 index 000000000..8c9e13b04 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeListResponse.java @@ -0,0 +1,209 @@ +package com.chargebee.v4.models.dispute.responses; + +import java.util.List; + +import com.chargebee.v4.models.dispute.Dispute; + +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.DisputeService; +import com.chargebee.v4.models.dispute.params.DisputeListParams; + +/** Immutable response object for DisputeList operation. Contains paginated list data. */ +public final class DisputeListResponse { + + private final List list; + + private final String nextOffset; + + private final DisputeService service; + private final DisputeListParams originalParams; + private final Response httpResponse; + + private DisputeListResponse( + List list, + String nextOffset, + DisputeService service, + DisputeListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into DisputeListResponse object (no service context). Use this when you + * only need to read a single page (no nextPage()). + */ + public static DisputeListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), DisputeListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new DisputeListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DisputeListResponse from JSON", e); + } + } + + /** + * Parse JSON response into DisputeListResponse object with service context for pagination + * (enables nextPage()). + */ + public static DisputeListResponse fromJson( + String json, + DisputeService service, + DisputeListParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), DisputeListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new DisputeListResponse(list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DisputeListResponse 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 DisputeListResponse 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)."); + } + + DisputeListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : DisputeListParams.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 "DisputeListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + DisputeListResponse that = (DisputeListResponse) 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 DisputeListItem { + + private Dispute dispute; + + public Dispute getDispute() { + return dispute; + } + + public static DisputeListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static DisputeListItem fromJson(JsonObject jsonObj) { + DisputeListItem item = new DisputeListItem(); + + JsonObject __disputeObj = JsonUtil.getJsonObject(jsonObj, "dispute"); + if (__disputeObj != null) { + item.dispute = Dispute.fromJson(__disputeObj); + } + + return item; + } + + @Override + public String toString() { + return "DisputeListItem{" + "dispute=" + dispute + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + DisputeListItem that = (DisputeListItem) o; + return java.util.Objects.equals(dispute, that.dispute); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(dispute); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeRetrieveResponse.java new file mode 100644 index 000000000..348ec0ba8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/dispute/responses/DisputeRetrieveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.dispute.responses; + +import com.chargebee.v4.models.dispute.Dispute; + +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 DisputeRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class DisputeRetrieveResponse extends BaseResponse { + private final Dispute dispute; + + private DisputeRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.dispute = builder.dispute; + } + + /** Parse JSON response into DisputeRetrieveResponse object. */ + public static DisputeRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into DisputeRetrieveResponse object with HTTP response. */ + public static DisputeRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __disputeObj = JsonUtil.getJsonObject(jsonObj, "dispute"); + if (__disputeObj != null) { + builder.dispute(Dispute.fromJson(__disputeObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse DisputeRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for DisputeRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for DisputeRetrieveResponse. */ + public static class Builder { + + private Dispute dispute; + + private Response httpResponse; + + private Builder() {} + + public Builder dispute(Dispute dispute) { + this.dispute = dispute; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public DisputeRetrieveResponse build() { + return new DisputeRetrieveResponse(this); + } + } + + /** Get the dispute from the response. */ + public Dispute getDispute() { + return dispute; + } + + @Override + public String toString() { + return "DisputeRetrieveResponse{" + "dispute=" + dispute + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + DisputeRetrieveResponse that = (DisputeRetrieveResponse) o; + return java.util.Objects.equals(dispute, that.dispute); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(dispute); + } +} diff --git a/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java b/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java index f135c975f..5e7870399 100644 --- a/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java +++ b/src/main/java/com/chargebee/v4/models/einvoice/Einvoice.java @@ -10,21 +10,38 @@ import com.chargebee.v4.internal.JsonUtil; import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import java.sql.Timestamp; import java.util.List; public class Einvoice { private String id; + private EntityType entityType; + private String entityId; private String referenceId; private String referenceNumber; private Status status; private String message; + private Timestamp createdAt; + private Long resourceVersion; + private Timestamp updatedAt; + private Boolean deleted; private List providerReferences; + private String businessEntityId; + private List artifacts; public String getId() { return id; } + public EntityType getEntityType() { + return entityType; + } + + public String getEntityId() { + return entityId; + } + public String getReferenceId() { return referenceId; } @@ -41,10 +58,62 @@ public String getMessage() { return message; } + public Timestamp getCreatedAt() { + return createdAt; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public Boolean getDeleted() { + return deleted; + } + public List getProviderReferences() { return providerReferences; } + public String getBusinessEntityId() { + return businessEntityId; + } + + public List getArtifacts() { + return artifacts; + } + + public enum EntityType { + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + /** 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 enum Status { SCHEDULED("scheduled"), @@ -108,6 +177,10 @@ public static Einvoice fromJson(JsonObject jsonObj) { obj.id = JsonUtil.getString(jsonObj, "id"); + obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + + obj.entityId = JsonUtil.getString(jsonObj, "entity_id"); + obj.referenceId = JsonUtil.getString(jsonObj, "reference_id"); obj.referenceNumber = JsonUtil.getString(jsonObj, "reference_number"); @@ -116,11 +189,24 @@ public static Einvoice fromJson(JsonObject jsonObj) { obj.message = JsonUtil.getString(jsonObj, "message"); + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.deleted = JsonUtil.getBoolean(jsonObj, "deleted"); + JsonArray __providerReferencesArr = JsonUtil.getJsonArray(jsonObj, "provider_references"); if (__providerReferencesArr != null) { obj.providerReferences = JsonUtil.mapArrayToObjects(__providerReferencesArr); } + obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + + obj.artifacts = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "artifacts"), Artifacts::fromJson); + return obj; } @@ -129,6 +215,10 @@ public String toString() { return "Einvoice{" + "id=" + id + + ", entityType=" + + entityType + + ", entityId=" + + entityId + ", referenceId=" + referenceId + ", referenceNumber=" @@ -137,8 +227,20 @@ public String toString() { + status + ", message=" + message + + ", createdAt=" + + createdAt + + ", resourceVersion=" + + resourceVersion + + ", updatedAt=" + + updatedAt + + ", deleted=" + + deleted + ", providerReferences=" + providerReferences + + ", businessEntityId=" + + businessEntityId + + ", artifacts=" + + artifacts + "}"; } @@ -149,17 +251,239 @@ public boolean equals(Object o) { Einvoice that = (Einvoice) o; return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(entityType, that.entityType) + && java.util.Objects.equals(entityId, that.entityId) && java.util.Objects.equals(referenceId, that.referenceId) && java.util.Objects.equals(referenceNumber, that.referenceNumber) && java.util.Objects.equals(status, that.status) && java.util.Objects.equals(message, that.message) - && java.util.Objects.equals(providerReferences, that.providerReferences); + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(resourceVersion, that.resourceVersion) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(deleted, that.deleted) + && java.util.Objects.equals(providerReferences, that.providerReferences) + && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(artifacts, that.artifacts); } @Override public int hashCode() { return java.util.Objects.hash( - id, referenceId, referenceNumber, status, message, providerReferences); + id, + entityType, + entityId, + referenceId, + referenceNumber, + status, + message, + createdAt, + resourceVersion, + updatedAt, + deleted, + providerReferences, + businessEntityId, + artifacts); + } + + public static class Artifacts { + + private String artifactType; + private Direction direction; + private Status status; + private String code; + private String externalArtifactId; + private Timestamp createdAt; + private Long resourceVersion; + private Timestamp updatedAt; + private Boolean deleted; + + public String getArtifactType() { + return artifactType; + } + + public Direction getDirection() { + return direction; + } + + public Status getStatus() { + return status; + } + + public String getCode() { + return code; + } + + public String getExternalArtifactId() { + return externalArtifactId; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public Boolean getDeleted() { + return deleted; + } + + public enum Direction { + OUTBOUND("outbound"), + + INBOUND("inbound"), + + /** An enum member indicating that Direction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Direction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Direction fromString(String value) { + if (value == null) return _UNKNOWN; + for (Direction enumValue : Direction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + SCHEDULED("scheduled"), + + SKIPPED("skipped"), + + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + FAILED("failed"), + + REGISTERED("registered"), + + /** 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 Artifacts fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Artifacts fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Artifacts fromJson(JsonObject jsonObj) { + Artifacts obj = new Artifacts(); + + obj.artifactType = JsonUtil.getString(jsonObj, "artifact_type"); + + obj.direction = Direction.fromString(JsonUtil.getString(jsonObj, "direction")); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.code = JsonUtil.getString(jsonObj, "code"); + + obj.externalArtifactId = JsonUtil.getString(jsonObj, "external_artifact_id"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.deleted = JsonUtil.getBoolean(jsonObj, "deleted"); + + return obj; + } + + @Override + public String toString() { + return "Artifacts{" + + "artifactType=" + + artifactType + + ", direction=" + + direction + + ", status=" + + status + + ", code=" + + code + + ", externalArtifactId=" + + externalArtifactId + + ", createdAt=" + + createdAt + + ", resourceVersion=" + + resourceVersion + + ", updatedAt=" + + updatedAt + + ", deleted=" + + deleted + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Artifacts that = (Artifacts) o; + return java.util.Objects.equals(artifactType, that.artifactType) + && java.util.Objects.equals(direction, that.direction) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(code, that.code) + && java.util.Objects.equals(externalArtifactId, that.externalArtifactId) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(resourceVersion, that.resourceVersion) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(deleted, that.deleted); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + artifactType, + direction, + status, + code, + externalArtifactId, + createdAt, + resourceVersion, + updatedAt, + deleted); + } } } diff --git a/src/main/java/com/chargebee/v4/models/einvoice/params/EinvoiceRetrieveParams.java b/src/main/java/com/chargebee/v4/models/einvoice/params/EinvoiceRetrieveParams.java new file mode 100644 index 000000000..9484b763d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/einvoice/params/EinvoiceRetrieveParams.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.einvoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class EinvoiceRetrieveParams { + + private final Map queryParams; + + private EinvoiceRetrieveParams(EinvoiceRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public EinvoiceRetrieveBuilder toBuilder() { + EinvoiceRetrieveBuilder builder = new EinvoiceRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for EinvoiceRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EinvoiceRetrieveBuilder builder() { + return new EinvoiceRetrieveBuilder(); + } + + public static final class EinvoiceRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private EinvoiceRetrieveBuilder() {} + + public EinvoiceRetrieveParams build() { + return new EinvoiceRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/einvoice/params/ListEinvoicesParams.java b/src/main/java/com/chargebee/v4/models/einvoice/params/ListEinvoicesParams.java new file mode 100644 index 000000000..d4549d579 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/einvoice/params/ListEinvoicesParams.java @@ -0,0 +1,195 @@ +/* + * 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.einvoice.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ListEinvoicesParams { + + private final Map queryParams; + + private ListEinvoicesParams(ListEinvoicesBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListEinvoicesBuilder toBuilder() { + ListEinvoicesBuilder builder = new ListEinvoicesBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListEinvoicesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListEinvoicesBuilder builder() { + return new ListEinvoicesBuilder(); + } + + public static final class ListEinvoicesBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListEinvoicesBuilder() {} + + public ListEinvoicesBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListEinvoicesBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public IdFilter id() { + return new IdFilter("id", this, queryParams); + } + + public ReferenceIdFilter referenceId() { + return new ReferenceIdFilter("reference_id", this, queryParams); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this, queryParams); + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public ListEinvoicesBuilder invoiceId(String value) { + queryParams.put("invoice_id", value); + return this; + } + + public ListEinvoicesBuilder creditNoteId(String value) { + queryParams.put("credit_note_id", value); + return this; + } + + public ListEinvoicesParams build() { + return new ListEinvoicesParams(this); + } + + public static final class IdFilter extends StringFilter { + IdFilter(String fieldName, ListEinvoicesBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class ReferenceIdFilter extends StringFilter { + ReferenceIdFilter( + String fieldName, ListEinvoicesBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class UpdatedAtFilter extends TimestampFilter { + UpdatedAtFilter(String fieldName, ListEinvoicesBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final ListEinvoicesBuilder builder; + + SortBySortBuilder(String fieldName, ListEinvoicesBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final ListEinvoicesBuilder builder; + + SortDirection(String fieldName, String selectedField, ListEinvoicesBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public ListEinvoicesBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public ListEinvoicesBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum SortByAsc { + UPDATED_AT("updated_at"), + + /** An enum member indicating that SortByAsc was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + SortByAsc(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SortByAsc fromString(String value) { + if (value == null) return _UNKNOWN; + for (SortByAsc enumValue : SortByAsc.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SortByDesc { + UPDATED_AT("updated_at"), + + /** An enum member indicating that SortByDesc was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + SortByDesc(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SortByDesc fromString(String value) { + if (value == null) return _UNKNOWN; + for (SortByDesc enumValue : SortByDesc.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/einvoice/responses/EinvoiceRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/einvoice/responses/EinvoiceRetrieveResponse.java new file mode 100644 index 000000000..4bca728c5 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/einvoice/responses/EinvoiceRetrieveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.einvoice.responses; + +import com.chargebee.v4.models.einvoice.Einvoice; + +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 EinvoiceRetrieve operation. Contains the response data from a + * single resource get operation. + */ +public final class EinvoiceRetrieveResponse extends BaseResponse { + private final Einvoice einvoice; + + private EinvoiceRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.einvoice = builder.einvoice; + } + + /** Parse JSON response into EinvoiceRetrieveResponse object. */ + public static EinvoiceRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into EinvoiceRetrieveResponse object with HTTP response. */ + public static EinvoiceRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __einvoiceObj = JsonUtil.getJsonObject(jsonObj, "einvoice"); + if (__einvoiceObj != null) { + builder.einvoice(Einvoice.fromJson(__einvoiceObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse EinvoiceRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for EinvoiceRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for EinvoiceRetrieveResponse. */ + public static class Builder { + + private Einvoice einvoice; + + private Response httpResponse; + + private Builder() {} + + public Builder einvoice(Einvoice einvoice) { + this.einvoice = einvoice; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public EinvoiceRetrieveResponse build() { + return new EinvoiceRetrieveResponse(this); + } + } + + /** Get the einvoice from the response. */ + public Einvoice getEinvoice() { + return einvoice; + } + + @Override + public String toString() { + return "EinvoiceRetrieveResponse{" + "einvoice=" + einvoice + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EinvoiceRetrieveResponse that = (EinvoiceRetrieveResponse) o; + return java.util.Objects.equals(einvoice, that.einvoice); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(einvoice); + } +} diff --git a/src/main/java/com/chargebee/v4/models/einvoice/responses/ListEinvoicesResponse.java b/src/main/java/com/chargebee/v4/models/einvoice/responses/ListEinvoicesResponse.java new file mode 100644 index 000000000..77b17a2ff --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/einvoice/responses/ListEinvoicesResponse.java @@ -0,0 +1,211 @@ +package com.chargebee.v4.models.einvoice.responses; + +import java.util.List; + +import com.chargebee.v4.models.einvoice.Einvoice; + +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.EinvoiceService; +import com.chargebee.v4.models.einvoice.params.ListEinvoicesParams; + +/** Immutable response object for ListEinvoices operation. Contains paginated list data. */ +public final class ListEinvoicesResponse { + + private final List list; + + private final String nextOffset; + + private final EinvoiceService service; + private final ListEinvoicesParams originalParams; + private final Response httpResponse; + + private ListEinvoicesResponse( + List list, + String nextOffset, + EinvoiceService service, + ListEinvoicesParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListEinvoicesResponse object (no service context). Use this when you + * only need to read a single page (no nextPage()). + */ + public static ListEinvoicesResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), EinvoiceListEinvoicesItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListEinvoicesResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListEinvoicesResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListEinvoicesResponse object with service context for pagination + * (enables nextPage()). + */ + public static ListEinvoicesResponse fromJson( + String json, + EinvoiceService service, + ListEinvoicesParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), EinvoiceListEinvoicesItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListEinvoicesResponse(list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListEinvoicesResponse 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 ListEinvoicesResponse 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)."); + } + + ListEinvoicesParams nextParams = + (originalParams != null ? originalParams.toBuilder() : ListEinvoicesParams.builder()) + .offset(nextOffset) + .build(); + + return service.listEinvoices(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 "ListEinvoicesResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ListEinvoicesResponse that = (ListEinvoicesResponse) 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 EinvoiceListEinvoicesItem { + + private Einvoice einvoice; + + public Einvoice getEinvoice() { + return einvoice; + } + + public static EinvoiceListEinvoicesItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EinvoiceListEinvoicesItem fromJson(JsonObject jsonObj) { + EinvoiceListEinvoicesItem item = new EinvoiceListEinvoicesItem(); + + JsonObject __einvoiceObj = JsonUtil.getJsonObject(jsonObj, "einvoice"); + if (__einvoiceObj != null) { + item.einvoice = Einvoice.fromJson(__einvoiceObj); + } + + return item; + } + + @Override + public String toString() { + return "EinvoiceListEinvoicesItem{" + "einvoice=" + einvoice + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EinvoiceListEinvoicesItem that = (EinvoiceListEinvoicesItem) o; + return java.util.Objects.equals(einvoice, that.einvoice); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(einvoice); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/emailLog/EmailLog.java b/src/main/java/com/chargebee/v4/models/emailLog/EmailLog.java new file mode 100644 index 000000000..3237613f4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/emailLog/EmailLog.java @@ -0,0 +1,224 @@ +/* + * 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.emailLog; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class EmailLog { + + private String id; + private String templateName; + private String fromAddress; + private String toAddress; + private String subject; + private Status status; + private Timestamp sentOn; + private String customerId; + private String siteId; + private String businessEntityId; + private String brandId; + private String errorMessage; + + public String getId() { + return id; + } + + public String getTemplateName() { + return templateName; + } + + public String getFromAddress() { + return fromAddress; + } + + public String getToAddress() { + return toAddress; + } + + public String getSubject() { + return subject; + } + + public Status getStatus() { + return status; + } + + public Timestamp getSentOn() { + return sentOn; + } + + public String getCustomerId() { + return customerId; + } + + public String getSiteId() { + return siteId; + } + + public String getBusinessEntityId() { + return businessEntityId; + } + + public String getBrandId() { + return brandId; + } + + public String getErrorMessage() { + return errorMessage; + } + + public enum Status { + SCHEDULED("scheduled"), + + RESCHEDULED("rescheduled"), + + SUCCEEDED("succeeded"), + + FAILED("failed"), + + DEFERRED("deferred"), + + DELIVERED("delivered"), + + OPENED("opened"), + + BOUNCED("bounced"), + + DROPPED("dropped"), + + /** 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 EmailLog fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EmailLog fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static EmailLog fromJson(JsonObject jsonObj) { + EmailLog obj = new EmailLog(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.templateName = JsonUtil.getString(jsonObj, "template_name"); + + obj.fromAddress = JsonUtil.getString(jsonObj, "from_address"); + + obj.toAddress = JsonUtil.getString(jsonObj, "to_address"); + + obj.subject = JsonUtil.getString(jsonObj, "subject"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.sentOn = JsonUtil.getTimestamp(jsonObj, "sent_on"); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.siteId = JsonUtil.getString(jsonObj, "site_id"); + + obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + + obj.errorMessage = JsonUtil.getString(jsonObj, "error_message"); + + return obj; + } + + @Override + public String toString() { + return "EmailLog{" + + "id=" + + id + + ", templateName=" + + templateName + + ", fromAddress=" + + fromAddress + + ", toAddress=" + + toAddress + + ", subject=" + + subject + + ", status=" + + status + + ", sentOn=" + + sentOn + + ", customerId=" + + customerId + + ", siteId=" + + siteId + + ", businessEntityId=" + + businessEntityId + + ", brandId=" + + brandId + + ", errorMessage=" + + errorMessage + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EmailLog that = (EmailLog) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(templateName, that.templateName) + && java.util.Objects.equals(fromAddress, that.fromAddress) + && java.util.Objects.equals(toAddress, that.toAddress) + && java.util.Objects.equals(subject, that.subject) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(sentOn, that.sentOn) + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(siteId, that.siteId) + && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) + && java.util.Objects.equals(errorMessage, that.errorMessage); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + templateName, + fromAddress, + toAddress, + subject, + status, + sentOn, + customerId, + siteId, + businessEntityId, + brandId, + errorMessage); + } +} diff --git a/src/main/java/com/chargebee/v4/models/emailLog/params/EmailLogsForCustomerParams.java b/src/main/java/com/chargebee/v4/models/emailLog/params/EmailLogsForCustomerParams.java new file mode 100644 index 000000000..fe071c9bc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/emailLog/params/EmailLogsForCustomerParams.java @@ -0,0 +1,96 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.emailLog.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class EmailLogsForCustomerParams { + + private final Map queryParams; + + private EmailLogsForCustomerParams(EmailLogsForCustomerBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public EmailLogsForCustomerBuilder toBuilder() { + EmailLogsForCustomerBuilder builder = new EmailLogsForCustomerBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for EmailLogsForCustomerParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EmailLogsForCustomerBuilder builder() { + return new EmailLogsForCustomerBuilder(); + } + + public static final class EmailLogsForCustomerBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private EmailLogsForCustomerBuilder() {} + + public EmailLogsForCustomerBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public EmailLogsForCustomerBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public SentOnFilter sentOn() { + return new SentOnFilter("sent_on", this, queryParams); + } + + public BusinessEntityIdFilter businessEntityId() { + return new BusinessEntityIdFilter("business_entity_id", this, queryParams); + } + + public BrandIdFilter brandId() { + return new BrandIdFilter("brand_id", this, queryParams); + } + + public EmailLogsForCustomerParams build() { + return new EmailLogsForCustomerParams(this); + } + + public static final class SentOnFilter extends TimestampFilter { + SentOnFilter( + String fieldName, EmailLogsForCustomerBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class BusinessEntityIdFilter + extends StringFilter { + BusinessEntityIdFilter( + String fieldName, EmailLogsForCustomerBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class BrandIdFilter extends StringFilter { + BrandIdFilter( + String fieldName, EmailLogsForCustomerBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/emailLog/responses/EmailLogsForCustomerResponse.java b/src/main/java/com/chargebee/v4/models/emailLog/responses/EmailLogsForCustomerResponse.java new file mode 100644 index 000000000..6c2dfdde9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/emailLog/responses/EmailLogsForCustomerResponse.java @@ -0,0 +1,218 @@ +package com.chargebee.v4.models.emailLog.responses; + +import java.util.List; + +import com.chargebee.v4.models.emailLog.EmailLog; + +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.EmailLogService; +import com.chargebee.v4.models.emailLog.params.EmailLogsForCustomerParams; + +/** Immutable response object for EmailLogsForCustomer operation. Contains paginated list data. */ +public final class EmailLogsForCustomerResponse { + + private final List list; + + private final String nextOffset; + + private final String customerId; + + private final EmailLogService service; + private final EmailLogsForCustomerParams originalParams; + private final Response httpResponse; + + private EmailLogsForCustomerResponse( + List list, + String nextOffset, + String customerId, + EmailLogService service, + EmailLogsForCustomerParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.customerId = customerId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into EmailLogsForCustomerResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static EmailLogsForCustomerResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), EmailLogEmailLogsForCustomerItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new EmailLogsForCustomerResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse EmailLogsForCustomerResponse from JSON", e); + } + } + + /** + * Parse JSON response into EmailLogsForCustomerResponse object with service context for + * pagination (enables nextPage()). + */ + public static EmailLogsForCustomerResponse fromJson( + String json, + EmailLogService service, + EmailLogsForCustomerParams originalParams, + String customerId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), EmailLogEmailLogsForCustomerItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new EmailLogsForCustomerResponse( + list, nextOffset, customerId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse EmailLogsForCustomerResponse 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 EmailLogsForCustomerResponse 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)."); + } + + EmailLogsForCustomerParams nextParams = + (originalParams != null ? originalParams.toBuilder() : EmailLogsForCustomerParams.builder()) + .offset(nextOffset) + .build(); + + return service.emailLogsForCustomer(customerId, 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 "EmailLogsForCustomerResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EmailLogsForCustomerResponse that = (EmailLogsForCustomerResponse) 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 EmailLogEmailLogsForCustomerItem { + + private EmailLog emailLog; + + public EmailLog getEmailLog() { + return emailLog; + } + + public static EmailLogEmailLogsForCustomerItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EmailLogEmailLogsForCustomerItem fromJson(JsonObject jsonObj) { + EmailLogEmailLogsForCustomerItem item = new EmailLogEmailLogsForCustomerItem(); + + JsonObject __emailLogObj = JsonUtil.getJsonObject(jsonObj, "email_log"); + if (__emailLogObj != null) { + item.emailLog = EmailLog.fromJson(__emailLogObj); + } + + return item; + } + + @Override + public String toString() { + return "EmailLogEmailLogsForCustomerItem{" + "emailLog=" + emailLog + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EmailLogEmailLogsForCustomerItem that = (EmailLogEmailLogsForCustomerItem) o; + return java.util.Objects.equals(emailLog, that.emailLog); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(emailLog); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/estimate/Estimate.java b/src/main/java/com/chargebee/v4/models/estimate/Estimate.java index 0c7550f65..480e84747 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/Estimate.java +++ b/src/main/java/com/chargebee/v4/models/estimate/Estimate.java @@ -5380,6 +5380,7 @@ public static class ScheduleEntries { private String id; private Timestamp date; private Long amount; + private Long scheduledAmount; private Status status; public String getId() { @@ -5394,6 +5395,10 @@ public Long getAmount() { return amount; } + public Long getScheduledAmount() { + return scheduledAmount; + } + public Status getStatus() { return status; } @@ -5445,6 +5450,8 @@ public static ScheduleEntries fromJson(JsonObject jsonObj) { obj.amount = JsonUtil.getLong(jsonObj, "amount"); + obj.scheduledAmount = JsonUtil.getLong(jsonObj, "scheduled_amount"); + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); return obj; @@ -5459,6 +5466,8 @@ public String toString() { + date + ", amount=" + amount + + ", scheduledAmount=" + + scheduledAmount + ", status=" + status + "}"; @@ -5473,13 +5482,14 @@ public boolean equals(Object o) { return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(date, that.date) && java.util.Objects.equals(amount, that.amount) + && java.util.Objects.equals(scheduledAmount, that.scheduledAmount) && java.util.Objects.equals(status, that.status); } @Override public int hashCode() { - return java.util.Objects.hash(id, date, amount, status); + return java.util.Objects.hash(id, date, amount, scheduledAmount, status); } } } diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java index 00591d33c..5069b946d 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemEstimateParams.java @@ -1457,6 +1457,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1718,6 +1720,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private final ChargeOnOption chargeOnOption; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1744,6 +1748,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemType = builder.itemType; + this.description = builder.description; + this.chargeOnOption = builder.chargeOnOption; } @@ -1791,6 +1797,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + public ChargeOnOption getChargeOnOption() { return chargeOnOption; } @@ -1854,6 +1864,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.chargeOnOption != null) { formData.put("charge_on_option", this.chargeOnOption); @@ -1892,6 +1907,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private ChargeOnOption chargeOnOption; private SubscriptionItemsBuilder() {} @@ -1951,6 +1968,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { this.chargeOnOption = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java index 07d1843de..0d9063965 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/CreateSubscriptionItemForCustomerEstimateParams.java @@ -1429,6 +1429,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private final ChargeOnOption chargeOnOption; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1455,6 +1457,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemType = builder.itemType; + this.description = builder.description; + this.chargeOnOption = builder.chargeOnOption; } @@ -1502,6 +1506,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + public ChargeOnOption getChargeOnOption() { return chargeOnOption; } @@ -1565,6 +1573,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.chargeOnOption != null) { formData.put("charge_on_option", this.chargeOnOption); @@ -1603,6 +1616,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private ChargeOnOption chargeOnOption; private SubscriptionItemsBuilder() {} @@ -1662,6 +1677,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { this.chargeOnOption = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java index 854c80c8d..f90ac4cc3 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateCreateSubscriptionParams.java @@ -1525,6 +1525,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java index 0c779b50c..1a7b5a2ab 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java @@ -844,6 +844,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java index fd565ed5f..b5e7cb479 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java @@ -838,6 +838,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java index 9f4cd6e07..ae85cbdc9 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionForItemsParams.java @@ -1625,6 +1625,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1743,6 +1745,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private final ProrationType prorationType; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1771,6 +1775,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemType = builder.itemType; + this.description = builder.description; + this.prorationType = builder.prorationType; } @@ -1822,6 +1828,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + public ProrationType getProrationType() { return prorationType; } @@ -1890,6 +1900,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.prorationType != null) { formData.put("proration_type", this.prorationType); @@ -1930,6 +1945,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private ProrationType prorationType; private SubscriptionItemsBuilder() {} @@ -1994,6 +2011,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder prorationType(ProrationType value) { this.prorationType = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java index b52db207a..df1fb1962 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateUpdateSubscriptionParams.java @@ -1646,6 +1646,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleActivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleActivatedEvent.java new file mode 100644 index 000000000..dd48b64cf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleActivatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleActivatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleActivatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleActivatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleActivatedEvent fromJson(JsonObject jsonObj) { + BusinessRuleActivatedEvent obj = new BusinessRuleActivatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleActivatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleActivatedEvent that = (BusinessRuleActivatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleCreatedEvent.java new file mode 100644 index 000000000..42baa0e5b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleCreatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleCreatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleCreatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleCreatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleCreatedEvent fromJson(JsonObject jsonObj) { + BusinessRuleCreatedEvent obj = new BusinessRuleCreatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleCreatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleCreatedEvent that = (BusinessRuleCreatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeactivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeactivatedEvent.java new file mode 100644 index 000000000..ac5a27e57 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeactivatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleDeactivatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleDeactivatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleDeactivatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleDeactivatedEvent fromJson(JsonObject jsonObj) { + BusinessRuleDeactivatedEvent obj = new BusinessRuleDeactivatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleDeactivatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleDeactivatedEvent that = (BusinessRuleDeactivatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeletedEvent.java new file mode 100644 index 000000000..b8da006bc --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleDeletedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleDeletedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleDeletedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleDeletedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleDeletedEvent fromJson(JsonObject jsonObj) { + BusinessRuleDeletedEvent obj = new BusinessRuleDeletedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleDeletedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleDeletedEvent that = (BusinessRuleDeletedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleReleasedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleReleasedEvent.java new file mode 100644 index 000000000..463a04dc9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleReleasedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleReleasedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleReleasedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleReleasedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleReleasedEvent fromJson(JsonObject jsonObj) { + BusinessRuleReleasedEvent obj = new BusinessRuleReleasedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleReleasedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleReleasedEvent that = (BusinessRuleReleasedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRuleUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRuleUpdatedEvent.java new file mode 100644 index 000000000..82e7b22c3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRuleUpdatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRule.BusinessRule; + +public class BusinessRuleUpdatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRuleUpdatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRuleUpdatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRuleUpdatedEvent fromJson(JsonObject jsonObj) { + BusinessRuleUpdatedEvent obj = new BusinessRuleUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRuleUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRuleUpdatedEvent that = (BusinessRuleUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRule businessRule; + + public BusinessRule getBusinessRule() { + return businessRule; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRuleObj = JsonUtil.getJsonObject(jsonObj, "business_rule"); + if (__businessRuleObj != null) { + obj.businessRule = BusinessRule.fromJson(__businessRuleObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRule=" + businessRule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRule, that.businessRule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesAppliedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesAppliedEvent.java new file mode 100644 index 000000000..1fb035a90 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesAppliedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.appliedBusinessRule.AppliedBusinessRule; + +public class BusinessRulesAppliedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesAppliedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesAppliedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesAppliedEvent fromJson(JsonObject jsonObj) { + BusinessRulesAppliedEvent obj = new BusinessRulesAppliedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesAppliedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesAppliedEvent that = (BusinessRulesAppliedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private AppliedBusinessRule businessRulesApplied; + + public AppliedBusinessRule getBusinessRulesApplied() { + return businessRulesApplied; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesAppliedObj = + JsonUtil.getJsonObject(jsonObj, "business_rules_applied"); + if (__businessRulesAppliedObj != null) { + obj.businessRulesApplied = AppliedBusinessRule.fromJson(__businessRulesAppliedObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRulesApplied=" + businessRulesApplied + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRulesApplied, that.businessRulesApplied); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRulesApplied); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesetActivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetActivatedEvent.java new file mode 100644 index 000000000..796423f75 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetActivatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +public class BusinessRulesetActivatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesetActivatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetActivatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetActivatedEvent fromJson(JsonObject jsonObj) { + BusinessRulesetActivatedEvent obj = new BusinessRulesetActivatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetActivatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetActivatedEvent that = (BusinessRulesetActivatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + obj.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesetCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetCreatedEvent.java new file mode 100644 index 000000000..cfe1a94da --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetCreatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +public class BusinessRulesetCreatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesetCreatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetCreatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetCreatedEvent fromJson(JsonObject jsonObj) { + BusinessRulesetCreatedEvent obj = new BusinessRulesetCreatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetCreatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetCreatedEvent that = (BusinessRulesetCreatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + obj.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeactivatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeactivatedEvent.java new file mode 100644 index 000000000..f437e7c48 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeactivatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +public class BusinessRulesetDeactivatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesetDeactivatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetDeactivatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetDeactivatedEvent fromJson(JsonObject jsonObj) { + BusinessRulesetDeactivatedEvent obj = new BusinessRulesetDeactivatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetDeactivatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetDeactivatedEvent that = (BusinessRulesetDeactivatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + obj.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeletedEvent.java new file mode 100644 index 000000000..0911efc2f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetDeletedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +public class BusinessRulesetDeletedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesetDeletedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetDeletedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetDeletedEvent fromJson(JsonObject jsonObj) { + BusinessRulesetDeletedEvent obj = new BusinessRulesetDeletedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetDeletedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetDeletedEvent that = (BusinessRulesetDeletedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + obj.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/BusinessRulesetUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetUpdatedEvent.java new file mode 100644 index 000000000..6919fa606 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/BusinessRulesetUpdatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.businessRuleset.BusinessRuleset; + +public class BusinessRulesetUpdatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static BusinessRulesetUpdatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BusinessRulesetUpdatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BusinessRulesetUpdatedEvent fromJson(JsonObject jsonObj) { + BusinessRulesetUpdatedEvent obj = new BusinessRulesetUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "BusinessRulesetUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BusinessRulesetUpdatedEvent that = (BusinessRulesetUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private BusinessRuleset businessRuleset; + + public BusinessRuleset getBusinessRuleset() { + return businessRuleset; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __businessRulesetObj = JsonUtil.getJsonObject(jsonObj, "business_ruleset"); + if (__businessRulesetObj != null) { + obj.businessRuleset = BusinessRuleset.fromJson(__businessRulesetObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "businessRuleset=" + businessRuleset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(businessRuleset, that.businessRuleset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessRuleset); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/EinvoiceCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/EinvoiceCreatedEvent.java new file mode 100644 index 000000000..7b2c9b56f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/EinvoiceCreatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.einvoice.Einvoice; + +public class EinvoiceCreatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static EinvoiceCreatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EinvoiceCreatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static EinvoiceCreatedEvent fromJson(JsonObject jsonObj) { + EinvoiceCreatedEvent obj = new EinvoiceCreatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "EinvoiceCreatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EinvoiceCreatedEvent that = (EinvoiceCreatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private Einvoice einvoice; + + public Einvoice getEinvoice() { + return einvoice; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __einvoiceObj = JsonUtil.getJsonObject(jsonObj, "einvoice"); + if (__einvoiceObj != null) { + obj.einvoice = Einvoice.fromJson(__einvoiceObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "einvoice=" + einvoice + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(einvoice, that.einvoice); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(einvoice); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/EinvoiceUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/EinvoiceUpdatedEvent.java new file mode 100644 index 000000000..cd85f8387 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/EinvoiceUpdatedEvent.java @@ -0,0 +1,183 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.einvoice.Einvoice; + +public class EinvoiceUpdatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static EinvoiceUpdatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EinvoiceUpdatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static EinvoiceUpdatedEvent fromJson(JsonObject jsonObj) { + EinvoiceUpdatedEvent obj = new EinvoiceUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "EinvoiceUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EinvoiceUpdatedEvent that = (EinvoiceUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private Einvoice einvoice; + + public Einvoice getEinvoice() { + return einvoice; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __einvoiceObj = JsonUtil.getJsonObject(jsonObj, "einvoice"); + if (__einvoiceObj != null) { + obj.einvoice = Einvoice.fromJson(__einvoiceObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "einvoice=" + einvoice + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(einvoice, that.einvoice); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(einvoice); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/Event.java b/src/main/java/com/chargebee/v4/models/event/Event.java index 0b85bf8f5..a11830e15 100644 --- a/src/main/java/com/chargebee/v4/models/event/Event.java +++ b/src/main/java/com/chargebee/v4/models/event/Event.java @@ -21,6 +21,7 @@ public class Event { @Deprecated private WebhookStatus webhookStatus; @Deprecated private String webhookFailureReason; private EventType eventType; + private String siteId; private ApiVersion apiVersion; private java.util.Map content; private String originUser; @@ -56,6 +57,10 @@ public EventType getEventType() { return eventType; } + public String getSiteId() { + return siteId; + } + public ApiVersion getApiVersion() { return apiVersion; } @@ -277,6 +282,10 @@ public enum EventType { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -625,12 +634,36 @@ public enum EventType { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + PLAN_CREATED("plan_created"), PLAN_UPDATED("plan_updated"), @@ -719,6 +752,8 @@ public static Event fromJson(JsonObject jsonObj) { obj.eventType = EventType.fromString(JsonUtil.getString(jsonObj, "event_type")); + obj.siteId = JsonUtil.getString(jsonObj, "site_id"); + obj.apiVersion = ApiVersion.fromString(JsonUtil.getString(jsonObj, "api_version")); JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); @@ -752,6 +787,8 @@ public String toString() { + webhookFailureReason + ", eventType=" + eventType + + ", siteId=" + + siteId + ", apiVersion=" + apiVersion + ", content=" @@ -776,6 +813,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(webhookStatus, that.webhookStatus) && java.util.Objects.equals(webhookFailureReason, that.webhookFailureReason) && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(siteId, that.siteId) && java.util.Objects.equals(apiVersion, that.apiVersion) && java.util.Objects.equals(content, that.content) && java.util.Objects.equals(originUser, that.originUser) @@ -793,6 +831,7 @@ public int hashCode() { webhookStatus, webhookFailureReason, eventType, + siteId, apiVersion, content, originUser, diff --git a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java index f817e0bb7..d32a997f0 100644 --- a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java +++ b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java @@ -606,6 +606,10 @@ public enum EventTypeIs { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -954,12 +958,36 @@ public enum EventTypeIs { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + /** An enum member indicating that EventTypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1100,6 +1128,10 @@ public enum EventTypeIsNot { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -1448,12 +1480,36 @@ public enum EventTypeIsNot { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + /** An enum member indicating that EventTypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1594,6 +1650,10 @@ public enum EventTypeIn { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -1942,12 +2002,36 @@ public enum EventTypeIn { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + /** An enum member indicating that EventTypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2088,6 +2172,10 @@ public enum EventTypeNotIn { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -2436,12 +2524,36 @@ public enum EventTypeNotIn { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + /** An enum member indicating that EventTypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2860,6 +2972,10 @@ public enum EventType { CREDIT_NOTE_DELETED("credit_note_deleted"), + EINVOICE_CREATED("einvoice_created"), + + EINVOICE_UPDATED("einvoice_updated"), + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), @@ -3208,12 +3324,36 @@ public enum EventType { LEDGER_UPDATED("ledger_updated"), + BUSINESS_RULE_CREATED("business_rule_created"), + + BUSINESS_RULE_UPDATED("business_rule_updated"), + + BUSINESS_RULE_ACTIVATED("business_rule_activated"), + + BUSINESS_RULE_DEACTIVATED("business_rule_deactivated"), + + BUSINESS_RULE_DELETED("business_rule_deleted"), + + BUSINESS_RULE_RELEASED("business_rule_released"), + VAULT_TOKEN_CREATED("vault_token_created"), VAULT_TOKEN_UPDATED("vault_token_updated"), VAULT_TOKEN_DELETED("vault_token_deleted"), + BUSINESS_RULES_APPLIED("business_rules_applied"), + + BUSINESS_RULESET_CREATED("business_ruleset_created"), + + BUSINESS_RULESET_UPDATED("business_ruleset_updated"), + + BUSINESS_RULESET_ACTIVATED("business_ruleset_activated"), + + BUSINESS_RULESET_DEACTIVATED("business_ruleset_deactivated"), + + BUSINESS_RULESET_DELETED("business_ruleset_deleted"), + /** An enum member indicating that EventType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java index 61268bc36..9e93b12a6 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java @@ -377,6 +377,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java index 11d59664f..5ba8fec92 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java @@ -1273,6 +1273,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java index a78af317d..4007e9001 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java @@ -1274,6 +1274,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java index 85e31241a..6a586fb86 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java @@ -398,6 +398,32 @@ public enum PaymentMethod { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -542,6 +568,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java index b7b774880..42a1cbecb 100644 --- a/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java +++ b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java @@ -175,6 +175,8 @@ public enum GatewayName { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayName was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java index 78fa4f50e..306a37b45 100644 --- a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java @@ -810,6 +810,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java index e0b5e8af0..e87fef857 100644 --- a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java @@ -786,6 +786,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java b/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java index 4d11eaca4..3244759c0 100644 --- a/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java +++ b/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java @@ -15,18 +15,18 @@ public class GrantBlock { private String id; private String subscriptionId; - private AccountType accountType; private String unitId; private UnitType unitType; - private String grantedAmount; + private AccountType accountType; + @Deprecated private String grantedAmount; private Timestamp effectiveFrom; private Timestamp expiresAt; - private String balance; - private String holdAmount; - private String usedAmount; - private String expiredAmount; - private String rolledOverAmount; - private String voidedAmount; + @Deprecated private String balance; + @Deprecated private String holdAmount; + @Deprecated private String usedAmount; + @Deprecated private String expiredAmount; + @Deprecated private String rolledOverAmount; + @Deprecated private String voidedAmount; private String originGrantBlockId; private Status status; private GrantSource grantSource; @@ -34,6 +34,8 @@ public class GrantBlock { private Timestamp modifiedAt; private Long resourceVersion; private java.util.Map metadata; + private ProvisionedBlockBalance provisionedBlockBalance; + private OverdraftBlockBalance overdraftBlockBalance; public String getId() { return id; @@ -43,10 +45,6 @@ public String getSubscriptionId() { return subscriptionId; } - public AccountType getAccountType() { - return accountType; - } - public String getUnitId() { return unitId; } @@ -55,6 +53,11 @@ public UnitType getUnitType() { return unitType; } + public AccountType getAccountType() { + return accountType; + } + + @Deprecated public String getGrantedAmount() { return grantedAmount; } @@ -67,26 +70,32 @@ public Timestamp getExpiresAt() { return expiresAt; } + @Deprecated public String getBalance() { return balance; } + @Deprecated public String getHoldAmount() { return holdAmount; } + @Deprecated public String getUsedAmount() { return usedAmount; } + @Deprecated public String getExpiredAmount() { return expiredAmount; } + @Deprecated public String getRolledOverAmount() { return rolledOverAmount; } + @Deprecated public String getVoidedAmount() { return voidedAmount; } @@ -119,16 +128,22 @@ public java.util.Map getMetadata() { return metadata; } - public enum AccountType { - PROVISIONED("provisioned"), + public ProvisionedBlockBalance getProvisionedBlockBalance() { + return provisionedBlockBalance; + } - OVERDRAFT("overdraft"), + public OverdraftBlockBalance getOverdraftBlockBalance() { + return overdraftBlockBalance; + } - /** An enum member indicating that AccountType was instantiated with an unknown value. */ + public enum UnitType { + CREDIT_UNIT("credit_unit"), + + /** An enum member indicating that UnitType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - AccountType(String value) { + UnitType(String value) { this.value = value; } @@ -136,9 +151,9 @@ public String getValue() { return value; } - public static AccountType fromString(String value) { + public static UnitType fromString(String value) { if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { + for (UnitType enumValue : UnitType.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -147,14 +162,16 @@ public static AccountType fromString(String value) { } } - public enum UnitType { - CREDIT_UNIT("credit_unit"), + public enum AccountType { + PROVISIONED("provisioned"), - /** An enum member indicating that UnitType was instantiated with an unknown value. */ + OVERDRAFT("overdraft"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - UnitType(String value) { + AccountType(String value) { this.value = value; } @@ -162,9 +179,9 @@ public String getValue() { return value; } - public static UnitType fromString(String value) { + public static AccountType fromString(String value) { if (value == null) return _UNKNOWN; - for (UnitType enumValue : UnitType.values()) { + for (AccountType enumValue : AccountType.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -258,12 +275,12 @@ public static GrantBlock fromJson(JsonObject jsonObj) { obj.subscriptionId = JsonUtil.getString(jsonObj, "subscription_id"); - obj.accountType = AccountType.fromString(JsonUtil.getString(jsonObj, "account_type")); - obj.unitId = JsonUtil.getString(jsonObj, "unit_id"); obj.unitType = UnitType.fromString(JsonUtil.getString(jsonObj, "unit_type")); + obj.accountType = AccountType.fromString(JsonUtil.getString(jsonObj, "account_type")); + obj.grantedAmount = JsonUtil.getString(jsonObj, "granted_amount"); obj.effectiveFrom = JsonUtil.getTimestamp(jsonObj, "effective_from"); @@ -300,6 +317,18 @@ public static GrantBlock fromJson(JsonObject jsonObj) { ? JsonUtil.parseJsonObjectToMap(__metadataObj) : new java.util.HashMap<>(); + JsonObject __provisionedBlockBalanceObj = + JsonUtil.getJsonObject(jsonObj, "provisioned_block_balance"); + if (__provisionedBlockBalanceObj != null) { + obj.provisionedBlockBalance = ProvisionedBlockBalance.fromJson(__provisionedBlockBalanceObj); + } + + JsonObject __overdraftBlockBalanceObj = + JsonUtil.getJsonObject(jsonObj, "overdraft_block_balance"); + if (__overdraftBlockBalanceObj != null) { + obj.overdraftBlockBalance = OverdraftBlockBalance.fromJson(__overdraftBlockBalanceObj); + } + return obj; } @@ -310,12 +339,12 @@ public String toString() { + id + ", subscriptionId=" + subscriptionId - + ", accountType=" - + accountType + ", unitId=" + unitId + ", unitType=" + unitType + + ", accountType=" + + accountType + ", grantedAmount=" + grantedAmount + ", effectiveFrom=" @@ -348,6 +377,10 @@ public String toString() { + resourceVersion + ", metadata=" + metadata + + ", provisionedBlockBalance=" + + provisionedBlockBalance + + ", overdraftBlockBalance=" + + overdraftBlockBalance + "}"; } @@ -359,9 +392,9 @@ public boolean equals(Object o) { GrantBlock that = (GrantBlock) o; return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(subscriptionId, that.subscriptionId) - && java.util.Objects.equals(accountType, that.accountType) && java.util.Objects.equals(unitId, that.unitId) && java.util.Objects.equals(unitType, that.unitType) + && java.util.Objects.equals(accountType, that.accountType) && java.util.Objects.equals(grantedAmount, that.grantedAmount) && java.util.Objects.equals(effectiveFrom, that.effectiveFrom) && java.util.Objects.equals(expiresAt, that.expiresAt) @@ -377,7 +410,9 @@ public boolean equals(Object o) { && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(modifiedAt, that.modifiedAt) && java.util.Objects.equals(resourceVersion, that.resourceVersion) - && java.util.Objects.equals(metadata, that.metadata); + && java.util.Objects.equals(metadata, that.metadata) + && java.util.Objects.equals(provisionedBlockBalance, that.provisionedBlockBalance) + && java.util.Objects.equals(overdraftBlockBalance, that.overdraftBlockBalance); } @Override @@ -386,9 +421,9 @@ public int hashCode() { return java.util.Objects.hash( id, subscriptionId, - accountType, unitId, unitType, + accountType, grantedAmount, effectiveFrom, expiresAt, @@ -404,6 +439,222 @@ public int hashCode() { createdAt, modifiedAt, resourceVersion, - metadata); + metadata, + provisionedBlockBalance, + overdraftBlockBalance); + } + + public static class ProvisionedBlockBalance { + + private String grantedAmount; + private String totalBalance; + private String usableBalance; + private String holdAmount; + private String usedAmount; + private String expiredAmount; + private String rolledOverAmount; + private String voidedAmount; + + public String getGrantedAmount() { + return grantedAmount; + } + + public String getTotalBalance() { + return totalBalance; + } + + public String getUsableBalance() { + return usableBalance; + } + + public String getHoldAmount() { + return holdAmount; + } + + public String getUsedAmount() { + return usedAmount; + } + + public String getExpiredAmount() { + return expiredAmount; + } + + public String getRolledOverAmount() { + return rolledOverAmount; + } + + public String getVoidedAmount() { + return voidedAmount; + } + + public static ProvisionedBlockBalance fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ProvisionedBlockBalance fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ProvisionedBlockBalance fromJson(JsonObject jsonObj) { + ProvisionedBlockBalance obj = new ProvisionedBlockBalance(); + + obj.grantedAmount = JsonUtil.getString(jsonObj, "granted_amount"); + + obj.totalBalance = JsonUtil.getString(jsonObj, "total_balance"); + + obj.usableBalance = JsonUtil.getString(jsonObj, "usable_balance"); + + obj.holdAmount = JsonUtil.getString(jsonObj, "hold_amount"); + + obj.usedAmount = JsonUtil.getString(jsonObj, "used_amount"); + + obj.expiredAmount = JsonUtil.getString(jsonObj, "expired_amount"); + + obj.rolledOverAmount = JsonUtil.getString(jsonObj, "rolled_over_amount"); + + obj.voidedAmount = JsonUtil.getString(jsonObj, "voided_amount"); + + return obj; + } + + @Override + public String toString() { + return "ProvisionedBlockBalance{" + + "grantedAmount=" + + grantedAmount + + ", totalBalance=" + + totalBalance + + ", usableBalance=" + + usableBalance + + ", holdAmount=" + + holdAmount + + ", usedAmount=" + + usedAmount + + ", expiredAmount=" + + expiredAmount + + ", rolledOverAmount=" + + rolledOverAmount + + ", voidedAmount=" + + voidedAmount + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ProvisionedBlockBalance that = (ProvisionedBlockBalance) o; + return java.util.Objects.equals(grantedAmount, that.grantedAmount) + && java.util.Objects.equals(totalBalance, that.totalBalance) + && java.util.Objects.equals(usableBalance, that.usableBalance) + && java.util.Objects.equals(holdAmount, that.holdAmount) + && java.util.Objects.equals(usedAmount, that.usedAmount) + && java.util.Objects.equals(expiredAmount, that.expiredAmount) + && java.util.Objects.equals(rolledOverAmount, that.rolledOverAmount) + && java.util.Objects.equals(voidedAmount, that.voidedAmount); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + grantedAmount, + totalBalance, + usableBalance, + holdAmount, + usedAmount, + expiredAmount, + rolledOverAmount, + voidedAmount); + } + } + + public static class OverdraftBlockBalance { + + private Boolean isUnlimited; + private String limit; + private String totalBalance; + private String usableBalance; + private String usedAmount; + + public Boolean getIsUnlimited() { + return isUnlimited; + } + + public String getLimit() { + return limit; + } + + public String getTotalBalance() { + return totalBalance; + } + + public String getUsableBalance() { + return usableBalance; + } + + public String getUsedAmount() { + return usedAmount; + } + + public static OverdraftBlockBalance fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static OverdraftBlockBalance fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static OverdraftBlockBalance fromJson(JsonObject jsonObj) { + OverdraftBlockBalance obj = new OverdraftBlockBalance(); + + obj.isUnlimited = JsonUtil.getBoolean(jsonObj, "is_unlimited"); + + obj.limit = JsonUtil.getString(jsonObj, "limit"); + + obj.totalBalance = JsonUtil.getString(jsonObj, "total_balance"); + + obj.usableBalance = JsonUtil.getString(jsonObj, "usable_balance"); + + obj.usedAmount = JsonUtil.getString(jsonObj, "used_amount"); + + return obj; + } + + @Override + public String toString() { + return "OverdraftBlockBalance{" + + "isUnlimited=" + + isUnlimited + + ", limit=" + + limit + + ", totalBalance=" + + totalBalance + + ", usableBalance=" + + usableBalance + + ", usedAmount=" + + usedAmount + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + OverdraftBlockBalance that = (OverdraftBlockBalance) o; + return java.util.Objects.equals(isUnlimited, that.isUnlimited) + && java.util.Objects.equals(limit, that.limit) + && java.util.Objects.equals(totalBalance, that.totalBalance) + && java.util.Objects.equals(usableBalance, that.usableBalance) + && java.util.Objects.equals(usedAmount, that.usedAmount); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(isUnlimited, limit, totalBalance, usableBalance, usedAmount); + } } } diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java b/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java index eefe313a6..a98abd29d 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/HostedPage.java @@ -27,6 +27,7 @@ public class HostedPage { private Long resourceVersion; private java.util.Map checkoutInfo; private String businessEntityId; + private String brandId; private Boolean embed; public String getId() { @@ -86,6 +87,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Boolean getEmbed() { return embed; } @@ -279,6 +284,8 @@ public static HostedPage fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + obj.embed = JsonUtil.getBoolean(jsonObj, "embed"); return obj; @@ -315,6 +322,8 @@ public String toString() { + checkoutInfo + ", businessEntityId=" + businessEntityId + + ", brandId=" + + brandId + ", embed=" + embed + "}"; @@ -340,6 +349,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(resourceVersion, that.resourceVersion) && java.util.Objects.equals(checkoutInfo, that.checkoutInfo) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(embed, that.embed); } @@ -361,6 +371,7 @@ public int hashCode() { resourceVersion, checkoutInfo, businessEntityId, + brandId, embed); } } diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java index 2db144dc1..774ecac84 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageAcceptQuoteParams.java @@ -13,6 +13,8 @@ public final class HostedPageAcceptQuoteParams { + private final String brandId; + private final String redirectUrl; private final Layout layout; @@ -21,6 +23,8 @@ public final class HostedPageAcceptQuoteParams { private HostedPageAcceptQuoteParams(HostedPageAcceptQuoteBuilder builder) { + this.brandId = builder.brandId; + this.redirectUrl = builder.redirectUrl; this.layout = builder.layout; @@ -28,6 +32,10 @@ private HostedPageAcceptQuoteParams(HostedPageAcceptQuoteBuilder builder) { this.quote = builder.quote; } + public String getBrandId() { + return brandId; + } + public String getRedirectUrl() { return redirectUrl; } @@ -44,6 +52,11 @@ public QuoteParams getQuote() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.redirectUrl != null) { formData.put("redirect_url", this.redirectUrl); @@ -75,6 +88,8 @@ public static HostedPageAcceptQuoteBuilder builder() { public static final class HostedPageAcceptQuoteBuilder { + private String brandId; + private String redirectUrl; private Layout layout; @@ -83,6 +98,11 @@ public static final class HostedPageAcceptQuoteBuilder { private HostedPageAcceptQuoteBuilder() {} + public HostedPageAcceptQuoteBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageAcceptQuoteBuilder redirectUrl(String value) { this.redirectUrl = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java index 1ff9278ce..8ce7acb0a 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java @@ -18,6 +18,8 @@ public final class HostedPageCheckoutExistingForItemsParams { private final Layout layout; + private final String brandId; + private final List mandatoryItemsToRemove; private final Boolean replaceItemsList; @@ -75,6 +77,8 @@ private HostedPageCheckoutExistingForItemsParams( this.layout = builder.layout; + this.brandId = builder.brandId; + this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; this.replaceItemsList = builder.replaceItemsList; @@ -132,6 +136,10 @@ public Layout getLayout() { return layout; } + public String getBrandId() { + return brandId; + } + public List getMandatoryItemsToRemove() { return mandatoryItemsToRemove; } @@ -245,6 +253,11 @@ public Map toFormData() { formData.put("layout", this.layout); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.mandatoryItemsToRemove != null) { formData.put("mandatory_items_to_remove", this.mandatoryItemsToRemove); @@ -448,6 +461,8 @@ public static final class HostedPageCheckoutExistingForItemsBuilder { private Layout layout; + private String brandId; + private List mandatoryItemsToRemove; private Boolean replaceItemsList; @@ -507,6 +522,11 @@ public HostedPageCheckoutExistingForItemsBuilder layout(Layout value) { return this; } + public HostedPageCheckoutExistingForItemsBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageCheckoutExistingForItemsBuilder mandatoryItemsToRemove(List value) { this.mandatoryItemsToRemove = value; return this; @@ -1441,6 +1461,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageCheckoutExistingParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java index 17f1c1e19..6ecf51efd 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java @@ -1318,6 +1318,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java index f9cca02ed..8c01a096d 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutGiftForItemsParams.java @@ -18,6 +18,8 @@ public final class HostedPageCheckoutGiftForItemsParams { private final String businessEntityId; + private final String brandId; + private final String redirectUrl; private final List couponIds; @@ -34,6 +36,8 @@ private HostedPageCheckoutGiftForItemsParams(HostedPageCheckoutGiftForItemsBuild this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.redirectUrl = builder.redirectUrl; this.couponIds = builder.couponIds; @@ -53,6 +57,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public String getRedirectUrl() { return redirectUrl; } @@ -87,6 +95,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.redirectUrl != null) { formData.put("redirect_url", this.redirectUrl); @@ -152,6 +165,8 @@ public static final class HostedPageCheckoutGiftForItemsBuilder { private String businessEntityId; + private String brandId; + private String redirectUrl; private List couponIds; @@ -174,6 +189,11 @@ public HostedPageCheckoutGiftForItemsBuilder businessEntityId(String value) { return this; } + public HostedPageCheckoutGiftForItemsBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageCheckoutGiftForItemsBuilder redirectUrl(String value) { this.redirectUrl = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java index a9708a76d..dcca9d202 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java @@ -20,6 +20,8 @@ public final class HostedPageCheckoutNewForItemsParams { private final String businessEntityId; + private final String brandId; + private final Integer billingCycles; private final List mandatoryItemsToRemove; @@ -64,6 +66,8 @@ private HostedPageCheckoutNewForItemsParams(HostedPageCheckoutNewForItemsBuilder this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.billingCycles = builder.billingCycles; this.mandatoryItemsToRemove = builder.mandatoryItemsToRemove; @@ -111,6 +115,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Integer getBillingCycles() { return billingCycles; } @@ -201,6 +209,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.billingCycles != null) { formData.put("billing_cycles", this.billingCycles); @@ -381,6 +394,8 @@ public static final class HostedPageCheckoutNewForItemsBuilder { private String businessEntityId; + private String brandId; + private Integer billingCycles; private List mandatoryItemsToRemove; @@ -431,6 +446,11 @@ public HostedPageCheckoutNewForItemsBuilder businessEntityId(String value) { return this; } + public HostedPageCheckoutNewForItemsBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageCheckoutNewForItemsBuilder billingCycles(Integer value) { this.billingCycles = value; return this; @@ -1315,6 +1335,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1556,6 +1578,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageCheckoutNewParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java index 34e666248..5da5f7169 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java @@ -1265,6 +1265,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1476,6 +1478,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java index 59fa4d9e6..0ef93223e 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java @@ -18,6 +18,8 @@ public final class HostedPageCheckoutOneTimeForItemsParams { private final String businessEntityId; + private final String brandId; + private final Layout layout; private final String invoiceNote; @@ -59,6 +61,8 @@ private HostedPageCheckoutOneTimeForItemsParams( this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.layout = builder.layout; this.invoiceNote = builder.invoiceNote; @@ -100,6 +104,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Layout getLayout() { return layout; } @@ -181,6 +189,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.layout != null) { formData.put("layout", this.layout); @@ -359,6 +372,8 @@ public static final class HostedPageCheckoutOneTimeForItemsBuilder { private String businessEntityId; + private String brandId; + private Layout layout; private String invoiceNote; @@ -402,6 +417,11 @@ public HostedPageCheckoutOneTimeForItemsBuilder businessEntityId(String value) { return this; } + public HostedPageCheckoutOneTimeForItemsBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageCheckoutOneTimeForItemsBuilder layout(Layout value) { this.layout = value; return this; @@ -910,6 +930,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1199,6 +1221,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageCheckoutOneTimeParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java index bba4d1f72..a065ca703 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java @@ -710,6 +710,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -969,6 +971,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageClaimGiftParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java index d3f5c2751..f8a23c5c8 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageClaimGiftParams.java @@ -13,6 +13,8 @@ public final class HostedPageClaimGiftParams { + private final String brandId; + private final String redirectUrl; private final GiftParams gift; @@ -21,6 +23,8 @@ public final class HostedPageClaimGiftParams { private HostedPageClaimGiftParams(HostedPageClaimGiftBuilder builder) { + this.brandId = builder.brandId; + this.redirectUrl = builder.redirectUrl; this.gift = builder.gift; @@ -28,6 +32,10 @@ private HostedPageClaimGiftParams(HostedPageClaimGiftBuilder builder) { this.customer = builder.customer; } + public String getBrandId() { + return brandId; + } + public String getRedirectUrl() { return redirectUrl; } @@ -44,6 +52,11 @@ public CustomerParams getCustomer() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.redirectUrl != null) { formData.put("redirect_url", this.redirectUrl); @@ -80,6 +93,8 @@ public static HostedPageClaimGiftBuilder builder() { public static final class HostedPageClaimGiftBuilder { + private String brandId; + private String redirectUrl; private GiftParams gift; @@ -88,6 +103,11 @@ public static final class HostedPageClaimGiftBuilder { private HostedPageClaimGiftBuilder() {} + public HostedPageClaimGiftBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageClaimGiftBuilder redirectUrl(String value) { this.redirectUrl = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java index 49a4775c2..f3fa4b5c4 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java @@ -13,6 +13,8 @@ public final class HostedPageCollectNowParams { + private final String brandId; + private final String redirectUrl; private final String currencyCode; @@ -25,6 +27,8 @@ public final class HostedPageCollectNowParams { private HostedPageCollectNowParams(HostedPageCollectNowBuilder builder) { + this.brandId = builder.brandId; + this.redirectUrl = builder.redirectUrl; this.currencyCode = builder.currencyCode; @@ -36,6 +40,10 @@ private HostedPageCollectNowParams(HostedPageCollectNowBuilder builder) { this.card = builder.card; } + public String getBrandId() { + return brandId; + } + public String getRedirectUrl() { return redirectUrl; } @@ -60,6 +68,11 @@ public CardParams getCard() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.redirectUrl != null) { formData.put("redirect_url", this.redirectUrl); @@ -106,6 +119,8 @@ public static HostedPageCollectNowBuilder builder() { public static final class HostedPageCollectNowBuilder { + private String brandId; + private String redirectUrl; private String currencyCode; @@ -118,6 +133,11 @@ public static final class HostedPageCollectNowBuilder { private HostedPageCollectNowBuilder() {} + public HostedPageCollectNowBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageCollectNowBuilder redirectUrl(String value) { this.redirectUrl = value; return this; @@ -416,6 +436,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageExtendSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java index 17a1f0265..db3974143 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageExtendSubscriptionParams.java @@ -13,6 +13,8 @@ public final class HostedPageExtendSubscriptionParams { + private final String brandId; + private final Integer expiry; private final Integer billingCycle; @@ -21,6 +23,8 @@ public final class HostedPageExtendSubscriptionParams { private HostedPageExtendSubscriptionParams(HostedPageExtendSubscriptionBuilder builder) { + this.brandId = builder.brandId; + this.expiry = builder.expiry; this.billingCycle = builder.billingCycle; @@ -28,6 +32,10 @@ private HostedPageExtendSubscriptionParams(HostedPageExtendSubscriptionBuilder b this.subscription = builder.subscription; } + public String getBrandId() { + return brandId; + } + public Integer getExpiry() { return expiry; } @@ -44,6 +52,11 @@ public SubscriptionParams getSubscription() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.expiry != null) { formData.put("expiry", this.expiry); @@ -75,6 +88,8 @@ public static HostedPageExtendSubscriptionBuilder builder() { public static final class HostedPageExtendSubscriptionBuilder { + private String brandId; + private Integer expiry; private Integer billingCycle; @@ -83,6 +98,11 @@ public static final class HostedPageExtendSubscriptionBuilder { private HostedPageExtendSubscriptionBuilder() {} + public HostedPageExtendSubscriptionBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageExtendSubscriptionBuilder expiry(Integer value) { this.expiry = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java index def2bd727..db578ac16 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java @@ -15,6 +15,8 @@ public final class HostedPageManagePaymentSourcesParams { private final String businessEntityId; + private final String brandId; + private final String redirectUrl; private final CustomerParams customer; @@ -25,6 +27,8 @@ private HostedPageManagePaymentSourcesParams(HostedPageManagePaymentSourcesBuild this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.redirectUrl = builder.redirectUrl; this.customer = builder.customer; @@ -36,6 +40,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public String getRedirectUrl() { return redirectUrl; } @@ -57,6 +65,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.redirectUrl != null) { formData.put("redirect_url", this.redirectUrl); @@ -95,6 +108,8 @@ public static final class HostedPageManagePaymentSourcesBuilder { private String businessEntityId; + private String brandId; + private String redirectUrl; private CustomerParams customer; @@ -108,6 +123,11 @@ public HostedPageManagePaymentSourcesBuilder businessEntityId(String value) { return this; } + public HostedPageManagePaymentSourcesBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPageManagePaymentSourcesBuilder redirectUrl(String value) { this.redirectUrl = value; return this; @@ -363,6 +383,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPagePreCancelParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java index c42e3d638..41c5d3bee 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java @@ -13,6 +13,8 @@ public final class HostedPagePreCancelParams { + private final String brandId; + private final String passThruContent; private final String cancelUrl; @@ -25,6 +27,8 @@ public final class HostedPagePreCancelParams { private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { + this.brandId = builder.brandId; + this.passThruContent = builder.passThruContent; this.cancelUrl = builder.cancelUrl; @@ -36,6 +40,10 @@ private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { this.subscription = builder.subscription; } + public String getBrandId() { + return brandId; + } + public String getPassThruContent() { return passThruContent; } @@ -60,6 +68,11 @@ public SubscriptionParams getSubscription() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.passThruContent != null) { formData.put("pass_thru_content", this.passThruContent); @@ -101,6 +114,8 @@ public static HostedPagePreCancelBuilder builder() { public static final class HostedPagePreCancelBuilder { + private String brandId; + private String passThruContent; private String cancelUrl; @@ -113,6 +128,11 @@ public static final class HostedPagePreCancelBuilder { private HostedPagePreCancelBuilder() {} + public HostedPagePreCancelBuilder brandId(String value) { + this.brandId = value; + return this; + } + public HostedPagePreCancelBuilder passThruContent(String value) { this.passThruContent = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java index 77eddd000..ec518b0aa 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java @@ -465,6 +465,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/hostedPage/params/HostedPageUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java index b6823ef79..97b199eb9 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java @@ -465,6 +465,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** 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/invoice/Invoice.java b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java index c65b4eb5a..6481822ed 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/Invoice.java +++ b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java @@ -64,6 +64,7 @@ public class Invoice { private String vatNumberPrefix; private Channel channel; private String businessEntityId; + private String brandId; private List exchangeRates; private List lineItems; private List lineItemTiers; @@ -282,6 +283,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public List getExchangeRates() { return exchangeRates; } @@ -629,6 +634,8 @@ public static Invoice fromJson(JsonObject jsonObj) { knownFields.add("business_entity_id"); + knownFields.add("brand_id"); + knownFields.add("exchange_rates"); knownFields.add("line_items"); @@ -771,6 +778,8 @@ public static Invoice fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + obj.exchangeRates = JsonUtil.mapArray( JsonUtil.getJsonArray(jsonObj, "exchange_rates"), ExchangeRates::fromJson); @@ -969,6 +978,8 @@ public String toString() { + channel + ", businessEntityId=" + businessEntityId + + ", brandId=" + + brandId + ", exchangeRates=" + exchangeRates + ", lineItems=" @@ -1074,6 +1085,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(vatNumberPrefix, that.vatNumberPrefix) && java.util.Objects.equals(channel, that.channel) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(exchangeRates, that.exchangeRates) && java.util.Objects.equals(lineItems, that.lineItems) && java.util.Objects.equals(lineItemTiers, that.lineItemTiers) @@ -1152,6 +1164,7 @@ public int hashCode() { vatNumberPrefix, channel, businessEntityId, + brandId, exchangeRates, lineItems, lineItemTiers, diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java index 95c7ba275..82fe57ce4 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java @@ -1777,6 +1777,10 @@ public static final class LineItemsParams { private final Long tax10Amount; + private final Boolean isPartialTaxApplied; + + private final Long taxableAmount; + private final ProrationMode prorationMode; private final Timestamp createdAt; @@ -1857,6 +1861,10 @@ private LineItemsParams(LineItemsBuilder builder) { this.tax10Amount = builder.tax10Amount; + this.isPartialTaxApplied = builder.isPartialTaxApplied; + + this.taxableAmount = builder.taxableAmount; + this.prorationMode = builder.prorationMode; this.createdAt = builder.createdAt; @@ -2010,6 +2018,14 @@ public Long getTax10Amount() { return tax10Amount; } + public Boolean getIsPartialTaxApplied() { + return isPartialTaxApplied; + } + + public Long getTaxableAmount() { + return taxableAmount; + } + public ProrationMode getProrationMode() { return prorationMode; } @@ -2207,6 +2223,16 @@ public Map toFormData() { formData.put("tax10_amount", this.tax10Amount); } + if (this.isPartialTaxApplied != null) { + + formData.put("is_partial_tax_applied", this.isPartialTaxApplied); + } + + if (this.taxableAmount != null) { + + formData.put("taxable_amount", this.taxableAmount); + } + if (this.prorationMode != null) { formData.put("proration_mode", this.prorationMode); @@ -2302,6 +2328,10 @@ public static final class LineItemsBuilder { private Long tax10Amount; + private Boolean isPartialTaxApplied; + + private Long taxableAmount; + private ProrationMode prorationMode; private Timestamp createdAt; @@ -2493,6 +2523,16 @@ public LineItemsBuilder tax10Amount(Long value) { return this; } + public LineItemsBuilder isPartialTaxApplied(Boolean value) { + this.isPartialTaxApplied = value; + return this; + } + + public LineItemsBuilder taxableAmount(Long value) { + this.taxableAmount = value; + return this; + } + public LineItemsBuilder prorationMode(ProrationMode value) { this.prorationMode = value; return this; @@ -3421,14 +3461,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java index 679b71fcc..a0541f886 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java @@ -1764,6 +1764,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1794,6 +1796,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2555,6 +2559,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2697,6 +2727,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2994,6 +3026,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java index 86a1bb3ac..82703dc3f 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java @@ -1605,6 +1605,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1635,6 +1637,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2396,6 +2400,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2538,6 +2568,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2835,6 +2867,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java index 1aa6bd312..f299366b4 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordPaymentParams.java @@ -306,14 +306,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java index cc58eba46..ea1476283 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceRecordRefundParams.java @@ -273,14 +273,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSendEmailParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSendEmailParams.java new file mode 100644 index 000000000..bac87a67a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceSendEmailParams.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.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceSendEmailParams { + + private InvoiceSendEmailParams(InvoiceSendEmailBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for InvoiceSendEmailParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceSendEmailBuilder builder() { + return new InvoiceSendEmailBuilder(); + } + + public static final class InvoiceSendEmailBuilder { + + private InvoiceSendEmailBuilder() {} + + public InvoiceSendEmailParams build() { + return new InvoiceSendEmailParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSendEmailResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSendEmailResponse.java new file mode 100644 index 000000000..8303ebe1c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceSendEmailResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.invoice.responses; + +import java.util.List; + +import com.chargebee.v4.models.emailLog.EmailLog; + +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 InvoiceSendEmail operation. Contains the response data from the + * API. + */ +public final class InvoiceSendEmailResponse extends BaseResponse { + private final List emailLogs; + + private InvoiceSendEmailResponse(Builder builder) { + super(builder.httpResponse); + + this.emailLogs = builder.emailLogs; + } + + /** Parse JSON response into InvoiceSendEmailResponse object. */ + public static InvoiceSendEmailResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into InvoiceSendEmailResponse object with HTTP response. */ + public static InvoiceSendEmailResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + builder.emailLogs( + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "email_logs"), EmailLog::fromJson)); + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoiceSendEmailResponse from JSON", e); + } + } + + /** Create a new builder for InvoiceSendEmailResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InvoiceSendEmailResponse. */ + public static class Builder { + + private List emailLogs; + + private Response httpResponse; + + private Builder() {} + + public Builder emailLogs(List emailLogs) { + this.emailLogs = emailLogs; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InvoiceSendEmailResponse build() { + return new InvoiceSendEmailResponse(this); + } + } + + /** Get the emailLogs from the response. */ + public List getEmailLogs() { + return emailLogs; + } + + @Override + public String toString() { + return "InvoiceSendEmailResponse{" + "emailLogs=" + emailLogs + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + InvoiceSendEmailResponse that = (InvoiceSendEmailResponse) o; + return java.util.Objects.equals(emailLogs, that.emailLogs); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(emailLogs); + } +} diff --git a/src/main/java/com/chargebee/v4/models/ledgerEntry/LedgerEntry.java b/src/main/java/com/chargebee/v4/models/ledgerEntry/LedgerEntry.java index 6ef1fe77c..196eb839f 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerEntry/LedgerEntry.java +++ b/src/main/java/com/chargebee/v4/models/ledgerEntry/LedgerEntry.java @@ -15,9 +15,9 @@ public class LedgerEntry { private String id; private String subscriptionId; - private AccountType accountType; private String unitId; private UnitType unitType; + private AccountType accountType; private String amount; private String grantBlockStartBalance; private String grantBlockEndBalance; @@ -37,10 +37,6 @@ public String getSubscriptionId() { return subscriptionId; } - public AccountType getAccountType() { - return accountType; - } - public String getUnitId() { return unitId; } @@ -49,6 +45,10 @@ public UnitType getUnitType() { return unitType; } + public AccountType getAccountType() { + return accountType; + } + public String getAmount() { return amount; } @@ -89,16 +89,14 @@ public Timestamp getModifiedAt() { return modifiedAt; } - public enum AccountType { - PROVISIONED("provisioned"), - - OVERDRAFT("overdraft"), + public enum UnitType { + CREDIT_UNIT("credit_unit"), - /** An enum member indicating that AccountType was instantiated with an unknown value. */ + /** An enum member indicating that UnitType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - AccountType(String value) { + UnitType(String value) { this.value = value; } @@ -106,9 +104,9 @@ public String getValue() { return value; } - public static AccountType fromString(String value) { + public static UnitType fromString(String value) { if (value == null) return _UNKNOWN; - for (AccountType enumValue : AccountType.values()) { + for (UnitType enumValue : UnitType.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -117,14 +115,16 @@ public static AccountType fromString(String value) { } } - public enum UnitType { - CREDIT_UNIT("credit_unit"), + public enum AccountType { + PROVISIONED("provisioned"), - /** An enum member indicating that UnitType was instantiated with an unknown value. */ + OVERDRAFT("overdraft"), + + /** An enum member indicating that AccountType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - UnitType(String value) { + AccountType(String value) { this.value = value; } @@ -132,9 +132,9 @@ public String getValue() { return value; } - public static UnitType fromString(String value) { + public static AccountType fromString(String value) { if (value == null) return _UNKNOWN; - for (UnitType enumValue : UnitType.values()) { + for (AccountType enumValue : AccountType.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -190,12 +190,12 @@ public static LedgerEntry fromJson(JsonObject jsonObj) { obj.subscriptionId = JsonUtil.getString(jsonObj, "subscription_id"); - obj.accountType = AccountType.fromString(JsonUtil.getString(jsonObj, "account_type")); - obj.unitId = JsonUtil.getString(jsonObj, "unit_id"); obj.unitType = UnitType.fromString(JsonUtil.getString(jsonObj, "unit_type")); + obj.accountType = AccountType.fromString(JsonUtil.getString(jsonObj, "account_type")); + obj.amount = JsonUtil.getString(jsonObj, "amount"); obj.grantBlockStartBalance = JsonUtil.getString(jsonObj, "grant_block_start_balance"); @@ -226,12 +226,12 @@ public String toString() { + id + ", subscriptionId=" + subscriptionId - + ", accountType=" - + accountType + ", unitId=" + unitId + ", unitType=" + unitType + + ", accountType=" + + accountType + ", amount=" + amount + ", grantBlockStartBalance=" @@ -263,9 +263,9 @@ public boolean equals(Object o) { LedgerEntry that = (LedgerEntry) o; return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(subscriptionId, that.subscriptionId) - && java.util.Objects.equals(accountType, that.accountType) && java.util.Objects.equals(unitId, that.unitId) && java.util.Objects.equals(unitType, that.unitType) + && java.util.Objects.equals(accountType, that.accountType) && java.util.Objects.equals(amount, that.amount) && java.util.Objects.equals(grantBlockStartBalance, that.grantBlockStartBalance) && java.util.Objects.equals(grantBlockEndBalance, that.grantBlockEndBalance) @@ -284,9 +284,9 @@ public int hashCode() { return java.util.Objects.hash( id, subscriptionId, - accountType, unitId, unitType, + accountType, amount, grantBlockStartBalance, grantBlockEndBalance, diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java index 842efcea0..3a2fba8e4 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java @@ -139,6 +139,8 @@ public enum Type { ADJUSTMENT("adjustment"), + OVERDRAFT_SETTLEMENT("overdraft_settlement"), + /** 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/ledgerOperation/params/LedgerOperationAllocateParams.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/LedgerOperationAllocateParams.java index 3c1d4b885..5e76b2664 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/LedgerOperationAllocateParams.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/LedgerOperationAllocateParams.java @@ -19,8 +19,12 @@ public final class LedgerOperationAllocateParams { private final String unitId; + private final String id; + private final String amount; + private final Timestamp effectiveFrom; + private final Timestamp expiresAt; private final java.util.Map metadata; @@ -31,8 +35,12 @@ private LedgerOperationAllocateParams(LedgerOperationAllocateBuilder builder) { this.unitId = builder.unitId; + this.id = builder.id; + this.amount = builder.amount; + this.effectiveFrom = builder.effectiveFrom; + this.expiresAt = builder.expiresAt; this.metadata = builder.metadata; @@ -46,10 +54,18 @@ public String getUnitId() { return unitId; } + public String getId() { + return id; + } + public String getAmount() { return amount; } + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + public Timestamp getExpiresAt() { return expiresAt; } @@ -72,11 +88,21 @@ public Map toFormData() { formData.put("unit_id", this.unitId); } + if (this.id != null) { + + formData.put("id", this.id); + } + if (this.amount != null) { formData.put("amount", this.amount); } + if (this.effectiveFrom != null) { + + formData.put("effective_from", this.effectiveFrom); + } + if (this.expiresAt != null) { formData.put("expires_at", this.expiresAt); @@ -112,11 +138,21 @@ public Map toJsonMap() { jsonData.put("unit_id", this.unitId); } + if (this.id != null) { + + jsonData.put("id", this.id); + } + if (this.amount != null) { jsonData.put("amount", this.amount); } + if (this.effectiveFrom != null) { + + jsonData.put("effective_from", this.effectiveFrom); + } + if (this.expiresAt != null) { jsonData.put("expires_at", this.expiresAt); @@ -147,8 +183,12 @@ public static final class LedgerOperationAllocateBuilder { private String unitId; + private String id; + private String amount; + private Timestamp effectiveFrom; + private Timestamp expiresAt; private java.util.Map metadata; @@ -165,11 +205,21 @@ public LedgerOperationAllocateBuilder unitId(String value) { return this; } + public LedgerOperationAllocateBuilder id(String value) { + this.id = value; + return this; + } + public LedgerOperationAllocateBuilder amount(String value) { this.amount = value; return this; } + public LedgerOperationAllocateBuilder effectiveFrom(Timestamp value) { + this.effectiveFrom = value; + return this; + } + public LedgerOperationAllocateBuilder expiresAt(Timestamp value) { this.expiresAt = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java index 5de0838d7..3a25ef4cb 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java @@ -217,6 +217,8 @@ public enum TypeIs { ADJUSTMENT("adjustment"), + OVERDRAFT_SETTLEMENT("overdraft_settlement"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -259,6 +261,8 @@ public enum TypeIn { ADJUSTMENT("adjustment"), + OVERDRAFT_SETTLEMENT("overdraft_settlement"), + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -353,6 +357,8 @@ public enum Type { ADJUSTMENT("adjustment"), + OVERDRAFT_SETTLEMENT("overdraft_settlement"), + /** 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/ledgerOperation/responses/LedgerOperationAuthorizeResponse.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationAuthorizeResponse.java index 0dc26c5ae..d75ccd4f0 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationAuthorizeResponse.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationAuthorizeResponse.java @@ -22,6 +22,8 @@ public final class LedgerOperationAuthorizeResponse extends BaseResponse { private final LedgerOperation ledgerOperation; + private final List ledgerOperations; + private final LedgerAccountBalance ledgerAccountBalance; private final List grantBlocks; @@ -33,6 +35,8 @@ private LedgerOperationAuthorizeResponse(Builder builder) { this.ledgerOperation = builder.ledgerOperation; + this.ledgerOperations = builder.ledgerOperations; + this.ledgerAccountBalance = builder.ledgerAccountBalance; this.grantBlocks = builder.grantBlocks; @@ -56,6 +60,10 @@ public static LedgerOperationAuthorizeResponse fromJson(String json, Response ht builder.ledgerOperation(LedgerOperation.fromJson(__ledgerOperationObj)); } + builder.ledgerOperations( + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "ledger_operations"), LedgerOperation::fromJson)); + JsonObject __ledgerAccountBalanceObj = JsonUtil.getJsonObject(jsonObj, "ledger_account_balance"); if (__ledgerAccountBalanceObj != null) { @@ -86,6 +94,8 @@ public static class Builder { private LedgerOperation ledgerOperation; + private List ledgerOperations; + private LedgerAccountBalance ledgerAccountBalance; private List grantBlocks; @@ -101,6 +111,11 @@ public Builder ledgerOperation(LedgerOperation ledgerOperation) { return this; } + public Builder ledgerOperations(List ledgerOperations) { + this.ledgerOperations = ledgerOperations; + return this; + } + public Builder ledgerAccountBalance(LedgerAccountBalance ledgerAccountBalance) { this.ledgerAccountBalance = ledgerAccountBalance; return this; @@ -131,6 +146,11 @@ public LedgerOperation getLedgerOperation() { return ledgerOperation; } + /** Get the ledgerOperations from the response. */ + public List getLedgerOperations() { + return ledgerOperations; + } + /** Get the ledgerAccountBalance from the response. */ public LedgerAccountBalance getLedgerAccountBalance() { return ledgerAccountBalance; @@ -151,6 +171,8 @@ public String toString() { return "LedgerOperationAuthorizeResponse{" + "ledgerOperation=" + ledgerOperation + + ", ledgerOperations=" + + ledgerOperations + ", ledgerAccountBalance=" + ledgerAccountBalance + ", grantBlocks=" @@ -167,6 +189,7 @@ public boolean equals(Object o) { LedgerOperationAuthorizeResponse that = (LedgerOperationAuthorizeResponse) o; return java.util.Objects.equals(ledgerOperation, that.ledgerOperation) + && java.util.Objects.equals(ledgerOperations, that.ledgerOperations) && java.util.Objects.equals(ledgerAccountBalance, that.ledgerAccountBalance) && java.util.Objects.equals(grantBlocks, that.grantBlocks) && java.util.Objects.equals(ledgerEntries, that.ledgerEntries); @@ -176,6 +199,6 @@ public boolean equals(Object o) { public int hashCode() { return java.util.Objects.hash( - ledgerOperation, ledgerAccountBalance, grantBlocks, ledgerEntries); + ledgerOperation, ledgerOperations, ledgerAccountBalance, grantBlocks, ledgerEntries); } } diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureAuthorizationResponse.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureAuthorizationResponse.java index d5cfbd5d0..9ee5bee44 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureAuthorizationResponse.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureAuthorizationResponse.java @@ -22,6 +22,8 @@ public final class LedgerOperationCaptureAuthorizationResponse extends BaseResponse { private final LedgerOperation ledgerOperation; + private final List ledgerOperations; + private final LedgerAccountBalance ledgerAccountBalance; private final List grantBlocks; @@ -33,6 +35,8 @@ private LedgerOperationCaptureAuthorizationResponse(Builder builder) { this.ledgerOperation = builder.ledgerOperation; + this.ledgerOperations = builder.ledgerOperations; + this.ledgerAccountBalance = builder.ledgerAccountBalance; this.grantBlocks = builder.grantBlocks; @@ -59,6 +63,10 @@ public static LedgerOperationCaptureAuthorizationResponse fromJson( builder.ledgerOperation(LedgerOperation.fromJson(__ledgerOperationObj)); } + builder.ledgerOperations( + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "ledger_operations"), LedgerOperation::fromJson)); + JsonObject __ledgerAccountBalanceObj = JsonUtil.getJsonObject(jsonObj, "ledger_account_balance"); if (__ledgerAccountBalanceObj != null) { @@ -90,6 +98,8 @@ public static class Builder { private LedgerOperation ledgerOperation; + private List ledgerOperations; + private LedgerAccountBalance ledgerAccountBalance; private List grantBlocks; @@ -105,6 +115,11 @@ public Builder ledgerOperation(LedgerOperation ledgerOperation) { return this; } + public Builder ledgerOperations(List ledgerOperations) { + this.ledgerOperations = ledgerOperations; + return this; + } + public Builder ledgerAccountBalance(LedgerAccountBalance ledgerAccountBalance) { this.ledgerAccountBalance = ledgerAccountBalance; return this; @@ -135,6 +150,11 @@ public LedgerOperation getLedgerOperation() { return ledgerOperation; } + /** Get the ledgerOperations from the response. */ + public List getLedgerOperations() { + return ledgerOperations; + } + /** Get the ledgerAccountBalance from the response. */ public LedgerAccountBalance getLedgerAccountBalance() { return ledgerAccountBalance; @@ -155,6 +175,8 @@ public String toString() { return "LedgerOperationCaptureAuthorizationResponse{" + "ledgerOperation=" + ledgerOperation + + ", ledgerOperations=" + + ledgerOperations + ", ledgerAccountBalance=" + ledgerAccountBalance + ", grantBlocks=" @@ -172,6 +194,7 @@ public boolean equals(Object o) { LedgerOperationCaptureAuthorizationResponse that = (LedgerOperationCaptureAuthorizationResponse) o; return java.util.Objects.equals(ledgerOperation, that.ledgerOperation) + && java.util.Objects.equals(ledgerOperations, that.ledgerOperations) && java.util.Objects.equals(ledgerAccountBalance, that.ledgerAccountBalance) && java.util.Objects.equals(grantBlocks, that.grantBlocks) && java.util.Objects.equals(ledgerEntries, that.ledgerEntries); @@ -181,6 +204,6 @@ public boolean equals(Object o) { public int hashCode() { return java.util.Objects.hash( - ledgerOperation, ledgerAccountBalance, grantBlocks, ledgerEntries); + ledgerOperation, ledgerOperations, ledgerAccountBalance, grantBlocks, ledgerEntries); } } diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureResponse.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureResponse.java index bcee5b269..e4479c7c7 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureResponse.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationCaptureResponse.java @@ -22,6 +22,8 @@ public final class LedgerOperationCaptureResponse extends BaseResponse { private final LedgerOperation ledgerOperation; + private final List ledgerOperations; + private final LedgerAccountBalance ledgerAccountBalance; private final List grantBlocks; @@ -33,6 +35,8 @@ private LedgerOperationCaptureResponse(Builder builder) { this.ledgerOperation = builder.ledgerOperation; + this.ledgerOperations = builder.ledgerOperations; + this.ledgerAccountBalance = builder.ledgerAccountBalance; this.grantBlocks = builder.grantBlocks; @@ -56,6 +60,10 @@ public static LedgerOperationCaptureResponse fromJson(String json, Response http builder.ledgerOperation(LedgerOperation.fromJson(__ledgerOperationObj)); } + builder.ledgerOperations( + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "ledger_operations"), LedgerOperation::fromJson)); + JsonObject __ledgerAccountBalanceObj = JsonUtil.getJsonObject(jsonObj, "ledger_account_balance"); if (__ledgerAccountBalanceObj != null) { @@ -86,6 +94,8 @@ public static class Builder { private LedgerOperation ledgerOperation; + private List ledgerOperations; + private LedgerAccountBalance ledgerAccountBalance; private List grantBlocks; @@ -101,6 +111,11 @@ public Builder ledgerOperation(LedgerOperation ledgerOperation) { return this; } + public Builder ledgerOperations(List ledgerOperations) { + this.ledgerOperations = ledgerOperations; + return this; + } + public Builder ledgerAccountBalance(LedgerAccountBalance ledgerAccountBalance) { this.ledgerAccountBalance = ledgerAccountBalance; return this; @@ -131,6 +146,11 @@ public LedgerOperation getLedgerOperation() { return ledgerOperation; } + /** Get the ledgerOperations from the response. */ + public List getLedgerOperations() { + return ledgerOperations; + } + /** Get the ledgerAccountBalance from the response. */ public LedgerAccountBalance getLedgerAccountBalance() { return ledgerAccountBalance; @@ -151,6 +171,8 @@ public String toString() { return "LedgerOperationCaptureResponse{" + "ledgerOperation=" + ledgerOperation + + ", ledgerOperations=" + + ledgerOperations + ", ledgerAccountBalance=" + ledgerAccountBalance + ", grantBlocks=" @@ -167,6 +189,7 @@ public boolean equals(Object o) { LedgerOperationCaptureResponse that = (LedgerOperationCaptureResponse) o; return java.util.Objects.equals(ledgerOperation, that.ledgerOperation) + && java.util.Objects.equals(ledgerOperations, that.ledgerOperations) && java.util.Objects.equals(ledgerAccountBalance, that.ledgerAccountBalance) && java.util.Objects.equals(grantBlocks, that.grantBlocks) && java.util.Objects.equals(ledgerEntries, that.ledgerEntries); @@ -176,6 +199,6 @@ public boolean equals(Object o) { public int hashCode() { return java.util.Objects.hash( - ledgerOperation, ledgerAccountBalance, grantBlocks, ledgerEntries); + ledgerOperation, ledgerOperations, ledgerAccountBalance, grantBlocks, ledgerEntries); } } diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationReleaseAuthorizationResponse.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationReleaseAuthorizationResponse.java index 8055b553c..e5c089469 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationReleaseAuthorizationResponse.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/responses/LedgerOperationReleaseAuthorizationResponse.java @@ -22,6 +22,8 @@ public final class LedgerOperationReleaseAuthorizationResponse extends BaseResponse { private final LedgerOperation ledgerOperation; + private final List ledgerOperations; + private final LedgerAccountBalance ledgerAccountBalance; private final List grantBlocks; @@ -33,6 +35,8 @@ private LedgerOperationReleaseAuthorizationResponse(Builder builder) { this.ledgerOperation = builder.ledgerOperation; + this.ledgerOperations = builder.ledgerOperations; + this.ledgerAccountBalance = builder.ledgerAccountBalance; this.grantBlocks = builder.grantBlocks; @@ -59,6 +63,10 @@ public static LedgerOperationReleaseAuthorizationResponse fromJson( builder.ledgerOperation(LedgerOperation.fromJson(__ledgerOperationObj)); } + builder.ledgerOperations( + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "ledger_operations"), LedgerOperation::fromJson)); + JsonObject __ledgerAccountBalanceObj = JsonUtil.getJsonObject(jsonObj, "ledger_account_balance"); if (__ledgerAccountBalanceObj != null) { @@ -90,6 +98,8 @@ public static class Builder { private LedgerOperation ledgerOperation; + private List ledgerOperations; + private LedgerAccountBalance ledgerAccountBalance; private List grantBlocks; @@ -105,6 +115,11 @@ public Builder ledgerOperation(LedgerOperation ledgerOperation) { return this; } + public Builder ledgerOperations(List ledgerOperations) { + this.ledgerOperations = ledgerOperations; + return this; + } + public Builder ledgerAccountBalance(LedgerAccountBalance ledgerAccountBalance) { this.ledgerAccountBalance = ledgerAccountBalance; return this; @@ -135,6 +150,11 @@ public LedgerOperation getLedgerOperation() { return ledgerOperation; } + /** Get the ledgerOperations from the response. */ + public List getLedgerOperations() { + return ledgerOperations; + } + /** Get the ledgerAccountBalance from the response. */ public LedgerAccountBalance getLedgerAccountBalance() { return ledgerAccountBalance; @@ -155,6 +175,8 @@ public String toString() { return "LedgerOperationReleaseAuthorizationResponse{" + "ledgerOperation=" + ledgerOperation + + ", ledgerOperations=" + + ledgerOperations + ", ledgerAccountBalance=" + ledgerAccountBalance + ", grantBlocks=" @@ -172,6 +194,7 @@ public boolean equals(Object o) { LedgerOperationReleaseAuthorizationResponse that = (LedgerOperationReleaseAuthorizationResponse) o; return java.util.Objects.equals(ledgerOperation, that.ledgerOperation) + && java.util.Objects.equals(ledgerOperations, that.ledgerOperations) && java.util.Objects.equals(ledgerAccountBalance, that.ledgerAccountBalance) && java.util.Objects.equals(grantBlocks, that.grantBlocks) && java.util.Objects.equals(ledgerEntries, that.ledgerEntries); @@ -181,6 +204,6 @@ public boolean equals(Object o) { public int hashCode() { return java.util.Objects.hash( - ledgerOperation, ledgerAccountBalance, grantBlocks, ledgerEntries); + ledgerOperation, ledgerOperations, ledgerAccountBalance, grantBlocks, ledgerEntries); } } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java index e9e378cef..45f21a768 100644 --- a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/OmnichannelSubscription.java @@ -375,6 +375,8 @@ public enum ExpirationReason { OTHER("other"), + SUBSCRIPTION_NOT_FOUND_IN_SOURCE("subscription_not_found_in_source"), + /** An enum member indicating that ExpirationReason was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java index 8ed6ddc0e..659f47793 100644 --- a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItem/OmnichannelSubscriptionItem.java @@ -181,6 +181,8 @@ public enum ExpirationReason { OTHER("other"), + SUBSCRIPTION_NOT_FOUND_IN_SOURCE("subscription_not_found_in_source"), + /** An enum member indicating that ExpirationReason was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; 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 ad6e8ffe3..e699099b9 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -32,6 +32,7 @@ public class PaymentIntent { private String customerId; private String gateway; private String businessEntityId; + private String brandId; private ActivePaymentAttempt activePaymentAttempt; private List paymentAttempts; private PaymentIntentMetadata paymentIntentMetadata; @@ -108,6 +109,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public ActivePaymentAttempt getActivePaymentAttempt() { return activePaymentAttempt; } @@ -259,6 +264,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -335,6 +366,8 @@ public static PaymentIntent fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + JsonObject __activePaymentAttemptObj = JsonUtil.getJsonObject(jsonObj, "active_payment_attempt"); if (__activePaymentAttemptObj != null) { @@ -393,6 +426,8 @@ public String toString() { + gateway + ", businessEntityId=" + businessEntityId + + ", brandId=" + + brandId + ", activePaymentAttempt=" + activePaymentAttempt + ", paymentAttempts=" @@ -426,6 +461,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(customerId, that.customerId) && java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(activePaymentAttempt, that.activePaymentAttempt) && java.util.Objects.equals(paymentAttempts, that.paymentAttempts) && java.util.Objects.equals(paymentIntentMetadata, that.paymentIntentMetadata); @@ -453,6 +489,7 @@ public int hashCode() { customerId, gateway, businessEntityId, + brandId, activePaymentAttempt, paymentAttempts, paymentIntentMetadata); @@ -664,6 +701,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -1210,6 +1273,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 caa4c1e26..01ed53611 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 @@ -16,6 +16,8 @@ public final class PaymentIntentCreateParams { private final String businessEntityId; + private final String brandId; + private final String customerId; private final Long amount; @@ -40,6 +42,8 @@ private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.customerId = builder.customerId; this.amount = builder.amount; @@ -65,6 +69,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public String getCustomerId() { return customerId; } @@ -114,6 +122,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.customerId != null) { formData.put("customer_id", this.customerId); @@ -177,6 +190,8 @@ public static final class PaymentIntentCreateBuilder { private String businessEntityId; + private String brandId; + private String customerId; private Long amount; @@ -204,6 +219,11 @@ public PaymentIntentCreateBuilder businessEntityId(String value) { return this; } + public PaymentIntentCreateBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentIntentCreateBuilder customerId(String value) { this.customerId = value; return this; @@ -364,6 +384,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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 437d5639d..d5eaaf4f0 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 @@ -284,6 +284,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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/paymentSchedule/PaymentSchedule.java b/src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java index 88c4cd815..13003970e 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java +++ b/src/main/java/com/chargebee/v4/models/paymentSchedule/PaymentSchedule.java @@ -24,6 +24,7 @@ public class PaymentSchedule { private Timestamp updatedAt; private String currencyCode; private List scheduleEntries; + private List referenceTransactions; public String getId() { return id; @@ -65,6 +66,10 @@ public List getScheduleEntries() { return scheduleEntries; } + public List getReferenceTransactions() { + return referenceTransactions; + } + public enum EntityType { INVOICE("invoice"), @@ -124,6 +129,11 @@ public static PaymentSchedule fromJson(JsonObject jsonObj) { JsonUtil.mapArray( JsonUtil.getJsonArray(jsonObj, "schedule_entries"), ScheduleEntries::fromJson); + obj.referenceTransactions = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "reference_transactions"), + ReferenceTransactions::fromJson); + return obj; } @@ -150,6 +160,8 @@ public String toString() { + currencyCode + ", scheduleEntries=" + scheduleEntries + + ", referenceTransactions=" + + referenceTransactions + "}"; } @@ -168,7 +180,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(resourceVersion, that.resourceVersion) && java.util.Objects.equals(updatedAt, that.updatedAt) && java.util.Objects.equals(currencyCode, that.currencyCode) - && java.util.Objects.equals(scheduleEntries, that.scheduleEntries); + && java.util.Objects.equals(scheduleEntries, that.scheduleEntries) + && java.util.Objects.equals(referenceTransactions, that.referenceTransactions); } @Override @@ -184,7 +197,8 @@ public int hashCode() { resourceVersion, updatedAt, currencyCode, - scheduleEntries); + scheduleEntries, + referenceTransactions); } public static class ScheduleEntries { @@ -192,6 +206,7 @@ public static class ScheduleEntries { private String id; private Timestamp date; private Long amount; + private Long scheduledAmount; private Status status; public String getId() { @@ -206,6 +221,10 @@ public Long getAmount() { return amount; } + public Long getScheduledAmount() { + return scheduledAmount; + } + public Status getStatus() { return status; } @@ -257,6 +276,8 @@ public static ScheduleEntries fromJson(JsonObject jsonObj) { obj.amount = JsonUtil.getLong(jsonObj, "amount"); + obj.scheduledAmount = JsonUtil.getLong(jsonObj, "scheduled_amount"); + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); return obj; @@ -271,6 +292,8 @@ public String toString() { + date + ", amount=" + amount + + ", scheduledAmount=" + + scheduledAmount + ", status=" + status + "}"; @@ -285,13 +308,151 @@ public boolean equals(Object o) { return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(date, that.date) && java.util.Objects.equals(amount, that.amount) + && java.util.Objects.equals(scheduledAmount, that.scheduledAmount) && java.util.Objects.equals(status, that.status); } @Override public int hashCode() { - return java.util.Objects.hash(id, date, amount, status); + return java.util.Objects.hash(id, date, amount, scheduledAmount, status); + } + } + + public static class ReferenceTransactions { + + private String scheduleEntryId; + private Long appliedAmount; + private String txnId; + private TxnStatus txnStatus; + private Timestamp txnDate; + private Long txnAmount; + + public String getScheduleEntryId() { + return scheduleEntryId; + } + + public Long getAppliedAmount() { + return appliedAmount; + } + + public String getTxnId() { + return txnId; + } + + public TxnStatus getTxnStatus() { + return txnStatus; + } + + public Timestamp getTxnDate() { + return txnDate; + } + + public Long getTxnAmount() { + return txnAmount; + } + + public enum TxnStatus { + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + VOIDED("voided"), + + FAILURE("failure"), + + TIMEOUT("timeout"), + + NEEDS_ATTENTION("needs_attention"), + + LATE_FAILURE("late_failure"), + + /** An enum member indicating that TxnStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TxnStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TxnStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (TxnStatus enumValue : TxnStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static ReferenceTransactions fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ReferenceTransactions fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ReferenceTransactions fromJson(JsonObject jsonObj) { + ReferenceTransactions obj = new ReferenceTransactions(); + + obj.scheduleEntryId = JsonUtil.getString(jsonObj, "schedule_entry_id"); + + obj.appliedAmount = JsonUtil.getLong(jsonObj, "applied_amount"); + + obj.txnId = JsonUtil.getString(jsonObj, "txn_id"); + + obj.txnStatus = TxnStatus.fromString(JsonUtil.getString(jsonObj, "txn_status")); + + obj.txnDate = JsonUtil.getTimestamp(jsonObj, "txn_date"); + + obj.txnAmount = JsonUtil.getLong(jsonObj, "txn_amount"); + + return obj; + } + + @Override + public String toString() { + return "ReferenceTransactions{" + + "scheduleEntryId=" + + scheduleEntryId + + ", appliedAmount=" + + appliedAmount + + ", txnId=" + + txnId + + ", txnStatus=" + + txnStatus + + ", txnDate=" + + txnDate + + ", txnAmount=" + + txnAmount + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ReferenceTransactions that = (ReferenceTransactions) o; + return java.util.Objects.equals(scheduleEntryId, that.scheduleEntryId) + && java.util.Objects.equals(appliedAmount, that.appliedAmount) + && java.util.Objects.equals(txnId, that.txnId) + && java.util.Objects.equals(txnStatus, that.txnStatus) + && java.util.Objects.equals(txnDate, that.txnDate) + && java.util.Objects.equals(txnAmount, that.txnAmount); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + scheduleEntryId, appliedAmount, txnId, txnStatus, txnDate, txnAmount); } } } diff --git a/src/main/java/com/chargebee/v4/models/paymentSchedule/params/PaymentScheduleListParams.java b/src/main/java/com/chargebee/v4/models/paymentSchedule/params/PaymentScheduleListParams.java new file mode 100644 index 000000000..aea48e945 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSchedule/params/PaymentScheduleListParams.java @@ -0,0 +1,94 @@ +/* + * 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.paymentSchedule.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentScheduleListParams { + + private final Map queryParams; + + private PaymentScheduleListParams(PaymentScheduleListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public PaymentScheduleListBuilder toBuilder() { + PaymentScheduleListBuilder builder = new PaymentScheduleListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for PaymentScheduleListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentScheduleListBuilder builder() { + return new PaymentScheduleListBuilder(); + } + + public static final class PaymentScheduleListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private PaymentScheduleListBuilder() {} + + public PaymentScheduleListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public PaymentScheduleListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public InvoiceIdFilter invoiceId() { + return new InvoiceIdFilter("invoice_id", this, queryParams); + } + + public IdFilter id() { + return new IdFilter("id", this, queryParams); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this, queryParams); + } + + public PaymentScheduleListParams build() { + return new PaymentScheduleListParams(this); + } + + public static final class InvoiceIdFilter extends StringFilter { + InvoiceIdFilter( + String fieldName, PaymentScheduleListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class IdFilter extends StringFilter { + IdFilter(String fieldName, PaymentScheduleListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class UpdatedAtFilter extends TimestampFilter { + UpdatedAtFilter( + String fieldName, PaymentScheduleListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSchedule/responses/PaymentScheduleListResponse.java b/src/main/java/com/chargebee/v4/models/paymentSchedule/responses/PaymentScheduleListResponse.java new file mode 100644 index 000000000..5a6a1fc74 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSchedule/responses/PaymentScheduleListResponse.java @@ -0,0 +1,212 @@ +package com.chargebee.v4.models.paymentSchedule.responses; + +import java.util.List; + +import com.chargebee.v4.models.paymentSchedule.PaymentSchedule; + +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.PaymentScheduleService; +import com.chargebee.v4.models.paymentSchedule.params.PaymentScheduleListParams; + +/** Immutable response object for PaymentScheduleList operation. Contains paginated list data. */ +public final class PaymentScheduleListResponse { + + private final List list; + + private final String nextOffset; + + private final PaymentScheduleService service; + private final PaymentScheduleListParams originalParams; + private final Response httpResponse; + + private PaymentScheduleListResponse( + List list, + String nextOffset, + PaymentScheduleService service, + PaymentScheduleListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into PaymentScheduleListResponse object (no service context). Use this when + * you only need to read a single page (no nextPage()). + */ + public static PaymentScheduleListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), PaymentScheduleListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new PaymentScheduleListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentScheduleListResponse from JSON", e); + } + } + + /** + * Parse JSON response into PaymentScheduleListResponse object with service context for pagination + * (enables nextPage()). + */ + public static PaymentScheduleListResponse fromJson( + String json, + PaymentScheduleService service, + PaymentScheduleListParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), PaymentScheduleListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new PaymentScheduleListResponse( + list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentScheduleListResponse 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 PaymentScheduleListResponse 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)."); + } + + PaymentScheduleListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : PaymentScheduleListParams.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 "PaymentScheduleListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentScheduleListResponse that = (PaymentScheduleListResponse) 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 PaymentScheduleListItem { + + private PaymentSchedule paymentSchedule; + + public PaymentSchedule getPaymentSchedule() { + return paymentSchedule; + } + + public static PaymentScheduleListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentScheduleListItem fromJson(JsonObject jsonObj) { + PaymentScheduleListItem item = new PaymentScheduleListItem(); + + JsonObject __paymentScheduleObj = JsonUtil.getJsonObject(jsonObj, "payment_schedule"); + if (__paymentScheduleObj != null) { + item.paymentSchedule = PaymentSchedule.fromJson(__paymentScheduleObj); + } + + return item; + } + + @Override + public String toString() { + return "PaymentScheduleListItem{" + "paymentSchedule=" + paymentSchedule + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentScheduleListItem that = (PaymentScheduleListItem) o; + return java.util.Objects.equals(paymentSchedule, that.paymentSchedule); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(paymentSchedule); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java b/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java index 5ccca48e8..dda54a350 100644 --- a/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleEstimate/PaymentScheduleEstimate.java @@ -153,6 +153,7 @@ public static class ScheduleEntries { private String id; private Timestamp date; private Long amount; + private Long scheduledAmount; private Status status; public String getId() { @@ -167,6 +168,10 @@ public Long getAmount() { return amount; } + public Long getScheduledAmount() { + return scheduledAmount; + } + public Status getStatus() { return status; } @@ -218,6 +223,8 @@ public static ScheduleEntries fromJson(JsonObject jsonObj) { obj.amount = JsonUtil.getLong(jsonObj, "amount"); + obj.scheduledAmount = JsonUtil.getLong(jsonObj, "scheduled_amount"); + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); return obj; @@ -232,6 +239,8 @@ public String toString() { + date + ", amount=" + amount + + ", scheduledAmount=" + + scheduledAmount + ", status=" + status + "}"; @@ -246,13 +255,14 @@ public boolean equals(Object o) { return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(date, that.date) && java.util.Objects.equals(amount, that.amount) + && java.util.Objects.equals(scheduledAmount, that.scheduledAmount) && java.util.Objects.equals(status, that.status); } @Override public int hashCode() { - return java.util.Objects.hash(id, date, amount, status); + return java.util.Objects.hash(id, date, amount, scheduledAmount, status); } } } diff --git a/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeListParams.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeListParams.java new file mode 100644 index 000000000..ef034b46f --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/params/PaymentScheduleSchemeListParams.java @@ -0,0 +1,85 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.paymentScheduleScheme.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class PaymentScheduleSchemeListParams { + + private final Map queryParams; + + private PaymentScheduleSchemeListParams(PaymentScheduleSchemeListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public PaymentScheduleSchemeListBuilder toBuilder() { + PaymentScheduleSchemeListBuilder builder = new PaymentScheduleSchemeListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for PaymentScheduleSchemeListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static PaymentScheduleSchemeListBuilder builder() { + return new PaymentScheduleSchemeListBuilder(); + } + + public static final class PaymentScheduleSchemeListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private PaymentScheduleSchemeListBuilder() {} + + public PaymentScheduleSchemeListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public PaymentScheduleSchemeListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public IdFilter id() { + return new IdFilter("id", this, queryParams); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this, queryParams); + } + + public PaymentScheduleSchemeListParams build() { + return new PaymentScheduleSchemeListParams(this); + } + + public static final class IdFilter extends StringFilter { + IdFilter( + String fieldName, PaymentScheduleSchemeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class UpdatedAtFilter + extends TimestampFilter { + UpdatedAtFilter( + String fieldName, PaymentScheduleSchemeListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeListResponse.java b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeListResponse.java new file mode 100644 index 000000000..e9bc762ef --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentScheduleScheme/responses/PaymentScheduleSchemeListResponse.java @@ -0,0 +1,225 @@ +package com.chargebee.v4.models.paymentScheduleScheme.responses; + +import java.util.List; + +import com.chargebee.v4.models.paymentScheduleScheme.PaymentScheduleScheme; + +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.PaymentScheduleSchemeService; +import com.chargebee.v4.models.paymentScheduleScheme.params.PaymentScheduleSchemeListParams; + +/** + * Immutable response object for PaymentScheduleSchemeList operation. Contains paginated list data. + */ +public final class PaymentScheduleSchemeListResponse { + + private final List list; + + private final String nextOffset; + + private final PaymentScheduleSchemeService service; + private final PaymentScheduleSchemeListParams originalParams; + private final Response httpResponse; + + private PaymentScheduleSchemeListResponse( + List list, + String nextOffset, + PaymentScheduleSchemeService service, + PaymentScheduleSchemeListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into PaymentScheduleSchemeListResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static PaymentScheduleSchemeListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), PaymentScheduleSchemeListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new PaymentScheduleSchemeListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentScheduleSchemeListResponse from JSON", e); + } + } + + /** + * Parse JSON response into PaymentScheduleSchemeListResponse object with service context for + * pagination (enables nextPage()). + */ + public static PaymentScheduleSchemeListResponse fromJson( + String json, + PaymentScheduleSchemeService service, + PaymentScheduleSchemeListParams originalParams, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), PaymentScheduleSchemeListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new PaymentScheduleSchemeListResponse( + list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse PaymentScheduleSchemeListResponse 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 PaymentScheduleSchemeListResponse 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)."); + } + + PaymentScheduleSchemeListParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : PaymentScheduleSchemeListParams.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 "PaymentScheduleSchemeListResponse{" + + "list=" + + list + + ", nextOffset=" + + nextOffset + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentScheduleSchemeListResponse that = (PaymentScheduleSchemeListResponse) 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 PaymentScheduleSchemeListItem { + + private PaymentScheduleScheme paymentScheduleScheme; + + public PaymentScheduleScheme getPaymentScheduleScheme() { + return paymentScheduleScheme; + } + + public static PaymentScheduleSchemeListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentScheduleSchemeListItem fromJson(JsonObject jsonObj) { + PaymentScheduleSchemeListItem item = new PaymentScheduleSchemeListItem(); + + JsonObject __paymentScheduleSchemeObj = + JsonUtil.getJsonObject(jsonObj, "payment_schedule_scheme"); + if (__paymentScheduleSchemeObj != null) { + item.paymentScheduleScheme = PaymentScheduleScheme.fromJson(__paymentScheduleSchemeObj); + } + + return item; + } + + @Override + public String toString() { + return "PaymentScheduleSchemeListItem{" + + "paymentScheduleScheme=" + + paymentScheduleScheme + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentScheduleSchemeListItem that = (PaymentScheduleSchemeListItem) o; + return java.util.Objects.equals(paymentScheduleScheme, that.paymentScheduleScheme); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(paymentScheduleScheme); + } + } +} 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 b9dfe8b3a..03fc4010f 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -29,6 +29,7 @@ public class PaymentSource { private java.util.Map vaultToken; private Boolean deleted; private String businessEntityId; + private String brandId; private Card card; private BankAccount bankAccount; private Boleto boleto; @@ -39,6 +40,7 @@ public class PaymentSource { private Venmo venmo; private KlarnaPayNow klarnaPayNow; private List mandates; + private NetworkTransactionReference networkTransactionReference; public String getId() { return id; @@ -100,6 +102,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Card getCard() { return card; } @@ -140,6 +146,10 @@ public List getMandates() { return mandates; } + public NetworkTransactionReference getNetworkTransactionReference() { + return networkTransactionReference; + } + public enum Type { CARD("card"), @@ -249,6 +259,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -427,6 +463,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -497,6 +535,8 @@ public static PaymentSource fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + JsonObject __cardObj = JsonUtil.getJsonObject(jsonObj, "card"); if (__cardObj != null) { obj.card = Card.fromJson(__cardObj); @@ -545,6 +585,13 @@ public static PaymentSource fromJson(JsonObject jsonObj) { obj.mandates = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "mandates"), Mandates::fromJson); + JsonObject __networkTransactionReferenceObj = + JsonUtil.getJsonObject(jsonObj, "network_transaction_reference"); + if (__networkTransactionReferenceObj != null) { + obj.networkTransactionReference = + NetworkTransactionReference.fromJson(__networkTransactionReferenceObj); + } + return obj; } @@ -581,6 +628,8 @@ public String toString() { + deleted + ", businessEntityId=" + businessEntityId + + ", brandId=" + + brandId + ", card=" + card + ", bankAccount=" @@ -601,6 +650,8 @@ public String toString() { + klarnaPayNow + ", mandates=" + mandates + + ", networkTransactionReference=" + + networkTransactionReference + "}"; } @@ -625,6 +676,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(vaultToken, that.vaultToken) && java.util.Objects.equals(deleted, that.deleted) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(card, that.card) && java.util.Objects.equals(bankAccount, that.bankAccount) && java.util.Objects.equals(boleto, that.boleto) @@ -634,7 +686,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(paypal, that.paypal) && java.util.Objects.equals(venmo, that.venmo) && java.util.Objects.equals(klarnaPayNow, that.klarnaPayNow) - && java.util.Objects.equals(mandates, that.mandates); + && java.util.Objects.equals(mandates, that.mandates) + && java.util.Objects.equals(networkTransactionReference, that.networkTransactionReference); } @Override @@ -656,6 +709,7 @@ public int hashCode() { vaultToken, deleted, businessEntityId, + brandId, card, bankAccount, boleto, @@ -665,7 +719,8 @@ public int hashCode() { paypal, venmo, klarnaPayNow, - mandates); + mandates, + networkTransactionReference); } public static class Card { @@ -1892,4 +1947,54 @@ public int hashCode() { return java.util.Objects.hash(id, subscriptionId, createdAt); } } + + public static class NetworkTransactionReference { + + private String originalNetworkTransactionId; + + public String getOriginalNetworkTransactionId() { + return originalNetworkTransactionId; + } + + public static NetworkTransactionReference fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static NetworkTransactionReference fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static NetworkTransactionReference fromJson(JsonObject jsonObj) { + NetworkTransactionReference obj = new NetworkTransactionReference(); + + obj.originalNetworkTransactionId = + JsonUtil.getString(jsonObj, "original_network_transaction_id"); + + return obj; + } + + @Override + public String toString() { + return "NetworkTransactionReference{" + + "originalNetworkTransactionId=" + + originalNetworkTransactionId + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + NetworkTransactionReference that = (NetworkTransactionReference) o; + return java.util.Objects.equals( + originalNetworkTransactionId, that.originalNetworkTransactionId); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(originalNetworkTransactionId); + } + } } diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java index 8e010b628..e6024d860 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/CreateVoucherPaymentSourceParams.java @@ -16,12 +16,16 @@ public final class CreateVoucherPaymentSourceParams { private final String customerId; + private final String brandId; + private final VoucherPaymentSourceParams voucherPaymentSource; private CreateVoucherPaymentSourceParams(CreateVoucherPaymentSourceBuilder builder) { this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.voucherPaymentSource = builder.voucherPaymentSource; } @@ -29,6 +33,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public VoucherPaymentSourceParams getVoucherPaymentSource() { return voucherPaymentSource; } @@ -42,6 +50,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.voucherPaymentSource != null) { // Single object @@ -65,6 +78,8 @@ public static final class CreateVoucherPaymentSourceBuilder { private String customerId; + private String brandId; + private VoucherPaymentSourceParams voucherPaymentSource; private CreateVoucherPaymentSourceBuilder() {} @@ -74,6 +89,11 @@ public CreateVoucherPaymentSourceBuilder customerId(String value) { return this; } + public CreateVoucherPaymentSourceBuilder brandId(String value) { + this.brandId = value; + return this; + } + public CreateVoucherPaymentSourceBuilder voucherPaymentSource( VoucherPaymentSourceParams value) { this.voucherPaymentSource = value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java index 0cd51d568..635c4ad94 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateBankAccountParams.java @@ -16,6 +16,8 @@ public final class PaymentSourceCreateBankAccountParams { private final String customerId; + private final String brandId; + private final String issuingCountry; private final Boolean replacePrimaryPaymentSource; @@ -26,6 +28,8 @@ private PaymentSourceCreateBankAccountParams(PaymentSourceCreateBankAccountBuild this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.issuingCountry = builder.issuingCountry; this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; @@ -37,6 +41,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public String getIssuingCountry() { return issuingCountry; } @@ -58,6 +66,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.issuingCountry != null) { formData.put("issuing_country", this.issuingCountry); @@ -91,6 +104,8 @@ public static final class PaymentSourceCreateBankAccountBuilder { private String customerId; + private String brandId; + private String issuingCountry; private Boolean replacePrimaryPaymentSource; @@ -104,6 +119,11 @@ public PaymentSourceCreateBankAccountBuilder customerId(String value) { return this; } + public PaymentSourceCreateBankAccountBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateBankAccountBuilder issuingCountry(String value) { this.issuingCountry = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java index 12c2958f4..c706e6d09 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateCardParams.java @@ -16,6 +16,8 @@ public final class PaymentSourceCreateCardParams { private final String customerId; + private final String brandId; + private final Boolean replacePrimaryPaymentSource; private final CardParams card; @@ -24,6 +26,8 @@ private PaymentSourceCreateCardParams(PaymentSourceCreateCardBuilder builder) { this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; this.card = builder.card; @@ -33,6 +37,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public Boolean getReplacePrimaryPaymentSource() { return replacePrimaryPaymentSource; } @@ -50,6 +58,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.replacePrimaryPaymentSource != null) { formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); @@ -78,6 +91,8 @@ public static final class PaymentSourceCreateCardBuilder { private String customerId; + private String brandId; + private Boolean replacePrimaryPaymentSource; private CardParams card; @@ -89,6 +104,11 @@ public PaymentSourceCreateCardBuilder customerId(String value) { return this; } + public PaymentSourceCreateCardBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateCardBuilder replacePrimaryPaymentSource(Boolean value) { this.replacePrimaryPaymentSource = value; return this; @@ -458,6 +478,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String 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 e4eed7aaa..0f869c052 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 @@ -16,6 +16,8 @@ public final class PaymentSourceCreateUsingPaymentIntentParams { private final String customerId; + private final String brandId; + private final Boolean replacePrimaryPaymentSource; private final PaymentIntentParams paymentIntent; @@ -25,6 +27,8 @@ private PaymentSourceCreateUsingPaymentIntentParams( this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; this.paymentIntent = builder.paymentIntent; @@ -34,6 +38,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public Boolean getReplacePrimaryPaymentSource() { return replacePrimaryPaymentSource; } @@ -51,6 +59,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.replacePrimaryPaymentSource != null) { formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); @@ -79,6 +92,8 @@ public static final class PaymentSourceCreateUsingPaymentIntentBuilder { private String customerId; + private String brandId; + private Boolean replacePrimaryPaymentSource; private PaymentIntentParams paymentIntent; @@ -90,6 +105,11 @@ public PaymentSourceCreateUsingPaymentIntentBuilder customerId(String value) { return this; } + public PaymentSourceCreateUsingPaymentIntentBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateUsingPaymentIntentBuilder replacePrimaryPaymentSource(Boolean value) { this.replacePrimaryPaymentSource = value; return this; @@ -398,6 +418,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 bec7549ff..ab5b323b0 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 @@ -16,6 +16,8 @@ public final class PaymentSourceCreateUsingPermanentTokenParams { private final String customerId; + private final String brandId; + private final Type type; private final String gatewayAccountId; @@ -47,6 +49,8 @@ private PaymentSourceCreateUsingPermanentTokenParams( this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.type = builder.type; this.gatewayAccountId = builder.gatewayAccountId; @@ -78,6 +82,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public Type getType() { return type; } @@ -139,6 +147,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.type != null) { formData.put("type", this.type); @@ -227,6 +240,8 @@ public static final class PaymentSourceCreateUsingPermanentTokenBuilder { private String customerId; + private String brandId; + private Type type; private String gatewayAccountId; @@ -260,6 +275,11 @@ public PaymentSourceCreateUsingPermanentTokenBuilder customerId(String value) { return this; } + public PaymentSourceCreateUsingPermanentTokenBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateUsingPermanentTokenBuilder type(Type value) { this.type = value; return this; @@ -442,6 +462,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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/PaymentSourceCreateUsingTempTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java index 03a9c3a1d..fd6f7ad30 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 @@ -24,6 +24,8 @@ public final class PaymentSourceCreateUsingTempTokenParams { private final String issuingCountry; + private final String brandId; + private final Boolean replacePrimaryPaymentSource; private final java.util.Map additionalInformation; @@ -41,6 +43,8 @@ private PaymentSourceCreateUsingTempTokenParams( this.issuingCountry = builder.issuingCountry; + this.brandId = builder.brandId; + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; this.additionalInformation = builder.additionalInformation; @@ -66,6 +70,10 @@ public String getIssuingCountry() { return issuingCountry; } + public String getBrandId() { + return brandId; + } + public Boolean getReplacePrimaryPaymentSource() { return replacePrimaryPaymentSource; } @@ -103,6 +111,11 @@ public Map toFormData() { formData.put("issuing_country", this.issuingCountry); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.replacePrimaryPaymentSource != null) { formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); @@ -134,6 +147,8 @@ public static final class PaymentSourceCreateUsingTempTokenBuilder { private String issuingCountry; + private String brandId; + private Boolean replacePrimaryPaymentSource; private java.util.Map additionalInformation; @@ -165,6 +180,11 @@ public PaymentSourceCreateUsingTempTokenBuilder issuingCountry(String value) { return this; } + public PaymentSourceCreateUsingTempTokenBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateUsingTempTokenBuilder replacePrimaryPaymentSource(Boolean value) { this.replacePrimaryPaymentSource = value; return this; @@ -290,6 +310,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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/PaymentSourceCreateUsingTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java index de6d578a5..c1b109bd0 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTokenParams.java @@ -15,6 +15,8 @@ public final class PaymentSourceCreateUsingTokenParams { private final String customerId; + private final String brandId; + private final Boolean replacePrimaryPaymentSource; private final String tokenId; @@ -23,6 +25,8 @@ private PaymentSourceCreateUsingTokenParams(PaymentSourceCreateUsingTokenBuilder this.customerId = builder.customerId; + this.brandId = builder.brandId; + this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; this.tokenId = builder.tokenId; @@ -32,6 +36,10 @@ public String getCustomerId() { return customerId; } + public String getBrandId() { + return brandId; + } + public Boolean getReplacePrimaryPaymentSource() { return replacePrimaryPaymentSource; } @@ -49,6 +57,11 @@ public Map toFormData() { formData.put("customer_id", this.customerId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.replacePrimaryPaymentSource != null) { formData.put("replace_primary_payment_source", this.replacePrimaryPaymentSource); @@ -72,6 +85,8 @@ public static final class PaymentSourceCreateUsingTokenBuilder { private String customerId; + private String brandId; + private Boolean replacePrimaryPaymentSource; private String tokenId; @@ -83,6 +98,11 @@ public PaymentSourceCreateUsingTokenBuilder customerId(String value) { return this; } + public PaymentSourceCreateUsingTokenBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PaymentSourceCreateUsingTokenBuilder replacePrimaryPaymentSource(Boolean value) { this.replacePrimaryPaymentSource = value; return this; 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 a75f4ab20..0ffd9ef6a 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 @@ -381,6 +381,32 @@ public enum TypeIs { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -513,6 +539,32 @@ public enum TypeIsNot { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -645,6 +697,32 @@ public enum TypeIn { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -777,6 +855,32 @@ public enum TypeNotIn { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that TypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1101,6 +1205,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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/PaymentSourceUpdateCardParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java index f453ea539..f935aba57 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceUpdateCardParams.java @@ -20,6 +20,8 @@ public final class PaymentSourceUpdateCardParams { private final CardParams card; + private final NetworkTransactionReferenceParams networkTransactionReference; + private PaymentSourceUpdateCardParams(PaymentSourceUpdateCardBuilder builder) { this.gatewayMetaData = builder.gatewayMetaData; @@ -27,6 +29,8 @@ private PaymentSourceUpdateCardParams(PaymentSourceUpdateCardBuilder builder) { this.referenceTransaction = builder.referenceTransaction; this.card = builder.card; + + this.networkTransactionReference = builder.networkTransactionReference; } public java.util.Map getGatewayMetaData() { @@ -41,6 +45,10 @@ public CardParams getCard() { return card; } + public NetworkTransactionReferenceParams getNetworkTransactionReference() { + return networkTransactionReference; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -65,6 +73,16 @@ public Map toFormData() { } } + if (this.networkTransactionReference != null) { + + // Single object + Map nestedData = this.networkTransactionReference.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "network_transaction_reference[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + return formData; } @@ -82,6 +100,8 @@ public static final class PaymentSourceUpdateCardBuilder { private CardParams card; + private NetworkTransactionReferenceParams networkTransactionReference; + private PaymentSourceUpdateCardBuilder() {} public PaymentSourceUpdateCardBuilder gatewayMetaData(java.util.Map value) { @@ -99,6 +119,12 @@ public PaymentSourceUpdateCardBuilder card(CardParams value) { return this; } + public PaymentSourceUpdateCardBuilder networkTransactionReference( + NetworkTransactionReferenceParams value) { + this.networkTransactionReference = value; + return this; + } + public PaymentSourceUpdateCardParams build() { return new PaymentSourceUpdateCardParams(this); } @@ -371,4 +397,52 @@ public CardParams build() { } } } + + public static final class NetworkTransactionReferenceParams { + + private final String originalNetworkTransactionId; + + private NetworkTransactionReferenceParams(NetworkTransactionReferenceBuilder builder) { + + this.originalNetworkTransactionId = builder.originalNetworkTransactionId; + } + + public String getOriginalNetworkTransactionId() { + return originalNetworkTransactionId; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.originalNetworkTransactionId != null) { + + formData.put("original_network_transaction_id", this.originalNetworkTransactionId); + } + + return formData; + } + + /** Create a new builder for NetworkTransactionReferenceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static NetworkTransactionReferenceBuilder builder() { + return new NetworkTransactionReferenceBuilder(); + } + + public static final class NetworkTransactionReferenceBuilder { + + private String originalNetworkTransactionId; + + private NetworkTransactionReferenceBuilder() {} + + public NetworkTransactionReferenceBuilder originalNetworkTransactionId(String value) { + this.originalNetworkTransactionId = value; + return this; + } + + public NetworkTransactionReferenceParams build() { + return new NetworkTransactionReferenceParams(this); + } + } + } } 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 adcb9b8dc..1b5274681 100644 --- a/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java @@ -294,6 +294,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java index 8a01dc65f..48d5a6346 100644 --- a/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/pricingPageSession/params/PricingPageSessionCreateForNewSubscriptionParams.java @@ -20,6 +20,8 @@ public final class PricingPageSessionCreateForNewSubscriptionParams { private final String businessEntityId; + private final String brandId; + private final Boolean autoSelectLocalCurrency; private final java.util.Map custom; @@ -45,6 +47,8 @@ private PricingPageSessionCreateForNewSubscriptionParams( this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.autoSelectLocalCurrency = builder.autoSelectLocalCurrency; this.custom = builder.custom; @@ -72,6 +76,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Boolean getAutoSelectLocalCurrency() { return autoSelectLocalCurrency; } @@ -122,6 +130,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.autoSelectLocalCurrency != null) { formData.put("auto_select_local_currency", this.autoSelectLocalCurrency); @@ -222,6 +235,8 @@ public static final class PricingPageSessionCreateForNewSubscriptionBuilder { private String businessEntityId; + private String brandId; + private Boolean autoSelectLocalCurrency; private java.util.Map custom; @@ -252,6 +267,11 @@ public PricingPageSessionCreateForNewSubscriptionBuilder businessEntityId(String return this; } + public PricingPageSessionCreateForNewSubscriptionBuilder brandId(String value) { + this.brandId = value; + return this; + } + public PricingPageSessionCreateForNewSubscriptionBuilder autoSelectLocalCurrency( Boolean value) { this.autoSelectLocalCurrency = value; diff --git a/src/main/java/com/chargebee/v4/models/promotionalGrant/params/PromotionalGrantsParams.java b/src/main/java/com/chargebee/v4/models/promotionalGrant/params/PromotionalGrantsParams.java index a15b5c22b..f0727f43e 100644 --- a/src/main/java/com/chargebee/v4/models/promotionalGrant/params/PromotionalGrantsParams.java +++ b/src/main/java/com/chargebee/v4/models/promotionalGrant/params/PromotionalGrantsParams.java @@ -19,8 +19,12 @@ public final class PromotionalGrantsParams { private final String unitId; + private final String id; + private final String amount; + private final Timestamp effectiveFrom; + private final Timestamp expiresAt; private final java.util.Map metadata; @@ -31,8 +35,12 @@ private PromotionalGrantsParams(PromotionalGrantsBuilder builder) { this.unitId = builder.unitId; + this.id = builder.id; + this.amount = builder.amount; + this.effectiveFrom = builder.effectiveFrom; + this.expiresAt = builder.expiresAt; this.metadata = builder.metadata; @@ -46,10 +54,18 @@ public String getUnitId() { return unitId; } + public String getId() { + return id; + } + public String getAmount() { return amount; } + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + public Timestamp getExpiresAt() { return expiresAt; } @@ -72,11 +88,21 @@ public Map toFormData() { formData.put("unit_id", this.unitId); } + if (this.id != null) { + + formData.put("id", this.id); + } + if (this.amount != null) { formData.put("amount", this.amount); } + if (this.effectiveFrom != null) { + + formData.put("effective_from", this.effectiveFrom); + } + if (this.expiresAt != null) { formData.put("expires_at", this.expiresAt); @@ -112,11 +138,21 @@ public Map toJsonMap() { jsonData.put("unit_id", this.unitId); } + if (this.id != null) { + + jsonData.put("id", this.id); + } + if (this.amount != null) { jsonData.put("amount", this.amount); } + if (this.effectiveFrom != null) { + + jsonData.put("effective_from", this.effectiveFrom); + } + if (this.expiresAt != null) { jsonData.put("expires_at", this.expiresAt); @@ -147,8 +183,12 @@ public static final class PromotionalGrantsBuilder { private String unitId; + private String id; + private String amount; + private Timestamp effectiveFrom; + private Timestamp expiresAt; private java.util.Map metadata; @@ -165,11 +205,21 @@ public PromotionalGrantsBuilder unitId(String value) { return this; } + public PromotionalGrantsBuilder id(String value) { + this.id = value; + return this; + } + public PromotionalGrantsBuilder amount(String value) { this.amount = value; return this; } + public PromotionalGrantsBuilder effectiveFrom(Timestamp value) { + this.effectiveFrom = value; + return this; + } + public PromotionalGrantsBuilder expiresAt(Timestamp value) { this.expiresAt = value; return this; 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 aae413af4..b92ac2617 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 @@ -837,6 +837,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java index dc207f82a..fa9f196ae 100644 --- a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java +++ b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseEstimateParams.java @@ -502,6 +502,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java b/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java index 217e265c2..ec85d34b1 100644 --- a/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java +++ b/src/main/java/com/chargebee/v4/models/quotedSubscription/QuotedSubscription.java @@ -529,6 +529,7 @@ public static class SubscriptionItems { private ChargeOnOption chargeOnOption; private ProrationType prorationType; private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + private String description; public String getItemPriceId() { return itemPriceId; @@ -632,6 +633,10 @@ public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { return usageAccumulationResetFrequency; } + public String getDescription() { + return description; + } + public enum ItemType { PLAN("plan"), @@ -884,6 +889,8 @@ public static SubscriptionItems fromJson(JsonObject jsonObj) { UsageAccumulationResetFrequency.fromString( JsonUtil.getString(jsonObj, "usage_accumulation_reset_frequency")); + obj.description = JsonUtil.getString(jsonObj, "description"); + return obj; } @@ -940,6 +947,8 @@ public String toString() { + prorationType + ", usageAccumulationResetFrequency=" + usageAccumulationResetFrequency + + ", description=" + + description + "}"; } @@ -974,7 +983,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(chargeOnOption, that.chargeOnOption) && java.util.Objects.equals(prorationType, that.prorationType) && java.util.Objects.equals( - usageAccumulationResetFrequency, that.usageAccumulationResetFrequency); + usageAccumulationResetFrequency, that.usageAccumulationResetFrequency) + && java.util.Objects.equals(description, that.description); } @Override @@ -1005,7 +1015,8 @@ public int hashCode() { chargeOnce, chargeOnOption, prorationType, - usageAccumulationResetFrequency); + usageAccumulationResetFrequency, + description); } } diff --git a/src/main/java/com/chargebee/v4/models/ramp/Ramp.java b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java index 823392bfe..e47da1d1a 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/Ramp.java +++ b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java @@ -33,6 +33,7 @@ public class Ramp { private List discountsToAdd; private List itemTiers; private ContractTerm contractTerm; + private BillingConfiguration billingConfiguration; private StatusTransitionReason statusTransitionReason; public String getId() { @@ -107,6 +108,10 @@ public ContractTerm getContractTerm() { return contractTerm; } + public BillingConfiguration getBillingConfiguration() { + return billingConfiguration; + } + public StatusTransitionReason getStatusTransitionReason() { return statusTransitionReason; } @@ -209,6 +214,11 @@ public static Ramp fromJson(JsonObject jsonObj) { obj.contractTerm = ContractTerm.fromJson(__contractTermObj); } + JsonObject __billingConfigurationObj = JsonUtil.getJsonObject(jsonObj, "billing_configuration"); + if (__billingConfigurationObj != null) { + obj.billingConfiguration = BillingConfiguration.fromJson(__billingConfigurationObj); + } + JsonObject __statusTransitionReasonObj = JsonUtil.getJsonObject(jsonObj, "status_transition_reason"); if (__statusTransitionReasonObj != null) { @@ -257,6 +267,8 @@ public String toString() { + itemTiers + ", contractTerm=" + contractTerm + + ", billingConfiguration=" + + billingConfiguration + ", statusTransitionReason=" + statusTransitionReason + "}"; @@ -286,6 +298,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(discountsToAdd, that.discountsToAdd) && java.util.Objects.equals(itemTiers, that.itemTiers) && java.util.Objects.equals(contractTerm, that.contractTerm) + && java.util.Objects.equals(billingConfiguration, that.billingConfiguration) && java.util.Objects.equals(statusTransitionReason, that.statusTransitionReason); } @@ -311,6 +324,7 @@ public int hashCode() { discountsToAdd, itemTiers, contractTerm, + billingConfiguration, statusTransitionReason); } @@ -1558,6 +1572,51 @@ public int hashCode() { } } + public static class BillingConfiguration { + + private String poNumber; + + public String getPoNumber() { + return poNumber; + } + + public static BillingConfiguration fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static BillingConfiguration fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static BillingConfiguration fromJson(JsonObject jsonObj) { + BillingConfiguration obj = new BillingConfiguration(); + + obj.poNumber = JsonUtil.getString(jsonObj, "po_number"); + + return obj; + } + + @Override + public String toString() { + return "BillingConfiguration{" + "poNumber=" + poNumber + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BillingConfiguration that = (BillingConfiguration) o; + return java.util.Objects.equals(poNumber, that.poNumber); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(poNumber); + } + } + public static class StatusTransitionReason { private String code; diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java index 1105c6f74..9efa34ee8 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java @@ -25,6 +25,8 @@ public final class RampCreateForSubscriptionParams { private final List itemsToRemove; + private final BillingConfigurationParams billingConfiguration; + private final ContractTermParams contractTerm; private final List itemsToAdd; @@ -49,6 +51,8 @@ private RampCreateForSubscriptionParams(RampCreateForSubscriptionBuilder builder this.itemsToRemove = builder.itemsToRemove; + this.billingConfiguration = builder.billingConfiguration; + this.contractTerm = builder.contractTerm; this.itemsToAdd = builder.itemsToAdd; @@ -82,6 +86,10 @@ public List getItemsToRemove() { return itemsToRemove; } + public BillingConfigurationParams getBillingConfiguration() { + return billingConfiguration; + } + public ContractTermParams getContractTerm() { return contractTerm; } @@ -135,6 +143,16 @@ public Map toFormData() { formData.put("items_to_remove", this.itemsToRemove); } + if (this.billingConfiguration != null) { + + // Single object + Map nestedData = this.billingConfiguration.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_configuration[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + if (this.contractTerm != null) { // Single object @@ -241,6 +259,8 @@ public static final class RampCreateForSubscriptionBuilder { private List itemsToRemove; + private BillingConfigurationParams billingConfiguration; + private ContractTermParams contractTerm; private List itemsToAdd; @@ -280,6 +300,11 @@ public RampCreateForSubscriptionBuilder itemsToRemove(List value) { return this; } + public RampCreateForSubscriptionBuilder billingConfiguration(BillingConfigurationParams value) { + this.billingConfiguration = value; + return this; + } + public RampCreateForSubscriptionBuilder contractTerm(ContractTermParams value) { this.contractTerm = value; return this; @@ -315,6 +340,54 @@ public RampCreateForSubscriptionParams build() { } } + public static final class BillingConfigurationParams { + + private final String poNumber; + + private BillingConfigurationParams(BillingConfigurationBuilder builder) { + + this.poNumber = builder.poNumber; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for BillingConfigurationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingConfigurationBuilder builder() { + return new BillingConfigurationBuilder(); + } + + public static final class BillingConfigurationBuilder { + + private String poNumber; + + private BillingConfigurationBuilder() {} + + public BillingConfigurationBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public BillingConfigurationParams build() { + return new BillingConfigurationParams(this); + } + } + } + public static final class ContractTermParams { private final ActionAtTermEnd actionAtTermEnd; diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java index 9bf9c07bc..dae86470c 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java @@ -25,6 +25,8 @@ public final class RampUpdateParams { private final List itemsToRemove; + private final BillingConfigurationParams billingConfiguration; + private final ContractTermParams contractTerm; private final List itemsToAdd; @@ -49,6 +51,8 @@ private RampUpdateParams(RampUpdateBuilder builder) { this.itemsToRemove = builder.itemsToRemove; + this.billingConfiguration = builder.billingConfiguration; + this.contractTerm = builder.contractTerm; this.itemsToAdd = builder.itemsToAdd; @@ -82,6 +86,10 @@ public List getItemsToRemove() { return itemsToRemove; } + public BillingConfigurationParams getBillingConfiguration() { + return billingConfiguration; + } + public ContractTermParams getContractTerm() { return contractTerm; } @@ -135,6 +143,16 @@ public Map toFormData() { formData.put("items_to_remove", this.itemsToRemove); } + if (this.billingConfiguration != null) { + + // Single object + Map nestedData = this.billingConfiguration.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "billing_configuration[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + if (this.contractTerm != null) { // Single object @@ -241,6 +259,8 @@ public static final class RampUpdateBuilder { private List itemsToRemove; + private BillingConfigurationParams billingConfiguration; + private ContractTermParams contractTerm; private List itemsToAdd; @@ -280,6 +300,11 @@ public RampUpdateBuilder itemsToRemove(List value) { return this; } + public RampUpdateBuilder billingConfiguration(BillingConfigurationParams value) { + this.billingConfiguration = value; + return this; + } + public RampUpdateBuilder contractTerm(ContractTermParams value) { this.contractTerm = value; return this; @@ -315,6 +340,54 @@ public RampUpdateParams build() { } } + public static final class BillingConfigurationParams { + + private final String poNumber; + + private BillingConfigurationParams(BillingConfigurationBuilder builder) { + + this.poNumber = builder.poNumber; + } + + public String getPoNumber() { + return poNumber; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.poNumber != null) { + + formData.put("po_number", this.poNumber); + } + + return formData; + } + + /** Create a new builder for BillingConfigurationParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static BillingConfigurationBuilder builder() { + return new BillingConfigurationBuilder(); + } + + public static final class BillingConfigurationBuilder { + + private String poNumber; + + private BillingConfigurationBuilder() {} + + public BillingConfigurationBuilder poNumber(String value) { + this.poNumber = value; + return this; + } + + public BillingConfigurationParams build() { + return new BillingConfigurationParams(this); + } + } + } + public static final class ContractTermParams { private final ActionAtTermEnd actionAtTermEnd; 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 1c21d6598..d9c3f338a 100644 --- a/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java +++ b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java @@ -1085,6 +1085,7 @@ public static class Discounts { private String itemPriceId; private Timestamp startDate; private Timestamp endDate; + private Timestamp applyTill; public String getId() { return id; @@ -1138,6 +1139,10 @@ public Timestamp getEndDate() { return endDate; } + public Timestamp getApplyTill() { + return applyTill; + } + public enum Type { FIXED_AMOUNT("fixed_amount"), @@ -1295,6 +1300,8 @@ public static Discounts fromJson(JsonObject jsonObj) { obj.endDate = JsonUtil.getTimestamp(jsonObj, "end_date"); + obj.applyTill = JsonUtil.getTimestamp(jsonObj, "apply_till"); + return obj; } @@ -1327,6 +1334,8 @@ public String toString() { + startDate + ", endDate=" + endDate + + ", applyTill=" + + applyTill + "}"; } @@ -1348,7 +1357,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(periodUnit, that.periodUnit) && java.util.Objects.equals(itemPriceId, that.itemPriceId) && java.util.Objects.equals(startDate, that.startDate) - && java.util.Objects.equals(endDate, that.endDate); + && java.util.Objects.equals(endDate, that.endDate) + && java.util.Objects.equals(applyTill, that.applyTill); } @Override @@ -1367,7 +1377,8 @@ public int hashCode() { periodUnit, itemPriceId, startDate, - endDate); + endDate, + applyTill); } } diff --git a/src/main/java/com/chargebee/v4/models/subscription/Subscription.java b/src/main/java/com/chargebee/v4/models/subscription/Subscription.java index e528193cf..7d651e3fa 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/Subscription.java +++ b/src/main/java/com/chargebee/v4/models/subscription/Subscription.java @@ -74,6 +74,7 @@ public class Subscription { private Boolean autoCloseInvoices; private String businessEntityId; private Boolean decommissioned; + private String brandId; private List subscriptionItems; private List itemTiers; private List chargedItems; @@ -335,6 +336,10 @@ public Boolean getDecommissioned() { return decommissioned; } + public String getBrandId() { + return brandId; + } + public List getSubscriptionItems() { return subscriptionItems; } @@ -848,6 +853,8 @@ public static Subscription fromJson(JsonObject jsonObj) { knownFields.add("decommissioned"); + knownFields.add("brand_id"); + knownFields.add("subscription_items"); knownFields.add("item_tiers"); @@ -1014,6 +1021,8 @@ public static Subscription fromJson(JsonObject jsonObj) { obj.decommissioned = JsonUtil.getBoolean(jsonObj, "decommissioned"); + obj.brandId = JsonUtil.getString(jsonObj, "brand_id"); + obj.subscriptionItems = JsonUtil.mapArray( JsonUtil.getJsonArray(jsonObj, "subscription_items"), SubscriptionItems::fromJson); @@ -1202,6 +1211,8 @@ public String toString() { + businessEntityId + ", decommissioned=" + decommissioned + + ", brandId=" + + brandId + ", subscriptionItems=" + subscriptionItems + ", itemTiers=" @@ -1313,6 +1324,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(autoCloseInvoices, that.autoCloseInvoices) && java.util.Objects.equals(businessEntityId, that.businessEntityId) && java.util.Objects.equals(decommissioned, that.decommissioned) + && java.util.Objects.equals(brandId, that.brandId) && java.util.Objects.equals(subscriptionItems, that.subscriptionItems) && java.util.Objects.equals(itemTiers, that.itemTiers) && java.util.Objects.equals(chargedItems, that.chargedItems) @@ -1399,6 +1411,7 @@ public int hashCode() { autoCloseInvoices, businessEntityId, decommissioned, + brandId, subscriptionItems, itemTiers, chargedItems, @@ -1449,6 +1462,7 @@ public static class SubscriptionItems { private ChargeOnOption chargeOnOption; private ProrationType prorationType; private UsageAccumulationResetFrequency usageAccumulationResetFrequency; + private String description; public String getItemPriceId() { return itemPriceId; @@ -1552,6 +1566,10 @@ public UsageAccumulationResetFrequency getUsageAccumulationResetFrequency() { return usageAccumulationResetFrequency; } + public String getDescription() { + return description; + } + public enum ItemType { PLAN("plan"), @@ -1804,6 +1822,8 @@ public static SubscriptionItems fromJson(JsonObject jsonObj) { UsageAccumulationResetFrequency.fromString( JsonUtil.getString(jsonObj, "usage_accumulation_reset_frequency")); + obj.description = JsonUtil.getString(jsonObj, "description"); + return obj; } @@ -1860,6 +1880,8 @@ public String toString() { + prorationType + ", usageAccumulationResetFrequency=" + usageAccumulationResetFrequency + + ", description=" + + description + "}"; } @@ -1894,7 +1916,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(chargeOnOption, that.chargeOnOption) && java.util.Objects.equals(prorationType, that.prorationType) && java.util.Objects.equals( - usageAccumulationResetFrequency, that.usageAccumulationResetFrequency); + usageAccumulationResetFrequency, that.usageAccumulationResetFrequency) + && java.util.Objects.equals(description, that.description); } @Override @@ -1925,7 +1948,8 @@ public int hashCode() { chargeOnce, chargeOnOption, prorationType, - usageAccumulationResetFrequency); + usageAccumulationResetFrequency, + description); } } 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 741b9ea76..706fa8d25 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 @@ -1440,6 +1440,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2347,6 +2349,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2377,6 +2381,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2658,6 +2664,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2800,6 +2832,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3626,14 +3660,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod 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 ec3d576bd..bda1edfc4 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 @@ -19,6 +19,8 @@ public final class SubscriptionCreateForCustomerParams { private final String id; + private final String brandId; + private final String planId; private final Integer planQuantity; @@ -97,6 +99,8 @@ private SubscriptionCreateForCustomerParams(SubscriptionCreateForCustomerBuilder this.id = builder.id; + this.brandId = builder.brandId; + this.planId = builder.planId; this.planQuantity = builder.planQuantity; @@ -179,6 +183,10 @@ public String getId() { return id; } + public String getBrandId() { + return brandId; + } + public String getPlanId() { return planId; } @@ -336,6 +344,11 @@ public Map toFormData() { formData.put("id", this.id); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.planId != null) { formData.put("plan_id", this.planId); @@ -582,6 +595,8 @@ public static final class SubscriptionCreateForCustomerBuilder { private String id; + private String brandId; + private String planId; private Integer planQuantity; @@ -663,6 +678,11 @@ public SubscriptionCreateForCustomerBuilder id(String value) { return this; } + public SubscriptionCreateForCustomerBuilder brandId(String value) { + this.brandId = value; + return this; + } + public SubscriptionCreateForCustomerBuilder planId(String value) { this.planId = value; return this; @@ -1751,6 +1771,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 1925d9820..987cd0e2b 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 @@ -19,6 +19,8 @@ public final class SubscriptionCreateParams { private final String id; + private final String brandId; + private final String planId; private final Integer planQuantity; @@ -113,6 +115,8 @@ private SubscriptionCreateParams(SubscriptionCreateBuilder builder) { this.id = builder.id; + this.brandId = builder.brandId; + this.planId = builder.planId; this.planQuantity = builder.planQuantity; @@ -211,6 +215,10 @@ public String getId() { return id; } + public String getBrandId() { + return brandId; + } + public String getPlanId() { return planId; } @@ -400,6 +408,11 @@ public Map toFormData() { formData.put("id", this.id); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.planId != null) { formData.put("plan_id", this.planId); @@ -731,6 +744,8 @@ public static final class SubscriptionCreateBuilder { private String id; + private String brandId; + private String planId; private Integer planQuantity; @@ -828,6 +843,11 @@ public SubscriptionCreateBuilder id(String value) { return this; } + public SubscriptionCreateBuilder brandId(String value) { + this.brandId = value; + return this; + } + public SubscriptionCreateBuilder planId(String value) { this.planId = value; return this; @@ -1897,6 +1917,8 @@ public enum Taxability { EXEMPT("exempt"), + ZERO_RATED("zero_rated"), + /** An enum member indicating that Taxability was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2687,6 +2709,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2717,6 +2741,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3478,6 +3504,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3620,6 +3672,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3917,6 +3971,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 60d0304b5..d21dda02a 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 @@ -21,6 +21,8 @@ public final class SubscriptionCreateWithItemsParams { private final String businessEntityId; + private final String brandId; + private final Timestamp trialEnd; private final Integer billingCycles; @@ -103,6 +105,8 @@ private SubscriptionCreateWithItemsParams(SubscriptionCreateWithItemsBuilder bui this.businessEntityId = builder.businessEntityId; + this.brandId = builder.brandId; + this.trialEnd = builder.trialEnd; this.billingCycles = builder.billingCycles; @@ -191,6 +195,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public String getBrandId() { + return brandId; + } + public Timestamp getTrialEnd() { return trialEnd; } @@ -357,6 +365,11 @@ public Map toFormData() { formData.put("business_entity_id", this.businessEntityId); } + if (this.brandId != null) { + + formData.put("brand_id", this.brandId); + } + if (this.trialEnd != null) { formData.put("trial_end", this.trialEnd); @@ -625,6 +638,8 @@ public static final class SubscriptionCreateWithItemsBuilder { private String businessEntityId; + private String brandId; + private Timestamp trialEnd; private Integer billingCycles; @@ -713,6 +728,11 @@ public SubscriptionCreateWithItemsBuilder businessEntityId(String value) { return this; } + public SubscriptionCreateWithItemsBuilder brandId(String value) { + this.brandId = value; + return this; + } + public SubscriptionCreateWithItemsBuilder trialEnd(Timestamp value) { this.trialEnd = value; return this; @@ -1806,6 +1826,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -2043,6 +2089,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private final ChargeOnOption chargeOnOption; private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; @@ -2071,6 +2119,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemType = builder.itemType; + this.description = builder.description; + this.chargeOnOption = builder.chargeOnOption; this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; @@ -2120,6 +2170,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + public ChargeOnOption getChargeOnOption() { return chargeOnOption; } @@ -2187,6 +2241,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.chargeOnOption != null) { formData.put("charge_on_option", this.chargeOnOption); @@ -2230,6 +2289,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private ChargeOnOption chargeOnOption; private UsageAccumulationResetFrequency usageAccumulationResetFrequency; @@ -2291,6 +2352,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder chargeOnOption(ChargeOnOption value) { this.chargeOnOption = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java index 1b697a03a..aec23c39a 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForCustomerParams.java @@ -1240,14 +1240,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java index dd9e996b1..ed9094173 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionImportForItemsParams.java @@ -1270,14 +1270,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1666,6 +1670,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemPriceId = builder.itemPriceId; @@ -1689,6 +1695,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.chargeOnce = builder.chargeOnce; this.itemType = builder.itemType; + + this.description = builder.description; } public String getItemPriceId() { @@ -1735,6 +1743,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -1794,6 +1806,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + return formData; } @@ -1827,6 +1844,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private SubscriptionItemsBuilder() {} public SubscriptionItemsBuilder itemPriceId(String value) { @@ -1884,6 +1903,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsParams build() { return new SubscriptionItemsParams(this); } 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 9b7f6c52b..425453a82 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 @@ -794,6 +794,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 5d6ad04e3..ab8cfafad 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 @@ -552,6 +552,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 a79bdb44c..ca551fed4 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 @@ -1924,6 +1924,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1954,6 +1956,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2255,6 +2259,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2397,6 +2427,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2694,6 +2726,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -3881,6 +3939,8 @@ public static final class SubscriptionItemsParams { private final ItemType itemType; + private final String description; + private final ProrationType prorationType; private final UsageAccumulationResetFrequency usageAccumulationResetFrequency; @@ -3911,6 +3971,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.itemType = builder.itemType; + this.description = builder.description; + this.prorationType = builder.prorationType; this.usageAccumulationResetFrequency = builder.usageAccumulationResetFrequency; @@ -3964,6 +4026,10 @@ public ItemType getItemType() { return itemType; } + public String getDescription() { + return description; + } + public ProrationType getProrationType() { return prorationType; } @@ -4036,6 +4102,11 @@ public Map toFormData() { formData.put("item_type", this.itemType); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.prorationType != null) { formData.put("proration_type", this.prorationType); @@ -4081,6 +4152,8 @@ public static final class SubscriptionItemsBuilder { private ItemType itemType; + private String description; + private ProrationType prorationType; private UsageAccumulationResetFrequency usageAccumulationResetFrequency; @@ -4147,6 +4220,11 @@ public SubscriptionItemsBuilder itemType(ItemType value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder prorationType(ProrationType value) { this.prorationType = value; return this; 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 4fe6c83ec..5af8b26a7 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 @@ -1839,6 +1839,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1869,6 +1871,8 @@ public enum PreferredScheme { VISA("visa"), + DANKORT("dankort"), + /** An enum member indicating that PreferredScheme was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2170,6 +2174,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2312,6 +2342,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2609,6 +2641,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** * 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 3e32be239..f7ffafdf4 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java @@ -16,6 +16,7 @@ public class ThirdPartyPaymentMethod { private Gateway gateway; private String gatewayAccountId; private String referenceId; + private java.util.Map networkTransactionReference; public Type getType() { return type; @@ -33,6 +34,10 @@ public String getReferenceId() { return referenceId; } + public java.util.Map getNetworkTransactionReference() { + return networkTransactionReference; + } + public enum Type { CARD("card"), @@ -142,6 +147,32 @@ public enum Type { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -286,6 +317,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -330,6 +363,13 @@ public static ThirdPartyPaymentMethod fromJson(JsonObject jsonObj) { obj.referenceId = JsonUtil.getString(jsonObj, "reference_id"); + JsonObject __networkTransactionReferenceObj = + JsonUtil.getJsonObject(jsonObj, "network_transaction_reference"); + obj.networkTransactionReference = + __networkTransactionReferenceObj != null + ? JsonUtil.parseJsonObjectToMap(__networkTransactionReferenceObj) + : new java.util.HashMap<>(); + return obj; } @@ -344,6 +384,8 @@ public String toString() { + gatewayAccountId + ", referenceId=" + referenceId + + ", networkTransactionReference=" + + networkTransactionReference + "}"; } @@ -356,12 +398,14 @@ public boolean equals(Object o) { return java.util.Objects.equals(type, that.type) && java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) - && java.util.Objects.equals(referenceId, that.referenceId); + && java.util.Objects.equals(referenceId, that.referenceId) + && java.util.Objects.equals(networkTransactionReference, that.networkTransactionReference); } @Override public int hashCode() { - return java.util.Objects.hash(type, gateway, gatewayAccountId, referenceId); + return java.util.Objects.hash( + type, gateway, gatewayAccountId, referenceId, networkTransactionReference); } } 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 f937ddc79..1a5f5238d 100644 --- a/src/main/java/com/chargebee/v4/models/token/Token.java +++ b/src/main/java/com/chargebee/v4/models/token/Token.java @@ -195,6 +195,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -329,6 +331,32 @@ public enum PaymentMethodType { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** 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 c113329b0..7de038f3e 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java +++ b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java @@ -61,6 +61,7 @@ public class Transaction { private List linkedRefunds; private List linkedPayments; private ErrorDetail errorDetail; + private NetworkTransactionDetails networkTransactionDetails; public String getId() { return id; @@ -246,6 +247,10 @@ public ErrorDetail getErrorDetail() { return errorDetail; } + public NetworkTransactionDetails getNetworkTransactionDetails() { + return networkTransactionDetails; + } + public enum PaymentMethod { CARD("card"), @@ -375,6 +380,32 @@ public enum PaymentMethod { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -519,6 +550,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -819,6 +852,13 @@ public static Transaction fromJson(JsonObject jsonObj) { obj.errorDetail = ErrorDetail.fromJson(__errorDetailObj); } + JsonObject __networkTransactionDetailsObj = + JsonUtil.getJsonObject(jsonObj, "network_transaction_details"); + if (__networkTransactionDetailsObj != null) { + obj.networkTransactionDetails = + NetworkTransactionDetails.fromJson(__networkTransactionDetailsObj); + } + return obj; } @@ -917,6 +957,8 @@ public String toString() { + linkedPayments + ", errorDetail=" + errorDetail + + ", networkTransactionDetails=" + + networkTransactionDetails + "}"; } @@ -971,7 +1013,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(linkedCreditNotes, that.linkedCreditNotes) && java.util.Objects.equals(linkedRefunds, that.linkedRefunds) && java.util.Objects.equals(linkedPayments, that.linkedPayments) - && java.util.Objects.equals(errorDetail, that.errorDetail); + && java.util.Objects.equals(errorDetail, that.errorDetail) + && java.util.Objects.equals(networkTransactionDetails, that.networkTransactionDetails); } @Override @@ -1023,7 +1066,8 @@ public int hashCode() { linkedCreditNotes, linkedRefunds, linkedPayments, - errorDetail); + errorDetail, + networkTransactionDetails); } public static class LinkedInvoices { @@ -1812,4 +1856,64 @@ public int hashCode() { processorAdviceCode); } } + + public static class NetworkTransactionDetails { + + private String networkTransactionId; + private String originalNetworkTransactionId; + + public String getNetworkTransactionId() { + return networkTransactionId; + } + + public String getOriginalNetworkTransactionId() { + return originalNetworkTransactionId; + } + + public static NetworkTransactionDetails fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static NetworkTransactionDetails fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static NetworkTransactionDetails fromJson(JsonObject jsonObj) { + NetworkTransactionDetails obj = new NetworkTransactionDetails(); + + obj.networkTransactionId = JsonUtil.getString(jsonObj, "network_transaction_id"); + + obj.originalNetworkTransactionId = + JsonUtil.getString(jsonObj, "original_network_transaction_id"); + + return obj; + } + + @Override + public String toString() { + return "NetworkTransactionDetails{" + + "networkTransactionId=" + + networkTransactionId + + ", originalNetworkTransactionId=" + + originalNetworkTransactionId + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + NetworkTransactionDetails that = (NetworkTransactionDetails) o; + return java.util.Objects.equals(networkTransactionId, that.networkTransactionId) + && java.util.Objects.equals( + originalNetworkTransactionId, that.originalNetworkTransactionId); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(networkTransactionId, originalNetworkTransactionId); + } + } } 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 b4e2d15d7..ccb29e130 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 @@ -700,6 +700,32 @@ public enum PaymentMethodIs { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethodIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -852,6 +878,32 @@ public enum PaymentMethodIsNot { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethodIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1004,6 +1056,32 @@ public enum PaymentMethodIn { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethodIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1156,6 +1234,32 @@ public enum PaymentMethodNotIn { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethodNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1300,6 +1404,8 @@ public enum GatewayIs { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIs was instantiated with an unknown value. */ @@ -1446,6 +1552,8 @@ public enum GatewayIsNot { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIsNot was instantiated with an unknown value. */ @@ -1592,6 +1700,8 @@ public enum GatewayIn { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIn was instantiated with an unknown value. */ @@ -1738,6 +1848,8 @@ public enum GatewayNotIn { PAYWAY("payway"), + PAYU("payu"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayNotIn was instantiated with an unknown value. */ @@ -2259,6 +2371,32 @@ public enum PaymentMethod { QPAY("qpay"), + OVO("ovo"), + + MOMO("momo"), + + MERCADO_PAGO("mercado_pago"), + + NEQUI("nequi"), + + NUPAY("nupay"), + + PICPAY("picpay"), + + THAI_QR("thai_qr"), + + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + + AFFIRM_PAY("affirm_pay"), + + RAKUTEN_PAY("rakuten_pay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2403,6 +2541,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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/TransactionRecordRefundParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java index af075f0cd..2740bc958 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionRecordRefundParams.java @@ -176,14 +176,18 @@ public enum PaymentMethod { CUSTOM("custom"), - DANA("dana"), - - TOUCH_N_GO("touch_n_go"), - TAMARA("tamara"), QPAY("qpay"), + BLIK("blik"), + + FPX("fpx"), + + WERO("wero"), + + P24("p24"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String 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 25f1ed028..8656460ba 100644 --- a/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java @@ -248,6 +248,8 @@ public enum Gateway { PAYWAY("payway"), + PAYU("payu"), + 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/services/BusinessRuleService.java b/src/main/java/com/chargebee/v4/services/BusinessRuleService.java new file mode 100644 index 000000000..39c0c4276 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/BusinessRuleService.java @@ -0,0 +1,450 @@ +/* + * 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.businessRule.params.BusinessRuleApplyRulesParams; + +import com.chargebee.v4.models.businessRule.params.BusinessRuleUpdateDraftParams; + +import com.chargebee.v4.models.businessRule.params.BusinessRuleListParams; + +import com.chargebee.v4.models.businessRule.params.BusinessRuleCreateParams; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleApplyRulesResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleDeleteDraftResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleReleaseRuleResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleActivateRuleResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleRetrieveDraftResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleUpdateDraftResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleDeleteResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleDeactivateRuleResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleRetrieveResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleListResponse; + +import com.chargebee.v4.models.businessRule.responses.BusinessRuleCreateResponse; + +public final class BusinessRuleService extends BaseService { + + private final ServiceConfig config; + + public BusinessRuleService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private BusinessRuleService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private BusinessRuleService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + BusinessRuleService with(RequestOptions newOptions) { + return new BusinessRuleService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public BusinessRuleService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * applyRules a businessRule using immutable params (executes immediately) - returns raw Response. + */ + Response applyRulesRaw(BusinessRuleApplyRulesParams params) throws ChargebeeException { + + return post( + "businessRule", + "applyRules", + "/business_rules/apply_rules", + params != null ? params.toFormData() : null); + } + + /** + * applyRules a businessRule using raw JSON payload (executes immediately) - returns raw Response. + */ + Response applyRulesRaw(String jsonPayload) throws ChargebeeException { + + return postJson("businessRule", "applyRules", "/business_rules/apply_rules", jsonPayload); + } + + public BusinessRuleApplyRulesResponse applyRules(BusinessRuleApplyRulesParams params) + throws ChargebeeException { + Response response = applyRulesRaw(params); + + return BusinessRuleApplyRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of applyRules for businessRule with params. */ + public CompletableFuture applyRulesAsync( + BusinessRuleApplyRulesParams params) { + + return postAsync( + "businessRule", + "applyRules", + "/business_rules/apply_rules", + params != null ? params.toFormData() : null) + .thenApply( + response -> + BusinessRuleApplyRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + /** deleteDraft a businessRule (executes immediately) - returns raw Response. */ + Response deleteDraftRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/delete_draft", "business-rule-id", businessRuleId); + + return post("businessRule", "deleteDraft", path, null); + } + + public BusinessRuleDeleteDraftResponse deleteDraft(String businessRuleId) + throws ChargebeeException { + Response response = deleteDraftRaw(businessRuleId); + return BusinessRuleDeleteDraftResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of deleteDraft for businessRule without params. */ + public CompletableFuture deleteDraftAsync( + String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/delete_draft", "business-rule-id", businessRuleId); + + return postAsync("businessRule", "deleteDraft", path, null) + .thenApply( + response -> + BusinessRuleDeleteDraftResponse.fromJson(response.getBodyAsString(), response)); + } + + /** releaseRule a businessRule (executes immediately) - returns raw Response. */ + Response releaseRuleRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/release", "business-rule-id", businessRuleId); + + return post("businessRule", "releaseRule", path, null); + } + + public BusinessRuleReleaseRuleResponse releaseRule(String businessRuleId) + throws ChargebeeException { + Response response = releaseRuleRaw(businessRuleId); + return BusinessRuleReleaseRuleResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of releaseRule for businessRule without params. */ + public CompletableFuture releaseRuleAsync( + String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/release", "business-rule-id", businessRuleId); + + return postAsync("businessRule", "releaseRule", path, null) + .thenApply( + response -> + BusinessRuleReleaseRuleResponse.fromJson(response.getBodyAsString(), response)); + } + + /** activateRule a businessRule (executes immediately) - returns raw Response. */ + Response activateRuleRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/activate", "business-rule-id", businessRuleId); + + return post("businessRule", "activateRule", path, null); + } + + public BusinessRuleActivateRuleResponse activateRule(String businessRuleId) + throws ChargebeeException { + Response response = activateRuleRaw(businessRuleId); + return BusinessRuleActivateRuleResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of activateRule for businessRule without params. */ + public CompletableFuture activateRuleAsync( + String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/activate", "business-rule-id", businessRuleId); + + return postAsync("businessRule", "activateRule", path, null) + .thenApply( + response -> + BusinessRuleActivateRuleResponse.fromJson(response.getBodyAsString(), response)); + } + + /** retrieveDraft a businessRule (executes immediately) - returns raw Response. */ + Response retrieveDraftRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + + return get("businessRule", "retrieveDraft", path, null); + } + + public BusinessRuleRetrieveDraftResponse retrieveDraft(String businessRuleId) + throws ChargebeeException { + Response response = retrieveDraftRaw(businessRuleId); + return BusinessRuleRetrieveDraftResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieveDraft for businessRule without params. */ + public CompletableFuture retrieveDraftAsync( + String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + + return getAsync("businessRule", "retrieveDraft", path, null) + .thenApply( + response -> + BusinessRuleRetrieveDraftResponse.fromJson(response.getBodyAsString(), response)); + } + + /** updateDraft a businessRule (executes immediately) - returns raw Response. */ + Response updateDraftRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + + return post("businessRule", "updateDraft", path, null); + } + + /** + * updateDraft a businessRule using immutable params (executes immediately) - returns raw + * Response. + */ + Response updateDraftRaw(String businessRuleId, BusinessRuleUpdateDraftParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + return post("businessRule", "updateDraft", path, params.toFormData()); + } + + /** + * updateDraft a businessRule using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response updateDraftRaw(String businessRuleId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + return postJson("businessRule", "updateDraft", path, jsonPayload); + } + + public BusinessRuleUpdateDraftResponse updateDraft( + String businessRuleId, BusinessRuleUpdateDraftParams params) throws ChargebeeException { + Response response = updateDraftRaw(businessRuleId, params); + return BusinessRuleUpdateDraftResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of updateDraft for businessRule with params. */ + public CompletableFuture updateDraftAsync( + String businessRuleId, BusinessRuleUpdateDraftParams params) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/draft", "business-rule-id", businessRuleId); + return postAsync("businessRule", "updateDraft", path, params.toFormData()) + .thenApply( + response -> + BusinessRuleUpdateDraftResponse.fromJson(response.getBodyAsString(), response)); + } + + /** delete a businessRule (executes immediately) - returns raw Response. */ + Response deleteRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/delete", "business-rule-id", businessRuleId); + + return post("businessRule", "delete", path, null); + } + + public BusinessRuleDeleteResponse delete(String businessRuleId) throws ChargebeeException { + Response response = deleteRaw(businessRuleId); + return BusinessRuleDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of delete for businessRule without params. */ + public CompletableFuture deleteAsync(String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/delete", "business-rule-id", businessRuleId); + + return postAsync("businessRule", "delete", path, null) + .thenApply( + response -> BusinessRuleDeleteResponse.fromJson(response.getBodyAsString(), response)); + } + + /** deactivateRule a businessRule (executes immediately) - returns raw Response. */ + Response deactivateRuleRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/deactivate", "business-rule-id", businessRuleId); + + return post("businessRule", "deactivateRule", path, null); + } + + public BusinessRuleDeactivateRuleResponse deactivateRule(String businessRuleId) + throws ChargebeeException { + Response response = deactivateRuleRaw(businessRuleId); + return BusinessRuleDeactivateRuleResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of deactivateRule for businessRule without params. */ + public CompletableFuture deactivateRuleAsync( + String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}/deactivate", "business-rule-id", businessRuleId); + + return postAsync("businessRule", "deactivateRule", path, null) + .thenApply( + response -> + BusinessRuleDeactivateRuleResponse.fromJson(response.getBodyAsString(), response)); + } + + /** retrieve a businessRule (executes immediately) - returns raw Response. */ + Response retrieveRaw(String businessRuleId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}", "business-rule-id", businessRuleId); + + return get("businessRule", "retrieve", path, null); + } + + public BusinessRuleRetrieveResponse retrieve(String businessRuleId) throws ChargebeeException { + Response response = retrieveRaw(businessRuleId); + return BusinessRuleRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for businessRule without params. */ + public CompletableFuture retrieveAsync(String businessRuleId) { + String path = + buildPathWithParams( + "/business_rules/{business-rule-id}", "business-rule-id", businessRuleId); + + return getAsync("businessRule", "retrieve", path, null) + .thenApply( + response -> + BusinessRuleRetrieveResponse.fromJson(response.getBodyAsString(), response)); + } + + /** list a businessRule using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(BusinessRuleListParams params) throws ChargebeeException { + + return get( + "businessRule", "list", "/business_rules", params != null ? params.toQueryParams() : null); + } + + /** list a businessRule without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("businessRule", "list", "/business_rules", null); + } + + /** list a businessRule 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 BusinessRuleListResponse list(BusinessRuleListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return BusinessRuleListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for businessRule with params. */ + public CompletableFuture listAsync(BusinessRuleListParams params) { + + return getAsync( + "businessRule", + "list", + "/business_rules", + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + BusinessRuleListResponse.fromJson( + response.getBodyAsString(), this, params, response)); + } + + public BusinessRuleListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return BusinessRuleListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for businessRule without params. */ + public CompletableFuture listAsync() { + + return getAsync("businessRule", "list", "/business_rules", null) + .thenApply( + response -> + BusinessRuleListResponse.fromJson( + response.getBodyAsString(), this, null, response)); + } + + /** create a businessRule using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(BusinessRuleCreateParams params) throws ChargebeeException { + + return post( + "businessRule", "create", "/business_rules", params != null ? params.toFormData() : null); + } + + /** create a businessRule using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("businessRule", "create", "/business_rules", jsonPayload); + } + + public BusinessRuleCreateResponse create(BusinessRuleCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return BusinessRuleCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of create for businessRule with params. */ + public CompletableFuture createAsync( + BusinessRuleCreateParams params) { + + return postAsync( + "businessRule", + "create", + "/business_rules", + params != null ? params.toFormData() : null) + .thenApply( + response -> BusinessRuleCreateResponse.fromJson(response.getBodyAsString(), response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/BusinessRulesetService.java b/src/main/java/com/chargebee/v4/services/BusinessRulesetService.java new file mode 100644 index 000000000..d87476589 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/BusinessRulesetService.java @@ -0,0 +1,583 @@ +/* + * 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.businessRuleset.params.BusinessRulesetUpdateParams; + +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetRemoveRulesParams; + +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetListRulesParams; + +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetListParams; + +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetCreateParams; + +import com.chargebee.v4.models.businessRuleset.params.BusinessRulesetAddRulesParams; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetRetrieveResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetUpdateResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetRemoveRulesResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetDeleteResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetDeactivateResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetListRulesResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetListResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetCreateResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetActivateResponse; + +import com.chargebee.v4.models.businessRuleset.responses.BusinessRulesetAddRulesResponse; + +public final class BusinessRulesetService extends BaseService { + + private final ServiceConfig config; + + public BusinessRulesetService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private BusinessRulesetService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private BusinessRulesetService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + BusinessRulesetService with(RequestOptions newOptions) { + return new BusinessRulesetService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public BusinessRulesetService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a businessRuleset (executes immediately) - returns raw Response. */ + Response retrieveRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + + return get("businessRuleset", "retrieve", path, null); + } + + public BusinessRulesetRetrieveResponse retrieve(String businessRulesetId) + throws ChargebeeException { + Response response = retrieveRaw(businessRulesetId); + return BusinessRulesetRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for businessRuleset without params. */ + public CompletableFuture retrieveAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + + return getAsync("businessRuleset", "retrieve", path, null) + .thenApply( + response -> + BusinessRulesetRetrieveResponse.fromJson(response.getBodyAsString(), response)); + } + + /** update a businessRuleset (executes immediately) - returns raw Response. */ + Response updateRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + + return post("businessRuleset", "update", path, null); + } + + /** + * update a businessRuleset using immutable params (executes immediately) - returns raw Response. + */ + Response updateRaw(String businessRulesetId, BusinessRulesetUpdateParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + return post("businessRuleset", "update", path, params.toFormData()); + } + + /** + * update a businessRuleset using raw JSON payload (executes immediately) - returns raw Response. + */ + Response updateRaw(String businessRulesetId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + return postJson("businessRuleset", "update", path, jsonPayload); + } + + public BusinessRulesetUpdateResponse update( + String businessRulesetId, BusinessRulesetUpdateParams params) throws ChargebeeException { + Response response = updateRaw(businessRulesetId, params); + return BusinessRulesetUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for businessRuleset with params. */ + public CompletableFuture updateAsync( + String businessRulesetId, BusinessRulesetUpdateParams params) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}", "business-ruleset-id", businessRulesetId); + return postAsync("businessRuleset", "update", path, params.toFormData()) + .thenApply( + response -> + BusinessRulesetUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** removeRules a businessRuleset (executes immediately) - returns raw Response. */ + Response removeRulesRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/remove_rules", + "business-ruleset-id", + businessRulesetId); + + return post("businessRuleset", "removeRules", path, null); + } + + /** + * removeRules a businessRuleset using immutable params (executes immediately) - returns raw + * Response. + */ + Response removeRulesRaw(String businessRulesetId, BusinessRulesetRemoveRulesParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/remove_rules", + "business-ruleset-id", + businessRulesetId); + return post("businessRuleset", "removeRules", path, params.toFormData()); + } + + /** + * removeRules a businessRuleset using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response removeRulesRaw(String businessRulesetId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/remove_rules", + "business-ruleset-id", + businessRulesetId); + return postJson("businessRuleset", "removeRules", path, jsonPayload); + } + + public BusinessRulesetRemoveRulesResponse removeRules( + String businessRulesetId, BusinessRulesetRemoveRulesParams params) throws ChargebeeException { + Response response = removeRulesRaw(businessRulesetId, params); + return BusinessRulesetRemoveRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of removeRules for businessRuleset with params. */ + public CompletableFuture removeRulesAsync( + String businessRulesetId, BusinessRulesetRemoveRulesParams params) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/remove_rules", + "business-ruleset-id", + businessRulesetId); + return postAsync("businessRuleset", "removeRules", path, params.toFormData()) + .thenApply( + response -> + BusinessRulesetRemoveRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + public BusinessRulesetRemoveRulesResponse removeRules(String businessRulesetId) + throws ChargebeeException { + Response response = removeRulesRaw(businessRulesetId); + return BusinessRulesetRemoveRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of removeRules for businessRuleset without params. */ + public CompletableFuture removeRulesAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/remove_rules", + "business-ruleset-id", + businessRulesetId); + + return postAsync("businessRuleset", "removeRules", path, null) + .thenApply( + response -> + BusinessRulesetRemoveRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + /** delete a businessRuleset (executes immediately) - returns raw Response. */ + Response deleteRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/delete", + "business-ruleset-id", + businessRulesetId); + + return post("businessRuleset", "delete", path, null); + } + + public BusinessRulesetDeleteResponse delete(String businessRulesetId) throws ChargebeeException { + Response response = deleteRaw(businessRulesetId); + return BusinessRulesetDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of delete for businessRuleset without params. */ + public CompletableFuture deleteAsync(String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/delete", + "business-ruleset-id", + businessRulesetId); + + return postAsync("businessRuleset", "delete", path, null) + .thenApply( + response -> + BusinessRulesetDeleteResponse.fromJson(response.getBodyAsString(), response)); + } + + /** deactivate a businessRuleset (executes immediately) - returns raw Response. */ + Response deactivateRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/deactivate", + "business-ruleset-id", + businessRulesetId); + + return post("businessRuleset", "deactivate", path, null); + } + + public BusinessRulesetDeactivateResponse deactivate(String businessRulesetId) + throws ChargebeeException { + Response response = deactivateRaw(businessRulesetId); + return BusinessRulesetDeactivateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of deactivate for businessRuleset without params. */ + public CompletableFuture deactivateAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/deactivate", + "business-ruleset-id", + businessRulesetId); + + return postAsync("businessRuleset", "deactivate", path, null) + .thenApply( + response -> + BusinessRulesetDeactivateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** listRules a businessRuleset (executes immediately) - returns raw Response. */ + Response listRulesRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/rules", + "business-ruleset-id", + businessRulesetId); + + return get("businessRuleset", "listRules", path, null); + } + + /** + * listRules a businessRuleset using immutable params (executes immediately) - returns raw + * Response. + */ + Response listRulesRaw(String businessRulesetId, BusinessRulesetListRulesParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/rules", + "business-ruleset-id", + businessRulesetId); + return get( + "businessRuleset", "listRules", path, params != null ? params.toQueryParams() : null); + } + + public BusinessRulesetListRulesResponse listRules( + String businessRulesetId, BusinessRulesetListRulesParams params) throws ChargebeeException { + Response response = listRulesRaw(businessRulesetId, params); + return BusinessRulesetListRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of listRules for businessRuleset with params. */ + public CompletableFuture listRulesAsync( + String businessRulesetId, BusinessRulesetListRulesParams params) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/rules", + "business-ruleset-id", + businessRulesetId); + return getAsync( + "businessRuleset", "listRules", path, params != null ? params.toQueryParams() : null) + .thenApply( + response -> + BusinessRulesetListRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + public BusinessRulesetListRulesResponse listRules(String businessRulesetId) + throws ChargebeeException { + Response response = listRulesRaw(businessRulesetId); + return BusinessRulesetListRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of listRules for businessRuleset without params. */ + public CompletableFuture listRulesAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/rules", + "business-ruleset-id", + businessRulesetId); + + return getAsync("businessRuleset", "listRules", path, null) + .thenApply( + response -> + BusinessRulesetListRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + /** + * list a businessRuleset using immutable params (executes immediately) - returns raw Response. + */ + Response listRaw(BusinessRulesetListParams params) throws ChargebeeException { + + return get( + "businessRuleset", + "list", + "/business_rulesets", + params != null ? params.toQueryParams() : null); + } + + /** list a businessRuleset without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("businessRuleset", "list", "/business_rulesets", null); + } + + /** + * list a businessRuleset 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 BusinessRulesetListResponse list(BusinessRulesetListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return BusinessRulesetListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for businessRuleset with params. */ + public CompletableFuture listAsync( + BusinessRulesetListParams params) { + + return getAsync( + "businessRuleset", + "list", + "/business_rulesets", + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + BusinessRulesetListResponse.fromJson( + response.getBodyAsString(), this, params, response)); + } + + public BusinessRulesetListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return BusinessRulesetListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for businessRuleset without params. */ + public CompletableFuture listAsync() { + + return getAsync("businessRuleset", "list", "/business_rulesets", null) + .thenApply( + response -> + BusinessRulesetListResponse.fromJson( + response.getBodyAsString(), this, null, response)); + } + + /** + * create a businessRuleset using immutable params (executes immediately) - returns raw Response. + */ + Response createRaw(BusinessRulesetCreateParams params) throws ChargebeeException { + + return post( + "businessRuleset", + "create", + "/business_rulesets", + params != null ? params.toFormData() : null); + } + + /** + * create a businessRuleset using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("businessRuleset", "create", "/business_rulesets", jsonPayload); + } + + public BusinessRulesetCreateResponse create(BusinessRulesetCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return BusinessRulesetCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of create for businessRuleset with params. */ + public CompletableFuture createAsync( + BusinessRulesetCreateParams params) { + + return postAsync( + "businessRuleset", + "create", + "/business_rulesets", + params != null ? params.toFormData() : null) + .thenApply( + response -> + BusinessRulesetCreateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** activate a businessRuleset (executes immediately) - returns raw Response. */ + Response activateRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/activate", + "business-ruleset-id", + businessRulesetId); + + return post("businessRuleset", "activate", path, null); + } + + public BusinessRulesetActivateResponse activate(String businessRulesetId) + throws ChargebeeException { + Response response = activateRaw(businessRulesetId); + return BusinessRulesetActivateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of activate for businessRuleset without params. */ + public CompletableFuture activateAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/activate", + "business-ruleset-id", + businessRulesetId); + + return postAsync("businessRuleset", "activate", path, null) + .thenApply( + response -> + BusinessRulesetActivateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** addRules a businessRuleset (executes immediately) - returns raw Response. */ + Response addRulesRaw(String businessRulesetId) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/add_rules", + "business-ruleset-id", + businessRulesetId); + + return post("businessRuleset", "addRules", path, null); + } + + /** + * addRules a businessRuleset using immutable params (executes immediately) - returns raw + * Response. + */ + Response addRulesRaw(String businessRulesetId, BusinessRulesetAddRulesParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/add_rules", + "business-ruleset-id", + businessRulesetId); + return post("businessRuleset", "addRules", path, params.toFormData()); + } + + /** + * addRules a businessRuleset using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response addRulesRaw(String businessRulesetId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/add_rules", + "business-ruleset-id", + businessRulesetId); + return postJson("businessRuleset", "addRules", path, jsonPayload); + } + + public BusinessRulesetAddRulesResponse addRules( + String businessRulesetId, BusinessRulesetAddRulesParams params) throws ChargebeeException { + Response response = addRulesRaw(businessRulesetId, params); + return BusinessRulesetAddRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of addRules for businessRuleset with params. */ + public CompletableFuture addRulesAsync( + String businessRulesetId, BusinessRulesetAddRulesParams params) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/add_rules", + "business-ruleset-id", + businessRulesetId); + return postAsync("businessRuleset", "addRules", path, params.toFormData()) + .thenApply( + response -> + BusinessRulesetAddRulesResponse.fromJson(response.getBodyAsString(), response)); + } + + public BusinessRulesetAddRulesResponse addRules(String businessRulesetId) + throws ChargebeeException { + Response response = addRulesRaw(businessRulesetId); + return BusinessRulesetAddRulesResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of addRules for businessRuleset without params. */ + public CompletableFuture addRulesAsync( + String businessRulesetId) { + String path = + buildPathWithParams( + "/business_rulesets/{business-ruleset-id}/add_rules", + "business-ruleset-id", + businessRulesetId); + + return postAsync("businessRuleset", "addRules", path, null) + .thenApply( + response -> + BusinessRulesetAddRulesResponse.fromJson(response.getBodyAsString(), response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/CreditNoteService.java b/src/main/java/com/chargebee/v4/services/CreditNoteService.java index f96f372eb..e8a6c4fd2 100644 --- a/src/main/java/com/chargebee/v4/services/CreditNoteService.java +++ b/src/main/java/com/chargebee/v4/services/CreditNoteService.java @@ -67,6 +67,8 @@ import com.chargebee.v4.models.creditNote.responses.CreditNoteRetrieveResponse; +import com.chargebee.v4.models.creditNote.responses.CreditNoteSendEmailResponse; + public final class CreditNoteService extends BaseService { private final ServiceConfig config; @@ -867,4 +869,29 @@ public CompletableFuture retrieveAsync(String credit .thenApply( response -> CreditNoteRetrieveResponse.fromJson(response.getBodyAsString(), response)); } + + /** sendEmail a creditNote (executes immediately) - returns raw Response. */ + Response sendEmailRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/send_email", "credit-note-id", creditNoteId); + + return post("creditNote", "sendEmail", path, null); + } + + public CreditNoteSendEmailResponse sendEmail(String creditNoteId) throws ChargebeeException { + Response response = sendEmailRaw(creditNoteId); + return CreditNoteSendEmailResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of sendEmail for creditNote without params. */ + public CompletableFuture sendEmailAsync(String creditNoteId) { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/send_email", "credit-note-id", creditNoteId); + + return postAsync("creditNote", "sendEmail", path, null) + .thenApply( + response -> CreditNoteSendEmailResponse.fromJson(response.getBodyAsString(), response)); + } } diff --git a/src/main/java/com/chargebee/v4/services/CustomerService.java b/src/main/java/com/chargebee/v4/services/CustomerService.java index b8b888fc6..396f8c601 100644 --- a/src/main/java/com/chargebee/v4/services/CustomerService.java +++ b/src/main/java/com/chargebee/v4/services/CustomerService.java @@ -103,6 +103,8 @@ import com.chargebee.v4.models.customer.responses.CustomerRecordExcessPaymentResponse; +import com.chargebee.v4.models.customer.responses.CustomerSendPaymentRequestResponse; + import com.chargebee.v4.models.customer.responses.CustomerSetPromotionalCreditsResponse; import com.chargebee.v4.models.customer.responses.CustomerUpdateContactResponse; @@ -1231,6 +1233,34 @@ public CompletableFuture recordExcessPaymen CustomerRecordExcessPaymentResponse.fromJson(response.getBodyAsString(), response)); } + /** sendPaymentRequest a customer (executes immediately) - returns raw Response. */ + Response sendPaymentRequestRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams( + "/customers/{customer-id}/send_payment_request", "customer-id", customerId); + + return post("customer", "sendPaymentRequest", path, null); + } + + public CustomerSendPaymentRequestResponse sendPaymentRequest(String customerId) + throws ChargebeeException { + Response response = sendPaymentRequestRaw(customerId); + return CustomerSendPaymentRequestResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of sendPaymentRequest for customer without params. */ + public CompletableFuture sendPaymentRequestAsync( + String customerId) { + String path = + buildPathWithParams( + "/customers/{customer-id}/send_payment_request", "customer-id", customerId); + + return postAsync("customer", "sendPaymentRequest", path, null) + .thenApply( + response -> + CustomerSendPaymentRequestResponse.fromJson(response.getBodyAsString(), response)); + } + /** setPromotionalCredits a customer (executes immediately) - returns raw Response. */ Response setPromotionalCreditsRaw(String customerId) throws ChargebeeException { String path = diff --git a/src/main/java/com/chargebee/v4/services/DisputeService.java b/src/main/java/com/chargebee/v4/services/DisputeService.java new file mode 100644 index 000000000..61bee301f --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/DisputeService.java @@ -0,0 +1,124 @@ +/* + * 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.dispute.params.DisputeListParams; + +import com.chargebee.v4.models.dispute.responses.DisputeRetrieveResponse; + +import com.chargebee.v4.models.dispute.responses.DisputeListResponse; + +public final class DisputeService extends BaseService { + + private final ServiceConfig config; + + public DisputeService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private DisputeService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private DisputeService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + DisputeService with(RequestOptions newOptions) { + return new DisputeService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public DisputeService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a dispute (executes immediately) - returns raw Response. */ + Response retrieveRaw(String disputeId) throws ChargebeeException { + String path = buildPathWithParams("/disputes/{dispute-id}", "dispute-id", disputeId); + + return get("dispute", "retrieve", path, null); + } + + public DisputeRetrieveResponse retrieve(String disputeId) throws ChargebeeException { + Response response = retrieveRaw(disputeId); + return DisputeRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for dispute without params. */ + public CompletableFuture retrieveAsync(String disputeId) { + String path = buildPathWithParams("/disputes/{dispute-id}", "dispute-id", disputeId); + + return getAsync("dispute", "retrieve", path, null) + .thenApply( + response -> DisputeRetrieveResponse.fromJson(response.getBodyAsString(), response)); + } + + /** list a dispute using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(DisputeListParams params) throws ChargebeeException { + + return get("dispute", "list", "/disputes", params != null ? params.toQueryParams() : null); + } + + /** list a dispute without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("dispute", "list", "/disputes", null); + } + + /** list a dispute 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 DisputeListResponse list(DisputeListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return DisputeListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for dispute with params. */ + public CompletableFuture listAsync(DisputeListParams params) { + + return getAsync("dispute", "list", "/disputes", params != null ? params.toQueryParams() : null) + .thenApply( + response -> + DisputeListResponse.fromJson(response.getBodyAsString(), this, params, response)); + } + + public DisputeListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return DisputeListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for dispute without params. */ + public CompletableFuture listAsync() { + + return getAsync("dispute", "list", "/disputes", null) + .thenApply( + response -> + DisputeListResponse.fromJson(response.getBodyAsString(), this, null, response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/EinvoiceService.java b/src/main/java/com/chargebee/v4/services/EinvoiceService.java new file mode 100644 index 000000000..4319d30a4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/EinvoiceService.java @@ -0,0 +1,133 @@ +/* + * 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.einvoice.params.ListEinvoicesParams; + +import com.chargebee.v4.models.einvoice.responses.ListEinvoicesResponse; + +import com.chargebee.v4.models.einvoice.responses.EinvoiceRetrieveResponse; + +public final class EinvoiceService extends BaseService { + + private final ServiceConfig config; + + public EinvoiceService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private EinvoiceService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private EinvoiceService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + EinvoiceService with(RequestOptions newOptions) { + return new EinvoiceService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public EinvoiceService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * listEinvoices a einvoice using immutable params (executes immediately) - returns raw Response. + */ + Response listEinvoicesRaw(ListEinvoicesParams params) throws ChargebeeException { + + return get( + "einvoice", "listEinvoices", "/einvoices", params != null ? params.toQueryParams() : null); + } + + /** listEinvoices a einvoice without params (executes immediately) - returns raw Response. */ + Response listEinvoicesRaw() throws ChargebeeException { + + return get("einvoice", "listEinvoices", "/einvoices", null); + } + + /** + * listEinvoices a einvoice using raw JSON payload (executes immediately) - returns raw Response. + */ + Response listEinvoicesRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListEinvoicesResponse listEinvoices(ListEinvoicesParams params) throws ChargebeeException { + Response response = listEinvoicesRaw(params); + + return ListEinvoicesResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of listEinvoices for einvoice with params. */ + public CompletableFuture listEinvoicesAsync(ListEinvoicesParams params) { + + return getAsync( + "einvoice", + "listEinvoices", + "/einvoices", + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + ListEinvoicesResponse.fromJson(response.getBodyAsString(), this, params, response)); + } + + public ListEinvoicesResponse listEinvoices() throws ChargebeeException { + Response response = listEinvoicesRaw(); + + return ListEinvoicesResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of listEinvoices for einvoice without params. */ + public CompletableFuture listEinvoicesAsync() { + + return getAsync("einvoice", "listEinvoices", "/einvoices", null) + .thenApply( + response -> + ListEinvoicesResponse.fromJson(response.getBodyAsString(), this, null, response)); + } + + /** retrieve a einvoice (executes immediately) - returns raw Response. */ + Response retrieveRaw(String einvoiceId) throws ChargebeeException { + String path = buildPathWithParams("/einvoices/{einvoice-id}", "einvoice-id", einvoiceId); + + return get("einvoice", "retrieve", path, null); + } + + public EinvoiceRetrieveResponse retrieve(String einvoiceId) throws ChargebeeException { + Response response = retrieveRaw(einvoiceId); + return EinvoiceRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for einvoice without params. */ + public CompletableFuture retrieveAsync(String einvoiceId) { + String path = buildPathWithParams("/einvoices/{einvoice-id}", "einvoice-id", einvoiceId); + + return getAsync("einvoice", "retrieve", path, null) + .thenApply( + response -> EinvoiceRetrieveResponse.fromJson(response.getBodyAsString(), response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/EmailLogService.java b/src/main/java/com/chargebee/v4/services/EmailLogService.java new file mode 100644 index 000000000..5759746f2 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/EmailLogService.java @@ -0,0 +1,127 @@ +/* + * 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.emailLog.params.EmailLogsForCustomerParams; + +import com.chargebee.v4.models.emailLog.responses.EmailLogsForCustomerResponse; + +public final class EmailLogService extends BaseService { + + private final ServiceConfig config; + + public EmailLogService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private EmailLogService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private EmailLogService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + EmailLogService with(RequestOptions newOptions) { + return new EmailLogService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public EmailLogService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * emailLogsForCustomer a emailLog using immutable params (executes immediately) - returns raw + * Response. + */ + Response emailLogsForCustomerRaw(String customerId, EmailLogsForCustomerParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/email_logs", "customer-id", customerId); + return get( + "emailLog", "emailLogsForCustomer", path, params != null ? params.toQueryParams() : null); + } + + /** + * emailLogsForCustomer a emailLog without params (executes immediately) - returns raw Response. + */ + Response emailLogsForCustomerRaw(String customerId) throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/email_logs", "customer-id", customerId); + return get("emailLog", "emailLogsForCustomer", path, null); + } + + /** + * emailLogsForCustomer a emailLog using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response emailLogsForCustomerRaw(String customerId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams("/customers/{customer-id}/email_logs", "customer-id", customerId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public EmailLogsForCustomerResponse emailLogsForCustomer( + String customerId, EmailLogsForCustomerParams params) throws ChargebeeException { + Response response = emailLogsForCustomerRaw(customerId, params); + return EmailLogsForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response); + } + + public EmailLogsForCustomerResponse emailLogsForCustomer(String customerId) + throws ChargebeeException { + Response response = emailLogsForCustomerRaw(customerId); + return EmailLogsForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response); + } + + /** Async variant of emailLogsForCustomer for emailLog with params. */ + public CompletableFuture emailLogsForCustomerAsync( + String customerId, EmailLogsForCustomerParams params) { + String path = + buildPathWithParams("/customers/{customer-id}/email_logs", "customer-id", customerId); + return getAsync( + "emailLog", + "emailLogsForCustomer", + path, + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + EmailLogsForCustomerResponse.fromJson( + response.getBodyAsString(), this, params, customerId, response)); + } + + /** Async variant of emailLogsForCustomer for emailLog without params. */ + public CompletableFuture emailLogsForCustomerAsync( + String customerId) { + String path = + buildPathWithParams("/customers/{customer-id}/email_logs", "customer-id", customerId); + return getAsync("emailLog", "emailLogsForCustomer", path, null) + .thenApply( + response -> + EmailLogsForCustomerResponse.fromJson( + response.getBodyAsString(), this, null, customerId, response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/InvoiceService.java b/src/main/java/com/chargebee/v4/services/InvoiceService.java index c1651d181..695af9ba1 100644 --- a/src/main/java/com/chargebee/v4/services/InvoiceService.java +++ b/src/main/java/com/chargebee/v4/services/InvoiceService.java @@ -123,6 +123,8 @@ import com.chargebee.v4.models.invoice.responses.InvoiceApplyCreditsResponse; +import com.chargebee.v4.models.invoice.responses.InvoiceSendEmailResponse; + import com.chargebee.v4.models.invoice.responses.InvoiceRetrieveResponse; import com.chargebee.v4.models.invoice.responses.InvoiceCreateForChargeItemResponse; @@ -1078,6 +1080,27 @@ public CompletableFuture applyCreditsAsync(String i response -> InvoiceApplyCreditsResponse.fromJson(response.getBodyAsString(), response)); } + /** sendEmail a invoice (executes immediately) - returns raw Response. */ + Response sendEmailRaw(String invoiceId) throws ChargebeeException { + String path = buildPathWithParams("/invoices/{invoice-id}/send_email", "invoice-id", invoiceId); + + return post("invoice", "sendEmail", path, null); + } + + public InvoiceSendEmailResponse sendEmail(String invoiceId) throws ChargebeeException { + Response response = sendEmailRaw(invoiceId); + return InvoiceSendEmailResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of sendEmail for invoice without params. */ + public CompletableFuture sendEmailAsync(String invoiceId) { + String path = buildPathWithParams("/invoices/{invoice-id}/send_email", "invoice-id", invoiceId); + + return postAsync("invoice", "sendEmail", path, null) + .thenApply( + response -> InvoiceSendEmailResponse.fromJson(response.getBodyAsString(), response)); + } + /** retrieve a invoice (executes immediately) - returns raw Response. */ Response retrieveRaw(String invoiceId) throws ChargebeeException { String path = buildPathWithParams("/invoices/{invoice-id}", "invoice-id", invoiceId); diff --git a/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java b/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java index a719cf3cf..27dcc48a9 100644 --- a/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java +++ b/src/main/java/com/chargebee/v4/services/PaymentScheduleSchemeService.java @@ -13,10 +13,14 @@ import com.chargebee.v4.transport.Response; import java.util.concurrent.CompletableFuture; +import com.chargebee.v4.models.paymentScheduleScheme.params.PaymentScheduleSchemeListParams; + import com.chargebee.v4.models.paymentScheduleScheme.params.PaymentScheduleSchemeCreateParams; import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeRetrieveResponse; +import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeListResponse; + import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeCreateResponse; import com.chargebee.v4.models.paymentScheduleScheme.responses.PaymentScheduleSchemeDeleteResponse; @@ -89,6 +93,74 @@ public CompletableFuture retrieveAsync( response.getBodyAsString(), response)); } + /** + * list a paymentScheduleScheme using immutable params (executes immediately) - returns raw + * Response. + */ + Response listRaw(PaymentScheduleSchemeListParams params) throws ChargebeeException { + + return get( + "paymentScheduleScheme", + "list", + "/payment_schedule_schemes", + params != null ? params.toQueryParams() : null); + } + + /** list a paymentScheduleScheme without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("paymentScheduleScheme", "list", "/payment_schedule_schemes", null); + } + + /** + * list a paymentScheduleScheme 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 PaymentScheduleSchemeListResponse list(PaymentScheduleSchemeListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return PaymentScheduleSchemeListResponse.fromJson( + response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for paymentScheduleScheme with params. */ + public CompletableFuture listAsync( + PaymentScheduleSchemeListParams params) { + + return getAsync( + "paymentScheduleScheme", + "list", + "/payment_schedule_schemes", + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + PaymentScheduleSchemeListResponse.fromJson( + response.getBodyAsString(), this, params, response)); + } + + public PaymentScheduleSchemeListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return PaymentScheduleSchemeListResponse.fromJson( + response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for paymentScheduleScheme without params. */ + public CompletableFuture listAsync() { + + return getAsync("paymentScheduleScheme", "list", "/payment_schedule_schemes", null) + .thenApply( + response -> + PaymentScheduleSchemeListResponse.fromJson( + response.getBodyAsString(), this, null, response)); + } + /** * create a paymentScheduleScheme using immutable params (executes immediately) - returns raw * Response. diff --git a/src/main/java/com/chargebee/v4/services/PaymentScheduleService.java b/src/main/java/com/chargebee/v4/services/PaymentScheduleService.java new file mode 100644 index 000000000..762467150 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/PaymentScheduleService.java @@ -0,0 +1,118 @@ +/* + * 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.paymentSchedule.params.PaymentScheduleListParams; + +import com.chargebee.v4.models.paymentSchedule.responses.PaymentScheduleListResponse; + +public final class PaymentScheduleService extends BaseService { + + private final ServiceConfig config; + + public PaymentScheduleService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentScheduleService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private PaymentScheduleService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + PaymentScheduleService with(RequestOptions newOptions) { + return new PaymentScheduleService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public PaymentScheduleService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * list a paymentSchedule using immutable params (executes immediately) - returns raw Response. + */ + Response listRaw(PaymentScheduleListParams params) throws ChargebeeException { + + return get( + "paymentSchedule", + "list", + "/payment_schedules", + params != null ? params.toQueryParams() : null); + } + + /** list a paymentSchedule without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("paymentSchedule", "list", "/payment_schedules", null); + } + + /** + * list a paymentSchedule 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 PaymentScheduleListResponse list(PaymentScheduleListParams params) + throws ChargebeeException { + Response response = listRaw(params); + + return PaymentScheduleListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for paymentSchedule with params. */ + public CompletableFuture listAsync( + PaymentScheduleListParams params) { + + return getAsync( + "paymentSchedule", + "list", + "/payment_schedules", + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + PaymentScheduleListResponse.fromJson( + response.getBodyAsString(), this, params, response)); + } + + public PaymentScheduleListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return PaymentScheduleListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for paymentSchedule without params. */ + public CompletableFuture listAsync() { + + return getAsync("paymentSchedule", "list", "/payment_schedules", null) + .thenApply( + response -> + PaymentScheduleListResponse.fromJson( + response.getBodyAsString(), this, null, response)); + } +} diff --git a/src/main/java/com/chargebee/v4/telemetry/SdkTelemetryState.java b/src/main/java/com/chargebee/v4/telemetry/SdkTelemetryState.java index 87cf04664..fdec15839 100644 --- a/src/main/java/com/chargebee/v4/telemetry/SdkTelemetryState.java +++ b/src/main/java/com/chargebee/v4/telemetry/SdkTelemetryState.java @@ -9,9 +9,7 @@ import java.util.concurrent.atomic.AtomicBoolean; -/** - * Per-client gate so the SDK telemetry header is considered at most once per client instance. - */ +/** Per-client gate so the SDK telemetry header is considered at most once per client instance. */ public final class SdkTelemetryState { private final AtomicBoolean emitted = new AtomicBoolean(false); diff --git a/src/main/java/com/chargebee/v4/telemetry/TelemetryExecutor.java b/src/main/java/com/chargebee/v4/telemetry/TelemetryExecutor.java index 4d5afa933..4d7d8ef8b 100644 --- a/src/main/java/com/chargebee/v4/telemetry/TelemetryExecutor.java +++ b/src/main/java/com/chargebee/v4/telemetry/TelemetryExecutor.java @@ -20,8 +20,8 @@ * *
    *
  • {@link SdkTelemetryEmitter} — the anonymous {@code x-chargebee-sdk-telemetry} request - * header Chargebee uses to track SDK adoption. Enabled by default, opt out with {@link - * com.chargebee.v4.client.ChargebeeClient.Builder#sdkTelemetryEnabled(boolean)}. + * header Chargebee uses to track SDK adoption. Enabled by default, opt out with {@code + * ChargebeeClient.Builder#sdkTelemetryEnabled(boolean)}. *
  • {@link TelemetryAdapterExecutor} — the customer's own {@link TelemetryAdapter}, which turns * calls into spans in their observability stack. Off unless an adapter is supplied. *