diff --git a/CHANGELOG.md b/CHANGELOG.md index d495f7a47..009800e61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,85 @@ +### v4.13.0 (2026-07-21) +* * * +### New Resources: +- [`AsyncResponse`](https://apidocs.chargebee.com/docs/api/async_responses) has been added. +- [`AsyncResponseList`](https://apidocs.chargebee.com/docs/api/async_response_lists) has been added. +- [`ColumnDefinition`](https://apidocs.chargebee.com/docs/api/column_definitions) has been added. +- [`Meter`](https://apidocs.chargebee.com/docs/api/meters) has been added. +- [`MeteredFeature`](https://apidocs.chargebee.com/docs/api/metered_features) has been added. + + +### New Attributes: +- [`currency_code`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#currency_code) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#threshold) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`filter_conditions`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#filter_conditions) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`exchange_rates`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#exchange_rates) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`metered`](https://apidocs.chargebee.com/docs/api/features/feature-object#metered) has been added to [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- [`exchange_rates`](https://apidocs.chargebee.com/docs/api/invoices/invoice-object#exchange_rates) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`payment_intent_metadata`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). + + +### New Parameters: +- [`metered`](https://apidocs.chargebee.com/docs/api/features/list-features#metered) has been added as query parameter to [`list_features`](https://apidocs.chargebee.com/docs/api/features/list-features) in [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- [`decommissioned`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions#decommissioned) has been added as query parameter to [`list_subscriptions`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`currency_code`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#currency_code) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`line_items.proration_mode`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_proration_mode) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`item_prices.description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#item_prices_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`item_prices.entity_description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#item_prices_entity_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`charges.entity_description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#charges_entity_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription.decommissioned`](https://apidocs.chargebee.com/docs/api/exports/export-subscriptions#subscription_decommissioned) has been added as request body parameter to [`export_subscriptions`](https://apidocs.chargebee.com/docs/api/exports/export-subscriptions) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`item_prices.description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#item_prices_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`item_prices.entity_description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#item_prices_entity_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`charges.entity_description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#charges_entity_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`create_pending_invoice`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#create_pending_invoice) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`line_items.proration_mode`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_proration_mode) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`paid_at`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#paid_at) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`discounts_to_add.quantity`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp#discounts_to_add_quantity) has been added as request body parameter to [`create_a_ramp`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`discounts_to_add.quantity`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp#discounts_to_add_quantity) has been added as request body parameter to [`update_a_subscription_ramp`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`customer.email`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_email) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). +- [`customer.first_name`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_first_name) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). +- [`customer.last_name`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_last_name) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). + + +### Parameter Updates: +- [`metered_feature_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#metered_feature_id) has been changed from required to optional in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). + + +### New Events: +- [`payment_source_business_entity_changed`](https://apidocs.chargebee.com/docs/api/events/webhook/payment_source_business_entity_changed) has been added. + + +### Deleted Attributes: +- `start_balance` has been removed from [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `end_balance` has been removed from [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). + + +### New Enums: +- `real_time_payments` has been added as a new value enum `DunningType`. +- `payment_source_business_entity_changed` has been added as a new value enum `EventType`. +- `paynow`, `bizum`, and `promptpay` have been added as new values enum `PaymentMethod`. +- `paynow`, `bizum`, and `promptpay` have been added as new values enum `PaymentMethodType`. +- `active`, `archived`, and `deleted` have been added as new values enum `Status`. +- `zero_rated`, `region_non_taxable`, `product_exempt`, `high_value_physical_goods`, `zero_value_item`, and `tax_not_configured_external_provider` have been added as new values enum `TaxOverrideReason`. +- `paynow`, `bizum`, `promptpay`, `simple`, `compound`, and `spend_exceeded` have been added as new values enum `Type`. +- `success` and `failed` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/async_responses/async-response-object#status) in [`AsyncResponse`](https://apidocs.chargebee.com/docs/api/async_responses). +- `number` and `string` have been added as new values to enum attribute [`data_type`](https://apidocs.chargebee.com/docs/api/column_definitions/column-definition-object#data_type) in [`ColumnDefinition`](https://apidocs.chargebee.com/docs/api/column_definitions). +- `simple` and `compound` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/meters/meter-object#type) in [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `active`, `archived`, and `deleted` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/meters/meter-object#status) in [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `cb_js`, `components_fields`, `checkout_v3`, `paynow_v3`, `portal_v3`, `gift_v3`, `checkout_v4`, `payment_component`, `pc_inapp_v4`, and `pc_fpc_v4` 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). +- `adjusted_term`, `service_period_revision`, `delta`, and `reset` have been added as new values to enum request body parameter `line_items.proration_mode` in [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) of [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- `true` and `false` have been added as new values to enum query parameter `metered.is` in [`list_features`](https://apidocs.chargebee.com/docs/api/features/list-features) of [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- `adjusted_term`, `service_period_revision`, `delta`, and `reset` have been added as new values to enum request body parameter `line_items.proration_mode` in [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `updated_at`, `name`, `created_at`, and `id` have been added as new values to enum query parameter `sort_by.asc` in [`list_all_available_meters`](https://apidocs.chargebee.com/docs/api/meters/list-all-available-meters) of [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `updated_at`, `name`, `created_at`, and `id` have been added as new values to enum query parameter `sort_by.desc` in [`list_all_available_meters`](https://apidocs.chargebee.com/docs/api/meters/list-all-available-meters) of [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `number` and `string` have been added as new values to enum request body parameter `column_definitions.data_type` in [`create_a_metered_feature`](https://apidocs.chargebee.com/docs/api/metered_features/create-a-metered-feature) of [`MeteredFeature`](https://apidocs.chargebee.com/docs/api/metered_features). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `true` and `false` have been added as new values to enum query parameter `decommissioned.is` in [`list_subscriptions`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + + ### v4.12.0 (2026-06-30) * * * diff --git a/VERSION b/VERSION index 815588ef1..813b83b65 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.12.0 +4.13.0 diff --git a/build.gradle.kts b/build.gradle.kts index a6ce87d63..ca6220895 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.12.0" +version = "4.13.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 5d09536df..dbedc752f 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -54,6 +54,8 @@ import com.chargebee.v4.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.MeterService; + import com.chargebee.v4.services.RampService; import com.chargebee.v4.services.OmnichannelOneTimeOrderService; @@ -84,6 +86,8 @@ import com.chargebee.v4.services.UsageEventService; +import com.chargebee.v4.services.MeteredFeatureService; + import com.chargebee.v4.services.PriceVariantService; import com.chargebee.v4.services.FullExportService; @@ -373,6 +377,13 @@ public interface ClientMethods { */ OmnichannelSubscriptionItemService omnichannelSubscriptionItems(); + /** + * Access meter-related operations. + * + * @return MeterService instance for fluent API access + */ + MeterService meters(); + /** * Access ramp-related operations. * @@ -478,6 +489,13 @@ public interface ClientMethods { */ UsageEventService usageEvents(); + /** + * Access metered_feature-related operations. + * + * @return MeteredFeatureService instance for fluent API access + */ + MeteredFeatureService meteredFeatures(); + /** * Access price_variant-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 dc36f738f..a56a6f087 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -54,6 +54,8 @@ import com.chargebee.v4.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.MeterService; + import com.chargebee.v4.services.RampService; import com.chargebee.v4.services.OmnichannelOneTimeOrderService; @@ -84,6 +86,8 @@ import com.chargebee.v4.services.UsageEventService; +import com.chargebee.v4.services.MeteredFeatureService; + import com.chargebee.v4.services.PriceVariantService; import com.chargebee.v4.services.FullExportService; @@ -321,6 +325,11 @@ public OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { return getServiceRegistry().omnichannelSubscriptionItems(); } + @Override + public MeterService meters() { + return getServiceRegistry().meters(); + } + @Override public RampService ramps() { return getServiceRegistry().ramps(); @@ -396,6 +405,11 @@ public UsageEventService usageEvents() { return getServiceRegistry().usageEvents(); } + @Override + public MeteredFeatureService meteredFeatures() { + return getServiceRegistry().meteredFeatures(); + } + @Override public PriceVariantService priceVariants() { return getServiceRegistry().priceVariants(); diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index e01eb214d..c92aa4274 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -54,6 +54,8 @@ import com.chargebee.v4.services.OmnichannelSubscriptionItemService; +import com.chargebee.v4.services.MeterService; + import com.chargebee.v4.services.RampService; import com.chargebee.v4.services.OmnichannelOneTimeOrderService; @@ -84,6 +86,8 @@ import com.chargebee.v4.services.UsageEventService; +import com.chargebee.v4.services.MeteredFeatureService; + import com.chargebee.v4.services.PriceVariantService; import com.chargebee.v4.services.FullExportService; @@ -239,6 +243,8 @@ final class ServiceRegistry { private volatile OmnichannelSubscriptionItemService omnichannelSubscriptionItemService; + private volatile MeterService meterService; + private volatile RampService rampService; private volatile OmnichannelOneTimeOrderService omnichannelOneTimeOrderService; @@ -269,6 +275,8 @@ final class ServiceRegistry { private volatile UsageEventService usageEventService; + private volatile MeteredFeatureService meteredFeatureService; + private volatile PriceVariantService priceVariantService; private volatile FullExportService fullExportService; @@ -772,6 +780,21 @@ OmnichannelSubscriptionItemService omnichannelSubscriptionItems() { return omnichannelSubscriptionItemService; } + /** + * Get or create the MeterService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + MeterService meters() { + if (meterService == null) { + synchronized (this) { + if (meterService == null) { + meterService = new MeterService(client); + } + } + } + return meterService; + } + /** * Get or create the RampService instance. Thread-safe lazy initialization using double-checked * locking. @@ -997,6 +1020,21 @@ UsageEventService usageEvents() { return usageEventService; } + /** + * Get or create the MeteredFeatureService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + MeteredFeatureService meteredFeatures() { + if (meteredFeatureService == null) { + synchronized (this) { + if (meteredFeatureService == null) { + meteredFeatureService = new MeteredFeatureService(client); + } + } + } + return meteredFeatureService; + } + /** * Get or create the PriceVariantService instance. Thread-safe lazy initialization using * double-checked locking. diff --git a/src/main/java/com/chargebee/v4/models/alert/Alert.java b/src/main/java/com/chargebee/v4/models/alert/Alert.java index f2715f757..e1dc64cbb 100644 --- a/src/main/java/com/chargebee/v4/models/alert/Alert.java +++ b/src/main/java/com/chargebee/v4/models/alert/Alert.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.JsonUtil; import com.google.gson.JsonObject; import java.sql.Timestamp; +import java.util.List; public class Alert { @@ -18,11 +19,14 @@ public class Alert { private String name; private String description; private String meteredFeatureId; + private String currencyCode; private String subscriptionId; private Status status; private String meta; private Timestamp createdAt; private Timestamp updatedAt; + private List threshold; + private List filterConditions; public String getId() { return id; @@ -44,6 +48,10 @@ public String getMeteredFeatureId() { return meteredFeatureId; } + public String getCurrencyCode() { + return currencyCode; + } + public String getSubscriptionId() { return subscriptionId; } @@ -64,9 +72,19 @@ public Timestamp getUpdatedAt() { return updatedAt; } + public List getThreshold() { + return threshold; + } + + public List getFilterConditions() { + return filterConditions; + } + public enum Type { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -139,6 +157,8 @@ public static Alert fromJson(JsonObject jsonObj) { obj.meteredFeatureId = JsonUtil.getString(jsonObj, "metered_feature_id"); + obj.currencyCode = JsonUtil.getString(jsonObj, "currency_code"); + obj.subscriptionId = JsonUtil.getString(jsonObj, "subscription_id"); obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); @@ -149,6 +169,13 @@ public static Alert fromJson(JsonObject jsonObj) { obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + obj.threshold = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "threshold"), Threshold::fromJson); + + obj.filterConditions = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "filter_conditions"), FilterConditions::fromJson); + return obj; } @@ -165,6 +192,8 @@ public String toString() { + description + ", meteredFeatureId=" + meteredFeatureId + + ", currencyCode=" + + currencyCode + ", subscriptionId=" + subscriptionId + ", status=" @@ -175,6 +204,10 @@ public String toString() { + createdAt + ", updatedAt=" + updatedAt + + ", threshold=" + + threshold + + ", filterConditions=" + + filterConditions + "}"; } @@ -189,11 +222,14 @@ public boolean equals(Object o) { && java.util.Objects.equals(name, that.name) && java.util.Objects.equals(description, that.description) && java.util.Objects.equals(meteredFeatureId, that.meteredFeatureId) + && java.util.Objects.equals(currencyCode, that.currencyCode) && java.util.Objects.equals(subscriptionId, that.subscriptionId) && java.util.Objects.equals(status, that.status) && java.util.Objects.equals(meta, that.meta) && java.util.Objects.equals(createdAt, that.createdAt) - && java.util.Objects.equals(updatedAt, that.updatedAt); + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(threshold, that.threshold) + && java.util.Objects.equals(filterConditions, that.filterConditions); } @Override @@ -205,10 +241,216 @@ public int hashCode() { name, description, meteredFeatureId, + currencyCode, subscriptionId, status, meta, createdAt, - updatedAt); + updatedAt, + threshold, + filterConditions); + } + + public static class Threshold { + + private Mode mode; + private Double value; + + public Mode getMode() { + return mode; + } + + public Double getValue() { + return value; + } + + public enum Mode { + ABSOLUTE("absolute"), + + PERCENTAGE("percentage"), + + /** An enum member indicating that Mode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Mode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Mode fromString(String value) { + if (value == null) return _UNKNOWN; + for (Mode enumValue : Mode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static Threshold fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Threshold fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Threshold fromJson(JsonObject jsonObj) { + Threshold obj = new Threshold(); + + obj.mode = Mode.fromString(JsonUtil.getString(jsonObj, "mode")); + + obj.value = JsonUtil.getDouble(jsonObj, "value"); + + return obj; + } + + @Override + public String toString() { + return "Threshold{" + "mode=" + mode + ", value=" + value + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Threshold that = (Threshold) o; + return java.util.Objects.equals(mode, that.mode) + && java.util.Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(mode, value); + } + } + + public static class FilterConditions { + + private Field field; + private Operator operator; + private String value; + + public Field getField() { + return field; + } + + public Operator getOperator() { + return operator; + } + + public String getValue() { + return value; + } + + public enum Field { + PLAN_PRICE_ID("plan_price_id"), + + /** An enum member indicating that Field was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Field(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Field fromString(String value) { + if (value == null) return _UNKNOWN; + for (Field enumValue : Field.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Operator { + EQUALS("equals"), + + NOT_EQUALS("not_equals"), + + /** An enum member indicating that Operator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operator fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operator enumValue : Operator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static FilterConditions fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static FilterConditions fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static FilterConditions fromJson(JsonObject jsonObj) { + FilterConditions obj = new FilterConditions(); + + obj.field = Field.fromString(JsonUtil.getString(jsonObj, "field")); + + obj.operator = Operator.fromString(JsonUtil.getString(jsonObj, "operator")); + + obj.value = JsonUtil.getString(jsonObj, "value"); + + return obj; + } + + @Override + public String toString() { + return "FilterConditions{" + + "field=" + + field + + ", operator=" + + operator + + ", value=" + + value + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + FilterConditions that = (FilterConditions) o; + return java.util.Objects.equals(field, that.field) + && java.util.Objects.equals(operator, that.operator) + && java.util.Objects.equals(value, that.value); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(field, operator, value); + } } } diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java index 134d16374..83e38c42d 100644 --- a/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java @@ -22,6 +22,8 @@ public final class AlertCreateParams { private final String meteredFeatureId; + private final String currencyCode; + private final String subscriptionId; private final String meta; @@ -40,6 +42,8 @@ private AlertCreateParams(AlertCreateBuilder builder) { this.meteredFeatureId = builder.meteredFeatureId; + this.currencyCode = builder.currencyCode; + this.subscriptionId = builder.subscriptionId; this.meta = builder.meta; @@ -65,6 +69,10 @@ public String getMeteredFeatureId() { return meteredFeatureId; } + public String getCurrencyCode() { + return currencyCode; + } + public String getSubscriptionId() { return subscriptionId; } @@ -105,6 +113,11 @@ public Map toFormData() { formData.put("metered_feature_id", this.meteredFeatureId); } + if (this.currencyCode != null) { + + formData.put("currency_code", this.currencyCode); + } + if (this.subscriptionId != null) { formData.put("subscription_id", this.subscriptionId); @@ -159,6 +172,8 @@ public static final class AlertCreateBuilder { private String meteredFeatureId; + private String currencyCode; + private String subscriptionId; private String meta; @@ -189,6 +204,11 @@ public AlertCreateBuilder meteredFeatureId(String value) { return this; } + public AlertCreateBuilder currencyCode(String value) { + this.currencyCode = value; + return this; + } + public AlertCreateBuilder subscriptionId(String value) { this.subscriptionId = value; return this; @@ -217,6 +237,8 @@ public AlertCreateParams build() { public enum Type { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java index bd34b1619..5c8f74624 100644 --- a/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java @@ -207,6 +207,8 @@ public AlertListBuilder notIn(String... values) { public enum TypeIs { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -261,6 +263,8 @@ public static StatusIs fromString(String value) { public enum Type { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java index a1546b506..e2aa0a3c3 100644 --- a/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java @@ -222,6 +222,8 @@ public static StatusIs fromString(String value) { public enum TypeIs { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -276,6 +278,8 @@ public static Status fromString(String value) { public enum Type { USAGE_EXCEEDED("usage_exceeded"), + SPEND_EXCEEDED("spend_exceeded"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/asyncResponse/AsyncResponse.java b/src/main/java/com/chargebee/v4/models/asyncResponse/AsyncResponse.java new file mode 100644 index 000000000..ad3b89d19 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/asyncResponse/AsyncResponse.java @@ -0,0 +1,356 @@ +/* + * 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.asyncResponse; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class AsyncResponse { + + private String apiVersion; + private Timestamp createdAt; + private Timestamp completedAt; + private Status status; + private java.util.Map result; + private Request request; + private ErrorDetail errorDetail; + + public String getApiVersion() { + return apiVersion; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getCompletedAt() { + return completedAt; + } + + public Status getStatus() { + return status; + } + + public java.util.Map getResult() { + return result; + } + + public Request getRequest() { + return request; + } + + public ErrorDetail getErrorDetail() { + return errorDetail; + } + + public enum Status { + SUCCESS("success"), + + FAILED("failed"), + + /** 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 AsyncResponse fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AsyncResponse fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static AsyncResponse fromJson(JsonObject jsonObj) { + AsyncResponse obj = new AsyncResponse(); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.completedAt = JsonUtil.getTimestamp(jsonObj, "completed_at"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + JsonObject __resultObj = JsonUtil.getJsonObject(jsonObj, "result"); + obj.result = + __resultObj != null + ? JsonUtil.parseJsonObjectToMap(__resultObj) + : new java.util.HashMap<>(); + + JsonObject __requestObj = JsonUtil.getJsonObject(jsonObj, "request"); + if (__requestObj != null) { + obj.request = Request.fromJson(__requestObj); + } + + JsonObject __errorDetailObj = JsonUtil.getJsonObject(jsonObj, "error_detail"); + if (__errorDetailObj != null) { + obj.errorDetail = ErrorDetail.fromJson(__errorDetailObj); + } + + return obj; + } + + @Override + public String toString() { + return "AsyncResponse{" + + "apiVersion=" + + apiVersion + + ", createdAt=" + + createdAt + + ", completedAt=" + + completedAt + + ", status=" + + status + + ", result=" + + result + + ", request=" + + request + + ", errorDetail=" + + errorDetail + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AsyncResponse that = (AsyncResponse) o; + return java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(completedAt, that.completedAt) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(result, that.result) + && java.util.Objects.equals(request, that.request) + && java.util.Objects.equals(errorDetail, that.errorDetail); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + apiVersion, createdAt, completedAt, status, result, request, errorDetail); + } + + public static class Request { + + private String id; + private String resource; + private String operationType; + private String method; + private String uri; + private String idempotencyKey; + + public String getId() { + return id; + } + + public String getResource() { + return resource; + } + + public String getOperationType() { + return operationType; + } + + public String getMethod() { + return method; + } + + public String getUri() { + return uri; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public static Request fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Request fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Request fromJson(JsonObject jsonObj) { + Request obj = new Request(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.resource = JsonUtil.getString(jsonObj, "resource"); + + obj.operationType = JsonUtil.getString(jsonObj, "operation_type"); + + obj.method = JsonUtil.getString(jsonObj, "method"); + + obj.uri = JsonUtil.getString(jsonObj, "uri"); + + obj.idempotencyKey = JsonUtil.getString(jsonObj, "idempotency_key"); + + return obj; + } + + @Override + public String toString() { + return "Request{" + + "id=" + + id + + ", resource=" + + resource + + ", operationType=" + + operationType + + ", method=" + + method + + ", uri=" + + uri + + ", idempotencyKey=" + + idempotencyKey + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Request that = (Request) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(resource, that.resource) + && java.util.Objects.equals(operationType, that.operationType) + && java.util.Objects.equals(method, that.method) + && java.util.Objects.equals(uri, that.uri) + && java.util.Objects.equals(idempotencyKey, that.idempotencyKey); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(id, resource, operationType, method, uri, idempotencyKey); + } + } + + public static class ErrorDetail { + + private String message; + private String type; + private String apiErrorCode; + private String errorCode; + private String errorMsg; + private String httpStatusCode; + + public String getMessage() { + return message; + } + + public String getType() { + return type; + } + + public String getApiErrorCode() { + return apiErrorCode; + } + + public String getErrorCode() { + return errorCode; + } + + public String getErrorMsg() { + return errorMsg; + } + + public String getHttpStatusCode() { + return httpStatusCode; + } + + public static ErrorDetail fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ErrorDetail fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ErrorDetail fromJson(JsonObject jsonObj) { + ErrorDetail obj = new ErrorDetail(); + + obj.message = JsonUtil.getString(jsonObj, "message"); + + obj.type = JsonUtil.getString(jsonObj, "type"); + + obj.apiErrorCode = JsonUtil.getString(jsonObj, "api_error_code"); + + obj.errorCode = JsonUtil.getString(jsonObj, "error_code"); + + obj.errorMsg = JsonUtil.getString(jsonObj, "error_msg"); + + obj.httpStatusCode = JsonUtil.getString(jsonObj, "http_status_code"); + + return obj; + } + + @Override + public String toString() { + return "ErrorDetail{" + + "message=" + + message + + ", type=" + + type + + ", apiErrorCode=" + + apiErrorCode + + ", errorCode=" + + errorCode + + ", errorMsg=" + + errorMsg + + ", httpStatusCode=" + + httpStatusCode + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ErrorDetail that = (ErrorDetail) o; + return java.util.Objects.equals(message, that.message) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(apiErrorCode, that.apiErrorCode) + && java.util.Objects.equals(errorCode, that.errorCode) + && java.util.Objects.equals(errorMsg, that.errorMsg) + && java.util.Objects.equals(httpStatusCode, that.httpStatusCode); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + message, type, apiErrorCode, errorCode, errorMsg, httpStatusCode); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/asyncResponseList/AsyncResponseList.java b/src/main/java/com/chargebee/v4/models/asyncResponseList/AsyncResponseList.java new file mode 100644 index 000000000..2bc9b0046 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/asyncResponseList/AsyncResponseList.java @@ -0,0 +1,402 @@ +/* + * 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.asyncResponseList; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; +import java.util.List; + +public class AsyncResponseList { + + private List list; + + public List getList() { + return list; + } + + public static AsyncResponseList fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AsyncResponseList fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static AsyncResponseList fromJson(JsonObject jsonObj) { + AsyncResponseList obj = new AsyncResponseList(); + + obj.list = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), AsyncResponse::fromJson); + + return obj; + } + + @Override + public String toString() { + return "AsyncResponseList{" + "list=" + list + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AsyncResponseList that = (AsyncResponseList) o; + return java.util.Objects.equals(list, that.list); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(list); + } + + public static class AsyncResponse { + + private String apiVersion; + private Timestamp createdAt; + private Timestamp completedAt; + private Status status; + private Request request; + private ErrorDetail errorDetail; + private java.util.Map result; + + public String getApiVersion() { + return apiVersion; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getCompletedAt() { + return completedAt; + } + + public Status getStatus() { + return status; + } + + public Request getRequest() { + return request; + } + + public ErrorDetail getErrorDetail() { + return errorDetail; + } + + public java.util.Map getResult() { + return result; + } + + public enum Status { + SUCCESS("success"), + + FAILED("failed"), + + /** 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 AsyncResponse fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AsyncResponse fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static AsyncResponse fromJson(JsonObject jsonObj) { + AsyncResponse obj = new AsyncResponse(); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.completedAt = JsonUtil.getTimestamp(jsonObj, "completed_at"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + JsonObject __requestObj = JsonUtil.getJsonObject(jsonObj, "request"); + if (__requestObj != null) { + obj.request = Request.fromJson(__requestObj); + } + + JsonObject __errorDetailObj = JsonUtil.getJsonObject(jsonObj, "error_detail"); + if (__errorDetailObj != null) { + obj.errorDetail = ErrorDetail.fromJson(__errorDetailObj); + } + + JsonObject __resultObj = JsonUtil.getJsonObject(jsonObj, "result"); + obj.result = + __resultObj != null + ? JsonUtil.parseJsonObjectToMap(__resultObj) + : new java.util.HashMap<>(); + + return obj; + } + + @Override + public String toString() { + return "AsyncResponse{" + + "apiVersion=" + + apiVersion + + ", createdAt=" + + createdAt + + ", completedAt=" + + completedAt + + ", status=" + + status + + ", request=" + + request + + ", errorDetail=" + + errorDetail + + ", result=" + + result + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AsyncResponse that = (AsyncResponse) o; + return java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(completedAt, that.completedAt) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(request, that.request) + && java.util.Objects.equals(errorDetail, that.errorDetail) + && java.util.Objects.equals(result, that.result); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + apiVersion, createdAt, completedAt, status, request, errorDetail, result); + } + + public static class Request { + + private String id; + private String resource; + private String operationType; + private String method; + private String uri; + private String idempotencyKey; + + public String getId() { + return id; + } + + public String getResource() { + return resource; + } + + public String getOperationType() { + return operationType; + } + + public String getMethod() { + return method; + } + + public String getUri() { + return uri; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public static Request fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Request fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Request fromJson(JsonObject jsonObj) { + Request obj = new Request(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.resource = JsonUtil.getString(jsonObj, "resource"); + + obj.operationType = JsonUtil.getString(jsonObj, "operation_type"); + + obj.method = JsonUtil.getString(jsonObj, "method"); + + obj.uri = JsonUtil.getString(jsonObj, "uri"); + + obj.idempotencyKey = JsonUtil.getString(jsonObj, "idempotency_key"); + + return obj; + } + + @Override + public String toString() { + return "Request{" + + "id=" + + id + + ", resource=" + + resource + + ", operationType=" + + operationType + + ", method=" + + method + + ", uri=" + + uri + + ", idempotencyKey=" + + idempotencyKey + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Request that = (Request) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(resource, that.resource) + && java.util.Objects.equals(operationType, that.operationType) + && java.util.Objects.equals(method, that.method) + && java.util.Objects.equals(uri, that.uri) + && java.util.Objects.equals(idempotencyKey, that.idempotencyKey); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(id, resource, operationType, method, uri, idempotencyKey); + } + } + + public static class ErrorDetail { + + private String message; + private String type; + private String apiErrorCode; + private String errorCode; + private String errorMsg; + private String httpStatusCode; + + public String getMessage() { + return message; + } + + public String getType() { + return type; + } + + public String getApiErrorCode() { + return apiErrorCode; + } + + public String getErrorCode() { + return errorCode; + } + + public String getErrorMsg() { + return errorMsg; + } + + public String getHttpStatusCode() { + return httpStatusCode; + } + + public static ErrorDetail fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ErrorDetail fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ErrorDetail fromJson(JsonObject jsonObj) { + ErrorDetail obj = new ErrorDetail(); + + obj.message = JsonUtil.getString(jsonObj, "message"); + + obj.type = JsonUtil.getString(jsonObj, "type"); + + obj.apiErrorCode = JsonUtil.getString(jsonObj, "api_error_code"); + + obj.errorCode = JsonUtil.getString(jsonObj, "error_code"); + + obj.errorMsg = JsonUtil.getString(jsonObj, "error_msg"); + + obj.httpStatusCode = JsonUtil.getString(jsonObj, "http_status_code"); + + return obj; + } + + @Override + public String toString() { + return "ErrorDetail{" + + "message=" + + message + + ", type=" + + type + + ", apiErrorCode=" + + apiErrorCode + + ", errorCode=" + + errorCode + + ", errorMsg=" + + errorMsg + + ", httpStatusCode=" + + httpStatusCode + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ErrorDetail that = (ErrorDetail) o; + return java.util.Objects.equals(message, that.message) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(apiErrorCode, that.apiErrorCode) + && java.util.Objects.equals(errorCode, that.errorCode) + && java.util.Objects.equals(errorMsg, that.errorMsg) + && java.util.Objects.equals(httpStatusCode, that.httpStatusCode); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + message, type, apiErrorCode, errorCode, errorMsg, httpStatusCode); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/columnDefinition/ColumnDefinition.java b/src/main/java/com/chargebee/v4/models/columnDefinition/ColumnDefinition.java new file mode 100644 index 000000000..ad56a02a3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/columnDefinition/ColumnDefinition.java @@ -0,0 +1,92 @@ +/* + * 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.columnDefinition; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +public class ColumnDefinition { + + private String columnName; + private DataType dataType; + + public String getColumnName() { + return columnName; + } + + public DataType getDataType() { + return dataType; + } + + public enum DataType { + NUMBER("number"), + + STRING("string"), + + /** An enum member indicating that DataType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DataType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DataType enumValue : DataType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static ColumnDefinition fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ColumnDefinition fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ColumnDefinition fromJson(JsonObject jsonObj) { + ColumnDefinition obj = new ColumnDefinition(); + + obj.columnName = JsonUtil.getString(jsonObj, "column_name"); + + obj.dataType = DataType.fromString(JsonUtil.getString(jsonObj, "data_type")); + + return obj; + } + + @Override + public String toString() { + return "ColumnDefinition{" + "columnName=" + columnName + ", dataType=" + dataType + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ColumnDefinition that = (ColumnDefinition) o; + return java.util.Objects.equals(columnName, that.columnName) + && java.util.Objects.equals(dataType, that.dataType); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(columnName, dataType); + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java index e0883c150..426884eb9 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/CreditNote.java @@ -61,6 +61,7 @@ public class CreditNote { private TaxOrigin taxOrigin; private List linkedRefunds; private List allocations; + private List exchangeRates; private ShippingAddress shippingAddress; private BillingAddress billingAddress; private Einvoice einvoice; @@ -248,6 +249,10 @@ public List getAllocations() { return allocations; } + public List getExchangeRates() { + return exchangeRates; + } + public ShippingAddress getShippingAddress() { return shippingAddress; } @@ -555,6 +560,8 @@ public static CreditNote fromJson(JsonObject jsonObj) { knownFields.add("allocations"); + knownFields.add("exchange_rates"); + knownFields.add("shipping_address"); knownFields.add("billing_address"); @@ -672,6 +679,10 @@ public static CreditNote fromJson(JsonObject jsonObj) { obj.allocations = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "allocations"), Allocations::fromJson); + obj.exchangeRates = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "exchange_rates"), ExchangeRates::fromJson); + JsonObject __shippingAddressObj = JsonUtil.getJsonObject(jsonObj, "shipping_address"); if (__shippingAddressObj != null) { obj.shippingAddress = ShippingAddress.fromJson(__shippingAddressObj); @@ -791,6 +802,8 @@ public String toString() { + linkedRefunds + ", allocations=" + allocations + + ", exchangeRates=" + + exchangeRates + ", shippingAddress=" + shippingAddress + ", billingAddress=" @@ -855,6 +868,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(taxOrigin, that.taxOrigin) && java.util.Objects.equals(linkedRefunds, that.linkedRefunds) && java.util.Objects.equals(allocations, that.allocations) + && java.util.Objects.equals(exchangeRates, that.exchangeRates) && java.util.Objects.equals(shippingAddress, that.shippingAddress) && java.util.Objects.equals(billingAddress, that.billingAddress) && java.util.Objects.equals(einvoice, that.einvoice) @@ -911,6 +925,7 @@ public int hashCode() { taxOrigin, linkedRefunds, allocations, + exchangeRates, shippingAddress, billingAddress, einvoice, @@ -945,6 +960,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -1046,6 +1062,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -1162,6 +1182,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -1224,6 +1276,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -1280,6 +1334,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -1313,7 +1369,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -1344,7 +1401,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } @@ -2750,6 +2808,59 @@ public int hashCode() { } } + public static class ExchangeRates { + + private String currencyCode; + private BigDecimal rate; + + public String getCurrencyCode() { + return currencyCode; + } + + public BigDecimal getRate() { + return rate; + } + + public static ExchangeRates fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ExchangeRates fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ExchangeRates fromJson(JsonObject jsonObj) { + ExchangeRates obj = new ExchangeRates(); + + obj.currencyCode = JsonUtil.getString(jsonObj, "currency_code"); + + obj.rate = JsonUtil.getBigDecimal(jsonObj, "rate"); + + return obj; + } + + @Override + public String toString() { + return "ExchangeRates{" + "currencyCode=" + currencyCode + ", rate=" + rate + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ExchangeRates that = (ExchangeRates) o; + return java.util.Objects.equals(currencyCode, that.currencyCode) + && java.util.Objects.equals(rate, that.rate); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(currencyCode, rate); + } + } + public static class ShippingAddress { private String firstName; diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java index 4aaddf3bd..e9b29e752 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/ImportCreditNoteParams.java @@ -732,6 +732,8 @@ public static final class LineItemsParams { private final Long tax10Amount; + private final ProrationMode prorationMode; + private LineItemsParams(LineItemsBuilder builder) { this.referenceLineItemId = builder.referenceLineItemId; @@ -809,6 +811,8 @@ private LineItemsParams(LineItemsBuilder builder) { this.tax10Name = builder.tax10Name; this.tax10Amount = builder.tax10Amount; + + this.prorationMode = builder.prorationMode; } public String getReferenceLineItemId() { @@ -963,6 +967,10 @@ public Long getTax10Amount() { return tax10Amount; } + public ProrationMode getProrationMode() { + return prorationMode; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -1157,6 +1165,11 @@ public Map toFormData() { formData.put("tax10_amount", this.tax10Amount); } + if (this.prorationMode != null) { + + formData.put("proration_mode", this.prorationMode); + } + return formData; } @@ -1244,6 +1257,8 @@ public static final class LineItemsBuilder { private Long tax10Amount; + private ProrationMode prorationMode; + private LineItemsBuilder() {} public LineItemsBuilder referenceLineItemId(String value) { @@ -1436,6 +1451,11 @@ public LineItemsBuilder tax10Amount(Long value) { return this; } + public LineItemsBuilder prorationMode(ProrationMode value) { + this.prorationMode = value; + return this; + } + public LineItemsParams build() { return new LineItemsParams(this); } @@ -1478,6 +1498,38 @@ public static EntityType fromString(String value) { return _UNKNOWN; } } + + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } public static final class LineItemTiersParams { diff --git a/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java b/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java index 34531a959..c7b6c6983 100644 --- a/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java +++ b/src/main/java/com/chargebee/v4/models/creditNoteEstimate/CreditNoteEstimate.java @@ -319,6 +319,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -420,6 +421,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -536,6 +541,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -598,6 +635,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -654,6 +693,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -687,7 +728,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -718,7 +760,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } diff --git a/src/main/java/com/chargebee/v4/models/customer/Customer.java b/src/main/java/com/chargebee/v4/models/customer/Customer.java index 130d1838d..64e5176d0 100644 --- a/src/main/java/com/chargebee/v4/models/customer/Customer.java +++ b/src/main/java/com/chargebee/v4/models/customer/Customer.java @@ -2147,6 +2147,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java index 4bf54aa1f..b7f5901b8 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java @@ -584,6 +584,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1245,6 +1251,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java index 5c7c73c55..0c045f076 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java @@ -2597,6 +2597,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3022,6 +3028,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java index df11d7a1c..ed6c5cb48 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java @@ -394,6 +394,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/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 toFormData() { Map formData = new LinkedHashMap<>(); @@ -1253,6 +1269,16 @@ public Map toFormData() { formData.put("date_to", this.dateTo); } + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.entityDescription != null) { + + formData.put("entity_description", this.entityDescription); + } + return formData; } @@ -1278,6 +1304,10 @@ public static final class ItemPricesBuilder { private Timestamp dateTo; + private String description; + + private String entityDescription; + private ItemPricesBuilder() {} public ItemPricesBuilder itemPriceId(String value) { @@ -1315,6 +1345,16 @@ public ItemPricesBuilder dateTo(Timestamp value) { return this; } + public ItemPricesBuilder description(String value) { + this.description = value; + return this; + } + + public ItemPricesBuilder entityDescription(String value) { + this.entityDescription = value; + return this; + } + public ItemPricesParams build() { return new ItemPricesParams(this); } @@ -1587,6 +1627,8 @@ public static final class ChargesParams { private final Timestamp dateTo; + private final String entityDescription; + private ChargesParams(ChargesBuilder builder) { this.amount = builder.amount; @@ -1614,6 +1656,8 @@ private ChargesParams(ChargesBuilder builder) { this.dateFrom = builder.dateFrom; this.dateTo = builder.dateTo; + + this.entityDescription = builder.entityDescription; } public Long getAmount() { @@ -1668,6 +1712,10 @@ public Timestamp getDateTo() { return dateTo; } + public String getEntityDescription() { + return entityDescription; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -1737,6 +1785,11 @@ public Map toFormData() { formData.put("date_to", this.dateTo); } + if (this.entityDescription != null) { + + formData.put("entity_description", this.entityDescription); + } + return formData; } @@ -1774,6 +1827,8 @@ public static final class ChargesBuilder { private Timestamp dateTo; + private String entityDescription; + private ChargesBuilder() {} public ChargesBuilder amount(Long value) { @@ -1841,6 +1896,11 @@ public ChargesBuilder dateTo(Timestamp value) { return this; } + public ChargesBuilder entityDescription(String value) { + this.entityDescription = value; + return this; + } + public ChargesParams build() { return new ChargesParams(this); } diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java index 2898229eb..901511a9f 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionForItemsParams.java @@ -830,6 +830,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java index f6bdf062a..38708cdbc 100644 --- a/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/estimate/params/EstimateGiftSubscriptionParams.java @@ -824,6 +824,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/event/Event.java b/src/main/java/com/chargebee/v4/models/event/Event.java index fb0d7bd26..2ccf040cf 100644 --- a/src/main/java/com/chargebee/v4/models/event/Event.java +++ b/src/main/java/com/chargebee/v4/models/event/Event.java @@ -483,6 +483,8 @@ public enum EventType { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), diff --git a/src/main/java/com/chargebee/v4/models/event/PaymentSourceBusinessEntityChangedEvent.java b/src/main/java/com/chargebee/v4/models/event/PaymentSourceBusinessEntityChangedEvent.java new file mode 100644 index 000000000..a2cb8e19a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/PaymentSourceBusinessEntityChangedEvent.java @@ -0,0 +1,203 @@ +/* + * 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.paymentSource.PaymentSource; + +import com.chargebee.v4.models.businessEntityTransfer.BusinessEntityTransfer; + +public class PaymentSourceBusinessEntityChangedEvent { + + 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 PaymentSourceBusinessEntityChangedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentSourceBusinessEntityChangedEvent fromJson( + java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static PaymentSourceBusinessEntityChangedEvent fromJson(JsonObject jsonObj) { + PaymentSourceBusinessEntityChangedEvent obj = new PaymentSourceBusinessEntityChangedEvent(); + + 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 "PaymentSourceBusinessEntityChangedEvent{" + + "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; + + PaymentSourceBusinessEntityChangedEvent that = (PaymentSourceBusinessEntityChangedEvent) 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 BusinessEntityTransfer businessEntityTransfer; + private PaymentSource paymentSource; + + public BusinessEntityTransfer getBusinessEntityTransfer() { + return businessEntityTransfer; + } + + public PaymentSource getPaymentSource() { + return paymentSource; + } + + 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 __businessEntityTransferObj = + JsonUtil.getJsonObject(jsonObj, "business_entity_transfer"); + if (__businessEntityTransferObj != null) { + obj.businessEntityTransfer = BusinessEntityTransfer.fromJson(__businessEntityTransferObj); + } + + JsonObject __paymentSourceObj = JsonUtil.getJsonObject(jsonObj, "payment_source"); + if (__paymentSourceObj != null) { + obj.paymentSource = PaymentSource.fromJson(__paymentSourceObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + + "businessEntityTransfer=" + + businessEntityTransfer + + ", paymentSource=" + + paymentSource + + "}"; + } + + @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(businessEntityTransfer, that.businessEntityTransfer) + && java.util.Objects.equals(paymentSource, that.paymentSource); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(businessEntityTransfer, paymentSource); + } + } +} 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 d5a9dc399..1c4bb6807 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 @@ -812,6 +812,8 @@ public enum EventTypeIs { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), @@ -1288,6 +1290,8 @@ public enum EventTypeIsNot { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), @@ -1764,6 +1768,8 @@ public enum EventTypeIn { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), @@ -2240,6 +2246,8 @@ public enum EventTypeNotIn { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), @@ -2994,6 +3002,8 @@ public enum EventType { SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + PAYMENT_SOURCE_BUSINESS_ENTITY_CHANGED("payment_source_business_entity_changed"), + PURCHASE_CREATED("purchase_created"), VOUCHER_CREATED("voucher_created"), diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java index af61c1fce..f4cdf17ca 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportSubscriptionsParams.java @@ -257,6 +257,10 @@ public ChannelFilter channel() { return new ChannelFilter("channel", this, filterParams); } + public DecommissionedFilter decommissioned() { + return new DecommissionedFilter("decommissioned", this, filterParams); + } + public PlanIdFilter planId() { return new PlanIdFilter("plan_id", this, filterParams); } @@ -362,6 +366,13 @@ public static final class ChannelFilter extends EnumFilter { + DecommissionedFilter( + String fieldName, SubscriptionBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + public static final class PlanIdFilter extends StringFilter { PlanIdFilter(String fieldName, SubscriptionBuilder builder, Map params) { super(fieldName, builder, params); diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java index ab5c77a52..4f1e04c83 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportTransactionsParams.java @@ -384,6 +384,12 @@ public enum PaymentMethod { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/feature/Feature.java b/src/main/java/com/chargebee/v4/models/feature/Feature.java index 7b32ae680..c10bd4338 100644 --- a/src/main/java/com/chargebee/v4/models/feature/Feature.java +++ b/src/main/java/com/chargebee/v4/models/feature/Feature.java @@ -23,6 +23,7 @@ public class Feature { private Long resourceVersion; private Timestamp updatedAt; private Timestamp createdAt; + private Boolean metered; private List levels; private java.util.Map customFields = new java.util.HashMap<>(); @@ -63,6 +64,10 @@ public Timestamp getCreatedAt() { return createdAt; } + public Boolean getMetered() { + return metered; + } + public List getLevels() { return levels; } @@ -180,6 +185,8 @@ public static Feature fromJson(JsonObject jsonObj) { knownFields.add("created_at"); + knownFields.add("metered"); + knownFields.add("levels"); obj.id = JsonUtil.getString(jsonObj, "id"); @@ -200,6 +207,8 @@ public static Feature fromJson(JsonObject jsonObj) { obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + obj.metered = JsonUtil.getBoolean(jsonObj, "metered"); + obj.levels = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "levels"), Levels::fromJson); obj.customFields = JsonUtil.extractCustomFields(jsonObj, knownFields); @@ -228,6 +237,8 @@ public String toString() { + updatedAt + ", createdAt=" + createdAt + + ", metered=" + + metered + ", levels=" + levels + ", customFields=" @@ -250,6 +261,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(resourceVersion, that.resourceVersion) && java.util.Objects.equals(updatedAt, that.updatedAt) && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(metered, that.metered) && java.util.Objects.equals(levels, that.levels) && java.util.Objects.equals(customFields, that.customFields); } @@ -267,6 +279,7 @@ public int hashCode() { resourceVersion, updatedAt, createdAt, + metered, levels, customFields); } diff --git a/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java b/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java index e4877d1ad..b36d5898e 100644 --- a/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java +++ b/src/main/java/com/chargebee/v4/models/feature/params/FeatureListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -73,6 +74,10 @@ public TypeFilter type() { return new TypeFilter("type", this, queryParams); } + public MeteredFilter metered() { + return new MeteredFilter("metered", this, queryParams); + } + /** * Create a filter for a custom field. * @@ -217,6 +222,25 @@ public FeatureListBuilder notIn(String... values) { return builder; } } + + public static final class MeteredFilter extends BooleanFilter { + MeteredFilter(String fieldName, FeatureListBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .metered().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public FeatureListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } } public enum StatusIs { @@ -467,6 +491,34 @@ public static TypeNotIn fromString(String value) { } } + public enum MeteredIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that MeteredIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + MeteredIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static MeteredIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (MeteredIs enumValue : MeteredIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public enum Status { ACTIVE("active"), diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java index b706d6f4f..6694a5c05 100644 --- a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateForItemsParams.java @@ -796,6 +796,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java index e85c1c63e..0ba39e987 100644 --- a/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftCreateParams.java @@ -772,6 +772,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java b/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java index a0fa40765..8f375f097 100644 --- a/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java +++ b/src/main/java/com/chargebee/v4/models/grantBlock/GrantBlock.java @@ -25,12 +25,12 @@ public class GrantBlock { private String voidedAmount; private String originGrantBlockId; private Status status; - private String metadata; private GrantSource grantSource; private Timestamp createdAt; private AccountType accountType; private String unitId; private UnitType unitType; + private java.util.Map metadata; public String getId() { return id; @@ -80,10 +80,6 @@ public Status getStatus() { return status; } - public String getMetadata() { - return metadata; - } - public GrantSource getGrantSource() { return grantSource; } @@ -104,6 +100,10 @@ public UnitType getUnitType() { return unitType; } + public java.util.Map getMetadata() { + return metadata; + } + public enum Status { AVAILABLE("available"), @@ -259,8 +259,6 @@ public static GrantBlock fromJson(JsonObject jsonObj) { obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); - obj.metadata = JsonUtil.getString(jsonObj, "metadata"); - obj.grantSource = GrantSource.fromString(JsonUtil.getString(jsonObj, "grant_source")); obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); @@ -271,6 +269,12 @@ public static GrantBlock fromJson(JsonObject jsonObj) { obj.unitType = UnitType.fromString(JsonUtil.getString(jsonObj, "unit_type")); + JsonObject __metadataObj = JsonUtil.getJsonObject(jsonObj, "metadata"); + obj.metadata = + __metadataObj != null + ? JsonUtil.parseJsonObjectToMap(__metadataObj) + : new java.util.HashMap<>(); + return obj; } @@ -301,8 +305,6 @@ public String toString() { + originGrantBlockId + ", status=" + status - + ", metadata=" - + metadata + ", grantSource=" + grantSource + ", createdAt=" @@ -313,6 +315,8 @@ public String toString() { + unitId + ", unitType=" + unitType + + ", metadata=" + + metadata + "}"; } @@ -334,12 +338,12 @@ public boolean equals(Object o) { && java.util.Objects.equals(voidedAmount, that.voidedAmount) && java.util.Objects.equals(originGrantBlockId, that.originGrantBlockId) && java.util.Objects.equals(status, that.status) - && java.util.Objects.equals(metadata, that.metadata) && java.util.Objects.equals(grantSource, that.grantSource) && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(accountType, that.accountType) && java.util.Objects.equals(unitId, that.unitId) - && java.util.Objects.equals(unitType, that.unitType); + && java.util.Objects.equals(unitType, that.unitType) + && java.util.Objects.equals(metadata, that.metadata); } @Override @@ -358,11 +362,11 @@ public int hashCode() { voidedAmount, originGrantBlockId, status, - metadata, grantSource, createdAt, accountType, unitId, - unitType); + unitType, + metadata); } } diff --git a/src/main/java/com/chargebee/v4/models/invoice/Invoice.java b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java index 78c5fb0fe..c65b4eb5a 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/Invoice.java +++ b/src/main/java/com/chargebee/v4/models/invoice/Invoice.java @@ -64,6 +64,7 @@ public class Invoice { private String vatNumberPrefix; private Channel channel; private String businessEntityId; + private List exchangeRates; private List lineItems; private List lineItemTiers; private List lineItemDiscounts; @@ -281,6 +282,10 @@ public String getBusinessEntityId() { return businessEntityId; } + public List getExchangeRates() { + return exchangeRates; + } + public List getLineItems() { return lineItems; } @@ -624,6 +629,8 @@ public static Invoice fromJson(JsonObject jsonObj) { knownFields.add("business_entity_id"); + knownFields.add("exchange_rates"); + knownFields.add("line_items"); knownFields.add("line_item_tiers"); @@ -764,6 +771,10 @@ public static Invoice fromJson(JsonObject jsonObj) { obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); + obj.exchangeRates = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "exchange_rates"), ExchangeRates::fromJson); + obj.lineItems = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "line_items"), LineItems::fromJson); @@ -958,6 +969,8 @@ public String toString() { + channel + ", businessEntityId=" + businessEntityId + + ", exchangeRates=" + + exchangeRates + ", lineItems=" + lineItems + ", lineItemTiers=" @@ -1061,6 +1074,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(vatNumberPrefix, that.vatNumberPrefix) && java.util.Objects.equals(channel, that.channel) && java.util.Objects.equals(businessEntityId, that.businessEntityId) + && java.util.Objects.equals(exchangeRates, that.exchangeRates) && java.util.Objects.equals(lineItems, that.lineItems) && java.util.Objects.equals(lineItemTiers, that.lineItemTiers) && java.util.Objects.equals(lineItemDiscounts, that.lineItemDiscounts) @@ -1138,6 +1152,7 @@ public int hashCode() { vatNumberPrefix, channel, businessEntityId, + exchangeRates, lineItems, lineItemTiers, lineItemDiscounts, @@ -1163,6 +1178,59 @@ public int hashCode() { customFields); } + public static class ExchangeRates { + + private String currencyCode; + private BigDecimal rate; + + public String getCurrencyCode() { + return currencyCode; + } + + public BigDecimal getRate() { + return rate; + } + + public static ExchangeRates fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ExchangeRates fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ExchangeRates fromJson(JsonObject jsonObj) { + ExchangeRates obj = new ExchangeRates(); + + obj.currencyCode = JsonUtil.getString(jsonObj, "currency_code"); + + obj.rate = JsonUtil.getBigDecimal(jsonObj, "rate"); + + return obj; + } + + @Override + public String toString() { + return "ExchangeRates{" + "currencyCode=" + currencyCode + ", rate=" + rate + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ExchangeRates that = (ExchangeRates) o; + return java.util.Objects.equals(currencyCode, that.currencyCode) + && java.util.Objects.equals(rate, that.rate); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(currencyCode, rate); + } + } + public static class LineItems { private String id; @@ -1190,6 +1258,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -1291,6 +1360,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -1407,6 +1480,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -1469,6 +1574,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -1525,6 +1632,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -1558,7 +1667,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -1589,7 +1699,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } @@ -3173,6 +3284,8 @@ public enum DunningType { DIRECT_DEBIT("direct_debit"), + REAL_TIME_PAYMENTS("real_time_payments"), + /** An enum member indicating that DunningType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java index 7535e1038..2f1f7a545 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/ImportInvoiceParams.java @@ -60,6 +60,8 @@ public final class ImportInvoiceParams { private final Boolean useForProration; + private final Timestamp paidAt; + private final CreditNoteParams creditNote; private final BillingAddressParams billingAddress; @@ -130,6 +132,8 @@ private ImportInvoiceParams(ImportInvoiceBuilder builder) { this.useForProration = builder.useForProration; + this.paidAt = builder.paidAt; + this.creditNote = builder.creditNote; this.billingAddress = builder.billingAddress; @@ -246,6 +250,10 @@ public Boolean getUseForProration() { return useForProration; } + public Timestamp getPaidAt() { + return paidAt; + } + public CreditNoteParams getCreditNote() { return creditNote; } @@ -408,6 +416,11 @@ public Map toFormData() { formData.put("use_for_proration", this.useForProration); } + if (this.paidAt != null) { + + formData.put("paid_at", this.paidAt); + } + if (this.creditNote != null) { // Single object @@ -615,6 +628,8 @@ public static final class ImportInvoiceBuilder { private Boolean useForProration; + private Timestamp paidAt; + private CreditNoteParams creditNote; private BillingAddressParams billingAddress; @@ -751,6 +766,11 @@ public ImportInvoiceBuilder useForProration(Boolean value) { return this; } + public ImportInvoiceBuilder paidAt(Timestamp value) { + this.paidAt = value; + return this; + } + public ImportInvoiceBuilder creditNote(CreditNoteParams value) { this.creditNote = value; return this; @@ -876,12 +896,24 @@ public static PriceType fromString(String value) { } public enum TaxOverrideReason { + ZERO_RATED("zero_rated"), + ID_EXEMPT("id_exempt"), CUSTOMER_EXEMPT("customer_exempt"), + REGION_NON_TAXABLE("region_non_taxable"), + + PRODUCT_EXEMPT("product_exempt"), + EXPORT("export"), + HIGH_VALUE_PHYSICAL_GOODS("high_value_physical_goods"), + + ZERO_VALUE_ITEM("zero_value_item"), + + TAX_NOT_CONFIGURED_EXTERNAL_PROVIDER("tax_not_configured_external_provider"), + /** An enum member indicating that TaxOverrideReason was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1745,6 +1777,8 @@ public static final class LineItemsParams { private final Long tax10Amount; + private final ProrationMode prorationMode; + private final Timestamp createdAt; private LineItemsParams(LineItemsBuilder builder) { @@ -1823,6 +1857,8 @@ private LineItemsParams(LineItemsBuilder builder) { this.tax10Amount = builder.tax10Amount; + this.prorationMode = builder.prorationMode; + this.createdAt = builder.createdAt; } @@ -1974,6 +2010,10 @@ public Long getTax10Amount() { return tax10Amount; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public Timestamp getCreatedAt() { return createdAt; } @@ -2167,6 +2207,11 @@ public Map toFormData() { formData.put("tax10_amount", this.tax10Amount); } + if (this.prorationMode != null) { + + formData.put("proration_mode", this.prorationMode); + } + if (this.createdAt != null) { formData.put("created_at", this.createdAt); @@ -2257,6 +2302,8 @@ public static final class LineItemsBuilder { private Long tax10Amount; + private ProrationMode prorationMode; + private Timestamp createdAt; private LineItemsBuilder() {} @@ -2446,6 +2493,11 @@ public LineItemsBuilder tax10Amount(Long value) { return this; } + public LineItemsBuilder prorationMode(ProrationMode value) { + this.prorationMode = value; + return this; + } + public LineItemsBuilder createdAt(Timestamp value) { this.createdAt = value; return this; @@ -2493,6 +2545,38 @@ public static EntityType fromString(String value) { return _UNKNOWN; } } + + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } public static final class PaymentReferenceNumbersParams { diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java index d966a45a9..547b79d13 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java @@ -43,6 +43,8 @@ public final class InvoiceCreateForChargeItemsAndChargesParams { private final Timestamp invoiceDate; + private final Boolean createPendingInvoice; + private final String tokenId; private final Boolean replacePrimaryPaymentSource; @@ -106,6 +108,8 @@ private InvoiceCreateForChargeItemsAndChargesParams( this.invoiceDate = builder.invoiceDate; + this.createPendingInvoice = builder.createPendingInvoice; + this.tokenId = builder.tokenId; this.replacePrimaryPaymentSource = builder.replacePrimaryPaymentSource; @@ -196,6 +200,10 @@ public Timestamp getInvoiceDate() { return invoiceDate; } + public Boolean getCreatePendingInvoice() { + return createPendingInvoice; + } + public String getTokenId() { return tokenId; } @@ -333,6 +341,11 @@ public Map toFormData() { formData.put("invoice_date", this.invoiceDate); } + if (this.createPendingInvoice != null) { + + formData.put("create_pending_invoice", this.createPendingInvoice); + } + if (this.tokenId != null) { formData.put("token_id", this.tokenId); @@ -542,6 +555,8 @@ public static final class InvoiceCreateForChargeItemsAndChargesBuilder { private Timestamp invoiceDate; + private Boolean createPendingInvoice; + private String tokenId; private Boolean replacePrimaryPaymentSource; @@ -644,6 +659,11 @@ public InvoiceCreateForChargeItemsAndChargesBuilder invoiceDate(Timestamp value) return this; } + public InvoiceCreateForChargeItemsAndChargesBuilder createPendingInvoice(Boolean value) { + this.createPendingInvoice = value; + return this; + } + public InvoiceCreateForChargeItemsAndChargesBuilder tokenId(String value) { this.tokenId = value; return this; @@ -2521,6 +2541,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2946,6 +2972,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -2988,6 +3020,10 @@ public static final class ItemPricesParams { private final Timestamp dateTo; + private final String description; + + private final String entityDescription; + private ItemPricesParams(ItemPricesBuilder builder) { this.itemPriceId = builder.itemPriceId; @@ -3003,6 +3039,10 @@ private ItemPricesParams(ItemPricesBuilder builder) { this.dateFrom = builder.dateFrom; this.dateTo = builder.dateTo; + + this.description = builder.description; + + this.entityDescription = builder.entityDescription; } public String getItemPriceId() { @@ -3033,6 +3073,14 @@ public Timestamp getDateTo() { return dateTo; } + public String getDescription() { + return description; + } + + public String getEntityDescription() { + return entityDescription; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -3072,6 +3120,16 @@ public Map toFormData() { formData.put("date_to", this.dateTo); } + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.entityDescription != null) { + + formData.put("entity_description", this.entityDescription); + } + return formData; } @@ -3097,6 +3155,10 @@ public static final class ItemPricesBuilder { private Timestamp dateTo; + private String description; + + private String entityDescription; + private ItemPricesBuilder() {} public ItemPricesBuilder itemPriceId(String value) { @@ -3134,6 +3196,16 @@ public ItemPricesBuilder dateTo(Timestamp value) { return this; } + public ItemPricesBuilder description(String value) { + this.description = value; + return this; + } + + public ItemPricesBuilder entityDescription(String value) { + this.entityDescription = value; + return this; + } + public ItemPricesParams build() { return new ItemPricesParams(this); } @@ -3380,6 +3452,8 @@ public static PricingType fromString(String value) { public static final class ChargesParams { + private final String entityDescription; + private final Long amount; private final String amountInDecimal; @@ -3408,6 +3482,8 @@ public static final class ChargesParams { private ChargesParams(ChargesBuilder builder) { + this.entityDescription = builder.entityDescription; + this.amount = builder.amount; this.amountInDecimal = builder.amountInDecimal; @@ -3435,6 +3511,10 @@ private ChargesParams(ChargesBuilder builder) { this.dateTo = builder.dateTo; } + public String getEntityDescription() { + return entityDescription; + } + public Long getAmount() { return amount; } @@ -3491,6 +3571,11 @@ public Timestamp getDateTo() { public Map toFormData() { Map formData = new LinkedHashMap<>(); + if (this.entityDescription != null) { + + formData.put("entity_description", this.entityDescription); + } + if (this.amount != null) { formData.put("amount", this.amount); @@ -3567,6 +3652,8 @@ public static ChargesBuilder builder() { public static final class ChargesBuilder { + private String entityDescription; + private Long amount; private String amountInDecimal; @@ -3595,6 +3682,11 @@ public static final class ChargesBuilder { private ChargesBuilder() {} + public ChargesBuilder entityDescription(String value) { + this.entityDescription = value; + return this; + } + public ChargesBuilder amount(Long value) { this.amount = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java index 073b77c70..4aaeaff7e 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java @@ -2382,6 +2382,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2807,6 +2813,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java b/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java index 9e9f8794f..3ea7726bd 100644 --- a/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java +++ b/src/main/java/com/chargebee/v4/models/invoiceEstimate/InvoiceEstimate.java @@ -315,6 +315,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -416,6 +417,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -532,6 +537,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -594,6 +631,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -650,6 +689,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -683,7 +724,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -714,7 +756,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java index 37e6667aa..21a9948d3 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/LedgerOperation.java @@ -16,8 +16,6 @@ public class LedgerOperation { private String id; private Type type; private String amount; - private String startBalance; - private String endBalance; private String provisionedStartBalance; private String provisionedEndBalance; private String overdraftStartBalance; @@ -25,12 +23,12 @@ public class LedgerOperation { private String parentLedgerOperationId; private Timestamp ledgerOperationTimestamp; private Timestamp autoReleaseTimestamp; - private String metadata; private Timestamp createdAt; private Timestamp modifiedAt; private String subscriptionId; private String unitId; private UnitType unitType; + private java.util.Map metadata; public String getId() { return id; @@ -44,14 +42,6 @@ public String getAmount() { return amount; } - public String getStartBalance() { - return startBalance; - } - - public String getEndBalance() { - return endBalance; - } - public String getProvisionedStartBalance() { return provisionedStartBalance; } @@ -80,10 +70,6 @@ public Timestamp getAutoReleaseTimestamp() { return autoReleaseTimestamp; } - public String getMetadata() { - return metadata; - } - public Timestamp getCreatedAt() { return createdAt; } @@ -104,6 +90,10 @@ public UnitType getUnitType() { return unitType; } + public java.util.Map getMetadata() { + return metadata; + } + public enum Type { ALLOCATION("allocation"), @@ -189,10 +179,6 @@ public static LedgerOperation fromJson(JsonObject jsonObj) { obj.amount = JsonUtil.getString(jsonObj, "amount"); - obj.startBalance = JsonUtil.getString(jsonObj, "start_balance"); - - obj.endBalance = JsonUtil.getString(jsonObj, "end_balance"); - obj.provisionedStartBalance = JsonUtil.getString(jsonObj, "provisioned_start_balance"); obj.provisionedEndBalance = JsonUtil.getString(jsonObj, "provisioned_end_balance"); @@ -207,8 +193,6 @@ public static LedgerOperation fromJson(JsonObject jsonObj) { obj.autoReleaseTimestamp = JsonUtil.getTimestamp(jsonObj, "auto_release_timestamp"); - obj.metadata = JsonUtil.getString(jsonObj, "metadata"); - obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); @@ -219,6 +203,12 @@ public static LedgerOperation fromJson(JsonObject jsonObj) { obj.unitType = UnitType.fromString(JsonUtil.getString(jsonObj, "unit_type")); + JsonObject __metadataObj = JsonUtil.getJsonObject(jsonObj, "metadata"); + obj.metadata = + __metadataObj != null + ? JsonUtil.parseJsonObjectToMap(__metadataObj) + : new java.util.HashMap<>(); + return obj; } @@ -231,10 +221,6 @@ public String toString() { + type + ", amount=" + amount - + ", startBalance=" - + startBalance - + ", endBalance=" - + endBalance + ", provisionedStartBalance=" + provisionedStartBalance + ", provisionedEndBalance=" @@ -249,8 +235,6 @@ public String toString() { + ledgerOperationTimestamp + ", autoReleaseTimestamp=" + autoReleaseTimestamp - + ", metadata=" - + metadata + ", createdAt=" + createdAt + ", modifiedAt=" @@ -261,6 +245,8 @@ public String toString() { + unitId + ", unitType=" + unitType + + ", metadata=" + + metadata + "}"; } @@ -273,8 +259,6 @@ public boolean equals(Object o) { return java.util.Objects.equals(id, that.id) && java.util.Objects.equals(type, that.type) && java.util.Objects.equals(amount, that.amount) - && java.util.Objects.equals(startBalance, that.startBalance) - && java.util.Objects.equals(endBalance, that.endBalance) && java.util.Objects.equals(provisionedStartBalance, that.provisionedStartBalance) && java.util.Objects.equals(provisionedEndBalance, that.provisionedEndBalance) && java.util.Objects.equals(overdraftStartBalance, that.overdraftStartBalance) @@ -282,12 +266,12 @@ public boolean equals(Object o) { && java.util.Objects.equals(parentLedgerOperationId, that.parentLedgerOperationId) && java.util.Objects.equals(ledgerOperationTimestamp, that.ledgerOperationTimestamp) && java.util.Objects.equals(autoReleaseTimestamp, that.autoReleaseTimestamp) - && java.util.Objects.equals(metadata, that.metadata) && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(modifiedAt, that.modifiedAt) && java.util.Objects.equals(subscriptionId, that.subscriptionId) && java.util.Objects.equals(unitId, that.unitId) - && java.util.Objects.equals(unitType, that.unitType); + && java.util.Objects.equals(unitType, that.unitType) + && java.util.Objects.equals(metadata, that.metadata); } @Override @@ -297,8 +281,6 @@ public int hashCode() { id, type, amount, - startBalance, - endBalance, provisionedStartBalance, provisionedEndBalance, overdraftStartBalance, @@ -306,11 +288,11 @@ public int hashCode() { parentLedgerOperationId, ledgerOperationTimestamp, autoReleaseTimestamp, - metadata, createdAt, modifiedAt, subscriptionId, unitId, - unitType); + unitType, + metadata); } } 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/meter/Meter.java b/src/main/java/com/chargebee/v4/models/meter/Meter.java new file mode 100644 index 000000000..7fb8d6b0a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meter/Meter.java @@ -0,0 +1,602 @@ +/* + * 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.meter; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; +import java.util.List; + +public class Meter { + + private String id; + private String name; + private String description; + private Type type; + private Status status; + private String query; + private Timestamp createdAt; + private Timestamp updatedAt; + private List columnDefinitions; + private List features; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Type getType() { + return type; + } + + public Status getStatus() { + return status; + } + + public String getQuery() { + return query; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public List getColumnDefinitions() { + return columnDefinitions; + } + + public List getFeatures() { + return features; + } + + public enum Type { + SIMPLE("simple"), + + COMPOUND("compound"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** 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 Meter fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Meter fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Meter fromJson(JsonObject jsonObj) { + Meter obj = new Meter(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.type = Type.fromString(JsonUtil.getString(jsonObj, "type")); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.query = JsonUtil.getString(jsonObj, "query"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.columnDefinitions = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "column_definitions"), ColumnDefinitions::fromJson); + + obj.features = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "features"), Features::fromJson); + + return obj; + } + + @Override + public String toString() { + return "Meter{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", type=" + + type + + ", status=" + + status + + ", query=" + + query + + ", createdAt=" + + createdAt + + ", updatedAt=" + + updatedAt + + ", columnDefinitions=" + + columnDefinitions + + ", features=" + + features + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Meter that = (Meter) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(query, that.query) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(columnDefinitions, that.columnDefinitions) + && java.util.Objects.equals(features, that.features); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + name, + description, + type, + status, + query, + createdAt, + updatedAt, + columnDefinitions, + features); + } + + public static class ColumnDefinitions { + + private String columnName; + private DataType dataType; + + public String getColumnName() { + return columnName; + } + + public DataType getDataType() { + return dataType; + } + + public enum DataType { + NUMBER("number"), + + STRING("string"), + + /** An enum member indicating that DataType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DataType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DataType enumValue : DataType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static ColumnDefinitions fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ColumnDefinitions fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ColumnDefinitions fromJson(JsonObject jsonObj) { + ColumnDefinitions obj = new ColumnDefinitions(); + + obj.columnName = JsonUtil.getString(jsonObj, "column_name"); + + obj.dataType = DataType.fromString(JsonUtil.getString(jsonObj, "data_type")); + + return obj; + } + + @Override + public String toString() { + return "ColumnDefinitions{" + "columnName=" + columnName + ", dataType=" + dataType + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ColumnDefinitions that = (ColumnDefinitions) o; + return java.util.Objects.equals(columnName, that.columnName) + && java.util.Objects.equals(dataType, that.dataType); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(columnName, dataType); + } + } + + public static class Features { + + private String id; + private String name; + private String description; + private Status status; + private Type type; + private String unit; + private Long resourceVersion; + private Timestamp updatedAt; + private Timestamp createdAt; + private Boolean metered; + private List levels; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Status getStatus() { + return status; + } + + public Type getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Boolean getMetered() { + return metered; + } + + public List getLevels() { + return levels; + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + 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; + } + } + + public enum Type { + SWITCH("switch"), + + CUSTOM("custom"), + + QUANTITY("quantity"), + + RANGE("range"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static Features fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Features fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Features fromJson(JsonObject jsonObj) { + Features obj = new Features(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.type = Type.fromString(JsonUtil.getString(jsonObj, "type")); + + obj.unit = JsonUtil.getString(jsonObj, "unit"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.metered = JsonUtil.getBoolean(jsonObj, "metered"); + + obj.levels = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "levels"), Levels::fromJson); + + return obj; + } + + @Override + public String toString() { + return "Features{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", status=" + + status + + ", type=" + + type + + ", unit=" + + unit + + ", resourceVersion=" + + resourceVersion + + ", updatedAt=" + + updatedAt + + ", createdAt=" + + createdAt + + ", metered=" + + metered + + ", levels=" + + levels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Features that = (Features) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(unit, that.unit) + && java.util.Objects.equals(resourceVersion, that.resourceVersion) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(metered, that.metered) + && java.util.Objects.equals(levels, that.levels); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + name, + description, + status, + type, + unit, + resourceVersion, + updatedAt, + createdAt, + metered, + levels); + } + + public static class Levels { + + private String name; + private String value; + private Integer level; + private Boolean isUnlimited; + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public Integer getLevel() { + return level; + } + + public Boolean getIsUnlimited() { + return isUnlimited; + } + + public static Levels fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Levels fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Levels fromJson(JsonObject jsonObj) { + Levels obj = new Levels(); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.value = JsonUtil.getString(jsonObj, "value"); + + obj.level = JsonUtil.getInteger(jsonObj, "level"); + + obj.isUnlimited = JsonUtil.getBoolean(jsonObj, "is_unlimited"); + + return obj; + } + + @Override + public String toString() { + return "Levels{" + + "name=" + + name + + ", value=" + + value + + ", level=" + + level + + ", isUnlimited=" + + isUnlimited + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Levels that = (Levels) o; + return java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(value, that.value) + && java.util.Objects.equals(level, that.level) + && java.util.Objects.equals(isUnlimited, that.isUnlimited); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(name, value, level, isUnlimited); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meter/params/MeterListParams.java b/src/main/java/com/chargebee/v4/models/meter/params/MeterListParams.java new file mode 100644 index 000000000..0e5920b41 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meter/params/MeterListParams.java @@ -0,0 +1,187 @@ +/* + * 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.meter.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class MeterListParams { + + private final Map queryParams; + + private MeterListParams(MeterListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public MeterListBuilder toBuilder() { + MeterListBuilder builder = new MeterListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for MeterListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeterListBuilder builder() { + return new MeterListBuilder(); + } + + public static final class MeterListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private MeterListBuilder() {} + + public MeterListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public MeterListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public NameFilter name() { + return new NameFilter("name", this, queryParams); + } + + public SortBySortBuilder sortBy() { + return new SortBySortBuilder("sort_by", this); + } + + public MeterListParams build() { + return new MeterListParams(this); + } + + public static final class NameFilter extends StringFilter { + NameFilter(String fieldName, MeterListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class SortBySortBuilder { + private final String fieldName; + private final MeterListBuilder builder; + + SortBySortBuilder(String fieldName, MeterListBuilder builder) { + this.fieldName = fieldName; + this.builder = builder; + } + + public SortDirection id() { + return new SortDirection(fieldName, "id", builder); + } + + public SortDirection name() { + return new SortDirection(fieldName, "name", builder); + } + + public SortDirection created_at() { + return new SortDirection(fieldName, "created_at", builder); + } + + public SortDirection updated_at() { + return new SortDirection(fieldName, "updated_at", builder); + } + } + + public static final class SortDirection { + private final String fieldName; + private final String selectedField; + private final MeterListBuilder builder; + + SortDirection(String fieldName, String selectedField, MeterListBuilder builder) { + this.fieldName = fieldName; + this.selectedField = selectedField; + this.builder = builder; + } + + public MeterListBuilder asc() { + builder.queryParams.put(fieldName + "[asc]", selectedField); + return builder; + } + + public MeterListBuilder desc() { + builder.queryParams.put(fieldName + "[desc]", selectedField); + return builder; + } + } + } + + public enum SortByAsc { + ID("id"), + + NAME("name"), + + CREATED_AT("created_at"), + + UPDATED_AT("updated_at"), + + /** An enum member indicating that SortByAsc was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + SortByAsc(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SortByAsc fromString(String value) { + if (value == null) return _UNKNOWN; + for (SortByAsc enumValue : SortByAsc.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum SortByDesc { + ID("id"), + + NAME("name"), + + CREATED_AT("created_at"), + + UPDATED_AT("updated_at"), + + /** An enum member indicating that SortByDesc was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + SortByDesc(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static SortByDesc fromString(String value) { + if (value == null) return _UNKNOWN; + for (SortByDesc enumValue : SortByDesc.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meter/responses/MeterListResponse.java b/src/main/java/com/chargebee/v4/models/meter/responses/MeterListResponse.java new file mode 100644 index 000000000..29d3740fb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meter/responses/MeterListResponse.java @@ -0,0 +1,206 @@ +package com.chargebee.v4.models.meter.responses; + +import java.util.List; + +import com.chargebee.v4.models.meter.Meter; + +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.MeterService; +import com.chargebee.v4.models.meter.params.MeterListParams; + +/** Immutable response object for MeterList operation. Contains paginated list data. */ +public final class MeterListResponse { + + private final List list; + + private final String nextOffset; + + private final MeterService service; + private final MeterListParams originalParams; + private final Response httpResponse; + + private MeterListResponse( + List list, + String nextOffset, + MeterService service, + MeterListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into MeterListResponse object (no service context). Use this when you only + * need to read a single page (no nextPage()). + */ + public static MeterListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), MeterListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new MeterListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeterListResponse from JSON", e); + } + } + + /** + * Parse JSON response into MeterListResponse object with service context for pagination (enables + * nextPage()). + */ + public static MeterListResponse fromJson( + String json, MeterService service, MeterListParams originalParams, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), MeterListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new MeterListResponse(list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeterListResponse 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 MeterListResponse 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)."); + } + + MeterListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : MeterListParams.builder()) + .offset(nextOffset) + .build(); + + return service.list(nextParams); + } + + /** Get the raw response payload as JSON string. */ + public String responsePayload() { + return httpResponse != null ? httpResponse.getBodyAsString() : null; + } + + /** Get the HTTP status code. */ + public int httpStatus() { + return httpResponse != null ? httpResponse.getStatusCode() : 0; + } + + /** Get response headers. */ + public java.util.Map> headers() { + return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap(); + } + + /** Get a specific header value. */ + public java.util.List header(String name) { + if (httpResponse == null) return null; + return httpResponse.getHeaders().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(name)) + .map(java.util.Map.Entry::getValue) + .findFirst() + .orElse(null); + } + + @Override + public String toString() { + return "MeterListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeterListResponse that = (MeterListResponse) 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 MeterListItem { + + private Meter meter; + + public Meter getMeter() { + return meter; + } + + public static MeterListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static MeterListItem fromJson(JsonObject jsonObj) { + MeterListItem item = new MeterListItem(); + + JsonObject __meterObj = JsonUtil.getJsonObject(jsonObj, "meter"); + if (__meterObj != null) { + item.meter = Meter.fromJson(__meterObj); + } + + return item; + } + + @Override + public String toString() { + return "MeterListItem{" + "meter=" + meter + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeterListItem that = (MeterListItem) o; + return java.util.Objects.equals(meter, that.meter); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(meter); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/MeteredFeature.java b/src/main/java/com/chargebee/v4/models/meteredFeature/MeteredFeature.java new file mode 100644 index 000000000..4b44de393 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/MeteredFeature.java @@ -0,0 +1,573 @@ +/* + * 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.meteredFeature; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; +import java.util.List; + +public class MeteredFeature { + + private String id; + private String name; + private String description; + private Type type; + private Status status; + private String query; + private List columnDefinitions; + private List features; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Type getType() { + return type; + } + + public Status getStatus() { + return status; + } + + public String getQuery() { + return query; + } + + public List getColumnDefinitions() { + return columnDefinitions; + } + + public List getFeatures() { + return features; + } + + public enum Type { + SIMPLE("simple"), + + COMPOUND("compound"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + /** 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 MeteredFeature fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static MeteredFeature fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static MeteredFeature fromJson(JsonObject jsonObj) { + MeteredFeature obj = new MeteredFeature(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.type = Type.fromString(JsonUtil.getString(jsonObj, "type")); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.query = JsonUtil.getString(jsonObj, "query"); + + obj.columnDefinitions = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "column_definitions"), ColumnDefinitions::fromJson); + + obj.features = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "features"), Features::fromJson); + + return obj; + } + + @Override + public String toString() { + return "MeteredFeature{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", type=" + + type + + ", status=" + + status + + ", query=" + + query + + ", columnDefinitions=" + + columnDefinitions + + ", features=" + + features + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeteredFeature that = (MeteredFeature) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(query, that.query) + && java.util.Objects.equals(columnDefinitions, that.columnDefinitions) + && java.util.Objects.equals(features, that.features); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, name, description, type, status, query, columnDefinitions, features); + } + + public static class ColumnDefinitions { + + private String columnName; + private DataType dataType; + + public String getColumnName() { + return columnName; + } + + public DataType getDataType() { + return dataType; + } + + public enum DataType { + NUMBER("number"), + + STRING("string"), + + /** An enum member indicating that DataType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DataType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DataType enumValue : DataType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static ColumnDefinitions fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static ColumnDefinitions fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static ColumnDefinitions fromJson(JsonObject jsonObj) { + ColumnDefinitions obj = new ColumnDefinitions(); + + obj.columnName = JsonUtil.getString(jsonObj, "column_name"); + + obj.dataType = DataType.fromString(JsonUtil.getString(jsonObj, "data_type")); + + return obj; + } + + @Override + public String toString() { + return "ColumnDefinitions{" + "columnName=" + columnName + ", dataType=" + dataType + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ColumnDefinitions that = (ColumnDefinitions) o; + return java.util.Objects.equals(columnName, that.columnName) + && java.util.Objects.equals(dataType, that.dataType); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(columnName, dataType); + } + } + + public static class Features { + + private String id; + private String name; + private String description; + private Status status; + private Type type; + private String unit; + private Long resourceVersion; + private Timestamp updatedAt; + private Timestamp createdAt; + private Boolean metered; + private List levels; + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public Status getStatus() { + return status; + } + + public Type getType() { + return type; + } + + public String getUnit() { + return unit; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Boolean getMetered() { + return metered; + } + + public List getLevels() { + return levels; + } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + 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; + } + } + + public enum Type { + SWITCH("switch"), + + CUSTOM("custom"), + + QUANTITY("quantity"), + + RANGE("range"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static Features fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Features fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Features fromJson(JsonObject jsonObj) { + Features obj = new Features(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.type = Type.fromString(JsonUtil.getString(jsonObj, "type")); + + obj.unit = JsonUtil.getString(jsonObj, "unit"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.metered = JsonUtil.getBoolean(jsonObj, "metered"); + + obj.levels = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "levels"), Levels::fromJson); + + return obj; + } + + @Override + public String toString() { + return "Features{" + + "id=" + + id + + ", name=" + + name + + ", description=" + + description + + ", status=" + + status + + ", type=" + + type + + ", unit=" + + unit + + ", resourceVersion=" + + resourceVersion + + ", updatedAt=" + + updatedAt + + ", createdAt=" + + createdAt + + ", metered=" + + metered + + ", levels=" + + levels + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Features that = (Features) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(type, that.type) + && java.util.Objects.equals(unit, that.unit) + && java.util.Objects.equals(resourceVersion, that.resourceVersion) + && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(metered, that.metered) + && java.util.Objects.equals(levels, that.levels); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + name, + description, + status, + type, + unit, + resourceVersion, + updatedAt, + createdAt, + metered, + levels); + } + + public static class Levels { + + private String name; + private String value; + private Integer level; + private Boolean isUnlimited; + + public String getName() { + return name; + } + + public String getValue() { + return value; + } + + public Integer getLevel() { + return level; + } + + public Boolean getIsUnlimited() { + return isUnlimited; + } + + public static Levels fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Levels fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Levels fromJson(JsonObject jsonObj) { + Levels obj = new Levels(); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.value = JsonUtil.getString(jsonObj, "value"); + + obj.level = JsonUtil.getInteger(jsonObj, "level"); + + obj.isUnlimited = JsonUtil.getBoolean(jsonObj, "is_unlimited"); + + return obj; + } + + @Override + public String toString() { + return "Levels{" + + "name=" + + name + + ", value=" + + value + + ", level=" + + level + + ", isUnlimited=" + + isUnlimited + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Levels that = (Levels) o; + return java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(value, that.value) + && java.util.Objects.equals(level, that.level) + && java.util.Objects.equals(isUnlimited, that.isUnlimited); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(name, value, level, isUnlimited); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureArchiveParams.java b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureArchiveParams.java new file mode 100644 index 000000000..67df7e387 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureArchiveParams.java @@ -0,0 +1,39 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.meteredFeature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class MeteredFeatureArchiveParams { + + private MeteredFeatureArchiveParams(MeteredFeatureArchiveBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for MeteredFeatureArchiveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeteredFeatureArchiveBuilder builder() { + return new MeteredFeatureArchiveBuilder(); + } + + public static final class MeteredFeatureArchiveBuilder { + + private MeteredFeatureArchiveBuilder() {} + + public MeteredFeatureArchiveParams build() { + return new MeteredFeatureArchiveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureCreateParams.java b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureCreateParams.java new file mode 100644 index 000000000..db073da86 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureCreateParams.java @@ -0,0 +1,247 @@ +/* + * 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.meteredFeature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class MeteredFeatureCreateParams { + + private final String name; + + private final String description; + + private final String featureUnit; + + private final String query; + + private final List columnDefinitions; + + private MeteredFeatureCreateParams(MeteredFeatureCreateBuilder builder) { + + this.name = builder.name; + + this.description = builder.description; + + this.featureUnit = builder.featureUnit; + + this.query = builder.query; + + this.columnDefinitions = builder.columnDefinitions; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getFeatureUnit() { + return featureUnit; + } + + public String getQuery() { + return query; + } + + public List getColumnDefinitions() { + return columnDefinitions; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.featureUnit != null) { + + formData.put("feature_unit", this.featureUnit); + } + + if (this.query != null) { + + formData.put("query", this.query); + } + + if (this.columnDefinitions != null) { + + // List of objects + for (int i = 0; i < this.columnDefinitions.size(); i++) { + ColumnDefinitionsParams item = this.columnDefinitions.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "column_definitions[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for MeteredFeatureCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeteredFeatureCreateBuilder builder() { + return new MeteredFeatureCreateBuilder(); + } + + public static final class MeteredFeatureCreateBuilder { + + private String name; + + private String description; + + private String featureUnit; + + private String query; + + private List columnDefinitions; + + private MeteredFeatureCreateBuilder() {} + + public MeteredFeatureCreateBuilder name(String value) { + this.name = value; + return this; + } + + public MeteredFeatureCreateBuilder description(String value) { + this.description = value; + return this; + } + + public MeteredFeatureCreateBuilder featureUnit(String value) { + this.featureUnit = value; + return this; + } + + public MeteredFeatureCreateBuilder query(String value) { + this.query = value; + return this; + } + + public MeteredFeatureCreateBuilder columnDefinitions(List value) { + this.columnDefinitions = value; + return this; + } + + public MeteredFeatureCreateParams build() { + return new MeteredFeatureCreateParams(this); + } + } + + public static final class ColumnDefinitionsParams { + + private final String columnName; + + private final DataType dataType; + + private ColumnDefinitionsParams(ColumnDefinitionsBuilder builder) { + + this.columnName = builder.columnName; + + this.dataType = builder.dataType; + } + + public String getColumnName() { + return columnName; + } + + public DataType getDataType() { + return dataType; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.columnName != null) { + + formData.put("column_name", this.columnName); + } + + if (this.dataType != null) { + + formData.put("data_type", this.dataType); + } + + return formData; + } + + /** Create a new builder for ColumnDefinitionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ColumnDefinitionsBuilder builder() { + return new ColumnDefinitionsBuilder(); + } + + public static final class ColumnDefinitionsBuilder { + + private String columnName; + + private DataType dataType; + + private ColumnDefinitionsBuilder() {} + + public ColumnDefinitionsBuilder columnName(String value) { + this.columnName = value; + return this; + } + + public ColumnDefinitionsBuilder dataType(DataType value) { + this.dataType = value; + return this; + } + + public ColumnDefinitionsParams build() { + return new ColumnDefinitionsParams(this); + } + } + + public enum DataType { + NUMBER("number"), + + STRING("string"), + + /** An enum member indicating that DataType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DataType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DataType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DataType enumValue : DataType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureDeleteParams.java b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureDeleteParams.java new file mode 100644 index 000000000..0d3271267 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureDeleteParams.java @@ -0,0 +1,39 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.meteredFeature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class MeteredFeatureDeleteParams { + + private MeteredFeatureDeleteParams(MeteredFeatureDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for MeteredFeatureDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeteredFeatureDeleteBuilder builder() { + return new MeteredFeatureDeleteBuilder(); + } + + public static final class MeteredFeatureDeleteBuilder { + + private MeteredFeatureDeleteBuilder() {} + + public MeteredFeatureDeleteParams build() { + return new MeteredFeatureDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureReactivateParams.java b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureReactivateParams.java new file mode 100644 index 000000000..bf7a93c7a --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/params/MeteredFeatureReactivateParams.java @@ -0,0 +1,39 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.meteredFeature.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class MeteredFeatureReactivateParams { + + private MeteredFeatureReactivateParams(MeteredFeatureReactivateBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for MeteredFeatureReactivateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static MeteredFeatureReactivateBuilder builder() { + return new MeteredFeatureReactivateBuilder(); + } + + public static final class MeteredFeatureReactivateBuilder { + + private MeteredFeatureReactivateBuilder() {} + + public MeteredFeatureReactivateParams build() { + return new MeteredFeatureReactivateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureArchiveResponse.java b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureArchiveResponse.java new file mode 100644 index 000000000..09ad2eddf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureArchiveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.meteredFeature.responses; + +import com.chargebee.v4.models.meter.Meter; + +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 MeteredFeatureArchive operation. Contains the response data from + * the API. + */ +public final class MeteredFeatureArchiveResponse extends BaseResponse { + private final Meter meter; + + private MeteredFeatureArchiveResponse(Builder builder) { + super(builder.httpResponse); + + this.meter = builder.meter; + } + + /** Parse JSON response into MeteredFeatureArchiveResponse object. */ + public static MeteredFeatureArchiveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into MeteredFeatureArchiveResponse object with HTTP response. */ + public static MeteredFeatureArchiveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __meterObj = JsonUtil.getJsonObject(jsonObj, "meter"); + if (__meterObj != null) { + builder.meter(Meter.fromJson(__meterObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeteredFeatureArchiveResponse from JSON", e); + } + } + + /** Create a new builder for MeteredFeatureArchiveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MeteredFeatureArchiveResponse. */ + public static class Builder { + + private Meter meter; + + private Response httpResponse; + + private Builder() {} + + public Builder meter(Meter meter) { + this.meter = meter; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public MeteredFeatureArchiveResponse build() { + return new MeteredFeatureArchiveResponse(this); + } + } + + /** Get the meter from the response. */ + public Meter getMeter() { + return meter; + } + + @Override + public String toString() { + return "MeteredFeatureArchiveResponse{" + "meter=" + meter + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeteredFeatureArchiveResponse that = (MeteredFeatureArchiveResponse) o; + return java.util.Objects.equals(meter, that.meter); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(meter); + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureCreateResponse.java b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureCreateResponse.java new file mode 100644 index 000000000..9c831f67b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureCreateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.meteredFeature.responses; + +import com.chargebee.v4.models.meter.Meter; + +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 MeteredFeatureCreate operation. Contains the response data from the + * API. + */ +public final class MeteredFeatureCreateResponse extends BaseResponse { + private final Meter meter; + + private MeteredFeatureCreateResponse(Builder builder) { + super(builder.httpResponse); + + this.meter = builder.meter; + } + + /** Parse JSON response into MeteredFeatureCreateResponse object. */ + public static MeteredFeatureCreateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into MeteredFeatureCreateResponse object with HTTP response. */ + public static MeteredFeatureCreateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __meterObj = JsonUtil.getJsonObject(jsonObj, "meter"); + if (__meterObj != null) { + builder.meter(Meter.fromJson(__meterObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeteredFeatureCreateResponse from JSON", e); + } + } + + /** Create a new builder for MeteredFeatureCreateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MeteredFeatureCreateResponse. */ + public static class Builder { + + private Meter meter; + + private Response httpResponse; + + private Builder() {} + + public Builder meter(Meter meter) { + this.meter = meter; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public MeteredFeatureCreateResponse build() { + return new MeteredFeatureCreateResponse(this); + } + } + + /** Get the meter from the response. */ + public Meter getMeter() { + return meter; + } + + @Override + public String toString() { + return "MeteredFeatureCreateResponse{" + "meter=" + meter + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeteredFeatureCreateResponse that = (MeteredFeatureCreateResponse) o; + return java.util.Objects.equals(meter, that.meter); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(meter); + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureDeleteResponse.java b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureDeleteResponse.java new file mode 100644 index 000000000..e6d25934c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureDeleteResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.meteredFeature.responses; + +import com.chargebee.v4.models.meter.Meter; + +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 MeteredFeatureDelete operation. Contains the response data from the + * API. + */ +public final class MeteredFeatureDeleteResponse extends BaseResponse { + private final Meter meter; + + private MeteredFeatureDeleteResponse(Builder builder) { + super(builder.httpResponse); + + this.meter = builder.meter; + } + + /** Parse JSON response into MeteredFeatureDeleteResponse object. */ + public static MeteredFeatureDeleteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into MeteredFeatureDeleteResponse object with HTTP response. */ + public static MeteredFeatureDeleteResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __meterObj = JsonUtil.getJsonObject(jsonObj, "meter"); + if (__meterObj != null) { + builder.meter(Meter.fromJson(__meterObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeteredFeatureDeleteResponse from JSON", e); + } + } + + /** Create a new builder for MeteredFeatureDeleteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MeteredFeatureDeleteResponse. */ + public static class Builder { + + private Meter meter; + + private Response httpResponse; + + private Builder() {} + + public Builder meter(Meter meter) { + this.meter = meter; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public MeteredFeatureDeleteResponse build() { + return new MeteredFeatureDeleteResponse(this); + } + } + + /** Get the meter from the response. */ + public Meter getMeter() { + return meter; + } + + @Override + public String toString() { + return "MeteredFeatureDeleteResponse{" + "meter=" + meter + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeteredFeatureDeleteResponse that = (MeteredFeatureDeleteResponse) o; + return java.util.Objects.equals(meter, that.meter); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(meter); + } +} diff --git a/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureReactivateResponse.java b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureReactivateResponse.java new file mode 100644 index 000000000..59d784119 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/meteredFeature/responses/MeteredFeatureReactivateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.meteredFeature.responses; + +import com.chargebee.v4.models.meter.Meter; + +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 MeteredFeatureReactivate operation. Contains the response data from + * the API. + */ +public final class MeteredFeatureReactivateResponse extends BaseResponse { + private final Meter meter; + + private MeteredFeatureReactivateResponse(Builder builder) { + super(builder.httpResponse); + + this.meter = builder.meter; + } + + /** Parse JSON response into MeteredFeatureReactivateResponse object. */ + public static MeteredFeatureReactivateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into MeteredFeatureReactivateResponse object with HTTP response. */ + public static MeteredFeatureReactivateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __meterObj = JsonUtil.getJsonObject(jsonObj, "meter"); + if (__meterObj != null) { + builder.meter(Meter.fromJson(__meterObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse MeteredFeatureReactivateResponse from JSON", e); + } + } + + /** Create a new builder for MeteredFeatureReactivateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for MeteredFeatureReactivateResponse. */ + public static class Builder { + + private Meter meter; + + private Response httpResponse; + + private Builder() {} + + public Builder meter(Meter meter) { + this.meter = meter; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public MeteredFeatureReactivateResponse build() { + return new MeteredFeatureReactivateResponse(this); + } + } + + /** Get the meter from the response. */ + public Meter getMeter() { + return meter; + } + + @Override + public String toString() { + return "MeteredFeatureReactivateResponse{" + "meter=" + meter + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + MeteredFeatureReactivateResponse that = (MeteredFeatureReactivateResponse) o; + return java.util.Objects.equals(meter, that.meter); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(meter); + } +} 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 db7162729..c38ff6b38 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -33,6 +33,7 @@ public class PaymentIntent { private String businessEntityId; private ActivePaymentAttempt activePaymentAttempt; private List paymentAttempts; + private PaymentIntentMetadata paymentIntentMetadata; public String getId() { return id; @@ -110,6 +111,10 @@ public List getPaymentAttempts() { return paymentAttempts; } + public PaymentIntentMetadata getPaymentIntentMetadata() { + return paymentIntentMetadata; + } + public enum Status { INITED("inited"), @@ -235,6 +240,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -314,6 +325,12 @@ public static PaymentIntent fromJson(JsonObject jsonObj) { JsonUtil.mapArray( JsonUtil.getJsonArray(jsonObj, "payment_attempts"), PaymentAttempts::fromJson); + JsonObject __paymentIntentMetadataObj = + JsonUtil.getJsonObject(jsonObj, "payment_intent_metadata"); + if (__paymentIntentMetadataObj != null) { + obj.paymentIntentMetadata = PaymentIntentMetadata.fromJson(__paymentIntentMetadataObj); + } + return obj; } @@ -358,6 +375,8 @@ public String toString() { + activePaymentAttempt + ", paymentAttempts=" + paymentAttempts + + ", paymentIntentMetadata=" + + paymentIntentMetadata + "}"; } @@ -385,7 +404,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(businessEntityId, that.businessEntityId) && java.util.Objects.equals(activePaymentAttempt, that.activePaymentAttempt) - && java.util.Objects.equals(paymentAttempts, that.paymentAttempts); + && java.util.Objects.equals(paymentAttempts, that.paymentAttempts) + && java.util.Objects.equals(paymentIntentMetadata, that.paymentIntentMetadata); } @Override @@ -410,7 +430,8 @@ public int hashCode() { gateway, businessEntityId, activePaymentAttempt, - paymentAttempts); + paymentAttempts, + paymentIntentMetadata); } public static class ActivePaymentAttempt { @@ -595,6 +616,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -1104,6 +1131,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -1430,4 +1463,126 @@ public int hashCode() { } } } + + public static class PaymentIntentMetadata { + + private Source source; + private String clientIpAddress; + private String userAgent; + private Timestamp createdAt; + + public Source getSource() { + return source; + } + + public String getClientIpAddress() { + return clientIpAddress; + } + + public String getUserAgent() { + return userAgent; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public enum Source { + CB_JS("cb_js"), + + COMPONENTS_FIELDS("components_fields"), + + CHECKOUT_V_3("checkout_v3"), + + PAYNOW_V_3("paynow_v3"), + + PORTAL_V_3("portal_v3"), + + 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"), + + /** An enum member indicating that Source was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Source(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Source fromString(String value) { + if (value == null) return _UNKNOWN; + for (Source enumValue : Source.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static PaymentIntentMetadata fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentIntentMetadata fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static PaymentIntentMetadata fromJson(JsonObject jsonObj) { + PaymentIntentMetadata obj = new PaymentIntentMetadata(); + + obj.source = Source.fromString(JsonUtil.getString(jsonObj, "source")); + + obj.clientIpAddress = JsonUtil.getString(jsonObj, "client_ip_address"); + + obj.userAgent = JsonUtil.getString(jsonObj, "user_agent"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + return obj; + } + + @Override + public String toString() { + return "PaymentIntentMetadata{" + + "source=" + + source + + ", clientIpAddress=" + + clientIpAddress + + ", userAgent=" + + userAgent + + ", createdAt=" + + createdAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentIntentMetadata that = (PaymentIntentMetadata) o; + return java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(clientIpAddress, that.clientIpAddress) + && java.util.Objects.equals(userAgent, that.userAgent) + && java.util.Objects.equals(createdAt, that.createdAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(source, clientIpAddress, userAgent, createdAt); + } + } } diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java index 062eda0ed..acaeb383e 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java @@ -329,6 +329,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java index cf9a41c8f..dcd2bc730 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java @@ -249,6 +249,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java index 6225ca9e1..9689462fb 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -230,6 +230,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java index 6e652af95..2dd32ed57 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java @@ -384,6 +384,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java index e15265695..cb134e6ce 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java @@ -428,6 +428,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java index 4279d1221..d7d6aaceb 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java @@ -276,6 +276,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java index f8615c6e3..b64fba994 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java @@ -367,6 +367,12 @@ public enum TypeIs { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -485,6 +491,12 @@ public enum TypeIsNot { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -603,6 +615,12 @@ public enum TypeIn { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -721,6 +739,12 @@ public enum TypeNotIn { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that TypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1031,6 +1055,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/promotionalGrant/PromotionalGrant.java b/src/main/java/com/chargebee/v4/models/promotionalGrant/PromotionalGrant.java index a4af910f1..ea8f4201a 100644 --- a/src/main/java/com/chargebee/v4/models/promotionalGrant/PromotionalGrant.java +++ b/src/main/java/com/chargebee/v4/models/promotionalGrant/PromotionalGrant.java @@ -17,7 +17,7 @@ public class PromotionalGrant { private String unitId; private String amount; private Timestamp expiresAt; - private String metadata; + private java.util.Map metadata; public String getSubscriptionId() { return subscriptionId; @@ -35,7 +35,7 @@ public Timestamp getExpiresAt() { return expiresAt; } - public String getMetadata() { + public java.util.Map getMetadata() { return metadata; } @@ -58,7 +58,11 @@ public static PromotionalGrant fromJson(JsonObject jsonObj) { obj.expiresAt = JsonUtil.getTimestamp(jsonObj, "expires_at"); - obj.metadata = JsonUtil.getString(jsonObj, "metadata"); + JsonObject __metadataObj = JsonUtil.getJsonObject(jsonObj, "metadata"); + obj.metadata = + __metadataObj != null + ? JsonUtil.parseJsonObjectToMap(__metadataObj) + : new java.util.HashMap<>(); return obj; } diff --git a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java index f9d569b0f..a0387c9df 100644 --- a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java @@ -823,6 +823,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/quote/Quote.java b/src/main/java/com/chargebee/v4/models/quote/Quote.java index 33e4134c7..2d03f1b34 100644 --- a/src/main/java/com/chargebee/v4/models/quote/Quote.java +++ b/src/main/java/com/chargebee/v4/models/quote/Quote.java @@ -762,6 +762,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -863,6 +864,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -979,6 +984,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -1041,6 +1078,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -1097,6 +1136,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -1130,7 +1171,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -1161,7 +1203,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } diff --git a/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java b/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java index c55891fcc..3455e0062 100644 --- a/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java +++ b/src/main/java/com/chargebee/v4/models/quoteLineGroup/QuoteLineGroup.java @@ -273,6 +273,7 @@ public static class LineItems { private TaxExemptReason taxExemptReason; private String entityId; private String customerId; + private ProrationMode prorationMode; public String getId() { return id; @@ -374,6 +375,10 @@ public String getCustomerId() { return customerId; } + public ProrationMode getProrationMode() { + return prorationMode; + } + public enum PricingModel { FLAT_FEE("flat_fee"), @@ -490,6 +495,38 @@ public static TaxExemptReason fromString(String value) { } } + public enum ProrationMode { + RESET("reset"), + + DELTA("delta"), + + SERVICE_PERIOD_REVISION("service_period_revision"), + + ADJUSTED_TERM("adjusted_term"), + + /** An enum member indicating that ProrationMode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ProrationMode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ProrationMode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ProrationMode enumValue : ProrationMode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static LineItems fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -552,6 +589,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + obj.prorationMode = ProrationMode.fromString(JsonUtil.getString(jsonObj, "proration_mode")); + return obj; } @@ -608,6 +647,8 @@ public String toString() { + entityId + ", customerId=" + customerId + + ", prorationMode=" + + prorationMode + "}"; } @@ -641,7 +682,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(entityType, that.entityType) && java.util.Objects.equals(taxExemptReason, that.taxExemptReason) && java.util.Objects.equals(entityId, that.entityId) - && java.util.Objects.equals(customerId, that.customerId); + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(prorationMode, that.prorationMode); } @Override @@ -672,7 +714,8 @@ public int hashCode() { entityType, taxExemptReason, entityId, - customerId); + customerId, + prorationMode); } } diff --git a/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java b/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java index 8020f2a36..daca55755 100644 --- a/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java +++ b/src/main/java/com/chargebee/v4/models/quotedCharge/QuotedCharge.java @@ -120,6 +120,7 @@ public static class Charges { private Long amount; private String amountInDecimal; private String description; + private String entityDescription; private Integer servicePeriodInDays; private AvalaraSaleType avalaraSaleType; private Integer avalaraTransactionType; @@ -137,6 +138,10 @@ public String getDescription() { return description; } + public String getEntityDescription() { + return entityDescription; + } + public Integer getServicePeriodInDays() { return servicePeriodInDays; } @@ -202,6 +207,8 @@ public static Charges fromJson(JsonObject jsonObj) { obj.description = JsonUtil.getString(jsonObj, "description"); + obj.entityDescription = JsonUtil.getString(jsonObj, "entity_description"); + obj.servicePeriodInDays = JsonUtil.getInteger(jsonObj, "service_period_in_days"); obj.avalaraSaleType = @@ -223,6 +230,8 @@ public String toString() { + amountInDecimal + ", description=" + description + + ", entityDescription=" + + entityDescription + ", servicePeriodInDays=" + servicePeriodInDays + ", avalaraSaleType=" @@ -243,6 +252,7 @@ public boolean equals(Object o) { return java.util.Objects.equals(amount, that.amount) && java.util.Objects.equals(amountInDecimal, that.amountInDecimal) && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(entityDescription, that.entityDescription) && java.util.Objects.equals(servicePeriodInDays, that.servicePeriodInDays) && java.util.Objects.equals(avalaraSaleType, that.avalaraSaleType) && java.util.Objects.equals(avalaraTransactionType, that.avalaraTransactionType) @@ -256,6 +266,7 @@ public int hashCode() { amount, amountInDecimal, description, + entityDescription, servicePeriodInDays, avalaraSaleType, avalaraTransactionType, @@ -270,6 +281,8 @@ public static class InvoiceItems { private String quantityInDecimal; private Long unitPrice; private String unitPriceInDecimal; + private String description; + private String entityDescription; private Integer servicePeriodDays; public String getItemPriceId() { @@ -292,6 +305,14 @@ public String getUnitPriceInDecimal() { return unitPriceInDecimal; } + public String getDescription() { + return description; + } + + public String getEntityDescription() { + return entityDescription; + } + public Integer getServicePeriodDays() { return servicePeriodDays; } @@ -317,6 +338,10 @@ public static InvoiceItems fromJson(JsonObject jsonObj) { obj.unitPriceInDecimal = JsonUtil.getString(jsonObj, "unit_price_in_decimal"); + obj.description = JsonUtil.getString(jsonObj, "description"); + + obj.entityDescription = JsonUtil.getString(jsonObj, "entity_description"); + obj.servicePeriodDays = JsonUtil.getInteger(jsonObj, "service_period_days"); return obj; @@ -335,6 +360,10 @@ public String toString() { + unitPrice + ", unitPriceInDecimal=" + unitPriceInDecimal + + ", description=" + + description + + ", entityDescription=" + + entityDescription + ", servicePeriodDays=" + servicePeriodDays + "}"; @@ -351,6 +380,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(quantityInDecimal, that.quantityInDecimal) && java.util.Objects.equals(unitPrice, that.unitPrice) && java.util.Objects.equals(unitPriceInDecimal, that.unitPriceInDecimal) + && java.util.Objects.equals(description, that.description) + && java.util.Objects.equals(entityDescription, that.entityDescription) && java.util.Objects.equals(servicePeriodDays, that.servicePeriodDays); } @@ -363,6 +394,8 @@ public int hashCode() { quantityInDecimal, unitPrice, unitPriceInDecimal, + description, + entityDescription, servicePeriodDays); } } diff --git a/src/main/java/com/chargebee/v4/models/ramp/Ramp.java b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java index 5a631532e..823392bfe 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/Ramp.java +++ b/src/main/java/com/chargebee/v4/models/ramp/Ramp.java @@ -984,6 +984,7 @@ public static class DiscountsToAdd { private Type type; private Double percentage; private Long amount; + private Integer quantity; private DurationType durationType; private Integer period; private PeriodUnit periodUnit; @@ -1012,6 +1013,10 @@ public Long getAmount() { return amount; } + public Integer getQuantity() { + return quantity; + } + public DurationType getDurationType() { return durationType; } @@ -1045,6 +1050,8 @@ public enum Type { PERCENTAGE("percentage"), + OFFER_QUANTITY("offer_quantity"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1179,6 +1186,8 @@ public static DiscountsToAdd fromJson(JsonObject jsonObj) { obj.amount = JsonUtil.getLong(jsonObj, "amount"); + obj.quantity = JsonUtil.getInteger(jsonObj, "quantity"); + obj.durationType = DurationType.fromString(JsonUtil.getString(jsonObj, "duration_type")); obj.period = JsonUtil.getInteger(jsonObj, "period"); @@ -1209,6 +1218,8 @@ public String toString() { + percentage + ", amount=" + amount + + ", quantity=" + + quantity + ", durationType=" + durationType + ", period=" @@ -1237,6 +1248,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(type, that.type) && java.util.Objects.equals(percentage, that.percentage) && java.util.Objects.equals(amount, that.amount) + && java.util.Objects.equals(quantity, that.quantity) && java.util.Objects.equals(durationType, that.durationType) && java.util.Objects.equals(period, that.period) && java.util.Objects.equals(periodUnit, that.periodUnit) @@ -1255,6 +1267,7 @@ public int hashCode() { type, percentage, amount, + quantity, durationType, period, periodUnit, diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java index 0d57f2a2f..1105c6f74 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampCreateForSubscriptionParams.java @@ -1327,6 +1327,8 @@ public static final class DiscountsToAddParams { private final Long amount; + private final Integer quantity; + private final Integer period; private final PeriodUnit periodUnit; @@ -1345,6 +1347,8 @@ private DiscountsToAddParams(DiscountsToAddBuilder builder) { this.amount = builder.amount; + this.quantity = builder.quantity; + this.period = builder.period; this.periodUnit = builder.periodUnit; @@ -1370,6 +1374,10 @@ public Long getAmount() { return amount; } + public Integer getQuantity() { + return quantity; + } + public Integer getPeriod() { return period; } @@ -1410,6 +1418,11 @@ public Map toFormData() { formData.put("amount", this.amount); } + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + if (this.period != null) { formData.put("period", this.period); @@ -1449,6 +1462,8 @@ public static final class DiscountsToAddBuilder { private Long amount; + private Integer quantity; + private Integer period; private PeriodUnit periodUnit; @@ -1479,6 +1494,11 @@ public DiscountsToAddBuilder amount(Long value) { return this; } + public DiscountsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + public DiscountsToAddBuilder period(Integer value) { this.period = value; return this; 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/ramp/params/RampUpdateParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java index 29f76e370..9bf9c07bc 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampUpdateParams.java @@ -1327,6 +1327,8 @@ public static final class DiscountsToAddParams { private final Long amount; + private final Integer quantity; + private final Integer period; private final PeriodUnit periodUnit; @@ -1345,6 +1347,8 @@ private DiscountsToAddParams(DiscountsToAddBuilder builder) { this.amount = builder.amount; + this.quantity = builder.quantity; + this.period = builder.period; this.periodUnit = builder.periodUnit; @@ -1370,6 +1374,10 @@ public Long getAmount() { return amount; } + public Integer getQuantity() { + return quantity; + } + public Integer getPeriod() { return period; } @@ -1410,6 +1418,11 @@ public Map toFormData() { formData.put("amount", this.amount); } + if (this.quantity != null) { + + formData.put("quantity", this.quantity); + } + if (this.period != null) { formData.put("period", this.period); @@ -1449,6 +1462,8 @@ public static final class DiscountsToAddBuilder { private Long amount; + private Integer quantity; + private Integer period; private PeriodUnit periodUnit; @@ -1479,6 +1494,11 @@ public DiscountsToAddBuilder amount(Long value) { return this; } + public DiscountsToAddBuilder quantity(Integer value) { + this.quantity = value; + return this; + } + public DiscountsToAddBuilder period(Integer value) { this.period = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java index ead1eb3ca..b7eace073 100644 --- a/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/recordedPurchase/params/RecordedPurchaseCreateParams.java @@ -163,15 +163,39 @@ public static final class CustomerParams { private final String id; + private final String email; + + private final String firstName; + + private final String lastName; + private CustomerParams(CustomerBuilder builder) { this.id = builder.id; + + this.email = builder.email; + + this.firstName = builder.firstName; + + this.lastName = builder.lastName; } public String getId() { return id; } + public String getEmail() { + return email; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -181,6 +205,21 @@ public Map toFormData() { formData.put("id", this.id); } + if (this.email != null) { + + formData.put("email", this.email); + } + + if (this.firstName != null) { + + formData.put("first_name", this.firstName); + } + + if (this.lastName != null) { + + formData.put("last_name", this.lastName); + } + return formData; } @@ -194,6 +233,12 @@ public static final class CustomerBuilder { private String id; + private String email; + + private String firstName; + + private String lastName; + private CustomerBuilder() {} public CustomerBuilder id(String value) { @@ -201,6 +246,21 @@ public CustomerBuilder id(String value) { return this; } + public CustomerBuilder email(String value) { + this.email = value; + return this; + } + + public CustomerBuilder firstName(String value) { + this.firstName = value; + return this; + } + + public CustomerBuilder lastName(String value) { + this.lastName = value; + return this; + } + public CustomerParams build() { return new CustomerParams(this); } diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java index 1445cab78..86566a927 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java @@ -2644,6 +2644,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java index 1552571c4..fce774ca8 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java @@ -1737,6 +1737,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java index 1166f8ab3..89c1a5f38 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java @@ -3464,6 +3464,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3889,6 +3895,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java index 2af33af31..d2afd4894 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java @@ -1792,6 +1792,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java index 7634aa7d7..77b0f6205 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java @@ -145,6 +145,10 @@ public ChannelFilter channel() { return new ChannelFilter("channel", this, queryParams); } + public DecommissionedFilter decommissioned() { + return new DecommissionedFilter("decommissioned", this, queryParams); + } + public PlanIdFilter planId() { return new PlanIdFilter("plan_id", this, queryParams); } @@ -552,6 +556,26 @@ public SubscriptionListBuilder notIn(String... values) { } } + public static final class DecommissionedFilter extends BooleanFilter { + DecommissionedFilter( + String fieldName, SubscriptionListBuilder builder, Map params) { + super(fieldName, builder, params); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe boolean overload instead: + *
{@code .decommissioned().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + } + public static final class PlanIdFilter extends StringFilter { PlanIdFilter(String fieldName, SubscriptionListBuilder builder, Map params) { super(fieldName, builder, params); @@ -1470,6 +1494,34 @@ public static ChannelNotIn fromString(String value) { } } + public enum DecommissionedIs { + TRUE("true"), + + FALSE("false"), + + /** An enum member indicating that DecommissionedIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DecommissionedIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DecommissionedIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (DecommissionedIs enumValue : DecommissionedIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public enum Status { FUTURE("future"), diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java index 3a05d77dc..0be2ab6d8 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java @@ -780,6 +780,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java index 8aad9415a..41dd0c2ad 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java @@ -538,6 +538,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java index 440d67a58..df982ca86 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java @@ -2241,6 +2241,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2666,6 +2672,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java index f1be4f978..dc146e3fe 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java @@ -2156,6 +2156,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2581,6 +2587,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java index 43cd04466..36571e792 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java @@ -128,6 +128,12 @@ public enum Type { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/token/Token.java b/src/main/java/com/chargebee/v4/models/token/Token.java index e80f461ac..d5e28e972 100644 --- a/src/main/java/com/chargebee/v4/models/token/Token.java +++ b/src/main/java/com/chargebee/v4/models/token/Token.java @@ -315,6 +315,12 @@ public enum PaymentMethodType { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java index 6f261744d..b717c5faf 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java +++ b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java @@ -361,6 +361,12 @@ public enum PaymentMethod { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java index bb62e83e0..cef313e4a 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java @@ -686,6 +686,12 @@ public enum PaymentMethodIs { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -824,6 +830,12 @@ public enum PaymentMethodIsNot { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -962,6 +974,12 @@ public enum PaymentMethodIn { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1100,6 +1118,12 @@ public enum PaymentMethodNotIn { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethodNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2189,6 +2213,12 @@ public enum PaymentMethod { SOUTH_KOREAN_CARDS("south_korean_cards"), + PAYNOW("paynow"), + + BIZUM("bizum"), + + PROMPTPAY("promptpay"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/services/MeterService.java b/src/main/java/com/chargebee/v4/services/MeterService.java new file mode 100644 index 000000000..ad7a2f019 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/MeterService.java @@ -0,0 +1,101 @@ +/* + * 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.meter.params.MeterListParams; + +import com.chargebee.v4.models.meter.responses.MeterListResponse; + +public final class MeterService extends BaseService { + + private final ServiceConfig config; + + public MeterService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private MeterService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private MeterService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + MeterService with(RequestOptions newOptions) { + return new MeterService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public MeterService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** list a meter using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(MeterListParams params) throws ChargebeeException { + + return get("meter", "list", "/meters", params != null ? params.toQueryParams() : null); + } + + /** list a meter without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("meter", "list", "/meters", null); + } + + /** list a meter using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public MeterListResponse list(MeterListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return MeterListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for meter with params. */ + public CompletableFuture listAsync(MeterListParams params) { + + return getAsync("meter", "list", "/meters", params != null ? params.toQueryParams() : null) + .thenApply( + response -> + MeterListResponse.fromJson(response.getBodyAsString(), this, params, response)); + } + + public MeterListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return MeterListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for meter without params. */ + public CompletableFuture listAsync() { + + return getAsync("meter", "list", "/meters", null) + .thenApply( + response -> + MeterListResponse.fromJson(response.getBodyAsString(), this, null, response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/MeteredFeatureService.java b/src/main/java/com/chargebee/v4/services/MeteredFeatureService.java new file mode 100644 index 000000000..a3b70162c --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/MeteredFeatureService.java @@ -0,0 +1,193 @@ +/* + * 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.meteredFeature.params.MeteredFeatureCreateParams; + +import com.chargebee.v4.models.meteredFeature.responses.MeteredFeatureReactivateResponse; + +import com.chargebee.v4.models.meteredFeature.responses.MeteredFeatureDeleteResponse; + +import com.chargebee.v4.models.meteredFeature.responses.MeteredFeatureCreateResponse; + +import com.chargebee.v4.models.meteredFeature.responses.MeteredFeatureArchiveResponse; + +public final class MeteredFeatureService extends BaseService { + + private final ServiceConfig config; + + public MeteredFeatureService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private MeteredFeatureService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private MeteredFeatureService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + MeteredFeatureService with(RequestOptions newOptions) { + return new MeteredFeatureService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public MeteredFeatureService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** reactivate a meteredFeature (executes immediately) - returns raw Response. */ + Response reactivateRaw(String meteredFeatureId) throws ChargebeeException { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/reactivate_command", + "metered-feature-id", + meteredFeatureId); + + return post("meteredFeature", "reactivate", path, null); + } + + public MeteredFeatureReactivateResponse reactivate(String meteredFeatureId) + throws ChargebeeException { + Response response = reactivateRaw(meteredFeatureId); + return MeteredFeatureReactivateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of reactivate for meteredFeature without params. */ + public CompletableFuture reactivateAsync( + String meteredFeatureId) { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/reactivate_command", + "metered-feature-id", + meteredFeatureId); + + return postAsync("meteredFeature", "reactivate", path, null) + .thenApply( + response -> + MeteredFeatureReactivateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** delete a meteredFeature (executes immediately) - returns raw Response. */ + Response deleteRaw(String meteredFeatureId) throws ChargebeeException { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/delete", + "metered-feature-id", + meteredFeatureId); + + return post("meteredFeature", "delete", path, null); + } + + public MeteredFeatureDeleteResponse delete(String meteredFeatureId) throws ChargebeeException { + Response response = deleteRaw(meteredFeatureId); + return MeteredFeatureDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of delete for meteredFeature without params. */ + public CompletableFuture deleteAsync(String meteredFeatureId) { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/delete", + "metered-feature-id", + meteredFeatureId); + + return postAsync("meteredFeature", "delete", path, null) + .thenApply( + response -> + MeteredFeatureDeleteResponse.fromJson(response.getBodyAsString(), response)); + } + + /** + * create a meteredFeature using immutable params (executes immediately) - returns raw Response. + */ + Response createRaw(MeteredFeatureCreateParams params) throws ChargebeeException { + + return post( + "meteredFeature", + "create", + "/metered_features", + params != null ? params.toFormData() : null); + } + + /** + * create a meteredFeature using raw JSON payload (executes immediately) - returns raw Response. + */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("meteredFeature", "create", "/metered_features", jsonPayload); + } + + public MeteredFeatureCreateResponse create(MeteredFeatureCreateParams params) + throws ChargebeeException { + Response response = createRaw(params); + + return MeteredFeatureCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of create for meteredFeature with params. */ + public CompletableFuture createAsync( + MeteredFeatureCreateParams params) { + + return postAsync( + "meteredFeature", + "create", + "/metered_features", + params != null ? params.toFormData() : null) + .thenApply( + response -> + MeteredFeatureCreateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** archive a meteredFeature (executes immediately) - returns raw Response. */ + Response archiveRaw(String meteredFeatureId) throws ChargebeeException { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/archive_command", + "metered-feature-id", + meteredFeatureId); + + return post("meteredFeature", "archive", path, null); + } + + public MeteredFeatureArchiveResponse archive(String meteredFeatureId) throws ChargebeeException { + Response response = archiveRaw(meteredFeatureId); + return MeteredFeatureArchiveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of archive for meteredFeature without params. */ + public CompletableFuture archiveAsync(String meteredFeatureId) { + String path = + buildPathWithParams( + "/metered_features/{metered-feature-id}/archive_command", + "metered-feature-id", + meteredFeatureId); + + return postAsync("meteredFeature", "archive", path, null) + .thenApply( + response -> + MeteredFeatureArchiveResponse.fromJson(response.getBodyAsString(), response)); + } +} diff --git a/src/main/java/com/chargebee/v4/telemetry/TelemetryAttributeKeys.java b/src/main/java/com/chargebee/v4/telemetry/TelemetryAttributeKeys.java index 4a4a15f7a..0421c9cd2 100644 --- a/src/main/java/com/chargebee/v4/telemetry/TelemetryAttributeKeys.java +++ b/src/main/java/com/chargebee/v4/telemetry/TelemetryAttributeKeys.java @@ -24,7 +24,8 @@ public final class TelemetryAttributeKeys { public static final String HTTP_REQUEST_HEADER_ATTRIBUTE_PREFIX = "http.request.header."; public static final String CHARGEBEE_TELEMETRY_HEADER_PREFIX = "chargebee-"; - public static final String CHARGEBEE_TELEMETRY_HEADER_EXCLUDE_PREFIX = "chargebee-request-origin-"; + public static final String CHARGEBEE_TELEMETRY_HEADER_EXCLUDE_PREFIX = + "chargebee-request-origin-"; public static final String URL_FULL = "url.full"; public static final String HTTP_REQUEST_METHOD = "http.request.method";