diff --git a/CHANGELOG.md b/CHANGELOG.md index b7954424..66385d5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,19 @@ +### v4.0.1 (2026-01-19) +* * * + +### New Parameters: +* `applicable_item_price_ids` has been added to Coupon#CouponListRequest. +* `applicable_item_price_ids` has been added to Export#CouponRequest. + +### New Enums: +* `Twikey` has been added to GatewayEnum. + +### Deleted Action: +* `move` action has been removed from the ItemPrice. + +### New Features: +* add util method for export and 'Time Machine' async handler. + ### v4.0.0 (2026-01-13) * * * diff --git a/build.gradle.kts b/build.gradle.kts index 30a861c6..a1c68d92 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,8 @@ plugins { } group = "com.chargebee" -version = "4.0.0" -description = "Next-gen Java client library for ChargeBee API" +version = "4.0.1" +description = "Java client library for ChargeBee" // Project metadata val projectUrl = "https://github.com/chargebee/chargebee-java" diff --git a/dist/chargebee-java-4.0.0-javadoc.jar b/dist/chargebee-java-4.0.1-javadoc.jar similarity index 70% rename from dist/chargebee-java-4.0.0-javadoc.jar rename to dist/chargebee-java-4.0.1-javadoc.jar index e237dac3..3ba04acc 100644 Binary files a/dist/chargebee-java-4.0.0-javadoc.jar and b/dist/chargebee-java-4.0.1-javadoc.jar differ diff --git a/dist/chargebee-java-4.0.0-sources.jar b/dist/chargebee-java-4.0.1-sources.jar similarity index 81% rename from dist/chargebee-java-4.0.0-sources.jar rename to dist/chargebee-java-4.0.1-sources.jar index 6fa9d79b..891f5688 100644 Binary files a/dist/chargebee-java-4.0.0-sources.jar and b/dist/chargebee-java-4.0.1-sources.jar differ diff --git a/dist/chargebee-java-4.0.0.jar b/dist/chargebee-java-4.0.1.jar similarity index 59% rename from dist/chargebee-java-4.0.0.jar rename to dist/chargebee-java-4.0.1.jar index 35dc9287..bd218b61 100644 Binary files a/dist/chargebee-java-4.0.0.jar and b/dist/chargebee-java-4.0.1.jar differ diff --git a/src/main/java/com/chargebee/v4/models/card/Card.java b/src/main/java/com/chargebee/v4/models/card/Card.java index 23645ea5..e0ad458b 100644 --- a/src/main/java/com/chargebee/v4/models/card/Card.java +++ b/src/main/java/com/chargebee/v4/models/card/Card.java @@ -296,6 +296,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java index 66ffffe6..80b3846e 100644 --- a/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java @@ -180,6 +180,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java index 9f2e076f..16bba69f 100644 --- a/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java @@ -537,6 +537,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java b/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java index 7dbc9828..502d4ff9 100644 --- a/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java +++ b/src/main/java/com/chargebee/v4/models/coupon/params/CouponListParams.java @@ -95,6 +95,10 @@ public CurrencyCodeFilter currencyCode() { return new CurrencyCodeFilter("currency_code", this, queryParams); } + public ApplicableItemPriceIdsFilter applicableItemPriceIds() { + return new ApplicableItemPriceIdsFilter("applicable_item_price_ids", this, queryParams); + } + public CouponListParams build() { return new CouponListParams(this); } @@ -153,6 +157,13 @@ public static final class CurrencyCodeFilter extends StringFilter { + ApplicableItemPriceIdsFilter( + String fieldName, CouponListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + public static final class SortBySortBuilder { private final String fieldName; private final CouponListBuilder builder; 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 72fa6ed9..067670ca 100644 --- a/src/main/java/com/chargebee/v4/models/customer/Customer.java +++ b/src/main/java/com/chargebee/v4/models/customer/Customer.java @@ -2284,6 +2284,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java index 49b7f90e..f0810a78 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 @@ -1812,6 +1812,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2689,6 +2691,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java index 395abe22..b63cf7c3 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 @@ -494,6 +494,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java index 91144727..d62b28cc 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportAddonsParams.java @@ -45,7 +45,9 @@ public Map toFormData() { // Single object Map nestedData = this.addon.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "addon[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "addon[" + key.replace("[", "][") : "addon[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java index 1497c43d..90e740ed 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportAttachedItemsParams.java @@ -44,7 +44,11 @@ public Map toFormData() { // Single object Map nestedData = this.attachedItem.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "attached_item[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "attached_item[" + key.replace("[", "][") + : "attached_item[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java index 22657698..9e43a757 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCouponsParams.java @@ -44,7 +44,9 @@ public Map toFormData() { // Single object Map nestedData = this.coupon.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "coupon[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "coupon[" + key.replace("[", "][") : "coupon[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -73,6 +75,10 @@ public CurrencyCodeFilter currencyCode() { return new CurrencyCodeFilter("currency_code", this, filterParams); } + public ApplicableItemPriceIdsFilter applicableItemPriceIds() { + return new ApplicableItemPriceIdsFilter("applicable_item_price_ids", this, filterParams); + } + public ExportCouponsBuilder coupon(CouponParams value) { this.coupon = value; return this; @@ -88,6 +94,14 @@ public static final class CurrencyCodeFilter extends StringFilter { + ApplicableItemPriceIdsFilter( + String fieldName, ExportCouponsBuilder builder, Map params) { + super(fieldName, builder, params); + } + } } public static final class CouponParams { diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java index 80bcf518..723a71a9 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCreditNotesParams.java @@ -38,7 +38,11 @@ public Map toFormData() { // Single object Map nestedData = this.creditNote.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "credit_note[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "credit_note[" + key.replace("[", "][") + : "credit_note[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java index 1a581302..fbf02444 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportCustomersParams.java @@ -65,7 +65,9 @@ public Map toFormData() { // Single object Map nestedData = this.customer.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "customer[" + key.replace("[", "][") : "customer[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -75,7 +77,11 @@ public Map toFormData() { // Single object Map nestedData = this.relationship.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "relationship[" + key.replace("[", "][") + : "relationship[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java index f564ddaf..2e2d1dc9 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportDeferredRevenueParams.java @@ -160,7 +160,9 @@ public Map toFormData() { // Single object Map nestedData = this.invoice.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "invoice[" + key.replace("[", "][") : "invoice[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -170,7 +172,11 @@ public Map toFormData() { // Single object Map nestedData = this.subscription.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "subscription[" + key.replace("[", "][") + : "subscription[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -180,7 +186,9 @@ public Map toFormData() { // Single object Map nestedData = this.customer.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "customer[" + key.replace("[", "][") : "customer[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -190,7 +198,11 @@ public Map toFormData() { // Single object Map nestedData = this.relationship.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "relationship[" + key.replace("[", "][") + : "relationship[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java index fc3dce26..bb1865b9 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportDifferentialPricesParams.java @@ -42,7 +42,11 @@ public Map toFormData() { // Single object Map nestedData = this.differentialPrice.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "differential_price[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "differential_price[" + key.replace("[", "][") + : "differential_price[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java index 91bfb838..c679c0ac 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportInvoicesParams.java @@ -45,7 +45,9 @@ public Map toFormData() { // Single object Map nestedData = this.invoice.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "invoice[" + key.replace("[", "][") : "invoice[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java index 146d508b..5bd2bc75 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemFamiliesParams.java @@ -44,7 +44,11 @@ public Map toFormData() { // Single object Map nestedData = this.itemFamily.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_family[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "item_family[" + key.replace("[", "][") + : "item_family[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java index d8f342e4..48ec15b1 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemPricesParams.java @@ -45,7 +45,9 @@ public Map toFormData() { // Single object Map nestedData = this.itemPrice.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item_price[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "item_price[" + key.replace("[", "][") : "item_price[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java index d9e47e5e..2ffdaee0 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportItemsParams.java @@ -44,7 +44,9 @@ public Map toFormData() { // Single object Map nestedData = this.item.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "item[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "item[" + key.replace("[", "][") : "item[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java index 3add1983..4a22aabc 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportOrdersParams.java @@ -45,7 +45,9 @@ public Map toFormData() { // Single object Map nestedData = this.order.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "order[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "order[" + key.replace("[", "][") : "order[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java index 637e8365..84aeeec6 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportPlansParams.java @@ -45,7 +45,9 @@ public Map toFormData() { // Single object Map nestedData = this.plan.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "plan[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "plan[" + key.replace("[", "][") : "plan[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java index 26e36f4a..b99f7008 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java @@ -44,7 +44,11 @@ public Map toFormData() { // Single object Map nestedData = this.priceVariant.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "price_variant[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "price_variant[" + key.replace("[", "][") + : "price_variant[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java index e7e8ae5e..a6f143d3 100644 --- a/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRevenueRecognitionParams.java @@ -160,7 +160,9 @@ public Map toFormData() { // Single object Map nestedData = this.invoice.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "invoice[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "invoice[" + key.replace("[", "][") : "invoice[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -170,7 +172,11 @@ public Map toFormData() { // Single object Map nestedData = this.subscription.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "subscription[" + key.replace("[", "][") + : "subscription[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -180,7 +186,9 @@ public Map toFormData() { // Single object Map nestedData = this.customer.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "customer[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "customer[" + key.replace("[", "][") : "customer[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -190,7 +198,11 @@ public Map toFormData() { // Single object Map nestedData = this.relationship.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "relationship[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "relationship[" + key.replace("[", "][") + : "relationship[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } 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 8f392981..fba695df 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 @@ -58,7 +58,11 @@ public Map toFormData() { // Single object Map nestedData = this.subscription.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "subscription[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "subscription[" + key.replace("[", "][") + : "subscription[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } 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 14c8f823..1d92215a 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 @@ -38,7 +38,11 @@ public Map toFormData() { // Single object Map nestedData = this.transaction.toFormData(); for (Map.Entry entry : nestedData.entrySet()) { - String nestedKey = "transaction[" + entry.getKey() + "]"; + String key = entry.getKey(); + String nestedKey = + key.contains("[") + ? "transaction[" + key.replace("[", "][") + : "transaction[" + key + "]"; formData.put(nestedKey, entry.getValue()); } } @@ -482,6 +486,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java index f50e845c..b23db35c 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingForItemsParams.java @@ -1330,6 +1330,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java index d6f31cb7..09a7b434 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutExistingParams.java @@ -1207,6 +1207,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java index 3d79ba6c..9250eee1 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewForItemsParams.java @@ -1445,6 +1445,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java index 2f7ddff3..7ed14a0b 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutNewParams.java @@ -1365,6 +1365,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java index 69c6cff9..fe08f184 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeForItemsParams.java @@ -1139,6 +1139,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java index 005b5782..a8493b2e 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCheckoutOneTimeParams.java @@ -909,6 +909,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java index 376e45f8..e4fed04e 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageCollectNowParams.java @@ -355,6 +355,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java index e09c4c96..fee48962 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageManagePaymentSourcesParams.java @@ -335,6 +335,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java index 9fb81ae5..2212029d 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdateCardParams.java @@ -457,6 +457,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java index 67d692e2..5f29375b 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageUpdatePaymentMethodParams.java @@ -457,6 +457,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateForChargeItemsAndChargesParams.java index 29dfbde4..13d576a8 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 @@ -1716,6 +1716,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2593,6 +2595,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceCreateParams.java index 13cdc543..e180351f 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 @@ -1597,6 +1597,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2474,6 +2476,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java index a69fc41f..53062ad3 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -365,6 +365,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java index 63713118..c1a6ac93 100644 --- a/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java @@ -285,6 +285,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java index 31a5897f..2c5a26be 100644 --- a/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java +++ b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java @@ -2001,6 +2001,7 @@ public static class CreditLines { private String amount; private String unitPrice; + private String quantity; private String lineItemAssociationId; public String getAmount() { @@ -2011,6 +2012,10 @@ public String getUnitPrice() { return unitPrice; } + public String getQuantity() { + return quantity; + } + public String getLineItemAssociationId() { return lineItemAssociationId; } @@ -2022,6 +2027,8 @@ public static CreditLines fromJson(String json) { obj.unitPrice = JsonUtil.getString(json, "unit_price"); + obj.quantity = JsonUtil.getString(json, "quantity"); + obj.lineItemAssociationId = JsonUtil.getString(json, "line_item_association_id"); return obj; @@ -2034,6 +2041,8 @@ public String toString() { + amount + ", unitPrice=" + unitPrice + + ", quantity=" + + quantity + ", lineItemAssociationId=" + lineItemAssociationId + "}"; @@ -2047,13 +2056,14 @@ public boolean equals(Object o) { CreditLines that = (CreditLines) o; return java.util.Objects.equals(amount, that.amount) && java.util.Objects.equals(unitPrice, that.unitPrice) + && java.util.Objects.equals(quantity, that.quantity) && java.util.Objects.equals(lineItemAssociationId, that.lineItemAssociationId); } @Override public int hashCode() { - return java.util.Objects.hash(amount, unitPrice, lineItemAssociationId); + return java.util.Objects.hash(amount, unitPrice, quantity, lineItemAssociationId); } } } 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 d55fc074..2f8fb71f 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 @@ -2288,6 +2288,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2685,6 +2687,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java index 1caaf068..84ca8fbb 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 @@ -2628,6 +2628,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3505,6 +3507,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java index 7383c7c8..88725392 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 @@ -1916,6 +1916,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2333,6 +2335,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java index a90548e4..16b6787d 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 @@ -1831,6 +1831,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2248,6 +2250,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java index eb0c94ba..008658f9 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/ThirdPartyEntityMapping.java @@ -124,6 +124,8 @@ public enum EntityType { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -228,6 +230,8 @@ public enum FailedDependentEntityType { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** * An enum member indicating that FailedDependentEntityType was instantiated with an unknown * value. diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java index 8f60b481..0ea4c2ca 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListAllParams.java @@ -180,6 +180,8 @@ public enum EntityTypeIs { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityTypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -234,6 +236,8 @@ public enum EntityTypeIsNot { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityTypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java index f205ab90..912c8318 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java @@ -138,6 +138,8 @@ public enum EntityTypeIs { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityTypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -192,6 +194,8 @@ public enum EntityTypeIsNot { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityTypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java index 520a528b..c7ab85a4 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingRetrieveEntityParams.java @@ -107,6 +107,8 @@ public enum EntityType { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java index 1a7b51e4..1d03a257 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingUpdateEntityParams.java @@ -294,6 +294,8 @@ public enum EntityType { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** An enum member indicating that EntityType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -398,6 +400,8 @@ public enum FailedDependentEntityType { TAX_GROUP("tax_group"), + SALES_ORDER("sales_order"), + /** * An enum member indicating that FailedDependentEntityType 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 92804730..c4a5455b 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java @@ -229,6 +229,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/token/Token.java b/src/main/java/com/chargebee/v4/models/token/Token.java index ea0f8115..457d826e 100644 --- a/src/main/java/com/chargebee/v4/models/token/Token.java +++ b/src/main/java/com/chargebee/v4/models/token/Token.java @@ -186,6 +186,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java index 7ed6cac2..88576ce4 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java +++ b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java @@ -462,6 +462,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java index 5932acae..a3c2de1f 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 @@ -682,6 +682,8 @@ public enum GatewayIs { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIs was instantiated with an unknown value. */ @@ -820,6 +822,8 @@ public enum GatewayIsNot { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIsNot was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java index d3cbc0f6..bfdd8388 100644 --- a/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java @@ -239,6 +239,8 @@ public enum Gateway { EZIDEBIT("ezidebit"), + TWIKEY("twikey"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/services/ExportService.java b/src/main/java/com/chargebee/v4/services/ExportService.java index 0d981839..6cd8f2f6 100644 --- a/src/main/java/com/chargebee/v4/services/ExportService.java +++ b/src/main/java/com/chargebee/v4/services/ExportService.java @@ -471,4 +471,34 @@ public ExportPlansResponse plans(ExportPlansParams params) throws ChargebeeExcep return ExportPlansResponse.fromJson(response.getBodyAsString(), response); } + + // === Export Utility Methods === + + /** + * Waits for an export operation to complete by polling its status. Polls every 10 seconds + * (configurable via cb.java.export.sleep.millis system property). + * + * @param export The export to wait for (must have a valid ID) + * @return The completed Export object with COMPLETED or FAILED status + * @throws ChargebeeException if API call fails during polling + * @throws RuntimeException if export takes too long (over 50 polling attempts) + * @throws InterruptedException if thread is interrupted while waiting + */ + public com.chargebee.v4.models.export.Export waitForExportCompletion( + com.chargebee.v4.models.export.Export export) + throws ChargebeeException, InterruptedException { + int count = 0; + int sleepTime = Integer.getInteger("cb.java.export.sleep.millis", 10000); + com.chargebee.v4.models.export.Export currentExport = export; + + while (currentExport.getStatus() == com.chargebee.v4.models.export.Export.Status.IN_PROCESS) { + if (count++ > 50) { + throw new RuntimeException("Export is taking too long"); + } + Thread.sleep(sleepTime); + ExportRetrieveResponse response = retrieve(currentExport.getId()); + currentExport = response.getExport(); + } + return currentExport; + } } diff --git a/src/main/java/com/chargebee/v4/services/ItemPriceService.java b/src/main/java/com/chargebee/v4/services/ItemPriceService.java index 021f2fe9..5940deb8 100644 --- a/src/main/java/com/chargebee/v4/services/ItemPriceService.java +++ b/src/main/java/com/chargebee/v4/services/ItemPriceService.java @@ -12,22 +12,16 @@ import com.chargebee.v4.exceptions.ChargebeeException; import com.chargebee.v4.transport.Response; -import com.chargebee.v4.models.itemPrice.params.ItemPriceFindApplicableItemsParams; - -import com.chargebee.v4.models.itemPrice.params.MoveItemPriceParams; - import com.chargebee.v4.models.itemPrice.params.ItemPriceUpdateParams; import com.chargebee.v4.models.itemPrice.params.FindApplicableItemPricesParams; +import com.chargebee.v4.models.itemPrice.params.ItemPriceFindApplicableItemsParams; + import com.chargebee.v4.models.itemPrice.params.ItemPriceListParams; import com.chargebee.v4.models.itemPrice.params.ItemPriceCreateParams; -import com.chargebee.v4.models.itemPrice.responses.ItemPriceFindApplicableItemsResponse; - -import com.chargebee.v4.models.itemPrice.responses.MoveItemPriceResponse; - import com.chargebee.v4.models.itemPrice.responses.ItemPriceRetrieveResponse; import com.chargebee.v4.models.itemPrice.responses.ItemPriceUpdateResponse; @@ -36,6 +30,8 @@ import com.chargebee.v4.models.itemPrice.responses.FindApplicableItemPricesResponse; +import com.chargebee.v4.models.itemPrice.responses.ItemPriceFindApplicableItemsResponse; + import com.chargebee.v4.models.itemPrice.responses.ItemPriceListResponse; import com.chargebee.v4.models.itemPrice.responses.ItemPriceCreateResponse; @@ -74,87 +70,6 @@ public ItemPriceService withOptions(RequestOptions options) { // === Operations === - /** - * findApplicableItems a itemPrice using immutable params (executes immediately) - returns raw - * Response. - */ - Response findApplicableItemsRaw(String itemPriceId, ItemPriceFindApplicableItemsParams params) - throws ChargebeeException { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - return get(path, params != null ? params.toQueryParams() : null); - } - - /** - * findApplicableItems a itemPrice without params (executes immediately) - returns raw Response. - */ - Response findApplicableItemsRaw(String itemPriceId) throws ChargebeeException { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - return get(path, null); - } - - /** - * findApplicableItems a itemPrice using raw JSON payload (executes immediately) - returns raw - * Response. - */ - Response findApplicableItemsRaw(String itemPriceId, String jsonPayload) - throws ChargebeeException { - String path = - buildPathWithParams( - "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); - throw new UnsupportedOperationException("JSON payload not supported for GET operations"); - } - - public ItemPriceFindApplicableItemsResponse findApplicableItems( - String itemPriceId, ItemPriceFindApplicableItemsParams params) throws ChargebeeException { - Response response = findApplicableItemsRaw(itemPriceId, params); - return ItemPriceFindApplicableItemsResponse.fromJson( - response.getBodyAsString(), this, params, itemPriceId, response); - } - - public ItemPriceFindApplicableItemsResponse findApplicableItems(String itemPriceId) - throws ChargebeeException { - Response response = findApplicableItemsRaw(itemPriceId); - return ItemPriceFindApplicableItemsResponse.fromJson( - response.getBodyAsString(), this, null, itemPriceId, response); - } - - /** moveItemPrice a itemPrice (executes immediately) - returns raw Response. */ - Response moveItemPriceRaw(String itemPriceId) throws ChargebeeException { - String path = - buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); - - return post(path, null); - } - - /** - * moveItemPrice a itemPrice using immutable params (executes immediately) - returns raw Response. - */ - Response moveItemPriceRaw(String itemPriceId, MoveItemPriceParams params) - throws ChargebeeException { - String path = - buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); - return post(path, params.toFormData()); - } - - /** - * moveItemPrice a itemPrice using raw JSON payload (executes immediately) - returns raw Response. - */ - Response moveItemPriceRaw(String itemPriceId, String jsonPayload) throws ChargebeeException { - String path = - buildPathWithParams("/item_prices/{item-price-id}/move", "item-price-id", itemPriceId); - return postJson(path, jsonPayload); - } - - public MoveItemPriceResponse moveItemPrice(String itemPriceId, MoveItemPriceParams params) - throws ChargebeeException { - Response response = moveItemPriceRaw(itemPriceId, params); - return MoveItemPriceResponse.fromJson(response.getBodyAsString(), response); - } - /** retrieve a itemPrice (executes immediately) - returns raw Response. */ Response retrieveRaw(String itemPriceId) throws ChargebeeException { String path = buildPathWithParams("/item_prices/{item-price-id}", "item-price-id", itemPriceId); @@ -259,6 +174,54 @@ public FindApplicableItemPricesResponse findApplicableItemPrices(String itemPric response.getBodyAsString(), this, null, itemPriceId, response); } + /** + * findApplicableItems a itemPrice using immutable params (executes immediately) - returns raw + * Response. + */ + Response findApplicableItemsRaw(String itemPriceId, ItemPriceFindApplicableItemsParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * findApplicableItems a itemPrice without params (executes immediately) - returns raw Response. + */ + Response findApplicableItemsRaw(String itemPriceId) throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + return get(path, null); + } + + /** + * findApplicableItems a itemPrice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response findApplicableItemsRaw(String itemPriceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/item_prices/{item-price-id}/applicable_items", "item-price-id", itemPriceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ItemPriceFindApplicableItemsResponse findApplicableItems( + String itemPriceId, ItemPriceFindApplicableItemsParams params) throws ChargebeeException { + Response response = findApplicableItemsRaw(itemPriceId, params); + return ItemPriceFindApplicableItemsResponse.fromJson( + response.getBodyAsString(), this, params, itemPriceId, response); + } + + public ItemPriceFindApplicableItemsResponse findApplicableItems(String itemPriceId) + throws ChargebeeException { + Response response = findApplicableItemsRaw(itemPriceId); + return ItemPriceFindApplicableItemsResponse.fromJson( + response.getBodyAsString(), this, null, itemPriceId, response); + } + /** list a itemPrice using immutable params (executes immediately) - returns raw Response. */ Response listRaw(ItemPriceListParams params) throws ChargebeeException { diff --git a/src/main/java/com/chargebee/v4/services/TimeMachineService.java b/src/main/java/com/chargebee/v4/services/TimeMachineService.java index 2e04acc5..9c05e302 100644 --- a/src/main/java/com/chargebee/v4/services/TimeMachineService.java +++ b/src/main/java/com/chargebee/v4/services/TimeMachineService.java @@ -22,6 +22,12 @@ import com.chargebee.v4.models.timeMachine.responses.TimeMachineStartAfreshResponse; +import com.chargebee.v4.models.timeMachine.TimeMachine; +import com.chargebee.v4.models.timeMachine.TimeMachine.TimeTravelStatus; +import com.chargebee.v4.exceptions.OperationFailedException; +import com.chargebee.v4.exceptions.codes.BadRequestApiErrorCode; +import com.chargebee.v4.internal.JsonUtil; + public final class TimeMachineService extends BaseService { private final ServiceConfig config; @@ -167,4 +173,70 @@ public TimeMachineStartAfreshResponse startAfresh(String timeMachineName) Response response = startAfreshRaw(timeMachineName); return TimeMachineStartAfreshResponse.fromJson(response.getBodyAsString(), response); } + + // === Time Travel Completion Helper === + + /** + * Waits for time travel operation to complete. Polls the API until the status changes from + * IN_PROGRESS. + * + * @param timeMachine The TimeMachine instance to wait for + * @return The updated TimeMachine with final status + * @throws ChargebeeException if the API call fails + * @throws InterruptedException if the thread is interrupted while waiting + * @throws RuntimeException if time travel takes too long or ends in invalid state + * @throws OperationFailedException if time travel fails + */ + public TimeMachine waitForTimeTravelCompletion(TimeMachine timeMachine) + throws ChargebeeException, InterruptedException { + return waitForTimeTravelCompletion(timeMachine.getName()); + } + + /** + * Waits for time travel operation to complete. Polls the API until the status changes from + * IN_PROGRESS. + * + * @param timeMachineName The name of the TimeMachine to wait for + * @return The updated TimeMachine with final status + * @throws ChargebeeException if the API call fails + * @throws InterruptedException if the thread is interrupted while waiting + * @throws RuntimeException if time travel takes too long or ends in invalid state + * @throws OperationFailedException if time travel fails + */ + public TimeMachine waitForTimeTravelCompletion(String timeMachineName) + throws ChargebeeException, InterruptedException { + int count = 0; + int sleepTime = Integer.getInteger("cb.java.time_travel.sleep.millis", 3000); + TimeMachine timeMachine = retrieve(timeMachineName).getTimeMachine(); + + while (timeMachine.getTimeTravelStatus() == TimeTravelStatus.IN_PROGRESS) { + if (count++ > 30) { + throw new RuntimeException("The time travel is taking too much time"); + } + Thread.sleep(sleepTime); + timeMachine = retrieve(timeMachineName).getTimeMachine(); + } + + if (timeMachine.getTimeTravelStatus() == TimeTravelStatus.FAILED) { + String errorJson = timeMachine.getErrorJson(); + int httpStatusCode = JsonUtil.getInteger(errorJson, "http_code"); + String exceptionMessage = JsonUtil.getString(errorJson, "message"); + throw new OperationFailedException( + httpStatusCode, + "operation_failed", + BadRequestApiErrorCode._UNKNOWN, + exceptionMessage, + errorJson, + null, + null); + } + + if (timeMachine.getTimeTravelStatus() == TimeTravelStatus.NOT_ENABLED + || timeMachine.getTimeTravelStatus() == TimeTravelStatus._UNKNOWN) { + throw new RuntimeException( + "Time travel status is in wrong state: " + timeMachine.getTimeTravelStatus()); + } + + return timeMachine; + } }