From 974ef1b36007c92926811c3f4551dba8e6c62491 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Thu, 21 Aug 2025 16:37:36 +0530 Subject: [PATCH] Release version 3.9.0 --- CHANGELOG.md | 56 +++++++ chargebee/main.py | 12 ++ chargebee/models/__init__.py | 20 +++ chargebee/models/comment/responses.py | 1 + chargebee/models/credit_note/operations.py | 132 ++++++++------- chargebee/models/credit_note/responses.py | 132 +++++++-------- chargebee/models/customer/operations.py | 1 + .../models/customer_entitlement/operations.py | 1 + chargebee/models/discount/operations.py | 1 + chargebee/models/discount/responses.py | 1 + chargebee/models/enums.py | 11 ++ chargebee/models/estimate/operations.py | 4 + chargebee/models/hosted_page/operations.py | 3 + .../models/impacted_customer/__init__.py | 2 + .../models/impacted_customer/operations.py | 16 ++ .../models/impacted_customer/responses.py | 18 ++ chargebee/models/invoice/operations.py | 116 ++++++------- chargebee/models/invoice/responses.py | 158 +++++++++--------- .../omnichannel_one_time_order/__init__.py | 2 + .../omnichannel_one_time_order/operations.py | 88 ++++++++++ .../omnichannel_one_time_order/responses.py | 57 +++++++ .../__init__.py | 2 + .../operations.py | 24 +++ .../responses.py | 16 ++ .../operations.py | 1 + .../models/pricing_page_session/operations.py | 2 + .../models/promotional_credit/responses.py | 1 + chargebee/models/purchase/operations.py | 2 + chargebee/models/quote/operations.py | 6 + chargebee/models/quoted_charge/operations.py | 4 + chargebee/models/quoted_charge/responses.py | 8 + .../models/recorded_purchase/operations.py | 5 + .../models/recorded_purchase/responses.py | 9 + chargebee/models/subscription/operations.py | 5 + chargebee/models/subscription/responses.py | 1 + .../__init__.py | 2 + .../operations.py | 11 ++ .../responses.py | 10 ++ .../__init__.py | 2 + .../operations.py | 11 ++ .../responses.py | 10 ++ chargebee/models/usage_file/operations.py | 14 +- chargebee/models/usage_file/responses.py | 4 +- chargebee/models/webhook_endpoint/__init__.py | 2 + .../models/webhook_endpoint/operations.py | 131 +++++++++++++++ .../models/webhook_endpoint/responses.py | 54 ++++++ chargebee/version.py | 2 +- 47 files changed, 894 insertions(+), 277 deletions(-) create mode 100644 chargebee/models/impacted_customer/__init__.py create mode 100644 chargebee/models/impacted_customer/operations.py create mode 100644 chargebee/models/impacted_customer/responses.py create mode 100644 chargebee/models/omnichannel_one_time_order/__init__.py create mode 100644 chargebee/models/omnichannel_one_time_order/operations.py create mode 100644 chargebee/models/omnichannel_one_time_order/responses.py create mode 100644 chargebee/models/omnichannel_one_time_order_item/__init__.py create mode 100644 chargebee/models/omnichannel_one_time_order_item/operations.py create mode 100644 chargebee/models/omnichannel_one_time_order_item/responses.py create mode 100644 chargebee/models/subscription_entitlements_created_detail/__init__.py create mode 100644 chargebee/models/subscription_entitlements_created_detail/operations.py create mode 100644 chargebee/models/subscription_entitlements_created_detail/responses.py create mode 100644 chargebee/models/subscription_entitlements_updated_detail/__init__.py create mode 100644 chargebee/models/subscription_entitlements_updated_detail/operations.py create mode 100644 chargebee/models/subscription_entitlements_updated_detail/responses.py create mode 100644 chargebee/models/webhook_endpoint/__init__.py create mode 100644 chargebee/models/webhook_endpoint/operations.py create mode 100644 chargebee/models/webhook_endpoint/responses.py diff --git a/CHANGELOG.md b/CHANGELOG.md index c02e52f..687e62f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,59 @@ +### v3.9.0 (2025-08-19) +* * * +### New Resources: +* WebhookEndpoints has been added. +* OmnichannelOneTimeOrder has been added. +* OmnichannelOneTimeOrderItem has been added. + +### New Attributes: +* business_entity_id has been added to Comment. +* business_entity_id has been added to PromotionalCredit. +* quantity has been added to Discount. +* business_entity_id has been added to PromotionalCredit. +* coupon_applicability_mappings[] has been added to QuotedCharge. +* linked_omnichannel_one_time_orders[] has been added to RecordedPurchase. +* quantity has been added to Subscripiton#Discount. + +### New Input Parameters: +* transaction[id] has been added to Customer#RecordExcessPaymentRequest. +* discounts[quantity][] has been added to Estimate#CreateSubItemEstimateRequest. +* consolidate_entitlements has been added to CustomerEntitlement#EntitlementsForCustomer. +* discounts[quantity][] has been added to Estimate#CreateSubItemEstimateRequest. +* discounts[quantity][] has been added to Estimate#CreateSubItemForCustomerEstimateRequest. +* discounts[quantity][] has been added to Estimate#UpdateSubscriptionForItemsRequest. +* discounts[quantity][] has been added to Estimate#CreateInvoiceForItemsRequest. +* discounts[quantity][] has been added to HostedPage#CheckoutOneTimeForItemsRequest. +* discounts[quantity][] has been added to HostedPage#CheckoutNewForItemsRequest. +* discounts[quantity][] has been added to HostedPage#CheckoutExistingForItemsRequest. +* discounts[quantity][] has been added to PricingPageSession#CreateForNewSubscriptionRequest. +* discounts[quantity][] has been added to PricingPageSession#CreateForExistingSubscriptionRequest. +* discounts[quantity][] has been added to Purchase#CreateRequest. +* discounts[quantity][] has been added to Purchase#EstimateRequest. +* discounts[quantity][] has been added to Quote#CreateSubItemsForCustomerQuoteRequest. +* discounts[quantity][] has been added to Quote#EditCreateSubCustomerQuoteForItemsRequest. +* discounts[quantity][] has been added to Quote#UpdateSubscriptionQuoteForItemsRequest. +* discounts[quantity][] has been added to Quote#EditUpdateSubscriptionQuoteForItemsRequest. +* discounts[quantity][] has been added to Quote#CreateForChargeItemsAndChargesRequest. +* discounts[quantity][] has been added to Quote#EditForChargeItemsAndChargesRequest. +* discounts[quantity][] has been added to Subscription#CreateWithItemsRequest. +* discounts[quantity][] has been added to Subscription#UpdateForItemsRequest. +* discounts[quantity][] has been added to Subscription#ImportForItemsRequest. +* google_play_store[product_id] has been added to RecordedPurchase#CreateRequest. +* google_play_store[order_id] has been added to RecordedPurchase#CreateRequest. + +### New Enums +* PAUSE has been added to OmnichannelSubscriptionItemScheduledChange#ChangeType. +* OFFER_QUANTITY has been added to Discount#Type. +* OFFER_QUANTITY has been added to Subscription#Discount#Type. +* OMNICHANNEL_ONE_TIME_ORDER has been added to EntityType. +* OMNICHANNEL_ONE_TIME_ORDER_ITEM has been added to EntityType. +* USAGE_FILE has been added to EntityType. +* OMNICHANNEL_ONE_TIME_ORDER_CREATED has been added to EventType. +* OMNICHANNEL_ONE_TIME_ORDER_ITEM_CANCELLED has been added to EventType. +* USAGE_FILE_INGESTED has been added to EventType. +* OMNICHANNEL_SUBSCRIPTION_ITEM_PAUSE_SCHEDULED has been added to EventType. + + ### v3.8.0 (2025-07-18) * * * diff --git a/chargebee/main.py b/chargebee/main.py index 5778683..2a67068 100644 --- a/chargebee/main.py +++ b/chargebee/main.py @@ -69,6 +69,7 @@ def __init__( self.Gift = chargebee.Gift(self.env) self.Hierarchy = chargebee.Hierarchy(self.env) self.HostedPage = chargebee.HostedPage(self.env) + self.ImpactedCustomer = chargebee.ImpactedCustomer(self.env) self.ImpactedItem = chargebee.ImpactedItem(self.env) self.ImpactedItemPrice = chargebee.ImpactedItemPrice(self.env) self.ImpactedSubscription = chargebee.ImpactedSubscription(self.env) @@ -80,6 +81,10 @@ def __init__( self.ItemFamily = chargebee.ItemFamily(self.env) self.ItemPrice = chargebee.ItemPrice(self.env) self.Metadata = chargebee.Metadata(self.env) + self.OmnichannelOneTimeOrder = chargebee.OmnichannelOneTimeOrder(self.env) + self.OmnichannelOneTimeOrderItem = chargebee.OmnichannelOneTimeOrderItem( + self.env + ) self.OmnichannelSubscription = chargebee.OmnichannelSubscription(self.env) self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem( self.env @@ -114,6 +119,12 @@ def __init__( self.SiteMigrationDetail = chargebee.SiteMigrationDetail(self.env) self.Subscription = chargebee.Subscription(self.env) self.SubscriptionEntitlement = chargebee.SubscriptionEntitlement(self.env) + self.SubscriptionEntitlementsCreatedDetail = ( + chargebee.SubscriptionEntitlementsCreatedDetail(self.env) + ) + self.SubscriptionEntitlementsUpdatedDetail = ( + chargebee.SubscriptionEntitlementsUpdatedDetail(self.env) + ) self.SubscriptionEstimate = chargebee.SubscriptionEstimate(self.env) self.TaxWithheld = chargebee.TaxWithheld(self.env) self.ThirdPartyPaymentMethod = chargebee.ThirdPartyPaymentMethod(self.env) @@ -125,6 +136,7 @@ def __init__( self.UsageEvent = chargebee.UsageEvent(self.env) self.UsageFile = chargebee.UsageFile(self.env) self.VirtualBankAccount = chargebee.VirtualBankAccount(self.env) + self.WebhookEndpoint = chargebee.WebhookEndpoint(self.env) def update_connect_timeout_secs(self, connect_timeout): self.env.connect_timeout = connect_timeout diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 51d721d..3d1a9c4 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -154,6 +154,8 @@ from chargebee.models.hosted_page.operations import HostedPage +from chargebee.models.impacted_customer.operations import ImpactedCustomer + from chargebee.models.impacted_item.operations import ImpactedItem from chargebee.models.impacted_item_price.operations import ImpactedItemPrice @@ -176,6 +178,14 @@ from chargebee.models.metadata.operations import Metadata +from chargebee.models.omnichannel_one_time_order.operations import ( + OmnichannelOneTimeOrder, +) + +from chargebee.models.omnichannel_one_time_order_item.operations import ( + OmnichannelOneTimeOrderItem, +) + from chargebee.models.omnichannel_subscription.operations import OmnichannelSubscription from chargebee.models.omnichannel_subscription_item.operations import ( @@ -242,6 +252,14 @@ from chargebee.models.subscription_entitlement.operations import SubscriptionEntitlement +from chargebee.models.subscription_entitlements_created_detail.operations import ( + SubscriptionEntitlementsCreatedDetail, +) + +from chargebee.models.subscription_entitlements_updated_detail.operations import ( + SubscriptionEntitlementsUpdatedDetail, +) + from chargebee.models.subscription_estimate.operations import SubscriptionEstimate from chargebee.models.tax_withheld.operations import TaxWithheld @@ -265,3 +283,5 @@ from chargebee.models.usage_file.operations import UsageFile from chargebee.models.virtual_bank_account.operations import VirtualBankAccount + +from chargebee.models.webhook_endpoint.operations import WebhookEndpoint diff --git a/chargebee/models/comment/responses.py b/chargebee/models/comment/responses.py index bf8ebb1..7c29d8e 100644 --- a/chargebee/models/comment/responses.py +++ b/chargebee/models/comment/responses.py @@ -14,6 +14,7 @@ class CommentResponse(Model): created_at: int = None type: str = None entity_id: str = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index 22692db..da8aebb 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -45,17 +45,6 @@ class Status(Enum): def __str__(self): return self.value - class EinvoiceStatus(Enum): - SCHEDULED = "scheduled" - SKIPPED = "skipped" - IN_PROGRESS = "in_progress" - SUCCESS = "success" - FAILED = "failed" - REGISTERED = "registered" - - def __str__(self): - return self.value - class LineItemEntityType(Enum): ADHOC = "adhoc" PLAN_ITEM_PRICE = "plan_item_price" @@ -68,7 +57,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" @@ -79,14 +68,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" @@ -97,6 +79,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 AppliedCreditTaxApplication(Enum): PRE_TAX = "pre_tax" POST_TAX = "post_tax" @@ -104,11 +93,16 @@ class AppliedCreditTaxApplication(Enum): def __str__(self): return self.value - class Einvoice(TypedDict): - id: Required[str] - reference_number: NotRequired[str] - status: Required["CreditNote.EinvoiceStatus"] - message: NotRequired[str] + class EinvoiceStatus(Enum): + SCHEDULED = "scheduled" + SKIPPED = "skipped" + IN_PROGRESS = "in_progress" + SUCCESS = "success" + FAILED = "failed" + REGISTERED = "registered" + + def __str__(self): + return self.value class LineItem(TypedDict): id: NotRequired[str] @@ -137,21 +131,6 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["CreditNote.DiscountEntityType"] - discount_type: NotRequired["CreditNote.DiscountDiscountType"] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required["CreditNote.LineItemDiscountDiscountType"] - coupon_id: NotRequired[str] - entity_id: NotRequired[str] - discount_amount: Required[int] - class LineItemTier(TypedDict): line_item_id: NotRequired[str] starting_unit: Required[int] @@ -165,10 +144,12 @@ class LineItemTier(TypedDict): 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["CreditNote.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] class LineItemTax(TypedDict): line_item_id: NotRequired[str] @@ -187,6 +168,40 @@ class LineItemTax(TypedDict): tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] + class LineItemAddress(TypedDict): + line_item_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["CreditNote.DiscountEntityType"] + discount_type: NotRequired["CreditNote.DiscountDiscountType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + class TaxOrigin(TypedDict): + country: NotRequired[str] + registration_number: NotRequired[str] + class LinkedRefund(TypedDict): txn_id: Required[str] applied_amount: Required[int] @@ -237,31 +252,16 @@ class BillingAddress(TypedDict): zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] + class Einvoice(TypedDict): + id: Required[str] + reference_number: NotRequired[str] + status: Required["CreditNote.EinvoiceStatus"] + message: NotRequired[str] + class SiteDetailsAtCreation(TypedDict): timezone: NotRequired[str] organization_address: NotRequired[Dict[Any, Any]] - class TaxOrigin(TypedDict): - country: NotRequired[str] - registration_number: NotRequired[str] - - class LineItemAddress(TypedDict): - line_item_id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - state: NotRequired[str] - country: NotRequired[str] - zip: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - class CreateLineItemParams(TypedDict): reference_line_item_id: NotRequired[str] unit_amount: NotRequired[int] @@ -280,6 +280,7 @@ class RetrieveLineItemParams(TypedDict): customer_id: NotRequired[Filters.StringFilter] class RecordRefundTransactionParams(TypedDict): + id: NotRequired[str] amount: NotRequired[int] payment_method: Required[enums.PaymentMethod] reference_number: NotRequired[str] @@ -364,6 +365,7 @@ class ImportCreditNoteAllocationParams(TypedDict): allocated_at: Required[int] class ImportCreditNoteLinkedRefundParams(TypedDict): + id: NotRequired[str] amount: Required[int] payment_method: Required[enums.PaymentMethod] date: Required[int] diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py index d2b54fb..a4c8ed4 100644 --- a/chargebee/models/credit_note/responses.py +++ b/chargebee/models/credit_note/responses.py @@ -5,15 +5,6 @@ from chargebee.models import invoice, transaction, transaction, invoice, download -@dataclass -class EinvoiceResponse(Model): - raw_data: Dict[Any, Any] = None - id: str = None - reference_number: str = None - status: str = None - message: str = None - - @dataclass class LineItemResponse(Model): raw_data: Dict[Any, Any] = None @@ -44,27 +35,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 - line_item_id: str = None - discount_type: str = None - coupon_id: str = None - entity_id: str = None - discount_amount: int = None - - @dataclass class LineItemTierResponse(Model): raw_data: Dict[Any, Any] = None @@ -82,11 +52,13 @@ class LineItemTierResponse(Model): @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 @@ -109,6 +81,52 @@ class LineItemTaxResponse(Model): local_currency_code: str = None +@dataclass +class LineItemAddressResponse(Model): + raw_data: Dict[Any, Any] = None + line_item_id: str = None + first_name: str = None + last_name: str = None + email: str = None + company: str = None + phone: str = None + line1: str = None + line2: str = None + line3: str = None + city: str = None + state_code: str = None + state: str = None + country: str = None + zip: str = None + 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 TaxOriginResponse(Model): + raw_data: Dict[Any, Any] = None + country: str = None + registration_number: str = None + + @dataclass class LinkedRefundResponse(Model): raw_data: Dict[Any, Any] = None @@ -172,37 +190,19 @@ class BillingAddressResponse(Model): @dataclass -class SiteDetailsAtCreationResponse(Model): - raw_data: Dict[Any, Any] = None - timezone: str = None - organization_address: Dict[Any, Any] = None - - -@dataclass -class TaxOriginResponse(Model): +class EinvoiceResponse(Model): raw_data: Dict[Any, Any] = None - country: str = None - registration_number: str = None + id: str = None + reference_number: str = None + status: str = None + message: str = None @dataclass -class LineItemAddressResponse(Model): +class SiteDetailsAtCreationResponse(Model): raw_data: Dict[Any, Any] = None - line_item_id: str = None - first_name: str = None - last_name: str = None - email: str = None - company: str = None - phone: str = None - line1: str = None - line2: str = None - line3: str = None - city: str = None - state_code: str = None - state: str = None - country: str = None - zip: str = None - validation_status: str = None + timezone: str = None + organization_address: Dict[Any, Any] = None @dataclass @@ -229,7 +229,6 @@ class CreditNoteResponse(Model): resource_version: int = None updated_at: int = None channel: str = None - einvoice: EinvoiceResponse = None sub_total: int = None sub_total_in_local_currency: int = None total_in_local_currency: int = None @@ -237,11 +236,13 @@ class CreditNoteResponse(Model): round_off_amount: int = None fractional_correction: int = None line_items: List[LineItemResponse] = None - discounts: List[DiscountResponse] = None - line_item_discounts: List[LineItemDiscountResponse] = None line_item_tiers: List[LineItemTierResponse] = None - taxes: List[TaxResponse] = None + line_item_discounts: List[LineItemDiscountResponse] = None line_item_taxes: List[LineItemTaxResponse] = None + line_item_addresses: List[LineItemAddressResponse] = None + discounts: List[DiscountResponse] = None + taxes: List[TaxResponse] = None + tax_origin: TaxOriginResponse = None linked_refunds: List[LinkedRefundResponse] = None allocations: List[AllocationResponse] = None deleted: bool = None @@ -252,9 +253,8 @@ class CreditNoteResponse(Model): business_entity_id: str = None shipping_address: ShippingAddressResponse = None billing_address: BillingAddressResponse = None + einvoice: EinvoiceResponse = None site_details_at_creation: SiteDetailsAtCreationResponse = None - tax_origin: TaxOriginResponse = None - line_item_addresses: List[LineItemAddressResponse] = None @dataclass diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py index 635e2f7..fee47bf 100644 --- a/chargebee/models/customer/operations.py +++ b/chargebee/models/customer/operations.py @@ -350,6 +350,7 @@ class DeleteContactContactParams(TypedDict): id: Required[str] class RecordExcessPaymentTransactionParams(TypedDict): + id: NotRequired[str] amount: Required[int] currency_code: NotRequired[str] date: Required[int] diff --git a/chargebee/models/customer_entitlement/operations.py b/chargebee/models/customer_entitlement/operations.py index 980390a..84a0b9a 100644 --- a/chargebee/models/customer_entitlement/operations.py +++ b/chargebee/models/customer_entitlement/operations.py @@ -11,6 +11,7 @@ class CustomerEntitlement: class EntitlementsForCustomerParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] + consolidate_entitlements: NotRequired[bool] def entitlements_for_customer( self, id, params: EntitlementsForCustomerParams = None, headers=None diff --git a/chargebee/models/discount/operations.py b/chargebee/models/discount/operations.py index f663515..74c290d 100644 --- a/chargebee/models/discount/operations.py +++ b/chargebee/models/discount/operations.py @@ -12,6 +12,7 @@ class Discount: class Type(Enum): FIXED_AMOUNT = "fixed_amount" PERCENTAGE = "percentage" + OFFER_QUANTITY = "offer_quantity" def __str__(self): return self.value diff --git a/chargebee/models/discount/responses.py b/chargebee/models/discount/responses.py index b68b120..69ee464 100644 --- a/chargebee/models/discount/responses.py +++ b/chargebee/models/discount/responses.py @@ -11,6 +11,7 @@ class DiscountResponse(Model): type: str = None percentage: float = None amount: int = None + quantity: int = None currency_code: str = None duration_type: str = None period: int = None diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 20c7e37..482b538 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -369,6 +369,9 @@ class EntityType(Enum): "omnichannel_subscription_item_scheduled_change" ) SALES_ORDER = "sales_order" + OMNICHANNEL_ONE_TIME_ORDER = "omnichannel_one_time_order" + OMNICHANNEL_ONE_TIME_ORDER_ITEM = "omnichannel_one_time_order_item" + USAGE_FILE = "usage_file" def __str__(self): return self.value @@ -618,6 +621,14 @@ class EventType(Enum): 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" + ) PLAN_CREATED = "plan_created" PLAN_UPDATED = "plan_updated" PLAN_DELETED = "plan_deleted" diff --git a/chargebee/models/estimate/operations.py b/chargebee/models/estimate/operations.py index 15b845f..d4ec423 100644 --- a/chargebee/models/estimate/operations.py +++ b/chargebee/models/estimate/operations.py @@ -147,6 +147,7 @@ class CreateSubItemEstimateDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] class CreateSubItemEstimateItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -282,6 +283,7 @@ class CreateSubItemForCustomerEstimateDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] class CreateSubItemForCustomerEstimateItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -423,6 +425,7 @@ class UpdateSubscriptionForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] operation_type: Required[enums.OperationType] id: NotRequired[str] @@ -705,6 +708,7 @@ class CreateInvoiceForItemsNotesToRemoveParams(TypedDict): class CreateInvoiceForItemsDiscountParams(TypedDict): percentage: NotRequired[float] amount: NotRequired[int] + quantity: NotRequired[int] apply_on: Required[enums.ApplyOn] item_price_id: NotRequired[str] diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index 22e68d8..c90c383 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -264,6 +264,7 @@ class CheckoutOneTimeForItemsChargeParams(TypedDict): class CheckoutOneTimeForItemsDiscountParams(TypedDict): percentage: NotRequired[float] amount: NotRequired[int] + quantity: NotRequired[int] apply_on: Required[enums.ApplyOn] item_price_id: NotRequired[str] @@ -363,6 +364,7 @@ class CheckoutNewForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] class CheckoutNewForItemsItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -503,6 +505,7 @@ class CheckoutExistingForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] operation_type: Required[enums.OperationType] id: NotRequired[str] diff --git a/chargebee/models/impacted_customer/__init__.py b/chargebee/models/impacted_customer/__init__.py new file mode 100644 index 0000000..868cf60 --- /dev/null +++ b/chargebee/models/impacted_customer/__init__.py @@ -0,0 +1,2 @@ +from .operations import ImpactedCustomer +from .responses import ImpactedCustomerResponse diff --git a/chargebee/models/impacted_customer/operations.py b/chargebee/models/impacted_customer/operations.py new file mode 100644 index 0000000..c72f79f --- /dev/null +++ b/chargebee/models/impacted_customer/operations.py @@ -0,0 +1,16 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class ImpactedCustomer: + + env: environment.Environment + + class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + pass diff --git a/chargebee/models/impacted_customer/responses.py b/chargebee/models/impacted_customer/responses.py new file mode 100644 index 0000000..bd3d6b5 --- /dev/null +++ b/chargebee/models/impacted_customer/responses.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class DownloadResponse(Model): + raw_data: Dict[Any, Any] = None + download_url: str = None + valid_till: int = None + mime_type: str = None + + +@dataclass +class ImpactedCustomerResponse(Model): + raw_data: Dict[Any, Any] = None + action_type: str = None + download: DownloadResponse = None diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index ec94394..74d3754 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -50,7 +50,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" @@ -61,14 +61,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" @@ -79,6 +72,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 AppliedCreditTaxApplication(Enum): PRE_TAX = "pre_tax" POST_TAX = "post_tax" @@ -162,13 +162,18 @@ class LineItem(TypedDict): entity_id: NotRequired[str] customer_id: NotRequired[str] - class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required["Invoice.DiscountEntityType"] - discount_type: NotRequired["Invoice.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] @@ -177,11 +182,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] @@ -204,18 +204,39 @@ class LineItemCredit(TypedDict): applied_amount: Required[float] line_item_id: NotRequired[str] - class LineItemTier(TypedDict): + class LineItemAddress(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] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["Invoice.DiscountEntityType"] + discount_type: NotRequired["Invoice.DiscountDiscountType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + class TaxOrigin(TypedDict): + country: NotRequired[str] + registration_number: NotRequired[str] class LinkedPayment(TypedDict): txn_id: Required[str] @@ -291,10 +312,6 @@ class ShippingAddress(TypedDict): validation_status: NotRequired[enums.ValidationStatus] index: Required[int] - class StatementDescriptor(TypedDict): - id: Required[str] - descriptor: NotRequired[str] - class BillingAddress(TypedDict): first_name: NotRequired[str] last_name: NotRequired[str] @@ -311,6 +328,10 @@ class BillingAddress(TypedDict): zip: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] + class StatementDescriptor(TypedDict): + id: Required[str] + descriptor: NotRequired[str] + class Einvoice(TypedDict): id: Required[str] reference_number: NotRequired[str] @@ -321,27 +342,6 @@ class SiteDetailsAtCreation(TypedDict): timezone: NotRequired[str] organization_address: NotRequired[Dict[Any, Any]] - class TaxOrigin(TypedDict): - country: NotRequired[str] - registration_number: NotRequired[str] - - class LineItemAddress(TypedDict): - line_item_id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - state: NotRequired[str] - country: NotRequired[str] - zip: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - class CreateAddonParams(TypedDict): id: NotRequired[str] quantity: NotRequired[int] @@ -501,6 +501,7 @@ class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): class CreateForChargeItemsAndChargesDiscountParams(TypedDict): percentage: NotRequired[float] amount: NotRequired[int] + quantity: NotRequired[int] apply_on: Required[enums.ApplyOn] item_price_id: NotRequired[str] @@ -682,6 +683,7 @@ class ImportInvoiceCreditNoteParams(TypedDict): id: NotRequired[str] class ImportInvoicePaymentParams(TypedDict): + id: NotRequired[str] amount: Required[int] payment_method: Required[enums.PaymentMethod] date: NotRequired[int] diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index f41d00a..720dbcf 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -47,14 +47,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 @@ -67,14 +72,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 @@ -104,19 +101,49 @@ class LineItemCreditResponse(Model): @dataclass -class LineItemTierResponse(Model): +class LineItemAddressResponse(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 + first_name: str = None + last_name: str = None + email: str = None + company: str = None + phone: str = None + line1: str = None + line2: str = None + line3: str = None + city: str = None + state_code: str = None + state: str = None + country: str = None + zip: str = None + 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 TaxOriginResponse(Model): + raw_data: Dict[Any, Any] = None + country: str = None + registration_number: str = None @dataclass @@ -217,13 +244,6 @@ class ShippingAddressResponse(Model): index: int = None -@dataclass -class StatementDescriptorResponse(Model): - raw_data: Dict[Any, Any] = None - id: str = None - descriptor: str = None - - @dataclass class BillingAddressResponse(Model): raw_data: Dict[Any, Any] = None @@ -243,6 +263,13 @@ class BillingAddressResponse(Model): validation_status: str = None +@dataclass +class StatementDescriptorResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + descriptor: str = None + + @dataclass class EinvoiceResponse(Model): raw_data: Dict[Any, Any] = None @@ -259,67 +286,41 @@ class SiteDetailsAtCreationResponse(Model): organization_address: Dict[Any, Any] = None -@dataclass -class TaxOriginResponse(Model): - raw_data: Dict[Any, Any] = None - country: str = None - registration_number: str = None - - -@dataclass -class LineItemAddressResponse(Model): - raw_data: Dict[Any, Any] = None - line_item_id: str = None - first_name: str = None - last_name: str = None - email: str = None - company: str = None - phone: str = None - line1: str = None - line2: str = None - line3: str = None - city: str = None - state_code: str = None - state: str = None - country: str = None - zip: str = None - validation_status: str = None - - @dataclass class InvoiceResponse(Model): raw_data: Dict[Any, Any] = None id: str = None - po_number: str = None customer_id: str = None + payment_owner: str = None subscription_id: str = None recurring: bool = None status: str = None - vat_number: str = None - price_type: str = None date: int = None due_date: int = None net_term_days: int = None + po_number: str = None + vat_number: str = None + price_type: str = None exchange_rate: float = None + local_currency_exchange_rate: float = None currency_code: str = None + local_currency_code: str = None + tax: int = None + sub_total: int = None + sub_total_in_local_currency: int = None total: int = None - amount_paid: int = None + total_in_local_currency: int = None + amount_due: int = None amount_adjusted: int = None + amount_paid: int = None + paid_at: int = None write_off_amount: int = None credits_applied: int = None - amount_due: int = None - paid_at: int = None dunning_status: str = None next_retry_at: int = None voided_at: int = None resource_version: int = None updated_at: int = None - sub_total: int = None - sub_total_in_local_currency: int = None - total_in_local_currency: int = None - local_currency_code: str = None - tax: int = None - local_currency_exchange_rate: float = None first_invoice: bool = None new_sales_amount: int = None has_advance_charges: bool = None @@ -330,12 +331,14 @@ class InvoiceResponse(Model): amount_to_collect: int = None round_off_amount: int = 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_credits: List[LineItemCreditResponse] = None - line_item_tiers: List[LineItemTierResponse] = None + line_item_addresses: List[LineItemAddressResponse] = None + discounts: List[DiscountResponse] = None + taxes: List[TaxResponse] = None + tax_origin: TaxOriginResponse = None linked_payments: List[LinkedPaymentResponse] = None dunning_attempts: List[DunningAttemptResponse] = None applied_credits: List[AppliedCreditResponse] = None @@ -344,10 +347,9 @@ class InvoiceResponse(Model): linked_orders: List[LinkedOrderResponse] = None notes: List[NoteResponse] = None shipping_address: ShippingAddressResponse = None - statement_descriptor: StatementDescriptorResponse = None billing_address: BillingAddressResponse = None + statement_descriptor: StatementDescriptorResponse = None einvoice: EinvoiceResponse = None - payment_owner: str = None void_reason_code: str = None deleted: bool = None tax_category: str = None @@ -355,8 +357,6 @@ class InvoiceResponse(Model): channel: str = None business_entity_id: str = None site_details_at_creation: SiteDetailsAtCreationResponse = None - tax_origin: TaxOriginResponse = None - line_item_addresses: List[LineItemAddressResponse] = None @dataclass diff --git a/chargebee/models/omnichannel_one_time_order/__init__.py b/chargebee/models/omnichannel_one_time_order/__init__.py new file mode 100644 index 0000000..a92dae7 --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelOneTimeOrder +from .responses import OmnichannelOneTimeOrderResponse diff --git a/chargebee/models/omnichannel_one_time_order/operations.py b/chargebee/models/omnichannel_one_time_order/operations.py new file mode 100644 index 0000000..ff77e38 --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order/operations.py @@ -0,0 +1,88 @@ +from .responses import * +from chargebee import request, environment +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 + + +@dataclass +class OmnichannelOneTimeOrder: + + env: environment.Environment + + class Source(Enum): + APPLE_APP_STORE = "apple_app_store" + GOOGLE_PLAY_STORE = "google_play_store" + + def __str__(self): + return self.value + + class OmnichannelOneTimeOrderItemCancellationReason(Enum): + CUSTOMER_CANCELLED = "customer_cancelled" + CUSTOMER_DID_NOT_CONSENT_TO_PRICE_INCREASE = ( + "customer_did_not_consent_to_price_increase" + ) + REFUNDED_DUE_TO_APP_ISSUE = "refunded_due_to_app_issue" + REFUNDED_FOR_OTHER_REASON = "refunded_for_other_reason" + MERCHANT_REVOKED = "merchant_revoked" + + def __str__(self): + return self.value + + class OmnichannelTransactionType(Enum): + PURCHASE = "purchase" + RENEWAL = "renewal" + + 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] + source: NotRequired[Filters.EnumFilter] + customer_id: NotRequired[Filters.StringFilter] + + def retrieve(self, id, headers=None) -> RetrieveResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("omnichannel_one_time_orders", id), + self.env, + None, + headers, + RetrieveResponse, + None, + False, + jsonKeys, + options, + ) + + def list(self, params: ListParams = None, headers=None) -> ListResponse: + jsonKeys = {} + options = {} + return request.send_list_request( + "get", + request.uri_path("omnichannel_one_time_orders"), + self.env, + cast(Dict[Any, Any], params), + headers, + ListResponse, + None, + False, + jsonKeys, + options, + ) diff --git a/chargebee/models/omnichannel_one_time_order/responses.py b/chargebee/models/omnichannel_one_time_order/responses.py new file mode 100644 index 0000000..0b218b2 --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order/responses.py @@ -0,0 +1,57 @@ +from dataclasses import dataclass +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 + + +@dataclass +class OmnichannelOneTimeOrderResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + app_id: str = None + customer_id: str = None + id_at_source: str = None + origin: str = None + source: str = None + created_at: int = None + resource_version: int = None + omnichannel_one_time_order_items: List[ + "omnichannel_one_time_order_item.OmnichannelOneTimeOrderItemResponse" + ] = None + purchase_transaction: "omnichannel_transaction.OmnichannelTransactionResponse" = ( + None + ) + + +@dataclass +class RetrieveResponse(Response): + + omnichannel_one_time_order: OmnichannelOneTimeOrderResponse + + +@dataclass +class ListOmnichannelOneTimeOrderResponse: + omnichannel_one_time_order: OmnichannelOneTimeOrderResponse + + +@dataclass +class ListResponse(Response): + + list: List[ListOmnichannelOneTimeOrderResponse] + next_offset: str = None diff --git a/chargebee/models/omnichannel_one_time_order_item/__init__.py b/chargebee/models/omnichannel_one_time_order_item/__init__.py new file mode 100644 index 0000000..04ed50c --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order_item/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelOneTimeOrderItem +from .responses import OmnichannelOneTimeOrderItemResponse diff --git a/chargebee/models/omnichannel_one_time_order_item/operations.py b/chargebee/models/omnichannel_one_time_order_item/operations.py new file mode 100644 index 0000000..07be1b0 --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order_item/operations.py @@ -0,0 +1,24 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class OmnichannelOneTimeOrderItem: + + env: environment.Environment + + class CancellationReason(Enum): + CUSTOMER_CANCELLED = "customer_cancelled" + CUSTOMER_DID_NOT_CONSENT_TO_PRICE_INCREASE = ( + "customer_did_not_consent_to_price_increase" + ) + REFUNDED_DUE_TO_APP_ISSUE = "refunded_due_to_app_issue" + REFUNDED_FOR_OTHER_REASON = "refunded_for_other_reason" + MERCHANT_REVOKED = "merchant_revoked" + + def __str__(self): + return self.value + + pass diff --git a/chargebee/models/omnichannel_one_time_order_item/responses.py b/chargebee/models/omnichannel_one_time_order_item/responses.py new file mode 100644 index 0000000..63cd8ff --- /dev/null +++ b/chargebee/models/omnichannel_one_time_order_item/responses.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class OmnichannelOneTimeOrderItemResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + item_id_at_source: str = None + item_type_at_source: str = None + quantity: int = None + cancelled_at: int = None + cancellation_reason: str = None + created_at: int = None + resource_version: int = None diff --git a/chargebee/models/omnichannel_subscription_item_scheduled_change/operations.py b/chargebee/models/omnichannel_subscription_item_scheduled_change/operations.py index cef73f9..1b5cff5 100644 --- a/chargebee/models/omnichannel_subscription_item_scheduled_change/operations.py +++ b/chargebee/models/omnichannel_subscription_item_scheduled_change/operations.py @@ -11,6 +11,7 @@ class OmnichannelSubscriptionItemScheduledChange: class ChangeType(Enum): DOWNGRADE = "downgrade" + PAUSE = "pause" def __str__(self): return self.value diff --git a/chargebee/models/pricing_page_session/operations.py b/chargebee/models/pricing_page_session/operations.py index fbe7532..a12b0d1 100644 --- a/chargebee/models/pricing_page_session/operations.py +++ b/chargebee/models/pricing_page_session/operations.py @@ -33,6 +33,7 @@ class CreateForNewSubscriptionDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] label: NotRequired[str] class CreateForNewSubscriptionBillingAddressParams(TypedDict): @@ -82,6 +83,7 @@ class CreateForExistingSubscriptionDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] label: NotRequired[str] class CreateForNewSubscriptionParams(TypedDict): diff --git a/chargebee/models/promotional_credit/responses.py b/chargebee/models/promotional_credit/responses.py index dc72c7e..01a6dd1 100644 --- a/chargebee/models/promotional_credit/responses.py +++ b/chargebee/models/promotional_credit/responses.py @@ -20,6 +20,7 @@ class PromotionalCreditResponse(Model): closing_balance: int = None done_by: str = None created_at: int = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/purchase/operations.py b/chargebee/models/purchase/operations.py index 053ce3e..08d0898 100644 --- a/chargebee/models/purchase/operations.py +++ b/chargebee/models/purchase/operations.py @@ -47,6 +47,7 @@ class CreateDiscountParams(TypedDict): index: NotRequired[int] coupon_id: NotRequired[str] percentage: NotRequired[float] + quantity: NotRequired[int] amount: NotRequired[int] included_in_mrr: NotRequired[bool] @@ -122,6 +123,7 @@ class EstimateDiscountParams(TypedDict): index: NotRequired[int] coupon_id: NotRequired[str] percentage: NotRequired[float] + quantity: NotRequired[int] amount: NotRequired[int] included_in_mrr: NotRequired[bool] diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index 9cdf538..8481e48 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -555,6 +555,7 @@ class CreateSubItemsForCustomerQuoteDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] start_date: NotRequired[int] end_date: NotRequired[int] @@ -645,6 +646,7 @@ class EditCreateSubCustomerQuoteForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] start_date: NotRequired[int] end_date: NotRequired[int] @@ -737,6 +739,7 @@ class UpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] operation_type: Required[enums.OperationType] id: NotRequired[str] start_date: NotRequired[int] @@ -835,6 +838,7 @@ class EditUpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] operation_type: Required[enums.OperationType] id: NotRequired[str] start_date: NotRequired[int] @@ -960,6 +964,7 @@ class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): class CreateForChargeItemsAndChargesDiscountParams(TypedDict): percentage: NotRequired[float] + quantity: NotRequired[int] amount: NotRequired[int] apply_on: Required[enums.ApplyOn] item_price_id: NotRequired[str] @@ -1031,6 +1036,7 @@ class EditForChargeItemsAndChargesShippingAddressParams(TypedDict): class EditForChargeItemsAndChargesDiscountParams(TypedDict): percentage: NotRequired[float] + quantity: NotRequired[int] amount: NotRequired[int] apply_on: Required[enums.ApplyOn] item_price_id: NotRequired[str] diff --git a/chargebee/models/quoted_charge/operations.py b/chargebee/models/quoted_charge/operations.py index bcba1db..9ff4c3c 100644 --- a/chargebee/models/quoted_charge/operations.py +++ b/chargebee/models/quoted_charge/operations.py @@ -41,6 +41,10 @@ class ItemTier(TypedDict): class Coupon(TypedDict): coupon_id: Required[str] + class CouponApplicabilityMapping(TypedDict): + coupon_id: NotRequired[str] + applicable_item_price_ids: NotRequired[List[str]] + class Addon(TypedDict): id: Required[str] quantity: NotRequired[int] diff --git a/chargebee/models/quoted_charge/responses.py b/chargebee/models/quoted_charge/responses.py index a5ebbbc..1801272 100644 --- a/chargebee/models/quoted_charge/responses.py +++ b/chargebee/models/quoted_charge/responses.py @@ -47,6 +47,13 @@ class CouponResponse(Model): coupon_id: str = None +@dataclass +class CouponApplicabilityMappingResponse(Model): + raw_data: Dict[Any, Any] = None + coupon_id: str = None + applicable_item_price_ids: List[str] = None + + @dataclass class AddonResponse(Model): raw_data: Dict[Any, Any] = None @@ -67,3 +74,4 @@ class QuotedChargeResponse(Model): invoice_items: List[InvoiceItemResponse] = None item_tiers: List[ItemTierResponse] = None coupons: List[CouponResponse] = None + coupon_applicability_mappings: List[CouponApplicabilityMappingResponse] = None diff --git a/chargebee/models/recorded_purchase/operations.py b/chargebee/models/recorded_purchase/operations.py index 7f0eb60..94b1473 100644 --- a/chargebee/models/recorded_purchase/operations.py +++ b/chargebee/models/recorded_purchase/operations.py @@ -28,6 +28,9 @@ def __str__(self): class LinkedOmnichannelSubscription(TypedDict): omnichannel_subscription_id: NotRequired[str] + class LinkedOmnichannelOneTimeOrder(TypedDict): + omnichannel_one_time_order_id: NotRequired[str] + class ErrorDetail(TypedDict): error_message: NotRequired[str] @@ -41,6 +44,8 @@ class CreateAppleAppStoreParams(TypedDict): class CreateGooglePlayStoreParams(TypedDict): purchase_token: NotRequired[str] + product_id: NotRequired[str] + order_id: NotRequired[str] class CreateOmnichannelSubscriptionParams(TypedDict): id: NotRequired[str] diff --git a/chargebee/models/recorded_purchase/responses.py b/chargebee/models/recorded_purchase/responses.py index 655b861..7eb982c 100644 --- a/chargebee/models/recorded_purchase/responses.py +++ b/chargebee/models/recorded_purchase/responses.py @@ -11,6 +11,12 @@ class LinkedOmnichannelSubscriptionResponse(Model): omnichannel_subscription_id: str = None +@dataclass +class LinkedOmnichannelOneTimeOrderResponse(Model): + raw_data: Dict[Any, Any] = None + omnichannel_one_time_order_id: str = None + + @dataclass class ErrorDetailResponse(Model): raw_data: Dict[Any, Any] = None @@ -29,6 +35,9 @@ class RecordedPurchaseResponse(Model): created_at: int = None resource_version: int = None linked_omnichannel_subscriptions: List[LinkedOmnichannelSubscriptionResponse] = None + linked_omnichannel_one_time_orders: List[LinkedOmnichannelOneTimeOrderResponse] = ( + None + ) error_detail: ErrorDetailResponse = None diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py index 3216373..0ad0ee1 100644 --- a/chargebee/models/subscription/operations.py +++ b/chargebee/models/subscription/operations.py @@ -73,6 +73,7 @@ def __str__(self): class DiscountType(Enum): FIXED_AMOUNT = "fixed_amount" PERCENTAGE = "percentage" + OFFER_QUANTITY = "offer_quantity" def __str__(self): return self.value @@ -185,6 +186,7 @@ class Discount(TypedDict): type: Required["Subscription.DiscountType"] percentage: NotRequired[float] amount: NotRequired[int] + quantity: NotRequired[int] currency_code: NotRequired[str] duration_type: Required[enums.DurationType] period: NotRequired[int] @@ -470,6 +472,7 @@ class CreateWithItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] class CreateWithItemsItemTierParams(TypedDict): item_price_id: NotRequired[str] @@ -671,6 +674,7 @@ class UpdateForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] operation_type: Required[enums.OperationType] id: NotRequired[str] @@ -1076,6 +1080,7 @@ class ImportForItemsDiscountParams(TypedDict): period_unit: NotRequired[enums.PeriodUnit] included_in_mrr: NotRequired[bool] item_price_id: NotRequired[str] + quantity: NotRequired[int] class ImportForItemsChargedItemParams(TypedDict): item_price_id: NotRequired[str] diff --git a/chargebee/models/subscription/responses.py b/chargebee/models/subscription/responses.py index cec59cd..d9343bf 100644 --- a/chargebee/models/subscription/responses.py +++ b/chargebee/models/subscription/responses.py @@ -152,6 +152,7 @@ class DiscountResponse(Model): type: str = None percentage: float = None amount: int = None + quantity: int = None currency_code: str = None duration_type: str = None period: int = None diff --git a/chargebee/models/subscription_entitlements_created_detail/__init__.py b/chargebee/models/subscription_entitlements_created_detail/__init__.py new file mode 100644 index 0000000..cf23149 --- /dev/null +++ b/chargebee/models/subscription_entitlements_created_detail/__init__.py @@ -0,0 +1,2 @@ +from .operations import SubscriptionEntitlementsCreatedDetail +from .responses import SubscriptionEntitlementsCreatedDetailResponse diff --git a/chargebee/models/subscription_entitlements_created_detail/operations.py b/chargebee/models/subscription_entitlements_created_detail/operations.py new file mode 100644 index 0000000..3e89867 --- /dev/null +++ b/chargebee/models/subscription_entitlements_created_detail/operations.py @@ -0,0 +1,11 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class SubscriptionEntitlementsCreatedDetail: + + env: environment.Environment + + pass diff --git a/chargebee/models/subscription_entitlements_created_detail/responses.py b/chargebee/models/subscription_entitlements_created_detail/responses.py new file mode 100644 index 0000000..5ea30ef --- /dev/null +++ b/chargebee/models/subscription_entitlements_created_detail/responses.py @@ -0,0 +1,10 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class SubscriptionEntitlementsCreatedDetailResponse(Model): + raw_data: Dict[Any, Any] = None + subscription_id: str = None + has_next: bool = None diff --git a/chargebee/models/subscription_entitlements_updated_detail/__init__.py b/chargebee/models/subscription_entitlements_updated_detail/__init__.py new file mode 100644 index 0000000..a1d4bb8 --- /dev/null +++ b/chargebee/models/subscription_entitlements_updated_detail/__init__.py @@ -0,0 +1,2 @@ +from .operations import SubscriptionEntitlementsUpdatedDetail +from .responses import SubscriptionEntitlementsUpdatedDetailResponse diff --git a/chargebee/models/subscription_entitlements_updated_detail/operations.py b/chargebee/models/subscription_entitlements_updated_detail/operations.py new file mode 100644 index 0000000..6123c74 --- /dev/null +++ b/chargebee/models/subscription_entitlements_updated_detail/operations.py @@ -0,0 +1,11 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class SubscriptionEntitlementsUpdatedDetail: + + env: environment.Environment + + pass diff --git a/chargebee/models/subscription_entitlements_updated_detail/responses.py b/chargebee/models/subscription_entitlements_updated_detail/responses.py new file mode 100644 index 0000000..a4fec6f --- /dev/null +++ b/chargebee/models/subscription_entitlements_updated_detail/responses.py @@ -0,0 +1,10 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class SubscriptionEntitlementsUpdatedDetailResponse(Model): + raw_data: Dict[Any, Any] = None + subscription_id: str = None + has_next: bool = None diff --git a/chargebee/models/usage_file/operations.py b/chargebee/models/usage_file/operations.py index 9bb4297..0693f90 100644 --- a/chargebee/models/usage_file/operations.py +++ b/chargebee/models/usage_file/operations.py @@ -23,36 +23,36 @@ class UploadDetail(TypedDict): url: Required[str] expires_at: Required[int] - class UploadParams(TypedDict): + class UploadUrlParams(TypedDict): file_name: Required[str] mime_type: Required[str] - def upload(self, params: UploadParams, headers=None) -> UploadResponse: + def upload_url(self, params: UploadUrlParams, headers=None) -> UploadUrlResponse: jsonKeys = {} options = {} return request.send( "post", - request.uri_path("usage_files", "upload"), + request.uri_path("usage_files", "upload_url"), self.env, cast(Dict[Any, Any], params), headers, - UploadResponse, + UploadUrlResponse, "file-ingest", False, jsonKeys, options, ) - def status(self, id, headers=None) -> StatusResponse: + def processing_status(self, id, headers=None) -> ProcessingStatusResponse: jsonKeys = {} options = {} return request.send( "get", - request.uri_path("usage_files", id, "status"), + request.uri_path("usage_files", id, "processing_status"), self.env, None, headers, - StatusResponse, + ProcessingStatusResponse, "file-ingest", False, jsonKeys, diff --git a/chargebee/models/usage_file/responses.py b/chargebee/models/usage_file/responses.py index 8f6587f..66a8e9d 100644 --- a/chargebee/models/usage_file/responses.py +++ b/chargebee/models/usage_file/responses.py @@ -32,12 +32,12 @@ class UsageFileResponse(Model): @dataclass -class UploadResponse(Response): +class UploadUrlResponse(Response): is_idempotency_replayed: bool usage_file: UsageFileResponse @dataclass -class StatusResponse(Response): +class ProcessingStatusResponse(Response): usage_file: UsageFileResponse diff --git a/chargebee/models/webhook_endpoint/__init__.py b/chargebee/models/webhook_endpoint/__init__.py new file mode 100644 index 0000000..23926db --- /dev/null +++ b/chargebee/models/webhook_endpoint/__init__.py @@ -0,0 +1,2 @@ +from .operations import WebhookEndpoint +from .responses import WebhookEndpointResponse diff --git a/chargebee/models/webhook_endpoint/operations.py b/chargebee/models/webhook_endpoint/operations.py new file mode 100644 index 0000000..f410665 --- /dev/null +++ b/chargebee/models/webhook_endpoint/operations.py @@ -0,0 +1,131 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums + + +@dataclass +class WebhookEndpoint: + + env: environment.Environment + + class ApiVersion(Enum): + V1 = "v1" + V2 = "v2" + + def __str__(self): + return self.value + + class CreateParams(TypedDict): + name: Required[str] + api_version: NotRequired["WebhookEndpoint.ApiVersion"] + url: Required[str] + primary_url: NotRequired[bool] + disabled: NotRequired[bool] + basic_auth_password: NotRequired[str] + basic_auth_username: NotRequired[str] + send_card_resource: NotRequired[bool] + chargebee_response_schema_type: NotRequired[enums.ChargebeeResponseSchemaType] + enabled_events: NotRequired[List[enums.EventType]] + + class UpdateParams(TypedDict): + name: NotRequired[str] + api_version: NotRequired["WebhookEndpoint.ApiVersion"] + url: NotRequired[str] + primary_url: NotRequired[bool] + send_card_resource: NotRequired[bool] + basic_auth_password: NotRequired[str] + basic_auth_username: NotRequired[str] + disabled: NotRequired[bool] + enabled_events: NotRequired[List[enums.EventType]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + def create(self, params: CreateParams, headers=None) -> CreateResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("webhook_endpoints"), + self.env, + cast(Dict[Any, Any], params), + headers, + CreateResponse, + None, + False, + jsonKeys, + options, + ) + + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("webhook_endpoints", id), + self.env, + cast(Dict[Any, Any], params), + headers, + UpdateResponse, + None, + False, + jsonKeys, + options, + ) + + def retrieve(self, id, headers=None) -> RetrieveResponse: + jsonKeys = {} + options = {} + return request.send( + "get", + request.uri_path("webhook_endpoints", id), + self.env, + None, + headers, + RetrieveResponse, + None, + False, + jsonKeys, + options, + ) + + def delete(self, id, headers=None) -> DeleteResponse: + jsonKeys = {} + options = { + "isIdempotent": True, + } + return request.send( + "post", + request.uri_path("webhook_endpoints", id, "delete"), + self.env, + None, + headers, + DeleteResponse, + None, + False, + jsonKeys, + options, + ) + + def list(self, params: ListParams = None, headers=None) -> ListResponse: + jsonKeys = {} + options = {} + return request.send_list_request( + "get", + request.uri_path("webhook_endpoints"), + self.env, + cast(Dict[Any, Any], params), + headers, + ListResponse, + None, + False, + jsonKeys, + options, + ) diff --git a/chargebee/models/webhook_endpoint/responses.py b/chargebee/models/webhook_endpoint/responses.py new file mode 100644 index 0000000..8a48a52 --- /dev/null +++ b/chargebee/models/webhook_endpoint/responses.py @@ -0,0 +1,54 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response + + +@dataclass +class WebhookEndpointResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + url: str = None + send_card_resource: bool = None + disabled: bool = None + primary_url: bool = None + api_version: str = None + chargebee_response_schema_type: str = None + enabled_events: List[str] = None + + +@dataclass +class CreateResponse(Response): + is_idempotency_replayed: bool + webhook_endpoint: WebhookEndpointResponse + + +@dataclass +class UpdateResponse(Response): + is_idempotency_replayed: bool + webhook_endpoint: WebhookEndpointResponse + + +@dataclass +class RetrieveResponse(Response): + + webhook_endpoint: WebhookEndpointResponse + + +@dataclass +class DeleteResponse(Response): + is_idempotency_replayed: bool + webhook_endpoint: WebhookEndpointResponse + + +@dataclass +class ListWebhookEndpointResponse: + webhook_endpoint: WebhookEndpointResponse + + +@dataclass +class ListResponse(Response): + + list: List[ListWebhookEndpointResponse] + next_offset: str = None diff --git a/chargebee/version.py b/chargebee/version.py index 8173e1e..10baa2a 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = "3.8.0" +VERSION = "3.9.0"