From 7964e6eedcf7ef630c635321cc65c5c9d1b0f12f Mon Sep 17 00:00:00 2001 From: cb-karthikp Date: Mon, 9 Feb 2026 13:57:10 +0530 Subject: [PATCH 1/2] add filter support based on enum --- .../models/addon/params/AddonListParams.java | 528 ++++++++++++- .../params/AttachedItemListParams.java | 266 ++++++- .../coupon/params/CouponListParams.java | 353 ++++++++- .../params/CouponCodeListParams.java | 87 ++- .../params/CreditNoteListParams.java | 556 +++++++++++++- .../customer/params/CustomerListParams.java | 386 +++++++++- .../params/EntitlementListParams.java | 92 ++- .../models/event/params/EventListParams.java | 726 +++++++++++++++++- .../export/params/ExportCustomersParams.java | 36 +- .../params/ExportDeferredRevenueParams.java | 137 +--- .../export/params/ExportInvoicesParams.java | 33 +- .../params/ExportItemFamiliesParams.java | 37 +- .../export/params/ExportItemPricesParams.java | 36 +- .../export/params/ExportItemsParams.java | 168 +--- .../export/params/ExportOrdersParams.java | 33 +- .../export/params/ExportPlansParams.java | 33 +- .../params/ExportPriceVariantsParams.java | 36 +- .../ExportRevenueRecognitionParams.java | 137 +--- .../params/ExportSubscriptionsParams.java | 70 +- .../feature/params/FeatureListParams.java | 175 ++++- .../v4/models/gift/params/GiftListParams.java | 91 ++- .../params/HostedPageListParams.java | 195 ++++- .../invoice/params/InvoiceListParams.java | 474 +++++++++++- .../v4/models/item/params/ItemListParams.java | 596 +++++++++++++- .../params/ItemFamilyListParams.java | 16 +- .../itemPrice/params/ItemPriceListParams.java | 542 ++++++++++++- .../OmnichannelOneTimeOrderListParams.java | 85 +- .../OmnichannelSubscriptionListParams.java | 177 ++++- .../models/order/params/OrderListParams.java | 290 ++++++- .../params/PaymentSourceListParams.java | 239 +++++- .../PaymentVouchersForCustomerParams.java | 91 ++- .../PaymentVouchersForInvoiceParams.java | 91 ++- ...grationItemListApplicableAddonsParams.java | 17 +- .../Pc2MigrationItemPriceListParams.java | 116 ++- .../v4/models/plan/params/PlanListParams.java | 633 ++++++++++++++- .../params/PriceVariantListParams.java | 101 ++- .../product/params/ProductListParams.java | 116 ++- .../params/PromotionalCreditListParams.java | 85 +- .../models/quote/params/QuoteListParams.java | 101 ++- .../v4/models/ramp/params/RampListParams.java | 89 ++- .../params/SiteMigrationDetailListParams.java | 180 ++++- .../params/SubscriptionListParams.java | 434 ++++++++++- .../ThirdPartyEntityMappingListAllParams.java | 219 +++++- .../ThirdPartyEntityMappingListParams.java | 114 ++- .../params/TransactionListParams.java | 550 ++++++++++++- .../models/usage/params/UsageListParams.java | 87 ++- .../params/ListProductVariantsParams.java | 85 +- 47 files changed, 8838 insertions(+), 901 deletions(-) diff --git a/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java b/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java index 1121c762..8c3c5221 100644 --- a/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java +++ b/src/main/java/com/chargebee/v4/models/addon/params/AddonListParams.java @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -141,21 +142,178 @@ public static final class NameFilter extends StringFilter { } } - public static final class PricingModelFilter extends StringFilter { + public static final class PricingModelFilter + extends EnumFilter { PricingModelFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PricingModel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().is(PricingModel.YOUR_VALUE)}
+ * + * @see #is(PricingModel) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().isNot(PricingModel.YOUR_VALUE)}
+ * + * @see #isNot(PricingModel) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().in(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #in(PricingModel[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().notIn(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #notIn(PricingModel[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class TypeFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ChargeTypeFilter extends StringFilter { + public static final class ChargeTypeFilter extends EnumFilter { ChargeTypeFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ChargeType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeType().is(ChargeType.YOUR_VALUE)}
+ * + * @see #is(ChargeType) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeType().isNot(ChargeType.YOUR_VALUE)}
+ * + * @see #isNot(ChargeType) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeType().in(ChargeType.VALUE1, ChargeType.VALUE2)}
+ * + * @see #in(ChargeType[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeType().notIn(ChargeType.VALUE1, ChargeType.VALUE2)}
+ * + * @see #notIn(ChargeType[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -171,15 +329,119 @@ public static final class PeriodFilter extends NumberFilter { } } - public static final class PeriodUnitFilter extends StringFilter { + public static final class PeriodUnitFilter extends EnumFilter { PeriodUnitFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PeriodUnit::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().is(PeriodUnit.YOUR_VALUE)}
+ * + * @see #is(PeriodUnit) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().isNot(PeriodUnit.YOUR_VALUE)}
+ * + * @see #isNot(PeriodUnit) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().in(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #in(PeriodUnit[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().notIn(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #notIn(PeriodUnit[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -195,9 +457,61 @@ public static final class CurrencyCodeFilter extends StringFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, AddonListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public AddonListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public AddonListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public AddonListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public AddonListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -581,4 +895,194 @@ public static ChannelIsNot fromString(String value) { return _UNKNOWN; } } + + public enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Type { + ON_OFF("on_off"), + + QUANTITY("quantity"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** 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 ChargeType { + RECURRING("recurring"), + + NON_RECURRING("non_recurring"), + + /** An enum member indicating that ChargeType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeType enumValue : ChargeType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that PeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (PeriodUnit enumValue : PeriodUnit.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 enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java index 6ed8bb95..046a4f66 100644 --- a/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java +++ b/src/main/java/com/chargebee/v4/models/attachedItem/params/AttachedItemListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -95,23 +96,180 @@ public static final class ItemIdFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, AttachedItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public AttachedItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public AttachedItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public AttachedItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public AttachedItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ItemTypeFilter extends StringFilter { + public static final class ItemTypeFilter extends EnumFilter { ItemTypeFilter( String fieldName, AttachedItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ItemType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().is(ItemType.YOUR_VALUE)}
+ * + * @see #is(ItemType) + */ + @Deprecated + public AttachedItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().isNot(ItemType.YOUR_VALUE)}
+ * + * @see #isNot(ItemType) + */ + @Deprecated + public AttachedItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().in(ItemType.VALUE1, ItemType.VALUE2)}
+ * + * @see #in(ItemType[]) + */ + @Deprecated + public AttachedItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().notIn(ItemType.VALUE1, ItemType.VALUE2)}
+ * + * @see #notIn(ItemType[]) + */ + @Deprecated + public AttachedItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ChargeOnEventFilter extends StringFilter { + public static final class ChargeOnEventFilter + extends EnumFilter { ChargeOnEventFilter( String fieldName, AttachedItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ChargeOnEvent::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeOnEvent().is(ChargeOnEvent.YOUR_VALUE)}
+ * + * @see #is(ChargeOnEvent) + */ + @Deprecated + public AttachedItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeOnEvent().isNot(ChargeOnEvent.YOUR_VALUE)}
+ * + * @see #isNot(ChargeOnEvent) + */ + @Deprecated + public AttachedItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeOnEvent().in(ChargeOnEvent.VALUE1, ChargeOnEvent.VALUE2)}
+ * + * @see #in(ChargeOnEvent[]) + */ + @Deprecated + public AttachedItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeOnEvent().notIn(ChargeOnEvent.VALUE1, ChargeOnEvent.VALUE2)}
+ * + * @see #notIn(ChargeOnEvent[]) + */ + @Deprecated + public AttachedItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -314,4 +472,100 @@ public static ChargeOnEventIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Type { + RECOMMENDED("recommended"), + + MANDATORY("mandatory"), + + OPTIONAL("optional"), + + /** 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 ItemType { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that ItemType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ItemType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ItemType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ItemType enumValue : ItemType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeOnEvent { + SUBSCRIPTION_CREATION("subscription_creation"), + + SUBSCRIPTION_TRIAL_START("subscription_trial_start"), + + PLAN_ACTIVATION("plan_activation"), + + SUBSCRIPTION_ACTIVATION("subscription_activation"), + + CONTRACT_TERMINATION("contract_termination"), + + ON_DEMAND("on_demand"), + + /** An enum member indicating that ChargeOnEvent was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeOnEvent(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeOnEvent fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeOnEvent enumValue : ChargeOnEvent.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } 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 447d6151..49b6b802 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -130,27 +131,237 @@ public static final class NameFilter extends StringFilter { } } - public static final class DiscountTypeFilter extends StringFilter { + public static final class DiscountTypeFilter + extends EnumFilter { DiscountTypeFilter(String fieldName, CouponListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, DiscountType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .discountType().is(DiscountType.YOUR_VALUE)}
+ * + * @see #is(DiscountType) + */ + @Deprecated + public CouponListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .discountType().isNot(DiscountType.YOUR_VALUE)}
+ * + * @see #isNot(DiscountType) + */ + @Deprecated + public CouponListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .discountType().in(DiscountType.VALUE1, DiscountType.VALUE2)}
+ * + * @see #in(DiscountType[]) + */ + @Deprecated + public CouponListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .discountType().notIn(DiscountType.VALUE1, DiscountType.VALUE2)}
+ * + * @see #notIn(DiscountType[]) + */ + @Deprecated + public CouponListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class DurationTypeFilter extends StringFilter { + public static final class DurationTypeFilter + extends EnumFilter { DurationTypeFilter(String fieldName, CouponListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, DurationType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .durationType().is(DurationType.YOUR_VALUE)}
+ * + * @see #is(DurationType) + */ + @Deprecated + public CouponListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .durationType().isNot(DurationType.YOUR_VALUE)}
+ * + * @see #isNot(DurationType) + */ + @Deprecated + public CouponListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .durationType().in(DurationType.VALUE1, DurationType.VALUE2)}
+ * + * @see #in(DurationType[]) + */ + @Deprecated + public CouponListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .durationType().notIn(DurationType.VALUE1, DurationType.VALUE2)}
+ * + * @see #notIn(DurationType[]) + */ + @Deprecated + public CouponListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, CouponListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public CouponListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public CouponListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public CouponListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public CouponListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ApplyOnFilter extends StringFilter { + public static final class ApplyOnFilter extends EnumFilter { ApplyOnFilter(String fieldName, CouponListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ApplyOn::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .applyOn().is(ApplyOn.YOUR_VALUE)}
+ * + * @see #is(ApplyOn) + */ + @Deprecated + public CouponListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .applyOn().isNot(ApplyOn.YOUR_VALUE)}
+ * + * @see #isNot(ApplyOn) + */ + @Deprecated + public CouponListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .applyOn().in(ApplyOn.VALUE1, ApplyOn.VALUE2)}
+ * + * @see #in(ApplyOn[]) + */ + @Deprecated + public CouponListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .applyOn().notIn(ApplyOn.VALUE1, ApplyOn.VALUE2)}
+ * + * @see #notIn(ApplyOn[]) + */ + @Deprecated + public CouponListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -519,4 +730,130 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum DiscountType { + FIXED_AMOUNT("fixed_amount"), + + PERCENTAGE("percentage"), + + OFFER_QUANTITY("offer_quantity"), + + /** An enum member indicating that DiscountType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DiscountType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DiscountType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DiscountType enumValue : DiscountType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum DurationType { + ONE_TIME("one_time"), + + FOREVER("forever"), + + LIMITED_PERIOD("limited_period"), + + /** An enum member indicating that DurationType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DurationType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DurationType fromString(String value) { + if (value == null) return _UNKNOWN; + for (DurationType enumValue : DurationType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + EXPIRED("expired"), + + ARCHIVED("archived"), + + DELETED("deleted"), + + FUTURE("future"), + + /** 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 ApplyOn { + INVOICE_AMOUNT("invoice_amount"), + + SPECIFIED_ITEMS_TOTAL("specified_items_total"), + + EACH_SPECIFIED_ITEM("each_specified_item"), + + EACH_UNIT_OF_SPECIFIED_ITEMS("each_unit_of_specified_items"), + + /** An enum member indicating that ApplyOn was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ApplyOn(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ApplyOn fromString(String value) { + if (value == null) return _UNKNOWN; + for (ApplyOn enumValue : ApplyOn.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java index 417f6922..857a30bc 100644 --- a/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java +++ b/src/main/java/com/chargebee/v4/models/couponCode/params/CouponCodeListParams.java @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -93,9 +94,61 @@ public static final class CouponSetNameFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, CouponCodeListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public CouponCodeListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public CouponCodeListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public CouponCodeListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public CouponCodeListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -159,4 +212,34 @@ public static StatusIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Status { + NOT_REDEEMED("not_redeemed"), + + REDEEMED("redeemed"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java index 98e63605..3577d2d8 100644 --- a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteListParams.java @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -169,16 +170,121 @@ public static final class ReferenceInvoiceIdFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, CreditNoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public CreditNoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public CreditNoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public CreditNoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public CreditNoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ReasonCodeFilter extends StringFilter { + public static final class ReasonCodeFilter + extends EnumFilter { ReasonCodeFilter( String fieldName, CreditNoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ReasonCode::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .reasonCode().is(ReasonCode.YOUR_VALUE)}
+ * + * @see #is(ReasonCode) + */ + @Deprecated + public CreditNoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .reasonCode().isNot(ReasonCode.YOUR_VALUE)}
+ * + * @see #isNot(ReasonCode) + */ + @Deprecated + public CreditNoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .reasonCode().in(ReasonCode.VALUE1, ReasonCode.VALUE2)}
+ * + * @see #in(ReasonCode[]) + */ + @Deprecated + public CreditNoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .reasonCode().notIn(ReasonCode.VALUE1, ReasonCode.VALUE2)}
+ * + * @see #notIn(ReasonCode[]) + */ + @Deprecated + public CreditNoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -189,9 +295,61 @@ public static final class CreateReasonCodeFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, CreditNoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public CreditNoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public CreditNoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public CreditNoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public CreditNoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -207,9 +365,61 @@ public static final class TotalFilter extends NumberFilter { + public static final class PriceTypeFilter extends EnumFilter { PriceTypeFilter(String fieldName, CreditNoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PriceType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().is(PriceType.YOUR_VALUE)}
+ * + * @see #is(PriceType) + */ + @Deprecated + public CreditNoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().isNot(PriceType.YOUR_VALUE)}
+ * + * @see #isNot(PriceType) + */ + @Deprecated + public CreditNoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().in(PriceType.VALUE1, PriceType.VALUE2)}
+ * + * @see #in(PriceType[]) + */ + @Deprecated + public CreditNoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().notIn(PriceType.VALUE1, PriceType.VALUE2)}
+ * + * @see #notIn(PriceType[]) + */ + @Deprecated + public CreditNoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -246,9 +456,61 @@ public static final class UpdatedAtFilter extends TimestampFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, CreditNoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public CreditNoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public CreditNoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public CreditNoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public CreditNoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -739,6 +1001,174 @@ public static ChannelIsNot fromString(String value) { } } + public enum Type { + ADJUSTMENT("adjustment"), + + REFUNDABLE("refundable"), + + STORE("store"), + + /** 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 ReasonCode { + WRITE_OFF("write_off"), + + SUBSCRIPTION_CHANGE("subscription_change"), + + SUBSCRIPTION_CANCELLATION("subscription_cancellation"), + + SUBSCRIPTION_PAUSE("subscription_pause"), + + CHARGEBACK("chargeback"), + + PRODUCT_UNSATISFACTORY("product_unsatisfactory"), + + SERVICE_UNSATISFACTORY("service_unsatisfactory"), + + ORDER_CHANGE("order_change"), + + ORDER_CANCELLATION("order_cancellation"), + + WAIVER("waiver"), + + OTHER("other"), + + FRAUDULENT("fraudulent"), + + /** An enum member indicating that ReasonCode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ReasonCode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ReasonCode fromString(String value) { + if (value == null) return _UNKNOWN; + for (ReasonCode enumValue : ReasonCode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ADJUSTED("adjusted"), + + REFUNDED("refunded"), + + REFUND_DUE("refund_due"), + + VOIDED("voided"), + + /** 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 PriceType { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that PriceType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PriceType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PriceType enumValue : PriceType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static final class EinvoiceParams { private final Map queryParams; @@ -777,10 +1207,112 @@ public EinvoiceParams build() { return new EinvoiceParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, EinvoiceBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public EinvoiceBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public EinvoiceBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public EinvoiceBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public EinvoiceBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum Status { + SCHEDULED("scheduled"), + + SKIPPED("skipped"), + + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + FAILED("failed"), + + REGISTERED("registered"), + + ACCEPTED("accepted"), + + REJECTED("rejected"), + + MESSAGE_ACKNOWLEDGEMENT("message_acknowledgement"), + + IN_PROCESS("in_process"), + + UNDER_QUERY("under_query"), + + CONDITIONALLY_ACCEPTED("conditionally_accepted"), + + PAID("paid"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } } + return _UNKNOWN; } } } diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java index a4d75587..cdcf8499 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerListParams.java @@ -10,6 +10,8 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -180,16 +182,122 @@ public static final class PhoneFilter extends StringFilter } } - public static final class AutoCollectionFilter extends StringFilter { + public static final class AutoCollectionFilter + extends EnumFilter { AutoCollectionFilter( String fieldName, CustomerListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, AutoCollection::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .autoCollection().is(AutoCollection.YOUR_VALUE)}
+ * + * @see #is(AutoCollection) + */ + @Deprecated + public CustomerListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .autoCollection().isNot(AutoCollection.YOUR_VALUE)}
+ * + * @see #isNot(AutoCollection) + */ + @Deprecated + public CustomerListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .autoCollection().in(AutoCollection.VALUE1, AutoCollection.VALUE2)}
+ * + * @see #in(AutoCollection[]) + */ + @Deprecated + public CustomerListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .autoCollection().notIn(AutoCollection.VALUE1, AutoCollection.VALUE2)}
+       *     
+ * + * @see #notIn(AutoCollection[]) + */ + @Deprecated + public CustomerListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class TaxabilityFilter extends StringFilter { + public static final class TaxabilityFilter extends EnumFilter { TaxabilityFilter(String fieldName, CustomerListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Taxability::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .taxability().is(Taxability.YOUR_VALUE)}
+ * + * @see #is(Taxability) + */ + @Deprecated + public CustomerListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .taxability().isNot(Taxability.YOUR_VALUE)}
+ * + * @see #isNot(Taxability) + */ + @Deprecated + public CustomerListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .taxability().in(Taxability.VALUE1, Taxability.VALUE2)}
+ * + * @see #in(Taxability[]) + */ + @Deprecated + public CustomerListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .taxability().notIn(Taxability.VALUE1, Taxability.VALUE2)}
+ * + * @see #notIn(Taxability[]) + */ + @Deprecated + public CustomerListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -205,23 +313,145 @@ public static final class UpdatedAtFilter extends TimestampFilter { + public static final class OfflinePaymentMethodFilter + extends EnumFilter { OfflinePaymentMethodFilter( String fieldName, CustomerListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, OfflinePaymentMethod::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .offlinePaymentMethod().is(OfflinePaymentMethod.YOUR_VALUE)}
+ * + * @see #is(OfflinePaymentMethod) + */ + @Deprecated + public CustomerListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .offlinePaymentMethod().isNot(OfflinePaymentMethod.YOUR_VALUE)}
+ * + * @see #isNot(OfflinePaymentMethod) + */ + @Deprecated + public CustomerListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .offlinePaymentMethod().in(OfflinePaymentMethod.VALUE1, OfflinePaymentMethod.VALUE2)}
+       *     
+ * + * @see #in(OfflinePaymentMethod[]) + */ + @Deprecated + public CustomerListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .offlinePaymentMethod().notIn(OfflinePaymentMethod.VALUE1, OfflinePaymentMethod.VALUE2)}
+       *     
+ * + * @see #notIn(OfflinePaymentMethod[]) + */ + @Deprecated + public CustomerListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class AutoCloseInvoicesFilter extends StringFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, CustomerListBuilder 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 .autoCloseInvoices().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public CustomerListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class ChannelFilter extends StringFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, CustomerListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public CustomerListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public CustomerListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public CustomerListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public CustomerListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -778,6 +1008,144 @@ public static SortByDesc fromString(String value) { } } + public enum AutoCollection { + ON("on"), + + OFF("off"), + + /** An enum member indicating that AutoCollection was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AutoCollection(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AutoCollection fromString(String value) { + if (value == null) return _UNKNOWN; + for (AutoCollection enumValue : AutoCollection.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Taxability { + TAXABLE("taxable"), + + EXEMPT("exempt"), + + /** An enum member indicating that Taxability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Taxability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Taxability fromString(String value) { + if (value == null) return _UNKNOWN; + for (Taxability enumValue : Taxability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static final class RelationshipParams { private final Map queryParams; 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 e403bf65..2a9845f1 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 @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -89,10 +90,63 @@ public static final class FeatureIdFilter extends StringFilter { + public static final class EntityTypeFilter + extends EnumFilter { EntityTypeFilter( String fieldName, EntitlementListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, EntityType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().is(EntityType.YOUR_VALUE)}
+ * + * @see #is(EntityType) + */ + @Deprecated + public EntitlementListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().isNot(EntityType.YOUR_VALUE)}
+ * + * @see #isNot(EntityType) + */ + @Deprecated + public EntitlementListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().in(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #in(EntityType[]) + */ + @Deprecated + public EntitlementListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().notIn(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #notIn(EntityType[]) + */ + @Deprecated + public EntitlementListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -136,4 +190,38 @@ public static EntityTypeIs fromString(String value) { return _UNKNOWN; } } + + public enum EntityType { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } 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 7bbd28c6..ed7ac93f 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.sql.Timestamp; import java.util.Collections; @@ -102,21 +103,178 @@ public static final class IdFilter extends StringFilter { } } - public static final class WebhookStatusFilter extends StringFilter { + public static final class WebhookStatusFilter + extends EnumFilter { WebhookStatusFilter(String fieldName, EventListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, WebhookStatus::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .webhookStatus().is(WebhookStatus.YOUR_VALUE)}
+ * + * @see #is(WebhookStatus) + */ + @Deprecated + public EventListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .webhookStatus().isNot(WebhookStatus.YOUR_VALUE)}
+ * + * @see #isNot(WebhookStatus) + */ + @Deprecated + public EventListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .webhookStatus().in(WebhookStatus.VALUE1, WebhookStatus.VALUE2)}
+ * + * @see #in(WebhookStatus[]) + */ + @Deprecated + public EventListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .webhookStatus().notIn(WebhookStatus.VALUE1, WebhookStatus.VALUE2)}
+ * + * @see #notIn(WebhookStatus[]) + */ + @Deprecated + public EventListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class EventTypeFilter extends StringFilter { + public static final class EventTypeFilter extends EnumFilter { EventTypeFilter(String fieldName, EventListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, EventType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .eventType().is(EventType.YOUR_VALUE)}
+ * + * @see #is(EventType) + */ + @Deprecated + public EventListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .eventType().isNot(EventType.YOUR_VALUE)}
+ * + * @see #isNot(EventType) + */ + @Deprecated + public EventListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .eventType().in(EventType.VALUE1, EventType.VALUE2)}
+ * + * @see #in(EventType[]) + */ + @Deprecated + public EventListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .eventType().notIn(EventType.VALUE1, EventType.VALUE2)}
+ * + * @see #notIn(EventType[]) + */ + @Deprecated + public EventListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class SourceFilter extends StringFilter { + public static final class SourceFilter extends EnumFilter { SourceFilter(String fieldName, EventListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Source::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().is(Source.YOUR_VALUE)}
+ * + * @see #is(Source) + */ + @Deprecated + public EventListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().isNot(Source.YOUR_VALUE)}
+ * + * @see #isNot(Source) + */ + @Deprecated + public EventListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().in(Source.VALUE1, Source.VALUE2)}
+ * + * @see #in(Source[]) + */ + @Deprecated + public EventListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().notIn(Source.VALUE1, Source.VALUE2)}
+ * + * @see #notIn(Source[]) + */ + @Deprecated + public EventListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -1326,4 +1484,560 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum WebhookStatus { + NOT_CONFIGURED("not_configured"), + + SCHEDULED("scheduled"), + + SUCCEEDED("succeeded"), + + RE_SCHEDULED("re_scheduled"), + + FAILED("failed"), + + SKIPPED("skipped"), + + NOT_APPLICABLE("not_applicable"), + + DISABLED("disabled"), + + /** An enum member indicating that WebhookStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + WebhookStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static WebhookStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (WebhookStatus enumValue : WebhookStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum EventType { + COUPON_CREATED("coupon_created"), + + COUPON_UPDATED("coupon_updated"), + + COUPON_DELETED("coupon_deleted"), + + COUPON_SET_CREATED("coupon_set_created"), + + COUPON_SET_UPDATED("coupon_set_updated"), + + COUPON_SET_DELETED("coupon_set_deleted"), + + COUPON_CODES_ADDED("coupon_codes_added"), + + COUPON_CODES_DELETED("coupon_codes_deleted"), + + COUPON_CODES_UPDATED("coupon_codes_updated"), + + CUSTOMER_CREATED("customer_created"), + + CUSTOMER_CHANGED("customer_changed"), + + CUSTOMER_DELETED("customer_deleted"), + + CUSTOMER_MOVED_OUT("customer_moved_out"), + + CUSTOMER_MOVED_IN("customer_moved_in"), + + PROMOTIONAL_CREDITS_ADDED("promotional_credits_added"), + + PROMOTIONAL_CREDITS_DEDUCTED("promotional_credits_deducted"), + + SUBSCRIPTION_CREATED("subscription_created"), + + SUBSCRIPTION_CREATED_WITH_BACKDATING("subscription_created_with_backdating"), + + SUBSCRIPTION_STARTED("subscription_started"), + + SUBSCRIPTION_TRIAL_END_REMINDER("subscription_trial_end_reminder"), + + SUBSCRIPTION_ACTIVATED("subscription_activated"), + + SUBSCRIPTION_ACTIVATED_WITH_BACKDATING("subscription_activated_with_backdating"), + + SUBSCRIPTION_CHANGED("subscription_changed"), + + SUBSCRIPTION_TRIAL_EXTENDED("subscription_trial_extended"), + + MRR_UPDATED("mrr_updated"), + + SUBSCRIPTION_CHANGED_WITH_BACKDATING("subscription_changed_with_backdating"), + + SUBSCRIPTION_CANCELLATION_SCHEDULED("subscription_cancellation_scheduled"), + + SUBSCRIPTION_CANCELLATION_REMINDER("subscription_cancellation_reminder"), + + SUBSCRIPTION_CANCELLED("subscription_cancelled"), + + SUBSCRIPTION_CANCELED_WITH_BACKDATING("subscription_canceled_with_backdating"), + + SUBSCRIPTION_REACTIVATED("subscription_reactivated"), + + SUBSCRIPTION_REACTIVATED_WITH_BACKDATING("subscription_reactivated_with_backdating"), + + SUBSCRIPTION_RENEWED("subscription_renewed"), + + SUBSCRIPTION_ITEMS_RENEWED("subscription_items_renewed"), + + SUBSCRIPTION_SCHEDULED_CANCELLATION_REMOVED("subscription_scheduled_cancellation_removed"), + + SUBSCRIPTION_CHANGES_SCHEDULED("subscription_changes_scheduled"), + + SUBSCRIPTION_SCHEDULED_CHANGES_REMOVED("subscription_scheduled_changes_removed"), + + SUBSCRIPTION_SHIPPING_ADDRESS_UPDATED("subscription_shipping_address_updated"), + + SUBSCRIPTION_DELETED("subscription_deleted"), + + SUBSCRIPTION_PAUSED("subscription_paused"), + + SUBSCRIPTION_PAUSE_SCHEDULED("subscription_pause_scheduled"), + + SUBSCRIPTION_SCHEDULED_PAUSE_REMOVED("subscription_scheduled_pause_removed"), + + SUBSCRIPTION_RESUMED("subscription_resumed"), + + SUBSCRIPTION_RESUMPTION_SCHEDULED("subscription_resumption_scheduled"), + + SUBSCRIPTION_SCHEDULED_RESUMPTION_REMOVED("subscription_scheduled_resumption_removed"), + + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_ADDED("subscription_advance_invoice_schedule_added"), + + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_UPDATED("subscription_advance_invoice_schedule_updated"), + + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_REMOVED("subscription_advance_invoice_schedule_removed"), + + PENDING_INVOICE_CREATED("pending_invoice_created"), + + PENDING_INVOICE_UPDATED("pending_invoice_updated"), + + INVOICE_GENERATED("invoice_generated"), + + INVOICE_GENERATED_WITH_BACKDATING("invoice_generated_with_backdating"), + + INVOICE_UPDATED("invoice_updated"), + + INVOICE_DELETED("invoice_deleted"), + + CREDIT_NOTE_CREATED("credit_note_created"), + + CREDIT_NOTE_CREATED_WITH_BACKDATING("credit_note_created_with_backdating"), + + CREDIT_NOTE_UPDATED("credit_note_updated"), + + CREDIT_NOTE_DELETED("credit_note_deleted"), + + PAYMENT_SCHEDULES_CREATED("payment_schedules_created"), + + PAYMENT_SCHEDULES_UPDATED("payment_schedules_updated"), + + PAYMENT_SCHEDULE_SCHEME_CREATED("payment_schedule_scheme_created"), + + PAYMENT_SCHEDULE_SCHEME_DELETED("payment_schedule_scheme_deleted"), + + SUBSCRIPTION_RENEWAL_REMINDER("subscription_renewal_reminder"), + + ADD_USAGES_REMINDER("add_usages_reminder"), + + PAYMENT_DUE_REMINDER("payment_due_reminder"), + + TRANSACTION_CREATED("transaction_created"), + + TRANSACTION_UPDATED("transaction_updated"), + + TRANSACTION_DELETED("transaction_deleted"), + + PAYMENT_SUCCEEDED("payment_succeeded"), + + PAYMENT_FAILED("payment_failed"), + + DUNNING_UPDATED("dunning_updated"), + + PAYMENT_REFUNDED("payment_refunded"), + + PAYMENT_INITIATED("payment_initiated"), + + REFUND_INITIATED("refund_initiated"), + + NETD_PAYMENT_DUE_REMINDER("netd_payment_due_reminder"), + + AUTHORIZATION_SUCCEEDED("authorization_succeeded"), + + AUTHORIZATION_VOIDED("authorization_voided"), + + CARD_ADDED("card_added"), + + CARD_UPDATED("card_updated"), + + CARD_EXPIRY_REMINDER("card_expiry_reminder"), + + CARD_EXPIRED("card_expired"), + + CARD_DELETED("card_deleted"), + + PAYMENT_SOURCE_ADDED("payment_source_added"), + + PAYMENT_SOURCE_UPDATED("payment_source_updated"), + + PAYMENT_SOURCE_DELETED("payment_source_deleted"), + + PAYMENT_SOURCE_EXPIRING("payment_source_expiring"), + + PAYMENT_SOURCE_EXPIRED("payment_source_expired"), + + PAYMENT_SOURCE_LOCALLY_DELETED("payment_source_locally_deleted"), + + VIRTUAL_BANK_ACCOUNT_ADDED("virtual_bank_account_added"), + + VIRTUAL_BANK_ACCOUNT_UPDATED("virtual_bank_account_updated"), + + VIRTUAL_BANK_ACCOUNT_DELETED("virtual_bank_account_deleted"), + + TOKEN_CREATED("token_created"), + + TOKEN_CONSUMED("token_consumed"), + + TOKEN_EXPIRED("token_expired"), + + UNBILLED_CHARGES_CREATED("unbilled_charges_created"), + + UNBILLED_CHARGES_VOIDED("unbilled_charges_voided"), + + UNBILLED_CHARGES_DELETED("unbilled_charges_deleted"), + + UNBILLED_CHARGES_INVOICED("unbilled_charges_invoiced"), + + ORDER_CREATED("order_created"), + + ORDER_UPDATED("order_updated"), + + ORDER_CANCELLED("order_cancelled"), + + ORDER_DELIVERED("order_delivered"), + + ORDER_RETURNED("order_returned"), + + ORDER_READY_TO_PROCESS("order_ready_to_process"), + + ORDER_READY_TO_SHIP("order_ready_to_ship"), + + ORDER_DELETED("order_deleted"), + + ORDER_RESENT("order_resent"), + + QUOTE_CREATED("quote_created"), + + QUOTE_UPDATED("quote_updated"), + + QUOTE_DELETED("quote_deleted"), + + TAX_WITHHELD_RECORDED("tax_withheld_recorded"), + + TAX_WITHHELD_DELETED("tax_withheld_deleted"), + + TAX_WITHHELD_REFUNDED("tax_withheld_refunded"), + + GIFT_SCHEDULED("gift_scheduled"), + + GIFT_UNCLAIMED("gift_unclaimed"), + + GIFT_CLAIMED("gift_claimed"), + + GIFT_EXPIRED("gift_expired"), + + GIFT_CANCELLED("gift_cancelled"), + + GIFT_UPDATED("gift_updated"), + + HIERARCHY_CREATED("hierarchy_created"), + + HIERARCHY_DELETED("hierarchy_deleted"), + + PAYMENT_INTENT_CREATED("payment_intent_created"), + + PAYMENT_INTENT_UPDATED("payment_intent_updated"), + + CONTRACT_TERM_CREATED("contract_term_created"), + + CONTRACT_TERM_RENEWED("contract_term_renewed"), + + CONTRACT_TERM_TERMINATED("contract_term_terminated"), + + CONTRACT_TERM_COMPLETED("contract_term_completed"), + + CONTRACT_TERM_CANCELLED("contract_term_cancelled"), + + ITEM_FAMILY_CREATED("item_family_created"), + + ITEM_FAMILY_UPDATED("item_family_updated"), + + ITEM_FAMILY_DELETED("item_family_deleted"), + + ITEM_CREATED("item_created"), + + ITEM_UPDATED("item_updated"), + + ITEM_DELETED("item_deleted"), + + ITEM_PRICE_CREATED("item_price_created"), + + ITEM_PRICE_UPDATED("item_price_updated"), + + ITEM_PRICE_DELETED("item_price_deleted"), + + ATTACHED_ITEM_CREATED("attached_item_created"), + + ATTACHED_ITEM_UPDATED("attached_item_updated"), + + ATTACHED_ITEM_DELETED("attached_item_deleted"), + + DIFFERENTIAL_PRICE_CREATED("differential_price_created"), + + DIFFERENTIAL_PRICE_UPDATED("differential_price_updated"), + + DIFFERENTIAL_PRICE_DELETED("differential_price_deleted"), + + FEATURE_CREATED("feature_created"), + + FEATURE_UPDATED("feature_updated"), + + FEATURE_DELETED("feature_deleted"), + + FEATURE_ACTIVATED("feature_activated"), + + FEATURE_REACTIVATED("feature_reactivated"), + + FEATURE_ARCHIVED("feature_archived"), + + ITEM_ENTITLEMENTS_UPDATED("item_entitlements_updated"), + + ENTITLEMENT_OVERRIDES_UPDATED("entitlement_overrides_updated"), + + ENTITLEMENT_OVERRIDES_REMOVED("entitlement_overrides_removed"), + + ITEM_ENTITLEMENTS_REMOVED("item_entitlements_removed"), + + ENTITLEMENT_OVERRIDES_AUTO_REMOVED("entitlement_overrides_auto_removed"), + + SUBSCRIPTION_ENTITLEMENTS_CREATED("subscription_entitlements_created"), + + SUBSCRIPTION_ENTITLEMENTS_UPDATED("subscription_entitlements_updated"), + + BUSINESS_ENTITY_CREATED("business_entity_created"), + + BUSINESS_ENTITY_UPDATED("business_entity_updated"), + + BUSINESS_ENTITY_DELETED("business_entity_deleted"), + + CUSTOMER_BUSINESS_ENTITY_CHANGED("customer_business_entity_changed"), + + SUBSCRIPTION_BUSINESS_ENTITY_CHANGED("subscription_business_entity_changed"), + + PURCHASE_CREATED("purchase_created"), + + VOUCHER_CREATED("voucher_created"), + + VOUCHER_EXPIRED("voucher_expired"), + + VOUCHER_CREATE_FAILED("voucher_create_failed"), + + PRODUCT_CREATED("product_created"), + + PRODUCT_UPDATED("product_updated"), + + PRODUCT_DELETED("product_deleted"), + + VARIANT_CREATED("variant_created"), + + VARIANT_UPDATED("variant_updated"), + + VARIANT_DELETED("variant_deleted"), + + ITEM_PRICE_ENTITLEMENTS_UPDATED("item_price_entitlements_updated"), + + ITEM_PRICE_ENTITLEMENTS_REMOVED("item_price_entitlements_removed"), + + SUBSCRIPTION_RAMP_CREATED("subscription_ramp_created"), + + SUBSCRIPTION_RAMP_DELETED("subscription_ramp_deleted"), + + SUBSCRIPTION_RAMP_APPLIED("subscription_ramp_applied"), + + SUBSCRIPTION_RAMP_DRAFTED("subscription_ramp_drafted"), + + SUBSCRIPTION_RAMP_UPDATED("subscription_ramp_updated"), + + PRICE_VARIANT_CREATED("price_variant_created"), + + PRICE_VARIANT_UPDATED("price_variant_updated"), + + PRICE_VARIANT_DELETED("price_variant_deleted"), + + CUSTOMER_ENTITLEMENTS_UPDATED("customer_entitlements_updated"), + + SUBSCRIPTION_MOVED_IN("subscription_moved_in"), + + SUBSCRIPTION_MOVED_OUT("subscription_moved_out"), + + SUBSCRIPTION_MOVEMENT_FAILED("subscription_movement_failed"), + + OMNICHANNEL_SUBSCRIPTION_CREATED("omnichannel_subscription_created"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_RENEWED("omnichannel_subscription_item_renewed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADE_SCHEDULED( + "omnichannel_subscription_item_downgrade_scheduled"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_DOWNGRADE_REMOVED( + "omnichannel_subscription_item_scheduled_downgrade_removed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADED("omnichannel_subscription_item_downgraded"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_EXPIRED("omnichannel_subscription_item_expired"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLATION_SCHEDULED( + "omnichannel_subscription_item_cancellation_scheduled"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CANCELLATION_REMOVED( + "omnichannel_subscription_item_scheduled_cancellation_removed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_RESUBSCRIBED("omnichannel_subscription_item_resubscribed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_UPGRADED("omnichannel_subscription_item_upgraded"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLED("omnichannel_subscription_item_cancelled"), + + OMNICHANNEL_SUBSCRIPTION_IMPORTED("omnichannel_subscription_imported"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_STARTED( + "omnichannel_subscription_item_grace_period_started"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_EXPIRED( + "omnichannel_subscription_item_grace_period_expired"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_STARTED("omnichannel_subscription_item_dunning_started"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_EXPIRED("omnichannel_subscription_item_dunning_expired"), + + RULE_CREATED("rule_created"), + + RULE_UPDATED("rule_updated"), + + RULE_DELETED("rule_deleted"), + + RECORD_PURCHASE_FAILED("record_purchase_failed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_CHANGE_SCHEDULED( + "omnichannel_subscription_item_change_scheduled"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CHANGE_REMOVED( + "omnichannel_subscription_item_scheduled_change_removed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_REACTIVATED("omnichannel_subscription_item_reactivated"), + + SALES_ORDER_CREATED("sales_order_created"), + + SALES_ORDER_UPDATED("sales_order_updated"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_CHANGED("omnichannel_subscription_item_changed"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_PAUSED("omnichannel_subscription_item_paused"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_RESUMED("omnichannel_subscription_item_resumed"), + + OMNICHANNEL_ONE_TIME_ORDER_CREATED("omnichannel_one_time_order_created"), + + OMNICHANNEL_ONE_TIME_ORDER_ITEM_CANCELLED("omnichannel_one_time_order_item_cancelled"), + + USAGE_FILE_INGESTED("usage_file_ingested"), + + OMNICHANNEL_SUBSCRIPTION_ITEM_PAUSE_SCHEDULED("omnichannel_subscription_item_pause_scheduled"), + + OMNICHANNEL_SUBSCRIPTION_MOVED_IN("omnichannel_subscription_moved_in"), + + OMNICHANNEL_TRANSACTION_CREATED("omnichannel_transaction_created"), + + /** An enum member indicating that EventType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EventType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EventType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EventType enumValue : EventType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Source { + ADMIN_CONSOLE("admin_console"), + + API("api"), + + SCHEDULED_JOB("scheduled_job"), + + HOSTED_PAGE("hosted_page"), + + PORTAL("portal"), + + SYSTEM("system"), + + NONE("none"), + + JS_API("js_api"), + + MIGRATION("migration"), + + BULK_OPERATION("bulk_operation"), + + EXTERNAL_SERVICE("external_service"), + + /** 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; + } + } } 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 fbf02444..61268bc3 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -329,11 +330,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, CustomerBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -452,36 +452,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), 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 2e2d1dc9..11d59664 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -497,9 +498,9 @@ public static final class IdFilter extends StringFilter { } } - public static final class RecurringFilter extends EnumFilter { + public static final class RecurringFilter extends BooleanFilter { RecurringFilter(String fieldName, InvoiceBuilder builder, Map params) { - super(fieldName, builder, params, Recurring::getValue); + super(fieldName, builder, params); } } @@ -577,34 +578,6 @@ public static final class ChannelFilter extends EnumFilter { + extends BooleanFilter { HasScheduledChangesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, HasScheduledChanges::getValue); + super(fieldName, builder, params); } } @@ -914,11 +887,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -1011,36 +983,6 @@ public static CancelReason fromString(String value) { } } - public enum HasScheduledChanges { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that HasScheduledChanges was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - HasScheduledChanges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static HasScheduledChanges fromString(String value) { - if (value == null) return _UNKNOWN; - for (HasScheduledChanges enumValue : HasScheduledChanges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum OfflinePaymentMethod { NO_PREFERENCE("no_preference"), @@ -1093,36 +1035,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), @@ -1314,11 +1226,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, CustomerBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -1437,36 +1348,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), 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 c679c0ac..8251c79a 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -213,9 +214,9 @@ public static final class CustomerIdFilter extends StringFilter } } - public static final class RecurringFilter extends EnumFilter { + public static final class RecurringFilter extends BooleanFilter { RecurringFilter(String fieldName, InvoiceBuilder builder, Map params) { - super(fieldName, builder, params, Recurring::getValue); + super(fieldName, builder, params); } } @@ -293,34 +294,6 @@ public static final class ChannelFilter extends EnumFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ExportItemFamiliesBuilder builder, Map params) { - super(fieldName, builder, params, IncludeSiteLevelResources::getValue); - } - } - } - - public enum IncludeSiteLevelResources { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that IncludeSiteLevelResources was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - IncludeSiteLevelResources(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IncludeSiteLevelResources fromString(String value) { - if (value == null) return _UNKNOWN; - for (IncludeSiteLevelResources enumValue : IncludeSiteLevelResources.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } + super(fieldName, builder, params); } - return _UNKNOWN; } } 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 48ec15b1..7256c901 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -131,10 +132,10 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ExportItemPricesBuilder builder, Map params) { - super(fieldName, builder, params, IncludeSiteLevelResources::getValue); + super(fieldName, builder, params); } } } @@ -169,37 +170,6 @@ public static ItemType fromString(String value) { } } - public enum IncludeSiteLevelResources { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that IncludeSiteLevelResources was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - IncludeSiteLevelResources(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IncludeSiteLevelResources fromString(String value) { - if (value == null) return _UNKNOWN; - for (IncludeSiteLevelResources enumValue : IncludeSiteLevelResources.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public static final class ItemPriceParams { private final Map filterParams; 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 2ffdaee0..0b66b931 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -97,42 +98,11 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ExportItemsBuilder builder, Map params) { - super(fieldName, builder, params, IncludeSiteLevelResources::getValue); - } - } - } - - public enum IncludeSiteLevelResources { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that IncludeSiteLevelResources was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - IncludeSiteLevelResources(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IncludeSiteLevelResources fromString(String value) { - if (value == null) return _UNKNOWN; - for (IncludeSiteLevelResources enumValue : IncludeSiteLevelResources.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } + super(fieldName, builder, params); } - return _UNKNOWN; } } @@ -263,9 +233,9 @@ public static final class StatusFilter extends EnumFilter { } } - public static final class IsGiftableFilter extends EnumFilter { + public static final class IsGiftableFilter extends BooleanFilter { IsGiftableFilter(String fieldName, ItemBuilder builder, Map params) { - super(fieldName, builder, params, IsGiftable::getValue); + super(fieldName, builder, params); } } @@ -275,24 +245,22 @@ public static final class UpdatedAtFilter extends TimestampFilter { } } - public static final class EnabledForCheckoutFilter - extends EnumFilter { + public static final class EnabledForCheckoutFilter extends BooleanFilter { EnabledForCheckoutFilter( String fieldName, ItemBuilder builder, Map params) { - super(fieldName, builder, params, EnabledForCheckout::getValue); + super(fieldName, builder, params); } } - public static final class EnabledInPortalFilter - extends EnumFilter { + public static final class EnabledInPortalFilter extends BooleanFilter { EnabledInPortalFilter(String fieldName, ItemBuilder builder, Map params) { - super(fieldName, builder, params, EnabledInPortal::getValue); + super(fieldName, builder, params); } } - public static final class MeteredFilter extends EnumFilter { + public static final class MeteredFilter extends BooleanFilter { MeteredFilter(String fieldName, ItemBuilder builder, Map params) { - super(fieldName, builder, params, Metered::getValue); + super(fieldName, builder, params); } } @@ -400,120 +368,6 @@ public static Status fromString(String value) { } } - public enum IsGiftable { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsGiftable was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsGiftable(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsGiftable fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsGiftable enumValue : IsGiftable.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EnabledForCheckout { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that EnabledForCheckout was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - EnabledForCheckout(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EnabledForCheckout fromString(String value) { - if (value == null) return _UNKNOWN; - for (EnabledForCheckout enumValue : EnabledForCheckout.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum EnabledInPortal { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that EnabledInPortal was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - EnabledInPortal(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static EnabledInPortal fromString(String value) { - if (value == null) return _UNKNOWN; - for (EnabledInPortal enumValue : EnabledInPortal.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - - public enum Metered { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Metered was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Metered(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Metered fromString(String value) { - if (value == null) return _UNKNOWN; - for (Metered enumValue : Metered.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum UsageCalculation { SUM_OF_USAGES("sum_of_usages"), 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 4a22aabc..22a7ee4b 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -290,9 +291,9 @@ public static final class ResentStatusFilter extends EnumFilter { + public static final class IsResentFilter extends BooleanFilter { IsResentFilter(String fieldName, OrderBuilder builder, Map params) { - super(fieldName, builder, params, IsResent::getValue); + super(fieldName, builder, params); } } @@ -406,33 +407,5 @@ public static ResentStatus fromString(String value) { return _UNKNOWN; } } - - public enum IsResent { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that IsResent was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - IsResent(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IsResent fromString(String value) { - if (value == null) return _UNKNOWN; - for (IsResent enumValue : IsResent.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } } } 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 84aeeec6..e402a1fe 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -229,9 +230,9 @@ public static final class AddonApplicabilityFilter } } - public static final class GiftableFilter extends EnumFilter { + public static final class GiftableFilter extends BooleanFilter { GiftableFilter(String fieldName, PlanBuilder builder, Map params) { - super(fieldName, builder, params, Giftable::getValue); + super(fieldName, builder, params); } } @@ -344,34 +345,6 @@ public static AddonApplicability fromString(String value) { } } - public enum Giftable { - TRUE("true"), - - FALSE("false"), - - /** An enum member indicating that Giftable was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Giftable(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Giftable fromString(String value) { - if (value == null) return _UNKNOWN; - for (Giftable enumValue : Giftable.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/export/params/ExportPriceVariantsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportPriceVariantsParams.java index b99f7008..26a5573d 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -100,42 +101,11 @@ public static final class BusinessEntityIdFilter } public static final class IncludeSiteLevelResourcesFilter - extends EnumFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ExportPriceVariantsBuilder builder, Map params) { - super(fieldName, builder, params, IncludeSiteLevelResources::getValue); - } - } - } - - public enum IncludeSiteLevelResources { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that IncludeSiteLevelResources was instantiated with an unknown - * value. - */ - _UNKNOWN(null); - private final String value; - - IncludeSiteLevelResources(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static IncludeSiteLevelResources fromString(String value) { - if (value == null) return _UNKNOWN; - for (IncludeSiteLevelResources enumValue : IncludeSiteLevelResources.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } + super(fieldName, builder, params); } - return _UNKNOWN; } } 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 a6f143d3..a78af317 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -498,9 +499,9 @@ public static final class IdFilter extends StringFilter { } } - public static final class RecurringFilter extends EnumFilter { + public static final class RecurringFilter extends BooleanFilter { RecurringFilter(String fieldName, InvoiceBuilder builder, Map params) { - super(fieldName, builder, params, Recurring::getValue); + super(fieldName, builder, params); } } @@ -578,34 +579,6 @@ public static final class ChannelFilter extends EnumFilter { + extends BooleanFilter { HasScheduledChangesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, HasScheduledChanges::getValue); + super(fieldName, builder, params); } } @@ -915,11 +888,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -1012,36 +984,6 @@ public static CancelReason fromString(String value) { } } - public enum HasScheduledChanges { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that HasScheduledChanges was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - HasScheduledChanges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static HasScheduledChanges fromString(String value) { - if (value == null) return _UNKNOWN; - for (HasScheduledChanges enumValue : HasScheduledChanges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum OfflinePaymentMethod { NO_PREFERENCE("no_preference"), @@ -1094,36 +1036,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), @@ -1315,11 +1227,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, CustomerBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -1438,36 +1349,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), 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 fba695df..af61c1fc 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -327,10 +328,10 @@ public static final class CancelledAtFilter extends TimestampFilter { + extends BooleanFilter { HasScheduledChangesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, HasScheduledChanges::getValue); + super(fieldName, builder, params); } } @@ -348,11 +349,10 @@ public static final class OfflinePaymentMethodFilter } } - public static final class AutoCloseInvoicesFilter - extends EnumFilter { + public static final class AutoCloseInvoicesFilter extends BooleanFilter { AutoCloseInvoicesFilter( String fieldName, SubscriptionBuilder builder, Map params) { - super(fieldName, builder, params, AutoCloseInvoices::getValue); + super(fieldName, builder, params); } } @@ -445,36 +445,6 @@ public static CancelReason fromString(String value) { } } - public enum HasScheduledChanges { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that HasScheduledChanges was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - HasScheduledChanges(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static HasScheduledChanges fromString(String value) { - if (value == null) return _UNKNOWN; - for (HasScheduledChanges enumValue : HasScheduledChanges.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum OfflinePaymentMethod { NO_PREFERENCE("no_preference"), @@ -527,36 +497,6 @@ public static OfflinePaymentMethod fromString(String value) { } } - public enum AutoCloseInvoices { - TRUE("true"), - - FALSE("false"), - - /** - * An enum member indicating that AutoCloseInvoices was instantiated with an unknown value. - */ - _UNKNOWN(null); - private final String value; - - AutoCloseInvoices(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static AutoCloseInvoices fromString(String value) { - if (value == null) return _UNKNOWN; - for (AutoCloseInvoices enumValue : AutoCloseInvoices.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public enum Channel { WEB("web"), 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 7e6db631..bcf74303 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 @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -101,15 +102,119 @@ public static final class IdFilter extends StringFilter { } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, FeatureListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public FeatureListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public FeatureListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public FeatureListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public FeatureListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class TypeFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, FeatureListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public FeatureListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public FeatureListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public FeatureListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public FeatureListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -237,4 +342,66 @@ public static TypeIsNot fromString(String value) { return _UNKNOWN; } } + + 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; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java b/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java index 0b41ed76..c56e7718 100644 --- a/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java +++ b/src/main/java/com/chargebee/v4/models/gift/params/GiftListParams.java @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -72,9 +73,61 @@ public GiftListParams build() { return new GiftListParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, GiftListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public GiftListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public GiftListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public GiftListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public GiftListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -147,6 +200,40 @@ public static StatusIsNot fromString(String value) { } } + public enum Status { + SCHEDULED("scheduled"), + + UNCLAIMED("unclaimed"), + + CLAIMED("claimed"), + + CANCELLED("cancelled"), + + EXPIRED("expired"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static final class GiftReceiverParams { private final Map queryParams; diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java index f983bc9e..fd64a060 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPageListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -81,15 +82,119 @@ public static final class IdFilter extends StringFilter { } } - public static final class TypeFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, HostedPageListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public HostedPageListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public HostedPageListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public HostedPageListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public HostedPageListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StateFilter extends StringFilter { + public static final class StateFilter extends EnumFilter { StateFilter(String fieldName, HostedPageListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, State::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .state().is(State.YOUR_VALUE)}
+ * + * @see #is(State) + */ + @Deprecated + public HostedPageListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .state().isNot(State.YOUR_VALUE)}
+ * + * @see #isNot(State) + */ + @Deprecated + public HostedPageListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .state().in(State.VALUE1, State.VALUE2)}
+ * + * @see #in(State[]) + */ + @Deprecated + public HostedPageListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .state().notIn(State.VALUE1, State.VALUE2)}
+ * + * @see #notIn(State[]) + */ + @Deprecated + public HostedPageListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -263,4 +368,86 @@ public static StateIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Type { + CHECKOUT_NEW("checkout_new"), + + CHECKOUT_EXISTING("checkout_existing"), + + UPDATE_CARD("update_card"), + + UPDATE_PAYMENT_METHOD("update_payment_method"), + + MANAGE_PAYMENT_SOURCES("manage_payment_sources"), + + COLLECT_NOW("collect_now"), + + EXTEND_SUBSCRIPTION("extend_subscription"), + + CHECKOUT_ONE_TIME("checkout_one_time"), + + PRE_CANCEL("pre_cancel"), + + VIEW_VOUCHER("view_voucher"), + + ACCEPT_QUOTE("accept_quote"), + + /** 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 State { + CREATED("created"), + + REQUESTED("requested"), + + SUCCEEDED("succeeded"), + + CANCELLED("cancelled"), + + FAILED("failed"), + + ACKNOWLEDGED("acknowledged"), + + /** An enum member indicating that State was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + State(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static State fromString(String value) { + if (value == null) return _UNKNOWN; + for (State enumValue : State.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java index f9e85c00..77d440ac 100644 --- a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceListParams.java @@ -11,6 +11,8 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.sql.Timestamp; import java.util.Collections; @@ -176,21 +178,138 @@ public static final class CustomerIdFilter extends StringFilter { + public static final class RecurringFilter extends BooleanFilter { RecurringFilter(String fieldName, InvoiceListBuilder 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 .recurring().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public InvoiceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, InvoiceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public InvoiceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public InvoiceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public InvoiceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public InvoiceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class PriceTypeFilter extends StringFilter { + public static final class PriceTypeFilter extends EnumFilter { PriceTypeFilter(String fieldName, InvoiceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PriceType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().is(PriceType.YOUR_VALUE)}
+ * + * @see #is(PriceType) + */ + @Deprecated + public InvoiceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().isNot(PriceType.YOUR_VALUE)}
+ * + * @see #isNot(PriceType) + */ + @Deprecated + public InvoiceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().in(PriceType.VALUE1, PriceType.VALUE2)}
+ * + * @see #in(PriceType[]) + */ + @Deprecated + public InvoiceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .priceType().notIn(PriceType.VALUE1, PriceType.VALUE2)}
+ * + * @see #notIn(PriceType[]) + */ + @Deprecated + public InvoiceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -238,10 +357,63 @@ public static final class AmountDueFilter extends NumberFilter { + public static final class DunningStatusFilter + extends EnumFilter { DunningStatusFilter( String fieldName, InvoiceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, DunningStatus::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .dunningStatus().is(DunningStatus.YOUR_VALUE)}
+ * + * @see #is(DunningStatus) + */ + @Deprecated + public InvoiceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .dunningStatus().isNot(DunningStatus.YOUR_VALUE)}
+ * + * @see #isNot(DunningStatus) + */ + @Deprecated + public InvoiceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .dunningStatus().in(DunningStatus.VALUE1, DunningStatus.VALUE2)}
+ * + * @see #in(DunningStatus[]) + */ + @Deprecated + public InvoiceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .dunningStatus().notIn(DunningStatus.VALUE1, DunningStatus.VALUE2)}
+ * + * @see #notIn(DunningStatus[]) + */ + @Deprecated + public InvoiceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -257,9 +429,61 @@ public static final class UpdatedAtFilter extends TimestampFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, InvoiceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public InvoiceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public InvoiceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public InvoiceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public InvoiceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -714,6 +938,132 @@ public static SortByDesc fromString(String value) { } } + public enum Status { + PAID("paid"), + + POSTED("posted"), + + PAYMENT_DUE("payment_due"), + + NOT_PAID("not_paid"), + + VOIDED("voided"), + + PENDING("pending"), + + /** 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 PriceType { + TAX_EXCLUSIVE("tax_exclusive"), + + TAX_INCLUSIVE("tax_inclusive"), + + /** An enum member indicating that PriceType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PriceType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PriceType fromString(String value) { + if (value == null) return _UNKNOWN; + for (PriceType enumValue : PriceType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum DunningStatus { + IN_PROGRESS("in_progress"), + + EXHAUSTED("exhausted"), + + STOPPED("stopped"), + + SUCCESS("success"), + + /** An enum member indicating that DunningStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + DunningStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static DunningStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (DunningStatus enumValue : DunningStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static final class EinvoiceParams { private final Map queryParams; @@ -752,10 +1102,112 @@ public EinvoiceParams build() { return new EinvoiceParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, EinvoiceBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public EinvoiceBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public EinvoiceBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public EinvoiceBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public EinvoiceBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum Status { + SCHEDULED("scheduled"), + + SKIPPED("skipped"), + + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + FAILED("failed"), + + REGISTERED("registered"), + + ACCEPTED("accepted"), + + REJECTED("rejected"), + + MESSAGE_ACKNOWLEDGEMENT("message_acknowledgement"), + + IN_PROCESS("in_process"), + + UNDER_QUERY("under_query"), + + CONDITIONALLY_ACCEPTED("conditionally_accepted"), + + PAID("paid"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } } + return _UNKNOWN; } } } diff --git a/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java b/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java index 5f4e853e..566744c7 100644 --- a/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java +++ b/src/main/java/com/chargebee/v4/models/item/params/ItemListParams.java @@ -10,6 +10,8 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -140,9 +142,61 @@ public static final class ItemFamilyIdFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, ItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public ItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public ItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public ItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -152,23 +206,145 @@ public static final class NameFilter extends StringFilter { } } - public static final class ItemApplicabilityFilter extends StringFilter { + public static final class ItemApplicabilityFilter + extends EnumFilter { ItemApplicabilityFilter( String fieldName, ItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ItemApplicability::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemApplicability().is(ItemApplicability.YOUR_VALUE)}
+ * + * @see #is(ItemApplicability) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemApplicability().isNot(ItemApplicability.YOUR_VALUE)}
+ * + * @see #isNot(ItemApplicability) + */ + @Deprecated + public ItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .itemApplicability().in(ItemApplicability.VALUE1, ItemApplicability.VALUE2)}
+       *     
+ * + * @see #in(ItemApplicability[]) + */ + @Deprecated + public ItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .itemApplicability().notIn(ItemApplicability.VALUE1, ItemApplicability.VALUE2)}
+       *     
+ * + * @see #notIn(ItemApplicability[]) + */ + @Deprecated + public ItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, ItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class IsGiftableFilter extends StringFilter { + public static final class IsGiftableFilter extends BooleanFilter { IsGiftableFilter(String fieldName, ItemListBuilder 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 .isGiftable().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class UpdatedAtFilter extends TimestampFilter { @@ -177,35 +353,182 @@ public static final class UpdatedAtFilter extends TimestampFilter { + public static final class EnabledForCheckoutFilter extends BooleanFilter { EnabledForCheckoutFilter( String fieldName, ItemListBuilder 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 .enabledForCheckout().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class EnabledInPortalFilter extends StringFilter { + public static final class EnabledInPortalFilter extends BooleanFilter { EnabledInPortalFilter(String fieldName, ItemListBuilder 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 .enabledInPortal().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class MeteredFilter extends StringFilter { + public static final class MeteredFilter extends BooleanFilter { MeteredFilter(String fieldName, ItemListBuilder 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 ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class UsageCalculationFilter extends StringFilter { + public static final class UsageCalculationFilter + extends EnumFilter { UsageCalculationFilter( String fieldName, ItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, UsageCalculation::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .usageCalculation().is(UsageCalculation.YOUR_VALUE)}
+ * + * @see #is(UsageCalculation) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .usageCalculation().isNot(UsageCalculation.YOUR_VALUE)}
+ * + * @see #isNot(UsageCalculation) + */ + @Deprecated + public ItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .usageCalculation().in(UsageCalculation.VALUE1, UsageCalculation.VALUE2)}
+       *     
+ * + * @see #in(UsageCalculation[]) + */ + @Deprecated + public ItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .usageCalculation().notIn(UsageCalculation.VALUE1, UsageCalculation.VALUE2)}
+       *     
+ * + * @see #notIn(UsageCalculation[]) + */ + @Deprecated + public ItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ChannelFilter extends StringFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, ItemListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public ItemListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public ItemListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public ItemListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -217,11 +540,24 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ItemListBuilder 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 .includeSiteLevelResources().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class SortBySortBuilder { @@ -807,6 +1143,154 @@ public static SortByDesc fromString(String value) { } } + public enum Type { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** 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 ItemApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that ItemApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ItemApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ItemApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (ItemApplicability enumValue : ItemApplicability.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 enum UsageCalculation { + SUM_OF_USAGES("sum_of_usages"), + + LAST_USAGE("last_usage"), + + MAX_USAGE("max_usage"), + + /** An enum member indicating that UsageCalculation was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + UsageCalculation(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static UsageCalculation fromString(String value) { + if (value == null) return _UNKNOWN; + for (UsageCalculation enumValue : UsageCalculation.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static final class BundleConfigurationParams { private final Map queryParams; @@ -845,11 +1329,89 @@ public BundleConfigurationParams build() { return new BundleConfigurationParams(this); } - public static final class TypeFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter( String fieldName, BundleConfigurationBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public BundleConfigurationBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public BundleConfigurationBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public BundleConfigurationBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public BundleConfigurationBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum Type { + FIXED("fixed"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } } + return _UNKNOWN; } } } diff --git a/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java index b6bf7124..2b66d483 100644 --- a/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java +++ b/src/main/java/com/chargebee/v4/models/itemFamily/params/ItemFamilyListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.BooleanFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -120,11 +121,24 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ItemFamilyListBuilder 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 .includeSiteLevelResources().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemFamilyListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } } diff --git a/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java index 1b75407b..e244bd8c 100644 --- a/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java +++ b/src/main/java/com/chargebee/v4/models/itemPrice/params/ItemPriceListParams.java @@ -11,6 +11,8 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -144,10 +146,63 @@ public static final class NameFilter extends StringFilter } } - public static final class PricingModelFilter extends StringFilter { + public static final class PricingModelFilter + extends EnumFilter { PricingModelFilter( String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PricingModel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().is(PricingModel.YOUR_VALUE)}
+ * + * @see #is(PricingModel) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().isNot(PricingModel.YOUR_VALUE)}
+ * + * @see #isNot(PricingModel) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().in(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #in(PricingModel[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().notIn(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #notIn(PricingModel[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -164,9 +219,61 @@ public static final class ItemFamilyIdFilter extends StringFilter { + public static final class ItemTypeFilter extends EnumFilter { ItemTypeFilter(String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ItemType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().is(ItemType.YOUR_VALUE)}
+ * + * @see #is(ItemType) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().isNot(ItemType.YOUR_VALUE)}
+ * + * @see #isNot(ItemType) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().in(ItemType.VALUE1, ItemType.VALUE2)}
+ * + * @see #in(ItemType[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .itemType().notIn(ItemType.VALUE1, ItemType.VALUE2)}
+ * + * @see #notIn(ItemType[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -191,16 +298,123 @@ public static final class TrialPeriodFilter extends NumberFilter { + public static final class TrialPeriodUnitFilter + extends EnumFilter { TrialPeriodUnitFilter( String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, TrialPeriodUnit::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().is(TrialPeriodUnit.YOUR_VALUE)}
+ * + * @see #is(TrialPeriodUnit) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().isNot(TrialPeriodUnit.YOUR_VALUE)}
+ * + * @see #isNot(TrialPeriodUnit) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().in(TrialPeriodUnit.VALUE1, TrialPeriodUnit.VALUE2)}
+       *     
+ * + * @see #in(TrialPeriodUnit[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().notIn(TrialPeriodUnit.VALUE1, TrialPeriodUnit.VALUE2)}
+       *     
+ * + * @see #notIn(TrialPeriodUnit[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -218,16 +432,82 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, ItemPriceListBuilder 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 .includeSiteLevelResources().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class PeriodUnitFilter extends StringFilter { + public static final class PeriodUnitFilter + extends EnumFilter { PeriodUnitFilter(String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PeriodUnit::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().is(PeriodUnit.YOUR_VALUE)}
+ * + * @see #is(PeriodUnit) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().isNot(PeriodUnit.YOUR_VALUE)}
+ * + * @see #isNot(PeriodUnit) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().in(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #in(PeriodUnit[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().notIn(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #notIn(PeriodUnit[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -237,9 +517,61 @@ public static final class PeriodFilter extends NumberFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, ItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public ItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public ItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public ItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public ItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -779,4 +1111,188 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ItemType { + PLAN("plan"), + + ADDON("addon"), + + CHARGE("charge"), + + /** An enum member indicating that ItemType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ItemType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ItemType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ItemType enumValue : ItemType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.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 enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that PeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (PeriodUnit enumValue : PeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java index d44ef7e2..0cc785b4 100644 --- a/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelOneTimeOrder/params/OmnichannelOneTimeOrderListParams.java @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -67,12 +68,64 @@ public OmnichannelOneTimeOrderListParams build() { } public static final class SourceFilter - extends StringFilter { + extends EnumFilter { SourceFilter( String fieldName, OmnichannelOneTimeOrderListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Source::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().is(Source.YOUR_VALUE)}
+ * + * @see #is(Source) + */ + @Deprecated + public OmnichannelOneTimeOrderListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().isNot(Source.YOUR_VALUE)}
+ * + * @see #isNot(Source) + */ + @Deprecated + public OmnichannelOneTimeOrderListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().in(Source.VALUE1, Source.VALUE2)}
+ * + * @see #in(Source[]) + */ + @Deprecated + public OmnichannelOneTimeOrderListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().notIn(Source.VALUE1, Source.VALUE2)}
+ * + * @see #notIn(Source[]) + */ + @Deprecated + public OmnichannelOneTimeOrderListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -142,4 +195,32 @@ public static SourceIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Source { + APPLE_APP_STORE("apple_app_store"), + + GOOGLE_PLAY_STORE("google_play_store"), + + /** 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; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java index 4e86457f..5a3f7ec8 100644 --- a/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscription/params/OmnichannelSubscriptionListParams.java @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -73,12 +74,64 @@ public OmnichannelSubscriptionListParams build() { } public static final class SourceFilter - extends StringFilter { + extends EnumFilter { SourceFilter( String fieldName, OmnichannelSubscriptionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Source::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().is(Source.YOUR_VALUE)}
+ * + * @see #is(Source) + */ + @Deprecated + public OmnichannelSubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().isNot(Source.YOUR_VALUE)}
+ * + * @see #isNot(Source) + */ + @Deprecated + public OmnichannelSubscriptionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().in(Source.VALUE1, Source.VALUE2)}
+ * + * @see #in(Source[]) + */ + @Deprecated + public OmnichannelSubscriptionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().notIn(Source.VALUE1, Source.VALUE2)}
+ * + * @see #notIn(Source[]) + */ + @Deprecated + public OmnichannelSubscriptionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -149,6 +202,34 @@ public static SourceIsNot fromString(String value) { } } + public enum Source { + APPLE_APP_STORE("apple_app_store"), + + GOOGLE_PLAY_STORE("google_play_store"), + + /** 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 final class OmnichannelSubscriptionItemParams { private final Map queryParams; @@ -192,12 +273,64 @@ public OmnichannelSubscriptionItemParams build() { } public static final class StatusFilter - extends StringFilter { + extends EnumFilter { StatusFilter( String fieldName, OmnichannelSubscriptionItemBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public OmnichannelSubscriptionItemBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public OmnichannelSubscriptionItemBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public OmnichannelSubscriptionItemBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public OmnichannelSubscriptionItemBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -211,5 +344,41 @@ public static final class ItemIdAtSourceFilter } } } + + public enum Status { + ACTIVE("active"), + + EXPIRED("expired"), + + CANCELLED("cancelled"), + + IN_DUNNING("in_dunning"), + + IN_GRACE_PERIOD("in_grace_period"), + + PAUSED("paused"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } } diff --git a/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java b/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java index 7ed56897..dc423aeb 100644 --- a/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java +++ b/src/main/java/com/chargebee/v4/models/order/params/OrderListParams.java @@ -10,6 +10,8 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -147,9 +149,61 @@ public static final class SubscriptionIdFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, OrderListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public OrderListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public OrderListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public OrderListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public OrderListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -165,9 +219,61 @@ public static final class ShippedAtFilter extends TimestampFilter { + public static final class OrderTypeFilter extends EnumFilter { OrderTypeFilter(String fieldName, OrderListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, OrderType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .orderType().is(OrderType.YOUR_VALUE)}
+ * + * @see #is(OrderType) + */ + @Deprecated + public OrderListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .orderType().isNot(OrderType.YOUR_VALUE)}
+ * + * @see #isNot(OrderType) + */ + @Deprecated + public OrderListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .orderType().in(OrderType.VALUE1, OrderType.VALUE2)}
+ * + * @see #in(OrderType[]) + */ + @Deprecated + public OrderListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .orderType().notIn(OrderType.VALUE1, OrderType.VALUE2)}
+ * + * @see #notIn(OrderType[]) + */ + @Deprecated + public OrderListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -195,16 +301,82 @@ public static final class CreatedAtFilter extends TimestampFilter { + public static final class ResentStatusFilter + extends EnumFilter { ResentStatusFilter(String fieldName, OrderListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ResentStatus::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .resentStatus().is(ResentStatus.YOUR_VALUE)}
+ * + * @see #is(ResentStatus) + */ + @Deprecated + public OrderListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .resentStatus().isNot(ResentStatus.YOUR_VALUE)}
+ * + * @see #isNot(ResentStatus) + */ + @Deprecated + public OrderListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .resentStatus().in(ResentStatus.VALUE1, ResentStatus.VALUE2)}
+ * + * @see #in(ResentStatus[]) + */ + @Deprecated + public OrderListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .resentStatus().notIn(ResentStatus.VALUE1, ResentStatus.VALUE2)}
+ * + * @see #notIn(ResentStatus[]) + */ + @Deprecated + public OrderListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class IsResentFilter extends StringFilter { + public static final class IsResentFilter extends BooleanFilter { IsResentFilter(String fieldName, OrderListBuilder 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 .isResent().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public OrderListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class OriginalOrderIdFilter extends StringFilter { @@ -546,4 +718,108 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + NEW("new"), + + PROCESSING("processing"), + + COMPLETE("complete"), + + CANCELLED("cancelled"), + + VOIDED("voided"), + + QUEUED("queued"), + + AWAITING_SHIPMENT("awaiting_shipment"), + + ON_HOLD("on_hold"), + + DELIVERED("delivered"), + + SHIPPED("shipped"), + + PARTIALLY_DELIVERED("partially_delivered"), + + RETURNED("returned"), + + /** 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 OrderType { + MANUAL("manual"), + + SYSTEM_GENERATED("system_generated"), + + /** An enum member indicating that OrderType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + OrderType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OrderType fromString(String value) { + if (value == null) return _UNKNOWN; + for (OrderType enumValue : OrderType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ResentStatus { + FULLY_RESENT("fully_resent"), + + PARTIALLY_RESENT("partially_resent"), + + /** An enum member indicating that ResentStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ResentStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ResentStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (ResentStatus enumValue : ResentStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } 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 cba8dc2d..8b00e063 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -100,15 +101,119 @@ public static final class CustomerIdFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, PaymentSourceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public PaymentSourceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public PaymentSourceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public PaymentSourceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public PaymentSourceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, PaymentSourceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public PaymentSourceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public PaymentSourceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public PaymentSourceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public PaymentSourceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -474,4 +579,130 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Type { + CARD("card"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + AMAZON_PAYMENTS("amazon_payments"), + + DIRECT_DEBIT("direct_debit"), + + GENERIC("generic"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + KAKAO_PAY("kakao_pay"), + + NAVER_PAY("naver_pay"), + + REVOLUT_PAY("revolut_pay"), + + CASH_APP_PAY("cash_app_pay"), + + /** 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 { + VALID("valid"), + + EXPIRING("expiring"), + + EXPIRED("expired"), + + INVALID("invalid"), + + PENDING_VERIFICATION("pending_verification"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java index 72659d8b..8a3dc9a9 100644 --- a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForCustomerParams.java @@ -8,7 +8,7 @@ package com.chargebee.v4.models.paymentVoucher.params; import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -66,10 +66,63 @@ public PaymentVouchersForCustomerParams build() { return new PaymentVouchersForCustomerParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter + extends EnumFilter { StatusFilter( String fieldName, PaymentVouchersForCustomerBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public PaymentVouchersForCustomerBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public PaymentVouchersForCustomerBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public PaymentVouchersForCustomerBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public PaymentVouchersForCustomerBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -234,4 +287,36 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java index a5294dee..d5aa18ef 100644 --- a/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/params/PaymentVouchersForInvoiceParams.java @@ -8,7 +8,7 @@ package com.chargebee.v4.models.paymentVoucher.params; import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -66,10 +66,63 @@ public PaymentVouchersForInvoiceParams build() { return new PaymentVouchersForInvoiceParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter + extends EnumFilter { StatusFilter( String fieldName, PaymentVouchersForInvoiceBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public PaymentVouchersForInvoiceBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public PaymentVouchersForInvoiceBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public PaymentVouchersForInvoiceBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public PaymentVouchersForInvoiceBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -234,4 +287,36 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + ACTIVE("active"), + + CONSUMED("consumed"), + + EXPIRED("expired"), + + FAILURE("failure"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java index 4bd0ead0..347a427d 100644 --- a/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItem/params/Pc2MigrationItemListApplicableAddonsParams.java @@ -8,7 +8,7 @@ package com.chargebee.v4.models.pc2MigrationItem.params; import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -65,13 +65,26 @@ public Pc2MigrationItemListApplicableAddonsParams build() { } public static final class IsRecurringFilter - extends StringFilter { + extends BooleanFilter { IsRecurringFilter( String fieldName, Pc2MigrationItemListApplicableAddonsBuilder 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 .isRecurring().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public Pc2MigrationItemListApplicableAddonsBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } } diff --git a/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java index 6bb54e14..2dbab0c8 100644 --- a/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java +++ b/src/main/java/com/chargebee/v4/models/pc2MigrationItemPrice/params/Pc2MigrationItemPriceListParams.java @@ -9,6 +9,8 @@ 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 java.util.Collections; import java.util.LinkedHashMap; @@ -95,27 +97,105 @@ public static final class Pc2MigrationItemIdFilter } public static final class IsInvalidPc1IdFilter - extends StringFilter { + extends BooleanFilter { IsInvalidPc1IdFilter( String fieldName, Pc2MigrationItemPriceListBuilder 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 .isInvalidPc1Id().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class Pc1ItemTypeFilter - extends StringFilter { + extends EnumFilter { Pc1ItemTypeFilter( String fieldName, Pc2MigrationItemPriceListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Pc1ItemType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pc1ItemType().is(Pc1ItemType.YOUR_VALUE)}
+ * + * @see #is(Pc1ItemType) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pc1ItemType().isNot(Pc1ItemType.YOUR_VALUE)}
+ * + * @see #isNot(Pc1ItemType) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pc1ItemType().in(Pc1ItemType.VALUE1, Pc1ItemType.VALUE2)}
+ * + * @see #in(Pc1ItemType[]) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pc1ItemType().notIn(Pc1ItemType.VALUE1, Pc1ItemType.VALUE2)}
+ * + * @see #notIn(Pc1ItemType[]) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } public static final class IsRecurringFilter - extends StringFilter { + extends BooleanFilter { IsRecurringFilter( String fieldName, Pc2MigrationItemPriceListBuilder 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 .isRecurring().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public Pc2MigrationItemPriceListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } } @@ -230,4 +310,32 @@ public static IsRecurringIs fromString(String value) { return _UNKNOWN; } } + + public enum Pc1ItemType { + PLAN("plan"), + + ADDON("addon"), + + /** An enum member indicating that Pc1ItemType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Pc1ItemType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Pc1ItemType fromString(String value) { + if (value == null) return _UNKNOWN; + for (Pc1ItemType enumValue : Pc1ItemType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java b/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java index f626fba8..5ebb0531 100644 --- a/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java +++ b/src/main/java/com/chargebee/v4/models/plan/params/PlanListParams.java @@ -11,6 +11,8 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -165,9 +167,61 @@ public static final class PeriodFilter extends NumberFilter { } } - public static final class PeriodUnitFilter extends StringFilter { + public static final class PeriodUnitFilter extends EnumFilter { PeriodUnitFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PeriodUnit::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().is(PeriodUnit.YOUR_VALUE)}
+ * + * @see #is(PeriodUnit) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().isNot(PeriodUnit.YOUR_VALUE)}
+ * + * @see #isNot(PeriodUnit) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().in(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #in(PeriodUnit[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .periodUnit().notIn(PeriodUnit.VALUE1, PeriodUnit.VALUE2)}
+ * + * @see #notIn(PeriodUnit[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -177,40 +231,321 @@ public static final class TrialPeriodFilter extends NumberFilter { + public static final class TrialPeriodUnitFilter + extends EnumFilter { TrialPeriodUnitFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, TrialPeriodUnit::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().is(TrialPeriodUnit.YOUR_VALUE)}
+ * + * @see #is(TrialPeriodUnit) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().isNot(TrialPeriodUnit.YOUR_VALUE)}
+ * + * @see #isNot(TrialPeriodUnit) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().in(TrialPeriodUnit.VALUE1, TrialPeriodUnit.VALUE2)}
+       *     
+ * + * @see #in(TrialPeriodUnit[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .trialPeriodUnit().notIn(TrialPeriodUnit.VALUE1, TrialPeriodUnit.VALUE2)}
+       *     
+ * + * @see #notIn(TrialPeriodUnit[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class AddonApplicabilityFilter extends StringFilter { + public static final class AddonApplicabilityFilter + extends EnumFilter { AddonApplicabilityFilter( String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, AddonApplicability::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .addonApplicability().is(AddonApplicability.YOUR_VALUE)}
+ * + * @see #is(AddonApplicability) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .addonApplicability().isNot(AddonApplicability.YOUR_VALUE)}
+ * + * @see #isNot(AddonApplicability) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .addonApplicability().in(AddonApplicability.VALUE1, AddonApplicability.VALUE2)}
+       *     
+ * + * @see #in(AddonApplicability[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .addonApplicability().notIn(AddonApplicability.VALUE1, AddonApplicability.VALUE2)}
+       *     
+ * + * @see #notIn(AddonApplicability[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class GiftableFilter extends StringFilter { + public static final class GiftableFilter extends BooleanFilter { GiftableFilter(String fieldName, PlanListBuilder 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 .giftable().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class ChargeModelFilter extends StringFilter { + public static final class ChargeModelFilter extends EnumFilter { ChargeModelFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, ChargeModel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeModel().is(ChargeModel.YOUR_VALUE)}
+ * + * @see #is(ChargeModel) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeModel().isNot(ChargeModel.YOUR_VALUE)}
+ * + * @see #isNot(ChargeModel) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeModel().in(ChargeModel.VALUE1, ChargeModel.VALUE2)}
+ * + * @see #in(ChargeModel[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .chargeModel().notIn(ChargeModel.VALUE1, ChargeModel.VALUE2)}
+ * + * @see #notIn(ChargeModel[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class PricingModelFilter extends StringFilter { + public static final class PricingModelFilter extends EnumFilter { PricingModelFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PricingModel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().is(PricingModel.YOUR_VALUE)}
+ * + * @see #is(PricingModel) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().isNot(PricingModel.YOUR_VALUE)}
+ * + * @see #isNot(PricingModel) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().in(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #in(PricingModel[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .pricingModel().notIn(PricingModel.VALUE1, PricingModel.VALUE2)}
+ * + * @see #notIn(PricingModel[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -226,9 +561,61 @@ public static final class CurrencyCodeFilter extends StringFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, PlanListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public PlanListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public PlanListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public PlanListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public PlanListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -729,4 +1116,220 @@ public static ChannelIsNot fromString(String value) { return _UNKNOWN; } } + + public enum PeriodUnit { + DAY("day"), + + WEEK("week"), + + MONTH("month"), + + YEAR("year"), + + /** An enum member indicating that PeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (PeriodUnit enumValue : PeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TrialPeriodUnit { + DAY("day"), + + MONTH("month"), + + /** An enum member indicating that TrialPeriodUnit was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TrialPeriodUnit(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TrialPeriodUnit fromString(String value) { + if (value == null) return _UNKNOWN; + for (TrialPeriodUnit enumValue : TrialPeriodUnit.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AddonApplicability { + ALL("all"), + + RESTRICTED("restricted"), + + /** An enum member indicating that AddonApplicability was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AddonApplicability(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AddonApplicability fromString(String value) { + if (value == null) return _UNKNOWN; + for (AddonApplicability enumValue : AddonApplicability.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum ChargeModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that ChargeModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ChargeModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ChargeModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (ChargeModel enumValue : ChargeModel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum PricingModel { + FLAT_FEE("flat_fee"), + + PER_UNIT("per_unit"), + + TIERED("tiered"), + + VOLUME("volume"), + + STAIRSTEP("stairstep"), + + /** An enum member indicating that PricingModel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PricingModel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PricingModel fromString(String value) { + if (value == null) return _UNKNOWN; + for (PricingModel enumValue : PricingModel.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 enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java index 476ebfa0..ca3f1934 100644 --- a/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java +++ b/src/main/java/com/chargebee/v4/models/priceVariant/params/PriceVariantListParams.java @@ -10,6 +10,8 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -103,9 +105,61 @@ public static final class NameFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, PriceVariantListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public PriceVariantListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public PriceVariantListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public PriceVariantListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public PriceVariantListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -131,11 +185,24 @@ public static final class BusinessEntityIdFilter extends StringFilter { + extends BooleanFilter { IncludeSiteLevelResourcesFilter( String fieldName, PriceVariantListBuilder 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 .includeSiteLevelResources().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public PriceVariantListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class SortBySortBuilder { @@ -376,4 +443,32 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + ACTIVE("active"), + + ARCHIVED("archived"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java b/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java index 1670a5b4..a265ffdd 100644 --- a/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java +++ b/src/main/java/com/chargebee/v4/models/product/params/ProductListParams.java @@ -10,6 +10,8 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -108,22 +110,100 @@ public static final class NameFilter extends StringFilter { } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, ProductListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ProductListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ProductListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ProductListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ProductListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class ShippableFilter extends StringFilter { + public static final class ShippableFilter extends BooleanFilter { ShippableFilter(String fieldName, ProductListBuilder 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 .shippable().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ProductListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } - public static final class HasVariantFilter extends StringFilter { + public static final class HasVariantFilter extends BooleanFilter { HasVariantFilter(String fieldName, ProductListBuilder 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 .hasVariant().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public ProductListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class CreatedAtFilter extends TimestampFilter { @@ -362,4 +442,32 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java index 0fe640d7..98fd93e8 100644 --- a/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java +++ b/src/main/java/com/chargebee/v4/models/promotionalCredit/params/PromotionalCreditListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -89,10 +90,62 @@ public static final class CreatedAtFilter } } - public static final class TypeFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter( String fieldName, PromotionalCreditListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public PromotionalCreditListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public PromotionalCreditListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public PromotionalCreditListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public PromotionalCreditListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -159,4 +212,32 @@ public static TypeIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Type { + INCREMENT("increment"), + + DECREMENT("decrement"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java index 7b1de744..2d1735ad 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -125,9 +126,61 @@ public static final class SubscriptionIdFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, QuoteListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public QuoteListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public QuoteListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public QuoteListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public QuoteListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -350,4 +403,48 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + OPEN("open"), + + ACCEPTED("accepted"), + + DECLINED("declined"), + + INVOICED("invoiced"), + + CLOSED("closed"), + + PENDING_APPROVAL("pending_approval"), + + APPROVAL_REJECTED("approval_rejected"), + + PROPOSED("proposed"), + + VOIDED("voided"), + + EXPIRED("expired"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java index 6c0065f7..312f186c 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -84,9 +85,61 @@ public RampListParams build() { return new RampListParams(this); } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, RampListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public RampListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public RampListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public RampListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public RampListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -236,4 +289,36 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + SCHEDULED("scheduled"), + + SUCCEEDED("succeeded"), + + FAILED("failed"), + + DRAFT("draft"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java index 3c566c81..c7fd6777 100644 --- a/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java +++ b/src/main/java/com/chargebee/v4/models/siteMigrationDetail/params/SiteMigrationDetailListParams.java @@ -9,6 +9,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -102,17 +103,122 @@ public static final class EntityIdFilter extends StringFilter { + extends EnumFilter { EntityTypeFilter( String fieldName, SiteMigrationDetailListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, EntityType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().is(EntityType.YOUR_VALUE)}
+ * + * @see #is(EntityType) + */ + @Deprecated + public SiteMigrationDetailListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().isNot(EntityType.YOUR_VALUE)}
+ * + * @see #isNot(EntityType) + */ + @Deprecated + public SiteMigrationDetailListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().in(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #in(EntityType[]) + */ + @Deprecated + public SiteMigrationDetailListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().notIn(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #notIn(EntityType[]) + */ + @Deprecated + public SiteMigrationDetailListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class StatusFilter extends StringFilter { + public static final class StatusFilter + extends EnumFilter { StatusFilter( String fieldName, SiteMigrationDetailListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public SiteMigrationDetailListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public SiteMigrationDetailListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public SiteMigrationDetailListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public SiteMigrationDetailListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } } @@ -248,4 +354,70 @@ public static StatusIsNot fromString(String value) { return _UNKNOWN; } } + + public enum EntityType { + CUSTOMER("customer"), + + SUBSCRIPTION("subscription"), + + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + ORDER("order"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + MOVED_IN("moved_in"), + + MOVED_OUT("moved_out"), + + MOVING_OUT("moving_out"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionListParams.java index 06511e02..6a6a157c 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 @@ -11,6 +11,8 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; +import com.chargebee.v4.filters.BooleanFilter; import com.chargebee.v4.filters.CustomFieldSelector; @@ -190,16 +192,121 @@ public static final class ItemPriceIdFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, SubscriptionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public SubscriptionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public SubscriptionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public SubscriptionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class CancelReasonFilter extends StringFilter { + public static final class CancelReasonFilter + extends EnumFilter { CancelReasonFilter( String fieldName, SubscriptionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, CancelReason::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .cancelReason().is(CancelReason.YOUR_VALUE)}
+ * + * @see #is(CancelReason) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .cancelReason().isNot(CancelReason.YOUR_VALUE)}
+ * + * @see #isNot(CancelReason) + */ + @Deprecated + public SubscriptionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .cancelReason().in(CancelReason.VALUE1, CancelReason.VALUE2)}
+ * + * @see #in(CancelReason[]) + */ + @Deprecated + public SubscriptionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .cancelReason().notIn(CancelReason.VALUE1, CancelReason.VALUE2)}
+ * + * @see #notIn(CancelReason[]) + */ + @Deprecated + public SubscriptionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -247,11 +354,24 @@ public static final class CancelledAtFilter extends TimestampFilter { + extends BooleanFilter { HasScheduledChangesFilter( 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 .hasScheduledChanges().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class UpdatedAtFilter extends TimestampFilter { @@ -262,27 +382,109 @@ public static final class UpdatedAtFilter extends TimestampFilter { + extends EnumFilter { OfflinePaymentMethodFilter( String fieldName, SubscriptionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, OfflinePaymentMethod::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .offlinePaymentMethod().is(OfflinePaymentMethod.YOUR_VALUE)}
+ * + * @see #is(OfflinePaymentMethod) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .offlinePaymentMethod().isNot(OfflinePaymentMethod.YOUR_VALUE)}
+ * + * @see #isNot(OfflinePaymentMethod) + */ + @Deprecated + public SubscriptionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .offlinePaymentMethod().in(OfflinePaymentMethod.VALUE1, OfflinePaymentMethod.VALUE2)}
+       *     
+ * + * @see #in(OfflinePaymentMethod[]) + */ + @Deprecated + public SubscriptionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
+       *     {@code .offlinePaymentMethod().notIn(OfflinePaymentMethod.VALUE1, OfflinePaymentMethod.VALUE2)}
+       *     
+ * + * @see #notIn(OfflinePaymentMethod[]) + */ + @Deprecated + public SubscriptionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } public static final class AutoCloseInvoicesFilter - extends StringFilter { + extends BooleanFilter { AutoCloseInvoicesFilter( 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 .autoCloseInvoices().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class OverrideRelationshipFilter - extends StringFilter { + extends BooleanFilter { OverrideRelationshipFilter( 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 .overrideRelationship().is(true)}
+ * + * @see #is(boolean) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } } public static final class BusinessEntityIdFilter extends StringFilter { @@ -292,9 +494,61 @@ public static final class BusinessEntityIdFilter extends StringFilter { + public static final class ChannelFilter extends EnumFilter { ChannelFilter(String fieldName, SubscriptionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Channel::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().is(Channel.YOUR_VALUE)}
+ * + * @see #is(Channel) + */ + @Deprecated + public SubscriptionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().isNot(Channel.YOUR_VALUE)}
+ * + * @see #isNot(Channel) + */ + @Deprecated + public SubscriptionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().in(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #in(Channel[]) + */ + @Deprecated + public SubscriptionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .channel().notIn(Channel.VALUE1, Channel.VALUE2)}
+ * + * @see #notIn(Channel[]) + */ + @Deprecated + public SubscriptionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -898,4 +1152,162 @@ public static ChannelIsNot fromString(String value) { return _UNKNOWN; } } + + public enum Status { + FUTURE("future"), + + IN_TRIAL("in_trial"), + + ACTIVE("active"), + + NON_RENEWING("non_renewing"), + + PAUSED("paused"), + + CANCELLED("cancelled"), + + TRANSFERRED("transferred"), + + /** 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 CancelReason { + NOT_PAID("not_paid"), + + NO_CARD("no_card"), + + FRAUD_REVIEW_FAILED("fraud_review_failed"), + + NON_COMPLIANT_EU_CUSTOMER("non_compliant_eu_customer"), + + TAX_CALCULATION_FAILED("tax_calculation_failed"), + + CURRENCY_INCOMPATIBLE_WITH_GATEWAY("currency_incompatible_with_gateway"), + + NON_COMPLIANT_CUSTOMER("non_compliant_customer"), + + /** An enum member indicating that CancelReason was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + CancelReason(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static CancelReason fromString(String value) { + if (value == null) return _UNKNOWN; + for (CancelReason enumValue : CancelReason.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum OfflinePaymentMethod { + NO_PREFERENCE("no_preference"), + + CASH("cash"), + + CHECK("check"), + + BANK_TRANSFER("bank_transfer"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + BOLETO("boleto"), + + US_AUTOMATED_BANK_TRANSFER("us_automated_bank_transfer"), + + EU_AUTOMATED_BANK_TRANSFER("eu_automated_bank_transfer"), + + UK_AUTOMATED_BANK_TRANSFER("uk_automated_bank_transfer"), + + JP_AUTOMATED_BANK_TRANSFER("jp_automated_bank_transfer"), + + MX_AUTOMATED_BANK_TRANSFER("mx_automated_bank_transfer"), + + CUSTOM("custom"), + + /** + * An enum member indicating that OfflinePaymentMethod was instantiated with an unknown value. + */ + _UNKNOWN(null); + private final String value; + + OfflinePaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static OfflinePaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (OfflinePaymentMethod enumValue : OfflinePaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Channel { + WEB("web"), + + APP_STORE("app_store"), + + PLAY_STORE("play_store"), + + /** An enum member indicating that Channel was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Channel(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Channel fromString(String value) { + if (value == null) return _UNKNOWN; + for (Channel enumValue : Channel.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } 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 0ea4c2ca..21eceff4 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 @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -99,22 +100,126 @@ public static final class EntityIdFilter } public static final class EntityTypeFilter - extends StringFilter { + extends EnumFilter { EntityTypeFilter( String fieldName, ThirdPartyEntityMappingListAllBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, EntityType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().is(EntityType.YOUR_VALUE)}
+ * + * @see #is(EntityType) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().isNot(EntityType.YOUR_VALUE)}
+ * + * @see #isNot(EntityType) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().in(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #in(EntityType[]) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().notIn(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #notIn(EntityType[]) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } public static final class StatusFilter - extends StringFilter { + extends EnumFilter { StatusFilter( String fieldName, ThirdPartyEntityMappingListAllBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ThirdPartyEntityMappingListAllBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -360,4 +465,110 @@ public static StatusIsNot fromString(String value) { return _UNKNOWN; } } + + public enum EntityType { + CUSTOMER("customer"), + + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + SUBSCRIPTION("subscription"), + + ORDER("order"), + + QUOTE("quote"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + TAX_RATE("tax_rate"), + + 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; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + SYNCED("synced"), + + PARTIALLY_SYNCED("partially_synced"), + + CREATE_FAILED("create_failed"), + + UPDATE_FAILED("update_failed"), + + STOPPED("stopped"), + + IGNORED("ignored"), + + TO_BE_PICKED("to_be_picked"), + + FORCE_SYNC("force_sync"), + + MISMATCH("mismatch"), + + DELETED("deleted"), + + QUEUED("queued"), + + DELETE_FAILED("delete_failed"), + + DELETE_SUCCESS("delete_success"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java b/src/main/java/com/chargebee/v4/models/thirdPartyEntityMapping/params/ThirdPartyEntityMappingListParams.java index 912c8318..a5fcdffd 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 @@ -8,8 +8,8 @@ package com.chargebee.v4.models.thirdPartyEntityMapping.params; import com.chargebee.v4.internal.Recommended; -import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -77,12 +77,64 @@ public ThirdPartyEntityMappingListParams build() { } public static final class EntityTypeFilter - extends StringFilter { + extends EnumFilter { EntityTypeFilter( String fieldName, ThirdPartyEntityMappingListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, EntityType::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().is(EntityType.YOUR_VALUE)}
+ * + * @see #is(EntityType) + */ + @Deprecated + public ThirdPartyEntityMappingListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().isNot(EntityType.YOUR_VALUE)}
+ * + * @see #isNot(EntityType) + */ + @Deprecated + public ThirdPartyEntityMappingListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().in(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #in(EntityType[]) + */ + @Deprecated + public ThirdPartyEntityMappingListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .entityType().notIn(EntityType.VALUE1, EntityType.VALUE2)}
+ * + * @see #notIn(EntityType[]) + */ + @Deprecated + public ThirdPartyEntityMappingListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -218,4 +270,60 @@ public static EntityTypeIsNot fromString(String value) { return _UNKNOWN; } } + + public enum EntityType { + CUSTOMER("customer"), + + INVOICE("invoice"), + + CREDIT_NOTE("credit_note"), + + TRANSACTION("transaction"), + + PLAN("plan"), + + ADDON("addon"), + + COUPON("coupon"), + + SUBSCRIPTION("subscription"), + + ORDER("order"), + + QUOTE("quote"), + + ITEM_FAMILY("item_family"), + + ITEM("item"), + + ITEM_PRICE("item_price"), + + TAX_RATE("tax_rate"), + + 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; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } 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 8877e904..c31fe402 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 @@ -11,6 +11,7 @@ import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.NumberFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -156,16 +157,121 @@ public static final class PaymentSourceIdFilter extends StringFilter { + public static final class PaymentMethodFilter + extends EnumFilter { PaymentMethodFilter( String fieldName, TransactionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, PaymentMethod::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .paymentMethod().is(PaymentMethod.YOUR_VALUE)}
+ * + * @see #is(PaymentMethod) + */ + @Deprecated + public TransactionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .paymentMethod().isNot(PaymentMethod.YOUR_VALUE)}
+ * + * @see #isNot(PaymentMethod) + */ + @Deprecated + public TransactionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .paymentMethod().in(PaymentMethod.VALUE1, PaymentMethod.VALUE2)}
+ * + * @see #in(PaymentMethod[]) + */ + @Deprecated + public TransactionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .paymentMethod().notIn(PaymentMethod.VALUE1, PaymentMethod.VALUE2)}
+ * + * @see #notIn(PaymentMethod[]) + */ + @Deprecated + public TransactionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } - public static final class GatewayFilter extends StringFilter { + public static final class GatewayFilter extends EnumFilter { GatewayFilter(String fieldName, TransactionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Gateway::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .gateway().is(Gateway.YOUR_VALUE)}
+ * + * @see #is(Gateway) + */ + @Deprecated + public TransactionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .gateway().isNot(Gateway.YOUR_VALUE)}
+ * + * @see #isNot(Gateway) + */ + @Deprecated + public TransactionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .gateway().in(Gateway.VALUE1, Gateway.VALUE2)}
+ * + * @see #in(Gateway[]) + */ + @Deprecated + public TransactionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .gateway().notIn(Gateway.VALUE1, Gateway.VALUE2)}
+ * + * @see #notIn(Gateway[]) + */ + @Deprecated + public TransactionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -190,9 +296,61 @@ public static final class ReferenceNumberFilter extends StringFilter { + public static final class TypeFilter extends EnumFilter { TypeFilter(String fieldName, TransactionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public TransactionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public TransactionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public TransactionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public TransactionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -215,9 +373,61 @@ public static final class AmountCapturableFilter extends NumberFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter(String fieldName, TransactionListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public TransactionListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public TransactionListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public TransactionListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public TransactionListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -1095,4 +1305,328 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum PaymentMethod { + CARD("card"), + + CASH("cash"), + + CHECK("check"), + + CHARGEBACK("chargeback"), + + BANK_TRANSFER("bank_transfer"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + DIRECT_DEBIT("direct_debit"), + + ALIPAY("alipay"), + + UNIONPAY("unionpay"), + + APPLE_PAY("apple_pay"), + + WECHAT_PAY("wechat_pay"), + + ACH_CREDIT("ach_credit"), + + SEPA_CREDIT("sepa_credit"), + + IDEAL("ideal"), + + GOOGLE_PAY("google_pay"), + + SOFORT("sofort"), + + BANCONTACT("bancontact"), + + GIROPAY("giropay"), + + DOTPAY("dotpay"), + + OTHER("other"), + + APP_STORE("app_store"), + + UPI("upi"), + + NETBANKING_EMANDATES("netbanking_emandates"), + + PLAY_STORE("play_store"), + + CUSTOM("custom"), + + BOLETO("boleto"), + + VENMO("venmo"), + + PAY_TO("pay_to"), + + FASTER_PAYMENTS("faster_payments"), + + SEPA_INSTANT_TRANSFER("sepa_instant_transfer"), + + AUTOMATED_BANK_TRANSFER("automated_bank_transfer"), + + KLARNA_PAY_NOW("klarna_pay_now"), + + ONLINE_BANKING_POLAND("online_banking_poland"), + + PAYCONIQ_BY_BANCONTACT("payconiq_by_bancontact"), + + ELECTRONIC_PAYMENT_STANDARD("electronic_payment_standard"), + + KBC_PAYMENT_BUTTON("kbc_payment_button"), + + PAY_BY_BANK("pay_by_bank"), + + TRUSTLY("trustly"), + + STABLECOIN("stablecoin"), + + KAKAO_PAY("kakao_pay"), + + NAVER_PAY("naver_pay"), + + REVOLUT_PAY("revolut_pay"), + + CASH_APP_PAY("cash_app_pay"), + + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + PaymentMethod(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static PaymentMethod fromString(String value) { + if (value == null) return _UNKNOWN; + for (PaymentMethod enumValue : PaymentMethod.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Gateway { + CHARGEBEE("chargebee"), + + CHARGEBEE_PAYMENTS("chargebee_payments"), + + ADYEN("adyen"), + + STRIPE("stripe"), + + WEPAY("wepay"), + + BRAINTREE("braintree"), + + AUTHORIZE_NET("authorize_net"), + + PAYPAL_PRO("paypal_pro"), + + PIN("pin"), + + EWAY("eway"), + + EWAY_RAPID("eway_rapid"), + + WORLDPAY("worldpay"), + + BALANCED_PAYMENTS("balanced_payments"), + + BEANSTREAM("beanstream"), + + BLUEPAY("bluepay"), + + ELAVON("elavon"), + + FIRST_DATA_GLOBAL("first_data_global"), + + HDFC("hdfc"), + + MIGS("migs"), + + NMI("nmi"), + + OGONE("ogone"), + + PAYMILL("paymill"), + + PAYPAL_PAYFLOW_PRO("paypal_payflow_pro"), + + SAGE_PAY("sage_pay"), + + TCO("tco"), + + WIRECARD("wirecard"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + GOCARDLESS("gocardless"), + + ORBITAL("orbital"), + + MONERIS_US("moneris_us"), + + MONERIS("moneris"), + + BLUESNAP("bluesnap"), + + CYBERSOURCE("cybersource"), + + VANTIV("vantiv"), + + CHECKOUT_COM("checkout_com"), + + PAYPAL("paypal"), + + INGENICO_DIRECT("ingenico_direct"), + + EXACT("exact"), + + MOLLIE("mollie"), + + QUICKBOOKS("quickbooks"), + + RAZORPAY("razorpay"), + + GLOBAL_PAYMENTS("global_payments"), + + BANK_OF_AMERICA("bank_of_america"), + + ECENTRIC("ecentric"), + + METRICS_GLOBAL("metrics_global"), + + WINDCAVE("windcave"), + + PAY_COM("pay_com"), + + EBANX("ebanx"), + + DLOCAL("dlocal"), + + NUVEI("nuvei"), + + SOLIDGATE("solidgate"), + + PAYSTACK("paystack"), + + JP_MORGAN("jp_morgan"), + + DEUTSCHE_BANK("deutsche_bank"), + + EZIDEBIT("ezidebit"), + + TWIKEY("twikey"), + + TEMPUS("tempus"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that Gateway was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Gateway(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Gateway fromString(String value) { + if (value == null) return _UNKNOWN; + for (Gateway enumValue : Gateway.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Type { + AUTHORIZATION("authorization"), + + PAYMENT("payment"), + + REFUND("refund"), + + PAYMENT_REVERSAL("payment_reversal"), + + /** 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 { + IN_PROGRESS("in_progress"), + + SUCCESS("success"), + + VOIDED("voided"), + + FAILURE("failure"), + + TIMEOUT("timeout"), + + NEEDS_ATTENTION("needs_attention"), + + LATE_FAILURE("late_failure"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java b/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java index e743c0e5..eaefa70c 100644 --- a/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java +++ b/src/main/java/com/chargebee/v4/models/usage/params/UsageListParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -127,9 +128,61 @@ public static final class InvoiceIdFilter extends StringFilter } } - public static final class SourceFilter extends StringFilter { + public static final class SourceFilter extends EnumFilter { SourceFilter(String fieldName, UsageListBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Source::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().is(Source.YOUR_VALUE)}
+ * + * @see #is(Source) + */ + @Deprecated + public UsageListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().isNot(Source.YOUR_VALUE)}
+ * + * @see #isNot(Source) + */ + @Deprecated + public UsageListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().in(Source.VALUE1, Source.VALUE2)}
+ * + * @see #in(Source[]) + */ + @Deprecated + public UsageListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .source().notIn(Source.VALUE1, Source.VALUE2)}
+ * + * @see #notIn(Source[]) + */ + @Deprecated + public UsageListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -317,4 +370,34 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Source { + ADMIN_CONSOLE("admin_console"), + + API("api"), + + BULK_OPERATION("bulk_operation"), + + /** 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; + } + } } diff --git a/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java b/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java index 8fa032a9..b885535e 100644 --- a/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java +++ b/src/main/java/com/chargebee/v4/models/variant/params/ListProductVariantsParams.java @@ -10,6 +10,7 @@ import com.chargebee.v4.internal.Recommended; import com.chargebee.v4.filters.StringFilter; import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; import java.util.Collections; import java.util.LinkedHashMap; @@ -110,10 +111,62 @@ public static final class SkuFilter extends StringFilter { + public static final class StatusFilter extends EnumFilter { StatusFilter( String fieldName, ListProductVariantsBuilder builder, Map params) { - super(fieldName, builder, params); + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ListProductVariantsBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ListProductVariantsBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ListProductVariantsBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ListProductVariantsBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; } } @@ -307,4 +360,32 @@ public static SortByDesc fromString(String value) { return _UNKNOWN; } } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + /** 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; + } + } } From 5f171366b7d5f92c9a51fb0dbe293f171fe81ecb Mon Sep 17 00:00:00 2001 From: cb-karthikp Date: Tue, 10 Feb 2026 12:07:02 +0530 Subject: [PATCH 2/2] change log and version bump-up --- CHANGELOG.md | 5 +++++ VERSION | 2 +- build.gradle.kts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70de8d26..51124118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### v4.1.1 (2026-02-10) +* * * +### Bug Fixes: +* Corrected the generation of `StringFilter` for `EnumFilter` and `BooleanFilter` parameters in GET list APIs. + ### v4.1.0 (2026-02-06) * * * ### New Attributes: diff --git a/VERSION b/VERSION index ee74734a..627a3f43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.0 +4.1.1 diff --git a/build.gradle.kts b/build.gradle.kts index 7ec634a5..21d27b43 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.1.0" +version = "4.1.1" description = "Java client library for ChargeBee" // Project metadata