From fa13920a2d019d531313cf210c3e85868981241a Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Wed, 12 Aug 2026 11:51:18 +0000 Subject: [PATCH] Releasing v4.15.0 --- CHANGELOG.md | 51 +++ VERSION | 2 +- build.gradle.kts | 2 +- .../chargebee/v4/client/ClientMethods.java | 9 + .../v4/client/ClientMethodsImpl.java | 7 + .../chargebee/v4/client/ServiceRegistry.java | 19 ++ .../params/CreditNoteUpdateParams.java | 112 +++++++ .../responses/CreditNoteUpdateResponse.java | 99 ++++++ .../params/CreditUnitListParams.java | 20 +- .../params/EntitlementListParams.java | 20 +- .../com/chargebee/v4/models/event/Event.java | 8 + ...hannelSubscriptionItemMrrUpdatedEvent.java | 227 +++++++++++++ .../models/event/VaultTokenCreatedEvent.java | 184 ++++++++++ .../models/event/VaultTokenDeletedEvent.java | 184 ++++++++++ .../models/event/VaultTokenUpdatedEvent.java | 184 ++++++++++ .../models/event/params/EventListParams.java | 40 +++ .../export/params/ExportRampsParams.java | 231 +++++++++++++ .../export/responses/ExportRampsResponse.java | 96 ++++++ .../GatewayPaymentMethodToken.java | 314 ++++++++++++++++++ .../params/ListLedgerOperationsParams.java | 20 +- .../OmnichannelSubscriptionItemMetric.java | 173 ++++++++++ .../models/paymentIntent/PaymentIntent.java | 20 +- .../models/paymentSource/PaymentSource.java | 15 + ...stGatewayTokensForPaymentSourceParams.java | 67 ++++ ...GatewayTokensForPaymentSourceResponse.java | 240 +++++++++++++ ...bscriptionItemsForCustomerQuoteParams.java | 20 ++ ...bscriptionCustomerQuoteForItemsParams.java | 20 ++ ...UpdateSubscriptionQuoteForItemsParams.java | 20 ++ ...UpdateSubscriptionQuoteForItemsParams.java | 20 ++ .../v4/models/quotedRamp/QuotedRamp.java | 15 +- .../v4/models/ramp/params/RampListParams.java | 20 +- .../VaultedPaymentMethod.java | 100 ++++++ .../VaultedPaymentMethodRetrieveParams.java | 50 +++ .../VaultedPaymentMethodRetrieveResponse.java | 104 ++++++ .../v4/services/CreditNoteService.java | 62 ++++ .../chargebee/v4/services/ExportService.java | 30 ++ .../v4/services/PaymentSourceService.java | 101 ++++++ .../services/VaultedPaymentMethodService.java | 85 +++++ 38 files changed, 2933 insertions(+), 58 deletions(-) create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemMrrUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java create mode 100644 src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java create mode 100644 src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java diff --git a/CHANGELOG.md b/CHANGELOG.md index b75cd9518..873fa0623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +### v4.15.0 (2026-08-12) +* * * +### New Resources: +- [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens) has been added. +- [`OmnichannelSubscriptionItemMetric`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_item_metrics) has been added. +- [`VaultedPaymentMethod`](https://apidocs.chargebee.com/docs/api/vaulted_payment_methods) has been added. + + +### New Actions: +- [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) has been added to [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Attributes: +- [`vault_token`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#vault_token) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Parameters: +- [`updated_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`updated_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#limit) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#offset) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`include_deleted`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#include_deleted) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`comment`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details#comment) has been added as request body parameter to [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`ramp`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#ramp) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`export_type`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#export_type) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Events: +- [`vault_token_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_updated) has been added. +- [`vault_token_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_deleted) has been added. +- [`omnichannel_subscription_item_mrr_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_mrr_updated) has been added. +- [`vault_token_created`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_created) has been added. + + +### New Enums: +- `omnichannel_subscription_item_metric` has been added as a new value enum `EntityType`. +- `omnichannel_subscription_item_mrr_updated`, `vault_token_created`, `vault_token_updated`, and `vault_token_deleted` have been added as new values enum `EventType`. +- `chargebee`, `chargebee_payments`, `adyen`, `stripe`, `wepay`, `braintree`, `authorize_net`, `paypal_pro`, `pin`, `eway`, `eway_rapid`, `worldpay`, `balanced_payments`, `beanstream`, `bluepay`, `elavon`, `first_data_global`, `hdfc`, `migs`, `nmi`, `ogone`, `paymill`, `paypal_payflow_pro`, `sage_pay`, `tco`, `wirecard`, `amazon_payments`, `paypal_express_checkout`, `gocardless`, `orbital`, `moneris_us`, `moneris`, `bluesnap`, `cybersource`, `vantiv`, `checkout_com`, `paypal`, `ingenico_direct`, `exact`, `mollie`, `quickbooks`, `razorpay`, `global_payments`, `bank_of_america`, `ecentric`, `metrics_global`, `windcave`, `pay_com`, `ebanx`, `dlocal`, `nuvei`, `solidgate`, `paystack`, `jp_morgan`, `deutsche_bank`, `ezidebit`, `twikey`, `tempus`, `moyasar`, `payway`, and `not_applicable` have been added as new values enum `GatewayName`. +- `active`, `inactive`, and `pending_verification` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens/gateway-payment-method-token-object#status) in [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens). +- `payment_method_helper`, `card_components`, `checkout`, `collect_now`, `portal`, and `payment_components` have been added as new values to enum attribute [`payment_intent_metadata.source`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata_source) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). + + + ### v4.14.0 (2026-07-30) * * * ### New Resources: diff --git a/VERSION b/VERSION index c412a4e2e..5c517bf11 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.14.0 +4.15.0 diff --git a/build.gradle.kts b/build.gradle.kts index 93b25bad6..7613af0c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.14.0" +version = "4.15.0" description = "Java client library for ChargeBee" // Project metadata diff --git a/src/main/java/com/chargebee/v4/client/ClientMethods.java b/src/main/java/com/chargebee/v4/client/ClientMethods.java index 5e3d1a5b2..ba9515f8c 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -164,6 +164,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -764,6 +766,13 @@ public interface ClientMethods { */ ThirdPartyEntityMappingService thirdPartyEntityMappings(); + /** + * Access vaulted_payment_method-related operations. + * + * @return VaultedPaymentMethodService instance for fluent API access + */ + VaultedPaymentMethodService vaultedPaymentMethods(); + /** * Access usage_charge-related operations. * diff --git a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java index 633024cdf..606e22889 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -164,6 +164,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -602,6 +604,11 @@ public ThirdPartyEntityMappingService thirdPartyEntityMappings() { return getServiceRegistry().thirdPartyEntityMappings(); } + @Override + public VaultedPaymentMethodService vaultedPaymentMethods() { + return getServiceRegistry().vaultedPaymentMethods(); + } + @Override public UsageChargeService usageCharges() { return getServiceRegistry().usageCharges(); diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index f5c0928c4..825e7c2f3 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -164,6 +164,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -355,6 +357,8 @@ final class ServiceRegistry { private volatile ThirdPartyEntityMappingService thirdPartyEntityMappingService; + private volatile VaultedPaymentMethodService vaultedPaymentMethodService; + private volatile UsageChargeService usageChargeService; private volatile EntitlementOverrideService entitlementOverrideService; @@ -1609,6 +1613,21 @@ ThirdPartyEntityMappingService thirdPartyEntityMappings() { return thirdPartyEntityMappingService; } + /** + * Get or create the VaultedPaymentMethodService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + VaultedPaymentMethodService vaultedPaymentMethods() { + if (vaultedPaymentMethodService == null) { + synchronized (this) { + if (vaultedPaymentMethodService == null) { + vaultedPaymentMethodService = new VaultedPaymentMethodService(client); + } + } + } + return vaultedPaymentMethodService; + } + /** * Get or create the UsageChargeService instance. Thread-safe lazy initialization using * double-checked locking. diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java new file mode 100644 index 000000000..2b6c5eb41 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java @@ -0,0 +1,112 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteUpdateParams { + + private final String comment; + + private final Map customFields; + + private CreditNoteUpdateParams(CreditNoteUpdateBuilder builder) { + + this.comment = builder.comment; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getComment() { + return comment; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for CreditNoteUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteUpdateBuilder builder() { + return new CreditNoteUpdateBuilder(); + } + + public static final class CreditNoteUpdateBuilder { + + private String comment; + + private Map customFields = new LinkedHashMap<>(); + + private CreditNoteUpdateBuilder() {} + + public CreditNoteUpdateBuilder comment(String value) { + this.comment = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public CreditNoteUpdateBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public CreditNoteUpdateBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CreditNoteUpdateParams build() { + return new CreditNoteUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java new file mode 100644 index 000000000..2a7f4d881 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreditNoteUpdate operation. Contains the response data from the + * API. + */ +public final class CreditNoteUpdateResponse extends BaseResponse { + private final CreditNote creditNote; + + private CreditNoteUpdateResponse(Builder builder) { + super(builder.httpResponse); + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into CreditNoteUpdateResponse object. */ + public static CreditNoteUpdateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreditNoteUpdateResponse object with HTTP response. */ + public static CreditNoteUpdateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __creditNoteObj = JsonUtil.getJsonObject(jsonObj, "credit_note"); + if (__creditNoteObj != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNoteUpdateResponse from JSON", e); + } + } + + /** Create a new builder for CreditNoteUpdateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreditNoteUpdateResponse. */ + public static class Builder { + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreditNoteUpdateResponse build() { + return new CreditNoteUpdateResponse(this); + } + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } + + @Override + public String toString() { + return "CreditNoteUpdateResponse{" + "creditNote=" + creditNote + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CreditNoteUpdateResponse that = (CreditNoteUpdateResponse) o; + return java.util.Objects.equals(creditNote, that.creditNote); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(creditNote); + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java b/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java index 2bec3c69b..b5925e62e 100644 --- a/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java +++ b/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java @@ -132,16 +132,16 @@ public static final class IdFilter extends StringFilter { } } - public enum StatusIn { + public enum StatusIs { ACTIVE("active"), ARCHIVED("archived"), - /** An enum member indicating that StatusIn was instantiated with an unknown value. */ + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIn(String value) { + StatusIs(String value) { this.value = value; } @@ -149,9 +149,9 @@ public String getValue() { return value; } - public static StatusIn fromString(String value) { + public static StatusIs fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIn enumValue : StatusIn.values()) { + for (StatusIs enumValue : StatusIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -160,16 +160,16 @@ public static StatusIn fromString(String value) { } } - public enum StatusIs { + public enum StatusIn { ACTIVE("active"), ARCHIVED("archived"), - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + /** An enum member indicating that StatusIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIs(String value) { + StatusIn(String value) { this.value = value; } @@ -177,9 +177,9 @@ public String getValue() { return value; } - public static StatusIs fromString(String value) { + public static StatusIn fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { + for (StatusIn enumValue : StatusIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java index 22469fb15..b10179b6d 100644 --- a/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java @@ -157,7 +157,7 @@ public static final class EntityIdFilter extends StringFilter map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static OmnichannelSubscriptionItemMrrUpdatedEvent fromJson(JsonObject jsonObj) { + OmnichannelSubscriptionItemMrrUpdatedEvent obj = + new OmnichannelSubscriptionItemMrrUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "OmnichannelSubscriptionItemMrrUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + OmnichannelSubscriptionItemMrrUpdatedEvent that = + (OmnichannelSubscriptionItemMrrUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private OmnichannelSubscriptionItem omnichannelSubscriptionItem; + private OmnichannelSubscription omnichannelSubscription; + private OmnichannelSubscriptionItemMetric omnichannelSubscriptionItemMetric; + + public OmnichannelSubscriptionItem getOmnichannelSubscriptionItem() { + return omnichannelSubscriptionItem; + } + + public OmnichannelSubscription getOmnichannelSubscription() { + return omnichannelSubscription; + } + + public OmnichannelSubscriptionItemMetric getOmnichannelSubscriptionItemMetric() { + return omnichannelSubscriptionItemMetric; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __omnichannelSubscriptionItemObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription_item"); + if (__omnichannelSubscriptionItemObj != null) { + obj.omnichannelSubscriptionItem = + OmnichannelSubscriptionItem.fromJson(__omnichannelSubscriptionItemObj); + } + + JsonObject __omnichannelSubscriptionObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription"); + if (__omnichannelSubscriptionObj != null) { + obj.omnichannelSubscription = + OmnichannelSubscription.fromJson(__omnichannelSubscriptionObj); + } + + JsonObject __omnichannelSubscriptionItemMetricObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription_item_metric"); + if (__omnichannelSubscriptionItemMetricObj != null) { + obj.omnichannelSubscriptionItemMetric = + OmnichannelSubscriptionItemMetric.fromJson(__omnichannelSubscriptionItemMetricObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + + "omnichannelSubscriptionItem=" + + omnichannelSubscriptionItem + + ", omnichannelSubscription=" + + omnichannelSubscription + + ", omnichannelSubscriptionItemMetric=" + + omnichannelSubscriptionItemMetric + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(omnichannelSubscriptionItem, that.omnichannelSubscriptionItem) + && java.util.Objects.equals(omnichannelSubscription, that.omnichannelSubscription) + && java.util.Objects.equals( + omnichannelSubscriptionItemMetric, that.omnichannelSubscriptionItemMetric); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + omnichannelSubscriptionItem, omnichannelSubscription, omnichannelSubscriptionItemMetric); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java new file mode 100644 index 000000000..bf8cfc99e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenCreatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenCreatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenCreatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenCreatedEvent fromJson(JsonObject jsonObj) { + VaultTokenCreatedEvent obj = new VaultTokenCreatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenCreatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenCreatedEvent that = (VaultTokenCreatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java new file mode 100644 index 000000000..54fa5c182 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenDeletedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenDeletedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenDeletedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenDeletedEvent fromJson(JsonObject jsonObj) { + VaultTokenDeletedEvent obj = new VaultTokenDeletedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenDeletedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenDeletedEvent that = (VaultTokenDeletedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java new file mode 100644 index 000000000..070e86d07 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenUpdatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenUpdatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenUpdatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenUpdatedEvent fromJson(JsonObject jsonObj) { + VaultTokenUpdatedEvent obj = new VaultTokenUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenUpdatedEvent that = (VaultTokenUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java index b9909a75a..f817e0bb7 100644 --- a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java +++ b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java @@ -944,6 +944,8 @@ public enum EventTypeIs { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -952,6 +954,12 @@ public enum EventTypeIs { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1430,6 +1438,8 @@ public enum EventTypeIsNot { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -1438,6 +1448,12 @@ public enum EventTypeIsNot { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1916,6 +1932,8 @@ public enum EventTypeIn { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -1924,6 +1942,12 @@ public enum EventTypeIn { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2402,6 +2426,8 @@ public enum EventTypeNotIn { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -2410,6 +2436,12 @@ public enum EventTypeNotIn { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3166,6 +3198,8 @@ public enum EventType { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -3174,6 +3208,12 @@ public enum EventType { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java new file mode 100644 index 000000000..4b1224987 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java @@ -0,0 +1,231 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.export.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportRampsParams { + + private final ExportType exportType; + + private final RampParams ramp; + + private ExportRampsParams(ExportRampsBuilder builder) { + + this.exportType = builder.exportType; + + this.ramp = builder.ramp; + } + + public ExportType getExportType() { + return exportType; + } + + public RampParams getRamp() { + return ramp; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.exportType != null) { + + formData.put("export_type", this.exportType); + } + + if (this.ramp != null) { + + // Single object + Map nestedData = this.ramp.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "ramp[" + key.replace("[", "][") : "ramp[" + key + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportRampsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportRampsBuilder builder() { + return new ExportRampsBuilder(); + } + + public static final class ExportRampsBuilder { + + private ExportType exportType; + + private RampParams ramp; + + private ExportRampsBuilder() {} + + public ExportRampsBuilder exportType(ExportType value) { + this.exportType = value; + return this; + } + + public ExportRampsBuilder ramp(RampParams value) { + this.ramp = value; + return this; + } + + public ExportRampsParams build() { + return new ExportRampsParams(this); + } + } + + public enum ExportType { + DATA("data"), + + IMPORT_FRIENDLY_DATA("import_friendly_data"), + + /** An enum member indicating that ExportType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExportType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExportType enumValue : ExportType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class RampParams { + + private final Map filterParams; + + private RampParams(RampBuilder builder) { + + this.filterParams = + builder.filterParams.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.filterParams)); + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + // Add filter params + formData.putAll(filterParams); + + return formData; + } + + /** Create a new builder for RampParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RampBuilder builder() { + return new RampBuilder(); + } + + public static final class RampBuilder { + + private final Map filterParams = new LinkedHashMap<>(); + + private RampBuilder() {} + + public StatusFilter status() { + return new StatusFilter("status", this, filterParams); + } + + public SubscriptionIdFilter subscriptionId() { + return new SubscriptionIdFilter("subscription_id", this, filterParams); + } + + public EffectiveFromFilter effectiveFrom() { + return new EffectiveFromFilter("effective_from", this, filterParams); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this, filterParams); + } + + public RampParams build() { + return new RampParams(this); + } + + public static final class StatusFilter extends EnumFilter { + StatusFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params, Status::getValue); + } + } + + public static final class SubscriptionIdFilter extends StringFilter { + SubscriptionIdFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class EffectiveFromFilter extends TimestampFilter { + EffectiveFromFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class UpdatedAtFilter extends TimestampFilter { + UpdatedAtFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } + + public enum Status { + SCHEDULED("scheduled"), + + SUCCEEDED("succeeded"), + + FAILED("failed"), + + DRAFT("draft"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java new file mode 100644 index 000000000..0ed4618a7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java @@ -0,0 +1,96 @@ +package com.chargebee.v4.models.export.responses; + +import com.chargebee.v4.models.export.Export; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for ExportRamps operation. Contains the response data from the API. */ +public final class ExportRampsResponse extends BaseResponse { + private final Export export; + + private ExportRampsResponse(Builder builder) { + super(builder.httpResponse); + + this.export = builder.export; + } + + /** Parse JSON response into ExportRampsResponse object. */ + public static ExportRampsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ExportRampsResponse object with HTTP response. */ + public static ExportRampsResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __exportObj = JsonUtil.getJsonObject(jsonObj, "export"); + if (__exportObj != null) { + builder.export(Export.fromJson(__exportObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ExportRampsResponse from JSON", e); + } + } + + /** Create a new builder for ExportRampsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ExportRampsResponse. */ + public static class Builder { + + private Export export; + + private Response httpResponse; + + private Builder() {} + + public Builder export(Export export) { + this.export = export; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ExportRampsResponse build() { + return new ExportRampsResponse(this); + } + } + + /** Get the export from the response. */ + public Export getExport() { + return export; + } + + @Override + public String toString() { + return "ExportRampsResponse{" + "export=" + export + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ExportRampsResponse that = (ExportRampsResponse) o; + return java.util.Objects.equals(export, that.export); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(export); + } +} diff --git a/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java new file mode 100644 index 000000000..b7b774880 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java @@ -0,0 +1,314 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.gatewayPaymentMethodToken; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class GatewayPaymentMethodToken { + + private String id; + private String gatewayAccountId; + private GatewayName gatewayName; + private String gatewayCustomerId; + private String gatewayToken; + private Status status; + private Timestamp createdAt; + private Timestamp updatedAt; + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public GatewayName getGatewayName() { + return gatewayName; + } + + public String getGatewayCustomerId() { + return gatewayCustomerId; + } + + public String getGatewayToken() { + return gatewayToken; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public enum GatewayName { + CHARGEBEE("chargebee"), + + CHARGEBEE_PAYMENTS("chargebee_payments"), + + ADYEN("adyen"), + + STRIPE("stripe"), + + WEPAY("wepay"), + + BRAINTREE("braintree"), + + AUTHORIZE_NET("authorize_net"), + + PAYPAL_PRO("paypal_pro"), + + PIN("pin"), + + EWAY("eway"), + + EWAY_RAPID("eway_rapid"), + + WORLDPAY("worldpay"), + + BALANCED_PAYMENTS("balanced_payments"), + + BEANSTREAM("beanstream"), + + BLUEPAY("bluepay"), + + ELAVON("elavon"), + + FIRST_DATA_GLOBAL("first_data_global"), + + HDFC("hdfc"), + + MIGS("migs"), + + NMI("nmi"), + + OGONE("ogone"), + + PAYMILL("paymill"), + + PAYPAL_PAYFLOW_PRO("paypal_payflow_pro"), + + SAGE_PAY("sage_pay"), + + TCO("tco"), + + WIRECARD("wirecard"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + GOCARDLESS("gocardless"), + + ORBITAL("orbital"), + + MONERIS_US("moneris_us"), + + MONERIS("moneris"), + + BLUESNAP("bluesnap"), + + CYBERSOURCE("cybersource"), + + VANTIV("vantiv"), + + CHECKOUT_COM("checkout_com"), + + PAYPAL("paypal"), + + INGENICO_DIRECT("ingenico_direct"), + + EXACT("exact"), + + MOLLIE("mollie"), + + QUICKBOOKS("quickbooks"), + + RAZORPAY("razorpay"), + + GLOBAL_PAYMENTS("global_payments"), + + BANK_OF_AMERICA("bank_of_america"), + + ECENTRIC("ecentric"), + + METRICS_GLOBAL("metrics_global"), + + WINDCAVE("windcave"), + + PAY_COM("pay_com"), + + EBANX("ebanx"), + + DLOCAL("dlocal"), + + NUVEI("nuvei"), + + SOLIDGATE("solidgate"), + + PAYSTACK("paystack"), + + JP_MORGAN("jp_morgan"), + + DEUTSCHE_BANK("deutsche_bank"), + + EZIDEBIT("ezidebit"), + + TWIKEY("twikey"), + + TEMPUS("tempus"), + + MOYASAR("moyasar"), + + PAYWAY("payway"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that GatewayName was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + GatewayName(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static GatewayName fromString(String value) { + if (value == null) return _UNKNOWN; + for (GatewayName enumValue : GatewayName.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + PENDING_VERIFICATION("pending_verification"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static GatewayPaymentMethodToken fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static GatewayPaymentMethodToken fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static GatewayPaymentMethodToken fromJson(JsonObject jsonObj) { + GatewayPaymentMethodToken obj = new GatewayPaymentMethodToken(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.gatewayAccountId = JsonUtil.getString(jsonObj, "gateway_account_id"); + + obj.gatewayName = GatewayName.fromString(JsonUtil.getString(jsonObj, "gateway_name")); + + obj.gatewayCustomerId = JsonUtil.getString(jsonObj, "gateway_customer_id"); + + obj.gatewayToken = JsonUtil.getString(jsonObj, "gateway_token"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + return obj; + } + + @Override + public String toString() { + return "GatewayPaymentMethodToken{" + + "id=" + + id + + ", gatewayAccountId=" + + gatewayAccountId + + ", gatewayName=" + + gatewayName + + ", gatewayCustomerId=" + + gatewayCustomerId + + ", gatewayToken=" + + gatewayToken + + ", status=" + + status + + ", createdAt=" + + createdAt + + ", updatedAt=" + + updatedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + GatewayPaymentMethodToken that = (GatewayPaymentMethodToken) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) + && java.util.Objects.equals(gatewayName, that.gatewayName) + && java.util.Objects.equals(gatewayCustomerId, that.gatewayCustomerId) + && java.util.Objects.equals(gatewayToken, that.gatewayToken) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(updatedAt, that.updatedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + gatewayAccountId, + gatewayName, + gatewayCustomerId, + gatewayToken, + status, + createdAt, + updatedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java index 4816665c8..5de0838d7 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java @@ -198,7 +198,7 @@ public ListLedgerOperationsBuilder desc() { } } - public enum TypeIn { + public enum TypeIs { ALLOCATION("allocation"), CAPTURE("capture"), @@ -217,11 +217,11 @@ public enum TypeIn { ADJUSTMENT("adjustment"), - /** An enum member indicating that TypeIn was instantiated with an unknown value. */ + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - TypeIn(String value) { + TypeIs(String value) { this.value = value; } @@ -229,9 +229,9 @@ public String getValue() { return value; } - public static TypeIn fromString(String value) { + public static TypeIs fromString(String value) { if (value == null) return _UNKNOWN; - for (TypeIn enumValue : TypeIn.values()) { + for (TypeIs enumValue : TypeIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -240,7 +240,7 @@ public static TypeIn fromString(String value) { } } - public enum TypeIs { + public enum TypeIn { ALLOCATION("allocation"), CAPTURE("capture"), @@ -259,11 +259,11 @@ public enum TypeIs { ADJUSTMENT("adjustment"), - /** An enum member indicating that TypeIs was instantiated with an unknown value. */ + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - TypeIs(String value) { + TypeIn(String value) { this.value = value; } @@ -271,9 +271,9 @@ public String getValue() { return value; } - public static TypeIs fromString(String value) { + public static TypeIn fromString(String value) { if (value == null) return _UNKNOWN; - for (TypeIs enumValue : TypeIs.values()) { + for (TypeIn enumValue : TypeIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java new file mode 100644 index 000000000..1428a9520 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java @@ -0,0 +1,173 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.omnichannelSubscriptionItemMetric; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class OmnichannelSubscriptionItemMetric { + + private String customerId; + private String omnichannelSubscriptionId; + private String omnichannelSubscriptionItemId; + private String itemIdAtSource; + private String mrrCurrency; + private Long mrrUnits; + private Long mrrNanos; + private Timestamp effectiveFrom; + private Timestamp calculatedAt; + private Timestamp createdAt; + private Long resourceVersion; + + public String getCustomerId() { + return customerId; + } + + public String getOmnichannelSubscriptionId() { + return omnichannelSubscriptionId; + } + + public String getOmnichannelSubscriptionItemId() { + return omnichannelSubscriptionItemId; + } + + public String getItemIdAtSource() { + return itemIdAtSource; + } + + public String getMrrCurrency() { + return mrrCurrency; + } + + public Long getMrrUnits() { + return mrrUnits; + } + + public Long getMrrNanos() { + return mrrNanos; + } + + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + + public Timestamp getCalculatedAt() { + return calculatedAt; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public static OmnichannelSubscriptionItemMetric fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static OmnichannelSubscriptionItemMetric fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static OmnichannelSubscriptionItemMetric fromJson(JsonObject jsonObj) { + OmnichannelSubscriptionItemMetric obj = new OmnichannelSubscriptionItemMetric(); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.omnichannelSubscriptionId = JsonUtil.getString(jsonObj, "omnichannel_subscription_id"); + + obj.omnichannelSubscriptionItemId = + JsonUtil.getString(jsonObj, "omnichannel_subscription_item_id"); + + obj.itemIdAtSource = JsonUtil.getString(jsonObj, "item_id_at_source"); + + obj.mrrCurrency = JsonUtil.getString(jsonObj, "mrr_currency"); + + obj.mrrUnits = JsonUtil.getLong(jsonObj, "mrr_units"); + + obj.mrrNanos = JsonUtil.getLong(jsonObj, "mrr_nanos"); + + obj.effectiveFrom = JsonUtil.getTimestamp(jsonObj, "effective_from"); + + obj.calculatedAt = JsonUtil.getTimestamp(jsonObj, "calculated_at"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + return obj; + } + + @Override + public String toString() { + return "OmnichannelSubscriptionItemMetric{" + + "customerId=" + + customerId + + ", omnichannelSubscriptionId=" + + omnichannelSubscriptionId + + ", omnichannelSubscriptionItemId=" + + omnichannelSubscriptionItemId + + ", itemIdAtSource=" + + itemIdAtSource + + ", mrrCurrency=" + + mrrCurrency + + ", mrrUnits=" + + mrrUnits + + ", mrrNanos=" + + mrrNanos + + ", effectiveFrom=" + + effectiveFrom + + ", calculatedAt=" + + calculatedAt + + ", createdAt=" + + createdAt + + ", resourceVersion=" + + resourceVersion + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + OmnichannelSubscriptionItemMetric that = (OmnichannelSubscriptionItemMetric) o; + return java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(omnichannelSubscriptionId, that.omnichannelSubscriptionId) + && java.util.Objects.equals( + omnichannelSubscriptionItemId, that.omnichannelSubscriptionItemId) + && java.util.Objects.equals(itemIdAtSource, that.itemIdAtSource) + && java.util.Objects.equals(mrrCurrency, that.mrrCurrency) + && java.util.Objects.equals(mrrUnits, that.mrrUnits) + && java.util.Objects.equals(mrrNanos, that.mrrNanos) + && java.util.Objects.equals(effectiveFrom, that.effectiveFrom) + && java.util.Objects.equals(calculatedAt, that.calculatedAt) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(resourceVersion, that.resourceVersion); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + customerId, + omnichannelSubscriptionId, + omnichannelSubscriptionItemId, + itemIdAtSource, + mrrCurrency, + mrrUnits, + mrrNanos, + effectiveFrom, + calculatedAt, + createdAt, + resourceVersion); + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java index 0cc1ee246..5db9886b3 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -1512,25 +1512,17 @@ public Timestamp getCreatedAt() { } public enum Source { - CB_JS("cb_js"), + PAYMENT_METHOD_HELPER("payment_method_helper"), - COMPONENTS_FIELDS("components_fields"), + CARD_COMPONENTS("card_components"), - CHECKOUT_V_3("checkout_v3"), + CHECKOUT("checkout"), - PAYNOW_V_3("paynow_v3"), + COLLECT_NOW("collect_now"), - PORTAL_V_3("portal_v3"), + PORTAL("portal"), - GIFT_V_3("gift_v3"), - - CHECKOUT_V_4("checkout_v4"), - - PAYMENT_COMPONENT("payment_component"), - - PC_INAPP_V_4("pc_inapp_v4"), - - PC_FPC_V_4("pc_fpc_v4"), + PAYMENT_COMPONENTS("payment_components"), /** An enum member indicating that Source was instantiated with an unknown value. */ _UNKNOWN(null); diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java index 62f9fa958..b9dfe8b3a 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -26,6 +26,7 @@ public class PaymentSource { private String gatewayAccountId; private String ipAddress; private String issuingCountry; + private java.util.Map vaultToken; private Boolean deleted; private String businessEntityId; private Card card; @@ -87,6 +88,10 @@ public String getIssuingCountry() { return issuingCountry; } + public java.util.Map getVaultToken() { + return vaultToken; + } + public Boolean getDeleted() { return deleted; } @@ -482,6 +487,12 @@ public static PaymentSource fromJson(JsonObject jsonObj) { obj.issuingCountry = JsonUtil.getString(jsonObj, "issuing_country"); + JsonObject __vaultTokenObj = JsonUtil.getJsonObject(jsonObj, "vault_token"); + obj.vaultToken = + __vaultTokenObj != null + ? JsonUtil.parseJsonObjectToMap(__vaultTokenObj) + : new java.util.HashMap<>(); + obj.deleted = JsonUtil.getBoolean(jsonObj, "deleted"); obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); @@ -564,6 +575,8 @@ public String toString() { + ipAddress + ", issuingCountry=" + issuingCountry + + ", vaultToken=" + + vaultToken + ", deleted=" + deleted + ", businessEntityId=" @@ -609,6 +622,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) && java.util.Objects.equals(ipAddress, that.ipAddress) && java.util.Objects.equals(issuingCountry, that.issuingCountry) + && java.util.Objects.equals(vaultToken, that.vaultToken) && java.util.Objects.equals(deleted, that.deleted) && java.util.Objects.equals(businessEntityId, that.businessEntityId) && java.util.Objects.equals(card, that.card) @@ -639,6 +653,7 @@ public int hashCode() { gatewayAccountId, ipAddress, issuingCountry, + vaultToken, deleted, businessEntityId, card, diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java new file mode 100644 index 000000000..2fd1a5fdf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java @@ -0,0 +1,67 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ListGatewayTokensForPaymentSourceParams { + + private final Map queryParams; + + private ListGatewayTokensForPaymentSourceParams( + ListGatewayTokensForPaymentSourceBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListGatewayTokensForPaymentSourceBuilder toBuilder() { + ListGatewayTokensForPaymentSourceBuilder builder = + new ListGatewayTokensForPaymentSourceBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListGatewayTokensForPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListGatewayTokensForPaymentSourceBuilder builder() { + return new ListGatewayTokensForPaymentSourceBuilder(); + } + + public static final class ListGatewayTokensForPaymentSourceBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListGatewayTokensForPaymentSourceBuilder() {} + + public ListGatewayTokensForPaymentSourceBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListGatewayTokensForPaymentSourceBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ListGatewayTokensForPaymentSourceBuilder includeDeleted(Boolean value) { + queryParams.put("include_deleted", value); + return this; + } + + public ListGatewayTokensForPaymentSourceParams build() { + return new ListGatewayTokensForPaymentSourceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java new file mode 100644 index 000000000..2988da04c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java @@ -0,0 +1,240 @@ +package com.chargebee.v4.models.paymentSource.responses; + +import java.util.List; + +import com.chargebee.v4.models.gatewayPaymentMethodToken.GatewayPaymentMethodToken; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.PaymentSourceService; +import com.chargebee.v4.models.paymentSource.params.ListGatewayTokensForPaymentSourceParams; + +/** + * Immutable response object for ListGatewayTokensForPaymentSource operation. Contains paginated + * list data. + */ +public final class ListGatewayTokensForPaymentSourceResponse { + + private final List list; + + private final String nextOffset; + + private final String custPaymentSourceId; + + private final PaymentSourceService service; + private final ListGatewayTokensForPaymentSourceParams originalParams; + private final Response httpResponse; + + private ListGatewayTokensForPaymentSourceResponse( + List list, + String nextOffset, + String custPaymentSourceId, + PaymentSourceService service, + ListGatewayTokensForPaymentSourceParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.custPaymentSourceId = custPaymentSourceId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListGatewayTokensForPaymentSourceResponse object (no service context). + * Use this when you only need to read a single page (no nextPage()). + */ + public static ListGatewayTokensForPaymentSourceResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + PaymentSourceListGatewayTokensForPaymentSourceItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListGatewayTokensForPaymentSourceResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListGatewayTokensForPaymentSourceResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListGatewayTokensForPaymentSourceResponse object with service context + * for pagination (enables nextPage()). + */ + public static ListGatewayTokensForPaymentSourceResponse fromJson( + String json, + PaymentSourceService service, + ListGatewayTokensForPaymentSourceParams originalParams, + String custPaymentSourceId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + PaymentSourceListGatewayTokensForPaymentSourceItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListGatewayTokensForPaymentSourceResponse( + list, nextOffset, custPaymentSourceId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListGatewayTokensForPaymentSourceResponse from JSON", e); + } + } + + /** Get the list from the response. */ + public List getList() { + return list; + } + + /** Get the nextOffset from the response. */ + public String getNextOffset() { + return nextOffset; + } + + /** Check if there are more pages available. */ + public boolean hasNextPage() { + return nextOffset != null && !nextOffset.isEmpty(); + } + + /** + * Get the next page of results. + * + * @throws ChargebeeException if unable to fetch next page + */ + public ListGatewayTokensForPaymentSourceResponse nextPage() throws ChargebeeException { + if (!hasNextPage()) { + throw new IllegalStateException("No more pages available"); + } + if (service == null) { + throw new UnsupportedOperationException( + "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse)."); + } + + ListGatewayTokensForPaymentSourceParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ListGatewayTokensForPaymentSourceParams.builder()) + .offset(nextOffset) + .build(); + + return service.listGatewayTokensForPaymentSource(custPaymentSourceId, nextParams); + } + + /** Get the raw response payload as JSON string. */ + public String responsePayload() { + return httpResponse != null ? httpResponse.getBodyAsString() : null; + } + + /** Get the HTTP status code. */ + public int httpStatus() { + return httpResponse != null ? httpResponse.getStatusCode() : 0; + } + + /** Get response headers. */ + public java.util.Map> headers() { + return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap(); + } + + /** Get a specific header value. */ + public java.util.List header(String name) { + if (httpResponse == null) return null; + return httpResponse.getHeaders().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(name)) + .map(java.util.Map.Entry::getValue) + .findFirst() + .orElse(null); + } + + @Override + public String toString() { + return "ListGatewayTokensForPaymentSourceResponse{" + + "list=" + + list + + ", nextOffset=" + + nextOffset + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ListGatewayTokensForPaymentSourceResponse that = (ListGatewayTokensForPaymentSourceResponse) o; + return java.util.Objects.equals(list, that.list) + && java.util.Objects.equals(nextOffset, that.nextOffset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(list, nextOffset); + } + + public static class PaymentSourceListGatewayTokensForPaymentSourceItem { + + private GatewayPaymentMethodToken gatewayPaymentMethodToken; + + public GatewayPaymentMethodToken getGatewayPaymentMethodToken() { + return gatewayPaymentMethodToken; + } + + public static PaymentSourceListGatewayTokensForPaymentSourceItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentSourceListGatewayTokensForPaymentSourceItem fromJson(JsonObject jsonObj) { + PaymentSourceListGatewayTokensForPaymentSourceItem item = + new PaymentSourceListGatewayTokensForPaymentSourceItem(); + + JsonObject __gatewayPaymentMethodTokenObj = + JsonUtil.getJsonObject(jsonObj, "gateway_payment_method_token"); + if (__gatewayPaymentMethodTokenObj != null) { + item.gatewayPaymentMethodToken = + GatewayPaymentMethodToken.fromJson(__gatewayPaymentMethodTokenObj); + } + + return item; + } + + @Override + public String toString() { + return "PaymentSourceListGatewayTokensForPaymentSourceItem{" + + "gatewayPaymentMethodToken=" + + gatewayPaymentMethodToken + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentSourceListGatewayTokensForPaymentSourceItem that = + (PaymentSourceListGatewayTokensForPaymentSourceItem) o; + return java.util.Objects.equals(gatewayPaymentMethodToken, that.gatewayPaymentMethodToken); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(gatewayPaymentMethodToken); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java index 76aa8eb8c..096043f55 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java @@ -1732,6 +1732,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1764,6 +1766,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1823,6 +1827,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -1901,6 +1909,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -1945,6 +1958,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2019,6 +2034,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java index a8a60667f..2d1d0426e 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java @@ -1716,6 +1716,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1748,6 +1750,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1807,6 +1811,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -1885,6 +1893,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -1929,6 +1942,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2003,6 +2018,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java index b88f4f4ac..89528d078 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java @@ -1899,6 +1899,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1931,6 +1933,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1990,6 +1994,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -2068,6 +2076,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -2112,6 +2125,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2186,6 +2201,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java index f71a538ab..10ce55da6 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java @@ -1936,6 +1936,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1968,6 +1970,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -2027,6 +2031,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -2105,6 +2113,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -2149,6 +2162,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2223,6 +2238,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java index 0cdbfcfa0..1843a8fdb 100644 --- a/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java +++ b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java @@ -137,6 +137,7 @@ public static class LineItems { private String amountPerBillingCycleInDecimal; private Long netAmountPerBillingCycle; private String netAmountPerBillingCycleInDecimal; + private String description; public String getItemPriceId() { return itemPriceId; @@ -255,6 +256,10 @@ public String getNetAmountPerBillingCycleInDecimal() { return netAmountPerBillingCycleInDecimal; } + public String getDescription() { + return description; + } + public enum ItemType { PLAN("plan"), @@ -457,6 +462,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.netAmountPerBillingCycleInDecimal = JsonUtil.getString(jsonObj, "net_amount_per_billing_cycle_in_decimal"); + obj.description = JsonUtil.getString(jsonObj, "description"); + return obj; } @@ -521,6 +528,8 @@ public String toString() { + netAmountPerBillingCycle + ", netAmountPerBillingCycleInDecimal=" + netAmountPerBillingCycleInDecimal + + ", description=" + + description + "}"; } @@ -564,7 +573,8 @@ public boolean equals(Object o) { amountPerBillingCycleInDecimal, that.amountPerBillingCycleInDecimal) && java.util.Objects.equals(netAmountPerBillingCycle, that.netAmountPerBillingCycle) && java.util.Objects.equals( - netAmountPerBillingCycleInDecimal, that.netAmountPerBillingCycleInDecimal); + netAmountPerBillingCycleInDecimal, that.netAmountPerBillingCycleInDecimal) + && java.util.Objects.equals(description, that.description); } @Override @@ -599,7 +609,8 @@ public int hashCode() { amountPerBillingCycle, amountPerBillingCycleInDecimal, netAmountPerBillingCycle, - netAmountPerBillingCycleInDecimal); + netAmountPerBillingCycleInDecimal, + description); } } diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java index 2fe4523fb..3d48cea1b 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java @@ -202,7 +202,7 @@ public RampListBuilder desc() { } } - public enum StatusIn { + public enum StatusIs { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -211,11 +211,11 @@ public enum StatusIn { DRAFT("draft"), - /** An enum member indicating that StatusIn was instantiated with an unknown value. */ + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIn(String value) { + StatusIs(String value) { this.value = value; } @@ -223,9 +223,9 @@ public String getValue() { return value; } - public static StatusIn fromString(String value) { + public static StatusIs fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIn enumValue : StatusIn.values()) { + for (StatusIs enumValue : StatusIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -234,7 +234,7 @@ public static StatusIn fromString(String value) { } } - public enum StatusIs { + public enum StatusIn { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -243,11 +243,11 @@ public enum StatusIs { DRAFT("draft"), - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + /** An enum member indicating that StatusIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIs(String value) { + StatusIn(String value) { this.value = value; } @@ -255,9 +255,9 @@ public String getValue() { return value; } - public static StatusIs fromString(String value) { + public static StatusIn fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { + for (StatusIn enumValue : StatusIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java new file mode 100644 index 000000000..eabddd0aa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java @@ -0,0 +1,100 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.vaultedPaymentMethod; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class VaultedPaymentMethod { + + private String id; + private String customerId; + private String creditCardId; + private Timestamp createdAt; + private Timestamp modifiedAt; + + public String getId() { + return id; + } + + public String getCustomerId() { + return customerId; + } + + public String getCreditCardId() { + return creditCardId; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getModifiedAt() { + return modifiedAt; + } + + public static VaultedPaymentMethod fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultedPaymentMethod fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultedPaymentMethod fromJson(JsonObject jsonObj) { + VaultedPaymentMethod obj = new VaultedPaymentMethod(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.creditCardId = JsonUtil.getString(jsonObj, "credit_card_id"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + + return obj; + } + + @Override + public String toString() { + return "VaultedPaymentMethod{" + + "id=" + + id + + ", customerId=" + + customerId + + ", creditCardId=" + + creditCardId + + ", createdAt=" + + createdAt + + ", modifiedAt=" + + modifiedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultedPaymentMethod that = (VaultedPaymentMethod) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(creditCardId, that.creditCardId) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(modifiedAt, that.modifiedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(id, customerId, creditCardId, createdAt, modifiedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java new file mode 100644 index 000000000..129e4b56d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java @@ -0,0 +1,50 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.vaultedPaymentMethod.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VaultedPaymentMethodRetrieveParams { + + private final Map queryParams; + + private VaultedPaymentMethodRetrieveParams(VaultedPaymentMethodRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public VaultedPaymentMethodRetrieveBuilder toBuilder() { + VaultedPaymentMethodRetrieveBuilder builder = new VaultedPaymentMethodRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for VaultedPaymentMethodRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VaultedPaymentMethodRetrieveBuilder builder() { + return new VaultedPaymentMethodRetrieveBuilder(); + } + + public static final class VaultedPaymentMethodRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private VaultedPaymentMethodRetrieveBuilder() {} + + public VaultedPaymentMethodRetrieveParams build() { + return new VaultedPaymentMethodRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java new file mode 100644 index 000000000..ccdadc87b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java @@ -0,0 +1,104 @@ +package com.chargebee.v4.models.vaultedPaymentMethod.responses; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VaultedPaymentMethodRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class VaultedPaymentMethodRetrieveResponse extends BaseResponse { + private final VaultedPaymentMethod vaultedPaymentMethod; + + private VaultedPaymentMethodRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.vaultedPaymentMethod = builder.vaultedPaymentMethod; + } + + /** Parse JSON response into VaultedPaymentMethodRetrieveResponse object. */ + public static VaultedPaymentMethodRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VaultedPaymentMethodRetrieveResponse object with HTTP response. */ + public static VaultedPaymentMethodRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + builder.vaultedPaymentMethod(VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse VaultedPaymentMethodRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for VaultedPaymentMethodRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VaultedPaymentMethodRetrieveResponse. */ + public static class Builder { + + private VaultedPaymentMethod vaultedPaymentMethod; + + private Response httpResponse; + + private Builder() {} + + public Builder vaultedPaymentMethod(VaultedPaymentMethod vaultedPaymentMethod) { + this.vaultedPaymentMethod = vaultedPaymentMethod; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VaultedPaymentMethodRetrieveResponse build() { + return new VaultedPaymentMethodRetrieveResponse(this); + } + } + + /** Get the vaultedPaymentMethod from the response. */ + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + @Override + public String toString() { + return "VaultedPaymentMethodRetrieveResponse{" + + "vaultedPaymentMethod=" + + vaultedPaymentMethod + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultedPaymentMethodRetrieveResponse that = (VaultedPaymentMethodRetrieveResponse) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } +} diff --git a/src/main/java/com/chargebee/v4/services/CreditNoteService.java b/src/main/java/com/chargebee/v4/services/CreditNoteService.java index 2b3b52456..f96f372eb 100644 --- a/src/main/java/com/chargebee/v4/services/CreditNoteService.java +++ b/src/main/java/com/chargebee/v4/services/CreditNoteService.java @@ -31,6 +31,8 @@ import com.chargebee.v4.models.creditNote.params.CreditNoteCreateParams; +import com.chargebee.v4.models.creditNote.params.CreditNoteUpdateParams; + import com.chargebee.v4.models.creditNote.params.CreditNoteRemoveTaxWithheldRefundParams; import com.chargebee.v4.models.creditNote.params.CreditNoteRetrieveParams; @@ -55,6 +57,8 @@ import com.chargebee.v4.models.creditNote.responses.CreditNoteCreateResponse; +import com.chargebee.v4.models.creditNote.responses.CreditNoteUpdateResponse; + import com.chargebee.v4.models.creditNote.responses.CreditNoteDownloadEinvoiceResponse; import com.chargebee.v4.models.creditNote.responses.CreditNoteResendEinvoiceResponse; @@ -619,6 +623,64 @@ public CompletableFuture createAsync(CreditNoteCreateP response -> CreditNoteCreateResponse.fromJson(response.getBodyAsString(), response)); } + /** update a creditNote (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + + return post("creditNote", "update", path, null); + } + + /** update a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId, CreditNoteUpdateParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return post("creditNote", "update", path, params.toFormData()); + } + + /** update a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return postJson("creditNote", "update", path, jsonPayload); + } + + public CreditNoteUpdateResponse update(String creditNoteId, CreditNoteUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(creditNoteId, params); + return CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for creditNote with params. */ + public CompletableFuture updateAsync( + String creditNoteId, CreditNoteUpdateParams params) { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return postAsync("creditNote", "update", path, params.toFormData()) + .thenApply( + response -> CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + + public CreditNoteUpdateResponse update(String creditNoteId) throws ChargebeeException { + Response response = updateRaw(creditNoteId); + return CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for creditNote without params. */ + public CompletableFuture updateAsync(String creditNoteId) { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + + return postAsync("creditNote", "update", path, null) + .thenApply( + response -> CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + /** downloadEinvoice a creditNote (executes immediately) - returns raw Response. */ Response downloadEinvoiceRaw(String creditNoteId) throws ChargebeeException { String path = diff --git a/src/main/java/com/chargebee/v4/services/ExportService.java b/src/main/java/com/chargebee/v4/services/ExportService.java index 2ca2851ff..7b5c827b9 100644 --- a/src/main/java/com/chargebee/v4/services/ExportService.java +++ b/src/main/java/com/chargebee/v4/services/ExportService.java @@ -19,6 +19,8 @@ import com.chargebee.v4.models.export.params.ExportTransactionsParams; +import com.chargebee.v4.models.export.params.ExportRampsParams; + import com.chargebee.v4.models.export.params.ExportDifferentialPricesParams; import com.chargebee.v4.models.export.params.ExportItemFamiliesParams; @@ -53,6 +55,8 @@ import com.chargebee.v4.models.export.responses.ExportTransactionsResponse; +import com.chargebee.v4.models.export.responses.ExportRampsResponse; + import com.chargebee.v4.models.export.responses.ExportDifferentialPricesResponse; import com.chargebee.v4.models.export.responses.ExportItemFamiliesResponse; @@ -224,6 +228,32 @@ public CompletableFuture transactionsAsync( response -> ExportTransactionsResponse.fromJson(response.getBodyAsString(), response)); } + /** ramps a export using immutable params (executes immediately) - returns raw Response. */ + Response rampsRaw(ExportRampsParams params) throws ChargebeeException { + + return post("export", "ramps", "/exports/ramps", params != null ? params.toFormData() : null); + } + + /** ramps a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response rampsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("export", "ramps", "/exports/ramps", jsonPayload); + } + + public ExportRampsResponse ramps(ExportRampsParams params) throws ChargebeeException { + Response response = rampsRaw(params); + + return ExportRampsResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of ramps for export with params. */ + public CompletableFuture rampsAsync(ExportRampsParams params) { + + return postAsync( + "export", "ramps", "/exports/ramps", params != null ? params.toFormData() : null) + .thenApply(response -> ExportRampsResponse.fromJson(response.getBodyAsString(), response)); + } + /** * differentialPrices a export using immutable params (executes immediately) - returns raw * Response. diff --git a/src/main/java/com/chargebee/v4/services/PaymentSourceService.java b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java index 3cd692967..4110ff952 100644 --- a/src/main/java/com/chargebee/v4/services/PaymentSourceService.java +++ b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java @@ -17,6 +17,8 @@ import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateCardParams; +import com.chargebee.v4.models.paymentSource.params.ListGatewayTokensForPaymentSourceParams; + import com.chargebee.v4.models.paymentSource.params.PaymentSourceVerifyBankAccountParams; import com.chargebee.v4.models.paymentSource.params.PaymentSourceListParams; @@ -45,6 +47,8 @@ import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateCardResponse; +import com.chargebee.v4.models.paymentSource.responses.ListGatewayTokensForPaymentSourceResponse; + import com.chargebee.v4.models.paymentSource.responses.PaymentSourceVerifyBankAccountResponse; import com.chargebee.v4.models.paymentSource.responses.PaymentSourceListResponse; @@ -230,6 +234,103 @@ public CompletableFuture createCardAsync( PaymentSourceCreateCardResponse.fromJson(response.getBodyAsString(), response)); } + /** + * listGatewayTokensForPaymentSource a paymentSource using immutable params (executes immediately) + * - returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return get( + "paymentSource", + "listGatewayTokensForPaymentSource", + path, + params != null ? params.toQueryParams() : null); + } + + /** + * listGatewayTokensForPaymentSource a paymentSource without params (executes immediately) - + * returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw(String custPaymentSourceId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return get("paymentSource", "listGatewayTokensForPaymentSource", path, null); + } + + /** + * listGatewayTokensForPaymentSource a paymentSource using raw JSON payload (executes immediately) + * - returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListGatewayTokensForPaymentSourceResponse listGatewayTokensForPaymentSource( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) + throws ChargebeeException { + Response response = listGatewayTokensForPaymentSourceRaw(custPaymentSourceId, params); + return ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, params, custPaymentSourceId, response); + } + + public ListGatewayTokensForPaymentSourceResponse listGatewayTokensForPaymentSource( + String custPaymentSourceId) throws ChargebeeException { + Response response = listGatewayTokensForPaymentSourceRaw(custPaymentSourceId); + return ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, null, custPaymentSourceId, response); + } + + /** Async variant of listGatewayTokensForPaymentSource for paymentSource with params. */ + public CompletableFuture + listGatewayTokensForPaymentSourceAsync( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return getAsync( + "paymentSource", + "listGatewayTokensForPaymentSource", + path, + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, params, custPaymentSourceId, response)); + } + + /** Async variant of listGatewayTokensForPaymentSource for paymentSource without params. */ + public CompletableFuture + listGatewayTokensForPaymentSourceAsync(String custPaymentSourceId) { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return getAsync("paymentSource", "listGatewayTokensForPaymentSource", path, null) + .thenApply( + response -> + ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, null, custPaymentSourceId, response)); + } + /** verifyBankAccount a paymentSource (executes immediately) - returns raw Response. */ Response verifyBankAccountRaw(String custPaymentSourceId) throws ChargebeeException { String path = diff --git a/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java b/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java new file mode 100644 index 000000000..62aefe0e4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java @@ -0,0 +1,85 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; +import java.util.concurrent.CompletableFuture; + +import com.chargebee.v4.models.vaultedPaymentMethod.responses.VaultedPaymentMethodRetrieveResponse; + +public final class VaultedPaymentMethodService extends BaseService { + + private final ServiceConfig config; + + public VaultedPaymentMethodService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private VaultedPaymentMethodService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private VaultedPaymentMethodService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + VaultedPaymentMethodService with(RequestOptions newOptions) { + return new VaultedPaymentMethodService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public VaultedPaymentMethodService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a vaultedPaymentMethod (executes immediately) - returns raw Response. */ + Response retrieveRaw(String vaultedPaymentMethodId) throws ChargebeeException { + String path = + buildPathWithParams( + "/vaulted_payment_methods/{vaulted-payment-method-id}", + "vaulted-payment-method-id", + vaultedPaymentMethodId); + + return get("vaultedPaymentMethod", "retrieve", path, null); + } + + public VaultedPaymentMethodRetrieveResponse retrieve(String vaultedPaymentMethodId) + throws ChargebeeException { + Response response = retrieveRaw(vaultedPaymentMethodId); + return VaultedPaymentMethodRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for vaultedPaymentMethod without params. */ + public CompletableFuture retrieveAsync( + String vaultedPaymentMethodId) { + String path = + buildPathWithParams( + "/vaulted_payment_methods/{vaulted-payment-method-id}", + "vaulted-payment-method-id", + vaultedPaymentMethodId); + + return getAsync("vaultedPaymentMethod", "retrieve", path, null) + .thenApply( + response -> + VaultedPaymentMethodRetrieveResponse.fromJson( + response.getBodyAsString(), response)); + } +}