diff --git a/CHANGELOG.md b/CHANGELOG.md index d8072de..7addce4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,60 @@ +### v3.12.0 (2025-09-24) +* * * + +### New Resources: +* PersonalizedOffer has been added. +* OfferFulfillment has been added. +* OfferEvent has been added. +* OmnichannelSubscriptionItemOffer has been added. + +### New Attributes: +* business_entity_id has been added to Customer#Balance. +* processor_advice_code has been added to GatewayErrorDetail. +* processor_advice_code has been added to Transaction#GatewayErrorDetail. +* omnichannel_subscription_item_offers has been added to OmnichannelSubscriptionItem. +* linked_omnichannel_subscriptions has been added to OmnichannelTransaction. +* linked_omnichannel_one_time_orders has been added to OmnichannelTransaction. +* contract_term has been added to Ramp. +* charge_once has been added to Ramp#ItemsToAdd. +* charge_on_option has been added to Ramp#ItemsToAdd. +* charge_on_event has been added to Ramp#ItemsToAdd. +* charge_once has been added to Ramp#ItemsToUpdate. +* charge_on_option has been added to Ramp#ItemsToUpdate. +* charge_on_event has been added to Ramp#ItemsToUpdate. +* error_file_path has been added to UsageFile. +* error_file_url has been added to UsageFile. + +### New Endpoint: +* move has been added to OmnichannelSubscription. + +### New Parameters: +* offline_payment_method has been added to Estimate#CreateSubItemEstimateRequest. +* offline_payment_method has been added to Estimate#CreateSubItemForCustomerEstimateRequest. +* offline_payment_method has been added to HostedPage#CheckoutNewForItemsRequest. +* offline_payment_method has been added to Quote#SubscriptionCreateSubItemsForCustomerQuoteRequest. +* offline_payment_method has been added to Quote#SubscriptionEditCreateSubCustomerQuoteForItemsRequest. +* contract_term has been added to Ramp#CreateForSubscriptionRequest. +* items_to_add has been added to Ramp#CreateForSubscriptionRequest. +* items_to_update has been added to Ramp#CreateForSubscriptionRequest. +* contract_term has been added to Ramp#UpdateRequest. +* items_to_add has been added to Ramp#UpdateRequest. +* items_to_update has been added to Ramp#UpdateRequest. + +### New Enums: +* DUNNING_UPDATED has been added EventType. +* OMNICHANNEL_SUBSCRIPTION_MOVED_IN has been added to EventType. + + +### Bug Fixes: +* currency list action has been marked as ListRequest. +* index has been removed from CreditNote#ShippingAddress. +* index has been removed from Invoice#ShippingAddress +* index has been removed from Order#ShippingAddress. +* index has been removed from Quote#ShippingAddress. +* index has been removed from SubscriptionEstimate#ShippingAddress. +* index has been removed from Subscription#ShippingAddress. + + ### v3.11.0b1 (2025-08-27) * * * diff --git a/chargebee/api_error.py b/chargebee/api_error.py index 053a324..aeabb3e 100644 --- a/chargebee/api_error.py +++ b/chargebee/api_error.py @@ -1,5 +1,4 @@ class APIError(Exception): - def __init__(self, http_code, json_obj, headers=None): Exception.__init__(self, json_obj.get("message")) self.json_obj = json_obj diff --git a/chargebee/main.py b/chargebee/main.py index 9d87456..66109a2 100644 --- a/chargebee/main.py +++ b/chargebee/main.py @@ -83,6 +83,8 @@ def __init__( self.ItemFamily = chargebee.ItemFamily(self.env) self.ItemPrice = chargebee.ItemPrice(self.env) self.Metadata = chargebee.Metadata(self.env) + self.OfferEvent = chargebee.OfferEvent(self.env) + self.OfferFulfillment = chargebee.OfferFulfillment(self.env) self.OmnichannelOneTimeOrder = chargebee.OmnichannelOneTimeOrder(self.env) self.OmnichannelOneTimeOrderItem = chargebee.OmnichannelOneTimeOrderItem( self.env @@ -91,6 +93,9 @@ def __init__( self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem( self.env ) + self.OmnichannelSubscriptionItemOffer = ( + chargebee.OmnichannelSubscriptionItemOffer(self.env) + ) self.OmnichannelSubscriptionItemScheduledChange = ( chargebee.OmnichannelSubscriptionItemScheduledChange(self.env) ) @@ -103,6 +108,7 @@ def __init__( self.PaymentScheduleScheme = chargebee.PaymentScheduleScheme(self.env) self.PaymentSource = chargebee.PaymentSource(self.env) self.PaymentVoucher = chargebee.PaymentVoucher(self.env) + self.PersonalizedOffer = chargebee.PersonalizedOffer(self.env) self.Plan = chargebee.Plan(self.env) self.PortalSession = chargebee.PortalSession(self.env) self.PriceVariant = chargebee.PriceVariant(self.env) diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 3d1a9c4..6756891 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -13,6 +13,7 @@ BillingPeriodUnit, BillingStartOption, CancelOption, + Category, ChangeOption, Channel, ChargeModel, @@ -26,6 +27,7 @@ CustomerType, DedupeOption, DirectDebitScheme, + DiscountType, DispositionType, DunningType, DurationType, @@ -178,6 +180,10 @@ from chargebee.models.metadata.operations import Metadata +from chargebee.models.offer_event.operations import OfferEvent + +from chargebee.models.offer_fulfillment.operations import OfferFulfillment + from chargebee.models.omnichannel_one_time_order.operations import ( OmnichannelOneTimeOrder, ) @@ -192,6 +198,10 @@ OmnichannelSubscriptionItem, ) +from chargebee.models.omnichannel_subscription_item_offer.operations import ( + OmnichannelSubscriptionItemOffer, +) + from chargebee.models.omnichannel_subscription_item_scheduled_change.operations import ( OmnichannelSubscriptionItemScheduledChange, ) @@ -216,6 +226,8 @@ from chargebee.models.payment_voucher.operations import PaymentVoucher +from chargebee.models.personalized_offer.operations import PersonalizedOffer + from chargebee.models.plan.operations import Plan from chargebee.models.portal_session.operations import PortalSession diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index 8425c14..a4775ee 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -233,7 +233,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class BillingAddress(TypedDict): first_name: NotRequired[str] diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py index cd43c2b..2e7b2b6 100644 --- a/chargebee/models/credit_note/responses.py +++ b/chargebee/models/credit_note/responses.py @@ -167,7 +167,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass diff --git a/chargebee/models/credit_note_estimate/operations.py b/chargebee/models/credit_note_estimate/operations.py index 92c960f..ec801de 100644 --- a/chargebee/models/credit_note_estimate/operations.py +++ b/chargebee/models/credit_note_estimate/operations.py @@ -29,7 +29,7 @@ class LineItemEntityType(Enum): def __str__(self): return self.value - class DiscountEntityType(Enum): + class LineItemDiscountDiscountType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -40,14 +40,7 @@ class DiscountEntityType(Enum): def __str__(self): return self.value - class DiscountDiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - class LineItemDiscountDiscountType(Enum): + class DiscountEntityType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -58,6 +51,13 @@ class LineItemDiscountDiscountType(Enum): def __str__(self): return self.value + class DiscountDiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + class LineItem(TypedDict): id: NotRequired[str] subscription_id: NotRequired[str] @@ -85,18 +85,25 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["CreditNoteEstimate.DiscountEntityType"] - discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] + class LineItemTier(TypedDict): + line_item_id: NotRequired[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + quantity_used: Required[int] + unit_amount: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + quantity_used_in_decimal: NotRequired[str] + unit_amount_in_decimal: NotRequired[str] + pricing_type: NotRequired[enums.PricingType] + package_size: NotRequired[int] - class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] class LineItemTax(TypedDict): line_item_id: NotRequired[str] @@ -115,24 +122,17 @@ class LineItemTax(TypedDict): tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] - class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required["CreditNoteEstimate.LineItemDiscountDiscountType"] - coupon_id: NotRequired[str] + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["CreditNoteEstimate.DiscountEntityType"] + discount_type: NotRequired["CreditNoteEstimate.DiscountDiscountType"] entity_id: NotRequired[str] - discount_amount: Required[int] + coupon_set_code: NotRequired[str] - class LineItemTier(TypedDict): - line_item_id: NotRequired[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - quantity_used: Required[int] - unit_amount: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - quantity_used_in_decimal: NotRequired[str] - unit_amount_in_decimal: NotRequired[str] - pricing_type: NotRequired[enums.PricingType] - package_size: NotRequired[int] + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] pass diff --git a/chargebee/models/credit_note_estimate/responses.py b/chargebee/models/credit_note_estimate/responses.py index 1cba572..721242f 100644 --- a/chargebee/models/credit_note_estimate/responses.py +++ b/chargebee/models/credit_note_estimate/responses.py @@ -34,22 +34,29 @@ class LineItemResponse(Model): @dataclass -class DiscountResponse(Model): +class LineItemTierResponse(Model): raw_data: Dict[Any, Any] = None - amount: int = None - description: str = None - entity_type: str = None - discount_type: str = None - entity_id: str = None - coupon_set_code: str = None + line_item_id: str = None + starting_unit: int = None + ending_unit: int = None + quantity_used: int = None + unit_amount: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + quantity_used_in_decimal: str = None + unit_amount_in_decimal: str = None + pricing_type: str = None + package_size: int = None @dataclass -class TaxResponse(Model): +class LineItemDiscountResponse(Model): raw_data: Dict[Any, Any] = None - name: str = None - amount: int = None - description: str = None + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None @dataclass @@ -73,29 +80,22 @@ class LineItemTaxResponse(Model): @dataclass -class LineItemDiscountResponse(Model): +class DiscountResponse(Model): raw_data: Dict[Any, Any] = None - line_item_id: str = None + amount: int = None + description: str = None + entity_type: str = None discount_type: str = None - coupon_id: str = None entity_id: str = None - discount_amount: int = None + coupon_set_code: str = None @dataclass -class LineItemTierResponse(Model): +class TaxResponse(Model): raw_data: Dict[Any, Any] = None - line_item_id: str = None - starting_unit: int = None - ending_unit: int = None - quantity_used: int = None - unit_amount: int = None - starting_unit_in_decimal: str = None - ending_unit_in_decimal: str = None - quantity_used_in_decimal: str = None - unit_amount_in_decimal: str = None - pricing_type: str = None - package_size: int = None + name: str = None + amount: int = None + description: str = None @dataclass @@ -110,10 +110,10 @@ class CreditNoteEstimateResponse(Model): amount_allocated: int = None amount_available: int = None line_items: List[LineItemResponse] = None + line_item_tiers: List[LineItemTierResponse] = None + line_item_discounts: List[LineItemDiscountResponse] = None + line_item_taxes: List[LineItemTaxResponse] = None discounts: List[DiscountResponse] = None taxes: List[TaxResponse] = None - line_item_taxes: List[LineItemTaxResponse] = None - line_item_discounts: List[LineItemDiscountResponse] = None - line_item_tiers: List[LineItemTierResponse] = None round_off_amount: int = None customer_id: str = None diff --git a/chargebee/models/currency/operations.py b/chargebee/models/currency/operations.py index e023d51..d417511 100644 --- a/chargebee/models/currency/operations.py +++ b/chargebee/models/currency/operations.py @@ -15,6 +15,10 @@ class ForexType(Enum): def __str__(self): return self.value + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + class CreateParams(TypedDict): currency_code: Required[str] forex_type: Required["Currency.ForexType"] @@ -28,14 +32,14 @@ class AddScheduleParams(TypedDict): manual_exchange_rate: Required[str] schedule_at: Required[int] - def list(self, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: jsonKeys = {} options = {} return request.send_list_request( "get", request.uri_path("currencies", "list"), self.env, - None, + cast(Dict[Any, Any], params), headers, ListResponse, None, diff --git a/chargebee/models/currency/responses.py b/chargebee/models/currency/responses.py index f80f322..35d30f9 100644 --- a/chargebee/models/currency/responses.py +++ b/chargebee/models/currency/responses.py @@ -16,10 +16,16 @@ class CurrencyResponse(Model): @dataclass -class ListResponse(Response): +class ListCurrencyResponse: currency: CurrencyResponse +@dataclass +class ListResponse(Response): + list: List[ListCurrencyResponse] + next_offset: str = None + + @dataclass class RetrieveResponse(Response): currency: CurrencyResponse diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py index b51efd9..0459a01 100644 --- a/chargebee/models/customer/operations.py +++ b/chargebee/models/customer/operations.py @@ -150,6 +150,7 @@ class Balance(TypedDict): unbilled_charges: Required[int] currency_code: Required[str] balance_currency_code: Required[str] + business_entity_id: NotRequired[str] class EntityIdentifier(TypedDict): id: Required[str] diff --git a/chargebee/models/customer/responses.py b/chargebee/models/customer/responses.py index 41bc27a..bab5bb4 100644 --- a/chargebee/models/customer/responses.py +++ b/chargebee/models/customer/responses.py @@ -79,6 +79,7 @@ class BalanceResponse(Model): unbilled_charges: int = None currency_code: str = None balance_currency_code: str = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 482b538..a0f128d 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -122,6 +122,15 @@ def __str__(self): return self.value +class Category(Enum): + INTRODUCTORY = "introductory" + PROMOTIONAL = "promotional" + DEVELOPER_DETERMINED = "developer_determined" + + def __str__(self): + return self.value + + class ChangeOption(Enum): IMMEDIATELY = "immediately" END_OF_TERM = "end_of_term" @@ -253,6 +262,15 @@ def __str__(self): return self.value +class DiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + PRICE = "price" + + def __str__(self): + return self.value + + class DispositionType(Enum): ATTACHMENT = "attachment" INLINE = "inline" @@ -466,6 +484,7 @@ class EventType(Enum): 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" @@ -629,6 +648,7 @@ class EventType(Enum): OMNICHANNEL_SUBSCRIPTION_ITEM_PAUSE_SCHEDULED = ( "omnichannel_subscription_item_pause_scheduled" ) + OMNICHANNEL_SUBSCRIPTION_MOVED_IN = "omnichannel_subscription_moved_in" PLAN_CREATED = "plan_created" PLAN_UPDATED = "plan_updated" PLAN_DELETED = "plan_deleted" @@ -1140,6 +1160,9 @@ class Type(Enum): KLARNA_PAY_NOW = "klarna_pay_now" ONLINE_BANKING_POLAND = "online_banking_poland" PAYCONIQ_BY_BANCONTACT = "payconiq_by_bancontact" + FREE_TRIAL = "free_trial" + PAY_UP_FRONT = "pay_up_front" + PAY_AS_YOU_GO = "pay_as_you_go" def __str__(self): return self.value diff --git a/chargebee/models/estimate/operations.py b/chargebee/models/estimate/operations.py index 40f7e64..c348494 100644 --- a/chargebee/models/estimate/operations.py +++ b/chargebee/models/estimate/operations.py @@ -118,6 +118,7 @@ class CreateSubItemEstimateSubscriptionParams(TypedDict): setup_fee: NotRequired[int] start_date: NotRequired[int] coupon: NotRequired[str] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] contract_term_billing_cycle_on_renewal: NotRequired[int] @@ -254,6 +255,7 @@ class CreateSubItemForCustomerEstimateSubscriptionParams(TypedDict): trial_end: NotRequired[int] setup_fee: NotRequired[int] start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] contract_term_billing_cycle_on_renewal: NotRequired[int] diff --git a/chargebee/models/gateway_error_detail/responses.py b/chargebee/models/gateway_error_detail/responses.py index beae84c..c7ee593 100644 --- a/chargebee/models/gateway_error_detail/responses.py +++ b/chargebee/models/gateway_error_detail/responses.py @@ -20,3 +20,4 @@ class GatewayErrorDetailResponse(Model): processor_error_code: str = None processor_error_message: str = None error_cause_id: str = None + processor_advice_code: str = None diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index b4e74c9..d3a6fad 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -20,6 +20,7 @@ class Type(Enum): CHECKOUT_ONE_TIME = "checkout_one_time" PRE_CANCEL = "pre_cancel" VIEW_VOUCHER = "view_voucher" + ACCEPT_QUOTE = "accept_quote" CHECKOUT_GIFT = "checkout_gift" CLAIM_GIFT = "claim_gift" @@ -320,6 +321,7 @@ class CheckoutNewForItemsSubscriptionParams(TypedDict): start_date: NotRequired[int] coupon: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] invoice_notes: NotRequired[str] po_number: NotRequired[str] contract_term_billing_cycle_on_renewal: NotRequired[int] diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index e208a0e..d3e2d19 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -309,7 +309,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class BillingAddress(TypedDict): first_name: NotRequired[str] diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index 5e5bcc8..2583bdb 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -241,7 +241,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass diff --git a/chargebee/models/invoice_estimate/operations.py b/chargebee/models/invoice_estimate/operations.py index f1d265b..1304063 100644 --- a/chargebee/models/invoice_estimate/operations.py +++ b/chargebee/models/invoice_estimate/operations.py @@ -21,7 +21,7 @@ class LineItemEntityType(Enum): def __str__(self): return self.value - class DiscountEntityType(Enum): + class LineItemDiscountDiscountType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -32,14 +32,7 @@ class DiscountEntityType(Enum): def __str__(self): return self.value - class DiscountDiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - class LineItemDiscountDiscountType(Enum): + class DiscountEntityType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -50,6 +43,13 @@ class LineItemDiscountDiscountType(Enum): def __str__(self): return self.value + class DiscountDiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + class LineItem(TypedDict): id: NotRequired[str] subscription_id: NotRequired[str] @@ -77,18 +77,25 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["InvoiceEstimate.DiscountEntityType"] - discount_type: NotRequired["InvoiceEstimate.DiscountDiscountType"] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] + class LineItemTier(TypedDict): + line_item_id: NotRequired[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + quantity_used: Required[int] + unit_amount: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + quantity_used_in_decimal: NotRequired[str] + unit_amount_in_decimal: NotRequired[str] + pricing_type: NotRequired[enums.PricingType] + package_size: NotRequired[int] - class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["InvoiceEstimate.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] class LineItemTax(TypedDict): line_item_id: NotRequired[str] @@ -107,31 +114,11 @@ class LineItemTax(TypedDict): tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] - class LineItemTier(TypedDict): - line_item_id: NotRequired[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - quantity_used: Required[int] - unit_amount: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - quantity_used_in_decimal: NotRequired[str] - unit_amount_in_decimal: NotRequired[str] - pricing_type: NotRequired[enums.PricingType] - package_size: NotRequired[int] - class LineItemCredit(TypedDict): cn_id: Required[str] applied_amount: Required[float] line_item_id: NotRequired[str] - class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required["InvoiceEstimate.LineItemDiscountDiscountType"] - coupon_id: NotRequired[str] - entity_id: NotRequired[str] - discount_amount: Required[int] - class LineItemAddress(TypedDict): line_item_id: NotRequired[str] first_name: NotRequired[str] @@ -149,4 +136,17 @@ class LineItemAddress(TypedDict): zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["InvoiceEstimate.DiscountEntityType"] + discount_type: NotRequired["InvoiceEstimate.DiscountDiscountType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + pass diff --git a/chargebee/models/invoice_estimate/responses.py b/chargebee/models/invoice_estimate/responses.py index 08a60e9..bdd15f2 100644 --- a/chargebee/models/invoice_estimate/responses.py +++ b/chargebee/models/invoice_estimate/responses.py @@ -34,22 +34,29 @@ class LineItemResponse(Model): @dataclass -class DiscountResponse(Model): +class LineItemTierResponse(Model): raw_data: Dict[Any, Any] = None - amount: int = None - description: str = None - entity_type: str = None - discount_type: str = None - entity_id: str = None - coupon_set_code: str = None + line_item_id: str = None + starting_unit: int = None + ending_unit: int = None + quantity_used: int = None + unit_amount: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + quantity_used_in_decimal: str = None + unit_amount_in_decimal: str = None + pricing_type: str = None + package_size: int = None @dataclass -class TaxResponse(Model): +class LineItemDiscountResponse(Model): raw_data: Dict[Any, Any] = None - name: str = None - amount: int = None - description: str = None + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None @dataclass @@ -72,22 +79,6 @@ class LineItemTaxResponse(Model): local_currency_code: str = None -@dataclass -class LineItemTierResponse(Model): - raw_data: Dict[Any, Any] = None - line_item_id: str = None - starting_unit: int = None - ending_unit: int = None - quantity_used: int = None - unit_amount: int = None - starting_unit_in_decimal: str = None - ending_unit_in_decimal: str = None - quantity_used_in_decimal: str = None - unit_amount_in_decimal: str = None - pricing_type: str = None - package_size: int = None - - @dataclass class LineItemCreditResponse(Model): raw_data: Dict[Any, Any] = None @@ -96,16 +87,6 @@ class LineItemCreditResponse(Model): line_item_id: str = None -@dataclass -class LineItemDiscountResponse(Model): - raw_data: Dict[Any, Any] = None - line_item_id: str = None - discount_type: str = None - coupon_id: str = None - entity_id: str = None - discount_amount: int = None - - @dataclass class LineItemAddressResponse(Model): raw_data: Dict[Any, Any] = None @@ -126,6 +107,25 @@ class LineItemAddressResponse(Model): validation_status: str = None +@dataclass +class DiscountResponse(Model): + raw_data: Dict[Any, Any] = None + amount: int = None + description: str = None + entity_type: str = None + discount_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class TaxResponse(Model): + raw_data: Dict[Any, Any] = None + name: str = None + amount: int = None + description: str = None + + @dataclass class InvoiceEstimateResponse(Model): raw_data: Dict[Any, Any] = None @@ -138,12 +138,12 @@ class InvoiceEstimateResponse(Model): amount_paid: int = None amount_due: int = None line_items: List[LineItemResponse] = None - discounts: List[DiscountResponse] = None - taxes: List[TaxResponse] = None - line_item_taxes: List[LineItemTaxResponse] = None line_item_tiers: List[LineItemTierResponse] = None - line_item_credits: List[LineItemCreditResponse] = None line_item_discounts: List[LineItemDiscountResponse] = None + line_item_taxes: List[LineItemTaxResponse] = None + line_item_credits: List[LineItemCreditResponse] = None + line_item_addresses: List[LineItemAddressResponse] = None + discounts: List[DiscountResponse] = None + taxes: List[TaxResponse] = None round_off_amount: int = None customer_id: str = None - line_item_addresses: List[LineItemAddressResponse] = None diff --git a/chargebee/models/offer_event/__init__.py b/chargebee/models/offer_event/__init__.py new file mode 100644 index 0000000..74c33e3 --- /dev/null +++ b/chargebee/models/offer_event/__init__.py @@ -0,0 +1,2 @@ +from .operations import OfferEvent +from .responses import OfferEventResponse diff --git a/chargebee/models/offer_event/operations.py b/chargebee/models/offer_event/operations.py new file mode 100644 index 0000000..210702c --- /dev/null +++ b/chargebee/models/offer_event/operations.py @@ -0,0 +1,38 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class OfferEvent: + env: environment.Environment + + class Type(Enum): + VIEWED = "viewed" + DISMISSED = "dismissed" + + def __str__(self): + return self.value + + class OfferEventsParams(TypedDict): + personalized_offer_id: Required[str] + type: Required["OfferEvent.Type"] + + def offer_events( + self, params: OfferEventsParams, headers=None + ) -> OfferEventsResponse: + jsonKeys = {} + options = {} + return request.send( + "post", + request.uri_path("offer_events"), + self.env, + cast(Dict[Any, Any], params), + headers, + OfferEventsResponse, + "grow", + True, + jsonKeys, + options, + ) diff --git a/chargebee/models/offer_event/responses.py b/chargebee/models/offer_event/responses.py new file mode 100644 index 0000000..ce2f872 --- /dev/null +++ b/chargebee/models/offer_event/responses.py @@ -0,0 +1,14 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response + + +@dataclass +class OfferEventResponse(Model): + raw_data: Dict[Any, Any] = None + + +@dataclass +class OfferEventsResponse(Response): + is_idempotency_replayed: bool diff --git a/chargebee/models/offer_fulfillment/__init__.py b/chargebee/models/offer_fulfillment/__init__.py new file mode 100644 index 0000000..7f4f8b5 --- /dev/null +++ b/chargebee/models/offer_fulfillment/__init__.py @@ -0,0 +1,2 @@ +from .operations import OfferFulfillment +from .responses import OfferFulfillmentResponse diff --git a/chargebee/models/offer_fulfillment/operations.py b/chargebee/models/offer_fulfillment/operations.py new file mode 100644 index 0000000..d6f42b5 --- /dev/null +++ b/chargebee/models/offer_fulfillment/operations.py @@ -0,0 +1,102 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class OfferFulfillment: + env: environment.Environment + + class ProcessingType(Enum): + BILLING_UPDATE = "billing_update" + CHECKOUT = "checkout" + URL_REDIRECT = "url_redirect" + WEBHOOK = "webhook" + EMAIL = "email" + + def __str__(self): + return self.value + + class Status(Enum): + IN_PROGRESS = "in_progress" + COMPLETED = "completed" + FAILED = "failed" + + def __str__(self): + return self.value + + class ErrorCode(Enum): + BILLING_UPDATE_FAILED = "billing_update_failed" + CHECKOUT_ABANDONED = "checkout_abandoned" + EXTERNAL_FULFILLMENT_FAILED = "external_fulfillment_failed" + INTERNAL_ERROR = "internal_error" + FULFILLMENT_EXPIRED = "fulfillment_expired" + + def __str__(self): + return self.value + + class Error(TypedDict): + code: Required["OfferFulfillment.ErrorCode"] + message: Required[str] + + class OfferFulfillmentsParams(TypedDict): + personalized_offer_id: Required[str] + option_id: Required[str] + + class OfferFulfillmentsUpdateParams(TypedDict): + id: Required[str] + status: Required["OfferFulfillment.Status"] + failure_reason: NotRequired[str] + + def offer_fulfillments( + self, params: OfferFulfillmentsParams, headers=None + ) -> OfferFulfillmentsResponse: + jsonKeys = {} + options = {} + return request.send( + "post", + request.uri_path("offer_fulfillments"), + self.env, + cast(Dict[Any, Any], params), + headers, + OfferFulfillmentsResponse, + "grow", + True, + jsonKeys, + options, + ) + + def offer_fulfillments_get(self, id, headers=None) -> OfferFulfillmentsGetResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("offer_fulfillments", id), + self.env, + None, + headers, + OfferFulfillmentsGetResponse, + "grow", + True, + jsonKeys, + options, + ) + + def offer_fulfillments_update( + self, id, params: OfferFulfillmentsUpdateParams, headers=None + ) -> OfferFulfillmentsUpdateResponse: + jsonKeys = {} + options = {} + return request.send( + "post", + request.uri_path("offer_fulfillments", id), + self.env, + cast(Dict[Any, Any], params), + headers, + OfferFulfillmentsUpdateResponse, + "grow", + True, + jsonKeys, + options, + ) diff --git a/chargebee/models/offer_fulfillment/responses.py b/chargebee/models/offer_fulfillment/responses.py new file mode 100644 index 0000000..abd1c8a --- /dev/null +++ b/chargebee/models/offer_fulfillment/responses.py @@ -0,0 +1,45 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response +from chargebee.models import hosted_page + + +@dataclass +class ErrorResponse(Model): + raw_data: Dict[Any, Any] = None + code: str = None + message: str = None + + +@dataclass +class OfferFulfillmentResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + personalized_offer_id: str = None + option_id: str = None + processing_type: str = None + status: str = None + redirect_url: str = None + failed_at: int = None + created_at: int = None + completed_at: int = None + error: ErrorResponse = None + + +@dataclass +class OfferFulfillmentsResponse(Response): + is_idempotency_replayed: bool + offer_fulfillment: OfferFulfillmentResponse + hosted_page: "hosted_page.HostedPageResponse" = None + + +@dataclass +class OfferFulfillmentsGetResponse(Response): + offer_fulfillment: OfferFulfillmentResponse + + +@dataclass +class OfferFulfillmentsUpdateResponse(Response): + is_idempotency_replayed: bool + offer_fulfillment: OfferFulfillmentResponse diff --git a/chargebee/models/omnichannel_one_time_order/operations.py b/chargebee/models/omnichannel_one_time_order/operations.py index 9f5652d..b2df08b 100644 --- a/chargebee/models/omnichannel_one_time_order/operations.py +++ b/chargebee/models/omnichannel_one_time_order/operations.py @@ -3,7 +3,7 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters -from chargebee.models import omnichannel_one_time_order_item +from chargebee.models import omnichannel_one_time_order_item, omnichannel_transaction @dataclass @@ -36,18 +36,6 @@ class OmnichannelTransactionType(Enum): def __str__(self): return self.value - class OmnichannelTransaction(TypedDict): - id: Required[str] - id_at_source: Required[str] - app_id: Required[str] - price_currency: NotRequired[str] - price_units: NotRequired[int] - price_nanos: NotRequired[int] - type: Required["OmnichannelOneTimeOrder.OmnichannelTransactionType"] - transacted_at: NotRequired[int] - created_at: Required[int] - resource_version: NotRequired[int] - class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] diff --git a/chargebee/models/omnichannel_one_time_order/responses.py b/chargebee/models/omnichannel_one_time_order/responses.py index e43c1bb..b9936d8 100644 --- a/chargebee/models/omnichannel_one_time_order/responses.py +++ b/chargebee/models/omnichannel_one_time_order/responses.py @@ -2,22 +2,7 @@ from chargebee.model import Model from typing import Dict, List, Any from chargebee.response import Response -from chargebee.models import omnichannel_one_time_order_item - - -@dataclass -class OmnichannelTransactionResponse(Model): - raw_data: Dict[Any, Any] = None - id: str = None - id_at_source: str = None - app_id: str = None - price_currency: str = None - price_units: int = None - price_nanos: int = None - type: str = None - transacted_at: int = None - created_at: int = None - resource_version: int = None +from chargebee.models import omnichannel_one_time_order_item, omnichannel_transaction @dataclass diff --git a/chargebee/models/omnichannel_subscription/operations.py b/chargebee/models/omnichannel_subscription/operations.py index 8c2fa83..3e094d2 100644 --- a/chargebee/models/omnichannel_subscription/operations.py +++ b/chargebee/models/omnichannel_subscription/operations.py @@ -3,7 +3,7 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters -from chargebee.models import omnichannel_subscription_item +from chargebee.models import omnichannel_subscription_item, omnichannel_transaction @dataclass @@ -62,18 +62,6 @@ class OmnichannelTransactionType(Enum): def __str__(self): return self.value - class OmnichannelTransaction(TypedDict): - id: Required[str] - id_at_source: Required[str] - app_id: Required[str] - price_currency: NotRequired[str] - price_units: NotRequired[int] - price_nanos: NotRequired[int] - type: Required["OmnichannelSubscription.OmnichannelTransactionType"] - transacted_at: NotRequired[int] - created_at: Required[int] - resource_version: NotRequired[int] - class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] @@ -84,6 +72,9 @@ class OmnichannelTransactionsForOmnichannelSubscriptionParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] + class MoveParams(TypedDict): + to_customer_id: Required[str] + def retrieve(self, id, headers=None) -> RetrieveResponse: jsonKeys = {} options = {} @@ -138,3 +129,21 @@ def omnichannel_transactions_for_omnichannel_subscription( jsonKeys, options, ) + + def move(self, id, params: MoveParams, headers=None) -> MoveResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("omnichannel_subscriptions", id, "move"), + self.env, + cast(Dict[Any, Any], params), + headers, + MoveResponse, + None, + False, + jsonKeys, + options, + ) diff --git a/chargebee/models/omnichannel_subscription/responses.py b/chargebee/models/omnichannel_subscription/responses.py index 26b241f..9587179 100644 --- a/chargebee/models/omnichannel_subscription/responses.py +++ b/chargebee/models/omnichannel_subscription/responses.py @@ -2,22 +2,11 @@ from chargebee.model import Model from typing import Dict, List, Any from chargebee.response import Response -from chargebee.models import omnichannel_subscription_item, omnichannel_transaction - - -@dataclass -class OmnichannelTransactionResponse(Model): - raw_data: Dict[Any, Any] = None - id: str = None - id_at_source: str = None - app_id: str = None - price_currency: str = None - price_units: int = None - price_nanos: int = None - type: str = None - transacted_at: int = None - created_at: int = None - resource_version: int = None +from chargebee.models import ( + omnichannel_subscription_item, + omnichannel_transaction, + omnichannel_transaction, +) @dataclass @@ -63,3 +52,9 @@ class OmnichannelTransactionsForOmnichannelSubscriptionResponse(Response): OmnichannelTransactionsForOmnichannelSubscriptionOmnichannelSubscriptionResponse ] next_offset: str = None + + +@dataclass +class MoveResponse(Response): + is_idempotency_replayed: bool + omnichannel_subscription: OmnichannelSubscriptionResponse diff --git a/chargebee/models/omnichannel_subscription_item/operations.py b/chargebee/models/omnichannel_subscription_item/operations.py index bf6ce82..2870922 100644 --- a/chargebee/models/omnichannel_subscription_item/operations.py +++ b/chargebee/models/omnichannel_subscription_item/operations.py @@ -2,6 +2,7 @@ from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +from chargebee.models import omnichannel_subscription_item_offer @dataclass diff --git a/chargebee/models/omnichannel_subscription_item/responses.py b/chargebee/models/omnichannel_subscription_item/responses.py index c6d17f5..c028820 100644 --- a/chargebee/models/omnichannel_subscription_item/responses.py +++ b/chargebee/models/omnichannel_subscription_item/responses.py @@ -2,7 +2,10 @@ from chargebee.model import Model from typing import Dict, List, Any from chargebee.response import Response -from chargebee.models import omnichannel_subscription_item_scheduled_change +from chargebee.models import ( + omnichannel_subscription_item_offer, + omnichannel_subscription_item_scheduled_change, +) @dataclass @@ -38,8 +41,11 @@ class OmnichannelSubscriptionItemResponse(Model): resumes_at: int = None has_scheduled_changes: bool = None resource_version: int = None - upcoming_renewal: UpcomingRenewalResponse = None - linked_item: LinkedItemResponse = None + omnichannel_subscription_item_offers: List[ + "omnichannel_subscription_item_offer.OmnichannelSubscriptionItemOfferResponse" + ] = None + upcoming_renewal: "upcoming_renewal.UpcomingRenewalResponse" = None + linked_item: "linked_item.LinkedItemResponse" = None @dataclass diff --git a/chargebee/models/omnichannel_subscription_item_offer/__init__.py b/chargebee/models/omnichannel_subscription_item_offer/__init__.py new file mode 100644 index 0000000..2aadfb1 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_offer/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelSubscriptionItemOffer +from .responses import OmnichannelSubscriptionItemOfferResponse diff --git a/chargebee/models/omnichannel_subscription_item_offer/operations.py b/chargebee/models/omnichannel_subscription_item_offer/operations.py new file mode 100644 index 0000000..87d0186 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_offer/operations.py @@ -0,0 +1,10 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class OmnichannelSubscriptionItemOffer: + env: environment.Environment + + pass diff --git a/chargebee/models/omnichannel_subscription_item_offer/responses.py b/chargebee/models/omnichannel_subscription_item_offer/responses.py new file mode 100644 index 0000000..ffc7872 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item_offer/responses.py @@ -0,0 +1,23 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class OmnichannelSubscriptionItemOfferResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + offer_id_at_source: str = None + category: str = None + category_at_source: str = None + type: str = None + type_at_source: str = None + discount_type: str = None + duration: str = None + percentage: float = None + price_currency: str = None + price_units: int = None + price_nanos: int = None + offer_term_start: int = None + offer_term_end: int = None + resource_version: int = None diff --git a/chargebee/models/omnichannel_transaction/operations.py b/chargebee/models/omnichannel_transaction/operations.py index 5cb6504..5eb9657 100644 --- a/chargebee/models/omnichannel_transaction/operations.py +++ b/chargebee/models/omnichannel_transaction/operations.py @@ -15,4 +15,10 @@ class Type(Enum): def __str__(self): return self.value + class LinkedOmnichannelSubscription(TypedDict): + omnichannel_subscription_id: NotRequired[str] + + class LinkedOmnichannelOneTimeOrder(TypedDict): + omnichannel_one_time_order_id: NotRequired[str] + pass diff --git a/chargebee/models/omnichannel_transaction/responses.py b/chargebee/models/omnichannel_transaction/responses.py index 8b5149e..268a45a 100644 --- a/chargebee/models/omnichannel_transaction/responses.py +++ b/chargebee/models/omnichannel_transaction/responses.py @@ -3,6 +3,18 @@ from typing import Dict, List, Any +@dataclass +class LinkedOmnichannelSubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + omnichannel_subscription_id: str = None + + +@dataclass +class LinkedOmnichannelOneTimeOrderResponse(Model): + raw_data: Dict[Any, Any] = None + omnichannel_one_time_order_id: str = None + + @dataclass class OmnichannelTransactionResponse(Model): raw_data: Dict[Any, Any] = None @@ -16,3 +28,7 @@ class OmnichannelTransactionResponse(Model): transacted_at: int = None created_at: int = None resource_version: int = None + linked_omnichannel_subscriptions: List[LinkedOmnichannelSubscriptionResponse] = None + linked_omnichannel_one_time_orders: List[LinkedOmnichannelOneTimeOrderResponse] = ( + None + ) diff --git a/chargebee/models/order/operations.py b/chargebee/models/order/operations.py index 5b3cb5e..0d7d5aa 100644 --- a/chargebee/models/order/operations.py +++ b/chargebee/models/order/operations.py @@ -158,7 +158,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class BillingAddress(TypedDict): first_name: NotRequired[str] diff --git a/chargebee/models/order/responses.py b/chargebee/models/order/responses.py index ddc905e..f91a682 100644 --- a/chargebee/models/order/responses.py +++ b/chargebee/models/order/responses.py @@ -47,7 +47,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass diff --git a/chargebee/models/personalized_offer/__init__.py b/chargebee/models/personalized_offer/__init__.py new file mode 100644 index 0000000..e80818c --- /dev/null +++ b/chargebee/models/personalized_offer/__init__.py @@ -0,0 +1,2 @@ +from .operations import PersonalizedOffer +from .responses import PersonalizedOfferResponse diff --git a/chargebee/models/personalized_offer/operations.py b/chargebee/models/personalized_offer/operations.py new file mode 100644 index 0000000..9371265 --- /dev/null +++ b/chargebee/models/personalized_offer/operations.py @@ -0,0 +1,77 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class PersonalizedOffer: + env: environment.Environment + + class OptionProcessingType(Enum): + BILLING_UPDATE = "billing_update" + CHECKOUT = "checkout" + URL_REDIRECT = "url_redirect" + WEBHOOK = "webhook" + EMAIL = "email" + + def __str__(self): + return self.value + + class OptionProcessingLayout(Enum): + IN_APP = "in_app" + FULL_PAGE = "full_page" + + def __str__(self): + return self.value + + class Content(TypedDict): + title: Required[str] + description: Required[str] + + class Option(TypedDict): + id: Required[str] + label: Required[str] + processing_type: Required["PersonalizedOffer.OptionProcessingType"] + processing_layout: Required["PersonalizedOffer.OptionProcessingLayout"] + redirect_url: Required[str] + + class PersonalizedOffersRequestContextParams(TypedDict): + user_agent: NotRequired[str] + locale: NotRequired[str] + timezone: NotRequired[str] + url: NotRequired[str] + referrer_url: NotRequired[str] + + class PersonalizedOffersParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + roles: NotRequired[List[str]] + external_user_id: NotRequired[str] + subscription_id: NotRequired[str] + customer_id: Required[str] + custom: NotRequired[Dict[Any, Any]] + request_context: NotRequired[ + "PersonalizedOffer.PersonalizedOffersRequestContextParams" + ] + + def personalized_offers( + self, params: PersonalizedOffersParams, headers=None + ) -> PersonalizedOffersResponse: + jsonKeys = { + "custom": 0, + } + options = {} + return request.send( + "post", + request.uri_path("personalized_offers"), + self.env, + cast(Dict[Any, Any], params), + headers, + PersonalizedOffersResponse, + "grow", + True, + jsonKeys, + options, + ) diff --git a/chargebee/models/personalized_offer/responses.py b/chargebee/models/personalized_offer/responses.py new file mode 100644 index 0000000..511749e --- /dev/null +++ b/chargebee/models/personalized_offer/responses.py @@ -0,0 +1,39 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response +from chargebee.models import brand + + +@dataclass +class ContentResponse(Model): + raw_data: Dict[Any, Any] = None + title: str = None + description: str = None + + +@dataclass +class OptionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + label: str = None + processing_type: str = None + processing_layout: str = None + redirect_url: str = None + + +@dataclass +class PersonalizedOfferResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + offer_id: str = None + content: ContentResponse = None + options: List[OptionResponse] = None + + +@dataclass +class PersonalizedOffersResponse(Response): + is_idempotency_replayed: bool + personalized_offers: List[PersonalizedOfferResponse] + expires_at: int + brand: "brand.BrandResponse" = None diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index b3d066a..ad2b91b 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -46,7 +46,7 @@ class LineItemEntityType(Enum): def __str__(self): return self.value - class DiscountEntityType(Enum): + class LineItemDiscountDiscountType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -57,14 +57,7 @@ class DiscountEntityType(Enum): def __str__(self): return self.value - class DiscountDiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - class LineItemDiscountDiscountType(Enum): + class DiscountEntityType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -75,6 +68,13 @@ class LineItemDiscountDiscountType(Enum): def __str__(self): return self.value + class DiscountDiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + class LineItem(TypedDict): id: NotRequired[str] subscription_id: NotRequired[str] @@ -102,13 +102,18 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["Quote.DiscountEntityType"] - discount_type: NotRequired["Quote.DiscountDiscountType"] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] + class LineItemTier(TypedDict): + line_item_id: NotRequired[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + quantity_used: Required[int] + unit_amount: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + quantity_used_in_decimal: NotRequired[str] + unit_amount_in_decimal: NotRequired[str] + pricing_type: NotRequired[enums.PricingType] + package_size: NotRequired[int] class LineItemDiscount(TypedDict): line_item_id: Required[str] @@ -117,11 +122,6 @@ class LineItemDiscount(TypedDict): entity_id: NotRequired[str] discount_amount: Required[int] - class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] - class LineItemTax(TypedDict): line_item_id: NotRequired[str] tax_name: Required[str] @@ -139,18 +139,18 @@ class LineItemTax(TypedDict): tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] - class LineItemTier(TypedDict): - line_item_id: NotRequired[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - quantity_used: Required[int] - unit_amount: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - quantity_used_in_decimal: NotRequired[str] - unit_amount_in_decimal: NotRequired[str] - pricing_type: NotRequired[enums.PricingType] - package_size: NotRequired[int] + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["Quote.DiscountEntityType"] + discount_type: NotRequired["Quote.DiscountDiscountType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] class ShippingAddress(TypedDict): first_name: NotRequired[str] @@ -167,7 +167,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class BillingAddress(TypedDict): first_name: NotRequired[str] @@ -526,6 +525,7 @@ class CreateSubItemsForCustomerQuoteSubscriptionParams(TypedDict): trial_end: NotRequired[int] setup_fee: NotRequired[int] start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] contract_term_billing_cycle_on_renewal: NotRequired[int] class CreateSubItemsForCustomerQuoteSubscriptionItemParams(TypedDict): @@ -617,6 +617,7 @@ class EditCreateSubCustomerQuoteForItemsSubscriptionParams(TypedDict): trial_end: NotRequired[int] setup_fee: NotRequired[int] start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] contract_term_billing_cycle_on_renewal: NotRequired[int] class EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(TypedDict): diff --git a/chargebee/models/quote/responses.py b/chargebee/models/quote/responses.py index 74a193d..3b01564 100644 --- a/chargebee/models/quote/responses.py +++ b/chargebee/models/quote/responses.py @@ -48,14 +48,19 @@ class LineItemResponse(Model): @dataclass -class DiscountResponse(Model): +class LineItemTierResponse(Model): raw_data: Dict[Any, Any] = None - amount: int = None - description: str = None - entity_type: str = None - discount_type: str = None - entity_id: str = None - coupon_set_code: str = None + line_item_id: str = None + starting_unit: int = None + ending_unit: int = None + quantity_used: int = None + unit_amount: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + quantity_used_in_decimal: str = None + unit_amount_in_decimal: str = None + pricing_type: str = None + package_size: int = None @dataclass @@ -68,14 +73,6 @@ class LineItemDiscountResponse(Model): discount_amount: int = None -@dataclass -class TaxResponse(Model): - raw_data: Dict[Any, Any] = None - name: str = None - amount: int = None - description: str = None - - @dataclass class LineItemTaxResponse(Model): raw_data: Dict[Any, Any] = None @@ -97,19 +94,22 @@ class LineItemTaxResponse(Model): @dataclass -class LineItemTierResponse(Model): +class DiscountResponse(Model): raw_data: Dict[Any, Any] = None - line_item_id: str = None - starting_unit: int = None - ending_unit: int = None - quantity_used: int = None - unit_amount: int = None - starting_unit_in_decimal: str = None - ending_unit_in_decimal: str = None - quantity_used_in_decimal: str = None - unit_amount_in_decimal: str = None - pricing_type: str = None - package_size: int = None + amount: int = None + description: str = None + entity_type: str = None + discount_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class TaxResponse(Model): + raw_data: Dict[Any, Any] = None + name: str = None + amount: int = None + description: str = None @dataclass @@ -129,7 +129,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass @@ -178,11 +177,11 @@ class QuoteResponse(Model): updated_at: int = None vat_number_prefix: str = None line_items: List[LineItemResponse] = None - discounts: List[DiscountResponse] = None + line_item_tiers: List[LineItemTierResponse] = None line_item_discounts: List[LineItemDiscountResponse] = None - taxes: List[TaxResponse] = None line_item_taxes: List[LineItemTaxResponse] = None - line_item_tiers: List[LineItemTierResponse] = None + discounts: List[DiscountResponse] = None + taxes: List[TaxResponse] = None tax_category: str = None currency_code: str = None notes: List[Dict[Any, Any]] = None diff --git a/chargebee/models/quote_line_group/operations.py b/chargebee/models/quote_line_group/operations.py index 5cf8423..12f2bd1 100644 --- a/chargebee/models/quote_line_group/operations.py +++ b/chargebee/models/quote_line_group/operations.py @@ -32,7 +32,7 @@ class LineItemEntityType(Enum): def __str__(self): return self.value - class DiscountEntityType(Enum): + class LineItemDiscountDiscountType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -43,14 +43,7 @@ class DiscountEntityType(Enum): def __str__(self): return self.value - class DiscountDiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - class LineItemDiscountDiscountType(Enum): + class DiscountEntityType(Enum): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" PROMOTIONAL_CREDITS = "promotional_credits" @@ -61,6 +54,13 @@ class LineItemDiscountDiscountType(Enum): def __str__(self): return self.value + class DiscountDiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + class LineItem(TypedDict): id: NotRequired[str] subscription_id: NotRequired[str] @@ -88,14 +88,6 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["QuoteLineGroup.DiscountEntityType"] - discount_type: NotRequired["QuoteLineGroup.DiscountDiscountType"] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - class LineItemDiscount(TypedDict): line_item_id: Required[str] discount_type: Required["QuoteLineGroup.LineItemDiscountDiscountType"] @@ -103,11 +95,6 @@ class LineItemDiscount(TypedDict): entity_id: NotRequired[str] discount_amount: Required[int] - class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] - class LineItemTax(TypedDict): line_item_id: NotRequired[str] tax_name: Required[str] @@ -125,4 +112,17 @@ class LineItemTax(TypedDict): tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["QuoteLineGroup.DiscountEntityType"] + discount_type: NotRequired["QuoteLineGroup.DiscountDiscountType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + pass diff --git a/chargebee/models/quote_line_group/responses.py b/chargebee/models/quote_line_group/responses.py index 0e48cb3..834c541 100644 --- a/chargebee/models/quote_line_group/responses.py +++ b/chargebee/models/quote_line_group/responses.py @@ -33,17 +33,6 @@ class LineItemResponse(Model): customer_id: str = None -@dataclass -class DiscountResponse(Model): - raw_data: Dict[Any, Any] = None - amount: int = None - description: str = None - entity_type: str = None - discount_type: str = None - entity_id: str = None - coupon_set_code: str = None - - @dataclass class LineItemDiscountResponse(Model): raw_data: Dict[Any, Any] = None @@ -54,14 +43,6 @@ class LineItemDiscountResponse(Model): discount_amount: int = None -@dataclass -class TaxResponse(Model): - raw_data: Dict[Any, Any] = None - name: str = None - amount: int = None - description: str = None - - @dataclass class LineItemTaxResponse(Model): raw_data: Dict[Any, Any] = None @@ -82,6 +63,25 @@ class LineItemTaxResponse(Model): local_currency_code: str = None +@dataclass +class DiscountResponse(Model): + raw_data: Dict[Any, Any] = None + amount: int = None + description: str = None + entity_type: str = None + discount_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class TaxResponse(Model): + raw_data: Dict[Any, Any] = None + name: str = None + amount: int = None + description: str = None + + @dataclass class QuoteLineGroupResponse(Model): raw_data: Dict[Any, Any] = None @@ -95,7 +95,7 @@ class QuoteLineGroupResponse(Model): charge_event: str = None billing_cycle_number: int = None line_items: List[LineItemResponse] = None - discounts: List[DiscountResponse] = None line_item_discounts: List[LineItemDiscountResponse] = None - taxes: List[TaxResponse] = None line_item_taxes: List[LineItemTaxResponse] = None + discounts: List[DiscountResponse] = None + taxes: List[TaxResponse] = None diff --git a/chargebee/models/ramp/operations.py b/chargebee/models/ramp/operations.py index 267f476..a1efe5b 100644 --- a/chargebee/models/ramp/operations.py +++ b/chargebee/models/ramp/operations.py @@ -26,6 +26,15 @@ class DiscountsToAddType(Enum): def __str__(self): return self.value + class ContractTermActionAtTermEnd(Enum): + RENEW = "renew" + EVERGREEN = "evergreen" + CANCEL = "cancel" + RENEW_ONCE = "renew_once" + + def __str__(self): + return self.value + class ItemsToAdd(TypedDict): item_price_id: Required[str] item_type: Required[enums.ItemType] @@ -40,6 +49,9 @@ class ItemsToAdd(TypedDict): billing_cycles: NotRequired[int] service_period_days: NotRequired[int] metered_quantity: NotRequired[str] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + charge_on_event: NotRequired[enums.ChargeOnEvent] class ItemsToUpdate(TypedDict): item_price_id: Required[str] @@ -55,6 +67,9 @@ class ItemsToUpdate(TypedDict): billing_cycles: NotRequired[int] service_period_days: NotRequired[int] metered_quantity: NotRequired[str] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + charge_on_event: NotRequired[enums.ChargeOnEvent] class CouponsToAdd(TypedDict): coupon_id: Required[str] @@ -86,6 +101,11 @@ class ItemTier(TypedDict): package_size: NotRequired[int] index: Required[int] + class ContractTerm(TypedDict): + cancellation_cutoff_period: NotRequired[int] + renewal_billing_cycles: NotRequired[int] + action_at_term_end: Required["Ramp.ContractTermActionAtTermEnd"] + class StatusTransitionReason(TypedDict): code: NotRequired[str] message: NotRequired[str] @@ -98,6 +118,9 @@ class CreateForSubscriptionItemsToAddParams(TypedDict): unit_price_in_decimal: NotRequired[str] billing_cycles: NotRequired[int] service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] class CreateForSubscriptionItemsToUpdateParams(TypedDict): item_price_id: Required[str] @@ -107,6 +130,9 @@ class CreateForSubscriptionItemsToUpdateParams(TypedDict): unit_price_in_decimal: NotRequired[str] billing_cycles: NotRequired[int] service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] class CreateForSubscriptionItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -133,6 +159,11 @@ class CreateForSubscriptionDiscountsToAddParams(TypedDict): included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + class CreateForSubscriptionContractTermParams(TypedDict): + action_at_term_end: NotRequired["Ramp.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + renewal_billing_cycles: NotRequired[int] + class UpdateItemsToAddParams(TypedDict): item_price_id: Required[str] quantity: NotRequired[int] @@ -141,6 +172,9 @@ class UpdateItemsToAddParams(TypedDict): unit_price_in_decimal: NotRequired[str] billing_cycles: NotRequired[int] service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] class UpdateItemsToUpdateParams(TypedDict): item_price_id: Required[str] @@ -150,6 +184,9 @@ class UpdateItemsToUpdateParams(TypedDict): unit_price_in_decimal: NotRequired[str] billing_cycles: NotRequired[int] service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] class UpdateItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -176,6 +213,11 @@ class UpdateDiscountsToAddParams(TypedDict): included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + class UpdateContractTermParams(TypedDict): + action_at_term_end: NotRequired["Ramp.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + renewal_billing_cycles: NotRequired[int] + class CreateForSubscriptionParams(TypedDict): effective_from: Required[int] description: NotRequired[str] @@ -191,6 +233,7 @@ class CreateForSubscriptionParams(TypedDict): discounts_to_add: Required[ List["Ramp.CreateForSubscriptionDiscountsToAddParams"] ] + contract_term: NotRequired["Ramp.CreateForSubscriptionContractTermParams"] class UpdateParams(TypedDict): effective_from: Required[int] @@ -203,6 +246,7 @@ class UpdateParams(TypedDict): item_tiers: NotRequired[List["Ramp.UpdateItemTierParams"]] coupons_to_add: NotRequired[List["Ramp.UpdateCouponsToAddParams"]] discounts_to_add: Required[List["Ramp.UpdateDiscountsToAddParams"]] + contract_term: NotRequired["Ramp.UpdateContractTermParams"] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/ramp/responses.py b/chargebee/models/ramp/responses.py index aabf610..582cbbd 100644 --- a/chargebee/models/ramp/responses.py +++ b/chargebee/models/ramp/responses.py @@ -20,6 +20,9 @@ class ItemsToAddResponse(Model): billing_cycles: int = None service_period_days: int = None metered_quantity: str = None + charge_once: bool = None + charge_on_option: str = None + charge_on_event: str = None @dataclass @@ -38,6 +41,9 @@ class ItemsToUpdateResponse(Model): billing_cycles: int = None service_period_days: int = None metered_quantity: str = None + charge_once: bool = None + charge_on_option: str = None + charge_on_event: str = None @dataclass @@ -79,6 +85,14 @@ class ItemTierResponse(Model): index: int = None +@dataclass +class ContractTermResponse(Model): + raw_data: Dict[Any, Any] = None + cancellation_cutoff_period: int = None + renewal_billing_cycles: int = None + action_at_term_end: str = None + + @dataclass class StatusTransitionReasonResponse(Model): raw_data: Dict[Any, Any] = None @@ -105,6 +119,7 @@ class RampResponse(Model): items_to_remove: List[str] = None coupons_to_remove: List[str] = None discounts_to_remove: List[str] = None + contract_term: ContractTermResponse = None deleted: bool = None status_transition_reason: StatusTransitionReasonResponse = None diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py index 710ce7c..883e5b8 100644 --- a/chargebee/models/subscription/operations.py +++ b/chargebee/models/subscription/operations.py @@ -143,7 +143,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class ReferralInfo(TypedDict): referral_code: NotRequired[str] @@ -1275,6 +1274,7 @@ class CreateWithItemsParams(TypedDict): auto_collection: NotRequired[enums.AutoCollection] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] po_number: NotRequired[str] coupon_ids: NotRequired[List[str]] payment_source_id: NotRequired[str] diff --git a/chargebee/models/subscription/responses.py b/chargebee/models/subscription/responses.py index 76ee046..0627665 100644 --- a/chargebee/models/subscription/responses.py +++ b/chargebee/models/subscription/responses.py @@ -98,7 +98,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass diff --git a/chargebee/models/subscription_estimate/operations.py b/chargebee/models/subscription_estimate/operations.py index a225559..da7b58d 100644 --- a/chargebee/models/subscription_estimate/operations.py +++ b/chargebee/models/subscription_estimate/operations.py @@ -54,7 +54,6 @@ class ShippingAddress(TypedDict): country: NotRequired[str] zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - index: Required[int] class ContractTerm(TypedDict): id: Required[str] diff --git a/chargebee/models/subscription_estimate/responses.py b/chargebee/models/subscription_estimate/responses.py index a46fb16..2786429 100644 --- a/chargebee/models/subscription_estimate/responses.py +++ b/chargebee/models/subscription_estimate/responses.py @@ -20,7 +20,6 @@ class ShippingAddressResponse(Model): country: str = None zip: str = None validation_status: str = None - index: int = None @dataclass diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py index 4843ac6..2755863 100644 --- a/chargebee/models/transaction/operations.py +++ b/chargebee/models/transaction/operations.py @@ -111,6 +111,7 @@ class GatewayErrorDetail(TypedDict): processor_error_code: NotRequired[str] processor_error_message: NotRequired[str] error_cause_id: NotRequired[str] + processor_advice_code: NotRequired[str] class CreateAuthorizationParams(TypedDict): customer_id: Required[str] diff --git a/chargebee/models/transaction/responses.py b/chargebee/models/transaction/responses.py index f57f8fd..9e2efaf 100644 --- a/chargebee/models/transaction/responses.py +++ b/chargebee/models/transaction/responses.py @@ -65,6 +65,7 @@ class GatewayErrorDetailResponse(Model): processor_error_code: str = None processor_error_message: str = None error_cause_id: str = None + processor_advice_code: str = None @dataclass diff --git a/chargebee/models/usage_file/responses.py b/chargebee/models/usage_file/responses.py index d05fdb8..ebebd04 100644 --- a/chargebee/models/usage_file/responses.py +++ b/chargebee/models/usage_file/responses.py @@ -28,6 +28,8 @@ class UsageFileResponse(Model): processing_completed_at: int = None uploaded_by: str = None uploaded_at: int = None + error_file_path: str = None + error_file_url: str = None upload_details: UploadDetailResponse = None diff --git a/chargebee/request.py b/chargebee/request.py index 7422b6a..6b6b610 100644 --- a/chargebee/request.py +++ b/chargebee/request.py @@ -70,9 +70,7 @@ def send( params = {} ser_params = ( - params - if isJsonRequest - else util.serialize(params, None, None, jsonKeys) + params if isJsonRequest else util.serialize(params, None, None, jsonKeys) ) request_args = { diff --git a/chargebee/version.py b/chargebee/version.py index 41994af..7ce5c1b 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = "3.11.0" +VERSION = "3.12.0"