From 70b7cd3586f2c9ca96817971c2233ba00133dc76 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 12 Sep 2024 19:53:10 +0530 Subject: [PATCH 01/19] Initial commit --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 53bf295ef6e8ecc7cdcb8b52c35db7dd2ea02c59 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Fri, 13 Sep 2024 09:31:35 +0530 Subject: [PATCH 02/19] V3.0.0b1 --- .gitignore | 29 + LICENSE | 24 + MANIFEST.in | 1 + chargebee/__init__.py | 26 + chargebee/api_error.py | 28 + chargebee/compat.py | 12 + chargebee/environment.py | 26 + chargebee/filters/__init__.py | 1 + chargebee/filters/filters.py | 43 + chargebee/http_request.py | 155 + chargebee/main.py | 23 + chargebee/model.py | 34 + chargebee/models/__init__.py | 586 +++ chargebee/models/addon/__init__.py | 13 + chargebee/models/addon/operations.py | 185 + chargebee/models/addon/responses.py | 117 + chargebee/models/addon/types.py | 153 + chargebee/models/address/__init__.py | 3 + chargebee/models/address/operations.py | 51 + chargebee/models/address/responses.py | 36 + chargebee/models/address/types.py | 21 + .../advance_invoice_schedule/__init__.py | 8 + .../advance_invoice_schedule/operations.py | 9 + .../advance_invoice_schedule/responses.py | 29 + .../models/advance_invoice_schedule/types.py | 33 + chargebee/models/attached_item/__init__.py | 3 + chargebee/models/attached_item/operations.py | 99 + chargebee/models/attached_item/responses.py | 58 + chargebee/models/attached_item/types.py | 38 + chargebee/models/attribute/__init__.py | 3 + chargebee/models/attribute/operations.py | 9 + chargebee/models/attribute/responses.py | 10 + chargebee/models/attribute/types.py | 6 + chargebee/models/business_entity/__init__.py | 3 + .../models/business_entity/operations.py | 50 + chargebee/models/business_entity/responses.py | 34 + chargebee/models/business_entity/types.py | 20 + .../business_entity_transfer/__init__.py | 3 + .../business_entity_transfer/operations.py | 9 + .../business_entity_transfer/responses.py | 16 + .../models/business_entity_transfer/types.py | 28 + chargebee/models/card/__init__.py | 3 + chargebee/models/card/operations.py | 92 + chargebee/models/card/responses.py | 71 + chargebee/models/card/types.py | 97 + chargebee/models/comment/__init__.py | 3 + chargebee/models/comment/operations.py | 66 + chargebee/models/comment/responses.py | 45 + chargebee/models/comment/types.py | 21 + chargebee/models/contact/__init__.py | 3 + chargebee/models/contact/operations.py | 9 + chargebee/models/contact/responses.py | 17 + chargebee/models/contact/types.py | 13 + chargebee/models/contract_term/__init__.py | 3 + chargebee/models/contract_term/operations.py | 9 + chargebee/models/contract_term/responses.py | 20 + chargebee/models/contract_term/types.py | 37 + chargebee/models/coupon/__init__.py | 15 + chargebee/models/coupon/operations.py | 226 ++ chargebee/models/coupon/responses.py | 122 + chargebee/models/coupon/types.py | 203 + chargebee/models/coupon_code/__init__.py | 3 + chargebee/models/coupon_code/operations.py | 65 + chargebee/models/coupon_code/responses.py | 43 + chargebee/models/coupon_code/types.py | 19 + chargebee/models/coupon_set/__init__.py | 3 + chargebee/models/coupon_set/operations.py | 114 + chargebee/models/coupon_set/responses.py | 63 + chargebee/models/coupon_set/types.py | 11 + chargebee/models/credit_note/__init__.py | 21 + chargebee/models/credit_note/operations.py | 262 ++ chargebee/models/credit_note/responses.py | 316 ++ chargebee/models/credit_note/types.py | 400 ++ .../models/credit_note_estimate/__init__.py | 12 + .../models/credit_note_estimate/operations.py | 9 + .../models/credit_note_estimate/responses.py | 109 + .../models/credit_note_estimate/types.py | 146 + chargebee/models/currency/__init__.py | 3 + chargebee/models/currency/operations.py | 88 + chargebee/models/currency/responses.py | 52 + chargebee/models/currency/types.py | 19 + chargebee/models/customer/__init__.py | 20 + chargebee/models/customer/operations.py | 520 +++ chargebee/models/customer/responses.py | 360 ++ chargebee/models/customer/types.py | 542 +++ .../models/customer_entitlement/__init__.py | 3 + .../models/customer_entitlement/operations.py | 24 + .../models/customer_entitlement/responses.py | 26 + .../models/customer_entitlement/types.py | 10 + .../models/differential_price/__init__.py | 3 + .../models/differential_price/operations.py | 93 + .../models/differential_price/responses.py | 73 + chargebee/models/differential_price/types.py | 78 + chargebee/models/discount/__init__.py | 3 + chargebee/models/discount/operations.py | 9 + chargebee/models/discount/responses.py | 25 + chargebee/models/discount/types.py | 31 + chargebee/models/download/__init__.py | 3 + chargebee/models/download/operations.py | 9 + chargebee/models/download/responses.py | 11 + chargebee/models/download/types.py | 7 + chargebee/models/entitlement/__init__.py | 3 + chargebee/models/entitlement/operations.py | 44 + chargebee/models/entitlement/responses.py | 33 + chargebee/models/entitlement/types.py | 30 + .../models/entitlement_override/__init__.py | 3 + .../models/entitlement_override/operations.py | 50 + .../models/entitlement_override/responses.py | 36 + .../models/entitlement_override/types.py | 31 + chargebee/models/enums.py | 1074 ++++++ chargebee/models/estimate/__init__.py | 3 + chargebee/models/estimate/operations.py | 522 +++ chargebee/models/estimate/responses.py | 142 + chargebee/models/estimate/types.py | 784 ++++ chargebee/models/event/__init__.py | 3 + chargebee/models/event/operations.py | 39 + chargebee/models/event/responses.py | 43 + chargebee/models/event/types.py | 48 + chargebee/models/export/__init__.py | 3 + chargebee/models/export/operations.py | 325 ++ chargebee/models/export/responses.py | 129 + chargebee/models/export/types.py | 364 ++ chargebee/models/feature/__init__.py | 3 + chargebee/models/feature/operations.py | 120 + chargebee/models/feature/responses.py | 80 + chargebee/models/feature/types.py | 55 + .../models/gateway_error_detail/__init__.py | 3 + .../models/gateway_error_detail/operations.py | 9 + .../models/gateway_error_detail/responses.py | 21 + .../models/gateway_error_detail/types.py | 17 + chargebee/models/gift/__init__.py | 3 + chargebee/models/gift/operations.py | 119 + chargebee/models/gift/responses.py | 100 + chargebee/models/gift/types.py | 158 + chargebee/models/hierarchy/__init__.py | 3 + chargebee/models/hierarchy/operations.py | 9 + chargebee/models/hierarchy/responses.py | 13 + chargebee/models/hierarchy/types.py | 9 + chargebee/models/hosted_page/__init__.py | 3 + chargebee/models/hosted_page/operations.py | 512 +++ chargebee/models/hosted_page/responses.py | 161 + chargebee/models/hosted_page/types.py | 688 ++++ chargebee/models/impacted_item/__init__.py | 3 + chargebee/models/impacted_item/operations.py | 9 + chargebee/models/impacted_item/responses.py | 18 + chargebee/models/impacted_item/types.py | 13 + .../models/impacted_item_price/__init__.py | 3 + .../models/impacted_item_price/operations.py | 9 + .../models/impacted_item_price/responses.py | 18 + chargebee/models/impacted_item_price/types.py | 13 + .../models/impacted_subscription/__init__.py | 3 + .../impacted_subscription/operations.py | 9 + .../models/impacted_subscription/responses.py | 18 + .../models/impacted_subscription/types.py | 13 + .../models/in_app_subscription/__init__.py | 3 + .../models/in_app_subscription/operations.py | 76 + .../models/in_app_subscription/responses.py | 38 + chargebee/models/in_app_subscription/types.py | 63 + chargebee/models/installment/__init__.py | 3 + chargebee/models/installment/operations.py | 36 + chargebee/models/installment/responses.py | 34 + chargebee/models/installment/types.py | 22 + .../models/installment_config/__init__.py | 3 + .../models/installment_config/operations.py | 48 + .../models/installment_config/responses.py | 42 + chargebee/models/installment_config/types.py | 34 + .../models/installment_detail/__init__.py | 3 + .../models/installment_detail/operations.py | 9 + .../models/installment_detail/responses.py | 24 + chargebee/models/installment_detail/types.py | 29 + chargebee/models/invoice/__init__.py | 26 + chargebee/models/invoice/operations.py | 772 ++++ chargebee/models/invoice/responses.py | 559 +++ chargebee/models/invoice/types.py | 938 +++++ chargebee/models/invoice_estimate/__init__.py | 11 + .../models/invoice_estimate/operations.py | 9 + .../models/invoice_estimate/responses.py | 109 + chargebee/models/invoice_estimate/types.py | 138 + chargebee/models/item/__init__.py | 10 + chargebee/models/item/operations.py | 117 + chargebee/models/item/responses.py | 73 + chargebee/models/item/types.py | 69 + chargebee/models/item_entitlement/__init__.py | 3 + .../models/item_entitlement/operations.py | 81 + .../models/item_entitlement/responses.py | 51 + chargebee/models/item_entitlement/types.py | 34 + chargebee/models/item_family/__init__.py | 3 + chargebee/models/item_family/operations.py | 81 + chargebee/models/item_family/responses.py | 51 + chargebee/models/item_family/types.py | 21 + chargebee/models/item_price/__init__.py | 15 + chargebee/models/item_price/operations.py | 189 + chargebee/models/item_price/responses.py | 148 + chargebee/models/item_price/types.py | 206 + chargebee/models/metadata/__init__.py | 3 + chargebee/models/metadata/operations.py | 9 + chargebee/models/metadata/responses.py | 9 + chargebee/models/metadata/types.py | 5 + chargebee/models/order/__init__.py | 17 + chargebee/models/order/operations.py | 247 ++ chargebee/models/order/responses.py | 255 ++ chargebee/models/order/types.py | 352 ++ chargebee/models/payment_intent/__init__.py | 3 + chargebee/models/payment_intent/operations.py | 61 + chargebee/models/payment_intent/responses.py | 58 + chargebee/models/payment_intent/types.py | 86 + .../payment_reference_number/__init__.py | 3 + .../payment_reference_number/operations.py | 9 + .../payment_reference_number/responses.py | 12 + .../models/payment_reference_number/types.py | 20 + chargebee/models/payment_source/__init__.py | 16 + chargebee/models/payment_source/operations.py | 289 ++ chargebee/models/payment_source/responses.py | 249 ++ chargebee/models/payment_source/types.py | 262 ++ chargebee/models/payment_voucher/__init__.py | 3 + .../models/payment_voucher/operations.py | 74 + chargebee/models/payment_voucher/responses.py | 71 + chargebee/models/payment_voucher/types.py | 50 + chargebee/models/plan/__init__.py | 17 + chargebee/models/plan/operations.py | 210 + chargebee/models/plan/responses.py | 152 + chargebee/models/plan/types.py | 240 ++ chargebee/models/portal_session/__init__.py | 3 + chargebee/models/portal_session/operations.py | 61 + chargebee/models/portal_session/responses.py | 54 + chargebee/models/portal_session/types.py | 41 + chargebee/models/price_variant/__init__.py | 3 + chargebee/models/price_variant/operations.py | 89 + chargebee/models/price_variant/responses.py | 61 + chargebee/models/price_variant/types.py | 40 + .../models/pricing_page_session/__init__.py | 3 + .../models/pricing_page_session/operations.py | 49 + .../models/pricing_page_session/responses.py | 24 + .../models/pricing_page_session/types.py | 69 + .../models/promotional_credit/__init__.py | 3 + .../models/promotional_credit/operations.py | 98 + .../models/promotional_credit/responses.py | 60 + chargebee/models/promotional_credit/types.py | 26 + chargebee/models/purchase/__init__.py | 3 + chargebee/models/purchase/operations.py | 54 + chargebee/models/purchase/responses.py | 27 + chargebee/models/purchase/types.py | 164 + chargebee/models/quote/__init__.py | 15 + chargebee/models/quote/operations.py | 545 +++ chargebee/models/quote/responses.py | 340 ++ chargebee/models/quote/types.py | 1028 +++++ chargebee/models/quote_line_group/__init__.py | 11 + .../models/quote_line_group/operations.py | 9 + .../models/quote_line_group/responses.py | 94 + chargebee/models/quote_line_group/types.py | 136 + chargebee/models/quoted_charge/__init__.py | 3 + chargebee/models/quoted_charge/operations.py | 9 + chargebee/models/quoted_charge/responses.py | 62 + chargebee/models/quoted_charge/types.py | 54 + .../models/quoted_subscription/__init__.py | 13 + .../models/quoted_subscription/operations.py | 9 + .../models/quoted_subscription/responses.py | 109 + chargebee/models/quoted_subscription/types.py | 130 + chargebee/models/ramp/__init__.py | 12 + chargebee/models/ramp/operations.py | 94 + chargebee/models/ramp/responses.py | 136 + chargebee/models/ramp/types.py | 202 + .../models/resource_migration/__init__.py | 3 + .../models/resource_migration/operations.py | 25 + .../models/resource_migration/responses.py | 21 + chargebee/models/resource_migration/types.py | 22 + .../models/site_migration_detail/__init__.py | 3 + .../site_migration_detail/operations.py | 28 + .../models/site_migration_detail/responses.py | 26 + .../models/site_migration_detail/types.py | 21 + chargebee/models/subscription/__init__.py | 19 + chargebee/models/subscription/operations.py | 996 +++++ chargebee/models/subscription/responses.py | 597 +++ chargebee/models/subscription/types.py | 1283 +++++++ .../subscription_entitlement/__init__.py | 3 + .../subscription_entitlement/operations.py | 51 + .../subscription_entitlement/responses.py | 45 + .../models/subscription_entitlement/types.py | 36 + .../models/subscription_estimate/__init__.py | 3 + .../subscription_estimate/operations.py | 9 + .../models/subscription_estimate/responses.py | 52 + .../models/subscription_estimate/types.py | 81 + chargebee/models/tax_withheld/__init__.py | 3 + chargebee/models/tax_withheld/operations.py | 9 + chargebee/models/tax_withheld/responses.py | 20 + chargebee/models/tax_withheld/types.py | 36 + .../third_party_payment_method/__init__.py | 3 + .../third_party_payment_method/operations.py | 9 + .../third_party_payment_method/responses.py | 12 + .../third_party_payment_method/types.py | 9 + chargebee/models/time_machine/__init__.py | 3 + chargebee/models/time_machine/operations.py | 52 + chargebee/models/time_machine/responses.py | 33 + chargebee/models/time_machine/types.py | 22 + chargebee/models/token/__init__.py | 3 + chargebee/models/token/operations.py | 9 + chargebee/models/token/responses.py | 20 + chargebee/models/token/types.py | 35 + chargebee/models/transaction/__init__.py | 15 + chargebee/models/transaction/operations.py | 204 + chargebee/models/transaction/responses.py | 201 + chargebee/models/transaction/types.py | 162 + chargebee/models/unbilled_charge/__init__.py | 3 + .../models/unbilled_charge/operations.py | 113 + chargebee/models/unbilled_charge/responses.py | 87 + chargebee/models/unbilled_charge/types.py | 128 + chargebee/models/usage/__init__.py | 3 + chargebee/models/usage/operations.py | 95 + chargebee/models/usage/responses.py | 57 + chargebee/models/usage/types.py | 21 + .../models/virtual_bank_account/__init__.py | 3 + .../models/virtual_bank_account/operations.py | 93 + .../models/virtual_bank_account/responses.py | 68 + .../models/virtual_bank_account/types.py | 34 + chargebee/request.py | 62 + chargebee/responses.py | 87 + chargebee/ssl/ca-certs.crt | 3385 +++++++++++++++++ chargebee/util.py | 55 + chargebee/version.py | 1 + setup.py | 26 + 320 files changed, 32053 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 MANIFEST.in create mode 100644 chargebee/__init__.py create mode 100644 chargebee/api_error.py create mode 100644 chargebee/compat.py create mode 100644 chargebee/environment.py create mode 100644 chargebee/filters/__init__.py create mode 100644 chargebee/filters/filters.py create mode 100644 chargebee/http_request.py create mode 100644 chargebee/main.py create mode 100644 chargebee/model.py create mode 100644 chargebee/models/__init__.py create mode 100644 chargebee/models/addon/__init__.py create mode 100644 chargebee/models/addon/operations.py create mode 100644 chargebee/models/addon/responses.py create mode 100644 chargebee/models/addon/types.py create mode 100644 chargebee/models/address/__init__.py create mode 100644 chargebee/models/address/operations.py create mode 100644 chargebee/models/address/responses.py create mode 100644 chargebee/models/address/types.py create mode 100644 chargebee/models/advance_invoice_schedule/__init__.py create mode 100644 chargebee/models/advance_invoice_schedule/operations.py create mode 100644 chargebee/models/advance_invoice_schedule/responses.py create mode 100644 chargebee/models/advance_invoice_schedule/types.py create mode 100644 chargebee/models/attached_item/__init__.py create mode 100644 chargebee/models/attached_item/operations.py create mode 100644 chargebee/models/attached_item/responses.py create mode 100644 chargebee/models/attached_item/types.py create mode 100644 chargebee/models/attribute/__init__.py create mode 100644 chargebee/models/attribute/operations.py create mode 100644 chargebee/models/attribute/responses.py create mode 100644 chargebee/models/attribute/types.py create mode 100644 chargebee/models/business_entity/__init__.py create mode 100644 chargebee/models/business_entity/operations.py create mode 100644 chargebee/models/business_entity/responses.py create mode 100644 chargebee/models/business_entity/types.py create mode 100644 chargebee/models/business_entity_transfer/__init__.py create mode 100644 chargebee/models/business_entity_transfer/operations.py create mode 100644 chargebee/models/business_entity_transfer/responses.py create mode 100644 chargebee/models/business_entity_transfer/types.py create mode 100644 chargebee/models/card/__init__.py create mode 100644 chargebee/models/card/operations.py create mode 100644 chargebee/models/card/responses.py create mode 100644 chargebee/models/card/types.py create mode 100644 chargebee/models/comment/__init__.py create mode 100644 chargebee/models/comment/operations.py create mode 100644 chargebee/models/comment/responses.py create mode 100644 chargebee/models/comment/types.py create mode 100644 chargebee/models/contact/__init__.py create mode 100644 chargebee/models/contact/operations.py create mode 100644 chargebee/models/contact/responses.py create mode 100644 chargebee/models/contact/types.py create mode 100644 chargebee/models/contract_term/__init__.py create mode 100644 chargebee/models/contract_term/operations.py create mode 100644 chargebee/models/contract_term/responses.py create mode 100644 chargebee/models/contract_term/types.py create mode 100644 chargebee/models/coupon/__init__.py create mode 100644 chargebee/models/coupon/operations.py create mode 100644 chargebee/models/coupon/responses.py create mode 100644 chargebee/models/coupon/types.py create mode 100644 chargebee/models/coupon_code/__init__.py create mode 100644 chargebee/models/coupon_code/operations.py create mode 100644 chargebee/models/coupon_code/responses.py create mode 100644 chargebee/models/coupon_code/types.py create mode 100644 chargebee/models/coupon_set/__init__.py create mode 100644 chargebee/models/coupon_set/operations.py create mode 100644 chargebee/models/coupon_set/responses.py create mode 100644 chargebee/models/coupon_set/types.py create mode 100644 chargebee/models/credit_note/__init__.py create mode 100644 chargebee/models/credit_note/operations.py create mode 100644 chargebee/models/credit_note/responses.py create mode 100644 chargebee/models/credit_note/types.py create mode 100644 chargebee/models/credit_note_estimate/__init__.py create mode 100644 chargebee/models/credit_note_estimate/operations.py create mode 100644 chargebee/models/credit_note_estimate/responses.py create mode 100644 chargebee/models/credit_note_estimate/types.py create mode 100644 chargebee/models/currency/__init__.py create mode 100644 chargebee/models/currency/operations.py create mode 100644 chargebee/models/currency/responses.py create mode 100644 chargebee/models/currency/types.py create mode 100644 chargebee/models/customer/__init__.py create mode 100644 chargebee/models/customer/operations.py create mode 100644 chargebee/models/customer/responses.py create mode 100644 chargebee/models/customer/types.py create mode 100644 chargebee/models/customer_entitlement/__init__.py create mode 100644 chargebee/models/customer_entitlement/operations.py create mode 100644 chargebee/models/customer_entitlement/responses.py create mode 100644 chargebee/models/customer_entitlement/types.py create mode 100644 chargebee/models/differential_price/__init__.py create mode 100644 chargebee/models/differential_price/operations.py create mode 100644 chargebee/models/differential_price/responses.py create mode 100644 chargebee/models/differential_price/types.py create mode 100644 chargebee/models/discount/__init__.py create mode 100644 chargebee/models/discount/operations.py create mode 100644 chargebee/models/discount/responses.py create mode 100644 chargebee/models/discount/types.py create mode 100644 chargebee/models/download/__init__.py create mode 100644 chargebee/models/download/operations.py create mode 100644 chargebee/models/download/responses.py create mode 100644 chargebee/models/download/types.py create mode 100644 chargebee/models/entitlement/__init__.py create mode 100644 chargebee/models/entitlement/operations.py create mode 100644 chargebee/models/entitlement/responses.py create mode 100644 chargebee/models/entitlement/types.py create mode 100644 chargebee/models/entitlement_override/__init__.py create mode 100644 chargebee/models/entitlement_override/operations.py create mode 100644 chargebee/models/entitlement_override/responses.py create mode 100644 chargebee/models/entitlement_override/types.py create mode 100644 chargebee/models/enums.py create mode 100644 chargebee/models/estimate/__init__.py create mode 100644 chargebee/models/estimate/operations.py create mode 100644 chargebee/models/estimate/responses.py create mode 100644 chargebee/models/estimate/types.py create mode 100644 chargebee/models/event/__init__.py create mode 100644 chargebee/models/event/operations.py create mode 100644 chargebee/models/event/responses.py create mode 100644 chargebee/models/event/types.py create mode 100644 chargebee/models/export/__init__.py create mode 100644 chargebee/models/export/operations.py create mode 100644 chargebee/models/export/responses.py create mode 100644 chargebee/models/export/types.py create mode 100644 chargebee/models/feature/__init__.py create mode 100644 chargebee/models/feature/operations.py create mode 100644 chargebee/models/feature/responses.py create mode 100644 chargebee/models/feature/types.py create mode 100644 chargebee/models/gateway_error_detail/__init__.py create mode 100644 chargebee/models/gateway_error_detail/operations.py create mode 100644 chargebee/models/gateway_error_detail/responses.py create mode 100644 chargebee/models/gateway_error_detail/types.py create mode 100644 chargebee/models/gift/__init__.py create mode 100644 chargebee/models/gift/operations.py create mode 100644 chargebee/models/gift/responses.py create mode 100644 chargebee/models/gift/types.py create mode 100644 chargebee/models/hierarchy/__init__.py create mode 100644 chargebee/models/hierarchy/operations.py create mode 100644 chargebee/models/hierarchy/responses.py create mode 100644 chargebee/models/hierarchy/types.py create mode 100644 chargebee/models/hosted_page/__init__.py create mode 100644 chargebee/models/hosted_page/operations.py create mode 100644 chargebee/models/hosted_page/responses.py create mode 100644 chargebee/models/hosted_page/types.py create mode 100644 chargebee/models/impacted_item/__init__.py create mode 100644 chargebee/models/impacted_item/operations.py create mode 100644 chargebee/models/impacted_item/responses.py create mode 100644 chargebee/models/impacted_item/types.py create mode 100644 chargebee/models/impacted_item_price/__init__.py create mode 100644 chargebee/models/impacted_item_price/operations.py create mode 100644 chargebee/models/impacted_item_price/responses.py create mode 100644 chargebee/models/impacted_item_price/types.py create mode 100644 chargebee/models/impacted_subscription/__init__.py create mode 100644 chargebee/models/impacted_subscription/operations.py create mode 100644 chargebee/models/impacted_subscription/responses.py create mode 100644 chargebee/models/impacted_subscription/types.py create mode 100644 chargebee/models/in_app_subscription/__init__.py create mode 100644 chargebee/models/in_app_subscription/operations.py create mode 100644 chargebee/models/in_app_subscription/responses.py create mode 100644 chargebee/models/in_app_subscription/types.py create mode 100644 chargebee/models/installment/__init__.py create mode 100644 chargebee/models/installment/operations.py create mode 100644 chargebee/models/installment/responses.py create mode 100644 chargebee/models/installment/types.py create mode 100644 chargebee/models/installment_config/__init__.py create mode 100644 chargebee/models/installment_config/operations.py create mode 100644 chargebee/models/installment_config/responses.py create mode 100644 chargebee/models/installment_config/types.py create mode 100644 chargebee/models/installment_detail/__init__.py create mode 100644 chargebee/models/installment_detail/operations.py create mode 100644 chargebee/models/installment_detail/responses.py create mode 100644 chargebee/models/installment_detail/types.py create mode 100644 chargebee/models/invoice/__init__.py create mode 100644 chargebee/models/invoice/operations.py create mode 100644 chargebee/models/invoice/responses.py create mode 100644 chargebee/models/invoice/types.py create mode 100644 chargebee/models/invoice_estimate/__init__.py create mode 100644 chargebee/models/invoice_estimate/operations.py create mode 100644 chargebee/models/invoice_estimate/responses.py create mode 100644 chargebee/models/invoice_estimate/types.py create mode 100644 chargebee/models/item/__init__.py create mode 100644 chargebee/models/item/operations.py create mode 100644 chargebee/models/item/responses.py create mode 100644 chargebee/models/item/types.py create mode 100644 chargebee/models/item_entitlement/__init__.py create mode 100644 chargebee/models/item_entitlement/operations.py create mode 100644 chargebee/models/item_entitlement/responses.py create mode 100644 chargebee/models/item_entitlement/types.py create mode 100644 chargebee/models/item_family/__init__.py create mode 100644 chargebee/models/item_family/operations.py create mode 100644 chargebee/models/item_family/responses.py create mode 100644 chargebee/models/item_family/types.py create mode 100644 chargebee/models/item_price/__init__.py create mode 100644 chargebee/models/item_price/operations.py create mode 100644 chargebee/models/item_price/responses.py create mode 100644 chargebee/models/item_price/types.py create mode 100644 chargebee/models/metadata/__init__.py create mode 100644 chargebee/models/metadata/operations.py create mode 100644 chargebee/models/metadata/responses.py create mode 100644 chargebee/models/metadata/types.py create mode 100644 chargebee/models/order/__init__.py create mode 100644 chargebee/models/order/operations.py create mode 100644 chargebee/models/order/responses.py create mode 100644 chargebee/models/order/types.py create mode 100644 chargebee/models/payment_intent/__init__.py create mode 100644 chargebee/models/payment_intent/operations.py create mode 100644 chargebee/models/payment_intent/responses.py create mode 100644 chargebee/models/payment_intent/types.py create mode 100644 chargebee/models/payment_reference_number/__init__.py create mode 100644 chargebee/models/payment_reference_number/operations.py create mode 100644 chargebee/models/payment_reference_number/responses.py create mode 100644 chargebee/models/payment_reference_number/types.py create mode 100644 chargebee/models/payment_source/__init__.py create mode 100644 chargebee/models/payment_source/operations.py create mode 100644 chargebee/models/payment_source/responses.py create mode 100644 chargebee/models/payment_source/types.py create mode 100644 chargebee/models/payment_voucher/__init__.py create mode 100644 chargebee/models/payment_voucher/operations.py create mode 100644 chargebee/models/payment_voucher/responses.py create mode 100644 chargebee/models/payment_voucher/types.py create mode 100644 chargebee/models/plan/__init__.py create mode 100644 chargebee/models/plan/operations.py create mode 100644 chargebee/models/plan/responses.py create mode 100644 chargebee/models/plan/types.py create mode 100644 chargebee/models/portal_session/__init__.py create mode 100644 chargebee/models/portal_session/operations.py create mode 100644 chargebee/models/portal_session/responses.py create mode 100644 chargebee/models/portal_session/types.py create mode 100644 chargebee/models/price_variant/__init__.py create mode 100644 chargebee/models/price_variant/operations.py create mode 100644 chargebee/models/price_variant/responses.py create mode 100644 chargebee/models/price_variant/types.py create mode 100644 chargebee/models/pricing_page_session/__init__.py create mode 100644 chargebee/models/pricing_page_session/operations.py create mode 100644 chargebee/models/pricing_page_session/responses.py create mode 100644 chargebee/models/pricing_page_session/types.py create mode 100644 chargebee/models/promotional_credit/__init__.py create mode 100644 chargebee/models/promotional_credit/operations.py create mode 100644 chargebee/models/promotional_credit/responses.py create mode 100644 chargebee/models/promotional_credit/types.py create mode 100644 chargebee/models/purchase/__init__.py create mode 100644 chargebee/models/purchase/operations.py create mode 100644 chargebee/models/purchase/responses.py create mode 100644 chargebee/models/purchase/types.py create mode 100644 chargebee/models/quote/__init__.py create mode 100644 chargebee/models/quote/operations.py create mode 100644 chargebee/models/quote/responses.py create mode 100644 chargebee/models/quote/types.py create mode 100644 chargebee/models/quote_line_group/__init__.py create mode 100644 chargebee/models/quote_line_group/operations.py create mode 100644 chargebee/models/quote_line_group/responses.py create mode 100644 chargebee/models/quote_line_group/types.py create mode 100644 chargebee/models/quoted_charge/__init__.py create mode 100644 chargebee/models/quoted_charge/operations.py create mode 100644 chargebee/models/quoted_charge/responses.py create mode 100644 chargebee/models/quoted_charge/types.py create mode 100644 chargebee/models/quoted_subscription/__init__.py create mode 100644 chargebee/models/quoted_subscription/operations.py create mode 100644 chargebee/models/quoted_subscription/responses.py create mode 100644 chargebee/models/quoted_subscription/types.py create mode 100644 chargebee/models/ramp/__init__.py create mode 100644 chargebee/models/ramp/operations.py create mode 100644 chargebee/models/ramp/responses.py create mode 100644 chargebee/models/ramp/types.py create mode 100644 chargebee/models/resource_migration/__init__.py create mode 100644 chargebee/models/resource_migration/operations.py create mode 100644 chargebee/models/resource_migration/responses.py create mode 100644 chargebee/models/resource_migration/types.py create mode 100644 chargebee/models/site_migration_detail/__init__.py create mode 100644 chargebee/models/site_migration_detail/operations.py create mode 100644 chargebee/models/site_migration_detail/responses.py create mode 100644 chargebee/models/site_migration_detail/types.py create mode 100644 chargebee/models/subscription/__init__.py create mode 100644 chargebee/models/subscription/operations.py create mode 100644 chargebee/models/subscription/responses.py create mode 100644 chargebee/models/subscription/types.py create mode 100644 chargebee/models/subscription_entitlement/__init__.py create mode 100644 chargebee/models/subscription_entitlement/operations.py create mode 100644 chargebee/models/subscription_entitlement/responses.py create mode 100644 chargebee/models/subscription_entitlement/types.py create mode 100644 chargebee/models/subscription_estimate/__init__.py create mode 100644 chargebee/models/subscription_estimate/operations.py create mode 100644 chargebee/models/subscription_estimate/responses.py create mode 100644 chargebee/models/subscription_estimate/types.py create mode 100644 chargebee/models/tax_withheld/__init__.py create mode 100644 chargebee/models/tax_withheld/operations.py create mode 100644 chargebee/models/tax_withheld/responses.py create mode 100644 chargebee/models/tax_withheld/types.py create mode 100644 chargebee/models/third_party_payment_method/__init__.py create mode 100644 chargebee/models/third_party_payment_method/operations.py create mode 100644 chargebee/models/third_party_payment_method/responses.py create mode 100644 chargebee/models/third_party_payment_method/types.py create mode 100644 chargebee/models/time_machine/__init__.py create mode 100644 chargebee/models/time_machine/operations.py create mode 100644 chargebee/models/time_machine/responses.py create mode 100644 chargebee/models/time_machine/types.py create mode 100644 chargebee/models/token/__init__.py create mode 100644 chargebee/models/token/operations.py create mode 100644 chargebee/models/token/responses.py create mode 100644 chargebee/models/token/types.py create mode 100644 chargebee/models/transaction/__init__.py create mode 100644 chargebee/models/transaction/operations.py create mode 100644 chargebee/models/transaction/responses.py create mode 100644 chargebee/models/transaction/types.py create mode 100644 chargebee/models/unbilled_charge/__init__.py create mode 100644 chargebee/models/unbilled_charge/operations.py create mode 100644 chargebee/models/unbilled_charge/responses.py create mode 100644 chargebee/models/unbilled_charge/types.py create mode 100644 chargebee/models/usage/__init__.py create mode 100644 chargebee/models/usage/operations.py create mode 100644 chargebee/models/usage/responses.py create mode 100644 chargebee/models/usage/types.py create mode 100644 chargebee/models/virtual_bank_account/__init__.py create mode 100644 chargebee/models/virtual_bank_account/operations.py create mode 100644 chargebee/models/virtual_bank_account/responses.py create mode 100644 chargebee/models/virtual_bank_account/types.py create mode 100644 chargebee/request.py create mode 100644 chargebee/responses.py create mode 100644 chargebee/ssl/ca-certs.crt create mode 100644 chargebee/util.py create mode 100644 chargebee/version.py create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1dc644a --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +*.py[co] + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg + +.idea diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f22d7e3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2011-2024 ChargeBee, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..f5e82a6 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include chargebee/ssl/ca-certs.crt \ No newline at end of file diff --git a/chargebee/__init__.py b/chargebee/__init__.py new file mode 100644 index 0000000..60bf529 --- /dev/null +++ b/chargebee/__init__.py @@ -0,0 +1,26 @@ +from chargebee.api_error import ( + APIError, + PaymentError, + InvalidRequestError, + OperationFailedError, +) +from chargebee.models import * +from chargebee.filters import Filters +from chargebee.main import ChargeBee + + +def configure(api_key, site): + ChargeBee.configure( + { + "api_key": api_key, + "site": site, + } + ) + + +def update_connect_timeout_secs(connect_timeout): + ChargeBee.update_connect_timeout_secs(connect_timeout) + + +def update_read_timeout_secs(read_timeout): + ChargeBee.update_read_timeout_secs(read_timeout) diff --git a/chargebee/api_error.py b/chargebee/api_error.py new file mode 100644 index 0000000..be61c7e --- /dev/null +++ b/chargebee/api_error.py @@ -0,0 +1,28 @@ +class APIError(Exception): + + def __init__(self, http_code, json_obj): + Exception.__init__(self, json_obj.get("message")) + self.json_obj = json_obj + self.http_status_code = http_code + self.type = json_obj.get("type") + self.api_error_code = json_obj.get("api_error_code") + self.param = json_obj.get("param") + + self.error_code = json_obj["error_code"] + self.http_code = http_code + self.http_body = None + + +class PaymentError(APIError): + def __init__(self, http_code, json_obj): + APIError.__init__(self, http_code, json_obj) + + +class InvalidRequestError(APIError): + def __init__(self, http_code, json_obj): + APIError.__init__(self, http_code, json_obj) + + +class OperationFailedError(APIError): + def __init__(self, http_code, json_obj): + APIError.__init__(self, http_code, json_obj) diff --git a/chargebee/compat.py b/chargebee/compat.py new file mode 100644 index 0000000..f046dfb --- /dev/null +++ b/chargebee/compat.py @@ -0,0 +1,12 @@ +import sys + +try: + import simplejson as json +except ImportError: + import json + +py_major_v = sys.version_info[0] +py_minor_v = sys.version_info[1] + +if py_major_v >= 3: + from urllib.parse import urlencode, urlparse diff --git a/chargebee/environment.py b/chargebee/environment.py new file mode 100644 index 0000000..2786a94 --- /dev/null +++ b/chargebee/environment.py @@ -0,0 +1,26 @@ +class Environment(object): + + chargebee_domain = None + protocol = "https" + API_VERSION = "v2" + connect_timeout = 30 + read_timeout = 80 + + def __init__(self, options): + self.api_key = options["api_key"] + self.site = options["site"] + + if self.chargebee_domain is None: + self.api_endpoint = "https://%s.chargebee.com/api/%s" % ( + self.site, + self.API_VERSION, + ) + else: + self.api_endpoint = "http://%s.%s/api/%s" % ( + self.site, + self.chargebee_domain, + self.API_VERSION, + ) + + def api_url(self, url): + return self.api_endpoint + url diff --git a/chargebee/filters/__init__.py b/chargebee/filters/__init__.py new file mode 100644 index 0000000..db99f17 --- /dev/null +++ b/chargebee/filters/__init__.py @@ -0,0 +1 @@ +from .filters import Filters diff --git a/chargebee/filters/filters.py b/chargebee/filters/filters.py new file mode 100644 index 0000000..00e0bc8 --- /dev/null +++ b/chargebee/filters/filters.py @@ -0,0 +1,43 @@ +from typing import List, NotRequired, TypedDict + + +class Filters: + class StringFilter(TypedDict): + IS: NotRequired[str] + IS_NOT: NotRequired[str] + STARTS_WITH: NotRequired[str] + IN: NotRequired[List[str]] + NOT_IN: NotRequired[List[str]] + IS_PRESENT: NotRequired[bool] + + class BooleanFilter(TypedDict): + IS: NotRequired[bool] + IS_PRESENT: NotRequired[bool] + + class EnumFilter(TypedDict): + IS: NotRequired[str] + IS_NOT: NotRequired[str] + IS_PRESENT: NotRequired[bool] + IN: NotRequired[List[str]] + NOT_IN: NotRequired[List[str]] + + class NumberFilter(TypedDict): + IS: NotRequired[int] + IS_NOT: NotRequired[int] + LT: NotRequired[int] + LTE: NotRequired[int] + GT: NotRequired[int] + GTE: NotRequired[int] + BETWEEN: NotRequired[List[int]] + IS_PRESENT: NotRequired[bool] + + class SortFilter(TypedDict): + ASC: NotRequired[str] + DESC: NotRequired[str] + + class TimestampFilter(TypedDict): + AFTER: NotRequired[int] + BEFORE: NotRequired[int] + ON: NotRequired[int] + BETWEEN: NotRequired[List[int]] + IS_PRESENT: NotRequired[bool] diff --git a/chargebee/http_request.py b/chargebee/http_request.py new file mode 100644 index 0000000..747c1d7 --- /dev/null +++ b/chargebee/http_request.py @@ -0,0 +1,155 @@ +import base64 +import logging +import platform +import requests + +from chargebee import ( + APIError, + PaymentError, + InvalidRequestError, + OperationFailedError, + compat, +) +from chargebee.main import ChargeBee +from chargebee.main import Environment +from chargebee import compat +from chargebee.version import VERSION + +_logger = logging.getLogger(__name__) + + +def _basic_auth_str(username): + return "Basic " + base64.b64encode( + ("%s:" % username).encode("latin1") + ).strip().decode("latin1") + + +def request(method, url, env, params=None, headers=None): + if not env: + raise Exception("No environment configured.") + if headers is None: + headers = {} + + url = env.api_url(url) + if method.lower() in ("get", "head", "delete"): + url = "%s?%s" % (url, compat.urlencode(params)) + payload = None + else: + payload = compat.urlencode(params) + headers["Content-type"] = "application/x-www-form-urlencoded" + + headers.update( + { + "User-Agent": "ChargeBee-Python-Client v%s" % VERSION, + "Accept": "application/json", + "Authorization": _basic_auth_str(env.api_key), + "Lang-Version": str(compat.py_major_v) + "." + str(compat.py_minor_v), + "OS-Version": platform.platform(), + } + ) + + meta = compat.urlparse(url) + request_args = { + "method": method.upper(), + "timeout": (env.connect_timeout, env.read_timeout), + "data": payload, + "headers": headers, + } + + uri = meta.netloc + meta.path + "?" + meta.query + + if ChargeBee.verify_ca_certs: + request_args.update( + { + "verify": ChargeBee.ca_cert_path, + "url": "https://" + uri, + } + ) + else: + if Environment.protocol == "https": + request_args.update( + { + "url": "https://" + uri, + } + ) + else: + request_args.update( + { + "url": "http://" + uri, + } + ) + + _logger.debug("{method} Request: {url}".format(**request_args)) + _logger.debug( + "HEADERS: {0}".format( + {k: v for k, v in headers.items() if k.lower() != "authorization"} + ) + ) + if payload: + _logger.debug("PAYLOAD: {data}".format(**request_args)) + + response = requests.request(**request_args) + + if compat.py_major_v >= 3: + _logger.debug( + "{method} Response: {status_code} - {text}".format( + method=request_args["method"], + status_code=response.status_code, + text=response.text, + ) + ) + elif compat.py_major_v < 3: + _logger.debug( + "{method} Response: {status_code} - {text}".format( + method=request_args["method"], + status_code=response.status_code, + text=response.text.encode("utf 8"), + ) + ) + + return process_response(url, response.text, response.status_code, response.headers) + + +def process_response(url, response, http_code, response_headers): + try: + resp_json = compat.json.loads(response) + except Exception as ex: + if "503" in response: + raise Exception( + "Sorry, the server is currently unable to handle the request due to a temporary overload or scheduled maintenance. Please retry after sometime. \n type: internal_temporary_error, \n http_status_code: 503, \n error_code: internal_temporary_error,\n content:" + + response + ) + elif "504" in response: + raise Exception( + "The server did not receive a timely response from an upstream server, request aborted. If this problem persists, contact us at support@chargebee.com. \n type: gateway_timeout, \n http_status_code: 504, \n error_code: gateway_timeout,\n content:" + + response + ) + else: + raise Exception( + "Sorry, something went wrong when trying to process the request. If this problem persists, contact us at support@chargebee.com. \n type: internal_error, \n http_status_code: 500, \n error_code: internal_error,\n content:" + + response + ) + + if http_code < 200 or http_code > 299: + handle_api_resp_error(url, http_code, resp_json) + + return resp_json, response_headers + + +def handle_api_resp_error(url, http_code, resp_json): + if "api_error_code" not in resp_json: + raise Exception( + "The api_error_code is not present. Probably not a chargebee error. \n URL is " + + url + + "\nContent is \n " + + str(resp_json) + ) + + if "payment" == resp_json.get("type"): + raise PaymentError(http_code, resp_json) + elif "operation_failed" == resp_json.get("type"): + raise OperationFailedError(http_code, resp_json) + elif "invalid_request" == resp_json.get("type"): + raise InvalidRequestError(http_code, resp_json) + else: + raise APIError(http_code, resp_json) diff --git a/chargebee/main.py b/chargebee/main.py new file mode 100644 index 0000000..b9986e1 --- /dev/null +++ b/chargebee/main.py @@ -0,0 +1,23 @@ +import os.path + +from chargebee.environment import Environment + + +class ChargeBee(object): + + default_env = None + + verify_ca_certs = True + ca_cert_path = os.path.join(os.path.dirname(__file__), "ssl", "ca-certs.crt") + + @classmethod + def configure(cls, options): + cls.default_env = Environment(options) + + @classmethod + def update_connect_timeout_secs(cls, connect_timeout): + cls.default_env.connect_timeout = connect_timeout + + @classmethod + def update_read_timeout_secs(cls, read_timeout): + cls.default_env.read_timeout = read_timeout diff --git a/chargebee/model.py b/chargebee/model.py new file mode 100644 index 0000000..ea1f65a --- /dev/null +++ b/chargebee/model.py @@ -0,0 +1,34 @@ +from chargebee.compat import json + + +class Model(object): + + def __init__(self, values): + self.raw_data = values + + def __str__(self): + return json.dumps(self.raw_data, indent=4) + + def __getattr__(self, name): + raise AttributeError("Attribute %s not found " % name) + + def hydrate(self): + for k, v in list(self.raw_data.items()): + val = None + if isinstance(v, dict): + val = self.construct(v) + elif isinstance(v, (list, tuple)): + val = [ + self.construct(item) if isinstance(item, dict) else item + for item in v + ] + else: + val = v + + setattr(self, k, val) + + @classmethod + def construct(cls, values): + obj = cls(values) + obj.hydrate() + return obj diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py new file mode 100644 index 0000000..0e11645 --- /dev/null +++ b/chargebee/models/__init__.py @@ -0,0 +1,586 @@ +from chargebee.models.enums import ( + AccountHolderType, + AccountReceivablesHandling, + AccountType, + Action, + ApiVersion, + ApplyOn, + AutoCollection, + AvalaraSaleType, + BillingAlignmentMode, + BillingDateMode, + BillingDayOfWeekMode, + CancelOption, + ChangeOption, + Channel, + ChargeModel, + ChargeOnEvent, + ChargeOnOption, + ChargesHandling, + ContractTermCancelOption, + CreditOptionForCurrentTermCharges, + CreditType, + CustomerType, + DedupeOption, + DirectDebitScheme, + DispositionType, + DunningType, + DurationType, + EcheckType, + EinvoicingMethod, + EndScheduleOn, + EntityCode, + EntityType, + EventName, + EventType, + ExportType, + FreePeriodUnit, + FriendOfferType, + Gateway, + HierarchyOperationType, + InvoiceDunningHandling, + ItemType, + Layout, + NotifyReferralSystem, + OfflinePaymentMethod, + OnEvent, + Operation, + OperationType, + PauseOption, + PaymentInitiator, + PaymentMethod, + PaymentMethodType, + PaymentVoucherType, + PeriodUnit, + PriceType, + PricingModel, + ProrationType, + ReferralSystem, + ReferrerRewardType, + RefundableCreditsHandling, + ReportBy, + ResumeOption, + Role, + ScheduleType, + Source, + TaxExemptReason, + TaxJurisType, + TaxOverrideReason, + Taxability, + TaxjarExemptionCategory, + TrialEndAction, + Type, + UnbilledChargesHandling, + UnbilledChargesOption, + UnpaidInvoicesHandling, + UsageAccumulationResetFrequency, + ValidationStatus, + VoucherType, + ChargeOn, +) + +from chargebee.models.addon.operations import Addon +from chargebee.models.addon.types import ( + Addons, + Tier, + TaxProvidersField, + Type, + ChargeType, + PeriodUnit, + Status, + ShippingFrequencyPeriodUnit, + ProrationType, +) + +from chargebee.models.address.operations import Address +from chargebee.models.address.types import Addresses + +from chargebee.models.advance_invoice_schedule.operations import AdvanceInvoiceSchedule +from chargebee.models.advance_invoice_schedule.types import ( + AdvanceInvoiceSchedules, + FixedIntervalSchedule, + SpecificDatesSchedule, + ScheduleType, +) + +from chargebee.models.attached_item.operations import AttachedItem +from chargebee.models.attached_item.types import AttachedItems, Type, Status + +from chargebee.models.attribute.operations import Attribute +from chargebee.models.attribute.types import Attributes + +from chargebee.models.business_entity.operations import BusinessEntity +from chargebee.models.business_entity.types import BusinessEntities, Status + +from chargebee.models.business_entity_transfer.operations import BusinessEntityTransfer +from chargebee.models.business_entity_transfer.types import ( + BusinessEntityTransfers, + ResourceType, + ReasonCode, +) + +from chargebee.models.card.operations import Card +from chargebee.models.card.types import Cards, Status, CardType, FundingType, PoweredBy + +from chargebee.models.comment.operations import Comment +from chargebee.models.comment.types import Comments, Type + +from chargebee.models.contact.operations import Contact +from chargebee.models.contact.types import Contacts + +from chargebee.models.contract_term.operations import ContractTerm +from chargebee.models.contract_term.types import ContractTerms, Status, ActionAtTermEnd + +from chargebee.models.coupon.operations import Coupon +from chargebee.models.coupon.types import ( + Coupons, + ItemConstraint, + ItemConstraintCriteria, + CouponConstraint, + DiscountType, + DurationType, + Status, + ApplyDiscountOn, + ApplyOn, + AddonConstraint, + PlanConstraint, +) + +from chargebee.models.coupon_code.operations import CouponCode +from chargebee.models.coupon_code.types import CouponCodes, Status + +from chargebee.models.coupon_set.operations import CouponSet +from chargebee.models.coupon_set.types import CouponSets + +from chargebee.models.credit_note.operations import CreditNote +from chargebee.models.credit_note.types import ( + CreditNotes, + Einvoice, + LineItem, + Discount, + LineItemDiscount, + LineItemTier, + Tax, + LineItemTax, + LinkedRefund, + Allocation, + ShippingAddress, + BillingAddress, + SiteDetailsAtCreation, + TaxOrigin, + Type, + ReasonCode, + Status, +) + +from chargebee.models.credit_note_estimate.operations import CreditNoteEstimate +from chargebee.models.credit_note_estimate.types import ( + CreditNoteEstimates, + LineItem, + Discount, + Tax, + LineItemTax, + LineItemDiscount, + LineItemTier, + Type, +) + +from chargebee.models.currency.operations import Currency +from chargebee.models.currency.types import Currencies, ForexType + +from chargebee.models.customer.operations import Customer +from chargebee.models.customer.types import ( + Customers, + BillingAddress, + ReferralUrl, + Contact, + PaymentMethod, + Balance, + EntityIdentifier, + TaxProvidersField, + Relationship, + ParentAccountAccess, + ChildAccountAccess, + VatNumberStatus, + BillingDayOfWeek, + PiiCleared, + CardStatus, + FraudFlag, +) + +from chargebee.models.customer_entitlement.operations import CustomerEntitlement +from chargebee.models.customer_entitlement.types import CustomerEntitlements + +from chargebee.models.differential_price.operations import DifferentialPrice +from chargebee.models.differential_price.types import ( + DifferentialPrices, + Tier, + ParentPeriod, + Status, +) + +from chargebee.models.discount.operations import Discount +from chargebee.models.discount.types import Discounts, Type + +from chargebee.models.download.operations import Download +from chargebee.models.download.types import Downloads + +from chargebee.models.entitlement.operations import Entitlement +from chargebee.models.entitlement.types import Entitlements, EntityType + +from chargebee.models.entitlement_override.operations import EntitlementOverride +from chargebee.models.entitlement_override.types import ( + EntitlementOverrides, + ScheduleStatus, +) + +from chargebee.models.estimate.operations import Estimate +from chargebee.models.estimate.types import Estimates + +from chargebee.models.event.operations import Event +from chargebee.models.event.types import Events, Webhook, WebhookStatus + +from chargebee.models.export.operations import Export +from chargebee.models.export.types import Exports, Download, MimeType, Status + +from chargebee.models.feature.operations import Feature +from chargebee.models.feature.types import Features, Level, Status, Type + +from chargebee.models.gateway_error_detail.operations import GatewayErrorDetail +from chargebee.models.gateway_error_detail.types import GatewayErrorDetails + +from chargebee.models.gift.operations import Gift +from chargebee.models.gift.types import ( + Gifts, + Gifter, + GiftReceiver, + GiftTimeline, + Status, +) + +from chargebee.models.hierarchy.operations import Hierarchy +from chargebee.models.hierarchy.types import Hierarchies + +from chargebee.models.hosted_page.operations import HostedPage +from chargebee.models.hosted_page.types import HostedPages, Type, State, FailureReason + +from chargebee.models.impacted_item.operations import ImpactedItem +from chargebee.models.impacted_item.types import ImpactedItems, Download + +from chargebee.models.impacted_item_price.operations import ImpactedItemPrice +from chargebee.models.impacted_item_price.types import ImpactedItemPrices, Download + +from chargebee.models.impacted_subscription.operations import ImpactedSubscription +from chargebee.models.impacted_subscription.types import ImpactedSubscriptions, Download + +from chargebee.models.in_app_subscription.operations import InAppSubscription +from chargebee.models.in_app_subscription.types import InAppSubscriptions, StoreStatus + +from chargebee.models.installment.operations import Installment +from chargebee.models.installment.types import Installments, Status + +from chargebee.models.installment_config.operations import InstallmentConfig +from chargebee.models.installment_config.types import ( + InstallmentConfigs, + Installment, + PeriodUnit, +) + +from chargebee.models.installment_detail.operations import InstallmentDetail +from chargebee.models.installment_detail.types import InstallmentDetails, Installment + +from chargebee.models.invoice.operations import Invoice +from chargebee.models.invoice.types import ( + Invoices, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + LineItemTier, + LinkedPayment, + DunningAttempt, + AppliedCredit, + AdjustmentCreditNote, + IssuedCreditNote, + LinkedOrder, + Note, + ShippingAddress, + StatementDescriptor, + BillingAddress, + Einvoice, + SiteDetailsAtCreation, + TaxOrigin, + Status, + DunningStatus, +) + +from chargebee.models.invoice_estimate.operations import InvoiceEstimate +from chargebee.models.invoice_estimate.types import ( + InvoiceEstimates, + LineItem, + Discount, + Tax, + LineItemTax, + LineItemTier, + LineItemDiscount, +) + +from chargebee.models.item.operations import Item +from chargebee.models.item.types import ( + Items, + ApplicableItem, + Status, + Type, + ItemApplicability, + UsageCalculation, +) + +from chargebee.models.item_entitlement.operations import ItemEntitlement +from chargebee.models.item_entitlement.types import ItemEntitlements, ItemType + +from chargebee.models.item_family.operations import ItemFamily +from chargebee.models.item_family.types import ItemFamilies, Status + +from chargebee.models.item_price.operations import ItemPrice +from chargebee.models.item_price.types import ( + ItemPrices, + Tier, + TaxDetail, + TaxProvidersField, + AccountingDetail, + Status, + ProrationType, + PeriodUnit, + TrialPeriodUnit, + TrialEndAction, + ShippingPeriodUnit, +) + +from chargebee.models.metadata.operations import Metadata +from chargebee.models.metadata.types import Metadata + +from chargebee.models.order.operations import Order +from chargebee.models.order.types import ( + Orders, + OrderLineItem, + ShippingAddress, + BillingAddress, + LineItemTax, + LineItemDiscount, + LinkedCreditNote, + ResentOrder, + Status, + CancellationReason, + PaymentStatus, + OrderType, + ResentStatus, +) + +from chargebee.models.payment_intent.operations import PaymentIntent +from chargebee.models.payment_intent.types import ( + PaymentIntents, + PaymentAttempt, + Status, + PaymentMethodType, +) + +from chargebee.models.payment_reference_number.operations import PaymentReferenceNumber +from chargebee.models.payment_reference_number.types import ( + PaymentReferenceNumbers, + Type, +) + +from chargebee.models.payment_source.operations import PaymentSource +from chargebee.models.payment_source.types import ( + PaymentSources, + Card, + BankAccount, + CustVoucherSource, + BillingAddress, + AmazonPayment, + Upi, + Paypal, + Venmo, + KlarnaPayNow, + Mandate, + Status, +) + +from chargebee.models.payment_voucher.operations import PaymentVoucher +from chargebee.models.payment_voucher.types import ( + PaymentVouchers, + LinkedInvoice, + Status, +) + +from chargebee.models.plan.operations import Plan +from chargebee.models.plan.types import ( + Plans, + Tier, + TaxProvidersField, + ApplicableAddon, + AttachedAddon, + EventBasedAddon, + PeriodUnit, + TrialPeriodUnit, + TrialEndAction, + ChargeModel, + Status, + AddonApplicability, + ShippingFrequencyPeriodUnit, +) + +from chargebee.models.portal_session.operations import PortalSession +from chargebee.models.portal_session.types import PortalSessions, LinkedCustomer, Status + +from chargebee.models.price_variant.operations import PriceVariant +from chargebee.models.price_variant.types import PriceVariants, Attribute, Status + +from chargebee.models.pricing_page_session.operations import PricingPageSession +from chargebee.models.pricing_page_session.types import PricingPageSessions + +from chargebee.models.promotional_credit.operations import PromotionalCredit +from chargebee.models.promotional_credit.types import PromotionalCredits, Type + +from chargebee.models.purchase.operations import Purchase +from chargebee.models.purchase.types import Purchases + +from chargebee.models.quote.operations import Quote +from chargebee.models.quote.types import ( + Quotes, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + LineItemTier, + ShippingAddress, + BillingAddress, + Status, + OperationType, +) + +from chargebee.models.quote_line_group.operations import QuoteLineGroup +from chargebee.models.quote_line_group.types import ( + QuoteLineGroups, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + ChargeEvent, +) + +from chargebee.models.quoted_charge.operations import QuotedCharge +from chargebee.models.quoted_charge.types import ( + QuotedCharges, + Charge, + Addon, + InvoiceItem, + ItemTier, + Coupon, +) + +from chargebee.models.quoted_subscription.operations import QuotedSubscription +from chargebee.models.quoted_subscription.types import ( + QuotedSubscriptions, + Addon, + EventBasedAddon, + Coupon, + SubscriptionItem, + ItemTier, + QuotedContractTerm, + ChangeOption, + BillingPeriodUnit, +) + +from chargebee.models.ramp.operations import Ramp +from chargebee.models.ramp.types import ( + Ramps, + ItemsToAdd, + ItemsToUpdate, + CouponsToAdd, + DiscountsToAdd, + ItemTier, + StatusTransitionReason, + Status, +) + +from chargebee.models.resource_migration.operations import ResourceMigration +from chargebee.models.resource_migration.types import ResourceMigrations, Status + +from chargebee.models.site_migration_detail.operations import SiteMigrationDetail +from chargebee.models.site_migration_detail.types import SiteMigrationDetails, Status + +from chargebee.models.subscription.operations import Subscription +from chargebee.models.subscription.types import ( + Subscriptions, + SubscriptionItem, + ItemTier, + ChargedItem, + Addon, + EventBasedAddon, + ChargedEventBasedAddon, + Coupon, + ShippingAddress, + ReferralInfo, + ContractTerm, + Discount, + Status, + CancelReason, + BillingPeriodUnit, +) + +from chargebee.models.subscription_entitlement.operations import SubscriptionEntitlement +from chargebee.models.subscription_entitlement.types import ( + SubscriptionEntitlements, + Component, + ScheduleStatus, +) + +from chargebee.models.subscription_estimate.operations import SubscriptionEstimate +from chargebee.models.subscription_estimate.types import ( + SubscriptionEstimates, + ShippingAddress, + ContractTerm, + Status, +) + +from chargebee.models.tax_withheld.operations import TaxWithheld +from chargebee.models.tax_withheld.types import TaxWithhelds, Type, PaymentMethod + +from chargebee.models.third_party_payment_method.operations import ( + ThirdPartyPaymentMethod, +) +from chargebee.models.third_party_payment_method.types import ThirdPartyPaymentMethods + +from chargebee.models.time_machine.operations import TimeMachine +from chargebee.models.time_machine.types import TimeMachines, TimeTravelStatus + +from chargebee.models.token.operations import Token +from chargebee.models.token.types import Tokens, Status, Vault + +from chargebee.models.transaction.operations import Transaction +from chargebee.models.transaction.types import ( + Transactions, + LinkedInvoice, + LinkedCreditNote, + LinkedRefund, + LinkedPayment, + GatewayErrorDetail, + Type, + Status, + FraudFlag, + InitiatorType, + AuthorizationReason, +) + +from chargebee.models.unbilled_charge.operations import UnbilledCharge +from chargebee.models.unbilled_charge.types import UnbilledCharges, Tier, EntityType + +from chargebee.models.usage.operations import Usage +from chargebee.models.usage.types import Usages + +from chargebee.models.virtual_bank_account.operations import VirtualBankAccount +from chargebee.models.virtual_bank_account.types import VirtualBankAccounts, Scheme diff --git a/chargebee/models/addon/__init__.py b/chargebee/models/addon/__init__.py new file mode 100644 index 0000000..05c9bd8 --- /dev/null +++ b/chargebee/models/addon/__init__.py @@ -0,0 +1,13 @@ +from .operations import Addon +from .responses import AddonResponse +from .types import ( + Addons, + Tier, + TaxProvidersField, + Type, + ChargeType, + PeriodUnit, + Status, + ShippingFrequencyPeriodUnit, + ProrationType, +) diff --git a/chargebee/models/addon/operations.py b/chargebee/models/addon/operations.py new file mode 100644 index 0000000..dbf7b4d --- /dev/null +++ b/chargebee/models/addon/operations.py @@ -0,0 +1,185 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Addon: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + charge_type: Required[ChargeType] + price: NotRequired[int] + tiers: NotRequired[List[CreateTierParams]] + currency_code: NotRequired[str] + period: NotRequired[int] + period_unit: NotRequired[PeriodUnit] + pricing_model: NotRequired[enums.PricingModel] + type: NotRequired[Type] + unit: NotRequired[str] + enabled_in_portal: NotRequired[bool] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + included_in_mrr: NotRequired[bool] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + price_in_decimal: NotRequired[str] + tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] + proration_type: NotRequired[ProrationType] + status: NotRequired[Status] + + class UpdateParams(TypedDict): + name: NotRequired[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + charge_type: NotRequired[ChargeType] + price: NotRequired[int] + tiers: NotRequired[List[UpdateTierParams]] + currency_code: NotRequired[str] + period: NotRequired[int] + period_unit: NotRequired[PeriodUnit] + pricing_model: NotRequired[enums.PricingModel] + type: NotRequired[Type] + unit: NotRequired[str] + enabled_in_portal: NotRequired[bool] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + included_in_mrr: NotRequired[bool] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + price_in_decimal: NotRequired[str] + tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] + proration_type: NotRequired[ProrationType] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + pricing_model: NotRequired[Filters.EnumFilter] + type: NotRequired[Filters.EnumFilter] + charge_type: NotRequired[Filters.EnumFilter] + price: NotRequired[Filters.NumberFilter] + period: NotRequired[Filters.NumberFilter] + period_unit: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + currency_code: NotRequired[Filters.StringFilter] + channel: NotRequired[Filters.EnumFilter] + include_deleted: NotRequired[bool] + + class CopyParams(TypedDict): + from_site: Required[str] + id_at_from_site: Required[str] + id: NotRequired[str] + for_site_merging: NotRequired[bool] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("addons"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("addons", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("addons"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("addons", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("addons", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + return request.send( + "post", + request.uri_path("addons", "copy"), + cast(Dict[Any, Any], params), + env, + headers, + CopyResponse, + ) + + @staticmethod + def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + return request.send( + "post", + request.uri_path("addons", id, "unarchive"), + None, + env, + headers, + UnarchiveResponse, + ) diff --git a/chargebee/models/addon/responses.py b/chargebee/models/addon/responses.py new file mode 100644 index 0000000..e991447 --- /dev/null +++ b/chargebee/models/addon/responses.py @@ -0,0 +1,117 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TierResponse(Model): + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + + +@dataclass +class TaxProvidersFieldResponse(Model): + provider_name: str = None + field_id: str = None + field_value: str = None + + +@dataclass +class AddonResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + invoice_name: str = None + description: str = None + pricing_model: str = None + type: str = None + charge_type: str = None + price: int = None + currency_code: str = None + period: int = None + period_unit: str = None + unit: str = None + status: str = None + archived_at: int = None + enabled_in_portal: bool = None + tax_code: str = None + hsn_code: str = None + taxjar_product_code: str = None + avalara_sale_type: str = None + avalara_transaction_type: int = None + avalara_service_type: int = None + sku: str = None + accounting_code: str = None + accounting_category1: str = None + accounting_category2: str = None + accounting_category3: str = None + accounting_category4: str = None + is_shippable: bool = None + shipping_frequency_period: int = None + shipping_frequency_period_unit: str = None + resource_version: int = None + updated_at: int = None + price_in_decimal: str = None + included_in_mrr: bool = None + channel: str = None + proration_type: str = None + invoice_notes: str = None + taxable: bool = None + tax_profile_id: str = None + meta_data: Dict[Any, Any] = None + tiers: List[TierResponse] = None + tax_providers_fields: List[TaxProvidersFieldResponse] = None + show_description_in_invoices: bool = None + show_description_in_quotes: bool = None + + +@dataclass +class CreateResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListAddonResponse: + addon: AddonResponse + + +@dataclass +class ListResponse: + list: List[ListAddonResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CopyResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UnarchiveResponse: + addon: AddonResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/addon/types.py b/chargebee/models/addon/types.py new file mode 100644 index 0000000..14e717c --- /dev/null +++ b/chargebee/models/addon/types.py @@ -0,0 +1,153 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + ON_OFF = "on_off" + QUANTITY = "quantity" + TIERED = "tiered" + VOLUME = "volume" + STAIRSTEP = "stairstep" + + def __str__(self): + return self.value + + +class ChargeType(Enum): + RECURRING = "recurring" + NON_RECURRING = "non_recurring" + + def __str__(self): + return self.value + + +class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class ShippingFrequencyPeriodUnit(Enum): + YEAR = "year" + MONTH = "month" + WEEK = "week" + DAY = "day" + + def __str__(self): + return self.value + + +class ProrationType(Enum): + SITE_DEFAULT = "site_default" + PARTIAL_TERM = "partial_term" + FULL_TERM = "full_term" + + def __str__(self): + return self.value + + +class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class Addons(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + pricing_model: Required[enums.PricingModel] + type: Required[Type] + charge_type: Required[ChargeType] + price: NotRequired[int] + currency_code: Required[str] + period: NotRequired[int] + period_unit: Required[PeriodUnit] + unit: NotRequired[str] + status: Required[Status] + archived_at: NotRequired[int] + enabled_in_portal: Required[bool] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + price_in_decimal: NotRequired[str] + included_in_mrr: NotRequired[bool] + channel: NotRequired[enums.Channel] + proration_type: NotRequired[ProrationType] + invoice_notes: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + tiers: NotRequired[List[Tier]] + tax_providers_fields: NotRequired[List[TaxProvidersField]] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + + +class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] diff --git a/chargebee/models/address/__init__.py b/chargebee/models/address/__init__.py new file mode 100644 index 0000000..e7273a0 --- /dev/null +++ b/chargebee/models/address/__init__.py @@ -0,0 +1,3 @@ +from .operations import Address +from .responses import AddressResponse +from .types import Addresses diff --git a/chargebee/models/address/operations.py b/chargebee/models/address/operations.py new file mode 100644 index 0000000..1978a6c --- /dev/null +++ b/chargebee/models/address/operations.py @@ -0,0 +1,51 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Address: + + class RetrieveParams(TypedDict): + subscription_id: Required[str] + label: Required[str] + + class UpdateParams(TypedDict): + subscription_id: Required[str] + label: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + addr: NotRequired[str] + extended_addr: NotRequired[str] + extended_addr2: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + @staticmethod + def retrieve(params: RetrieveParams, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("addresses"), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update(params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("addresses"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) diff --git a/chargebee/models/address/responses.py b/chargebee/models/address/responses.py new file mode 100644 index 0000000..f157219 --- /dev/null +++ b/chargebee/models/address/responses.py @@ -0,0 +1,36 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class AddressResponse(Model): + raw_data: Dict[Any, Any] = None + label: str = None + first_name: str = None + last_name: str = None + email: str = None + company: str = None + phone: str = None + addr: str = None + extended_addr: str = None + extended_addr2: str = None + city: str = None + state_code: str = None + state: str = None + country: str = None + zip: str = None + validation_status: str = None + subscription_id: str = None + + +@dataclass +class RetrieveResponse: + address: AddressResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + address: AddressResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/address/types.py b/chargebee/models/address/types.py new file mode 100644 index 0000000..b98a814 --- /dev/null +++ b/chargebee/models/address/types.py @@ -0,0 +1,21 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums + + +class Addresses(TypedDict): + label: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + addr: NotRequired[str] + extended_addr: NotRequired[str] + extended_addr2: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + subscription_id: Required[str] diff --git a/chargebee/models/advance_invoice_schedule/__init__.py b/chargebee/models/advance_invoice_schedule/__init__.py new file mode 100644 index 0000000..6b1bd22 --- /dev/null +++ b/chargebee/models/advance_invoice_schedule/__init__.py @@ -0,0 +1,8 @@ +from .operations import AdvanceInvoiceSchedule +from .responses import AdvanceInvoiceScheduleResponse +from .types import ( + AdvanceInvoiceSchedules, + FixedIntervalSchedule, + SpecificDatesSchedule, + ScheduleType, +) diff --git a/chargebee/models/advance_invoice_schedule/operations.py b/chargebee/models/advance_invoice_schedule/operations.py new file mode 100644 index 0000000..3b589e9 --- /dev/null +++ b/chargebee/models/advance_invoice_schedule/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class AdvanceInvoiceSchedule: + + pass diff --git a/chargebee/models/advance_invoice_schedule/responses.py b/chargebee/models/advance_invoice_schedule/responses.py new file mode 100644 index 0000000..e1e5918 --- /dev/null +++ b/chargebee/models/advance_invoice_schedule/responses.py @@ -0,0 +1,29 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class FixedIntervalScheduleResponse(Model): + end_schedule_on: str = None + number_of_occurrences: int = None + days_before_renewal: int = None + end_date: int = None + created_at: int = None + terms_to_charge: int = None + + +@dataclass +class SpecificDatesScheduleResponse(Model): + terms_to_charge: int = None + date: int = None + created_at: int = None + + +@dataclass +class AdvanceInvoiceScheduleResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + schedule_type: str = None + fixed_interval_schedule: FixedIntervalScheduleResponse = None + specific_dates_schedule: SpecificDatesScheduleResponse = None diff --git a/chargebee/models/advance_invoice_schedule/types.py b/chargebee/models/advance_invoice_schedule/types.py new file mode 100644 index 0000000..de3c2d1 --- /dev/null +++ b/chargebee/models/advance_invoice_schedule/types.py @@ -0,0 +1,33 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class ScheduleType(Enum): + FIXED_INTERVALS = "fixed_intervals" + SPECIFIC_DATES = "specific_dates" + + def __str__(self): + return self.value + + +class FixedIntervalSchedule(TypedDict): + end_schedule_on: NotRequired[enums.EndScheduleOn] + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_date: NotRequired[int] + created_at: Required[int] + terms_to_charge: NotRequired[int] + + +class SpecificDatesSchedule(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + created_at: Required[int] + + +class AdvanceInvoiceSchedules(TypedDict): + id: Required[str] + schedule_type: NotRequired[ScheduleType] + fixed_interval_schedule: NotRequired[FixedIntervalSchedule] + specific_dates_schedule: NotRequired[SpecificDatesSchedule] diff --git a/chargebee/models/attached_item/__init__.py b/chargebee/models/attached_item/__init__.py new file mode 100644 index 0000000..09bf50a --- /dev/null +++ b/chargebee/models/attached_item/__init__.py @@ -0,0 +1,3 @@ +from .operations import AttachedItem +from .responses import AttachedItemResponse +from .types import AttachedItems, Type, Status diff --git a/chargebee/models/attached_item/operations.py b/chargebee/models/attached_item/operations.py new file mode 100644 index 0000000..ddbd58e --- /dev/null +++ b/chargebee/models/attached_item/operations.py @@ -0,0 +1,99 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class AttachedItem: + + class CreateParams(TypedDict): + item_id: Required[str] + type: NotRequired[Type] + billing_cycles: NotRequired[int] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + + class UpdateParams(TypedDict): + parent_item_id: Required[str] + type: NotRequired[Type] + billing_cycles: NotRequired[int] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + + class RetrieveParams(TypedDict): + parent_item_id: Required[str] + + class DeleteParams(TypedDict): + parent_item_id: Required[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + item_type: NotRequired[Filters.EnumFilter] + charge_on_event: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + @staticmethod + def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("items", id, "attached_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("attached_items", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def retrieve( + id, params: RetrieveParams, env=None, headers=None + ) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("attached_items", id), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("attached_items", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(id, params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("items", id, "attached_items"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/attached_item/responses.py b/chargebee/models/attached_item/responses.py new file mode 100644 index 0000000..b88b3db --- /dev/null +++ b/chargebee/models/attached_item/responses.py @@ -0,0 +1,58 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class AttachedItemResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + parent_item_id: str = None + item_id: str = None + type: str = None + status: str = None + quantity: int = None + quantity_in_decimal: str = None + billing_cycles: int = None + charge_on_event: str = None + charge_once: bool = None + created_at: int = None + resource_version: int = None + updated_at: int = None + channel: str = None + + +@dataclass +class CreateResponse: + attached_item: AttachedItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + attached_item: AttachedItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + attached_item: AttachedItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + attached_item: AttachedItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListAttachedItemResponse: + attached_item: AttachedItemResponse + + +@dataclass +class ListResponse: + list: List[ListAttachedItemResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/attached_item/types.py b/chargebee/models/attached_item/types.py new file mode 100644 index 0000000..0642a3d --- /dev/null +++ b/chargebee/models/attached_item/types.py @@ -0,0 +1,38 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + RECOMMENDED = "recommended" + MANDATORY = "mandatory" + OPTIONAL = "optional" + + def __str__(self): + return self.value + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class AttachedItems(TypedDict): + id: Required[str] + parent_item_id: Required[str] + item_id: Required[str] + type: Required[Type] + status: NotRequired[Status] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + charge_on_event: Required[enums.ChargeOnEvent] + charge_once: Required[bool] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + channel: NotRequired[enums.Channel] diff --git a/chargebee/models/attribute/__init__.py b/chargebee/models/attribute/__init__.py new file mode 100644 index 0000000..3139f39 --- /dev/null +++ b/chargebee/models/attribute/__init__.py @@ -0,0 +1,3 @@ +from .operations import Attribute +from .responses import AttributeResponse +from .types import Attributes diff --git a/chargebee/models/attribute/operations.py b/chargebee/models/attribute/operations.py new file mode 100644 index 0000000..df99085 --- /dev/null +++ b/chargebee/models/attribute/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Attribute: + + pass diff --git a/chargebee/models/attribute/responses.py b/chargebee/models/attribute/responses.py new file mode 100644 index 0000000..3fdc7f5 --- /dev/null +++ b/chargebee/models/attribute/responses.py @@ -0,0 +1,10 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class AttributeResponse(Model): + raw_data: Dict[Any, Any] = None + name: str = None + value: str = None diff --git a/chargebee/models/attribute/types.py b/chargebee/models/attribute/types.py new file mode 100644 index 0000000..98bc980 --- /dev/null +++ b/chargebee/models/attribute/types.py @@ -0,0 +1,6 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Attributes(TypedDict): + name: Required[str] + value: Required[str] diff --git a/chargebee/models/business_entity/__init__.py b/chargebee/models/business_entity/__init__.py new file mode 100644 index 0000000..47afccc --- /dev/null +++ b/chargebee/models/business_entity/__init__.py @@ -0,0 +1,3 @@ +from .operations import BusinessEntity +from .responses import BusinessEntityResponse +from .types import BusinessEntities, Status diff --git a/chargebee/models/business_entity/operations.py b/chargebee/models/business_entity/operations.py new file mode 100644 index 0000000..cd74ca6 --- /dev/null +++ b/chargebee/models/business_entity/operations.py @@ -0,0 +1,50 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class BusinessEntity: + + class CreateTransfersParams(TypedDict): + active_resource_ids: Required[List[str]] + destination_business_entity_ids: Required[List[str]] + source_business_entity_ids: NotRequired[List[str]] + resource_types: Required[List[str]] + reason_codes: Required[List[str]] + + class GetTransfersParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + resource_type: NotRequired[Filters.StringFilter] + resource_id: NotRequired[Filters.StringFilter] + active_resource_id: NotRequired[Filters.StringFilter] + created_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create_transfers( + params: CreateTransfersParams, env=None, headers=None + ) -> CreateTransfersResponse: + return request.send( + "post", + request.uri_path("business_entities", "transfers"), + cast(Dict[Any, Any], params), + env, + headers, + CreateTransfersResponse, + ) + + @staticmethod + def get_transfers( + params: GetTransfersParams = None, env=None, headers=None + ) -> GetTransfersResponse: + return request.send( + "get", + request.uri_path("business_entities", "transfers"), + cast(Dict[Any, Any], params), + env, + headers, + GetTransfersResponse, + ) diff --git a/chargebee/models/business_entity/responses.py b/chargebee/models/business_entity/responses.py new file mode 100644 index 0000000..e6f0547 --- /dev/null +++ b/chargebee/models/business_entity/responses.py @@ -0,0 +1,34 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import business_entity_transfer + + +@dataclass +class BusinessEntityResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + status: str = None + deleted: bool = None + created_at: int = None + resource_version: int = None + updated_at: int = None + + +@dataclass +class CreateTransfersResponse: + business_entity_transfer: "business_entity_transfer.BusinessEntityTransferResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class GetTransfersBusinessEntityResponse: + business_entity_transfer: "business_entity_transfer.BusinessEntityTransferResponse" + + +@dataclass +class GetTransfersResponse: + list: List[GetTransfersBusinessEntityResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/business_entity/types.py b/chargebee/models/business_entity/types.py new file mode 100644 index 0000000..589598e --- /dev/null +++ b/chargebee/models/business_entity/types.py @@ -0,0 +1,20 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + ACTIVE = "active" + INACTIVE = "inactive" + + def __str__(self): + return self.value + + +class BusinessEntities(TypedDict): + id: Required[str] + name: Required[str] + status: Required[Status] + deleted: Required[bool] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] diff --git a/chargebee/models/business_entity_transfer/__init__.py b/chargebee/models/business_entity_transfer/__init__.py new file mode 100644 index 0000000..19ecdc1 --- /dev/null +++ b/chargebee/models/business_entity_transfer/__init__.py @@ -0,0 +1,3 @@ +from .operations import BusinessEntityTransfer +from .responses import BusinessEntityTransferResponse +from .types import BusinessEntityTransfers, ResourceType, ReasonCode diff --git a/chargebee/models/business_entity_transfer/operations.py b/chargebee/models/business_entity_transfer/operations.py new file mode 100644 index 0000000..272fbfc --- /dev/null +++ b/chargebee/models/business_entity_transfer/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class BusinessEntityTransfer: + + pass diff --git a/chargebee/models/business_entity_transfer/responses.py b/chargebee/models/business_entity_transfer/responses.py new file mode 100644 index 0000000..4ae8fd0 --- /dev/null +++ b/chargebee/models/business_entity_transfer/responses.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class BusinessEntityTransferResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + resource_type: str = None + resource_id: str = None + active_resource_id: str = None + destination_business_entity_id: str = None + source_business_entity_id: str = None + reason_code: str = None + created_at: int = None diff --git a/chargebee/models/business_entity_transfer/types.py b/chargebee/models/business_entity_transfer/types.py new file mode 100644 index 0000000..9a3c812 --- /dev/null +++ b/chargebee/models/business_entity_transfer/types.py @@ -0,0 +1,28 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class ResourceType(Enum): + CUSTOMER = "customer" + SUBSCRIPTION = "subscription" + + def __str__(self): + return self.value + + +class ReasonCode(Enum): + CORRECTION = "correction" + + def __str__(self): + return self.value + + +class BusinessEntityTransfers(TypedDict): + id: Required[str] + resource_type: Required[ResourceType] + resource_id: Required[str] + active_resource_id: Required[str] + destination_business_entity_id: Required[str] + source_business_entity_id: Required[str] + reason_code: Required[ReasonCode] + created_at: Required[int] diff --git a/chargebee/models/card/__init__.py b/chargebee/models/card/__init__.py new file mode 100644 index 0000000..231d570 --- /dev/null +++ b/chargebee/models/card/__init__.py @@ -0,0 +1,3 @@ +from .operations import Card +from .responses import CardResponse +from .types import Cards, Status, CardType, FundingType, PoweredBy diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py new file mode 100644 index 0000000..479b242 --- /dev/null +++ b/chargebee/models/card/operations.py @@ -0,0 +1,92 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Card: + + class UpdateCardForCustomerParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: Required[str] + expiry_month: Required[int] + expiry_year: Required[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + customer: NotRequired[UpdateCardForCustomerCustomerParams] + + class SwitchGatewayForCustomerParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: Required[str] + + class CopyCardForCustomerParams(TypedDict): + gateway_account_id: Required[str] + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("cards", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def update_card_for_customer( + id, params: UpdateCardForCustomerParams, env=None, headers=None + ) -> UpdateCardForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "credit_card"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateCardForCustomerResponse, + ) + + @staticmethod + def switch_gateway_for_customer( + id, params: SwitchGatewayForCustomerParams, env=None, headers=None + ) -> SwitchGatewayForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "switch_gateway"), + cast(Dict[Any, Any], params), + env, + headers, + SwitchGatewayForCustomerResponse, + ) + + @staticmethod + def copy_card_for_customer( + id, params: CopyCardForCustomerParams, env=None, headers=None + ) -> CopyCardForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "copy_card"), + cast(Dict[Any, Any], params), + env, + headers, + CopyCardForCustomerResponse, + ) + + @staticmethod + def delete_card_for_customer( + id, env=None, headers=None + ) -> DeleteCardForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "delete_card"), + None, + env, + headers, + DeleteCardForCustomerResponse, + ) diff --git a/chargebee/models/card/responses.py b/chargebee/models/card/responses.py new file mode 100644 index 0000000..cef478e --- /dev/null +++ b/chargebee/models/card/responses.py @@ -0,0 +1,71 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import third_party_payment_method, customer + + +@dataclass +class CardResponse(Model): + raw_data: Dict[Any, Any] = None + payment_source_id: str = None + status: str = None + gateway: str = None + gateway_account_id: str = None + ref_tx_id: str = None + first_name: str = None + last_name: str = None + iin: str = None + last4: str = None + card_type: str = None + funding_type: str = None + expiry_month: int = None + expiry_year: int = None + issuing_country: str = None + billing_addr1: str = None + billing_addr2: str = None + billing_city: str = None + billing_state_code: str = None + billing_state: str = None + billing_country: str = None + billing_zip: str = None + created_at: int = None + resource_version: int = None + updated_at: int = None + ip_address: str = None + powered_by: str = None + customer_id: str = None + masked_number: str = None + + +@dataclass +class RetrieveResponse: + card: CardResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateCardForCustomerResponse: + customer: "customer.CustomerResponse" + card: CardResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SwitchGatewayForCustomerResponse: + customer: "customer.CustomerResponse" + card: CardResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CopyCardForCustomerResponse: + third_party_payment_method: ( + "third_party_payment_method.ThirdPartyPaymentMethodResponse" + ) + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteCardForCustomerResponse: + customer: "customer.CustomerResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/card/types.py b/chargebee/models/card/types.py new file mode 100644 index 0000000..0dff5d6 --- /dev/null +++ b/chargebee/models/card/types.py @@ -0,0 +1,97 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + + def __str__(self): + return self.value + + +class CardType(Enum): + VISA = "visa" + MASTERCARD = "mastercard" + AMERICAN_EXPRESS = "american_express" + DISCOVER = "discover" + JCB = "jcb" + DINERS_CLUB = "diners_club" + BANCONTACT = "bancontact" + CMR_FALABELLA = "cmr_falabella" + TARJETA_NARANJA = "tarjeta_naranja" + NATIVA = "nativa" + CENCOSUD = "cencosud" + CABAL = "cabal" + ARGENCARD = "argencard" + ELO = "elo" + HIPERCARD = "hipercard" + CARNET = "carnet" + RUPAY = "rupay" + MAESTRO = "maestro" + OTHER = "other" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class FundingType(Enum): + CREDIT = "credit" + DEBIT = "debit" + PREPAID = "prepaid" + NOT_KNOWN = "not_known" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class PoweredBy(Enum): + IDEAL = "ideal" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GIROPAY = "giropay" + CARD = "card" + LATAM_LOCAL_CARD = "latam_local_card" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class Cards(TypedDict): + payment_source_id: Required[str] + status: Required[Status] + gateway: Required[enums.Gateway] + gateway_account_id: NotRequired[str] + ref_tx_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + iin: Required[str] + last4: Required[str] + card_type: NotRequired[CardType] + funding_type: Required[FundingType] + expiry_month: Required[int] + expiry_year: Required[int] + issuing_country: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_country: NotRequired[str] + billing_zip: NotRequired[str] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + ip_address: NotRequired[str] + powered_by: NotRequired[PoweredBy] + customer_id: Required[str] + masked_number: NotRequired[str] + + +class UpdateCardForCustomerCustomerParams(TypedDict): + vat_number: NotRequired[str] diff --git a/chargebee/models/comment/__init__.py b/chargebee/models/comment/__init__.py new file mode 100644 index 0000000..8f72b7b --- /dev/null +++ b/chargebee/models/comment/__init__.py @@ -0,0 +1,3 @@ +from .operations import Comment +from .responses import CommentResponse +from .types import Comments, Type diff --git a/chargebee/models/comment/operations.py b/chargebee/models/comment/operations.py new file mode 100644 index 0000000..764422a --- /dev/null +++ b/chargebee/models/comment/operations.py @@ -0,0 +1,66 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Comment: + + class CreateParams(TypedDict): + entity_type: Required[enums.EntityType] + entity_id: Required[str] + notes: Required[str] + added_by: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + created_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("comments"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("comments", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("comments"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("comments", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) diff --git a/chargebee/models/comment/responses.py b/chargebee/models/comment/responses.py new file mode 100644 index 0000000..a487160 --- /dev/null +++ b/chargebee/models/comment/responses.py @@ -0,0 +1,45 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CommentResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + entity_type: str = None + added_by: str = None + notes: str = None + created_at: int = None + type: str = None + entity_id: str = None + + +@dataclass +class CreateResponse: + comment: CommentResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + comment: CommentResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCommentResponse: + comment: CommentResponse + + +@dataclass +class ListResponse: + list: List[ListCommentResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + comment: CommentResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/comment/types.py b/chargebee/models/comment/types.py new file mode 100644 index 0000000..c80bb86 --- /dev/null +++ b/chargebee/models/comment/types.py @@ -0,0 +1,21 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + USER = "user" + SYSTEM = "system" + + def __str__(self): + return self.value + + +class Comments(TypedDict): + id: Required[str] + entity_type: Required[enums.EntityType] + added_by: NotRequired[str] + notes: Required[str] + created_at: Required[int] + type: Required[Type] + entity_id: Required[str] diff --git a/chargebee/models/contact/__init__.py b/chargebee/models/contact/__init__.py new file mode 100644 index 0000000..dc53e05 --- /dev/null +++ b/chargebee/models/contact/__init__.py @@ -0,0 +1,3 @@ +from .operations import Contact +from .responses import ContactResponse +from .types import Contacts diff --git a/chargebee/models/contact/operations.py b/chargebee/models/contact/operations.py new file mode 100644 index 0000000..c113e4e --- /dev/null +++ b/chargebee/models/contact/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Contact: + + pass diff --git a/chargebee/models/contact/responses.py b/chargebee/models/contact/responses.py new file mode 100644 index 0000000..75b997e --- /dev/null +++ b/chargebee/models/contact/responses.py @@ -0,0 +1,17 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ContactResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + first_name: str = None + last_name: str = None + email: str = None + phone: str = None + label: str = None + enabled: bool = None + send_account_email: bool = None + send_billing_email: bool = None diff --git a/chargebee/models/contact/types.py b/chargebee/models/contact/types.py new file mode 100644 index 0000000..03404bc --- /dev/null +++ b/chargebee/models/contact/types.py @@ -0,0 +1,13 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Contacts(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: Required[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: Required[bool] + send_account_email: Required[bool] + send_billing_email: Required[bool] diff --git a/chargebee/models/contract_term/__init__.py b/chargebee/models/contract_term/__init__.py new file mode 100644 index 0000000..58269c5 --- /dev/null +++ b/chargebee/models/contract_term/__init__.py @@ -0,0 +1,3 @@ +from .operations import ContractTerm +from .responses import ContractTermResponse +from .types import ContractTerms, Status, ActionAtTermEnd diff --git a/chargebee/models/contract_term/operations.py b/chargebee/models/contract_term/operations.py new file mode 100644 index 0000000..e2800b9 --- /dev/null +++ b/chargebee/models/contract_term/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ContractTerm: + + pass diff --git a/chargebee/models/contract_term/responses.py b/chargebee/models/contract_term/responses.py new file mode 100644 index 0000000..37063da --- /dev/null +++ b/chargebee/models/contract_term/responses.py @@ -0,0 +1,20 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ContractTermResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + status: str = None + contract_start: int = None + contract_end: int = None + billing_cycle: int = None + action_at_term_end: str = None + total_contract_value: int = None + total_contract_value_before_tax: int = None + cancellation_cutoff_period: int = None + created_at: int = None + subscription_id: str = None + remaining_billing_cycles: int = None diff --git a/chargebee/models/contract_term/types.py b/chargebee/models/contract_term/types.py new file mode 100644 index 0000000..440f439 --- /dev/null +++ b/chargebee/models/contract_term/types.py @@ -0,0 +1,37 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + def __str__(self): + return self.value + + +class ActionAtTermEnd(Enum): + RENEW = "renew" + EVERGREEN = "evergreen" + CANCEL = "cancel" + RENEW_ONCE = "renew_once" + + def __str__(self): + return self.value + + +class ContractTerms(TypedDict): + id: Required[str] + status: Required[Status] + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required[ActionAtTermEnd] + total_contract_value: Required[int] + total_contract_value_before_tax: Required[int] + cancellation_cutoff_period: NotRequired[int] + created_at: Required[int] + subscription_id: Required[str] + remaining_billing_cycles: NotRequired[int] diff --git a/chargebee/models/coupon/__init__.py b/chargebee/models/coupon/__init__.py new file mode 100644 index 0000000..79872c5 --- /dev/null +++ b/chargebee/models/coupon/__init__.py @@ -0,0 +1,15 @@ +from .operations import Coupon +from .responses import CouponResponse +from .types import ( + Coupons, + ItemConstraint, + ItemConstraintCriteria, + CouponConstraint, + DiscountType, + DurationType, + Status, + ApplyDiscountOn, + ApplyOn, + AddonConstraint, + PlanConstraint, +) diff --git a/chargebee/models/coupon/operations.py b/chargebee/models/coupon/operations.py new file mode 100644 index 0000000..716ecc3 --- /dev/null +++ b/chargebee/models/coupon/operations.py @@ -0,0 +1,226 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Coupon: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + discount_type: NotRequired[DiscountType] + discount_amount: NotRequired[int] + currency_code: NotRequired[str] + discount_percentage: NotRequired[float] + discount_quantity: NotRequired[int] + apply_on: Required[ApplyOn] + duration_type: NotRequired[DurationType] + duration_month: NotRequired[int] + valid_till: NotRequired[int] + max_redemptions: NotRequired[int] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + included_in_mrr: NotRequired[bool] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + plan_constraint: NotRequired[PlanConstraint] + addon_constraint: NotRequired[AddonConstraint] + plan_ids: NotRequired[List[str]] + addon_ids: NotRequired[List[str]] + status: NotRequired[Status] + + class CreateForItemsParams(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + discount_type: NotRequired[DiscountType] + discount_amount: NotRequired[int] + currency_code: NotRequired[str] + discount_percentage: NotRequired[float] + discount_quantity: NotRequired[int] + apply_on: Required[ApplyOn] + duration_type: NotRequired[DurationType] + duration_month: NotRequired[int] + valid_till: NotRequired[int] + max_redemptions: NotRequired[int] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + included_in_mrr: NotRequired[bool] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + item_constraints: Required[List[CreateForItemsItemConstraintParams]] + item_constraint_criteria: NotRequired[ + List[CreateForItemsItemConstraintCriteriaParams] + ] + status: NotRequired[Status] + coupon_constraints: Required[List[CreateForItemsCouponConstraintParams]] + + class UpdateForItemsParams(TypedDict): + name: NotRequired[str] + invoice_name: NotRequired[str] + discount_type: NotRequired[DiscountType] + discount_amount: NotRequired[int] + currency_code: NotRequired[str] + discount_percentage: NotRequired[float] + discount_quantity: NotRequired[int] + apply_on: NotRequired[ApplyOn] + duration_type: NotRequired[DurationType] + duration_month: NotRequired[int] + valid_till: NotRequired[int] + max_redemptions: NotRequired[int] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + included_in_mrr: NotRequired[bool] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + item_constraints: Required[List[UpdateForItemsItemConstraintParams]] + item_constraint_criteria: NotRequired[ + List[UpdateForItemsItemConstraintCriteriaParams] + ] + coupon_constraints: Required[List[UpdateForItemsCouponConstraintParams]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + discount_type: NotRequired[Filters.EnumFilter] + duration_type: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + apply_on: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + currency_code: NotRequired[Filters.StringFilter] + + class UpdateParams(TypedDict): + name: NotRequired[str] + invoice_name: NotRequired[str] + discount_type: NotRequired[DiscountType] + discount_amount: NotRequired[int] + currency_code: NotRequired[str] + discount_percentage: NotRequired[float] + discount_quantity: NotRequired[int] + apply_on: NotRequired[ApplyOn] + duration_type: NotRequired[DurationType] + duration_month: NotRequired[int] + valid_till: NotRequired[int] + max_redemptions: NotRequired[int] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + included_in_mrr: NotRequired[bool] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + plan_constraint: NotRequired[PlanConstraint] + addon_constraint: NotRequired[AddonConstraint] + plan_ids: NotRequired[List[str]] + addon_ids: NotRequired[List[str]] + + class CopyParams(TypedDict): + from_site: Required[str] + id_at_from_site: Required[str] + id: NotRequired[str] + for_site_merging: NotRequired[bool] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("coupons"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def create_for_items( + params: CreateForItemsParams, env=None, headers=None + ) -> CreateForItemsResponse: + return request.send( + "post", + request.uri_path("coupons", "create_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForItemsResponse, + ) + + @staticmethod + def update_for_items( + id, params: UpdateForItemsParams, env=None, headers=None + ) -> UpdateForItemsResponse: + return request.send( + "post", + request.uri_path("coupons", id, "update_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateForItemsResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("coupons"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("coupons", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("coupons", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("coupons", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + return request.send( + "post", + request.uri_path("coupons", "copy"), + cast(Dict[Any, Any], params), + env, + headers, + CopyResponse, + ) + + @staticmethod + def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + return request.send( + "post", + request.uri_path("coupons", id, "unarchive"), + None, + env, + headers, + UnarchiveResponse, + ) diff --git a/chargebee/models/coupon/responses.py b/chargebee/models/coupon/responses.py new file mode 100644 index 0000000..17a01b5 --- /dev/null +++ b/chargebee/models/coupon/responses.py @@ -0,0 +1,122 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ItemConstraintResponse(Model): + item_type: str = None + constraint: str = None + item_price_ids: List[Dict[Any, Any]] = None + + +@dataclass +class ItemConstraintCriteriaResponse(Model): + item_type: str = None + currencies: List[Dict[Any, Any]] = None + item_family_ids: List[Dict[Any, Any]] = None + item_price_periods: List[Dict[Any, Any]] = None + + +@dataclass +class CouponConstraintResponse(Model): + entity_type: str = None + type: str = None + value: str = None + + +@dataclass +class CouponResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + invoice_name: str = None + discount_type: str = None + discount_percentage: float = None + discount_amount: int = None + discount_quantity: int = None + currency_code: str = None + duration_type: str = None + duration_month: int = None + valid_till: int = None + max_redemptions: int = None + status: str = None + apply_discount_on: str = None + apply_on: str = None + plan_constraint: str = None + addon_constraint: str = None + created_at: int = None + archived_at: int = None + resource_version: int = None + updated_at: int = None + included_in_mrr: bool = None + period: int = None + period_unit: str = None + plan_ids: List[str] = None + addon_ids: List[str] = None + item_constraints: List[ItemConstraintResponse] = None + item_constraint_criteria: List[ItemConstraintCriteriaResponse] = None + redemptions: int = None + invoice_notes: str = None + meta_data: Dict[Any, Any] = None + coupon_constraints: List[CouponConstraintResponse] = None + + +@dataclass +class CreateResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForItemsResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateForItemsResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCouponResponse: + coupon: CouponResponse + + +@dataclass +class ListResponse: + list: List[ListCouponResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CopyResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UnarchiveResponse: + coupon: CouponResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/coupon/types.py b/chargebee/models/coupon/types.py new file mode 100644 index 0000000..a25f118 --- /dev/null +++ b/chargebee/models/coupon/types.py @@ -0,0 +1,203 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class DiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + +class DurationType(Enum): + ONE_TIME = "one_time" + FOREVER = "forever" + LIMITED_PERIOD = "limited_period" + + def __str__(self): + return self.value + + +class Status(Enum): + ACTIVE = "active" + EXPIRED = "expired" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class ApplyDiscountOn(Enum): + PLANS = "plans" + PLANS_AND_ADDONS = "plans_and_addons" + PLANS_WITH_QUANTITY = "plans_with_quantity" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class ApplyOn(Enum): + INVOICE_AMOUNT = "invoice_amount" + EACH_SPECIFIED_ITEM = "each_specified_item" + + def __str__(self): + return self.value + + +class AddonConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class PlanConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class ItemConstraintItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + +class ItemConstraintConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + CRITERIA = "criteria" + + def __str__(self): + return self.value + + +class ItemConstraintCriteriaItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + +class CouponConstraintEntityType(Enum): + CUSTOMER = "customer" + + def __str__(self): + return self.value + + +class CouponConstraintType(Enum): + MAX_REDEMPTIONS = "max_redemptions" + UNIQUE_BY = "unique_by" + + def __str__(self): + return self.value + + +class ItemConstraint(TypedDict): + item_type: Required[ItemConstraintItemType] + constraint: Required[ItemConstraintConstraint] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + +class ItemConstraintCriteria(TypedDict): + item_type: Required[ItemConstraintCriteriaItemType] + currencies: NotRequired[List[Dict[Any, Any]]] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + +class CouponConstraint(TypedDict): + entity_type: Required[CouponConstraintEntityType] + type: Required[CouponConstraintType] + value: NotRequired[str] + + +class Coupons(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + discount_type: Required[DiscountType] + discount_percentage: NotRequired[float] + discount_amount: NotRequired[int] + discount_quantity: NotRequired[int] + currency_code: NotRequired[str] + duration_type: Required[DurationType] + duration_month: NotRequired[int] + valid_till: NotRequired[int] + max_redemptions: NotRequired[int] + status: NotRequired[Status] + apply_discount_on: Required[ApplyDiscountOn] + apply_on: Required[ApplyOn] + plan_constraint: Required[PlanConstraint] + addon_constraint: Required[AddonConstraint] + created_at: Required[int] + archived_at: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + included_in_mrr: NotRequired[bool] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + plan_ids: NotRequired[List[str]] + addon_ids: NotRequired[List[str]] + item_constraints: NotRequired[List[ItemConstraint]] + item_constraint_criteria: NotRequired[List[ItemConstraintCriteria]] + redemptions: NotRequired[int] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + coupon_constraints: NotRequired[List[CouponConstraint]] + + +class CreateForItemsItemConstraintParams(TypedDict): + constraint: Required[ItemConstraintConstraint] + item_type: Required[ItemConstraintItemType] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + +class CreateForItemsItemConstraintCriteriaParams(TypedDict): + item_type: NotRequired[ItemConstraintCriteriaItemType] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + currencies: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + +class CreateForItemsCouponConstraintParams(TypedDict): + entity_type: Required[CouponConstraintEntityType] + type: Required[CouponConstraintType] + value: NotRequired[str] + + +class UpdateForItemsItemConstraintParams(TypedDict): + constraint: Required[ItemConstraintConstraint] + item_type: Required[ItemConstraintItemType] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + +class UpdateForItemsItemConstraintCriteriaParams(TypedDict): + item_type: NotRequired[ItemConstraintCriteriaItemType] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + currencies: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + +class UpdateForItemsCouponConstraintParams(TypedDict): + entity_type: Required[CouponConstraintEntityType] + type: Required[CouponConstraintType] + value: NotRequired[str] diff --git a/chargebee/models/coupon_code/__init__.py b/chargebee/models/coupon_code/__init__.py new file mode 100644 index 0000000..0fc50bf --- /dev/null +++ b/chargebee/models/coupon_code/__init__.py @@ -0,0 +1,3 @@ +from .operations import CouponCode +from .responses import CouponCodeResponse +from .types import CouponCodes, Status diff --git a/chargebee/models/coupon_code/operations.py b/chargebee/models/coupon_code/operations.py new file mode 100644 index 0000000..f8f3635 --- /dev/null +++ b/chargebee/models/coupon_code/operations.py @@ -0,0 +1,65 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class CouponCode: + + class CreateParams(TypedDict): + coupon_id: Required[str] + coupon_set_name: Required[str] + code: Required[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + code: NotRequired[Filters.StringFilter] + coupon_id: NotRequired[Filters.StringFilter] + coupon_set_name: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("coupon_codes"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("coupon_codes", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("coupon_codes"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def archive(id, env=None, headers=None) -> ArchiveResponse: + return request.send( + "post", + request.uri_path("coupon_codes", id, "archive"), + None, + env, + headers, + ArchiveResponse, + ) diff --git a/chargebee/models/coupon_code/responses.py b/chargebee/models/coupon_code/responses.py new file mode 100644 index 0000000..9970493 --- /dev/null +++ b/chargebee/models/coupon_code/responses.py @@ -0,0 +1,43 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CouponCodeResponse(Model): + raw_data: Dict[Any, Any] = None + code: str = None + status: str = None + coupon_id: str = None + coupon_set_id: str = None + coupon_set_name: str = None + + +@dataclass +class CreateResponse: + coupon_code: CouponCodeResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + coupon_code: CouponCodeResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCouponCodeResponse: + coupon_code: CouponCodeResponse + + +@dataclass +class ListResponse: + list: List[ListCouponCodeResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ArchiveResponse: + coupon_code: CouponCodeResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/coupon_code/types.py b/chargebee/models/coupon_code/types.py new file mode 100644 index 0000000..d51c137 --- /dev/null +++ b/chargebee/models/coupon_code/types.py @@ -0,0 +1,19 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + NOT_REDEEMED = "not_redeemed" + REDEEMED = "redeemed" + ARCHIVED = "archived" + + def __str__(self): + return self.value + + +class CouponCodes(TypedDict): + code: Required[str] + status: Required[Status] + coupon_id: Required[str] + coupon_set_id: Required[str] + coupon_set_name: Required[str] diff --git a/chargebee/models/coupon_set/__init__.py b/chargebee/models/coupon_set/__init__.py new file mode 100644 index 0000000..8739705 --- /dev/null +++ b/chargebee/models/coupon_set/__init__.py @@ -0,0 +1,3 @@ +from .operations import CouponSet +from .responses import CouponSetResponse +from .types import CouponSets diff --git a/chargebee/models/coupon_set/operations.py b/chargebee/models/coupon_set/operations.py new file mode 100644 index 0000000..85d0c24 --- /dev/null +++ b/chargebee/models/coupon_set/operations.py @@ -0,0 +1,114 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class CouponSet: + + class CreateParams(TypedDict): + coupon_id: Required[str] + name: Required[str] + id: Required[str] + meta_data: NotRequired[Dict[Any, Any]] + + class AddCouponCodesParams(TypedDict): + code: NotRequired[List[str]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + coupon_id: NotRequired[Filters.StringFilter] + total_count: NotRequired[Filters.NumberFilter] + redeemed_count: NotRequired[Filters.NumberFilter] + archived_count: NotRequired[Filters.NumberFilter] + + class UpdateParams(TypedDict): + name: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("coupon_sets"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def add_coupon_codes( + id, params: AddCouponCodesParams = None, env=None, headers=None + ) -> AddCouponCodesResponse: + return request.send( + "post", + request.uri_path("coupon_sets", id, "add_coupon_codes"), + cast(Dict[Any, Any], params), + env, + headers, + AddCouponCodesResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("coupon_sets"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("coupon_sets", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("coupon_sets", id, "update"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("coupon_sets", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def delete_unused_coupon_codes( + id, env=None, headers=None + ) -> DeleteUnusedCouponCodesResponse: + return request.send( + "post", + request.uri_path("coupon_sets", id, "delete_unused_coupon_codes"), + None, + env, + headers, + DeleteUnusedCouponCodesResponse, + ) diff --git a/chargebee/models/coupon_set/responses.py b/chargebee/models/coupon_set/responses.py new file mode 100644 index 0000000..6f8fa72 --- /dev/null +++ b/chargebee/models/coupon_set/responses.py @@ -0,0 +1,63 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CouponSetResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + coupon_id: str = None + name: str = None + total_count: int = None + redeemed_count: int = None + archived_count: int = None + meta_data: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddCouponCodesResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCouponSetResponse: + coupon_set: CouponSetResponse + + +@dataclass +class ListResponse: + list: List[ListCouponSetResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteUnusedCouponCodesResponse: + coupon_set: CouponSetResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/coupon_set/types.py b/chargebee/models/coupon_set/types.py new file mode 100644 index 0000000..35b9ea7 --- /dev/null +++ b/chargebee/models/coupon_set/types.py @@ -0,0 +1,11 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class CouponSets(TypedDict): + id: Required[str] + coupon_id: Required[str] + name: Required[str] + total_count: NotRequired[int] + redeemed_count: NotRequired[int] + archived_count: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/credit_note/__init__.py b/chargebee/models/credit_note/__init__.py new file mode 100644 index 0000000..9e464f8 --- /dev/null +++ b/chargebee/models/credit_note/__init__.py @@ -0,0 +1,21 @@ +from .operations import CreditNote +from .responses import CreditNoteResponse +from .types import ( + CreditNotes, + Einvoice, + LineItem, + Discount, + LineItemDiscount, + LineItemTier, + Tax, + LineItemTax, + LinkedRefund, + Allocation, + ShippingAddress, + BillingAddress, + SiteDetailsAtCreation, + TaxOrigin, + Type, + ReasonCode, + Status, +) diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py new file mode 100644 index 0000000..f31fbe3 --- /dev/null +++ b/chargebee/models/credit_note/operations.py @@ -0,0 +1,262 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class CreditNote: + + class CreateParams(TypedDict): + reference_invoice_id: NotRequired[str] + customer_id: NotRequired[str] + total: NotRequired[int] + type: Required[Type] + reason_code: NotRequired[ReasonCode] + create_reason_code: NotRequired[str] + date: NotRequired[int] + customer_notes: NotRequired[str] + currency_code: NotRequired[str] + line_items: NotRequired[List[CreateLineItemParams]] + comment: NotRequired[str] + + class PdfParams(TypedDict): + disposition_type: NotRequired[enums.DispositionType] + + class RefundParams(TypedDict): + refund_amount: NotRequired[int] + customer_notes: NotRequired[str] + refund_reason_code: NotRequired[str] + + class RecordRefundParams(TypedDict): + transaction: Required[RecordRefundTransactionParams] + refund_reason_code: NotRequired[str] + comment: NotRequired[str] + + class VoidCreditNoteParams(TypedDict): + comment: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + einvoice: NotRequired[ListEinvoiceParams] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + reference_invoice_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + reason_code: NotRequired[Filters.EnumFilter] + create_reason_code: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + price_type: NotRequired[Filters.EnumFilter] + amount_allocated: NotRequired[Filters.NumberFilter] + amount_refunded: NotRequired[Filters.NumberFilter] + amount_available: NotRequired[Filters.NumberFilter] + voided_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + channel: NotRequired[Filters.EnumFilter] + + class CreditNotesForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class DeleteParams(TypedDict): + comment: NotRequired[str] + + class RemoveTaxWithheldRefundParams(TypedDict): + tax_withheld: Required[RemoveTaxWithheldRefundTaxWithheldParams] + + class ImportCreditNoteParams(TypedDict): + id: Required[str] + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + reference_invoice_id: Required[str] + type: Required[Type] + currency_code: NotRequired[str] + create_reason_code: Required[str] + date: Required[int] + status: NotRequired[Status] + total: NotRequired[int] + refunded_at: NotRequired[int] + voided_at: NotRequired[int] + sub_total: NotRequired[int] + round_off_amount: NotRequired[int] + fractional_correction: NotRequired[int] + vat_number_prefix: NotRequired[str] + line_items: Required[List[ImportCreditNoteLineItemParams]] + line_item_tiers: Required[List[ImportCreditNoteLineItemTierParams]] + discounts: Required[List[ImportCreditNoteDiscountParams]] + taxes: Required[List[ImportCreditNoteTaxParams]] + allocations: Required[List[ImportCreditNoteAllocationParams]] + linked_refunds: Required[List[ImportCreditNoteLinkedRefundParams]] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("credit_notes"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("credit_notes", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "pdf"), + cast(Dict[Any, Any], params), + env, + headers, + PdfResponse, + ) + + @staticmethod + def download_einvoice(id, env=None, headers=None) -> DownloadEinvoiceResponse: + return request.send( + "get", + request.uri_path("credit_notes", id, "download_einvoice"), + None, + env, + headers, + DownloadEinvoiceResponse, + ) + + @staticmethod + def refund( + id, params: RefundParams = None, env=None, headers=None + ) -> RefundResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "refund"), + cast(Dict[Any, Any], params), + env, + headers, + RefundResponse, + ) + + @staticmethod + def record_refund( + id, params: RecordRefundParams, env=None, headers=None + ) -> RecordRefundResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "record_refund"), + cast(Dict[Any, Any], params), + env, + headers, + RecordRefundResponse, + ) + + @staticmethod + def void_credit_note( + id, params: VoidCreditNoteParams = None, env=None, headers=None + ) -> VoidCreditNoteResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "void"), + cast(Dict[Any, Any], params), + env, + headers, + VoidCreditNoteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("credit_notes"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def credit_notes_for_customer( + id, params: CreditNotesForCustomerParams = None, env=None, headers=None + ) -> CreditNotesForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "credit_notes"), + cast(Dict[Any, Any], params), + env, + headers, + CreditNotesForCustomerResponse, + ) + + @staticmethod + def delete( + id, params: DeleteParams = None, env=None, headers=None + ) -> DeleteResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def remove_tax_withheld_refund( + id, params: RemoveTaxWithheldRefundParams, env=None, headers=None + ) -> RemoveTaxWithheldRefundResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "remove_tax_withheld_refund"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveTaxWithheldRefundResponse, + ) + + @staticmethod + def resend_einvoice(id, env=None, headers=None) -> ResendEinvoiceResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "resend_einvoice"), + None, + env, + headers, + ResendEinvoiceResponse, + ) + + @staticmethod + def send_einvoice(id, env=None, headers=None) -> SendEinvoiceResponse: + return request.send( + "post", + request.uri_path("credit_notes", id, "send_einvoice"), + None, + env, + headers, + SendEinvoiceResponse, + ) + + @staticmethod + def import_credit_note( + params: ImportCreditNoteParams, env=None, headers=None + ) -> ImportCreditNoteResponse: + return request.send( + "post", + request.uri_path("credit_notes", "import_credit_note"), + cast(Dict[Any, Any], params), + env, + headers, + ImportCreditNoteResponse, + ) diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py new file mode 100644 index 0000000..2110672 --- /dev/null +++ b/chargebee/models/credit_note/responses.py @@ -0,0 +1,316 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import invoice, transaction, transaction, invoice, download + + +@dataclass +class EinvoiceResponse(Model): + id: str = None + reference_number: str = None + status: str = None + message: str = None + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + 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): + 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 + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LinkedRefundResponse(Model): + txn_id: str = None + applied_amount: int = None + applied_at: int = None + txn_status: str = None + txn_date: int = None + txn_amount: int = None + refund_reason_code: str = None + + +@dataclass +class AllocationResponse(Model): + invoice_id: str = None + allocated_amount: int = None + allocated_at: int = None + invoice_date: int = None + invoice_status: str = None + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class BillingAddressResponse(Model): + 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 SiteDetailsAtCreationResponse(Model): + timezone: str = None + organization_address: Dict[Any, Any] = None + + +@dataclass +class TaxOriginResponse(Model): + country: str = None + registration_number: str = None + + +@dataclass +class CreditNoteResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + subscription_id: str = None + reference_invoice_id: str = None + type: str = None + reason_code: str = None + status: str = None + vat_number: str = None + date: int = None + price_type: str = None + currency_code: str = None + total: int = None + amount_allocated: int = None + amount_refunded: int = None + amount_available: int = None + refunded_at: int = None + voided_at: int = None + generated_at: int = None + 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 + local_currency_code: str = None + 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_taxes: List[LineItemTaxResponse] = None + linked_refunds: List[LinkedRefundResponse] = None + allocations: List[AllocationResponse] = None + deleted: bool = None + tax_category: str = None + local_currency_exchange_rate: float = None + create_reason_code: str = None + vat_number_prefix: str = None + business_entity_id: str = None + shipping_address: ShippingAddressResponse = None + billing_address: BillingAddressResponse = None + site_details_at_creation: SiteDetailsAtCreationResponse = None + tax_origin: TaxOriginResponse = None + + +@dataclass +class CreateResponse: + credit_note: CreditNoteResponse + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PdfResponse: + download: "download.DownloadResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class DownloadEinvoiceResponse: + downloads: List["download.DownloadResponse"] + response_headers: Dict[Any, Any] = None + + +@dataclass +class RefundResponse: + credit_note: CreditNoteResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordRefundResponse: + credit_note: CreditNoteResponse + transaction: "transaction.TransactionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class VoidCreditNoteResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCreditNoteResponse: + credit_note: CreditNoteResponse + + +@dataclass +class ListResponse: + list: List[ListCreditNoteResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreditNotesForCustomerCreditNoteResponse: + credit_note: CreditNoteResponse + + +@dataclass +class CreditNotesForCustomerResponse: + list: List[CreditNotesForCustomerCreditNoteResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveTaxWithheldRefundResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ResendEinvoiceResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SendEinvoiceResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportCreditNoteResponse: + credit_note: CreditNoteResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/credit_note/types.py b/chargebee/models/credit_note/types.py new file mode 100644 index 0000000..bded736 --- /dev/null +++ b/chargebee/models/credit_note/types.py @@ -0,0 +1,400 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, invoice, transaction + + +class Type(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + +class ReasonCode(Enum): + WRITE_OFF = "write_off" + SUBSCRIPTION_CHANGE = "subscription_change" + SUBSCRIPTION_CANCELLATION = "subscription_cancellation" + SUBSCRIPTION_PAUSE = "subscription_pause" + CHARGEBACK = "chargeback" + PRODUCT_UNSATISFACTORY = "product_unsatisfactory" + SERVICE_UNSATISFACTORY = "service_unsatisfactory" + ORDER_CHANGE = "order_change" + ORDER_CANCELLATION = "order_cancellation" + WAIVER = "waiver" + OTHER = "other" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + +class Status(Enum): + ADJUSTED = "adjusted" + REFUNDED = "refunded" + REFUND_DUE = "refund_due" + VOIDED = "voided" + + 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" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class Einvoice(TypedDict): + id: Required[str] + reference_number: NotRequired[str] + status: Required[EinvoiceStatus] + message: NotRequired[str] + + +class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[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] + 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] + + +class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + +class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + +class LinkedRefund(TypedDict): + txn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + txn_status: NotRequired["transaction.Status"] + txn_date: NotRequired[int] + txn_amount: NotRequired[int] + refund_reason_code: NotRequired[str] + + +class Allocation(TypedDict): + invoice_id: Required[str] + allocated_amount: Required[int] + allocated_at: Required[int] + invoice_date: NotRequired[int] + invoice_status: Required["invoice.Status"] + + +class ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class BillingAddress(TypedDict): + 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 SiteDetailsAtCreation(TypedDict): + timezone: NotRequired[str] + organization_address: NotRequired[Dict[Any, Any]] + + +class TaxOrigin(TypedDict): + country: NotRequired[str] + registration_number: NotRequired[str] + + +class CreditNotes(TypedDict): + id: Required[str] + customer_id: Required[str] + subscription_id: NotRequired[str] + reference_invoice_id: NotRequired[str] + type: Required[Type] + reason_code: NotRequired[ReasonCode] + status: Required[Status] + vat_number: NotRequired[str] + date: NotRequired[int] + price_type: Required[enums.PriceType] + currency_code: Required[str] + total: NotRequired[int] + amount_allocated: NotRequired[int] + amount_refunded: NotRequired[int] + amount_available: NotRequired[int] + refunded_at: NotRequired[int] + voided_at: NotRequired[int] + generated_at: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + channel: NotRequired[enums.Channel] + einvoice: NotRequired[Einvoice] + sub_total: Required[int] + sub_total_in_local_currency: NotRequired[int] + total_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + round_off_amount: NotRequired[int] + fractional_correction: NotRequired[int] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + line_item_tiers: NotRequired[List[LineItemTier]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] + linked_refunds: NotRequired[List[LinkedRefund]] + allocations: NotRequired[List[Allocation]] + deleted: Required[bool] + tax_category: NotRequired[str] + local_currency_exchange_rate: NotRequired[float] + create_reason_code: NotRequired[str] + vat_number_prefix: NotRequired[str] + business_entity_id: NotRequired[str] + shipping_address: NotRequired[ShippingAddress] + billing_address: NotRequired[BillingAddress] + site_details_at_creation: NotRequired[SiteDetailsAtCreation] + tax_origin: NotRequired[TaxOrigin] + + +class CreateLineItemParams(TypedDict): + reference_line_item_id: NotRequired[str] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + amount: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + description: NotRequired[str] + entity_type: NotRequired[LineItemEntityType] + entity_id: NotRequired[str] + + +class RecordRefundTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + date: Required[int] + + +class ListEinvoiceParams(TypedDict): + Status: NotRequired[Filters.EnumFilter] + + +class RemoveTaxWithheldRefundTaxWithheldParams(TypedDict): + id: Required[str] + + +class ImportCreditNoteLineItemParams(TypedDict): + reference_line_item_id: NotRequired[str] + id: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + subscription_id: NotRequired[str] + description: Required[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + entity_type: NotRequired[LineItemEntityType] + entity_id: NotRequired[str] + item_level_discount1_entity_id: NotRequired[str] + item_level_discount1_amount: NotRequired[int] + item_level_discount2_entity_id: NotRequired[str] + item_level_discount2_amount: NotRequired[int] + tax1_name: NotRequired[str] + tax1_amount: NotRequired[int] + tax2_name: NotRequired[str] + tax2_amount: NotRequired[int] + tax3_name: NotRequired[str] + tax3_amount: NotRequired[int] + tax4_name: NotRequired[str] + tax4_amount: NotRequired[int] + tax5_name: NotRequired[str] + tax5_amount: NotRequired[int] + tax6_name: NotRequired[str] + tax6_amount: NotRequired[int] + tax7_name: NotRequired[str] + tax7_amount: NotRequired[int] + tax8_name: NotRequired[str] + tax8_amount: NotRequired[int] + tax9_name: NotRequired[str] + tax9_amount: NotRequired[int] + tax10_name: NotRequired[str] + tax10_amount: NotRequired[int] + + +class ImportCreditNoteLineItemTierParams(TypedDict): + line_item_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + +class ImportCreditNoteDiscountParams(TypedDict): + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + +class ImportCreditNoteTaxParams(TypedDict): + name: Required[str] + rate: Required[float] + amount: NotRequired[int] + description: NotRequired[str] + juris_type: NotRequired[enums.TaxJurisType] + juris_name: NotRequired[str] + juris_code: NotRequired[str] + + +class ImportCreditNoteAllocationParams(TypedDict): + invoice_id: Required[str] + allocated_amount: Required[int] + allocated_at: Required[int] + + +class ImportCreditNoteLinkedRefundParams(TypedDict): + amount: Required[int] + payment_method: Required[enums.PaymentMethod] + date: Required[int] + reference_number: NotRequired[str] diff --git a/chargebee/models/credit_note_estimate/__init__.py b/chargebee/models/credit_note_estimate/__init__.py new file mode 100644 index 0000000..679b1ef --- /dev/null +++ b/chargebee/models/credit_note_estimate/__init__.py @@ -0,0 +1,12 @@ +from .operations import CreditNoteEstimate +from .responses import CreditNoteEstimateResponse +from .types import ( + CreditNoteEstimates, + LineItem, + Discount, + Tax, + LineItemTax, + LineItemDiscount, + LineItemTier, + Type, +) diff --git a/chargebee/models/credit_note_estimate/operations.py b/chargebee/models/credit_note_estimate/operations.py new file mode 100644 index 0000000..6d0231f --- /dev/null +++ b/chargebee/models/credit_note_estimate/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class CreditNoteEstimate: + + pass diff --git a/chargebee/models/credit_note_estimate/responses.py b/chargebee/models/credit_note_estimate/responses.py new file mode 100644 index 0000000..1785373 --- /dev/null +++ b/chargebee/models/credit_note_estimate/responses.py @@ -0,0 +1,109 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + 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): + 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 + + +@dataclass +class CreditNoteEstimateResponse(Model): + raw_data: Dict[Any, Any] = None + reference_invoice_id: str = None + type: str = None + price_type: str = None + currency_code: str = None + sub_total: int = None + total: int = None + amount_allocated: int = None + amount_available: int = None + line_items: List[LineItemResponse] = 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/credit_note_estimate/types.py b/chargebee/models/credit_note_estimate/types.py new file mode 100644 index 0000000..bf9eb64 --- /dev/null +++ b/chargebee/models/credit_note_estimate/types.py @@ -0,0 +1,146 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + +class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + +class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[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] + 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] + + +class CreditNoteEstimates(TypedDict): + reference_invoice_id: Required[str] + type: Required[Type] + price_type: Required[enums.PriceType] + currency_code: Required[str] + sub_total: Required[int] + total: Required[int] + amount_allocated: Required[int] + amount_available: Required[int] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + line_item_tiers: NotRequired[List[LineItemTier]] + round_off_amount: NotRequired[int] + customer_id: NotRequired[str] diff --git a/chargebee/models/currency/__init__.py b/chargebee/models/currency/__init__.py new file mode 100644 index 0000000..c6beab8 --- /dev/null +++ b/chargebee/models/currency/__init__.py @@ -0,0 +1,3 @@ +from .operations import Currency +from .responses import CurrencyResponse +from .types import Currencies, ForexType diff --git a/chargebee/models/currency/operations.py b/chargebee/models/currency/operations.py new file mode 100644 index 0000000..b00f976 --- /dev/null +++ b/chargebee/models/currency/operations.py @@ -0,0 +1,88 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Currency: + + class CreateParams(TypedDict): + currency_code: Required[str] + forex_type: Required[ForexType] + manual_exchange_rate: NotRequired[str] + + class UpdateParams(TypedDict): + forex_type: Required[ForexType] + manual_exchange_rate: NotRequired[str] + + class AddScheduleParams(TypedDict): + manual_exchange_rate: Required[str] + schedule_at: Required[int] + + @staticmethod + def list(env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("currencies", "list"), + None, + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("currencies", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("currencies"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("currencies", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def add_schedule( + id, params: AddScheduleParams, env=None, headers=None + ) -> AddScheduleResponse: + return request.send( + "post", + request.uri_path("currencies", id, "add_schedule"), + cast(Dict[Any, Any], params), + env, + headers, + AddScheduleResponse, + ) + + @staticmethod + def remove_schedule(id, env=None, headers=None) -> RemoveScheduleResponse: + return request.send( + "post", + request.uri_path("currencies", id, "remove_schedule"), + None, + env, + headers, + RemoveScheduleResponse, + ) diff --git a/chargebee/models/currency/responses.py b/chargebee/models/currency/responses.py new file mode 100644 index 0000000..ad53df2 --- /dev/null +++ b/chargebee/models/currency/responses.py @@ -0,0 +1,52 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CurrencyResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + enabled: bool = None + forex_type: str = None + currency_code: str = None + is_base_currency: bool = None + manual_exchange_rate: str = None + + +@dataclass +class ListResponse: + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddScheduleResponse: + scheduled_at: int + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveScheduleResponse: + scheduled_at: int + currency: CurrencyResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/currency/types.py b/chargebee/models/currency/types.py new file mode 100644 index 0000000..c170a8e --- /dev/null +++ b/chargebee/models/currency/types.py @@ -0,0 +1,19 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class ForexType(Enum): + MANUAL = "manual" + AUTO = "auto" + + def __str__(self): + return self.value + + +class Currencies(TypedDict): + id: NotRequired[str] + enabled: Required[bool] + forex_type: NotRequired[ForexType] + currency_code: NotRequired[str] + is_base_currency: NotRequired[bool] + manual_exchange_rate: NotRequired[str] diff --git a/chargebee/models/customer/__init__.py b/chargebee/models/customer/__init__.py new file mode 100644 index 0000000..81cd2c5 --- /dev/null +++ b/chargebee/models/customer/__init__.py @@ -0,0 +1,20 @@ +from .operations import Customer +from .responses import CustomerResponse +from .types import ( + Customers, + BillingAddress, + ReferralUrl, + Contact, + PaymentMethod, + Balance, + EntityIdentifier, + TaxProvidersField, + Relationship, + ParentAccountAccess, + ChildAccountAccess, + VatNumberStatus, + BillingDayOfWeek, + PiiCleared, + CardStatus, + FraudFlag, +) diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py new file mode 100644 index 0000000..6f3e092 --- /dev/null +++ b/chargebee/models/customer/operations.py @@ -0,0 +1,520 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Customer: + + class CreateParams(TypedDict): + id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + preferred_currency_code: NotRequired[str] + phone: NotRequired[str] + company: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + net_term_days: NotRequired[int] + allow_direct_debit: NotRequired[bool] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + registered_for_gst: NotRequired[bool] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + taxability: NotRequired[enums.Taxability] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + client_profile_id: NotRequired[str] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + business_customer_without_vat_number: NotRequired[bool] + locale: NotRequired[str] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + auto_close_invoices: NotRequired[bool] + consolidated_invoicing: NotRequired[bool] + card: NotRequired[CreateCardParams] + bank_account: NotRequired[CreateBankAccountParams] + token_id: NotRequired[str] + payment_method: NotRequired[CreatePaymentMethodParams] + payment_intent: NotRequired[CreatePaymentIntentParams] + billing_address: NotRequired[CreateBillingAddressParams] + entity_identifiers: NotRequired[List[CreateEntityIdentifierParams]] + business_entity_id: NotRequired[str] + tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + created_from_ip: NotRequired[str] + invoice_notes: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + relationship: NotRequired[ListRelationshipParams] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + first_name: NotRequired[Filters.StringFilter] + last_name: NotRequired[Filters.StringFilter] + email: NotRequired[Filters.StringFilter] + company: NotRequired[Filters.StringFilter] + phone: NotRequired[Filters.StringFilter] + auto_collection: NotRequired[Filters.EnumFilter] + taxability: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + business_entity_id: NotRequired[Filters.StringFilter] + sort_by: NotRequired[Filters.SortFilter] + + class UpdateParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + preferred_currency_code: NotRequired[str] + phone: NotRequired[str] + company: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + allow_direct_debit: NotRequired[bool] + net_term_days: NotRequired[int] + taxability: NotRequired[enums.Taxability] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + client_profile_id: NotRequired[str] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + locale: NotRequired[str] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + auto_close_invoices: NotRequired[bool] + meta_data: NotRequired[Dict[Any, Any]] + fraud_flag: NotRequired[FraudFlag] + consolidated_invoicing: NotRequired[bool] + tax_providers_fields: NotRequired[List[UpdateTaxProvidersFieldParams]] + + class UpdatePaymentMethodParams(TypedDict): + payment_method: Required[UpdatePaymentMethodPaymentMethodParams] + + class UpdateBillingInfoParams(TypedDict): + billing_address: NotRequired[UpdateBillingInfoBillingAddressParams] + entity_identifiers: NotRequired[List[UpdateBillingInfoEntityIdentifierParams]] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + registered_for_gst: NotRequired[bool] + business_customer_without_vat_number: NotRequired[bool] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + tax_providers_fields: NotRequired[ + List[UpdateBillingInfoTaxProvidersFieldParams] + ] + + class ContactsForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class AssignPaymentRoleParams(TypedDict): + payment_source_id: Required[str] + role: Required[enums.Role] + + class AddContactParams(TypedDict): + contact: Required[AddContactContactParams] + + class UpdateContactParams(TypedDict): + contact: Required[UpdateContactContactParams] + + class DeleteContactParams(TypedDict): + contact: Required[DeleteContactContactParams] + + class AddPromotionalCreditsParams(TypedDict): + amount: Required[int] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class DeductPromotionalCreditsParams(TypedDict): + amount: Required[int] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class SetPromotionalCreditsParams(TypedDict): + amount: Required[int] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class RecordExcessPaymentParams(TypedDict): + transaction: Required[RecordExcessPaymentTransactionParams] + comment: NotRequired[str] + + class CollectPaymentParams(TypedDict): + amount: NotRequired[int] + invoice_allocations: Required[List[CollectPaymentInvoiceAllocationParams]] + payment_source_id: NotRequired[str] + token_id: NotRequired[str] + payment_method: NotRequired[CollectPaymentPaymentMethodParams] + card: NotRequired[CollectPaymentCardParams] + payment_intent: NotRequired[CollectPaymentPaymentIntentParams] + replace_primary_payment_source: NotRequired[bool] + retain_payment_source: NotRequired[bool] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class DeleteParams(TypedDict): + delete_payment_method: NotRequired[bool] + + class MoveParams(TypedDict): + id_at_from_site: Required[str] + from_site: Required[str] + tax_providers_fields: NotRequired[List[MoveTaxProvidersFieldParams]] + + class ChangeBillingDateParams(TypedDict): + billing_date: NotRequired[int] + billing_month: NotRequired[int] + billing_date_mode: NotRequired[enums.BillingDateMode] + billing_day_of_week: NotRequired[BillingDayOfWeek] + billing_day_of_week_mode: NotRequired[enums.BillingDayOfWeekMode] + + class MergeParams(TypedDict): + from_customer_id: Required[str] + to_customer_id: Required[str] + tax_providers_fields: NotRequired[List[MergeTaxProvidersFieldParams]] + + class RelationshipsParams(TypedDict): + parent_id: NotRequired[str] + payment_owner_id: NotRequired[str] + invoice_owner_id: NotRequired[str] + use_default_hierarchy_settings: NotRequired[bool] + parent_account_access: NotRequired[RelationshipsParentAccountAccessParams] + child_account_access: NotRequired[RelationshipsChildAccountAccessParams] + + class HierarchyParams(TypedDict): + hierarchy_operation_type: Required[enums.HierarchyOperationType] + + class UpdateHierarchySettingsParams(TypedDict): + use_default_hierarchy_settings: NotRequired[bool] + parent_account_access: NotRequired[ + UpdateHierarchySettingsParentAccountAccessParams + ] + child_account_access: NotRequired[ + UpdateHierarchySettingsChildAccountAccessParams + ] + + @staticmethod + def create(params: CreateParams = None, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("customers"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("customers"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("customers", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("customers", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def update_payment_method( + id, params: UpdatePaymentMethodParams, env=None, headers=None + ) -> UpdatePaymentMethodResponse: + return request.send( + "post", + request.uri_path("customers", id, "update_payment_method"), + cast(Dict[Any, Any], params), + env, + headers, + UpdatePaymentMethodResponse, + ) + + @staticmethod + def update_billing_info( + id, params: UpdateBillingInfoParams = None, env=None, headers=None + ) -> UpdateBillingInfoResponse: + return request.send( + "post", + request.uri_path("customers", id, "update_billing_info"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateBillingInfoResponse, + ) + + @staticmethod + def contacts_for_customer( + id, params: ContactsForCustomerParams = None, env=None, headers=None + ) -> ContactsForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "contacts"), + cast(Dict[Any, Any], params), + env, + headers, + ContactsForCustomerResponse, + ) + + @staticmethod + def assign_payment_role( + id, params: AssignPaymentRoleParams, env=None, headers=None + ) -> AssignPaymentRoleResponse: + return request.send( + "post", + request.uri_path("customers", id, "assign_payment_role"), + cast(Dict[Any, Any], params), + env, + headers, + AssignPaymentRoleResponse, + ) + + @staticmethod + def add_contact( + id, params: AddContactParams, env=None, headers=None + ) -> AddContactResponse: + return request.send( + "post", + request.uri_path("customers", id, "add_contact"), + cast(Dict[Any, Any], params), + env, + headers, + AddContactResponse, + ) + + @staticmethod + def update_contact( + id, params: UpdateContactParams, env=None, headers=None + ) -> UpdateContactResponse: + return request.send( + "post", + request.uri_path("customers", id, "update_contact"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateContactResponse, + ) + + @staticmethod + def delete_contact( + id, params: DeleteContactParams, env=None, headers=None + ) -> DeleteContactResponse: + return request.send( + "post", + request.uri_path("customers", id, "delete_contact"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteContactResponse, + ) + + @staticmethod + def add_promotional_credits( + id, params: AddPromotionalCreditsParams, env=None, headers=None + ) -> AddPromotionalCreditsResponse: + return request.send( + "post", + request.uri_path("customers", id, "add_promotional_credits"), + cast(Dict[Any, Any], params), + env, + headers, + AddPromotionalCreditsResponse, + ) + + @staticmethod + def deduct_promotional_credits( + id, params: DeductPromotionalCreditsParams, env=None, headers=None + ) -> DeductPromotionalCreditsResponse: + return request.send( + "post", + request.uri_path("customers", id, "deduct_promotional_credits"), + cast(Dict[Any, Any], params), + env, + headers, + DeductPromotionalCreditsResponse, + ) + + @staticmethod + def set_promotional_credits( + id, params: SetPromotionalCreditsParams, env=None, headers=None + ) -> SetPromotionalCreditsResponse: + return request.send( + "post", + request.uri_path("customers", id, "set_promotional_credits"), + cast(Dict[Any, Any], params), + env, + headers, + SetPromotionalCreditsResponse, + ) + + @staticmethod + def record_excess_payment( + id, params: RecordExcessPaymentParams, env=None, headers=None + ) -> RecordExcessPaymentResponse: + return request.send( + "post", + request.uri_path("customers", id, "record_excess_payment"), + cast(Dict[Any, Any], params), + env, + headers, + RecordExcessPaymentResponse, + ) + + @staticmethod + def collect_payment( + id, params: CollectPaymentParams, env=None, headers=None + ) -> CollectPaymentResponse: + return request.send( + "post", + request.uri_path("customers", id, "collect_payment"), + cast(Dict[Any, Any], params), + env, + headers, + CollectPaymentResponse, + ) + + @staticmethod + def delete( + id, params: DeleteParams = None, env=None, headers=None + ) -> DeleteResponse: + return request.send( + "post", + request.uri_path("customers", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def move(params: MoveParams, env=None, headers=None) -> MoveResponse: + return request.send( + "post", + request.uri_path("customers", "move"), + cast(Dict[Any, Any], params), + env, + headers, + MoveResponse, + ) + + @staticmethod + def change_billing_date( + id, params: ChangeBillingDateParams = None, env=None, headers=None + ) -> ChangeBillingDateResponse: + return request.send( + "post", + request.uri_path("customers", id, "change_billing_date"), + cast(Dict[Any, Any], params), + env, + headers, + ChangeBillingDateResponse, + ) + + @staticmethod + def merge(params: MergeParams, env=None, headers=None) -> MergeResponse: + return request.send( + "post", + request.uri_path("customers", "merge"), + cast(Dict[Any, Any], params), + env, + headers, + MergeResponse, + ) + + @staticmethod + def clear_personal_data(id, env=None, headers=None) -> ClearPersonalDataResponse: + return request.send( + "post", + request.uri_path("customers", id, "clear_personal_data"), + None, + env, + headers, + ClearPersonalDataResponse, + ) + + @staticmethod + def relationships( + id, params: RelationshipsParams = None, env=None, headers=None + ) -> RelationshipsResponse: + return request.send( + "post", + request.uri_path("customers", id, "relationships"), + cast(Dict[Any, Any], params), + env, + headers, + RelationshipsResponse, + ) + + @staticmethod + def delete_relationship(id, env=None, headers=None) -> DeleteRelationshipResponse: + return request.send( + "post", + request.uri_path("customers", id, "delete_relationship"), + None, + env, + headers, + DeleteRelationshipResponse, + ) + + @staticmethod + def hierarchy( + id, params: HierarchyParams, env=None, headers=None + ) -> HierarchyResponse: + return request.send( + "get", + request.uri_path("customers", id, "hierarchy"), + cast(Dict[Any, Any], params), + env, + headers, + HierarchyResponse, + ) + + @staticmethod + def update_hierarchy_settings( + id, params: UpdateHierarchySettingsParams = None, env=None, headers=None + ) -> UpdateHierarchySettingsResponse: + return request.send( + "post", + request.uri_path("customers", id, "update_hierarchy_settings"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateHierarchySettingsResponse, + ) diff --git a/chargebee/models/customer/responses.py b/chargebee/models/customer/responses.py new file mode 100644 index 0000000..9cebd94 --- /dev/null +++ b/chargebee/models/customer/responses.py @@ -0,0 +1,360 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + payment_intent, + card, + payment_source, + resource_migration, + hierarchy, + contact, + transaction, +) + + +@dataclass +class BillingAddressResponse(Model): + 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 ReferralUrlResponse(Model): + external_customer_id: str = None + referral_sharing_url: str = None + created_at: int = None + updated_at: int = None + referral_campaign_id: str = None + referral_account_id: str = None + referral_external_campaign_id: str = None + referral_system: str = None + + +@dataclass +class ContactResponse(Model): + id: str = None + first_name: str = None + last_name: str = None + email: str = None + phone: str = None + label: str = None + enabled: bool = None + send_account_email: bool = None + send_billing_email: bool = None + + +@dataclass +class PaymentMethodResponse(Model): + type: str = None + gateway: str = None + gateway_account_id: str = None + status: str = None + reference_id: str = None + + +@dataclass +class BalanceResponse(Model): + promotional_credits: int = None + excess_payments: int = None + refundable_credits: int = None + unbilled_charges: int = None + currency_code: str = None + balance_currency_code: str = None + + +@dataclass +class EntityIdentifierResponse(Model): + id: str = None + value: str = None + scheme: str = None + standard: str = None + + +@dataclass +class TaxProvidersFieldResponse(Model): + provider_name: str = None + field_id: str = None + field_value: str = None + + +@dataclass +class RelationshipResponse(Model): + parent_id: str = None + payment_owner_id: str = None + invoice_owner_id: str = None + + +@dataclass +class ParentAccountAccessResponse(Model): + portal_edit_child_subscriptions: str = None + portal_download_child_invoices: str = None + send_subscription_emails: bool = None + send_invoice_emails: bool = None + send_payment_emails: bool = None + + +@dataclass +class ChildAccountAccessResponse(Model): + portal_edit_subscriptions: str = None + portal_download_invoices: str = None + send_subscription_emails: bool = None + send_invoice_emails: bool = None + send_payment_emails: bool = None + + +@dataclass +class CustomerResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + first_name: str = None + last_name: str = None + email: str = None + phone: str = None + company: str = None + vat_number: str = None + auto_collection: str = None + offline_payment_method: str = None + net_term_days: int = None + vat_number_validated_time: int = None + vat_number_status: str = None + allow_direct_debit: bool = None + is_location_valid: bool = None + created_at: int = None + created_from_ip: str = None + exemption_details: List[Dict[Any, Any]] = None + taxability: str = None + entity_code: str = None + exempt_number: str = None + resource_version: int = None + updated_at: int = None + locale: str = None + billing_date: int = None + billing_month: int = None + billing_date_mode: str = None + billing_day_of_week: str = None + billing_day_of_week_mode: str = None + pii_cleared: str = None + auto_close_invoices: bool = None + channel: str = None + active_id: str = None + card_status: str = None + fraud_flag: str = None + primary_payment_source_id: str = None + backup_payment_source_id: str = None + billing_address: BillingAddressResponse = None + referral_urls: List[ReferralUrlResponse] = None + contacts: List[ContactResponse] = None + payment_method: PaymentMethodResponse = None + invoice_notes: str = None + business_entity_id: str = None + preferred_currency_code: str = None + promotional_credits: int = None + unbilled_charges: int = None + refundable_credits: int = None + excess_payments: int = None + balances: List[BalanceResponse] = None + entity_identifiers: List[EntityIdentifierResponse] = None + tax_providers_fields: List[TaxProvidersFieldResponse] = None + is_einvoice_enabled: bool = None + einvoicing_method: str = None + meta_data: Dict[Any, Any] = None + deleted: bool = None + registered_for_gst: bool = None + consolidated_invoicing: bool = None + customer_type: str = None + business_customer_without_vat_number: bool = None + client_profile_id: str = None + relationship: RelationshipResponse = None + use_default_hierarchy_settings: bool = None + parent_account_access: ParentAccountAccessResponse = None + child_account_access: ChildAccountAccessResponse = None + vat_number_prefix: str = None + entity_identifier_scheme: str = None + entity_identifier_standard: str = None + + +@dataclass +class CreateResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListCustomerResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + + +@dataclass +class ListResponse: + list: List[ListCustomerResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdatePaymentMethodResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateBillingInfoResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ContactsForCustomerCustomerResponse: + contact: "contact.ContactResponse" + + +@dataclass +class ContactsForCustomerResponse: + list: List[ContactsForCustomerCustomerResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class AssignPaymentRoleResponse: + customer: CustomerResponse + payment_source: "payment_source.PaymentSourceResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddContactResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateContactResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteContactResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddPromotionalCreditsResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeductPromotionalCreditsResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SetPromotionalCreditsResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordExcessPaymentResponse: + customer: CustomerResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class CollectPaymentResponse: + customer: CustomerResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + customer: CustomerResponse + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class MoveResponse: + resource_migration: "resource_migration.ResourceMigrationResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChangeBillingDateResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class MergeResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ClearPersonalDataResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RelationshipsResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteRelationshipResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class HierarchyResponse: + hierarchies: List["hierarchy.HierarchyResponse"] + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateHierarchySettingsResponse: + customer: CustomerResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/customer/types.py b/chargebee/models/customer/types.py new file mode 100644 index 0000000..77c8037 --- /dev/null +++ b/chargebee/models/customer/types.py @@ -0,0 +1,542 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, payment_intent + + +class VatNumberStatus(Enum): + VALID = "valid" + INVALID = "invalid" + NOT_VALIDATED = "not_validated" + UNDETERMINED = "undetermined" + + def __str__(self): + return self.value + + +class BillingDayOfWeek(Enum): + SUNDAY = "sunday" + MONDAY = "monday" + TUESDAY = "tuesday" + WEDNESDAY = "wednesday" + THURSDAY = "thursday" + FRIDAY = "friday" + SATURDAY = "saturday" + + def __str__(self): + return self.value + + +class PiiCleared(Enum): + ACTIVE = "active" + SCHEDULED_FOR_CLEAR = "scheduled_for_clear" + CLEARED = "cleared" + + def __str__(self): + return self.value + + +class CardStatus(Enum): + NO_CARD = "no_card" + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + PENDING_VERIFICATION = "pending_verification" + INVALID = "invalid" + + def __str__(self): + return self.value + + +class FraudFlag(Enum): + SAFE = "safe" + SUSPICIOUS = "suspicious" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + +class PaymentMethodStatus(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + INVALID = "invalid" + PENDING_VERIFICATION = "pending_verification" + + def __str__(self): + return self.value + + +class ParentAccountAccessPortalEditChildSubscriptions(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + +class ParentAccountAccessPortalDownloadChildInvoices(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + +class ChildAccountAccessPortalEditSubscriptions(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + + def __str__(self): + return self.value + + +class ChildAccountAccessPortalDownloadInvoices(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + +class BillingAddress(TypedDict): + 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 ReferralUrl(TypedDict): + external_customer_id: NotRequired[str] + referral_sharing_url: Required[str] + created_at: Required[int] + updated_at: Required[int] + referral_campaign_id: Required[str] + referral_account_id: Required[str] + referral_external_campaign_id: NotRequired[str] + referral_system: Required[enums.ReferralSystem] + + +class Contact(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: Required[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: Required[bool] + send_account_email: Required[bool] + send_billing_email: Required[bool] + + +class PaymentMethod(TypedDict): + type: Required[enums.Type] + gateway: Required[enums.Gateway] + gateway_account_id: NotRequired[str] + status: Required[PaymentMethodStatus] + reference_id: Required[str] + + +class Balance(TypedDict): + promotional_credits: Required[int] + excess_payments: Required[int] + refundable_credits: Required[int] + unbilled_charges: Required[int] + currency_code: Required[str] + balance_currency_code: Required[str] + + +class EntityIdentifier(TypedDict): + id: Required[str] + value: NotRequired[str] + scheme: Required[str] + standard: NotRequired[str] + + +class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class Relationship(TypedDict): + parent_id: NotRequired[str] + payment_owner_id: Required[str] + invoice_owner_id: Required[str] + + +class ParentAccountAccess(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + ParentAccountAccessPortalEditChildSubscriptions + ] + portal_download_child_invoices: NotRequired[ + ParentAccountAccessPortalDownloadChildInvoices + ] + send_subscription_emails: Required[bool] + send_invoice_emails: Required[bool] + send_payment_emails: Required[bool] + + +class ChildAccountAccess(TypedDict): + portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] + portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] + send_subscription_emails: Required[bool] + send_invoice_emails: Required[bool] + send_payment_emails: Required[bool] + + +class Customers(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + company: NotRequired[str] + vat_number: NotRequired[str] + auto_collection: Required[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + net_term_days: Required[int] + vat_number_validated_time: NotRequired[int] + vat_number_status: NotRequired[VatNumberStatus] + allow_direct_debit: Required[bool] + is_location_valid: NotRequired[bool] + created_at: Required[int] + created_from_ip: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + locale: NotRequired[str] + billing_date: NotRequired[int] + billing_month: NotRequired[int] + billing_date_mode: NotRequired[enums.BillingDateMode] + billing_day_of_week: NotRequired[BillingDayOfWeek] + billing_day_of_week_mode: NotRequired[enums.BillingDayOfWeekMode] + pii_cleared: NotRequired[PiiCleared] + auto_close_invoices: NotRequired[bool] + channel: NotRequired[enums.Channel] + active_id: NotRequired[str] + card_status: NotRequired[CardStatus] + fraud_flag: NotRequired[FraudFlag] + primary_payment_source_id: NotRequired[str] + backup_payment_source_id: NotRequired[str] + billing_address: NotRequired[BillingAddress] + referral_urls: NotRequired[List[ReferralUrl]] + contacts: NotRequired[List[Contact]] + payment_method: NotRequired[PaymentMethod] + invoice_notes: NotRequired[str] + business_entity_id: NotRequired[str] + preferred_currency_code: NotRequired[str] + promotional_credits: Required[int] + unbilled_charges: Required[int] + refundable_credits: Required[int] + excess_payments: Required[int] + balances: NotRequired[List[Balance]] + entity_identifiers: NotRequired[List[EntityIdentifier]] + tax_providers_fields: NotRequired[List[TaxProvidersField]] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + meta_data: NotRequired[Dict[Any, Any]] + deleted: Required[bool] + registered_for_gst: NotRequired[bool] + consolidated_invoicing: NotRequired[bool] + customer_type: NotRequired[enums.CustomerType] + business_customer_without_vat_number: NotRequired[bool] + client_profile_id: NotRequired[str] + relationship: NotRequired[Relationship] + use_default_hierarchy_settings: NotRequired[bool] + parent_account_access: NotRequired[ParentAccountAccess] + child_account_access: NotRequired[ChildAccountAccess] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + + +class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + standard: NotRequired[str] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class ListRelationshipParams(TypedDict): + ParentId: NotRequired[Filters.StringFilter] + PaymentOwnerId: NotRequired[Filters.StringFilter] + InvoiceOwnerId: NotRequired[Filters.StringFilter] + + +class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class UpdatePaymentMethodPaymentMethodParams(TypedDict): + type: Required[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateBillingInfoBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateBillingInfoEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + +class UpdateBillingInfoTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class AddContactContactParams(TypedDict): + id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: Required[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: NotRequired[bool] + send_billing_email: NotRequired[bool] + send_account_email: NotRequired[bool] + + +class UpdateContactContactParams(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: NotRequired[bool] + send_billing_email: NotRequired[bool] + send_account_email: NotRequired[bool] + + +class DeleteContactContactParams(TypedDict): + id: Required[str] + + +class RecordExcessPaymentTransactionParams(TypedDict): + amount: Required[int] + currency_code: NotRequired[str] + date: Required[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + + +class CollectPaymentInvoiceAllocationParams(TypedDict): + invoice_id: Required[str] + allocation_amount: NotRequired[int] + + +class CollectPaymentPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CollectPaymentCardParams(TypedDict): + gateway_account_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CollectPaymentPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + gw_payment_method_id: NotRequired[str] + reference_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class MoveTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class MergeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class RelationshipsParentAccountAccessParams(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + ParentAccountAccessPortalEditChildSubscriptions + ] + portal_download_child_invoices: NotRequired[ + ParentAccountAccessPortalDownloadChildInvoices + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + +class RelationshipsChildAccountAccessParams(TypedDict): + portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] + portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + +class UpdateHierarchySettingsParentAccountAccessParams(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + ParentAccountAccessPortalEditChildSubscriptions + ] + portal_download_child_invoices: NotRequired[ + ParentAccountAccessPortalDownloadChildInvoices + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + +class UpdateHierarchySettingsChildAccountAccessParams(TypedDict): + portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] + portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] diff --git a/chargebee/models/customer_entitlement/__init__.py b/chargebee/models/customer_entitlement/__init__.py new file mode 100644 index 0000000..085f98b --- /dev/null +++ b/chargebee/models/customer_entitlement/__init__.py @@ -0,0 +1,3 @@ +from .operations import CustomerEntitlement +from .responses import CustomerEntitlementResponse +from .types import CustomerEntitlements diff --git a/chargebee/models/customer_entitlement/operations.py b/chargebee/models/customer_entitlement/operations.py new file mode 100644 index 0000000..4f9ded5 --- /dev/null +++ b/chargebee/models/customer_entitlement/operations.py @@ -0,0 +1,24 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class CustomerEntitlement: + + class EntitlementsForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + @staticmethod + def entitlements_for_customer( + id, params: EntitlementsForCustomerParams = None, env=None, headers=None + ) -> EntitlementsForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "customer_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + EntitlementsForCustomerResponse, + ) diff --git a/chargebee/models/customer_entitlement/responses.py b/chargebee/models/customer_entitlement/responses.py new file mode 100644 index 0000000..974ba9a --- /dev/null +++ b/chargebee/models/customer_entitlement/responses.py @@ -0,0 +1,26 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CustomerEntitlementResponse(Model): + raw_data: Dict[Any, Any] = None + customer_id: str = None + subscription_id: str = None + feature_id: str = None + value: str = None + name: str = None + is_enabled: bool = None + + +@dataclass +class EntitlementsForCustomerCustomerEntitlementResponse: + customer_entitlement: CustomerEntitlementResponse + + +@dataclass +class EntitlementsForCustomerResponse: + list: List[EntitlementsForCustomerCustomerEntitlementResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/customer_entitlement/types.py b/chargebee/models/customer_entitlement/types.py new file mode 100644 index 0000000..9d92b02 --- /dev/null +++ b/chargebee/models/customer_entitlement/types.py @@ -0,0 +1,10 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class CustomerEntitlements(TypedDict): + customer_id: Required[str] + subscription_id: NotRequired[str] + feature_id: NotRequired[str] + value: NotRequired[str] + name: NotRequired[str] + is_enabled: Required[bool] diff --git a/chargebee/models/differential_price/__init__.py b/chargebee/models/differential_price/__init__.py new file mode 100644 index 0000000..df7eeec --- /dev/null +++ b/chargebee/models/differential_price/__init__.py @@ -0,0 +1,3 @@ +from .operations import DifferentialPrice +from .responses import DifferentialPriceResponse +from .types import DifferentialPrices, Tier, ParentPeriod, Status diff --git a/chargebee/models/differential_price/operations.py b/chargebee/models/differential_price/operations.py new file mode 100644 index 0000000..2dc5fb8 --- /dev/null +++ b/chargebee/models/differential_price/operations.py @@ -0,0 +1,93 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class DifferentialPrice: + + class CreateParams(TypedDict): + parent_item_id: Required[str] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + parent_periods: Required[List[CreateParentPeriodParams]] + tiers: NotRequired[List[CreateTierParams]] + + class RetrieveParams(TypedDict): + item_price_id: Required[str] + + class UpdateParams(TypedDict): + item_price_id: Required[str] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + parent_periods: Required[List[UpdateParentPeriodParams]] + tiers: NotRequired[List[UpdateTierParams]] + + class DeleteParams(TypedDict): + item_price_id: Required[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + item_price_id: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + id: NotRequired[Filters.StringFilter] + parent_item_id: NotRequired[Filters.StringFilter] + + @staticmethod + def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("item_prices", id, "differential_prices"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve( + id, params: RetrieveParams, env=None, headers=None + ) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("differential_prices", id), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("differential_prices", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("differential_prices", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("differential_prices"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/differential_price/responses.py b/chargebee/models/differential_price/responses.py new file mode 100644 index 0000000..a53a2a7 --- /dev/null +++ b/chargebee/models/differential_price/responses.py @@ -0,0 +1,73 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TierResponse(Model): + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + + +@dataclass +class ParentPeriodResponse(Model): + period_unit: str = None + period: List[Dict[Any, Any]] = None + + +@dataclass +class DifferentialPriceResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + item_price_id: str = None + parent_item_id: str = None + price: int = None + price_in_decimal: str = None + status: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + modified_at: int = None + tiers: List[TierResponse] = None + currency_code: str = None + parent_periods: List[ParentPeriodResponse] = None + + +@dataclass +class CreateResponse: + differential_price: DifferentialPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + differential_price: DifferentialPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + differential_price: DifferentialPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + differential_price: DifferentialPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListDifferentialPriceResponse: + differential_price: DifferentialPriceResponse + + +@dataclass +class ListResponse: + list: List[ListDifferentialPriceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/differential_price/types.py b/chargebee/models/differential_price/types.py new file mode 100644 index 0000000..fd42290 --- /dev/null +++ b/chargebee/models/differential_price/types.py @@ -0,0 +1,78 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + ACTIVE = "active" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class ParentPeriodPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class ParentPeriod(TypedDict): + period_unit: Required[ParentPeriodPeriodUnit] + period: NotRequired[List[Dict[Any, Any]]] + + +class DifferentialPrices(TypedDict): + id: Required[str] + item_price_id: Required[str] + parent_item_id: Required[str] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + status: NotRequired[Status] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + modified_at: Required[int] + tiers: NotRequired[List[Tier]] + currency_code: Required[str] + parent_periods: NotRequired[List[ParentPeriod]] + + +class CreateParentPeriodParams(TypedDict): + period_unit: Required[ParentPeriodPeriodUnit] + period: NotRequired[List[Dict[Any, Any]]] + + +class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateParentPeriodParams(TypedDict): + period_unit: Required[ParentPeriodPeriodUnit] + period: NotRequired[List[Dict[Any, Any]]] + + +class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] diff --git a/chargebee/models/discount/__init__.py b/chargebee/models/discount/__init__.py new file mode 100644 index 0000000..2965af8 --- /dev/null +++ b/chargebee/models/discount/__init__.py @@ -0,0 +1,3 @@ +from .operations import Discount +from .responses import DiscountResponse +from .types import Discounts, Type diff --git a/chargebee/models/discount/operations.py b/chargebee/models/discount/operations.py new file mode 100644 index 0000000..2e010a0 --- /dev/null +++ b/chargebee/models/discount/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Discount: + + pass diff --git a/chargebee/models/discount/responses.py b/chargebee/models/discount/responses.py new file mode 100644 index 0000000..b68b120 --- /dev/null +++ b/chargebee/models/discount/responses.py @@ -0,0 +1,25 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class DiscountResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + invoice_name: str = None + type: str = None + percentage: float = None + amount: int = None + currency_code: str = None + duration_type: str = None + period: int = None + period_unit: str = None + included_in_mrr: bool = None + apply_on: str = None + item_price_id: str = None + created_at: int = None + apply_till: int = None + applied_count: int = None + coupon_id: str = None + index: int = None diff --git a/chargebee/models/discount/types.py b/chargebee/models/discount/types.py new file mode 100644 index 0000000..2e9e14c --- /dev/null +++ b/chargebee/models/discount/types.py @@ -0,0 +1,31 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + +class Discounts(TypedDict): + id: Required[str] + invoice_name: NotRequired[str] + type: Required[Type] + percentage: NotRequired[float] + amount: NotRequired[int] + currency_code: NotRequired[str] + duration_type: Required[enums.DurationType] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: Required[bool] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + created_at: Required[int] + apply_till: NotRequired[int] + applied_count: NotRequired[int] + coupon_id: Required[str] + index: Required[int] diff --git a/chargebee/models/download/__init__.py b/chargebee/models/download/__init__.py new file mode 100644 index 0000000..f24997d --- /dev/null +++ b/chargebee/models/download/__init__.py @@ -0,0 +1,3 @@ +from .operations import Download +from .responses import DownloadResponse +from .types import Downloads diff --git a/chargebee/models/download/operations.py b/chargebee/models/download/operations.py new file mode 100644 index 0000000..cbe56a3 --- /dev/null +++ b/chargebee/models/download/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Download: + + pass diff --git a/chargebee/models/download/responses.py b/chargebee/models/download/responses.py new file mode 100644 index 0000000..298f0ab --- /dev/null +++ b/chargebee/models/download/responses.py @@ -0,0 +1,11 @@ +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 diff --git a/chargebee/models/download/types.py b/chargebee/models/download/types.py new file mode 100644 index 0000000..31d971a --- /dev/null +++ b/chargebee/models/download/types.py @@ -0,0 +1,7 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Downloads(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] diff --git a/chargebee/models/entitlement/__init__.py b/chargebee/models/entitlement/__init__.py new file mode 100644 index 0000000..be80fe7 --- /dev/null +++ b/chargebee/models/entitlement/__init__.py @@ -0,0 +1,3 @@ +from .operations import Entitlement +from .responses import EntitlementResponse +from .types import Entitlements, EntityType diff --git a/chargebee/models/entitlement/operations.py b/chargebee/models/entitlement/operations.py new file mode 100644 index 0000000..39f408c --- /dev/null +++ b/chargebee/models/entitlement/operations.py @@ -0,0 +1,44 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.models import enums +from chargebee.filters import Filters + + +class Entitlement: + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + feature_id: NotRequired[Filters.StringFilter] + entity_type: NotRequired[Filters.EnumFilter] + entity_id: NotRequired[Filters.StringFilter] + include_drafts: NotRequired[bool] + embed: NotRequired[str] + + class CreateParams(TypedDict): + action: Required[enums.Action] + entitlements: Required[List[CreateEntitlementParams]] + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) diff --git a/chargebee/models/entitlement/responses.py b/chargebee/models/entitlement/responses.py new file mode 100644 index 0000000..964b6a2 --- /dev/null +++ b/chargebee/models/entitlement/responses.py @@ -0,0 +1,33 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class EntitlementResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + entity_id: str = None + entity_type: str = None + feature_id: str = None + feature_name: str = None + value: str = None + name: str = None + + +@dataclass +class ListEntitlementResponse: + entitlement: EntitlementResponse + + +@dataclass +class ListResponse: + list: List[ListEntitlementResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + entitlement: EntitlementResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/entitlement/types.py b/chargebee/models/entitlement/types.py new file mode 100644 index 0000000..ba146be --- /dev/null +++ b/chargebee/models/entitlement/types.py @@ -0,0 +1,30 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class EntityType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + PLAN_PRICE = "plan_price" + ADDON_PRICE = "addon_price" + + def __str__(self): + return self.value + + +class Entitlements(TypedDict): + id: Required[str] + entity_id: NotRequired[str] + entity_type: NotRequired[EntityType] + feature_id: NotRequired[str] + feature_name: NotRequired[str] + value: NotRequired[str] + name: NotRequired[str] + + +class CreateEntitlementParams(TypedDict): + entity_id: Required[str] + feature_id: Required[str] + entity_type: NotRequired[EntityType] + value: NotRequired[str] diff --git a/chargebee/models/entitlement_override/__init__.py b/chargebee/models/entitlement_override/__init__.py new file mode 100644 index 0000000..2cd69ac --- /dev/null +++ b/chargebee/models/entitlement_override/__init__.py @@ -0,0 +1,3 @@ +from .operations import EntitlementOverride +from .responses import EntitlementOverrideResponse +from .types import EntitlementOverrides, ScheduleStatus diff --git a/chargebee/models/entitlement_override/operations.py b/chargebee/models/entitlement_override/operations.py new file mode 100644 index 0000000..6194376 --- /dev/null +++ b/chargebee/models/entitlement_override/operations.py @@ -0,0 +1,50 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.models import enums + + +class EntitlementOverride: + + class AddEntitlementOverrideForSubscriptionParams(TypedDict): + action: NotRequired[enums.Action] + entitlement_overrides: Required[ + List[AddEntitlementOverrideForSubscriptionEntitlementOverrideParams] + ] + + class ListEntitlementOverrideForSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + embed: NotRequired[str] + include_drafts: NotRequired[bool] + include_scheduled_overrides: NotRequired[bool] + + @staticmethod + def add_entitlement_override_for_subscription( + id, params: AddEntitlementOverrideForSubscriptionParams, env=None, headers=None + ) -> AddEntitlementOverrideForSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "entitlement_overrides"), + cast(Dict[Any, Any], params), + env, + headers, + AddEntitlementOverrideForSubscriptionResponse, + ) + + @staticmethod + def list_entitlement_override_for_subscription( + id, + params: ListEntitlementOverrideForSubscriptionParams = None, + env=None, + headers=None, + ) -> ListEntitlementOverrideForSubscriptionResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "entitlement_overrides"), + cast(Dict[Any, Any], params), + env, + headers, + ListEntitlementOverrideForSubscriptionResponse, + ) diff --git a/chargebee/models/entitlement_override/responses.py b/chargebee/models/entitlement_override/responses.py new file mode 100644 index 0000000..e27ec6e --- /dev/null +++ b/chargebee/models/entitlement_override/responses.py @@ -0,0 +1,36 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class EntitlementOverrideResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + entity_id: str = None + entity_type: str = None + feature_id: str = None + feature_name: str = None + value: str = None + name: str = None + expires_at: int = None + effective_from: int = None + schedule_status: str = None + + +@dataclass +class AddEntitlementOverrideForSubscriptionResponse: + entitlement_override: EntitlementOverrideResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListEntitlementOverrideForSubscriptionEntitlementOverrideResponse: + entitlement_override: EntitlementOverrideResponse + + +@dataclass +class ListEntitlementOverrideForSubscriptionResponse: + list: List[ListEntitlementOverrideForSubscriptionEntitlementOverrideResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/entitlement_override/types.py b/chargebee/models/entitlement_override/types.py new file mode 100644 index 0000000..2e3a1af --- /dev/null +++ b/chargebee/models/entitlement_override/types.py @@ -0,0 +1,31 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class ScheduleStatus(Enum): + ACTIVATED = "activated" + SCHEDULED = "scheduled" + FAILED = "failed" + + def __str__(self): + return self.value + + +class EntitlementOverrides(TypedDict): + id: Required[str] + entity_id: NotRequired[str] + entity_type: NotRequired[str] + feature_id: NotRequired[str] + feature_name: NotRequired[str] + value: NotRequired[str] + name: NotRequired[str] + expires_at: NotRequired[int] + effective_from: NotRequired[int] + schedule_status: NotRequired[ScheduleStatus] + + +class AddEntitlementOverrideForSubscriptionEntitlementOverrideParams(TypedDict): + feature_id: Required[str] + value: NotRequired[str] + expires_at: NotRequired[int] + effective_from: NotRequired[int] diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py new file mode 100644 index 0000000..392a132 --- /dev/null +++ b/chargebee/models/enums.py @@ -0,0 +1,1074 @@ +from enum import Enum + + +class AccountHolderType(Enum): + INDIVIDUAL = "individual" + COMPANY = "company" + + def __str__(self): + return self.value + + +class AccountReceivablesHandling(Enum): + NO_ACTION = "no_action" + SCHEDULE_PAYMENT_COLLECTION = "schedule_payment_collection" + WRITE_OFF = "write_off" + + def __str__(self): + return self.value + + +class AccountType(Enum): + CHECKING = "checking" + SAVINGS = "savings" + BUSINESS_CHECKING = "business_checking" + CURRENT = "current" + + def __str__(self): + return self.value + + +class Action(Enum): + UPSERT = "upsert" + REMOVE = "remove" + + def __str__(self): + return self.value + + +class ApiVersion(Enum): + V1 = "v1" + V2 = "v2" + + def __str__(self): + return self.value + + +class ApplyOn(Enum): + INVOICE_AMOUNT = "invoice_amount" + SPECIFIC_ITEM_PRICE = "specific_item_price" + + def __str__(self): + return self.value + + +class AutoCollection(Enum): + ON = "on" + OFF = "off" + + def __str__(self): + return self.value + + +class AvalaraSaleType(Enum): + WHOLESALE = "wholesale" + RETAIL = "retail" + CONSUMED = "consumed" + VENDOR_USE = "vendor_use" + + def __str__(self): + return self.value + + +class BillingAlignmentMode(Enum): + IMMEDIATE = "immediate" + DELAYED = "delayed" + + def __str__(self): + return self.value + + +class BillingDateMode(Enum): + USING_DEFAULTS = "using_defaults" + MANUALLY_SET = "manually_set" + + def __str__(self): + return self.value + + +class BillingDayOfWeekMode(Enum): + USING_DEFAULTS = "using_defaults" + MANUALLY_SET = "manually_set" + + def __str__(self): + return self.value + + +class CancelOption(Enum): + IMMEDIATELY = "immediately" + END_OF_TERM = "end_of_term" + SPECIFIC_DATE = "specific_date" + END_OF_BILLING_TERM = "end_of_billing_term" + + def __str__(self): + return self.value + + +class ChangeOption(Enum): + IMMEDIATELY = "immediately" + END_OF_TERM = "end_of_term" + SPECIFIC_DATE = "specific_date" + + def __str__(self): + return self.value + + +class Channel(Enum): + WEB = "web" + APP_STORE = "app_store" + PLAY_STORE = "play_store" + + def __str__(self): + return self.value + + +class ChargeModel(Enum): + FULL_CHARGE = "full_charge" + PRORATE = "prorate" + + def __str__(self): + return self.value + + +class ChargeOn(Enum): + IMMEDIATELY = "immediately" + ON_EVENT = "on_event" + + def __str__(self): + return self.value + + +class ChargeOnEvent(Enum): + SUBSCRIPTION_CREATION = "subscription_creation" + SUBSCRIPTION_TRIAL_START = "subscription_trial_start" + PLAN_ACTIVATION = "plan_activation" + SUBSCRIPTION_ACTIVATION = "subscription_activation" + CONTRACT_TERMINATION = "contract_termination" + ON_DEMAND = "on_demand" + + def __str__(self): + return self.value + + +class ChargeOnOption(Enum): + IMMEDIATELY = "immediately" + ON_EVENT = "on_event" + + def __str__(self): + return self.value + + +class ChargesHandling(Enum): + INVOICE_IMMEDIATELY = "invoice_immediately" + ADD_TO_UNBILLED_CHARGES = "add_to_unbilled_charges" + + def __str__(self): + return self.value + + +class ContractTermCancelOption(Enum): + TERMINATE_IMMEDIATELY = "terminate_immediately" + END_OF_CONTRACT_TERM = "end_of_contract_term" + + def __str__(self): + return self.value + + +class CreditOptionForCurrentTermCharges(Enum): + NONE = "none" + PRORATE = "prorate" + FULL = "full" + + def __str__(self): + return self.value + + +class CreditType(Enum): + LOYALTY_CREDITS = "loyalty_credits" + REFERRAL_REWARDS = "referral_rewards" + GENERAL = "general" + + def __str__(self): + return self.value + + +class CustomerType(Enum): + RESIDENTIAL = "residential" + BUSINESS = "business" + SENIOR_CITIZEN = "senior_citizen" + INDUSTRIAL = "industrial" + + def __str__(self): + return self.value + + +class DedupeOption(Enum): + SKIP = "skip" + UPDATE_EXISTING = "update_existing" + + def __str__(self): + return self.value + + +class DirectDebitScheme(Enum): + ACH = "ach" + BACS = "bacs" + SEPA_CORE = "sepa_core" + AUTOGIRO = "autogiro" + BECS = "becs" + BECS_NZ = "becs_nz" + PAD = "pad" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class DispositionType(Enum): + ATTACHMENT = "attachment" + INLINE = "inline" + + def __str__(self): + return self.value + + +class DunningType(Enum): + AUTO_COLLECT = "auto_collect" + OFFLINE = "offline" + DIRECT_DEBIT = "direct_debit" + + def __str__(self): + return self.value + + +class DurationType(Enum): + ONE_TIME = "one_time" + FOREVER = "forever" + LIMITED_PERIOD = "limited_period" + + def __str__(self): + return self.value + + +class EcheckType(Enum): + WEB = "web" + PPD = "ppd" + CCD = "ccd" + + def __str__(self): + return self.value + + +class EinvoicingMethod(Enum): + AUTOMATIC = "automatic" + MANUAL = "manual" + SITE_DEFAULT = "site_default" + + def __str__(self): + return self.value + + +class EndScheduleOn(Enum): + AFTER_NUMBER_OF_INTERVALS = "after_number_of_intervals" + SPECIFIC_DATE = "specific_date" + SUBSCRIPTION_END = "subscription_end" + + def __str__(self): + return self.value + + +class EntityCode(Enum): + A = "a" + B = "b" + C = "c" + D = "d" + E = "e" + F = "f" + G = "g" + H = "h" + I = "i" + J = "j" + K = "k" + L = "l" + M = "m" + N = "n" + P = "p" + Q = "q" + R = "r" + MED1 = "med1" + MED2 = "med2" + + def __str__(self): + return self.value + + +class EntityType(Enum): + CUSTOMER = "customer" + SUBSCRIPTION = "subscription" + COUPON = "coupon" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + INVOICE = "invoice" + QUOTE = "quote" + CREDIT_NOTE = "credit_note" + TRANSACTION = "transaction" + PLAN = "plan" + ADDON = "addon" + ORDER = "order" + ITEM_FAMILY = "item_family" + ITEM = "item" + ITEM_PRICE = "item_price" + PLAN_ITEM = "plan_item" + ADDON_ITEM = "addon_item" + CHARGE_ITEM = "charge_item" + PLAN_PRICE = "plan_price" + ADDON_PRICE = "addon_price" + CHARGE_PRICE = "charge_price" + DIFFERENTIAL_PRICE = "differential_price" + ATTACHED_ITEM = "attached_item" + FEATURE = "feature" + SUBSCRIPTION_ENTITLEMENT = "subscription_entitlement" + ITEM_ENTITLEMENT = "item_entitlement" + BUSINESS_ENTITY = "business_entity" + PRICE_VARIANT = "price_variant" + + def __str__(self): + return self.value + + +class EventName(Enum): + CANCELLATION_PAGE_LOADED = "cancellation_page_loaded" + + def __str__(self): + return self.value + + +class EventType(Enum): + COUPON_CREATED = "coupon_created" + COUPON_UPDATED = "coupon_updated" + COUPON_DELETED = "coupon_deleted" + COUPON_SET_CREATED = "coupon_set_created" + COUPON_SET_UPDATED = "coupon_set_updated" + COUPON_SET_DELETED = "coupon_set_deleted" + COUPON_CODES_ADDED = "coupon_codes_added" + COUPON_CODES_DELETED = "coupon_codes_deleted" + COUPON_CODES_UPDATED = "coupon_codes_updated" + CUSTOMER_CREATED = "customer_created" + CUSTOMER_CHANGED = "customer_changed" + CUSTOMER_DELETED = "customer_deleted" + CUSTOMER_MOVED_OUT = "customer_moved_out" + CUSTOMER_MOVED_IN = "customer_moved_in" + PROMOTIONAL_CREDITS_ADDED = "promotional_credits_added" + PROMOTIONAL_CREDITS_DEDUCTED = "promotional_credits_deducted" + SUBSCRIPTION_CREATED = "subscription_created" + SUBSCRIPTION_CREATED_WITH_BACKDATING = "subscription_created_with_backdating" + SUBSCRIPTION_STARTED = "subscription_started" + SUBSCRIPTION_TRIAL_END_REMINDER = "subscription_trial_end_reminder" + SUBSCRIPTION_ACTIVATED = "subscription_activated" + SUBSCRIPTION_ACTIVATED_WITH_BACKDATING = "subscription_activated_with_backdating" + SUBSCRIPTION_CHANGED = "subscription_changed" + SUBSCRIPTION_TRIAL_EXTENDED = "subscription_trial_extended" + MRR_UPDATED = "mrr_updated" + SUBSCRIPTION_CHANGED_WITH_BACKDATING = "subscription_changed_with_backdating" + SUBSCRIPTION_CANCELLATION_SCHEDULED = "subscription_cancellation_scheduled" + SUBSCRIPTION_CANCELLATION_REMINDER = "subscription_cancellation_reminder" + SUBSCRIPTION_CANCELLED = "subscription_cancelled" + SUBSCRIPTION_CANCELED_WITH_BACKDATING = "subscription_canceled_with_backdating" + SUBSCRIPTION_REACTIVATED = "subscription_reactivated" + SUBSCRIPTION_REACTIVATED_WITH_BACKDATING = ( + "subscription_reactivated_with_backdating" + ) + SUBSCRIPTION_RENEWED = "subscription_renewed" + SUBSCRIPTION_ITEMS_RENEWED = "subscription_items_renewed" + SUBSCRIPTION_SCHEDULED_CANCELLATION_REMOVED = ( + "subscription_scheduled_cancellation_removed" + ) + SUBSCRIPTION_CHANGES_SCHEDULED = "subscription_changes_scheduled" + SUBSCRIPTION_SCHEDULED_CHANGES_REMOVED = "subscription_scheduled_changes_removed" + SUBSCRIPTION_SHIPPING_ADDRESS_UPDATED = "subscription_shipping_address_updated" + SUBSCRIPTION_DELETED = "subscription_deleted" + SUBSCRIPTION_PAUSED = "subscription_paused" + SUBSCRIPTION_PAUSE_SCHEDULED = "subscription_pause_scheduled" + SUBSCRIPTION_SCHEDULED_PAUSE_REMOVED = "subscription_scheduled_pause_removed" + SUBSCRIPTION_RESUMED = "subscription_resumed" + SUBSCRIPTION_RESUMPTION_SCHEDULED = "subscription_resumption_scheduled" + SUBSCRIPTION_SCHEDULED_RESUMPTION_REMOVED = ( + "subscription_scheduled_resumption_removed" + ) + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_ADDED = ( + "subscription_advance_invoice_schedule_added" + ) + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_UPDATED = ( + "subscription_advance_invoice_schedule_updated" + ) + SUBSCRIPTION_ADVANCE_INVOICE_SCHEDULE_REMOVED = ( + "subscription_advance_invoice_schedule_removed" + ) + PENDING_INVOICE_CREATED = "pending_invoice_created" + PENDING_INVOICE_UPDATED = "pending_invoice_updated" + INVOICE_GENERATED = "invoice_generated" + INVOICE_GENERATED_WITH_BACKDATING = "invoice_generated_with_backdating" + INVOICE_UPDATED = "invoice_updated" + INVOICE_DELETED = "invoice_deleted" + CREDIT_NOTE_CREATED = "credit_note_created" + CREDIT_NOTE_CREATED_WITH_BACKDATING = "credit_note_created_with_backdating" + CREDIT_NOTE_UPDATED = "credit_note_updated" + CREDIT_NOTE_DELETED = "credit_note_deleted" + INVOICE_INSTALLMENTS_CREATED = "invoice_installments_created" + INVOICE_INSTALLMENT_UPDATED = "invoice_installment_updated" + INSTALLMENT_CONFIG_CREATED = "installment_config_created" + INSTALLMENT_CONFIG_DELETED = "installment_config_deleted" + SUBSCRIPTION_RENEWAL_REMINDER = "subscription_renewal_reminder" + ADD_USAGES_REMINDER = "add_usages_reminder" + TRANSACTION_CREATED = "transaction_created" + TRANSACTION_UPDATED = "transaction_updated" + TRANSACTION_DELETED = "transaction_deleted" + PAYMENT_SUCCEEDED = "payment_succeeded" + PAYMENT_FAILED = "payment_failed" + PAYMENT_REFUNDED = "payment_refunded" + PAYMENT_INITIATED = "payment_initiated" + REFUND_INITIATED = "refund_initiated" + AUTHORIZATION_SUCCEEDED = "authorization_succeeded" + AUTHORIZATION_VOIDED = "authorization_voided" + CARD_ADDED = "card_added" + CARD_UPDATED = "card_updated" + CARD_EXPIRY_REMINDER = "card_expiry_reminder" + CARD_EXPIRED = "card_expired" + CARD_DELETED = "card_deleted" + PAYMENT_SOURCE_ADDED = "payment_source_added" + PAYMENT_SOURCE_UPDATED = "payment_source_updated" + PAYMENT_SOURCE_DELETED = "payment_source_deleted" + PAYMENT_SOURCE_EXPIRING = "payment_source_expiring" + PAYMENT_SOURCE_EXPIRED = "payment_source_expired" + PAYMENT_SOURCE_LOCALLY_DELETED = "payment_source_locally_deleted" + VIRTUAL_BANK_ACCOUNT_ADDED = "virtual_bank_account_added" + VIRTUAL_BANK_ACCOUNT_UPDATED = "virtual_bank_account_updated" + VIRTUAL_BANK_ACCOUNT_DELETED = "virtual_bank_account_deleted" + TOKEN_CREATED = "token_created" + TOKEN_CONSUMED = "token_consumed" + TOKEN_EXPIRED = "token_expired" + UNBILLED_CHARGES_CREATED = "unbilled_charges_created" + UNBILLED_CHARGES_VOIDED = "unbilled_charges_voided" + UNBILLED_CHARGES_DELETED = "unbilled_charges_deleted" + UNBILLED_CHARGES_INVOICED = "unbilled_charges_invoiced" + ORDER_CREATED = "order_created" + ORDER_UPDATED = "order_updated" + ORDER_CANCELLED = "order_cancelled" + ORDER_DELIVERED = "order_delivered" + ORDER_RETURNED = "order_returned" + ORDER_READY_TO_PROCESS = "order_ready_to_process" + ORDER_READY_TO_SHIP = "order_ready_to_ship" + ORDER_DELETED = "order_deleted" + ORDER_RESENT = "order_resent" + QUOTE_CREATED = "quote_created" + QUOTE_UPDATED = "quote_updated" + QUOTE_DELETED = "quote_deleted" + TAX_WITHHELD_RECORDED = "tax_withheld_recorded" + TAX_WITHHELD_DELETED = "tax_withheld_deleted" + TAX_WITHHELD_REFUNDED = "tax_withheld_refunded" + GIFT_SCHEDULED = "gift_scheduled" + GIFT_UNCLAIMED = "gift_unclaimed" + GIFT_CLAIMED = "gift_claimed" + GIFT_EXPIRED = "gift_expired" + GIFT_CANCELLED = "gift_cancelled" + GIFT_UPDATED = "gift_updated" + HIERARCHY_CREATED = "hierarchy_created" + HIERARCHY_DELETED = "hierarchy_deleted" + PAYMENT_INTENT_CREATED = "payment_intent_created" + PAYMENT_INTENT_UPDATED = "payment_intent_updated" + CONTRACT_TERM_CREATED = "contract_term_created" + CONTRACT_TERM_RENEWED = "contract_term_renewed" + CONTRACT_TERM_TERMINATED = "contract_term_terminated" + CONTRACT_TERM_COMPLETED = "contract_term_completed" + CONTRACT_TERM_CANCELLED = "contract_term_cancelled" + ITEM_FAMILY_CREATED = "item_family_created" + ITEM_FAMILY_UPDATED = "item_family_updated" + ITEM_FAMILY_DELETED = "item_family_deleted" + ITEM_CREATED = "item_created" + ITEM_UPDATED = "item_updated" + ITEM_DELETED = "item_deleted" + ITEM_PRICE_CREATED = "item_price_created" + ITEM_PRICE_UPDATED = "item_price_updated" + ITEM_PRICE_DELETED = "item_price_deleted" + ATTACHED_ITEM_CREATED = "attached_item_created" + ATTACHED_ITEM_UPDATED = "attached_item_updated" + ATTACHED_ITEM_DELETED = "attached_item_deleted" + DIFFERENTIAL_PRICE_CREATED = "differential_price_created" + DIFFERENTIAL_PRICE_UPDATED = "differential_price_updated" + DIFFERENTIAL_PRICE_DELETED = "differential_price_deleted" + FEATURE_CREATED = "feature_created" + FEATURE_UPDATED = "feature_updated" + FEATURE_DELETED = "feature_deleted" + FEATURE_ACTIVATED = "feature_activated" + FEATURE_REACTIVATED = "feature_reactivated" + FEATURE_ARCHIVED = "feature_archived" + ITEM_ENTITLEMENTS_UPDATED = "item_entitlements_updated" + ENTITLEMENT_OVERRIDES_UPDATED = "entitlement_overrides_updated" + ENTITLEMENT_OVERRIDES_REMOVED = "entitlement_overrides_removed" + ITEM_ENTITLEMENTS_REMOVED = "item_entitlements_removed" + ENTITLEMENT_OVERRIDES_AUTO_REMOVED = "entitlement_overrides_auto_removed" + SUBSCRIPTION_ENTITLEMENTS_CREATED = "subscription_entitlements_created" + BUSINESS_ENTITY_CREATED = "business_entity_created" + BUSINESS_ENTITY_UPDATED = "business_entity_updated" + BUSINESS_ENTITY_DELETED = "business_entity_deleted" + CUSTOMER_BUSINESS_ENTITY_CHANGED = "customer_business_entity_changed" + SUBSCRIPTION_BUSINESS_ENTITY_CHANGED = "subscription_business_entity_changed" + PURCHASE_CREATED = "purchase_created" + VOUCHER_CREATED = "voucher_created" + VOUCHER_EXPIRED = "voucher_expired" + VOUCHER_CREATE_FAILED = "voucher_create_failed" + ITEM_PRICE_ENTITLEMENTS_UPDATED = "item_price_entitlements_updated" + ITEM_PRICE_ENTITLEMENTS_REMOVED = "item_price_entitlements_removed" + RAMP_CREATED = "ramp_created" + RAMP_DELETED = "ramp_deleted" + RAMP_APPLIED = "ramp_applied" + SUBSCRIPTION_RAMP_DRAFTED = "subscription_ramp_drafted" + SUBSCRIPTION_RAMP_UPDATED = "subscription_ramp_updated" + PRICE_VARIANT_CREATED = "price_variant_created" + PRICE_VARIANT_UPDATED = "price_variant_updated" + PRICE_VARIANT_DELETED = "price_variant_deleted" + CUSTOMER_ENTITLEMENTS_UPDATED = "customer_entitlements_updated" + SUBSCRIPTION_MOVED_IN = "subscription_moved_in" + SUBSCRIPTION_MOVED_OUT = "subscription_moved_out" + SUBSCRIPTION_MOVEMENT_FAILED = "subscription_movement_failed" + PLAN_CREATED = "plan_created" + PLAN_UPDATED = "plan_updated" + PLAN_DELETED = "plan_deleted" + ADDON_CREATED = "addon_created" + ADDON_UPDATED = "addon_updated" + ADDON_DELETED = "addon_deleted" + + def __str__(self): + return self.value + + +class ExportType(Enum): + DATA = "data" + IMPORT_FRIENDLY_DATA = "import_friendly_data" + + def __str__(self): + return self.value + + +class FreePeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class FriendOfferType(Enum): + NONE = "none" + COUPON = "coupon" + COUPON_CODE = "coupon_code" + + def __str__(self): + return self.value + + +class Gateway(Enum): + CHARGEBEE = "chargebee" + CHARGEBEE_PAYMENTS = "chargebee_payments" + STRIPE = "stripe" + WEPAY = "wepay" + BRAINTREE = "braintree" + AUTHORIZE_NET = "authorize_net" + PAYPAL_PRO = "paypal_pro" + PIN = "pin" + EWAY = "eway" + EWAY_RAPID = "eway_rapid" + WORLDPAY = "worldpay" + BALANCED_PAYMENTS = "balanced_payments" + BEANSTREAM = "beanstream" + BLUEPAY = "bluepay" + ELAVON = "elavon" + FIRST_DATA_GLOBAL = "first_data_global" + HDFC = "hdfc" + MIGS = "migs" + NMI = "nmi" + OGONE = "ogone" + PAYMILL = "paymill" + PAYPAL_PAYFLOW_PRO = "paypal_payflow_pro" + SAGE_PAY = "sage_pay" + TCO = "tco" + WIRECARD = "wirecard" + AMAZON_PAYMENTS = "amazon_payments" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + ADYEN = "adyen" + ORBITAL = "orbital" + MONERIS_US = "moneris_us" + MONERIS = "moneris" + BLUESNAP = "bluesnap" + CYBERSOURCE = "cybersource" + VANTIV = "vantiv" + CHECKOUT_COM = "checkout_com" + PAYPAL = "paypal" + INGENICO_DIRECT = "ingenico_direct" + EXACT = "exact" + MOLLIE = "mollie" + QUICKBOOKS = "quickbooks" + RAZORPAY = "razorpay" + GLOBAL_PAYMENTS = "global_payments" + BANK_OF_AMERICA = "bank_of_america" + ECENTRIC = "ecentric" + METRICS_GLOBAL = "metrics_global" + WINDCAVE = "windcave" + PAY_COM = "pay_com" + EBANX = "ebanx" + DLOCAL = "dlocal" + NUVEI = "nuvei" + GOCARDLESS = "gocardless" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class HierarchyOperationType(Enum): + COMPLETE_HIERARCHY = "complete_hierarchy" + SUBORDINATES = "subordinates" + PATH_TO_ROOT = "path_to_root" + + def __str__(self): + return self.value + + +class InvoiceDunningHandling(Enum): + CONTINUE = "continue" + STOP = "stop" + + def __str__(self): + return self.value + + +class ItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + +class Layout(Enum): + IN_APP = "in_app" + FULL_PAGE = "full_page" + + def __str__(self): + return self.value + + +class NotifyReferralSystem(Enum): + NONE = "none" + FIRST_PAID_CONVERSION = "first_paid_conversion" + ALL_INVOICES = "all_invoices" + + def __str__(self): + return self.value + + +class OfflinePaymentMethod(Enum): + NO_PREFERENCE = "no_preference" + CASH = "cash" + CHECK = "check" + BANK_TRANSFER = "bank_transfer" + ACH_CREDIT = "ach_credit" + SEPA_CREDIT = "sepa_credit" + BOLETO = "boleto" + US_AUTOMATED_BANK_TRANSFER = "us_automated_bank_transfer" + EU_AUTOMATED_BANK_TRANSFER = "eu_automated_bank_transfer" + UK_AUTOMATED_BANK_TRANSFER = "uk_automated_bank_transfer" + JP_AUTOMATED_BANK_TRANSFER = "jp_automated_bank_transfer" + MX_AUTOMATED_BANK_TRANSFER = "mx_automated_bank_transfer" + CUSTOM = "custom" + + def __str__(self): + return self.value + + +class OnEvent(Enum): + SUBSCRIPTION_CREATION = "subscription_creation" + SUBSCRIPTION_TRIAL_START = "subscription_trial_start" + PLAN_ACTIVATION = "plan_activation" + SUBSCRIPTION_ACTIVATION = "subscription_activation" + CONTRACT_TERMINATION = "contract_termination" + + def __str__(self): + return self.value + + +class Operation(Enum): + CREATE = "create" + UPDATE = "update" + DELETE = "delete" + + def __str__(self): + return self.value + + +class OperationType(Enum): + ADD = "add" + REMOVE = "remove" + + def __str__(self): + return self.value + + +class PauseOption(Enum): + IMMEDIATELY = "immediately" + END_OF_TERM = "end_of_term" + SPECIFIC_DATE = "specific_date" + BILLING_CYCLES = "billing_cycles" + + def __str__(self): + return self.value + + +class PaymentInitiator(Enum): + CUSTOMER = "customer" + MERCHANT = "merchant" + + def __str__(self): + return self.value + + +class PaymentMethod(Enum): + CASH = "cash" + CHECK = "check" + BANK_TRANSFER = "bank_transfer" + OTHER = "other" + CUSTOM = "custom" + CHARGEBACK = "chargeback" + CARD = "card" + AMAZON_PAYMENTS = "amazon_payments" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + DIRECT_DEBIT = "direct_debit" + ALIPAY = "alipay" + UNIONPAY = "unionpay" + APPLE_PAY = "apple_pay" + WECHAT_PAY = "wechat_pay" + ACH_CREDIT = "ach_credit" + SEPA_CREDIT = "sepa_credit" + IDEAL = "ideal" + GOOGLE_PAY = "google_pay" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GIROPAY = "giropay" + DOTPAY = "dotpay" + UPI = "upi" + NETBANKING_EMANDATES = "netbanking_emandates" + BOLETO = "boleto" + VENMO = "venmo" + PAY_TO = "pay_to" + FASTER_PAYMENTS = "faster_payments" + SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" + AUTOMATED_BANK_TRANSFER = "automated_bank_transfer" + KLARNA_PAY_NOW = "klarna_pay_now" + ONLINE_BANKING_POLAND = "online_banking_poland" + + def __str__(self): + return self.value + + +class PaymentMethodType(Enum): + CARD = "card" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + AMAZON_PAYMENTS = "amazon_payments" + DIRECT_DEBIT = "direct_debit" + GENERIC = "generic" + ALIPAY = "alipay" + UNIONPAY = "unionpay" + APPLE_PAY = "apple_pay" + WECHAT_PAY = "wechat_pay" + IDEAL = "ideal" + GOOGLE_PAY = "google_pay" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GIROPAY = "giropay" + DOTPAY = "dotpay" + UPI = "upi" + NETBANKING_EMANDATES = "netbanking_emandates" + VENMO = "venmo" + PAY_TO = "pay_to" + FASTER_PAYMENTS = "faster_payments" + SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" + AUTOMATED_BANK_TRANSFER = "automated_bank_transfer" + KLARNA_PAY_NOW = "klarna_pay_now" + ONLINE_BANKING_POLAND = "online_banking_poland" + + def __str__(self): + return self.value + + +class PaymentVoucherType(Enum): + BOLETO = "boleto" + + def __str__(self): + return self.value + + +class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class PriceType(Enum): + TAX_EXCLUSIVE = "tax_exclusive" + TAX_INCLUSIVE = "tax_inclusive" + + def __str__(self): + return self.value + + +class PricingModel(Enum): + FLAT_FEE = "flat_fee" + PER_UNIT = "per_unit" + TIERED = "tiered" + VOLUME = "volume" + STAIRSTEP = "stairstep" + + def __str__(self): + return self.value + + +class ProrationType(Enum): + FULL_TERM = "full_term" + PARTIAL_TERM = "partial_term" + NONE = "none" + + def __str__(self): + return self.value + + +class ReferralSystem(Enum): + REFERRAL_CANDY = "referral_candy" + REFERRAL_SAASQUATCH = "referral_saasquatch" + FRIENDBUY = "friendbuy" + + def __str__(self): + return self.value + + +class ReferrerRewardType(Enum): + NONE = "none" + REFERRAL_DIRECT_REWARD = "referral_direct_reward" + CUSTOM_PROMOTIONAL_CREDIT = "custom_promotional_credit" + CUSTOM_REVENUE_PERCENT_BASED = "custom_revenue_percent_based" + + def __str__(self): + return self.value + + +class RefundableCreditsHandling(Enum): + NO_ACTION = "no_action" + SCHEDULE_REFUND = "schedule_refund" + + def __str__(self): + return self.value + + +class ReportBy(Enum): + CUSTOMER = "customer" + INVOICE = "invoice" + PRODUCT = "product" + SUBSCRIPTION = "subscription" + + def __str__(self): + return self.value + + +class ResumeOption(Enum): + IMMEDIATELY = "immediately" + SPECIFIC_DATE = "specific_date" + + def __str__(self): + return self.value + + +class Role(Enum): + PRIMARY = "primary" + BACKUP = "backup" + NONE = "none" + + def __str__(self): + return self.value + + +class ScheduleType(Enum): + IMMEDIATE = "immediate" + SPECIFIC_DATES = "specific_dates" + FIXED_INTERVALS = "fixed_intervals" + + def __str__(self): + return self.value + + +class Source(Enum): + ADMIN_CONSOLE = "admin_console" + API = "api" + BULK_OPERATION = "bulk_operation" + SCHEDULED_JOB = "scheduled_job" + HOSTED_PAGE = "hosted_page" + PORTAL = "portal" + SYSTEM = "system" + NONE = "none" + JS_API = "js_api" + MIGRATION = "migration" + EXTERNAL_SERVICE = "external_service" + + def __str__(self): + return self.value + + +class TaxExemptReason(Enum): + TAX_NOT_CONFIGURED = "tax_not_configured" + REGION_NON_TAXABLE = "region_non_taxable" + EXPORT = "export" + CUSTOMER_EXEMPT = "customer_exempt" + PRODUCT_EXEMPT = "product_exempt" + ZERO_RATED = "zero_rated" + REVERSE_CHARGE = "reverse_charge" + HIGH_VALUE_PHYSICAL_GOODS = "high_value_physical_goods" + ZERO_VALUE_ITEM = "zero_value_item" + TAX_NOT_CONFIGURED_EXTERNAL_PROVIDER = "tax_not_configured_external_provider" + + def __str__(self): + return self.value + + +class TaxJurisType(Enum): + COUNTRY = "country" + FEDERAL = "federal" + STATE = "state" + COUNTY = "county" + CITY = "city" + SPECIAL = "special" + UNINCORPORATED = "unincorporated" + OTHER = "other" + + def __str__(self): + return self.value + + +class TaxOverrideReason(Enum): + ID_EXEMPT = "id_exempt" + CUSTOMER_EXEMPT = "customer_exempt" + EXPORT = "export" + + def __str__(self): + return self.value + + +class Taxability(Enum): + TAXABLE = "taxable" + EXEMPT = "exempt" + + def __str__(self): + return self.value + + +class TaxjarExemptionCategory(Enum): + WHOLESALE = "wholesale" + GOVERNMENT = "government" + OTHER = "other" + + def __str__(self): + return self.value + + +class TrialEndAction(Enum): + SITE_DEFAULT = "site_default" + PLAN_DEFAULT = "plan_default" + ACTIVATE_SUBSCRIPTION = "activate_subscription" + CANCEL_SUBSCRIPTION = "cancel_subscription" + + def __str__(self): + return self.value + + +class Type(Enum): + CARD = "card" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + AMAZON_PAYMENTS = "amazon_payments" + DIRECT_DEBIT = "direct_debit" + GENERIC = "generic" + ALIPAY = "alipay" + UNIONPAY = "unionpay" + APPLE_PAY = "apple_pay" + WECHAT_PAY = "wechat_pay" + IDEAL = "ideal" + GOOGLE_PAY = "google_pay" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GIROPAY = "giropay" + DOTPAY = "dotpay" + UPI = "upi" + NETBANKING_EMANDATES = "netbanking_emandates" + VENMO = "venmo" + PAY_TO = "pay_to" + FASTER_PAYMENTS = "faster_payments" + SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" + AUTOMATED_BANK_TRANSFER = "automated_bank_transfer" + KLARNA_PAY_NOW = "klarna_pay_now" + ONLINE_BANKING_POLAND = "online_banking_poland" + + def __str__(self): + return self.value + + +class UnbilledChargesHandling(Enum): + NO_ACTION = "no_action" + INVOICE = "invoice" + + def __str__(self): + return self.value + + +class UnbilledChargesOption(Enum): + INVOICE = "invoice" + DELETE = "delete" + + def __str__(self): + return self.value + + +class UnpaidInvoicesHandling(Enum): + NO_ACTION = "no_action" + SCHEDULE_PAYMENT_COLLECTION = "schedule_payment_collection" + + def __str__(self): + return self.value + + +class UsageAccumulationResetFrequency(Enum): + NEVER = "never" + SUBSCRIPTION_BILLING_FREQUENCY = "subscription_billing_frequency" + + def __str__(self): + return self.value + + +class ValidationStatus(Enum): + NOT_VALIDATED = "not_validated" + VALID = "valid" + PARTIALLY_VALID = "partially_valid" + INVALID = "invalid" + + def __str__(self): + return self.value + + +class VoucherType(Enum): + BOLETO = "boleto" + + def __str__(self): + return self.value diff --git a/chargebee/models/estimate/__init__.py b/chargebee/models/estimate/__init__.py new file mode 100644 index 0000000..8d2146a --- /dev/null +++ b/chargebee/models/estimate/__init__.py @@ -0,0 +1,3 @@ +from .operations import Estimate +from .responses import EstimateResponse +from .types import Estimates diff --git a/chargebee/models/estimate/operations.py b/chargebee/models/estimate/operations.py new file mode 100644 index 0000000..55d8f69 --- /dev/null +++ b/chargebee/models/estimate/operations.py @@ -0,0 +1,522 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Estimate: + + class CreateSubscriptionParams(TypedDict): + subscription: Required[CreateSubscriptionSubscriptionParams] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CreateSubscriptionAddonParams]] + event_based_addons: NotRequired[List[CreateSubscriptionEventBasedAddonParams]] + mandatory_addons_to_remove: NotRequired[List[str]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + billing_address: NotRequired[CreateSubscriptionBillingAddressParams] + shipping_address: NotRequired[CreateSubscriptionShippingAddressParams] + customer: NotRequired[CreateSubscriptionCustomerParams] + invoice_immediately: NotRequired[bool] + invoice_date: NotRequired[int] + contract_term: NotRequired[CreateSubscriptionContractTermParams] + tax_providers_fields: NotRequired[ + List[CreateSubscriptionTaxProvidersFieldParams] + ] + client_profile_id: NotRequired[str] + + class CreateSubItemEstimateParams(TypedDict): + subscription: NotRequired[CreateSubItemEstimateSubscriptionParams] + billing_cycles: NotRequired[int] + subscription_items: Required[List[CreateSubItemEstimateSubscriptionItemParams]] + discounts: Required[List[CreateSubItemEstimateDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[CreateSubItemEstimateItemTierParams]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + billing_address: NotRequired[CreateSubItemEstimateBillingAddressParams] + shipping_address: NotRequired[CreateSubItemEstimateShippingAddressParams] + customer: NotRequired[CreateSubItemEstimateCustomerParams] + invoice_immediately: NotRequired[bool] + invoice_date: NotRequired[int] + client_profile_id: NotRequired[str] + contract_term: NotRequired[CreateSubItemEstimateContractTermParams] + tax_providers_fields: NotRequired[ + List[CreateSubItemEstimateTaxProvidersFieldParams] + ] + + class CreateSubForCustomerEstimateParams(TypedDict): + use_existing_balances: NotRequired[bool] + subscription: NotRequired[CreateSubForCustomerEstimateSubscriptionParams] + invoice_immediately: NotRequired[bool] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CreateSubForCustomerEstimateAddonParams]] + event_based_addons: NotRequired[ + List[CreateSubForCustomerEstimateEventBasedAddonParams] + ] + mandatory_addons_to_remove: NotRequired[List[str]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[CreateSubForCustomerEstimateShippingAddressParams] + invoice_date: NotRequired[int] + coupon_ids: NotRequired[List[str]] + contract_term: NotRequired[CreateSubForCustomerEstimateContractTermParams] + + class CreateSubItemForCustomerEstimateParams(TypedDict): + use_existing_balances: NotRequired[bool] + subscription: NotRequired[CreateSubItemForCustomerEstimateSubscriptionParams] + invoice_immediately: NotRequired[bool] + billing_cycles: NotRequired[int] + subscription_items: Required[ + List[CreateSubItemForCustomerEstimateSubscriptionItemParams] + ] + discounts: Required[List[CreateSubItemForCustomerEstimateDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[CreateSubItemForCustomerEstimateItemTierParams]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[ + CreateSubItemForCustomerEstimateShippingAddressParams + ] + billing_address: NotRequired[ + CreateSubItemForCustomerEstimateBillingAddressParams + ] + invoice_date: NotRequired[int] + coupon_ids: NotRequired[List[str]] + contract_term: NotRequired[CreateSubItemForCustomerEstimateContractTermParams] + + class UpdateSubscriptionParams(TypedDict): + subscription: Required[UpdateSubscriptionSubscriptionParams] + changes_scheduled_at: NotRequired[int] + change_option: NotRequired[enums.ChangeOption] + addons: NotRequired[List[UpdateSubscriptionAddonParams]] + event_based_addons: NotRequired[List[UpdateSubscriptionEventBasedAddonParams]] + replace_addon_list: NotRequired[bool] + mandatory_addons_to_remove: NotRequired[List[str]] + invoice_date: NotRequired[int] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + prorate: NotRequired[bool] + end_of_term: NotRequired[bool] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + include_delayed_charges: NotRequired[bool] + use_existing_balances: NotRequired[bool] + billing_address: NotRequired[UpdateSubscriptionBillingAddressParams] + shipping_address: NotRequired[UpdateSubscriptionShippingAddressParams] + customer: NotRequired[UpdateSubscriptionCustomerParams] + invoice_immediately: NotRequired[bool] + + class UpdateSubscriptionForItemsParams(TypedDict): + subscription: Required[UpdateSubscriptionForItemsSubscriptionParams] + changes_scheduled_at: NotRequired[int] + change_option: NotRequired[enums.ChangeOption] + subscription_items: Required[ + List[UpdateSubscriptionForItemsSubscriptionItemParams] + ] + mandatory_items_to_remove: NotRequired[List[str]] + replace_items_list: NotRequired[bool] + discounts: Required[List[UpdateSubscriptionForItemsDiscountParams]] + item_tiers: NotRequired[List[UpdateSubscriptionForItemsItemTierParams]] + invoice_date: NotRequired[int] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + prorate: NotRequired[bool] + end_of_term: NotRequired[bool] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + include_delayed_charges: NotRequired[bool] + use_existing_balances: NotRequired[bool] + billing_address: NotRequired[UpdateSubscriptionForItemsBillingAddressParams] + shipping_address: NotRequired[UpdateSubscriptionForItemsShippingAddressParams] + customer: NotRequired[UpdateSubscriptionForItemsCustomerParams] + invoice_immediately: NotRequired[bool] + invoice_usages: NotRequired[bool] + + class RenewalEstimateParams(TypedDict): + include_delayed_charges: NotRequired[bool] + use_existing_balances: NotRequired[bool] + ignore_scheduled_cancellation: NotRequired[bool] + ignore_scheduled_changes: NotRequired[bool] + + class AdvanceInvoiceEstimateParams(TypedDict): + terms_to_charge: NotRequired[int] + specific_dates_schedule: NotRequired[ + List[AdvanceInvoiceEstimateSpecificDatesScheduleParams] + ] + fixed_interval_schedule: NotRequired[ + AdvanceInvoiceEstimateFixedIntervalScheduleParams + ] + invoice_immediately: NotRequired[bool] + schedule_type: NotRequired[enums.ScheduleType] + + class RegenerateInvoiceEstimateParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + prorate: NotRequired[bool] + invoice_immediately: NotRequired[bool] + + class ChangeTermEndParams(TypedDict): + term_ends_at: Required[int] + prorate: NotRequired[bool] + invoice_immediately: NotRequired[bool] + + class CancelSubscriptionParams(TypedDict): + cancel_option: NotRequired[enums.CancelOption] + end_of_term: NotRequired[bool] + cancel_at: NotRequired[int] + credit_option_for_current_term_charges: NotRequired[ + enums.CreditOptionForCurrentTermCharges + ] + unbilled_charges_option: NotRequired[enums.UnbilledChargesOption] + account_receivables_handling: NotRequired[enums.AccountReceivablesHandling] + refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] + contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] + invoice_date: NotRequired[int] + event_based_addons: NotRequired[List[CancelSubscriptionEventBasedAddonParams]] + cancel_reason_code: NotRequired[str] + + class CancelSubscriptionForItemsParams(TypedDict): + cancel_option: NotRequired[enums.CancelOption] + end_of_term: NotRequired[bool] + cancel_at: NotRequired[int] + credit_option_for_current_term_charges: NotRequired[ + enums.CreditOptionForCurrentTermCharges + ] + unbilled_charges_option: NotRequired[enums.UnbilledChargesOption] + account_receivables_handling: NotRequired[enums.AccountReceivablesHandling] + refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] + contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] + invoice_date: NotRequired[int] + subscription_items: NotRequired[ + List[CancelSubscriptionForItemsSubscriptionItemParams] + ] + cancel_reason_code: NotRequired[str] + + class PauseSubscriptionParams(TypedDict): + pause_option: NotRequired[enums.PauseOption] + subscription: NotRequired[PauseSubscriptionSubscriptionParams] + unbilled_charges_handling: NotRequired[enums.UnbilledChargesHandling] + + class ResumeSubscriptionParams(TypedDict): + resume_option: NotRequired[enums.ResumeOption] + subscription: NotRequired[ResumeSubscriptionSubscriptionParams] + charges_handling: NotRequired[enums.ChargesHandling] + + class GiftSubscriptionParams(TypedDict): + gift: NotRequired[GiftSubscriptionGiftParams] + gifter: Required[GiftSubscriptionGifterParams] + gift_receiver: Required[GiftSubscriptionGiftReceiverParams] + coupon_ids: NotRequired[List[str]] + payment_intent: NotRequired[GiftSubscriptionPaymentIntentParams] + shipping_address: NotRequired[GiftSubscriptionShippingAddressParams] + subscription: Required[GiftSubscriptionSubscriptionParams] + addons: NotRequired[List[GiftSubscriptionAddonParams]] + + class GiftSubscriptionForItemsParams(TypedDict): + gift: NotRequired[GiftSubscriptionForItemsGiftParams] + gifter: Required[GiftSubscriptionForItemsGifterParams] + gift_receiver: Required[GiftSubscriptionForItemsGiftReceiverParams] + coupon_ids: NotRequired[List[str]] + payment_intent: NotRequired[GiftSubscriptionForItemsPaymentIntentParams] + shipping_address: NotRequired[GiftSubscriptionForItemsShippingAddressParams] + subscription_items: NotRequired[ + List[GiftSubscriptionForItemsSubscriptionItemParams] + ] + + class CreateInvoiceParams(TypedDict): + invoice: NotRequired[CreateInvoiceInvoiceParams] + currency_code: NotRequired[str] + addons: NotRequired[List[CreateInvoiceAddonParams]] + charges: NotRequired[List[CreateInvoiceChargeParams]] + invoice_note: NotRequired[str] + remove_general_note: NotRequired[bool] + notes_to_remove: NotRequired[List[CreateInvoiceNotesToRemoveParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + authorization_transaction_id: NotRequired[str] + payment_source_id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + invoice_date: NotRequired[int] + shipping_address: NotRequired[CreateInvoiceShippingAddressParams] + tax_providers_fields: NotRequired[List[CreateInvoiceTaxProvidersFieldParams]] + + class CreateInvoiceForItemsParams(TypedDict): + invoice: NotRequired[CreateInvoiceForItemsInvoiceParams] + currency_code: NotRequired[str] + item_prices: NotRequired[List[CreateInvoiceForItemsItemPriceParams]] + item_tiers: NotRequired[List[CreateInvoiceForItemsItemTierParams]] + charges: NotRequired[List[CreateInvoiceForItemsChargeParams]] + invoice_note: NotRequired[str] + remove_general_note: NotRequired[bool] + notes_to_remove: NotRequired[List[CreateInvoiceForItemsNotesToRemoveParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + authorization_transaction_id: NotRequired[str] + payment_source_id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + discounts: Required[List[CreateInvoiceForItemsDiscountParams]] + shipping_address: NotRequired[CreateInvoiceForItemsShippingAddressParams] + tax_providers_fields: NotRequired[ + List[CreateInvoiceForItemsTaxProvidersFieldParams] + ] + invoice_date: NotRequired[int] + + @staticmethod + def create_subscription( + params: CreateSubscriptionParams, env=None, headers=None + ) -> CreateSubscriptionResponse: + return request.send( + "post", + request.uri_path("estimates", "create_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubscriptionResponse, + ) + + @staticmethod + def create_sub_item_estimate( + params: CreateSubItemEstimateParams, env=None, headers=None + ) -> CreateSubItemEstimateResponse: + return request.send( + "post", + request.uri_path("estimates", "create_subscription_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubItemEstimateResponse, + ) + + @staticmethod + def create_sub_for_customer_estimate( + id, params: CreateSubForCustomerEstimateParams, env=None, headers=None + ) -> CreateSubForCustomerEstimateResponse: + return request.send( + "get", + request.uri_path("customers", id, "create_subscription_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubForCustomerEstimateResponse, + ) + + @staticmethod + def create_sub_item_for_customer_estimate( + id, params: CreateSubItemForCustomerEstimateParams, env=None, headers=None + ) -> CreateSubItemForCustomerEstimateResponse: + return request.send( + "post", + request.uri_path("customers", id, "create_subscription_for_items_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubItemForCustomerEstimateResponse, + ) + + @staticmethod + def update_subscription( + params: UpdateSubscriptionParams, env=None, headers=None + ) -> UpdateSubscriptionResponse: + return request.send( + "post", + request.uri_path("estimates", "update_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateSubscriptionResponse, + ) + + @staticmethod + def update_subscription_for_items( + params: UpdateSubscriptionForItemsParams, env=None, headers=None + ) -> UpdateSubscriptionForItemsResponse: + return request.send( + "post", + request.uri_path("estimates", "update_subscription_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateSubscriptionForItemsResponse, + ) + + @staticmethod + def renewal_estimate( + id, params: RenewalEstimateParams = None, env=None, headers=None + ) -> RenewalEstimateResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "renewal_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + RenewalEstimateResponse, + ) + + @staticmethod + def advance_invoice_estimate( + id, params: AdvanceInvoiceEstimateParams = None, env=None, headers=None + ) -> AdvanceInvoiceEstimateResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "advance_invoice_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + AdvanceInvoiceEstimateResponse, + ) + + @staticmethod + def regenerate_invoice_estimate( + id, params: RegenerateInvoiceEstimateParams = None, env=None, headers=None + ) -> RegenerateInvoiceEstimateResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "regenerate_invoice_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + RegenerateInvoiceEstimateResponse, + ) + + @staticmethod + def upcoming_invoices_estimate( + id, env=None, headers=None + ) -> UpcomingInvoicesEstimateResponse: + return request.send( + "get", + request.uri_path("customers", id, "upcoming_invoices_estimate"), + None, + env, + headers, + UpcomingInvoicesEstimateResponse, + ) + + @staticmethod + def change_term_end( + id, params: ChangeTermEndParams, env=None, headers=None + ) -> ChangeTermEndResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "change_term_end_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + ChangeTermEndResponse, + ) + + @staticmethod + def cancel_subscription( + id, params: CancelSubscriptionParams = None, env=None, headers=None + ) -> CancelSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "cancel_subscription_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + CancelSubscriptionResponse, + ) + + @staticmethod + def cancel_subscription_for_items( + id, params: CancelSubscriptionForItemsParams = None, env=None, headers=None + ) -> CancelSubscriptionForItemsResponse: + return request.send( + "post", + request.uri_path( + "subscriptions", id, "cancel_subscription_for_items_estimate" + ), + cast(Dict[Any, Any], params), + env, + headers, + CancelSubscriptionForItemsResponse, + ) + + @staticmethod + def pause_subscription( + id, params: PauseSubscriptionParams = None, env=None, headers=None + ) -> PauseSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "pause_subscription_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + PauseSubscriptionResponse, + ) + + @staticmethod + def resume_subscription( + id, params: ResumeSubscriptionParams = None, env=None, headers=None + ) -> ResumeSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "resume_subscription_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + ResumeSubscriptionResponse, + ) + + @staticmethod + def gift_subscription( + params: GiftSubscriptionParams, env=None, headers=None + ) -> GiftSubscriptionResponse: + return request.send( + "post", + request.uri_path("estimates", "gift_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + GiftSubscriptionResponse, + ) + + @staticmethod + def gift_subscription_for_items( + params: GiftSubscriptionForItemsParams, env=None, headers=None + ) -> GiftSubscriptionForItemsResponse: + return request.send( + "post", + request.uri_path("estimates", "gift_subscription_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + GiftSubscriptionForItemsResponse, + ) + + @staticmethod + def create_invoice( + params: CreateInvoiceParams = None, env=None, headers=None + ) -> CreateInvoiceResponse: + return request.send( + "post", + request.uri_path("estimates", "create_invoice"), + cast(Dict[Any, Any], params), + env, + headers, + CreateInvoiceResponse, + ) + + @staticmethod + def create_invoice_for_items( + params: CreateInvoiceForItemsParams, env=None, headers=None + ) -> CreateInvoiceForItemsResponse: + return request.send( + "post", + request.uri_path("estimates", "create_invoice_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateInvoiceForItemsResponse, + ) diff --git a/chargebee/models/estimate/responses.py b/chargebee/models/estimate/responses.py new file mode 100644 index 0000000..2448583 --- /dev/null +++ b/chargebee/models/estimate/responses.py @@ -0,0 +1,142 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + payment_intent, + contract_term, + subscription_estimate, + invoice_estimate, + credit_note_estimate, + unbilled_charge, +) + + +@dataclass +class EstimateResponse(Model): + raw_data: Dict[Any, Any] = None + created_at: int = None + subscription_estimate: "subscription_estimate.SubscriptionEstimatesResponse" = None + subscription_estimates: List[ + "subscription_estimate.SubscriptionEstimatesResponse" + ] = None + invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None + invoice_estimates: List["invoice_estimate.InvoiceEstimatesResponse"] = None + next_invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None + credit_note_estimates: List["credit_note_estimate.CreditNoteEstimateResponse"] = ( + None + ) + unbilled_charge_estimates: List["unbilled_charge.UnbilledChargeResponse"] = None + + +@dataclass +class CreateSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateSubItemEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateSubForCustomerEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateSubItemForCustomerEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateSubscriptionForItemsResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RenewalEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AdvanceInvoiceEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RegenerateInvoiceEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpcomingInvoicesEstimateResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChangeTermEndResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelSubscriptionForItemsResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PauseSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ResumeSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class GiftSubscriptionResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class GiftSubscriptionForItemsResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateInvoiceResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateInvoiceForItemsResponse: + estimate: EstimateResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/estimate/types.py b/chargebee/models/estimate/types.py new file mode 100644 index 0000000..7a2f04e --- /dev/null +++ b/chargebee/models/estimate/types.py @@ -0,0 +1,784 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import ( + enums, + payment_intent, + contract_term, + subscription_estimate, + invoice_estimate, + credit_note_estimate, + unbilled_charge, +) + + +class UnbilledChargeEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class Estimates(TypedDict): + created_at: Required[int] + subscription_estimate: NotRequired[subscription_estimate.SubscriptionEstimates] + subscription_estimates: NotRequired[ + List[subscription_estimate.SubscriptionEstimates] + ] + invoice_estimate: NotRequired[invoice_estimate.InvoiceEstimates] + invoice_estimates: NotRequired[List[invoice_estimate.InvoiceEstimates]] + next_invoice_estimate: NotRequired[invoice_estimate.InvoiceEstimates] + credit_note_estimates: NotRequired[List[credit_note_estimate.CreditNoteEstimate]] + unbilled_charge_estimates: NotRequired[List[unbilled_charge.UnbilledCharge]] + + +class CreateSubscriptionSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: 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] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class CreateSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class CreateSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CreateSubscriptionBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubscriptionShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubscriptionCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + +class CreateSubscriptionContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CreateSubscriptionTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateSubItemEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class CreateSubItemEstimateSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class CreateSubItemEstimateDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class CreateSubItemEstimateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateSubItemEstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubItemEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubItemEstimateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + +class CreateSubItemEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + +class CreateSubItemEstimateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateSubForCustomerEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: 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] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class CreateSubForCustomerEstimateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class CreateSubForCustomerEstimateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CreateSubForCustomerEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubForCustomerEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CreateSubItemForCustomerEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class CreateSubItemForCustomerEstimateSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class CreateSubItemForCustomerEstimateDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class CreateSubItemForCustomerEstimateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateSubItemForCustomerEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubItemForCustomerEstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubItemForCustomerEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + +class UpdateSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class UpdateSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + proration_type: NotRequired[enums.ProrationType] + + +class UpdateSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class UpdateSubscriptionBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + + +class UpdateSubscriptionForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + trial_end_action: NotRequired[enums.TrialEndAction] + + +class UpdateSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + proration_type: NotRequired[enums.ProrationType] + + +class UpdateSubscriptionForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + +class UpdateSubscriptionForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateSubscriptionForItemsBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionForItemsShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + + +class AdvanceInvoiceEstimateSpecificDatesScheduleParams(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + +class AdvanceInvoiceEstimateFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + +class CancelSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + + +class CancelSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + +class PauseSubscriptionSubscriptionParams(TypedDict): + pause_date: NotRequired[int] + resume_date: NotRequired[int] + skip_billing_cycles: NotRequired[int] + + +class ResumeSubscriptionSubscriptionParams(TypedDict): + resume_date: NotRequired[int] + + +class GiftSubscriptionGiftParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + + +class GiftSubscriptionGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + +class GiftSubscriptionGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + +class GiftSubscriptionPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class GiftSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class GiftSubscriptionSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + + +class GiftSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class GiftSubscriptionForItemsGiftParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + + +class GiftSubscriptionForItemsGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + +class GiftSubscriptionForItemsGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + +class GiftSubscriptionForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class GiftSubscriptionForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class GiftSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class CreateInvoiceInvoiceParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + po_number: NotRequired[str] + + +class CreateInvoiceAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateInvoiceChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateInvoiceNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + +class CreateInvoiceShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateInvoiceTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateInvoiceForItemsInvoiceParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + po_number: NotRequired[str] + + +class CreateInvoiceForItemsItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateInvoiceForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateInvoiceForItemsChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateInvoiceForItemsNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + +class CreateInvoiceForItemsDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + +class CreateInvoiceForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateInvoiceForItemsTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] diff --git a/chargebee/models/event/__init__.py b/chargebee/models/event/__init__.py new file mode 100644 index 0000000..2a42706 --- /dev/null +++ b/chargebee/models/event/__init__.py @@ -0,0 +1,3 @@ +from .operations import Event +from .responses import EventResponse +from .types import Events, Webhook, WebhookStatus diff --git a/chargebee/models/event/operations.py b/chargebee/models/event/operations.py new file mode 100644 index 0000000..a699e7a --- /dev/null +++ b/chargebee/models/event/operations.py @@ -0,0 +1,39 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +import json +from chargebee.main import Environment +from chargebee.filters import Filters + + +class Event: + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + start_time: NotRequired[int] + end_time: NotRequired[int] + id: NotRequired[Filters.StringFilter] + webhook_status: NotRequired[Filters.EnumFilter] + event_type: NotRequired[Filters.EnumFilter] + source: NotRequired[Filters.EnumFilter] + occurred_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("events"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("events", id), None, env, headers, RetrieveResponse + ) diff --git a/chargebee/models/event/responses.py b/chargebee/models/event/responses.py new file mode 100644 index 0000000..5a6696c --- /dev/null +++ b/chargebee/models/event/responses.py @@ -0,0 +1,43 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class WebhookResponse(Model): + id: str = None + webhook_status: str = None + + +@dataclass +class EventResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + occurred_at: int = None + source: str = None + user: str = None + webhook_status: str = None + webhook_failure_reason: str = None + webhooks: List[WebhookResponse] = None + event_type: str = None + api_version: str = None + content: Dict[Any, Any] = None + origin_user: str = None + + +@dataclass +class ListEventResponse: + event: EventResponse + + +@dataclass +class ListResponse: + list: List[ListEventResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + event: EventResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/event/types.py b/chargebee/models/event/types.py new file mode 100644 index 0000000..818dc3e --- /dev/null +++ b/chargebee/models/event/types.py @@ -0,0 +1,48 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class WebhookStatus(Enum): + NOT_CONFIGURED = "not_configured" + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + RE_SCHEDULED = "re_scheduled" + FAILED = "failed" + SKIPPED = "skipped" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class WebhookWebhookStatus(Enum): + NOT_CONFIGURED = "not_configured" + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + RE_SCHEDULED = "re_scheduled" + FAILED = "failed" + SKIPPED = "skipped" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class Webhook(TypedDict): + id: Required[str] + webhook_status: Required[WebhookWebhookStatus] + + +class Events(TypedDict): + id: Required[str] + occurred_at: Required[int] + source: Required[enums.Source] + user: NotRequired[str] + webhook_status: Required[WebhookStatus] + webhook_failure_reason: NotRequired[str] + webhooks: NotRequired[List[Webhook]] + event_type: NotRequired[enums.EventType] + api_version: NotRequired[enums.ApiVersion] + content: Required[Dict[Any, Any]] + origin_user: NotRequired[str] diff --git a/chargebee/models/export/__init__.py b/chargebee/models/export/__init__.py new file mode 100644 index 0000000..64675e1 --- /dev/null +++ b/chargebee/models/export/__init__.py @@ -0,0 +1,3 @@ +from .operations import Export +from .responses import ExportResponse +from .types import Exports, Download, MimeType, Status diff --git a/chargebee/models/export/operations.py b/chargebee/models/export/operations.py new file mode 100644 index 0000000..195806b --- /dev/null +++ b/chargebee/models/export/operations.py @@ -0,0 +1,325 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.models import enums + + +class Export: + + class RevenueRecognitionParams(TypedDict): + invoice: NotRequired[RevenueRecognitionInvoiceParams] + subscription: NotRequired[RevenueRecognitionSubscriptionParams] + customer: NotRequired[RevenueRecognitionCustomerParams] + relationship: NotRequired[RevenueRecognitionRelationshipParams] + report_by: Required[enums.ReportBy] + currency_code: NotRequired[str] + report_from_month: Required[int] + report_from_year: Required[int] + report_to_month: Required[int] + report_to_year: Required[int] + include_discounts: NotRequired[bool] + payment_owner: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + item_price_id: NotRequired[Filters.StringFilter] + cancel_reason_code: NotRequired[Filters.StringFilter] + business_entity_id: NotRequired[Filters.StringFilter] + + class DeferredRevenueParams(TypedDict): + invoice: NotRequired[DeferredRevenueInvoiceParams] + subscription: NotRequired[DeferredRevenueSubscriptionParams] + customer: NotRequired[DeferredRevenueCustomerParams] + relationship: NotRequired[DeferredRevenueRelationshipParams] + report_by: Required[enums.ReportBy] + currency_code: NotRequired[str] + report_from_month: Required[int] + report_from_year: Required[int] + report_to_month: Required[int] + report_to_year: Required[int] + include_discounts: NotRequired[bool] + payment_owner: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + item_price_id: NotRequired[Filters.StringFilter] + cancel_reason_code: NotRequired[Filters.StringFilter] + business_entity_id: NotRequired[Filters.StringFilter] + + class PlansParams(TypedDict): + plan: NotRequired[PlansPlanParams] + currency_code: NotRequired[Filters.StringFilter] + + class AddonsParams(TypedDict): + addon: NotRequired[AddonsAddonParams] + currency_code: NotRequired[Filters.StringFilter] + + class CouponsParams(TypedDict): + coupon: NotRequired[CouponsCouponParams] + currency_code: NotRequired[Filters.StringFilter] + + class CustomersParams(TypedDict): + customer: NotRequired[CustomersCustomerParams] + relationship: NotRequired[CustomersRelationshipParams] + export_type: NotRequired[enums.ExportType] + business_entity_id: NotRequired[Filters.StringFilter] + + class SubscriptionsParams(TypedDict): + subscription: NotRequired[SubscriptionsSubscriptionParams] + export_type: NotRequired[enums.ExportType] + item_id: NotRequired[Filters.StringFilter] + item_price_id: NotRequired[Filters.StringFilter] + cancel_reason_code: NotRequired[Filters.StringFilter] + + class InvoicesParams(TypedDict): + invoice: NotRequired[InvoicesInvoiceParams] + payment_owner: NotRequired[Filters.StringFilter] + + class CreditNotesParams(TypedDict): + credit_note: NotRequired[CreditNotesCreditNoteParams] + + class TransactionsParams(TypedDict): + transaction: NotRequired[TransactionsTransactionParams] + + class OrdersParams(TypedDict): + order: NotRequired[OrdersOrderParams] + total: NotRequired[Filters.NumberFilter] + + class ItemFamiliesParams(TypedDict): + item_family: NotRequired[ItemFamiliesItemFamilyParams] + + class ItemsParams(TypedDict): + item: NotRequired[ItemsItemParams] + + class ItemPricesParams(TypedDict): + item_price: NotRequired[ItemPricesItemPriceParams] + item_family_id: NotRequired[Filters.StringFilter] + item_type: NotRequired[Filters.EnumFilter] + currency_code: NotRequired[Filters.StringFilter] + + class AttachedItemsParams(TypedDict): + attached_item: NotRequired[AttachedItemsAttachedItemParams] + item_type: NotRequired[Filters.EnumFilter] + + class DifferentialPricesParams(TypedDict): + differential_price: NotRequired[DifferentialPricesDifferentialPriceParams] + item_id: NotRequired[Filters.StringFilter] + + class PriceVariantsParams(TypedDict): + price_variant: NotRequired[PriceVariantsPriceVariantParams] + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("exports", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def revenue_recognition( + params: RevenueRecognitionParams, env=None, headers=None + ) -> RevenueRecognitionResponse: + return request.send( + "post", + request.uri_path("exports", "revenue_recognition"), + cast(Dict[Any, Any], params), + env, + headers, + RevenueRecognitionResponse, + ) + + @staticmethod + def deferred_revenue( + params: DeferredRevenueParams, env=None, headers=None + ) -> DeferredRevenueResponse: + return request.send( + "post", + request.uri_path("exports", "deferred_revenue"), + cast(Dict[Any, Any], params), + env, + headers, + DeferredRevenueResponse, + ) + + @staticmethod + def plans(params: PlansParams = None, env=None, headers=None) -> PlansResponse: + return request.send( + "post", + request.uri_path("exports", "plans"), + cast(Dict[Any, Any], params), + env, + headers, + PlansResponse, + ) + + @staticmethod + def addons(params: AddonsParams = None, env=None, headers=None) -> AddonsResponse: + return request.send( + "post", + request.uri_path("exports", "addons"), + cast(Dict[Any, Any], params), + env, + headers, + AddonsResponse, + ) + + @staticmethod + def coupons( + params: CouponsParams = None, env=None, headers=None + ) -> CouponsResponse: + return request.send( + "post", + request.uri_path("exports", "coupons"), + cast(Dict[Any, Any], params), + env, + headers, + CouponsResponse, + ) + + @staticmethod + def customers( + params: CustomersParams = None, env=None, headers=None + ) -> CustomersResponse: + return request.send( + "post", + request.uri_path("exports", "customers"), + cast(Dict[Any, Any], params), + env, + headers, + CustomersResponse, + ) + + @staticmethod + def subscriptions( + params: SubscriptionsParams = None, env=None, headers=None + ) -> SubscriptionsResponse: + return request.send( + "post", + request.uri_path("exports", "subscriptions"), + cast(Dict[Any, Any], params), + env, + headers, + SubscriptionsResponse, + ) + + @staticmethod + def invoices( + params: InvoicesParams = None, env=None, headers=None + ) -> InvoicesResponse: + return request.send( + "post", + request.uri_path("exports", "invoices"), + cast(Dict[Any, Any], params), + env, + headers, + InvoicesResponse, + ) + + @staticmethod + def credit_notes( + params: CreditNotesParams = None, env=None, headers=None + ) -> CreditNotesResponse: + return request.send( + "post", + request.uri_path("exports", "credit_notes"), + cast(Dict[Any, Any], params), + env, + headers, + CreditNotesResponse, + ) + + @staticmethod + def transactions( + params: TransactionsParams = None, env=None, headers=None + ) -> TransactionsResponse: + return request.send( + "post", + request.uri_path("exports", "transactions"), + cast(Dict[Any, Any], params), + env, + headers, + TransactionsResponse, + ) + + @staticmethod + def orders(params: OrdersParams = None, env=None, headers=None) -> OrdersResponse: + return request.send( + "post", + request.uri_path("exports", "orders"), + cast(Dict[Any, Any], params), + env, + headers, + OrdersResponse, + ) + + @staticmethod + def item_families( + params: ItemFamiliesParams = None, env=None, headers=None + ) -> ItemFamiliesResponse: + return request.send( + "post", + request.uri_path("exports", "item_families"), + cast(Dict[Any, Any], params), + env, + headers, + ItemFamiliesResponse, + ) + + @staticmethod + def items(params: ItemsParams = None, env=None, headers=None) -> ItemsResponse: + return request.send( + "post", + request.uri_path("exports", "items"), + cast(Dict[Any, Any], params), + env, + headers, + ItemsResponse, + ) + + @staticmethod + def item_prices( + params: ItemPricesParams = None, env=None, headers=None + ) -> ItemPricesResponse: + return request.send( + "post", + request.uri_path("exports", "item_prices"), + cast(Dict[Any, Any], params), + env, + headers, + ItemPricesResponse, + ) + + @staticmethod + def attached_items( + params: AttachedItemsParams = None, env=None, headers=None + ) -> AttachedItemsResponse: + return request.send( + "post", + request.uri_path("exports", "attached_items"), + cast(Dict[Any, Any], params), + env, + headers, + AttachedItemsResponse, + ) + + @staticmethod + def differential_prices( + params: DifferentialPricesParams = None, env=None, headers=None + ) -> DifferentialPricesResponse: + return request.send( + "post", + request.uri_path("exports", "differential_prices"), + cast(Dict[Any, Any], params), + env, + headers, + DifferentialPricesResponse, + ) + + @staticmethod + def price_variants( + params: PriceVariantsParams = None, env=None, headers=None + ) -> PriceVariantsResponse: + return request.send( + "post", + request.uri_path("exports", "price_variants"), + cast(Dict[Any, Any], params), + env, + headers, + PriceVariantsResponse, + ) diff --git a/chargebee/models/export/responses.py b/chargebee/models/export/responses.py new file mode 100644 index 0000000..e3038f2 --- /dev/null +++ b/chargebee/models/export/responses.py @@ -0,0 +1,129 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class DownloadResponse(Model): + download_url: str = None + valid_till: int = None + mime_type: str = None + + +@dataclass +class ExportResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + operation_type: str = None + mime_type: str = None + status: str = None + created_at: int = None + download: DownloadResponse = None + + +@dataclass +class RetrieveResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RevenueRecognitionResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeferredRevenueResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PlansResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddonsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CouponsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CustomersResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SubscriptionsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class InvoicesResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreditNotesResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class TransactionsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class OrdersResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ItemFamiliesResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ItemsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ItemPricesResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AttachedItemsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DifferentialPricesResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PriceVariantsResponse: + export: ExportResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/export/types.py b/chargebee/models/export/types.py new file mode 100644 index 0000000..6d7f7b7 --- /dev/null +++ b/chargebee/models/export/types.py @@ -0,0 +1,364 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.filters import Filters + + +class MimeType(Enum): + PDF = "pdf" + ZIP = "zip" + + def __str__(self): + return self.value + + +class Status(Enum): + IN_PROCESS = "in_process" + COMPLETED = "completed" + FAILED = "failed" + + def __str__(self): + return self.value + + +class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + +class Exports(TypedDict): + id: Required[str] + operation_type: Required[str] + mime_type: Required[MimeType] + status: Required[Status] + created_at: Required[int] + download: NotRequired[Download] + + +class RevenueRecognitionInvoiceParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Recurring: NotRequired[Filters.BooleanFilter] + Status: NotRequired[Filters.EnumFilter] + PriceType: NotRequired[Filters.EnumFilter] + Date: NotRequired[Filters.TimestampFilter] + PaidAt: NotRequired[Filters.TimestampFilter] + Total: NotRequired[Filters.NumberFilter] + AmountPaid: NotRequired[Filters.NumberFilter] + AmountAdjusted: NotRequired[Filters.NumberFilter] + CreditsApplied: NotRequired[Filters.NumberFilter] + AmountDue: NotRequired[Filters.NumberFilter] + DunningStatus: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class RevenueRecognitionSubscriptionParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + CancelReason: NotRequired[Filters.EnumFilter] + RemainingBillingCycles: NotRequired[Filters.NumberFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + ActivatedAt: NotRequired[Filters.TimestampFilter] + NextBillingAt: NotRequired[Filters.TimestampFilter] + CancelledAt: NotRequired[Filters.TimestampFilter] + HasScheduledChanges: NotRequired[Filters.BooleanFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + PlanId: NotRequired[Filters.StringFilter] + + +class RevenueRecognitionCustomerParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + FirstName: NotRequired[Filters.StringFilter] + LastName: NotRequired[Filters.StringFilter] + Email: NotRequired[Filters.StringFilter] + Company: NotRequired[Filters.StringFilter] + Phone: NotRequired[Filters.StringFilter] + AutoCollection: NotRequired[Filters.EnumFilter] + Taxability: NotRequired[Filters.EnumFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class RevenueRecognitionRelationshipParams(TypedDict): + ParentId: NotRequired[Filters.StringFilter] + PaymentOwnerId: NotRequired[Filters.StringFilter] + InvoiceOwnerId: NotRequired[Filters.StringFilter] + + +class DeferredRevenueInvoiceParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Recurring: NotRequired[Filters.BooleanFilter] + Status: NotRequired[Filters.EnumFilter] + PriceType: NotRequired[Filters.EnumFilter] + Date: NotRequired[Filters.TimestampFilter] + PaidAt: NotRequired[Filters.TimestampFilter] + Total: NotRequired[Filters.NumberFilter] + AmountPaid: NotRequired[Filters.NumberFilter] + AmountAdjusted: NotRequired[Filters.NumberFilter] + CreditsApplied: NotRequired[Filters.NumberFilter] + AmountDue: NotRequired[Filters.NumberFilter] + DunningStatus: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class DeferredRevenueSubscriptionParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + CancelReason: NotRequired[Filters.EnumFilter] + RemainingBillingCycles: NotRequired[Filters.NumberFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + ActivatedAt: NotRequired[Filters.TimestampFilter] + NextBillingAt: NotRequired[Filters.TimestampFilter] + CancelledAt: NotRequired[Filters.TimestampFilter] + HasScheduledChanges: NotRequired[Filters.BooleanFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + PlanId: NotRequired[Filters.StringFilter] + + +class DeferredRevenueCustomerParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + FirstName: NotRequired[Filters.StringFilter] + LastName: NotRequired[Filters.StringFilter] + Email: NotRequired[Filters.StringFilter] + Company: NotRequired[Filters.StringFilter] + Phone: NotRequired[Filters.StringFilter] + AutoCollection: NotRequired[Filters.EnumFilter] + Taxability: NotRequired[Filters.EnumFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class DeferredRevenueRelationshipParams(TypedDict): + ParentId: NotRequired[Filters.StringFilter] + PaymentOwnerId: NotRequired[Filters.StringFilter] + InvoiceOwnerId: NotRequired[Filters.StringFilter] + + +class PlansPlanParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + Price: NotRequired[Filters.NumberFilter] + Period: NotRequired[Filters.NumberFilter] + PeriodUnit: NotRequired[Filters.EnumFilter] + TrialPeriod: NotRequired[Filters.NumberFilter] + TrialPeriodUnit: NotRequired[Filters.EnumFilter] + AddonApplicability: NotRequired[Filters.EnumFilter] + Giftable: NotRequired[Filters.BooleanFilter] + Status: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class AddonsAddonParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + ChargeType: NotRequired[Filters.EnumFilter] + Price: NotRequired[Filters.NumberFilter] + Period: NotRequired[Filters.NumberFilter] + PeriodUnit: NotRequired[Filters.EnumFilter] + Status: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class CouponsCouponParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + DiscountType: NotRequired[Filters.EnumFilter] + DurationType: NotRequired[Filters.EnumFilter] + Status: NotRequired[Filters.EnumFilter] + ApplyOn: NotRequired[Filters.EnumFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + + +class CustomersCustomerParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + FirstName: NotRequired[Filters.StringFilter] + LastName: NotRequired[Filters.StringFilter] + Email: NotRequired[Filters.StringFilter] + Company: NotRequired[Filters.StringFilter] + Phone: NotRequired[Filters.StringFilter] + AutoCollection: NotRequired[Filters.EnumFilter] + Taxability: NotRequired[Filters.EnumFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class CustomersRelationshipParams(TypedDict): + ParentId: NotRequired[Filters.StringFilter] + PaymentOwnerId: NotRequired[Filters.StringFilter] + InvoiceOwnerId: NotRequired[Filters.StringFilter] + + +class SubscriptionsSubscriptionParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + CancelReason: NotRequired[Filters.EnumFilter] + RemainingBillingCycles: NotRequired[Filters.NumberFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] + ActivatedAt: NotRequired[Filters.TimestampFilter] + NextBillingAt: NotRequired[Filters.TimestampFilter] + CancelledAt: NotRequired[Filters.TimestampFilter] + HasScheduledChanges: NotRequired[Filters.BooleanFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + OfflinePaymentMethod: NotRequired[Filters.EnumFilter] + AutoCloseInvoices: NotRequired[Filters.BooleanFilter] + Channel: NotRequired[Filters.EnumFilter] + PlanId: NotRequired[Filters.StringFilter] + + +class InvoicesInvoiceParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + SubscriptionId: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + Recurring: NotRequired[Filters.BooleanFilter] + Status: NotRequired[Filters.EnumFilter] + PriceType: NotRequired[Filters.EnumFilter] + Date: NotRequired[Filters.TimestampFilter] + PaidAt: NotRequired[Filters.TimestampFilter] + Total: NotRequired[Filters.NumberFilter] + AmountPaid: NotRequired[Filters.NumberFilter] + AmountAdjusted: NotRequired[Filters.NumberFilter] + CreditsApplied: NotRequired[Filters.NumberFilter] + AmountDue: NotRequired[Filters.NumberFilter] + DunningStatus: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class CreditNotesCreditNoteParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + SubscriptionId: NotRequired[Filters.StringFilter] + ReferenceInvoiceId: NotRequired[Filters.StringFilter] + Type: NotRequired[Filters.EnumFilter] + ReasonCode: NotRequired[Filters.EnumFilter] + CreateReasonCode: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + Date: NotRequired[Filters.TimestampFilter] + Total: NotRequired[Filters.NumberFilter] + PriceType: NotRequired[Filters.EnumFilter] + AmountAllocated: NotRequired[Filters.NumberFilter] + AmountRefunded: NotRequired[Filters.NumberFilter] + AmountAvailable: NotRequired[Filters.NumberFilter] + VoidedAt: NotRequired[Filters.TimestampFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class TransactionsTransactionParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + SubscriptionId: NotRequired[Filters.StringFilter] + PaymentSourceId: NotRequired[Filters.StringFilter] + PaymentMethod: NotRequired[Filters.EnumFilter] + Gateway: NotRequired[Filters.EnumFilter] + GatewayAccountId: NotRequired[Filters.StringFilter] + IdAtGateway: NotRequired[Filters.StringFilter] + ReferenceNumber: NotRequired[Filters.StringFilter] + Type: NotRequired[Filters.EnumFilter] + Date: NotRequired[Filters.TimestampFilter] + Amount: NotRequired[Filters.NumberFilter] + AmountCapturable: NotRequired[Filters.NumberFilter] + Status: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + + +class OrdersOrderParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + SubscriptionId: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + PriceType: NotRequired[Filters.EnumFilter] + OrderDate: NotRequired[Filters.TimestampFilter] + ShippingDate: NotRequired[Filters.TimestampFilter] + ShippedAt: NotRequired[Filters.TimestampFilter] + DeliveredAt: NotRequired[Filters.TimestampFilter] + CancelledAt: NotRequired[Filters.TimestampFilter] + AmountPaid: NotRequired[Filters.NumberFilter] + RefundableCredits: NotRequired[Filters.NumberFilter] + RefundableCreditsIssued: NotRequired[Filters.NumberFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + ResentStatus: NotRequired[Filters.EnumFilter] + IsResent: NotRequired[Filters.BooleanFilter] + OriginalOrderId: NotRequired[Filters.StringFilter] + + +class ItemFamiliesItemFamilyParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + + +class ItemsItemParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + ItemFamilyId: NotRequired[Filters.StringFilter] + Type: NotRequired[Filters.EnumFilter] + Name: NotRequired[Filters.StringFilter] + ItemApplicability: NotRequired[Filters.EnumFilter] + Status: NotRequired[Filters.EnumFilter] + IsGiftable: NotRequired[Filters.BooleanFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + EnabledForCheckout: NotRequired[Filters.BooleanFilter] + EnabledInPortal: NotRequired[Filters.BooleanFilter] + Metered: NotRequired[Filters.BooleanFilter] + UsageCalculation: NotRequired[Filters.EnumFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class ItemPricesItemPriceParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + PricingModel: NotRequired[Filters.EnumFilter] + ItemId: NotRequired[Filters.StringFilter] + PriceVariantId: NotRequired[Filters.StringFilter] + TrialPeriod: NotRequired[Filters.NumberFilter] + TrialPeriodUnit: NotRequired[Filters.EnumFilter] + Status: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + PeriodUnit: NotRequired[Filters.EnumFilter] + Period: NotRequired[Filters.NumberFilter] + Channel: NotRequired[Filters.EnumFilter] + + +class AttachedItemsAttachedItemParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + ItemId: NotRequired[Filters.StringFilter] + Type: NotRequired[Filters.EnumFilter] + ChargeOnEvent: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + ParentItemId: NotRequired[Filters.StringFilter] + + +class DifferentialPricesDifferentialPriceParams(TypedDict): + ItemPriceId: NotRequired[Filters.StringFilter] + Id: NotRequired[Filters.StringFilter] + ParentItemId: NotRequired[Filters.StringFilter] + + +class PriceVariantsPriceVariantParams(TypedDict): + Id: NotRequired[Filters.StringFilter] + Name: NotRequired[Filters.StringFilter] + Status: NotRequired[Filters.EnumFilter] + UpdatedAt: NotRequired[Filters.TimestampFilter] + CreatedAt: NotRequired[Filters.TimestampFilter] diff --git a/chargebee/models/feature/__init__.py b/chargebee/models/feature/__init__.py new file mode 100644 index 0000000..6545f62 --- /dev/null +++ b/chargebee/models/feature/__init__.py @@ -0,0 +1,3 @@ +from .operations import Feature +from .responses import FeatureResponse +from .types import Features, Level, Status, Type diff --git a/chargebee/models/feature/operations.py b/chargebee/models/feature/operations.py new file mode 100644 index 0000000..a4fd6c6 --- /dev/null +++ b/chargebee/models/feature/operations.py @@ -0,0 +1,120 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Feature: + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + name: NotRequired[Filters.StringFilter] + id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + type: NotRequired[Filters.EnumFilter] + + class CreateParams(TypedDict): + id: NotRequired[str] + name: Required[str] + description: NotRequired[str] + type: NotRequired[Type] + unit: NotRequired[str] + levels: NotRequired[List[CreateLevelParams]] + + class UpdateParams(TypedDict): + name: NotRequired[str] + description: NotRequired[str] + unit: NotRequired[str] + levels: NotRequired[List[UpdateLevelParams]] + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("features"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("features"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("features", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("features", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("features", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def activate(id, env=None, headers=None) -> ActivateResponse: + return request.send( + "post", + request.uri_path("features", id, "activate_command"), + None, + env, + headers, + ActivateResponse, + ) + + @staticmethod + def archive(id, env=None, headers=None) -> ArchiveResponse: + return request.send( + "post", + request.uri_path("features", id, "archive_command"), + None, + env, + headers, + ArchiveResponse, + ) + + @staticmethod + def reactivate(id, env=None, headers=None) -> ReactivateResponse: + return request.send( + "post", + request.uri_path("features", id, "reactivate_command"), + None, + env, + headers, + ReactivateResponse, + ) diff --git a/chargebee/models/feature/responses.py b/chargebee/models/feature/responses.py new file mode 100644 index 0000000..4c8cd86 --- /dev/null +++ b/chargebee/models/feature/responses.py @@ -0,0 +1,80 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LevelResponse(Model): + name: str = None + value: str = None + level: int = None + is_unlimited: bool = None + + +@dataclass +class FeatureResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + description: str = None + status: str = None + type: str = None + unit: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + levels: List[LevelResponse] = None + + +@dataclass +class ListFeatureResponse: + feature: FeatureResponse + + +@dataclass +class ListResponse: + list: List[ListFeatureResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ActivateResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ArchiveResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ReactivateResponse: + feature: FeatureResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/feature/types.py b/chargebee/models/feature/types.py new file mode 100644 index 0000000..41bd693 --- /dev/null +++ b/chargebee/models/feature/types.py @@ -0,0 +1,55 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DRAFT = "draft" + + def __str__(self): + return self.value + + +class Type(Enum): + SWITCH = "switch" + CUSTOM = "custom" + QUANTITY = "quantity" + RANGE = "range" + + def __str__(self): + return self.value + + +class Level(TypedDict): + name: NotRequired[str] + value: Required[str] + level: Required[int] + is_unlimited: Required[bool] + + +class Features(TypedDict): + id: Required[str] + name: Required[str] + description: NotRequired[str] + status: NotRequired[Status] + type: NotRequired[Type] + unit: NotRequired[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + levels: NotRequired[List[Level]] + + +class CreateLevelParams(TypedDict): + name: NotRequired[str] + value: NotRequired[str] + is_unlimited: NotRequired[bool] + level: NotRequired[int] + + +class UpdateLevelParams(TypedDict): + name: NotRequired[str] + value: NotRequired[str] + is_unlimited: NotRequired[bool] + level: NotRequired[int] diff --git a/chargebee/models/gateway_error_detail/__init__.py b/chargebee/models/gateway_error_detail/__init__.py new file mode 100644 index 0000000..7079a5c --- /dev/null +++ b/chargebee/models/gateway_error_detail/__init__.py @@ -0,0 +1,3 @@ +from .operations import GatewayErrorDetail +from .responses import GatewayErrorDetailResponse +from .types import GatewayErrorDetails diff --git a/chargebee/models/gateway_error_detail/operations.py b/chargebee/models/gateway_error_detail/operations.py new file mode 100644 index 0000000..cd40c4d --- /dev/null +++ b/chargebee/models/gateway_error_detail/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class GatewayErrorDetail: + + pass diff --git a/chargebee/models/gateway_error_detail/responses.py b/chargebee/models/gateway_error_detail/responses.py new file mode 100644 index 0000000..d7e8dae --- /dev/null +++ b/chargebee/models/gateway_error_detail/responses.py @@ -0,0 +1,21 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class GatewayErrorDetailResponse(Model): + raw_data: Dict[Any, Any] = None + request_id: str = None + error_category: str = None + error_code: str = None + error_message: str = None + decline_code: str = None + decline_message: str = None + network_error_code: str = None + network_error_message: str = None + error_field: str = None + recommendation_code: str = None + recommendation_message: str = None + processor_error_code: str = None + processor_error_message: str = None diff --git a/chargebee/models/gateway_error_detail/types.py b/chargebee/models/gateway_error_detail/types.py new file mode 100644 index 0000000..6c50577 --- /dev/null +++ b/chargebee/models/gateway_error_detail/types.py @@ -0,0 +1,17 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class GatewayErrorDetails(TypedDict): + request_id: NotRequired[str] + error_category: NotRequired[str] + error_code: NotRequired[str] + error_message: NotRequired[str] + decline_code: NotRequired[str] + decline_message: NotRequired[str] + network_error_code: NotRequired[str] + network_error_message: NotRequired[str] + error_field: NotRequired[str] + recommendation_code: NotRequired[str] + recommendation_message: NotRequired[str] + processor_error_code: NotRequired[str] + processor_error_message: NotRequired[str] diff --git a/chargebee/models/gift/__init__.py b/chargebee/models/gift/__init__.py new file mode 100644 index 0000000..cdf8bc0 --- /dev/null +++ b/chargebee/models/gift/__init__.py @@ -0,0 +1,3 @@ +from .operations import Gift +from .responses import GiftResponse +from .types import Gifts, Gifter, GiftReceiver, GiftTimeline, Status diff --git a/chargebee/models/gift/operations.py b/chargebee/models/gift/operations.py new file mode 100644 index 0000000..0ba298e --- /dev/null +++ b/chargebee/models/gift/operations.py @@ -0,0 +1,119 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Gift: + + class CreateParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + gifter: Required[CreateGifterParams] + gift_receiver: Required[CreateGiftReceiverParams] + coupon_ids: NotRequired[List[str]] + payment_intent: NotRequired[CreatePaymentIntentParams] + shipping_address: NotRequired[CreateShippingAddressParams] + subscription: Required[CreateSubscriptionParams] + addons: NotRequired[List[CreateAddonParams]] + + class CreateForItemsParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + gifter: Required[CreateForItemsGifterParams] + gift_receiver: Required[CreateForItemsGiftReceiverParams] + coupon_ids: NotRequired[List[str]] + payment_intent: NotRequired[CreateForItemsPaymentIntentParams] + shipping_address: NotRequired[CreateForItemsShippingAddressParams] + subscription_items: NotRequired[List[CreateForItemsSubscriptionItemParams]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + gift_receiver: NotRequired[ListGiftReceiverParams] + gifter: NotRequired[ListGifterParams] + status: NotRequired[Filters.EnumFilter] + + class UpdateGiftParams(TypedDict): + scheduled_at: Required[int] + comment: NotRequired[str] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("gifts"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def create_for_items( + params: CreateForItemsParams, env=None, headers=None + ) -> CreateForItemsResponse: + return request.send( + "post", + request.uri_path("gifts", "create_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForItemsResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("gifts", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("gifts"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def claim(id, env=None, headers=None) -> ClaimResponse: + return request.send( + "post", + request.uri_path("gifts", id, "claim"), + None, + env, + headers, + ClaimResponse, + ) + + @staticmethod + def cancel(id, env=None, headers=None) -> CancelResponse: + return request.send( + "post", + request.uri_path("gifts", id, "cancel"), + None, + env, + headers, + CancelResponse, + ) + + @staticmethod + def update_gift( + id, params: UpdateGiftParams, env=None, headers=None + ) -> UpdateGiftResponse: + return request.send( + "post", + request.uri_path("gifts", id, "update_gift"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateGiftResponse, + ) diff --git a/chargebee/models/gift/responses.py b/chargebee/models/gift/responses.py new file mode 100644 index 0000000..4167fa3 --- /dev/null +++ b/chargebee/models/gift/responses.py @@ -0,0 +1,100 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import payment_intent, subscription, invoice + + +@dataclass +class GifterResponse(Model): + customer_id: str = None + invoice_id: str = None + signature: str = None + note: str = None + + +@dataclass +class GiftReceiverResponse(Model): + customer_id: str = None + subscription_id: str = None + first_name: str = None + last_name: str = None + email: str = None + + +@dataclass +class GiftTimelineResponse(Model): + status: str = None + occurred_at: int = None + + +@dataclass +class GiftResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + status: str = None + scheduled_at: int = None + auto_claim: bool = None + no_expiry: bool = None + claim_expiry_date: int = None + resource_version: int = None + updated_at: int = None + gifter: GifterResponse = None + gift_receiver: GiftReceiverResponse = None + gift_timelines: List[GiftTimelineResponse] = None + + +@dataclass +class CreateResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForItemsResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListGiftResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + + +@dataclass +class ListResponse: + list: List[ListGiftResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ClaimResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateGiftResponse: + gift: GiftResponse + subscription: "subscription.SubscriptionResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/gift/types.py b/chargebee/models/gift/types.py new file mode 100644 index 0000000..40e351c --- /dev/null +++ b/chargebee/models/gift/types.py @@ -0,0 +1,158 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, payment_intent + + +class Status(Enum): + SCHEDULED = "scheduled" + UNCLAIMED = "unclaimed" + CLAIMED = "claimed" + CANCELLED = "cancelled" + EXPIRED = "expired" + + def __str__(self): + return self.value + + +class Gifter(TypedDict): + customer_id: Required[str] + invoice_id: NotRequired[str] + signature: NotRequired[str] + note: NotRequired[str] + + +class GiftReceiver(TypedDict): + customer_id: Required[str] + subscription_id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + + +class GiftTimeline(TypedDict): + status: Required[Status] + occurred_at: NotRequired[int] + + +class Gifts(TypedDict): + id: Required[str] + status: Required[Status] + scheduled_at: NotRequired[int] + auto_claim: Required[bool] + no_expiry: Required[bool] + claim_expiry_date: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + gifter: Required[Gifter] + gift_receiver: Required[GiftReceiver] + gift_timelines: NotRequired[List[GiftTimeline]] + + +class CreateGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + +class CreateGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + +class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + + +class CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class CreateForItemsGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + +class CreateForItemsGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + +class CreateForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class ListGiftReceiverParams(TypedDict): + Email: NotRequired[Filters.StringFilter] + CustomerId: NotRequired[Filters.StringFilter] + + +class ListGifterParams(TypedDict): + CustomerId: NotRequired[Filters.StringFilter] diff --git a/chargebee/models/hierarchy/__init__.py b/chargebee/models/hierarchy/__init__.py new file mode 100644 index 0000000..96f134c --- /dev/null +++ b/chargebee/models/hierarchy/__init__.py @@ -0,0 +1,3 @@ +from .operations import Hierarchy +from .responses import HierarchyResponse +from .types import Hierarchies diff --git a/chargebee/models/hierarchy/operations.py b/chargebee/models/hierarchy/operations.py new file mode 100644 index 0000000..e1267a8 --- /dev/null +++ b/chargebee/models/hierarchy/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Hierarchy: + + pass diff --git a/chargebee/models/hierarchy/responses.py b/chargebee/models/hierarchy/responses.py new file mode 100644 index 0000000..8313167 --- /dev/null +++ b/chargebee/models/hierarchy/responses.py @@ -0,0 +1,13 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class HierarchyResponse(Model): + raw_data: Dict[Any, Any] = None + customer_id: str = None + parent_id: str = None + payment_owner_id: str = None + invoice_owner_id: str = None + children_ids: List[str] = None diff --git a/chargebee/models/hierarchy/types.py b/chargebee/models/hierarchy/types.py new file mode 100644 index 0000000..6561246 --- /dev/null +++ b/chargebee/models/hierarchy/types.py @@ -0,0 +1,9 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Hierarchies(TypedDict): + customer_id: Required[str] + parent_id: NotRequired[str] + payment_owner_id: Required[str] + invoice_owner_id: Required[str] + children_ids: NotRequired[List[str]] diff --git a/chargebee/models/hosted_page/__init__.py b/chargebee/models/hosted_page/__init__.py new file mode 100644 index 0000000..5fe8ba5 --- /dev/null +++ b/chargebee/models/hosted_page/__init__.py @@ -0,0 +1,3 @@ +from .operations import HostedPage +from .responses import HostedPageResponse +from .types import HostedPages, Type, State, FailureReason diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py new file mode 100644 index 0000000..36da927 --- /dev/null +++ b/chargebee/models/hosted_page/operations.py @@ -0,0 +1,512 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class HostedPage: + + class CheckoutNewParams(TypedDict): + subscription: Required[CheckoutNewSubscriptionParams] + customer: NotRequired[CheckoutNewCustomerParams] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CheckoutNewAddonParams]] + event_based_addons: NotRequired[List[CheckoutNewEventBasedAddonParams]] + mandatory_addons_to_remove: NotRequired[List[str]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + card: NotRequired[CheckoutNewCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + embed: NotRequired[bool] + iframe_messaging: NotRequired[bool] + allow_offline_payment_methods: NotRequired[bool] + billing_address: NotRequired[CheckoutNewBillingAddressParams] + shipping_address: NotRequired[CheckoutNewShippingAddressParams] + contract_term: NotRequired[CheckoutNewContractTermParams] + + class CheckoutOneTimeParams(TypedDict): + customer: NotRequired[CheckoutOneTimeCustomerParams] + addons: NotRequired[List[CheckoutOneTimeAddonParams]] + currency_code: NotRequired[str] + charges: NotRequired[List[CheckoutOneTimeChargeParams]] + invoice_note: NotRequired[str] + invoice: NotRequired[CheckoutOneTimeInvoiceParams] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + card: NotRequired[CheckoutOneTimeCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + embed: NotRequired[bool] + iframe_messaging: NotRequired[bool] + billing_address: NotRequired[CheckoutOneTimeBillingAddressParams] + shipping_address: NotRequired[CheckoutOneTimeShippingAddressParams] + + class CheckoutOneTimeForItemsParams(TypedDict): + business_entity_id: NotRequired[str] + layout: NotRequired[enums.Layout] + customer: NotRequired[CheckoutOneTimeForItemsCustomerParams] + item_prices: NotRequired[List[CheckoutOneTimeForItemsItemPriceParams]] + item_tiers: NotRequired[List[CheckoutOneTimeForItemsItemTierParams]] + charges: NotRequired[List[CheckoutOneTimeForItemsChargeParams]] + discounts: Required[List[CheckoutOneTimeForItemsDiscountParams]] + invoice_note: NotRequired[str] + invoice: NotRequired[CheckoutOneTimeForItemsInvoiceParams] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + currency_code: NotRequired[str] + card: NotRequired[CheckoutOneTimeForItemsCardParams] + entity_identifiers: NotRequired[ + List[CheckoutOneTimeForItemsEntityIdentifierParams] + ] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + billing_address: NotRequired[CheckoutOneTimeForItemsBillingAddressParams] + shipping_address: NotRequired[CheckoutOneTimeForItemsShippingAddressParams] + + class CheckoutNewForItemsParams(TypedDict): + subscription: NotRequired[CheckoutNewForItemsSubscriptionParams] + layout: NotRequired[enums.Layout] + customer: NotRequired[CheckoutNewForItemsCustomerParams] + business_entity_id: NotRequired[str] + billing_cycles: NotRequired[int] + subscription_items: Required[List[CheckoutNewForItemsSubscriptionItemParams]] + discounts: Required[List[CheckoutNewForItemsDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[CheckoutNewForItemsItemTierParams]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + card: NotRequired[CheckoutNewForItemsCardParams] + entity_identifiers: NotRequired[List[CheckoutNewForItemsEntityIdentifierParams]] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + allow_offline_payment_methods: NotRequired[bool] + billing_address: NotRequired[CheckoutNewForItemsBillingAddressParams] + shipping_address: NotRequired[CheckoutNewForItemsShippingAddressParams] + contract_term: NotRequired[CheckoutNewForItemsContractTermParams] + + class CheckoutExistingParams(TypedDict): + subscription: Required[CheckoutExistingSubscriptionParams] + addons: NotRequired[List[CheckoutExistingAddonParams]] + event_based_addons: NotRequired[List[CheckoutExistingEventBasedAddonParams]] + replace_addon_list: NotRequired[bool] + mandatory_addons_to_remove: NotRequired[List[str]] + invoice_date: NotRequired[int] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + reactivate: NotRequired[bool] + force_term_reset: NotRequired[bool] + customer: NotRequired[CheckoutExistingCustomerParams] + card: NotRequired[CheckoutExistingCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + embed: NotRequired[bool] + iframe_messaging: NotRequired[bool] + allow_offline_payment_methods: NotRequired[bool] + contract_term: NotRequired[CheckoutExistingContractTermParams] + + class CheckoutExistingForItemsParams(TypedDict): + layout: NotRequired[enums.Layout] + subscription: Required[CheckoutExistingForItemsSubscriptionParams] + subscription_items: Required[ + List[CheckoutExistingForItemsSubscriptionItemParams] + ] + mandatory_items_to_remove: NotRequired[List[str]] + replace_items_list: NotRequired[bool] + discounts: Required[List[CheckoutExistingForItemsDiscountParams]] + item_tiers: NotRequired[List[CheckoutExistingForItemsItemTierParams]] + invoice_date: NotRequired[int] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + reactivate: NotRequired[bool] + force_term_reset: NotRequired[bool] + change_option: NotRequired[enums.ChangeOption] + changes_scheduled_at: NotRequired[int] + customer: NotRequired[CheckoutExistingForItemsCustomerParams] + entity_identifiers: NotRequired[ + List[CheckoutExistingForItemsEntityIdentifierParams] + ] + card: NotRequired[CheckoutExistingForItemsCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + allow_offline_payment_methods: NotRequired[bool] + contract_term: NotRequired[CheckoutExistingForItemsContractTermParams] + + class UpdateCardParams(TypedDict): + customer: Required[UpdateCardCustomerParams] + card: NotRequired[UpdateCardCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + embed: NotRequired[bool] + iframe_messaging: NotRequired[bool] + + class UpdatePaymentMethodParams(TypedDict): + customer: Required[UpdatePaymentMethodCustomerParams] + card: NotRequired[UpdatePaymentMethodCardParams] + redirect_url: NotRequired[str] + cancel_url: NotRequired[str] + pass_thru_content: NotRequired[str] + embed: NotRequired[bool] + iframe_messaging: NotRequired[bool] + + class ManagePaymentSourcesParams(TypedDict): + customer: Required[ManagePaymentSourcesCustomerParams] + redirect_url: NotRequired[str] + card: NotRequired[ManagePaymentSourcesCardParams] + + class CollectNowParams(TypedDict): + customer: Required[CollectNowCustomerParams] + redirect_url: NotRequired[str] + card: NotRequired[CollectNowCardParams] + currency_code: NotRequired[str] + + class AcceptQuoteParams(TypedDict): + quote: Required[AcceptQuoteQuoteParams] + redirect_url: NotRequired[str] + layout: NotRequired[enums.Layout] + + class ExtendSubscriptionParams(TypedDict): + subscription: Required[ExtendSubscriptionSubscriptionParams] + expiry: NotRequired[int] + billing_cycle: NotRequired[int] + + class CheckoutGiftParams(TypedDict): + gifter: NotRequired[CheckoutGiftGifterParams] + redirect_url: NotRequired[str] + subscription: Required[CheckoutGiftSubscriptionParams] + addons: NotRequired[List[CheckoutGiftAddonParams]] + coupon_ids: NotRequired[List[str]] + + class CheckoutGiftForItemsParams(TypedDict): + business_entity_id: NotRequired[str] + gifter: NotRequired[CheckoutGiftForItemsGifterParams] + redirect_url: NotRequired[str] + subscription_items: NotRequired[ + List[CheckoutGiftForItemsSubscriptionItemParams] + ] + coupon_ids: NotRequired[List[str]] + + class ClaimGiftParams(TypedDict): + gift: Required[ClaimGiftGiftParams] + redirect_url: NotRequired[str] + customer: NotRequired[ClaimGiftCustomerParams] + + class RetrieveAgreementPdfParams(TypedDict): + payment_source_id: Required[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + state: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + class PreCancelParams(TypedDict): + subscription: Required[PreCancelSubscriptionParams] + pass_thru_content: NotRequired[str] + cancel_url: NotRequired[str] + redirect_url: NotRequired[str] + + class EventsParams(TypedDict): + event_name: Required[enums.EventName] + occurred_at: NotRequired[int] + event_data: Required[Dict[Any, Any]] + + class ViewVoucherParams(TypedDict): + payment_voucher: Required[ViewVoucherPaymentVoucherParams] + customer: NotRequired[ViewVoucherCustomerParams] + + @staticmethod + def checkout_new( + params: CheckoutNewParams, env=None, headers=None + ) -> CheckoutNewResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_new"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutNewResponse, + ) + + @staticmethod + def checkout_one_time( + params: CheckoutOneTimeParams = None, env=None, headers=None + ) -> CheckoutOneTimeResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_one_time"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutOneTimeResponse, + ) + + @staticmethod + def checkout_one_time_for_items( + params: CheckoutOneTimeForItemsParams, env=None, headers=None + ) -> CheckoutOneTimeForItemsResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_one_time_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutOneTimeForItemsResponse, + ) + + @staticmethod + def checkout_new_for_items( + params: CheckoutNewForItemsParams, env=None, headers=None + ) -> CheckoutNewForItemsResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_new_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutNewForItemsResponse, + ) + + @staticmethod + def checkout_existing( + params: CheckoutExistingParams, env=None, headers=None + ) -> CheckoutExistingResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_existing"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutExistingResponse, + ) + + @staticmethod + def checkout_existing_for_items( + params: CheckoutExistingForItemsParams, env=None, headers=None + ) -> CheckoutExistingForItemsResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_existing_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutExistingForItemsResponse, + ) + + @staticmethod + def update_card( + params: UpdateCardParams, env=None, headers=None + ) -> UpdateCardResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "update_card"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateCardResponse, + ) + + @staticmethod + def update_payment_method( + params: UpdatePaymentMethodParams, env=None, headers=None + ) -> UpdatePaymentMethodResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "update_payment_method"), + cast(Dict[Any, Any], params), + env, + headers, + UpdatePaymentMethodResponse, + ) + + @staticmethod + def manage_payment_sources( + params: ManagePaymentSourcesParams, env=None, headers=None + ) -> ManagePaymentSourcesResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "manage_payment_sources"), + cast(Dict[Any, Any], params), + env, + headers, + ManagePaymentSourcesResponse, + ) + + @staticmethod + def collect_now( + params: CollectNowParams, env=None, headers=None + ) -> CollectNowResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "collect_now"), + cast(Dict[Any, Any], params), + env, + headers, + CollectNowResponse, + ) + + @staticmethod + def accept_quote( + params: AcceptQuoteParams, env=None, headers=None + ) -> AcceptQuoteResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "accept_quote"), + cast(Dict[Any, Any], params), + env, + headers, + AcceptQuoteResponse, + ) + + @staticmethod + def extend_subscription( + params: ExtendSubscriptionParams, env=None, headers=None + ) -> ExtendSubscriptionResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "extend_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + ExtendSubscriptionResponse, + ) + + @staticmethod + def checkout_gift( + params: CheckoutGiftParams, env=None, headers=None + ) -> CheckoutGiftResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_gift"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutGiftResponse, + ) + + @staticmethod + def checkout_gift_for_items( + params: CheckoutGiftForItemsParams = None, env=None, headers=None + ) -> CheckoutGiftForItemsResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "checkout_gift_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CheckoutGiftForItemsResponse, + ) + + @staticmethod + def claim_gift( + params: ClaimGiftParams, env=None, headers=None + ) -> ClaimGiftResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "claim_gift"), + cast(Dict[Any, Any], params), + env, + headers, + ClaimGiftResponse, + ) + + @staticmethod + def retrieve_agreement_pdf( + params: RetrieveAgreementPdfParams, env=None, headers=None + ) -> RetrieveAgreementPdfResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "retrieve_agreement_pdf"), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveAgreementPdfResponse, + ) + + @staticmethod + def acknowledge(id, env=None, headers=None) -> AcknowledgeResponse: + return request.send( + "post", + request.uri_path("hosted_pages", id, "acknowledge"), + None, + env, + headers, + AcknowledgeResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("hosted_pages", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("hosted_pages"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def pre_cancel( + params: PreCancelParams, env=None, headers=None + ) -> PreCancelResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "pre_cancel"), + cast(Dict[Any, Any], params), + env, + headers, + PreCancelResponse, + ) + + @staticmethod + def events(params: EventsParams, env=None, headers=None) -> EventsResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "events"), + cast(Dict[Any, Any], params), + env, + headers, + EventsResponse, + ) + + @staticmethod + def view_voucher( + params: ViewVoucherParams, env=None, headers=None + ) -> ViewVoucherResponse: + return request.send( + "post", + request.uri_path("hosted_pages", "view_voucher"), + cast(Dict[Any, Any], params), + env, + headers, + ViewVoucherResponse, + ) diff --git a/chargebee/models/hosted_page/responses.py b/chargebee/models/hosted_page/responses.py new file mode 100644 index 0000000..b631a56 --- /dev/null +++ b/chargebee/models/hosted_page/responses.py @@ -0,0 +1,161 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import contract_term + + +@dataclass +class HostedPageResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + type: str = None + url: str = None + state: str = None + failure_reason: str = None + pass_thru_content: str = None + embed: bool = None + created_at: int = None + expires_at: int = None + content: Dict[Any, Any] = None + updated_at: int = None + resource_version: int = None + checkout_info: Dict[Any, Any] = None + business_entity_id: str = None + + +@dataclass +class CheckoutNewResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutOneTimeResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutOneTimeForItemsResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutNewForItemsResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutExistingResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutExistingForItemsResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateCardResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdatePaymentMethodResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ManagePaymentSourcesResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CollectNowResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AcceptQuoteResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ExtendSubscriptionResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutGiftResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CheckoutGiftForItemsResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ClaimGiftResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveAgreementPdfResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AcknowledgeResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListHostedPageResponse: + hosted_page: HostedPageResponse + + +@dataclass +class ListResponse: + list: List[ListHostedPageResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PreCancelResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class EventsResponse: + success: bool + response_headers: Dict[Any, Any] = None + + +@dataclass +class ViewVoucherResponse: + hosted_page: HostedPageResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/hosted_page/types.py b/chargebee/models/hosted_page/types.py new file mode 100644 index 0000000..aa1b44e --- /dev/null +++ b/chargebee/models/hosted_page/types.py @@ -0,0 +1,688 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, contract_term + + +class Type(Enum): + CHECKOUT_NEW = "checkout_new" + CHECKOUT_EXISTING = "checkout_existing" + UPDATE_PAYMENT_METHOD = "update_payment_method" + MANAGE_PAYMENT_SOURCES = "manage_payment_sources" + COLLECT_NOW = "collect_now" + EXTEND_SUBSCRIPTION = "extend_subscription" + CHECKOUT_ONE_TIME = "checkout_one_time" + PRE_CANCEL = "pre_cancel" + VIEW_VOUCHER = "view_voucher" + CHECKOUT_GIFT = "checkout_gift" + CLAIM_GIFT = "claim_gift" + + def __str__(self): + return self.value + + +class State(Enum): + CREATED = "created" + REQUESTED = "requested" + SUCCEEDED = "succeeded" + CANCELLED = "cancelled" + ACKNOWLEDGED = "acknowledged" + + def __str__(self): + return self.value + + +class FailureReason(Enum): + CARD_ERROR = "card_error" + SERVER_ERROR = "server_error" + + def __str__(self): + return self.value + + +class HostedPages(TypedDict): + id: NotRequired[str] + type: NotRequired[Type] + url: NotRequired[str] + state: NotRequired[State] + failure_reason: NotRequired[FailureReason] + pass_thru_content: NotRequired[str] + embed: Required[bool] + created_at: NotRequired[int] + expires_at: NotRequired[int] + content: Required[Dict[Any, Any]] + updated_at: NotRequired[int] + resource_version: NotRequired[int] + checkout_info: NotRequired[Dict[Any, Any]] + business_entity_id: NotRequired[str] + + +class CheckoutNewSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + affiliate_token: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CheckoutNewCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + +class CheckoutNewAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + +class CheckoutNewEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CheckoutNewCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutNewBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutNewShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutNewContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CheckoutOneTimeCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + +class CheckoutOneTimeAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CheckoutOneTimeChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CheckoutOneTimeInvoiceParams(TypedDict): + po_number: NotRequired[str] + + +class CheckoutOneTimeCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutOneTimeBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutOneTimeShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutOneTimeForItemsCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + +class CheckoutOneTimeForItemsItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CheckoutOneTimeForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CheckoutOneTimeForItemsChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CheckoutOneTimeForItemsDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + +class CheckoutOneTimeForItemsInvoiceParams(TypedDict): + po_number: NotRequired[str] + + +class CheckoutOneTimeForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutOneTimeForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + +class CheckoutOneTimeForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutOneTimeForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutNewForItemsSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CheckoutNewForItemsCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + + +class CheckoutNewForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class CheckoutNewForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class CheckoutNewForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CheckoutNewForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutNewForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + +class CheckoutNewForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutNewForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CheckoutNewForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CheckoutExistingSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CheckoutExistingAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class CheckoutExistingEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class CheckoutExistingCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + +class CheckoutExistingCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutExistingContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CheckoutExistingForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CheckoutExistingForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + +class CheckoutExistingForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + +class CheckoutExistingForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CheckoutExistingForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + + +class CheckoutExistingForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + +class CheckoutExistingForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CheckoutExistingForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class UpdateCardCustomerParams(TypedDict): + id: Required[str] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + +class UpdateCardCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class UpdatePaymentMethodCustomerParams(TypedDict): + id: Required[str] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + +class UpdatePaymentMethodCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class ManagePaymentSourcesCustomerParams(TypedDict): + id: Required[str] + + +class ManagePaymentSourcesCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class CollectNowCustomerParams(TypedDict): + id: Required[str] + + +class CollectNowCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + +class AcceptQuoteQuoteParams(TypedDict): + id: Required[str] + + +class ExtendSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + + +class CheckoutGiftGifterParams(TypedDict): + customer_id: NotRequired[str] + + +class CheckoutGiftSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + coupon: NotRequired[str] + + +class CheckoutGiftAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class CheckoutGiftForItemsGifterParams(TypedDict): + customer_id: NotRequired[str] + + +class CheckoutGiftForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + +class ClaimGiftGiftParams(TypedDict): + id: Required[str] + + +class ClaimGiftCustomerParams(TypedDict): + locale: NotRequired[str] + + +class PreCancelSubscriptionParams(TypedDict): + id: Required[str] + + +class ViewVoucherPaymentVoucherParams(TypedDict): + id: Required[str] + + +class ViewVoucherCustomerParams(TypedDict): + locale: NotRequired[str] diff --git a/chargebee/models/impacted_item/__init__.py b/chargebee/models/impacted_item/__init__.py new file mode 100644 index 0000000..a05d4b2 --- /dev/null +++ b/chargebee/models/impacted_item/__init__.py @@ -0,0 +1,3 @@ +from .operations import ImpactedItem +from .responses import ImpactedItemResponse +from .types import ImpactedItems, Download diff --git a/chargebee/models/impacted_item/operations.py b/chargebee/models/impacted_item/operations.py new file mode 100644 index 0000000..55da9fb --- /dev/null +++ b/chargebee/models/impacted_item/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ImpactedItem: + + pass diff --git a/chargebee/models/impacted_item/responses.py b/chargebee/models/impacted_item/responses.py new file mode 100644 index 0000000..428af3f --- /dev/null +++ b/chargebee/models/impacted_item/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): + download_url: str = None + valid_till: int = None + mime_type: str = None + + +@dataclass +class ImpactedItemResponse(Model): + raw_data: Dict[Any, Any] = None + count: int = None + download: DownloadResponse = None + items: List[Dict[Any, Any]] = None diff --git a/chargebee/models/impacted_item/types.py b/chargebee/models/impacted_item/types.py new file mode 100644 index 0000000..49e6bd5 --- /dev/null +++ b/chargebee/models/impacted_item/types.py @@ -0,0 +1,13 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + +class ImpactedItems(TypedDict): + count: NotRequired[int] + download: NotRequired[Download] + items: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/impacted_item_price/__init__.py b/chargebee/models/impacted_item_price/__init__.py new file mode 100644 index 0000000..936bb78 --- /dev/null +++ b/chargebee/models/impacted_item_price/__init__.py @@ -0,0 +1,3 @@ +from .operations import ImpactedItemPrice +from .responses import ImpactedItemPriceResponse +from .types import ImpactedItemPrices, Download diff --git a/chargebee/models/impacted_item_price/operations.py b/chargebee/models/impacted_item_price/operations.py new file mode 100644 index 0000000..62a9537 --- /dev/null +++ b/chargebee/models/impacted_item_price/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ImpactedItemPrice: + + pass diff --git a/chargebee/models/impacted_item_price/responses.py b/chargebee/models/impacted_item_price/responses.py new file mode 100644 index 0000000..cb27cd5 --- /dev/null +++ b/chargebee/models/impacted_item_price/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): + download_url: str = None + valid_till: int = None + mime_type: str = None + + +@dataclass +class ImpactedItemPriceResponse(Model): + raw_data: Dict[Any, Any] = None + count: int = None + download: DownloadResponse = None + item_prices: List[Dict[Any, Any]] = None diff --git a/chargebee/models/impacted_item_price/types.py b/chargebee/models/impacted_item_price/types.py new file mode 100644 index 0000000..1596acf --- /dev/null +++ b/chargebee/models/impacted_item_price/types.py @@ -0,0 +1,13 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + +class ImpactedItemPrices(TypedDict): + count: NotRequired[int] + download: NotRequired[Download] + item_prices: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/impacted_subscription/__init__.py b/chargebee/models/impacted_subscription/__init__.py new file mode 100644 index 0000000..aa666ad --- /dev/null +++ b/chargebee/models/impacted_subscription/__init__.py @@ -0,0 +1,3 @@ +from .operations import ImpactedSubscription +from .responses import ImpactedSubscriptionResponse +from .types import ImpactedSubscriptions, Download diff --git a/chargebee/models/impacted_subscription/operations.py b/chargebee/models/impacted_subscription/operations.py new file mode 100644 index 0000000..aed0e1f --- /dev/null +++ b/chargebee/models/impacted_subscription/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ImpactedSubscription: + + pass diff --git a/chargebee/models/impacted_subscription/responses.py b/chargebee/models/impacted_subscription/responses.py new file mode 100644 index 0000000..12c26f1 --- /dev/null +++ b/chargebee/models/impacted_subscription/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): + download_url: str = None + valid_till: int = None + mime_type: str = None + + +@dataclass +class ImpactedSubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + count: int = None + download: DownloadResponse = None + subscription_ids: List[Dict[Any, Any]] = None diff --git a/chargebee/models/impacted_subscription/types.py b/chargebee/models/impacted_subscription/types.py new file mode 100644 index 0000000..21aed30 --- /dev/null +++ b/chargebee/models/impacted_subscription/types.py @@ -0,0 +1,13 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + +class ImpactedSubscriptions(TypedDict): + count: NotRequired[int] + download: NotRequired[Download] + subscription_ids: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/in_app_subscription/__init__.py b/chargebee/models/in_app_subscription/__init__.py new file mode 100644 index 0000000..85a7d4a --- /dev/null +++ b/chargebee/models/in_app_subscription/__init__.py @@ -0,0 +1,3 @@ +from .operations import InAppSubscription +from .responses import InAppSubscriptionResponse +from .types import InAppSubscriptions, StoreStatus diff --git a/chargebee/models/in_app_subscription/operations.py b/chargebee/models/in_app_subscription/operations.py new file mode 100644 index 0000000..9a0a0ca --- /dev/null +++ b/chargebee/models/in_app_subscription/operations.py @@ -0,0 +1,76 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class InAppSubscription: + + class ProcessReceiptParams(TypedDict): + receipt: Required[str] + product: Required[ProcessReceiptProductParams] + customer: NotRequired[ProcessReceiptCustomerParams] + + class ImportReceiptParams(TypedDict): + receipt: Required[str] + product: Required[ImportReceiptProductParams] + customer: NotRequired[ImportReceiptCustomerParams] + + class ImportSubscriptionParams(TypedDict): + subscription: Required[ImportSubscriptionSubscriptionParams] + customer: NotRequired[ImportSubscriptionCustomerParams] + + class RetrieveStoreSubsParams(TypedDict): + receipt: Required[str] + + @staticmethod + def process_receipt( + id, params: ProcessReceiptParams, env=None, headers=None + ) -> ProcessReceiptResponse: + return request.send( + "post", + request.uri_path("in_app_subscriptions", id, "process_purchase_command"), + cast(Dict[Any, Any], params), + env, + headers, + ProcessReceiptResponse, + ) + + @staticmethod + def import_receipt( + id, params: ImportReceiptParams, env=None, headers=None + ) -> ImportReceiptResponse: + return request.send( + "post", + request.uri_path("in_app_subscriptions", id, "import_receipt"), + cast(Dict[Any, Any], params), + env, + headers, + ImportReceiptResponse, + ) + + @staticmethod + def import_subscription( + id, params: ImportSubscriptionParams, env=None, headers=None + ) -> ImportSubscriptionResponse: + return request.send( + "post", + request.uri_path("in_app_subscriptions", id, "import_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + ImportSubscriptionResponse, + ) + + @staticmethod + def retrieve_store_subs( + id, params: RetrieveStoreSubsParams, env=None, headers=None + ) -> RetrieveStoreSubsResponse: + return request.send( + "post", + request.uri_path("in_app_subscriptions", id, "retrieve"), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveStoreSubsResponse, + ) diff --git a/chargebee/models/in_app_subscription/responses.py b/chargebee/models/in_app_subscription/responses.py new file mode 100644 index 0000000..65c276f --- /dev/null +++ b/chargebee/models/in_app_subscription/responses.py @@ -0,0 +1,38 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class InAppSubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + app_id: str = None + subscription_id: str = None + customer_id: str = None + plan_id: str = None + store_status: str = None + invoice_id: str = None + + +@dataclass +class ProcessReceiptResponse: + in_app_subscription: InAppSubscriptionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportReceiptResponse: + in_app_subscriptions: List[InAppSubscriptionResponse] + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportSubscriptionResponse: + in_app_subscription: InAppSubscriptionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveStoreSubsResponse: + in_app_subscriptions: List[InAppSubscriptionResponse] + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/in_app_subscription/types.py b/chargebee/models/in_app_subscription/types.py new file mode 100644 index 0000000..f532825 --- /dev/null +++ b/chargebee/models/in_app_subscription/types.py @@ -0,0 +1,63 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class StoreStatus(Enum): + IN_TRIAL = "in_trial" + ACTIVE = "active" + CANCELLED = "cancelled" + PAUSED = "paused" + + def __str__(self): + return self.value + + +class InAppSubscriptions(TypedDict): + app_id: Required[str] + subscription_id: Required[str] + customer_id: NotRequired[str] + plan_id: NotRequired[str] + store_status: NotRequired[StoreStatus] + invoice_id: NotRequired[str] + + +class ProcessReceiptProductParams(TypedDict): + id: Required[str] + currency_code: Required[str] + price: Required[int] + name: NotRequired[str] + price_in_decimal: NotRequired[str] + period: NotRequired[str] + period_unit: NotRequired[str] + + +class ProcessReceiptCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + + +class ImportReceiptProductParams(TypedDict): + currency_code: Required[str] + + +class ImportReceiptCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + + +class ImportSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + started_at: Required[int] + term_start: Required[int] + term_end: Required[int] + product_id: Required[str] + currency_code: Required[str] + transaction_id: Required[str] + is_trial: NotRequired[bool] + + +class ImportSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] diff --git a/chargebee/models/installment/__init__.py b/chargebee/models/installment/__init__.py new file mode 100644 index 0000000..8bdf519 --- /dev/null +++ b/chargebee/models/installment/__init__.py @@ -0,0 +1,3 @@ +from .operations import Installment +from .responses import InstallmentResponse +from .types import Installments, Status diff --git a/chargebee/models/installment/operations.py b/chargebee/models/installment/operations.py new file mode 100644 index 0000000..27253fd --- /dev/null +++ b/chargebee/models/installment/operations.py @@ -0,0 +1,36 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Installment: + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + sort_by: NotRequired[Filters.SortFilter] + invoice_id: Required[Filters.StringFilter] + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("installments", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("installments"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/installment/responses.py b/chargebee/models/installment/responses.py new file mode 100644 index 0000000..379abff --- /dev/null +++ b/chargebee/models/installment/responses.py @@ -0,0 +1,34 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class InstallmentResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + invoice_id: str = None + date: int = None + amount: int = None + status: str = None + created_at: int = None + resource_version: int = None + updated_at: int = None + + +@dataclass +class RetrieveResponse: + installment: InstallmentResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListInstallmentResponse: + installment: InstallmentResponse + + +@dataclass +class ListResponse: + list: List[ListInstallmentResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/installment/types.py b/chargebee/models/installment/types.py new file mode 100644 index 0000000..9d83870 --- /dev/null +++ b/chargebee/models/installment/types.py @@ -0,0 +1,22 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + POSTED = "posted" + PAYMENT_DUE = "payment_due" + PAID = "paid" + + def __str__(self): + return self.value + + +class Installments(TypedDict): + id: Required[str] + invoice_id: Required[str] + date: Required[int] + amount: Required[int] + status: Required[Status] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] diff --git a/chargebee/models/installment_config/__init__.py b/chargebee/models/installment_config/__init__.py new file mode 100644 index 0000000..b479f0b --- /dev/null +++ b/chargebee/models/installment_config/__init__.py @@ -0,0 +1,3 @@ +from .operations import InstallmentConfig +from .responses import InstallmentConfigResponse +from .types import InstallmentConfigs, Installment, PeriodUnit diff --git a/chargebee/models/installment_config/operations.py b/chargebee/models/installment_config/operations.py new file mode 100644 index 0000000..e752950 --- /dev/null +++ b/chargebee/models/installment_config/operations.py @@ -0,0 +1,48 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class InstallmentConfig: + + class CreateParams(TypedDict): + number_of_installments: Required[int] + period_unit: Required[PeriodUnit] + period: NotRequired[int] + preferred_day: NotRequired[int] + description: NotRequired[str] + installments: NotRequired[List[CreateInstallmentParams]] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("installment_configs"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("installment_configs", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("installment_configs", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) diff --git a/chargebee/models/installment_config/responses.py b/chargebee/models/installment_config/responses.py new file mode 100644 index 0000000..bdfdfbe --- /dev/null +++ b/chargebee/models/installment_config/responses.py @@ -0,0 +1,42 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class InstallmentResponse(Model): + period: int = None + amount_percentage: float = None + + +@dataclass +class InstallmentConfigResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + description: str = None + number_of_installments: int = None + period_unit: str = None + period: int = None + preferred_day: int = None + created_at: int = None + resource_version: int = None + updated_at: int = None + installments: List[InstallmentResponse] = None + + +@dataclass +class CreateResponse: + installment_config: InstallmentConfigResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + installment_config: InstallmentConfigResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + installment_config: InstallmentConfigResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/installment_config/types.py b/chargebee/models/installment_config/types.py new file mode 100644 index 0000000..7d42166 --- /dev/null +++ b/chargebee/models/installment_config/types.py @@ -0,0 +1,34 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + + def __str__(self): + return self.value + + +class Installment(TypedDict): + period: NotRequired[int] + amount_percentage: NotRequired[float] + + +class InstallmentConfigs(TypedDict): + id: Required[str] + description: NotRequired[str] + number_of_installments: Required[int] + period_unit: Required[PeriodUnit] + period: NotRequired[int] + preferred_day: NotRequired[int] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + installments: NotRequired[List[Installment]] + + +class CreateInstallmentParams(TypedDict): + period: NotRequired[int] + amount_percentage: NotRequired[float] diff --git a/chargebee/models/installment_detail/__init__.py b/chargebee/models/installment_detail/__init__.py new file mode 100644 index 0000000..b1278fb --- /dev/null +++ b/chargebee/models/installment_detail/__init__.py @@ -0,0 +1,3 @@ +from .operations import InstallmentDetail +from .responses import InstallmentDetailResponse +from .types import InstallmentDetails, Installment diff --git a/chargebee/models/installment_detail/operations.py b/chargebee/models/installment_detail/operations.py new file mode 100644 index 0000000..fb7db5d --- /dev/null +++ b/chargebee/models/installment_detail/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class InstallmentDetail: + + pass diff --git a/chargebee/models/installment_detail/responses.py b/chargebee/models/installment_detail/responses.py new file mode 100644 index 0000000..1920a3a --- /dev/null +++ b/chargebee/models/installment_detail/responses.py @@ -0,0 +1,24 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class InstallmentResponse(Model): + id: str = None + invoice_id: str = None + date: int = None + amount: int = None + status: str = None + created_at: int = None + resource_version: int = None + updated_at: int = None + + +@dataclass +class InstallmentDetailResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + invoice_id: str = None + amount: int = None + installments: List[InstallmentResponse] = None diff --git a/chargebee/models/installment_detail/types.py b/chargebee/models/installment_detail/types.py new file mode 100644 index 0000000..e77c73e --- /dev/null +++ b/chargebee/models/installment_detail/types.py @@ -0,0 +1,29 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class InstallmentStatus(Enum): + POSTED = "posted" + PAYMENT_DUE = "payment_due" + PAID = "paid" + + def __str__(self): + return self.value + + +class Installment(TypedDict): + id: Required[str] + invoice_id: Required[str] + date: Required[int] + amount: Required[int] + status: Required[InstallmentStatus] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + + +class InstallmentDetails(TypedDict): + id: NotRequired[str] + invoice_id: NotRequired[str] + amount: NotRequired[int] + installments: NotRequired[List[Installment]] diff --git a/chargebee/models/invoice/__init__.py b/chargebee/models/invoice/__init__.py new file mode 100644 index 0000000..d7ad80f --- /dev/null +++ b/chargebee/models/invoice/__init__.py @@ -0,0 +1,26 @@ +from .operations import Invoice +from .responses import InvoiceResponse +from .types import ( + Invoices, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + LineItemTier, + LinkedPayment, + DunningAttempt, + AppliedCredit, + AdjustmentCreditNote, + IssuedCreditNote, + LinkedOrder, + Note, + ShippingAddress, + StatementDescriptor, + BillingAddress, + Einvoice, + SiteDetailsAtCreation, + TaxOrigin, + Status, + DunningStatus, +) diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py new file mode 100644 index 0000000..8db56d1 --- /dev/null +++ b/chargebee/models/invoice/operations.py @@ -0,0 +1,772 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Invoice: + + class CreateParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + currency_code: NotRequired[str] + addons: NotRequired[List[CreateAddonParams]] + invoice_date: NotRequired[int] + charges: NotRequired[List[CreateChargeParams]] + tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + invoice_note: NotRequired[str] + remove_general_note: NotRequired[bool] + notes_to_remove: NotRequired[List[CreateNotesToRemoveParams]] + po_number: NotRequired[str] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + authorization_transaction_id: NotRequired[str] + payment_source_id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + shipping_address: NotRequired[CreateShippingAddressParams] + statement_descriptor: NotRequired[CreateStatementDescriptorParams] + card: NotRequired[CreateCardParams] + bank_account: NotRequired[CreateBankAccountParams] + token_id: NotRequired[str] + payment_method: NotRequired[CreatePaymentMethodParams] + payment_intent: NotRequired[CreatePaymentIntentParams] + replace_primary_payment_source: NotRequired[bool] + retain_payment_source: NotRequired[bool] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class CreateForChargeItemsAndChargesParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + currency_code: NotRequired[str] + item_prices: NotRequired[List[CreateForChargeItemsAndChargesItemPriceParams]] + item_tiers: NotRequired[List[CreateForChargeItemsAndChargesItemTierParams]] + charges: NotRequired[List[CreateForChargeItemsAndChargesChargeParams]] + invoice_note: NotRequired[str] + remove_general_note: NotRequired[bool] + notes_to_remove: NotRequired[ + List[CreateForChargeItemsAndChargesNotesToRemoveParams] + ] + po_number: NotRequired[str] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + authorization_transaction_id: NotRequired[str] + payment_source_id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + tax_providers_fields: NotRequired[ + List[CreateForChargeItemsAndChargesTaxProvidersFieldParams] + ] + discounts: Required[List[CreateForChargeItemsAndChargesDiscountParams]] + invoice_date: NotRequired[int] + shipping_address: NotRequired[ + CreateForChargeItemsAndChargesShippingAddressParams + ] + statement_descriptor: NotRequired[ + CreateForChargeItemsAndChargesStatementDescriptorParams + ] + card: NotRequired[CreateForChargeItemsAndChargesCardParams] + bank_account: NotRequired[CreateForChargeItemsAndChargesBankAccountParams] + token_id: NotRequired[str] + payment_method: NotRequired[CreateForChargeItemsAndChargesPaymentMethodParams] + payment_intent: NotRequired[CreateForChargeItemsAndChargesPaymentIntentParams] + replace_primary_payment_source: NotRequired[bool] + retain_payment_source: NotRequired[bool] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class ChargeParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + currency_code: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: Required[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + coupon_ids: NotRequired[List[str]] + coupon: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + po_number: NotRequired[str] + invoice_date: NotRequired[int] + tax_providers_fields: NotRequired[List[ChargeTaxProvidersFieldParams]] + payment_source_id: NotRequired[str] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class ChargeAddonParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + addon_id: Required[str] + addon_quantity: NotRequired[int] + addon_unit_price: NotRequired[int] + addon_quantity_in_decimal: NotRequired[str] + addon_unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + coupon_ids: NotRequired[List[str]] + coupon: NotRequired[str] + po_number: NotRequired[str] + invoice_date: NotRequired[int] + payment_source_id: NotRequired[str] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class CreateForChargeItemParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + item_price: Required[CreateForChargeItemItemPriceParams] + item_tiers: NotRequired[List[CreateForChargeItemItemTierParams]] + po_number: NotRequired[str] + coupon: NotRequired[str] + payment_source_id: NotRequired[str] + payment_initiator: NotRequired[enums.PaymentInitiator] + invoice_date: NotRequired[int] + + class StopDunningParams(TypedDict): + comment: NotRequired[str] + + class ImportInvoiceParams(TypedDict): + id: Required[str] + currency_code: NotRequired[str] + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + po_number: NotRequired[str] + price_type: NotRequired[enums.PriceType] + tax_override_reason: NotRequired[enums.TaxOverrideReason] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + date: Required[int] + total: Required[int] + round_off: NotRequired[int] + status: NotRequired[Status] + voided_at: NotRequired[int] + void_reason_code: NotRequired[str] + is_written_off: NotRequired[bool] + write_off_amount: NotRequired[int] + write_off_date: NotRequired[int] + due_date: NotRequired[int] + net_term_days: NotRequired[int] + has_advance_charges: NotRequired[bool] + use_for_proration: NotRequired[bool] + line_items: Required[List[ImportInvoiceLineItemParams]] + payment_reference_numbers: Required[ + List[ImportInvoicePaymentReferenceNumberParams] + ] + line_item_tiers: Required[List[ImportInvoiceLineItemTierParams]] + discounts: Required[List[ImportInvoiceDiscountParams]] + taxes: Required[List[ImportInvoiceTaxParams]] + credit_note: NotRequired[ImportInvoiceCreditNoteParams] + payments: Required[List[ImportInvoicePaymentParams]] + notes: NotRequired[List[ImportInvoiceNoteParams]] + billing_address: NotRequired[ImportInvoiceBillingAddressParams] + shipping_address: NotRequired[ImportInvoiceShippingAddressParams] + + class ApplyPaymentsParams(TypedDict): + transactions: NotRequired[List[ApplyPaymentsTransactionParams]] + comment: NotRequired[str] + + class DeleteLineItemsParams(TypedDict): + line_items: NotRequired[List[DeleteLineItemsLineItemParams]] + + class ApplyCreditsParams(TypedDict): + credit_notes: NotRequired[List[ApplyCreditsCreditNoteParams]] + comment: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + einvoice: NotRequired[ListEinvoiceParams] + paid_on_after: NotRequired[int] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + recurring: NotRequired[Filters.BooleanFilter] + status: NotRequired[Filters.EnumFilter] + price_type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + paid_at: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + amount_paid: NotRequired[Filters.NumberFilter] + amount_adjusted: NotRequired[Filters.NumberFilter] + credits_applied: NotRequired[Filters.NumberFilter] + amount_due: NotRequired[Filters.NumberFilter] + dunning_status: NotRequired[Filters.EnumFilter] + payment_owner: NotRequired[Filters.StringFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + voided_at: NotRequired[Filters.TimestampFilter] + void_reason_code: NotRequired[Filters.StringFilter] + sort_by: NotRequired[Filters.SortFilter] + + class InvoicesForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class InvoicesForSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class PdfParams(TypedDict): + disposition_type: NotRequired[enums.DispositionType] + + class ListPaymentReferenceNumbersParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + payment_reference_number: NotRequired[ + ListPaymentReferenceNumbersPaymentReferenceNumberParams + ] + id: NotRequired[Filters.StringFilter] + + class AddChargeParams(TypedDict): + amount: Required[int] + description: Required[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + line_item: NotRequired[AddChargeLineItemParams] + comment: NotRequired[str] + subscription_id: NotRequired[str] + + class AddAddonChargeParams(TypedDict): + addon_id: Required[str] + addon_quantity: NotRequired[int] + addon_unit_price: NotRequired[int] + addon_quantity_in_decimal: NotRequired[str] + addon_unit_price_in_decimal: NotRequired[str] + line_item: NotRequired[AddAddonChargeLineItemParams] + comment: NotRequired[str] + subscription_id: NotRequired[str] + + class AddChargeItemParams(TypedDict): + item_price: Required[AddChargeItemItemPriceParams] + item_tiers: NotRequired[List[AddChargeItemItemTierParams]] + comment: NotRequired[str] + subscription_id: NotRequired[str] + + class CloseParams(TypedDict): + comment: NotRequired[str] + invoice_note: NotRequired[str] + remove_general_note: NotRequired[bool] + notes_to_remove: NotRequired[List[CloseNotesToRemoveParams]] + invoice_date: NotRequired[int] + + class CollectPaymentParams(TypedDict): + amount: NotRequired[int] + authorization_transaction_id: NotRequired[str] + payment_source_id: NotRequired[str] + comment: NotRequired[str] + payment_initiator: NotRequired[enums.PaymentInitiator] + + class RecordPaymentParams(TypedDict): + transaction: Required[RecordPaymentTransactionParams] + comment: NotRequired[str] + + class RecordTaxWithheldParams(TypedDict): + tax_withheld: Required[RecordTaxWithheldTaxWithheldParams] + + class RemoveTaxWithheldParams(TypedDict): + tax_withheld: Required[RemoveTaxWithheldTaxWithheldParams] + + class RefundParams(TypedDict): + refund_amount: NotRequired[int] + credit_note: NotRequired[RefundCreditNoteParams] + comment: NotRequired[str] + customer_notes: NotRequired[str] + + class RecordRefundParams(TypedDict): + transaction: Required[RecordRefundTransactionParams] + credit_note: NotRequired[RecordRefundCreditNoteParams] + comment: NotRequired[str] + customer_notes: NotRequired[str] + + class RemovePaymentParams(TypedDict): + transaction: Required[RemovePaymentTransactionParams] + + class RemoveCreditNoteParams(TypedDict): + credit_note: Required[RemoveCreditNoteCreditNoteParams] + + class VoidInvoiceParams(TypedDict): + comment: NotRequired[str] + void_reason_code: NotRequired[str] + + class WriteOffParams(TypedDict): + comment: NotRequired[str] + + class DeleteParams(TypedDict): + comment: NotRequired[str] + + class UpdateDetailsParams(TypedDict): + billing_address: NotRequired[UpdateDetailsBillingAddressParams] + shipping_address: NotRequired[UpdateDetailsShippingAddressParams] + statement_descriptor: NotRequired[UpdateDetailsStatementDescriptorParams] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + po_number: NotRequired[str] + comment: NotRequired[str] + + class InstallmentsParams(TypedDict): + config_id: Required[str] + amount: NotRequired[int] + + @staticmethod + def create(params: CreateParams = None, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("invoices"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def create_for_charge_items_and_charges( + params: CreateForChargeItemsAndChargesParams, env=None, headers=None + ) -> CreateForChargeItemsAndChargesResponse: + return request.send( + "post", + request.uri_path("invoices", "create_for_charge_items_and_charges"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForChargeItemsAndChargesResponse, + ) + + @staticmethod + def charge(params: ChargeParams, env=None, headers=None) -> ChargeResponse: + return request.send( + "post", + request.uri_path("invoices", "charge"), + cast(Dict[Any, Any], params), + env, + headers, + ChargeResponse, + ) + + @staticmethod + def charge_addon( + params: ChargeAddonParams, env=None, headers=None + ) -> ChargeAddonResponse: + return request.send( + "post", + request.uri_path("invoices", "charge_addon"), + cast(Dict[Any, Any], params), + env, + headers, + ChargeAddonResponse, + ) + + @staticmethod + def create_for_charge_item( + params: CreateForChargeItemParams, env=None, headers=None + ) -> CreateForChargeItemResponse: + return request.send( + "post", + request.uri_path("invoices", "create_for_charge_item"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForChargeItemResponse, + ) + + @staticmethod + def stop_dunning( + id, params: StopDunningParams = None, env=None, headers=None + ) -> StopDunningResponse: + return request.send( + "post", + request.uri_path("invoices", id, "stop_dunning"), + cast(Dict[Any, Any], params), + env, + headers, + StopDunningResponse, + ) + + @staticmethod + def import_invoice( + params: ImportInvoiceParams, env=None, headers=None + ) -> ImportInvoiceResponse: + return request.send( + "post", + request.uri_path("invoices", "import_invoice"), + cast(Dict[Any, Any], params), + env, + headers, + ImportInvoiceResponse, + ) + + @staticmethod + def apply_payments( + id, params: ApplyPaymentsParams = None, env=None, headers=None + ) -> ApplyPaymentsResponse: + return request.send( + "post", + request.uri_path("invoices", id, "apply_payments"), + cast(Dict[Any, Any], params), + env, + headers, + ApplyPaymentsResponse, + ) + + @staticmethod + def sync_usages(id, env=None, headers=None) -> SyncUsagesResponse: + return request.send( + "post", + request.uri_path("invoices", id, "sync_usages"), + None, + env, + headers, + SyncUsagesResponse, + ) + + @staticmethod + def delete_line_items( + id, params: DeleteLineItemsParams = None, env=None, headers=None + ) -> DeleteLineItemsResponse: + return request.send( + "post", + request.uri_path("invoices", id, "delete_line_items"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteLineItemsResponse, + ) + + @staticmethod + def apply_credits( + id, params: ApplyCreditsParams = None, env=None, headers=None + ) -> ApplyCreditsResponse: + return request.send( + "post", + request.uri_path("invoices", id, "apply_credits"), + cast(Dict[Any, Any], params), + env, + headers, + ApplyCreditsResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("invoices"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def invoices_for_customer( + id, params: InvoicesForCustomerParams = None, env=None, headers=None + ) -> InvoicesForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "invoices"), + cast(Dict[Any, Any], params), + env, + headers, + InvoicesForCustomerResponse, + ) + + @staticmethod + def invoices_for_subscription( + id, params: InvoicesForSubscriptionParams = None, env=None, headers=None + ) -> InvoicesForSubscriptionResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "invoices"), + cast(Dict[Any, Any], params), + env, + headers, + InvoicesForSubscriptionResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("invoices", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + return request.send( + "post", + request.uri_path("invoices", id, "pdf"), + cast(Dict[Any, Any], params), + env, + headers, + PdfResponse, + ) + + @staticmethod + def download_einvoice(id, env=None, headers=None) -> DownloadEinvoiceResponse: + return request.send( + "get", + request.uri_path("invoices", id, "download_einvoice"), + None, + env, + headers, + DownloadEinvoiceResponse, + ) + + @staticmethod + def list_payment_reference_numbers( + params: ListPaymentReferenceNumbersParams = None, env=None, headers=None + ) -> ListPaymentReferenceNumbersResponse: + return request.send( + "get", + request.uri_path("invoices", "payment_reference_numbers"), + cast(Dict[Any, Any], params), + env, + headers, + ListPaymentReferenceNumbersResponse, + ) + + @staticmethod + def add_charge( + id, params: AddChargeParams, env=None, headers=None + ) -> AddChargeResponse: + return request.send( + "post", + request.uri_path("invoices", id, "add_charge"), + cast(Dict[Any, Any], params), + env, + headers, + AddChargeResponse, + ) + + @staticmethod + def add_addon_charge( + id, params: AddAddonChargeParams, env=None, headers=None + ) -> AddAddonChargeResponse: + return request.send( + "post", + request.uri_path("invoices", id, "add_addon_charge"), + cast(Dict[Any, Any], params), + env, + headers, + AddAddonChargeResponse, + ) + + @staticmethod + def add_charge_item( + id, params: AddChargeItemParams, env=None, headers=None + ) -> AddChargeItemResponse: + return request.send( + "post", + request.uri_path("invoices", id, "add_charge_item"), + cast(Dict[Any, Any], params), + env, + headers, + AddChargeItemResponse, + ) + + @staticmethod + def close(id, params: CloseParams = None, env=None, headers=None) -> CloseResponse: + return request.send( + "post", + request.uri_path("invoices", id, "close"), + cast(Dict[Any, Any], params), + env, + headers, + CloseResponse, + ) + + @staticmethod + def collect_payment( + id, params: CollectPaymentParams = None, env=None, headers=None + ) -> CollectPaymentResponse: + return request.send( + "post", + request.uri_path("invoices", id, "collect_payment"), + cast(Dict[Any, Any], params), + env, + headers, + CollectPaymentResponse, + ) + + @staticmethod + def record_payment( + id, params: RecordPaymentParams, env=None, headers=None + ) -> RecordPaymentResponse: + return request.send( + "post", + request.uri_path("invoices", id, "record_payment"), + cast(Dict[Any, Any], params), + env, + headers, + RecordPaymentResponse, + ) + + @staticmethod + def record_tax_withheld( + id, params: RecordTaxWithheldParams, env=None, headers=None + ) -> RecordTaxWithheldResponse: + return request.send( + "post", + request.uri_path("invoices", id, "record_tax_withheld"), + cast(Dict[Any, Any], params), + env, + headers, + RecordTaxWithheldResponse, + ) + + @staticmethod + def remove_tax_withheld( + id, params: RemoveTaxWithheldParams, env=None, headers=None + ) -> RemoveTaxWithheldResponse: + return request.send( + "post", + request.uri_path("invoices", id, "remove_tax_withheld"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveTaxWithheldResponse, + ) + + @staticmethod + def refund( + id, params: RefundParams = None, env=None, headers=None + ) -> RefundResponse: + return request.send( + "post", + request.uri_path("invoices", id, "refund"), + cast(Dict[Any, Any], params), + env, + headers, + RefundResponse, + ) + + @staticmethod + def record_refund( + id, params: RecordRefundParams, env=None, headers=None + ) -> RecordRefundResponse: + return request.send( + "post", + request.uri_path("invoices", id, "record_refund"), + cast(Dict[Any, Any], params), + env, + headers, + RecordRefundResponse, + ) + + @staticmethod + def remove_payment( + id, params: RemovePaymentParams, env=None, headers=None + ) -> RemovePaymentResponse: + return request.send( + "post", + request.uri_path("invoices", id, "remove_payment"), + cast(Dict[Any, Any], params), + env, + headers, + RemovePaymentResponse, + ) + + @staticmethod + def remove_credit_note( + id, params: RemoveCreditNoteParams, env=None, headers=None + ) -> RemoveCreditNoteResponse: + return request.send( + "post", + request.uri_path("invoices", id, "remove_credit_note"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveCreditNoteResponse, + ) + + @staticmethod + def void_invoice( + id, params: VoidInvoiceParams = None, env=None, headers=None + ) -> VoidInvoiceResponse: + return request.send( + "post", + request.uri_path("invoices", id, "void"), + cast(Dict[Any, Any], params), + env, + headers, + VoidInvoiceResponse, + ) + + @staticmethod + def write_off( + id, params: WriteOffParams = None, env=None, headers=None + ) -> WriteOffResponse: + return request.send( + "post", + request.uri_path("invoices", id, "write_off"), + cast(Dict[Any, Any], params), + env, + headers, + WriteOffResponse, + ) + + @staticmethod + def delete( + id, params: DeleteParams = None, env=None, headers=None + ) -> DeleteResponse: + return request.send( + "post", + request.uri_path("invoices", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def update_details( + id, params: UpdateDetailsParams = None, env=None, headers=None + ) -> UpdateDetailsResponse: + return request.send( + "post", + request.uri_path("invoices", id, "update_details"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateDetailsResponse, + ) + + @staticmethod + def installments( + id, params: InstallmentsParams, env=None, headers=None + ) -> InstallmentsResponse: + return request.send( + "post", + request.uri_path("invoices", id, "installments"), + cast(Dict[Any, Any], params), + env, + headers, + InstallmentsResponse, + ) + + @staticmethod + def resend_einvoice(id, env=None, headers=None) -> ResendEinvoiceResponse: + return request.send( + "post", + request.uri_path("invoices", id, "resend_einvoice"), + None, + env, + headers, + ResendEinvoiceResponse, + ) + + @staticmethod + def send_einvoice(id, env=None, headers=None) -> SendEinvoiceResponse: + return request.send( + "post", + request.uri_path("invoices", id, "send_einvoice"), + None, + env, + headers, + SendEinvoiceResponse, + ) diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py new file mode 100644 index 0000000..25b1cdd --- /dev/null +++ b/chargebee/models/invoice/responses.py @@ -0,0 +1,559 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + credit_note, + payment_reference_number, + payment_intent, + transaction, + credit_note, + transaction, + payment_reference_number, + download, +) + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LineItemTierResponse(Model): + 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 + + +@dataclass +class LinkedPaymentResponse(Model): + txn_id: str = None + applied_amount: int = None + applied_at: int = None + txn_status: str = None + txn_date: int = None + txn_amount: int = None + + +@dataclass +class DunningAttemptResponse(Model): + attempt: int = None + transaction_id: str = None + dunning_type: str = None + created_at: int = None + txn_status: str = None + txn_amount: int = None + + +@dataclass +class AppliedCreditResponse(Model): + cn_id: str = None + applied_amount: int = None + applied_at: int = None + cn_reason_code: str = None + cn_create_reason_code: str = None + cn_date: int = None + cn_status: str = None + + +@dataclass +class AdjustmentCreditNoteResponse(Model): + cn_id: str = None + cn_reason_code: str = None + cn_create_reason_code: str = None + cn_date: int = None + cn_total: int = None + cn_status: str = None + + +@dataclass +class IssuedCreditNoteResponse(Model): + cn_id: str = None + cn_reason_code: str = None + cn_create_reason_code: str = None + cn_date: int = None + cn_total: int = None + cn_status: str = None + + +@dataclass +class LinkedOrderResponse(Model): + id: str = None + document_number: str = None + status: str = None + order_type: str = None + reference_id: str = None + fulfillment_status: str = None + batch_id: str = None + created_at: int = None + + +@dataclass +class NoteResponse(Model): + entity_type: str = None + note: str = None + entity_id: str = None + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class StatementDescriptorResponse(Model): + id: str = None + descriptor: str = None + + +@dataclass +class BillingAddressResponse(Model): + 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 EinvoiceResponse(Model): + id: str = None + reference_number: str = None + status: str = None + message: str = None + + +@dataclass +class SiteDetailsAtCreationResponse(Model): + timezone: str = None + organization_address: Dict[Any, Any] = None + + +@dataclass +class TaxOriginResponse(Model): + country: str = None + registration_number: str = None + + +@dataclass +class InvoiceResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + po_number: str = None + customer_id: 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 + exchange_rate: float = None + currency_code: str = None + total: int = None + amount_paid: int = None + amount_adjusted: 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 + term_finalized: bool = None + is_gifted: bool = None + generated_at: int = None + expected_payment_date: int = None + amount_to_collect: int = None + round_off_amount: 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 + line_item_tiers: List[LineItemTierResponse] = None + linked_payments: List[LinkedPaymentResponse] = None + dunning_attempts: List[DunningAttemptResponse] = None + applied_credits: List[AppliedCreditResponse] = None + adjustment_credit_notes: List[AdjustmentCreditNoteResponse] = None + issued_credit_notes: List[IssuedCreditNoteResponse] = None + linked_orders: List[LinkedOrderResponse] = None + notes: List[NoteResponse] = None + shipping_address: ShippingAddressResponse = None + statement_descriptor: StatementDescriptorResponse = None + billing_address: BillingAddressResponse = None + einvoice: EinvoiceResponse = None + payment_owner: str = None + void_reason_code: str = None + deleted: bool = None + tax_category: str = None + vat_number_prefix: str = None + channel: str = None + business_entity_id: str = None + site_details_at_creation: SiteDetailsAtCreationResponse = None + tax_origin: TaxOriginResponse = None + + +@dataclass +class CreateResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForChargeItemsAndChargesResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChargeResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChargeAddonResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForChargeItemResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class StopDunningResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportInvoiceResponse: + invoice: InvoiceResponse + credit_note: "credit_note.CreditNoteResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ApplyPaymentsResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SyncUsagesResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteLineItemsResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ApplyCreditsResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListInvoiceResponse: + invoice: InvoiceResponse + + +@dataclass +class ListResponse: + list: List[ListInvoiceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class InvoicesForCustomerInvoiceResponse: + invoice: InvoiceResponse + + +@dataclass +class InvoicesForCustomerResponse: + list: List[InvoicesForCustomerInvoiceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class InvoicesForSubscriptionInvoiceResponse: + invoice: InvoiceResponse + + +@dataclass +class InvoicesForSubscriptionResponse: + list: List[InvoicesForSubscriptionInvoiceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PdfResponse: + download: "download.DownloadResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class DownloadEinvoiceResponse: + downloads: List["download.DownloadResponse"] + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListPaymentReferenceNumbersInvoiceResponse: + payment_reference_number: "payment_reference_number.PaymentReferenceNumberResponse" + + +@dataclass +class ListPaymentReferenceNumbersResponse: + list: List[ListPaymentReferenceNumbersInvoiceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddChargeResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddAddonChargeResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddChargeItemResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CloseResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CollectPaymentResponse: + invoice: InvoiceResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordPaymentResponse: + invoice: InvoiceResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordTaxWithheldResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveTaxWithheldResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RefundResponse: + invoice: InvoiceResponse + transaction: "transaction.TransactionResponse" + credit_note: "credit_note.CreditNoteResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordRefundResponse: + invoice: InvoiceResponse + transaction: "transaction.TransactionResponse" = None + credit_note: "credit_note.CreditNoteResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemovePaymentResponse: + invoice: InvoiceResponse + transaction: "transaction.TransactionResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveCreditNoteResponse: + invoice: InvoiceResponse + credit_note: "credit_note.CreditNoteResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class VoidInvoiceResponse: + invoice: InvoiceResponse + credit_note: "credit_note.CreditNoteResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class WriteOffResponse: + invoice: InvoiceResponse + credit_note: "credit_note.CreditNoteResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateDetailsResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class InstallmentsResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ResendEinvoiceResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SendEinvoiceResponse: + invoice: InvoiceResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/invoice/types.py b/chargebee/models/invoice/types.py new file mode 100644 index 0000000..e28b0cd --- /dev/null +++ b/chargebee/models/invoice/types.py @@ -0,0 +1,938 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import ( + enums, + credit_note, + payment_reference_number, + payment_intent, + transaction, +) + + +class Status(Enum): + PAID = "paid" + POSTED = "posted" + PAYMENT_DUE = "payment_due" + NOT_PAID = "not_paid" + VOIDED = "voided" + PENDING = "pending" + + def __str__(self): + return self.value + + +class DunningStatus(Enum): + IN_PROGRESS = "in_progress" + EXHAUSTED = "exhausted" + STOPPED = "stopped" + SUCCESS = "success" + + def __str__(self): + return self.value + + +class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LinkedOrderStatus(Enum): + NEW = "new" + PROCESSING = "processing" + COMPLETE = "complete" + CANCELLED = "cancelled" + VOIDED = "voided" + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + + def __str__(self): + return self.value + + +class LinkedOrderOrderType(Enum): + MANUAL = "manual" + SYSTEM_GENERATED = "system_generated" + + def __str__(self): + return self.value + + +class NoteEntityType(Enum): + COUPON = "coupon" + SUBSCRIPTION = "subscription" + CUSTOMER = "customer" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + TAX = "tax" + PLAN = "plan" + ADDON = "addon" + + 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 LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[LineItemDiscountDiscountType] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + +class LinkedPayment(TypedDict): + txn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + txn_status: NotRequired["transaction.Status"] + txn_date: NotRequired[int] + txn_amount: NotRequired[int] + + +class DunningAttempt(TypedDict): + attempt: Required[int] + transaction_id: NotRequired[str] + dunning_type: Required[enums.DunningType] + created_at: NotRequired[int] + txn_status: NotRequired["transaction.Status"] + txn_amount: NotRequired[int] + + +class AppliedCredit(TypedDict): + cn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + cn_reason_code: NotRequired["credit_note.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_status: Required["credit_note.Status"] + + +class AdjustmentCreditNote(TypedDict): + cn_id: Required[str] + cn_reason_code: NotRequired["credit_note.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.Status"] + + +class IssuedCreditNote(TypedDict): + cn_id: Required[str] + cn_reason_code: NotRequired["credit_note.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.Status"] + + +class LinkedOrder(TypedDict): + id: Required[str] + document_number: NotRequired[str] + status: NotRequired[LinkedOrderStatus] + order_type: NotRequired[LinkedOrderOrderType] + reference_id: NotRequired[str] + fulfillment_status: NotRequired[str] + batch_id: NotRequired[str] + created_at: Required[int] + + +class Note(TypedDict): + entity_type: Required[NoteEntityType] + note: Required[str] + entity_id: NotRequired[str] + + +class ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class StatementDescriptor(TypedDict): + id: Required[str] + descriptor: NotRequired[str] + + +class BillingAddress(TypedDict): + 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 Einvoice(TypedDict): + id: Required[str] + reference_number: NotRequired[str] + status: Required[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 Invoices(TypedDict): + id: Required[str] + po_number: NotRequired[str] + customer_id: Required[str] + subscription_id: NotRequired[str] + recurring: Required[bool] + status: Required[Status] + vat_number: NotRequired[str] + price_type: Required[enums.PriceType] + date: NotRequired[int] + due_date: NotRequired[int] + net_term_days: NotRequired[int] + exchange_rate: NotRequired[float] + currency_code: Required[str] + total: NotRequired[int] + amount_paid: NotRequired[int] + amount_adjusted: NotRequired[int] + write_off_amount: NotRequired[int] + credits_applied: NotRequired[int] + amount_due: NotRequired[int] + paid_at: NotRequired[int] + dunning_status: NotRequired[DunningStatus] + next_retry_at: NotRequired[int] + voided_at: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + sub_total: Required[int] + sub_total_in_local_currency: NotRequired[int] + total_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + tax: Required[int] + local_currency_exchange_rate: NotRequired[float] + first_invoice: NotRequired[bool] + new_sales_amount: NotRequired[int] + has_advance_charges: NotRequired[bool] + term_finalized: Required[bool] + is_gifted: Required[bool] + generated_at: NotRequired[int] + expected_payment_date: NotRequired[int] + amount_to_collect: NotRequired[int] + round_off_amount: NotRequired[int] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] + line_item_tiers: NotRequired[List[LineItemTier]] + linked_payments: NotRequired[List[LinkedPayment]] + dunning_attempts: NotRequired[List[DunningAttempt]] + applied_credits: NotRequired[List[AppliedCredit]] + adjustment_credit_notes: NotRequired[List[AdjustmentCreditNote]] + issued_credit_notes: NotRequired[List[IssuedCreditNote]] + linked_orders: NotRequired[List[LinkedOrder]] + notes: NotRequired[List[Note]] + shipping_address: NotRequired[ShippingAddress] + statement_descriptor: NotRequired[StatementDescriptor] + billing_address: NotRequired[BillingAddress] + einvoice: NotRequired[Einvoice] + payment_owner: NotRequired[str] + void_reason_code: NotRequired[str] + deleted: Required[bool] + tax_category: NotRequired[str] + vat_number_prefix: NotRequired[str] + channel: NotRequired[enums.Channel] + business_entity_id: NotRequired[str] + site_details_at_creation: NotRequired[SiteDetailsAtCreation] + tax_origin: NotRequired[TaxOrigin] + + +class CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + +class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateForChargeItemsAndChargesNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + +class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + +class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForChargeItemsAndChargesStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateForChargeItemsAndChargesCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateForChargeItemsAndChargesBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class CreateForChargeItemsAndChargesPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateForChargeItemsAndChargesPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class ChargeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateForChargeItemItemPriceParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateForChargeItemItemTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class ImportInvoiceLineItemParams(TypedDict): + id: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + subscription_id: NotRequired[str] + description: Required[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + entity_type: NotRequired[LineItemEntityType] + entity_id: NotRequired[str] + item_level_discount1_entity_id: NotRequired[str] + item_level_discount1_amount: NotRequired[int] + item_level_discount2_entity_id: NotRequired[str] + item_level_discount2_amount: NotRequired[int] + tax1_name: NotRequired[str] + tax1_amount: NotRequired[int] + tax2_name: NotRequired[str] + tax2_amount: NotRequired[int] + tax3_name: NotRequired[str] + tax3_amount: NotRequired[int] + tax4_name: NotRequired[str] + tax4_amount: NotRequired[int] + tax5_name: NotRequired[str] + tax5_amount: NotRequired[int] + tax6_name: NotRequired[str] + tax6_amount: NotRequired[int] + tax7_name: NotRequired[str] + tax7_amount: NotRequired[int] + tax8_name: NotRequired[str] + tax8_amount: NotRequired[int] + tax9_name: NotRequired[str] + tax9_amount: NotRequired[int] + tax10_name: NotRequired[str] + tax10_amount: NotRequired[int] + + +class ImportInvoicePaymentReferenceNumberParams(TypedDict): + id: NotRequired[str] + type: Required["payment_reference_number.Type"] + number: Required[str] + + +class ImportInvoiceLineItemTierParams(TypedDict): + line_item_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + +class ImportInvoiceDiscountParams(TypedDict): + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + +class ImportInvoiceTaxParams(TypedDict): + name: Required[str] + rate: Required[float] + amount: NotRequired[int] + description: NotRequired[str] + juris_type: NotRequired[enums.TaxJurisType] + juris_name: NotRequired[str] + juris_code: NotRequired[str] + + +class ImportInvoiceCreditNoteParams(TypedDict): + id: NotRequired[str] + + +class ImportInvoicePaymentParams(TypedDict): + amount: Required[int] + payment_method: Required[enums.PaymentMethod] + date: NotRequired[int] + reference_number: NotRequired[str] + + +class ImportInvoiceNoteParams(TypedDict): + entity_type: NotRequired[NoteEntityType] + entity_id: NotRequired[str] + note: NotRequired[str] + + +class ImportInvoiceBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportInvoiceShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ApplyPaymentsTransactionParams(TypedDict): + id: NotRequired[str] + amount: NotRequired[int] + + +class DeleteLineItemsLineItemParams(TypedDict): + id: NotRequired[str] + + +class ApplyCreditsCreditNoteParams(TypedDict): + id: NotRequired[str] + + +class ListEinvoiceParams(TypedDict): + Status: NotRequired[Filters.EnumFilter] + + +class ListPaymentReferenceNumbersPaymentReferenceNumberParams(TypedDict): + Number: NotRequired[Filters.StringFilter] + + +class AddChargeLineItemParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class AddAddonChargeLineItemParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class AddChargeItemItemPriceParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class AddChargeItemItemTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CloseNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + +class RecordPaymentTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + id_at_gateway: NotRequired[str] + status: NotRequired["transaction.Status"] + date: NotRequired[int] + error_code: NotRequired[str] + error_text: NotRequired[str] + + +class RecordTaxWithheldTaxWithheldParams(TypedDict): + amount: Required[int] + reference_number: NotRequired[str] + date: NotRequired[int] + description: NotRequired[str] + + +class RemoveTaxWithheldTaxWithheldParams(TypedDict): + id: Required[str] + + +class RefundCreditNoteParams(TypedDict): + reason_code: NotRequired["credit_note.ReasonCode"] + create_reason_code: NotRequired[str] + + +class RecordRefundTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + date: Required[int] + + +class RecordRefundCreditNoteParams(TypedDict): + reason_code: NotRequired["credit_note.ReasonCode"] + create_reason_code: NotRequired[str] + + +class RemovePaymentTransactionParams(TypedDict): + id: Required[str] + + +class RemoveCreditNoteCreditNoteParams(TypedDict): + id: Required[str] + + +class UpdateDetailsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateDetailsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateDetailsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] diff --git a/chargebee/models/invoice_estimate/__init__.py b/chargebee/models/invoice_estimate/__init__.py new file mode 100644 index 0000000..b6bb8c8 --- /dev/null +++ b/chargebee/models/invoice_estimate/__init__.py @@ -0,0 +1,11 @@ +from .operations import InvoiceEstimate +from .responses import InvoiceEstimateResponse +from .types import ( + InvoiceEstimates, + LineItem, + Discount, + Tax, + LineItemTax, + LineItemTier, + LineItemDiscount, +) diff --git a/chargebee/models/invoice_estimate/operations.py b/chargebee/models/invoice_estimate/operations.py new file mode 100644 index 0000000..406738e --- /dev/null +++ b/chargebee/models/invoice_estimate/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class InvoiceEstimate: + + pass diff --git a/chargebee/models/invoice_estimate/responses.py b/chargebee/models/invoice_estimate/responses.py new file mode 100644 index 0000000..cd1986d --- /dev/null +++ b/chargebee/models/invoice_estimate/responses.py @@ -0,0 +1,109 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LineItemTierResponse(Model): + 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 + + +@dataclass +class LineItemDiscountResponse(Model): + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None + + +@dataclass +class InvoiceEstimateResponse(Model): + raw_data: Dict[Any, Any] = None + recurring: bool = None + price_type: str = None + currency_code: str = None + sub_total: int = None + total: int = None + credits_applied: int = None + 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_discounts: List[LineItemDiscountResponse] = None + round_off_amount: int = None + customer_id: str = None diff --git a/chargebee/models/invoice_estimate/types.py b/chargebee/models/invoice_estimate/types.py new file mode 100644 index 0000000..76684a9 --- /dev/null +++ b/chargebee/models/invoice_estimate/types.py @@ -0,0 +1,138 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + +class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[LineItemDiscountDiscountType] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] + + +class InvoiceEstimates(TypedDict): + recurring: Required[bool] + price_type: Required[enums.PriceType] + currency_code: Required[str] + sub_total: Required[int] + total: NotRequired[int] + credits_applied: NotRequired[int] + amount_paid: NotRequired[int] + amount_due: NotRequired[int] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] + line_item_tiers: NotRequired[List[LineItemTier]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + round_off_amount: NotRequired[int] + customer_id: NotRequired[str] diff --git a/chargebee/models/item/__init__.py b/chargebee/models/item/__init__.py new file mode 100644 index 0000000..2f5a4fb --- /dev/null +++ b/chargebee/models/item/__init__.py @@ -0,0 +1,10 @@ +from .operations import Item +from .responses import ItemResponse +from .types import ( + Items, + ApplicableItem, + Status, + Type, + ItemApplicability, + UsageCalculation, +) diff --git a/chargebee/models/item/operations.py b/chargebee/models/item/operations.py new file mode 100644 index 0000000..33fea57 --- /dev/null +++ b/chargebee/models/item/operations.py @@ -0,0 +1,117 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Item: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + type: Required[Type] + description: NotRequired[str] + item_family_id: Required[str] + is_giftable: NotRequired[bool] + is_shippable: NotRequired[bool] + external_name: NotRequired[str] + enabled_in_portal: NotRequired[bool] + redirect_url: NotRequired[str] + enabled_for_checkout: NotRequired[bool] + item_applicability: NotRequired[ItemApplicability] + applicable_items: NotRequired[List[str]] + unit: NotRequired[str] + gift_claim_redirect_url: NotRequired[str] + included_in_mrr: NotRequired[bool] + metered: NotRequired[bool] + usage_calculation: NotRequired[UsageCalculation] + metadata: NotRequired[Dict[Any, Any]] + + class UpdateParams(TypedDict): + name: NotRequired[str] + description: NotRequired[str] + is_shippable: NotRequired[bool] + external_name: NotRequired[str] + item_family_id: NotRequired[str] + enabled_in_portal: NotRequired[bool] + redirect_url: NotRequired[str] + enabled_for_checkout: NotRequired[bool] + item_applicability: NotRequired[ItemApplicability] + clear_applicable_items: NotRequired[bool] + applicable_items: NotRequired[List[str]] + unit: NotRequired[str] + gift_claim_redirect_url: NotRequired[str] + metadata: NotRequired[Dict[Any, Any]] + included_in_mrr: NotRequired[bool] + status: NotRequired[Status] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + item_family_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + name: NotRequired[Filters.StringFilter] + item_applicability: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + is_giftable: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + enabled_for_checkout: NotRequired[Filters.BooleanFilter] + enabled_in_portal: NotRequired[Filters.BooleanFilter] + metered: NotRequired[Filters.BooleanFilter] + usage_calculation: NotRequired[Filters.EnumFilter] + channel: NotRequired[Filters.EnumFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("items", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("items", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("items"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("items", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) diff --git a/chargebee/models/item/responses.py b/chargebee/models/item/responses.py new file mode 100644 index 0000000..ed89624 --- /dev/null +++ b/chargebee/models/item/responses.py @@ -0,0 +1,73 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ApplicableItemResponse(Model): + id: str = None + + +@dataclass +class ItemResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + external_name: str = None + description: str = None + status: str = None + resource_version: int = None + updated_at: int = None + item_family_id: str = None + type: str = None + is_shippable: bool = None + is_giftable: bool = None + redirect_url: str = None + enabled_for_checkout: bool = None + enabled_in_portal: bool = None + included_in_mrr: bool = None + item_applicability: str = None + gift_claim_redirect_url: str = None + unit: str = None + metered: bool = None + usage_calculation: str = None + archived_at: int = None + channel: str = None + applicable_items: List[ApplicableItemResponse] = None + metadata: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + item: ItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + item: ItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + item: ItemResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListItemResponse: + item: ItemResponse + + +@dataclass +class ListResponse: + list: List[ListItemResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + item: ItemResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/item/types.py b/chargebee/models/item/types.py new file mode 100644 index 0000000..a2e6c3e --- /dev/null +++ b/chargebee/models/item/types.py @@ -0,0 +1,69 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class Type(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + +class ItemApplicability(Enum): + ALL = "all" + RESTRICTED = "restricted" + + def __str__(self): + return self.value + + +class UsageCalculation(Enum): + SUM_OF_USAGES = "sum_of_usages" + LAST_USAGE = "last_usage" + MAX_USAGE = "max_usage" + + def __str__(self): + return self.value + + +class ApplicableItem(TypedDict): + id: NotRequired[str] + + +class Items(TypedDict): + id: Required[str] + name: Required[str] + external_name: NotRequired[str] + description: NotRequired[str] + status: NotRequired[Status] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + item_family_id: NotRequired[str] + type: Required[Type] + is_shippable: NotRequired[bool] + is_giftable: Required[bool] + redirect_url: NotRequired[str] + enabled_for_checkout: Required[bool] + enabled_in_portal: Required[bool] + included_in_mrr: NotRequired[bool] + item_applicability: Required[ItemApplicability] + gift_claim_redirect_url: NotRequired[str] + unit: NotRequired[str] + metered: Required[bool] + usage_calculation: NotRequired[UsageCalculation] + archived_at: NotRequired[int] + channel: NotRequired[enums.Channel] + applicable_items: NotRequired[List[ApplicableItem]] + metadata: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/item_entitlement/__init__.py b/chargebee/models/item_entitlement/__init__.py new file mode 100644 index 0000000..e7999ed --- /dev/null +++ b/chargebee/models/item_entitlement/__init__.py @@ -0,0 +1,3 @@ +from .operations import ItemEntitlement +from .responses import ItemEntitlementResponse +from .types import ItemEntitlements, ItemType diff --git a/chargebee/models/item_entitlement/operations.py b/chargebee/models/item_entitlement/operations.py new file mode 100644 index 0000000..2148e3f --- /dev/null +++ b/chargebee/models/item_entitlement/operations.py @@ -0,0 +1,81 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.models import enums + + +class ItemEntitlement: + + class ItemEntitlementsForItemParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_drafts: NotRequired[bool] + embed: NotRequired[str] + + class ItemEntitlementsForFeatureParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_drafts: NotRequired[bool] + + class AddItemEntitlementsParams(TypedDict): + action: Required[enums.Action] + item_entitlements: Required[List[AddItemEntitlementsItemEntitlementParams]] + + class UpsertOrRemoveItemEntitlementsForItemParams(TypedDict): + action: Required[enums.Action] + item_entitlements: Required[ + List[UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams] + ] + + @staticmethod + def item_entitlements_for_item( + id, params: ItemEntitlementsForItemParams = None, env=None, headers=None + ) -> ItemEntitlementsForItemResponse: + return request.send( + "get", + request.uri_path("items", id, "item_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + ItemEntitlementsForItemResponse, + ) + + @staticmethod + def item_entitlements_for_feature( + id, params: ItemEntitlementsForFeatureParams = None, env=None, headers=None + ) -> ItemEntitlementsForFeatureResponse: + return request.send( + "get", + request.uri_path("features", id, "item_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + ItemEntitlementsForFeatureResponse, + ) + + @staticmethod + def add_item_entitlements( + id, params: AddItemEntitlementsParams, env=None, headers=None + ) -> AddItemEntitlementsResponse: + return request.send( + "post", + request.uri_path("features", id, "item_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + AddItemEntitlementsResponse, + ) + + @staticmethod + def upsert_or_remove_item_entitlements_for_item( + id, params: UpsertOrRemoveItemEntitlementsForItemParams, env=None, headers=None + ) -> UpsertOrRemoveItemEntitlementsForItemResponse: + return request.send( + "post", + request.uri_path("items", id, "item_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + UpsertOrRemoveItemEntitlementsForItemResponse, + ) diff --git a/chargebee/models/item_entitlement/responses.py b/chargebee/models/item_entitlement/responses.py new file mode 100644 index 0000000..c9631f1 --- /dev/null +++ b/chargebee/models/item_entitlement/responses.py @@ -0,0 +1,51 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ItemEntitlementResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + item_id: str = None + item_type: str = None + feature_id: str = None + feature_name: str = None + value: str = None + name: str = None + + +@dataclass +class ItemEntitlementsForItemItemEntitlementResponse: + item_entitlement: ItemEntitlementResponse + + +@dataclass +class ItemEntitlementsForItemResponse: + list: List[ItemEntitlementsForItemItemEntitlementResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ItemEntitlementsForFeatureItemEntitlementResponse: + item_entitlement: ItemEntitlementResponse + + +@dataclass +class ItemEntitlementsForFeatureResponse: + list: List[ItemEntitlementsForFeatureItemEntitlementResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddItemEntitlementsResponse: + item_entitlement: ItemEntitlementResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpsertOrRemoveItemEntitlementsForItemResponse: + item_entitlement: ItemEntitlementResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/item_entitlement/types.py b/chargebee/models/item_entitlement/types.py new file mode 100644 index 0000000..6d44639 --- /dev/null +++ b/chargebee/models/item_entitlement/types.py @@ -0,0 +1,34 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class ItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + SUBSCRIPTION = "subscription" + ITEM = "item" + + def __str__(self): + return self.value + + +class ItemEntitlements(TypedDict): + id: Required[str] + item_id: NotRequired[str] + item_type: NotRequired[ItemType] + feature_id: NotRequired[str] + feature_name: NotRequired[str] + value: NotRequired[str] + name: NotRequired[str] + + +class AddItemEntitlementsItemEntitlementParams(TypedDict): + item_id: Required[str] + item_type: NotRequired[ItemType] + value: NotRequired[str] + + +class UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams(TypedDict): + feature_id: Required[str] + value: NotRequired[str] diff --git a/chargebee/models/item_family/__init__.py b/chargebee/models/item_family/__init__.py new file mode 100644 index 0000000..0958dba --- /dev/null +++ b/chargebee/models/item_family/__init__.py @@ -0,0 +1,3 @@ +from .operations import ItemFamily +from .responses import ItemFamilyResponse +from .types import ItemFamilies, Status diff --git a/chargebee/models/item_family/operations.py b/chargebee/models/item_family/operations.py new file mode 100644 index 0000000..11eab81 --- /dev/null +++ b/chargebee/models/item_family/operations.py @@ -0,0 +1,81 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class ItemFamily: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + description: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + class UpdateParams(TypedDict): + name: NotRequired[str] + description: NotRequired[str] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("item_families"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("item_families", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("item_families"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("item_families", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("item_families", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) diff --git a/chargebee/models/item_family/responses.py b/chargebee/models/item_family/responses.py new file mode 100644 index 0000000..5420b77 --- /dev/null +++ b/chargebee/models/item_family/responses.py @@ -0,0 +1,51 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ItemFamilyResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + description: str = None + status: str = None + resource_version: int = None + updated_at: int = None + channel: str = None + + +@dataclass +class CreateResponse: + item_family: ItemFamilyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + item_family: ItemFamilyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListItemFamilyResponse: + item_family: ItemFamilyResponse + + +@dataclass +class ListResponse: + list: List[ListItemFamilyResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + item_family: ItemFamilyResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + item_family: ItemFamilyResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/item_family/types.py b/chargebee/models/item_family/types.py new file mode 100644 index 0000000..e1368ad --- /dev/null +++ b/chargebee/models/item_family/types.py @@ -0,0 +1,21 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + ACTIVE = "active" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class ItemFamilies(TypedDict): + id: Required[str] + name: Required[str] + description: NotRequired[str] + status: NotRequired[Status] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + channel: NotRequired[enums.Channel] diff --git a/chargebee/models/item_price/__init__.py b/chargebee/models/item_price/__init__.py new file mode 100644 index 0000000..434545d --- /dev/null +++ b/chargebee/models/item_price/__init__.py @@ -0,0 +1,15 @@ +from .operations import ItemPrice +from .responses import ItemPriceResponse +from .types import ( + ItemPrices, + Tier, + TaxDetail, + TaxProvidersField, + AccountingDetail, + Status, + ProrationType, + PeriodUnit, + TrialPeriodUnit, + TrialEndAction, + ShippingPeriodUnit, +) diff --git a/chargebee/models/item_price/operations.py b/chargebee/models/item_price/operations.py new file mode 100644 index 0000000..ec19d14 --- /dev/null +++ b/chargebee/models/item_price/operations.py @@ -0,0 +1,189 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class ItemPrice: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + description: NotRequired[str] + item_id: Required[str] + invoice_notes: NotRequired[str] + proration_type: NotRequired[ProrationType] + external_name: NotRequired[str] + currency_code: NotRequired[str] + price_variant_id: NotRequired[str] + is_taxable: NotRequired[bool] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + metadata: NotRequired[Dict[Any, Any]] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] + pricing_model: NotRequired[enums.PricingModel] + tiers: NotRequired[List[CreateTierParams]] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + period_unit: NotRequired[PeriodUnit] + period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_period: NotRequired[int] + shipping_period: NotRequired[int] + shipping_period_unit: NotRequired[ShippingPeriodUnit] + billing_cycles: NotRequired[int] + trial_end_action: NotRequired[TrialEndAction] + tax_detail: NotRequired[CreateTaxDetailParams] + tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] + accounting_detail: NotRequired[CreateAccountingDetailParams] + + class UpdateParams(TypedDict): + name: NotRequired[str] + description: NotRequired[str] + proration_type: NotRequired[ProrationType] + price_variant_id: NotRequired[str] + status: NotRequired[Status] + external_name: NotRequired[str] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] + currency_code: NotRequired[str] + invoice_notes: NotRequired[str] + is_taxable: NotRequired[bool] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + metadata: NotRequired[Dict[Any, Any]] + pricing_model: NotRequired[enums.PricingModel] + tiers: NotRequired[List[UpdateTierParams]] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + period_unit: NotRequired[PeriodUnit] + period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_period: NotRequired[int] + shipping_period: NotRequired[int] + shipping_period_unit: NotRequired[ShippingPeriodUnit] + billing_cycles: NotRequired[int] + trial_end_action: NotRequired[TrialEndAction] + tax_detail: NotRequired[UpdateTaxDetailParams] + tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] + accounting_detail: NotRequired[UpdateAccountingDetailParams] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + pricing_model: NotRequired[Filters.EnumFilter] + item_id: NotRequired[Filters.StringFilter] + item_family_id: NotRequired[Filters.StringFilter] + item_type: NotRequired[Filters.EnumFilter] + currency_code: NotRequired[Filters.StringFilter] + price_variant_id: NotRequired[Filters.StringFilter] + trial_period: NotRequired[Filters.NumberFilter] + trial_period_unit: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + period_unit: NotRequired[Filters.EnumFilter] + period: NotRequired[Filters.NumberFilter] + channel: NotRequired[Filters.EnumFilter] + sort_by: NotRequired[Filters.SortFilter] + + class FindApplicableItemsParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + sort_by: NotRequired[Filters.SortFilter] + + class FindApplicableItemPricesParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + item_id: NotRequired[str] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("item_prices"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("item_prices", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("item_prices", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("item_prices"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("item_prices", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def find_applicable_items( + id, params: FindApplicableItemsParams = None, env=None, headers=None + ) -> FindApplicableItemsResponse: + return request.send( + "get", + request.uri_path("item_prices", id, "applicable_items"), + cast(Dict[Any, Any], params), + env, + headers, + FindApplicableItemsResponse, + ) + + @staticmethod + def find_applicable_item_prices( + id, params: FindApplicableItemPricesParams = None, env=None, headers=None + ) -> FindApplicableItemPricesResponse: + return request.send( + "get", + request.uri_path("item_prices", id, "applicable_item_prices"), + cast(Dict[Any, Any], params), + env, + headers, + FindApplicableItemPricesResponse, + ) diff --git a/chargebee/models/item_price/responses.py b/chargebee/models/item_price/responses.py new file mode 100644 index 0000000..15091d9 --- /dev/null +++ b/chargebee/models/item_price/responses.py @@ -0,0 +1,148 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import item + + +@dataclass +class TierResponse(Model): + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + + +@dataclass +class TaxDetailResponse(Model): + tax_profile_id: str = None + avalara_sale_type: str = None + avalara_transaction_type: int = None + avalara_service_type: int = None + avalara_tax_code: str = None + hsn_code: str = None + taxjar_product_code: str = None + + +@dataclass +class TaxProvidersFieldResponse(Model): + provider_name: str = None + field_id: str = None + field_value: str = None + + +@dataclass +class AccountingDetailResponse(Model): + sku: str = None + accounting_code: str = None + accounting_category1: str = None + accounting_category2: str = None + accounting_category3: str = None + accounting_category4: str = None + + +@dataclass +class ItemPriceResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + item_family_id: str = None + item_id: str = None + description: str = None + status: str = None + external_name: str = None + price_variant_id: str = None + proration_type: str = None + pricing_model: str = None + price: int = None + price_in_decimal: str = None + period: int = None + currency_code: str = None + period_unit: str = None + trial_period: int = None + trial_period_unit: str = None + trial_end_action: str = None + shipping_period: int = None + shipping_period_unit: str = None + billing_cycles: int = None + free_quantity: int = None + free_quantity_in_decimal: str = None + channel: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + usage_accumulation_reset_frequency: str = None + archived_at: int = None + invoice_notes: str = None + tiers: List[TierResponse] = None + is_taxable: bool = None + tax_detail: TaxDetailResponse = None + tax_providers_fields: List[TaxProvidersFieldResponse] = None + accounting_detail: AccountingDetailResponse = None + metadata: Dict[Any, Any] = None + item_type: str = None + archivable: bool = None + parent_item_id: str = None + show_description_in_invoices: bool = None + show_description_in_quotes: bool = None + + +@dataclass +class CreateResponse: + item_price: ItemPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + item_price: ItemPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + item_price: ItemPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListItemPriceResponse: + item_price: ItemPriceResponse + + +@dataclass +class ListResponse: + list: List[ListItemPriceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + item_price: ItemPriceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class FindApplicableItemsItemPriceResponse: + item: "item.ItemResponse" + + +@dataclass +class FindApplicableItemsResponse: + list: List[FindApplicableItemsItemPriceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class FindApplicableItemPricesItemPriceResponse: + item_price: ItemPriceResponse + + +@dataclass +class FindApplicableItemPricesResponse: + list: List[FindApplicableItemPricesItemPriceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/item_price/types.py b/chargebee/models/item_price/types.py new file mode 100644 index 0000000..df0b7ec --- /dev/null +++ b/chargebee/models/item_price/types.py @@ -0,0 +1,206 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class ProrationType(Enum): + SITE_DEFAULT = "site_default" + PARTIAL_TERM = "partial_term" + FULL_TERM = "full_term" + + def __str__(self): + return self.value + + +class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class TrialPeriodUnit(Enum): + DAY = "day" + MONTH = "month" + + def __str__(self): + return self.value + + +class TrialEndAction(Enum): + SITE_DEFAULT = "site_default" + ACTIVATE_SUBSCRIPTION = "activate_subscription" + CANCEL_SUBSCRIPTION = "cancel_subscription" + + def __str__(self): + return self.value + + +class ShippingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class TaxDetail(TypedDict): + tax_profile_id: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + + +class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class AccountingDetail(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + + +class ItemPrices(TypedDict): + id: Required[str] + name: Required[str] + item_family_id: NotRequired[str] + item_id: NotRequired[str] + description: NotRequired[str] + status: NotRequired[Status] + external_name: NotRequired[str] + price_variant_id: NotRequired[str] + proration_type: NotRequired[ProrationType] + pricing_model: Required[enums.PricingModel] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + period: NotRequired[int] + currency_code: Required[str] + period_unit: NotRequired[PeriodUnit] + trial_period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_end_action: NotRequired[TrialEndAction] + shipping_period: NotRequired[int] + shipping_period_unit: NotRequired[ShippingPeriodUnit] + billing_cycles: NotRequired[int] + free_quantity: Required[int] + free_quantity_in_decimal: NotRequired[str] + channel: NotRequired[enums.Channel] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] + archived_at: NotRequired[int] + invoice_notes: NotRequired[str] + tiers: NotRequired[List[Tier]] + is_taxable: NotRequired[bool] + tax_detail: NotRequired[TaxDetail] + tax_providers_fields: NotRequired[List[TaxProvidersField]] + accounting_detail: NotRequired[AccountingDetail] + metadata: NotRequired[Dict[Any, Any]] + item_type: NotRequired[enums.ItemType] + archivable: NotRequired[bool] + parent_item_id: NotRequired[str] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + + +class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateTaxDetailParams(TypedDict): + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + taxjar_product_code: NotRequired[str] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class CreateAccountingDetailParams(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + + +class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateTaxDetailParams(TypedDict): + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + taxjar_product_code: NotRequired[str] + + +class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class UpdateAccountingDetailParams(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] diff --git a/chargebee/models/metadata/__init__.py b/chargebee/models/metadata/__init__.py new file mode 100644 index 0000000..a62e82c --- /dev/null +++ b/chargebee/models/metadata/__init__.py @@ -0,0 +1,3 @@ +from .operations import Metadata +from .responses import MetadataResponse +from .types import Metadata diff --git a/chargebee/models/metadata/operations.py b/chargebee/models/metadata/operations.py new file mode 100644 index 0000000..ef368e5 --- /dev/null +++ b/chargebee/models/metadata/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Metadata: + + pass diff --git a/chargebee/models/metadata/responses.py b/chargebee/models/metadata/responses.py new file mode 100644 index 0000000..3d7a8fc --- /dev/null +++ b/chargebee/models/metadata/responses.py @@ -0,0 +1,9 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class MetadataResponse(Model): + raw_data: Dict[Any, Any] = None + change_type: str = None diff --git a/chargebee/models/metadata/types.py b/chargebee/models/metadata/types.py new file mode 100644 index 0000000..b1f665e --- /dev/null +++ b/chargebee/models/metadata/types.py @@ -0,0 +1,5 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any + + +class Metadata(TypedDict): + change_type: NotRequired[str] diff --git a/chargebee/models/order/__init__.py b/chargebee/models/order/__init__.py new file mode 100644 index 0000000..c452184 --- /dev/null +++ b/chargebee/models/order/__init__.py @@ -0,0 +1,17 @@ +from .operations import Order +from .responses import OrderResponse +from .types import ( + Orders, + OrderLineItem, + ShippingAddress, + BillingAddress, + LineItemTax, + LineItemDiscount, + LinkedCreditNote, + ResentOrder, + Status, + CancellationReason, + PaymentStatus, + OrderType, + ResentStatus, +) diff --git a/chargebee/models/order/operations.py b/chargebee/models/order/operations.py new file mode 100644 index 0000000..f3ff4dc --- /dev/null +++ b/chargebee/models/order/operations.py @@ -0,0 +1,247 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Order: + + class CreateParams(TypedDict): + id: NotRequired[str] + invoice_id: Required[str] + status: NotRequired[Status] + reference_id: NotRequired[str] + fulfillment_status: NotRequired[str] + note: NotRequired[str] + tracking_id: NotRequired[str] + tracking_url: NotRequired[str] + batch_id: NotRequired[str] + + class UpdateParams(TypedDict): + reference_id: NotRequired[str] + batch_id: NotRequired[str] + note: NotRequired[str] + shipping_date: NotRequired[int] + order_date: NotRequired[int] + cancelled_at: NotRequired[int] + cancellation_reason: NotRequired[CancellationReason] + shipped_at: NotRequired[int] + delivered_at: NotRequired[int] + order_line_items: NotRequired[List[UpdateOrderLineItemParams]] + tracking_url: NotRequired[str] + tracking_id: NotRequired[str] + shipment_carrier: NotRequired[str] + fulfillment_status: NotRequired[str] + status: NotRequired[Status] + shipping_address: NotRequired[UpdateShippingAddressParams] + + class ImportOrderParams(TypedDict): + id: NotRequired[str] + document_number: NotRequired[str] + invoice_id: Required[str] + status: Required[Status] + subscription_id: NotRequired[str] + customer_id: NotRequired[str] + created_at: Required[int] + order_date: Required[int] + shipping_date: Required[int] + reference_id: NotRequired[str] + fulfillment_status: NotRequired[str] + note: NotRequired[str] + tracking_id: NotRequired[str] + tracking_url: NotRequired[str] + batch_id: NotRequired[str] + shipment_carrier: NotRequired[str] + shipping_cut_off_date: NotRequired[int] + delivered_at: NotRequired[int] + shipped_at: NotRequired[int] + cancelled_at: NotRequired[int] + cancellation_reason: NotRequired[CancellationReason] + refundable_credits_issued: NotRequired[int] + shipping_address: NotRequired[ImportOrderShippingAddressParams] + billing_address: NotRequired[ImportOrderBillingAddressParams] + + class CancelParams(TypedDict): + cancellation_reason: Required[CancellationReason] + credit_note: NotRequired[CancelCreditNoteParams] + customer_notes: NotRequired[str] + comment: NotRequired[str] + cancelled_at: NotRequired[int] + + class CreateRefundableCreditNoteParams(TypedDict): + credit_note: Required[CreateRefundableCreditNoteCreditNoteParams] + customer_notes: NotRequired[str] + comment: NotRequired[str] + + class ReopenParams(TypedDict): + void_cancellation_credit_notes: NotRequired[bool] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + exclude_deleted_credit_notes: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + invoice_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + shipping_date: NotRequired[Filters.TimestampFilter] + shipped_at: NotRequired[Filters.TimestampFilter] + order_type: NotRequired[Filters.EnumFilter] + order_date: NotRequired[Filters.TimestampFilter] + paid_on: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + created_at: NotRequired[Filters.TimestampFilter] + resent_status: NotRequired[Filters.EnumFilter] + is_resent: NotRequired[Filters.BooleanFilter] + original_order_id: NotRequired[Filters.StringFilter] + sort_by: NotRequired[Filters.SortFilter] + + class OrdersForInvoiceParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class ResendParams(TypedDict): + shipping_date: NotRequired[int] + resend_reason: NotRequired[str] + order_line_items: NotRequired[List[ResendOrderLineItemParams]] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("orders"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("orders", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def import_order( + params: ImportOrderParams, env=None, headers=None + ) -> ImportOrderResponse: + return request.send( + "post", + request.uri_path("orders", "import_order"), + cast(Dict[Any, Any], params), + env, + headers, + ImportOrderResponse, + ) + + @staticmethod + def assign_order_number(id, env=None, headers=None) -> AssignOrderNumberResponse: + return request.send( + "post", + request.uri_path("orders", id, "assign_order_number"), + None, + env, + headers, + AssignOrderNumberResponse, + ) + + @staticmethod + def cancel(id, params: CancelParams, env=None, headers=None) -> CancelResponse: + return request.send( + "post", + request.uri_path("orders", id, "cancel"), + cast(Dict[Any, Any], params), + env, + headers, + CancelResponse, + ) + + @staticmethod + def create_refundable_credit_note( + id, params: CreateRefundableCreditNoteParams, env=None, headers=None + ) -> CreateRefundableCreditNoteResponse: + return request.send( + "post", + request.uri_path("orders", id, "create_refundable_credit_note"), + cast(Dict[Any, Any], params), + env, + headers, + CreateRefundableCreditNoteResponse, + ) + + @staticmethod + def reopen( + id, params: ReopenParams = None, env=None, headers=None + ) -> ReopenResponse: + return request.send( + "post", + request.uri_path("orders", id, "reopen"), + cast(Dict[Any, Any], params), + env, + headers, + ReopenResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("orders", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("orders", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("orders"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def orders_for_invoice( + id, params: OrdersForInvoiceParams = None, env=None, headers=None + ) -> OrdersForInvoiceResponse: + return request.send( + "get", + request.uri_path("invoices", id, "orders"), + cast(Dict[Any, Any], params), + env, + headers, + OrdersForInvoiceResponse, + ) + + @staticmethod + def resend( + id, params: ResendParams = None, env=None, headers=None + ) -> ResendResponse: + return request.send( + "post", + request.uri_path("orders", id, "resend"), + cast(Dict[Any, Any], params), + env, + headers, + ResendResponse, + ) diff --git a/chargebee/models/order/responses.py b/chargebee/models/order/responses.py new file mode 100644 index 0000000..fdd6451 --- /dev/null +++ b/chargebee/models/order/responses.py @@ -0,0 +1,255 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import credit_note + + +@dataclass +class OrderLineItemResponse(Model): + id: str = None + invoice_id: str = None + invoice_line_item_id: str = None + unit_price: int = None + description: str = None + amount: int = None + fulfillment_quantity: int = None + fulfillment_amount: int = None + tax_amount: int = None + amount_paid: int = None + amount_adjusted: int = None + refundable_credits_issued: int = None + refundable_credits: int = None + is_shippable: bool = None + sku: str = None + status: str = None + entity_type: str = None + item_level_discount_amount: int = None + discount_amount: int = None + entity_id: str = None + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class BillingAddressResponse(Model): + 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 LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None + + +@dataclass +class LinkedCreditNoteResponse(Model): + amount: int = None + type: str = None + id: str = None + status: str = None + amount_adjusted: int = None + amount_refunded: int = None + + +@dataclass +class ResentOrderResponse(Model): + order_id: str = None + reason: str = None + amount: int = None + + +@dataclass +class OrderResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + document_number: str = None + invoice_id: str = None + subscription_id: str = None + customer_id: str = None + status: str = None + cancellation_reason: str = None + payment_status: str = None + order_type: str = None + price_type: str = None + reference_id: str = None + fulfillment_status: str = None + order_date: int = None + shipping_date: int = None + note: str = None + tracking_id: str = None + tracking_url: str = None + batch_id: str = None + created_by: str = None + shipment_carrier: str = None + invoice_round_off_amount: int = None + tax: int = None + amount_paid: int = None + amount_adjusted: int = None + refundable_credits_issued: int = None + refundable_credits: int = None + rounding_adjustement: int = None + paid_on: int = None + shipping_cut_off_date: int = None + created_at: int = None + status_update_at: int = None + delivered_at: int = None + shipped_at: int = None + resource_version: int = None + updated_at: int = None + cancelled_at: int = None + resent_status: str = None + is_resent: bool = None + original_order_id: str = None + order_line_items: List[OrderLineItemResponse] = None + shipping_address: ShippingAddressResponse = None + billing_address: BillingAddressResponse = None + discount: int = None + sub_total: int = None + total: int = None + line_item_taxes: List[LineItemTaxResponse] = None + line_item_discounts: List[LineItemDiscountResponse] = None + linked_credit_notes: List[LinkedCreditNoteResponse] = None + deleted: bool = None + currency_code: str = None + is_gifted: bool = None + gift_note: str = None + gift_id: str = None + resend_reason: str = None + resent_orders: List[ResentOrderResponse] = None + business_entity_id: str = None + + +@dataclass +class CreateResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportOrderResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class AssignOrderNumberResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateRefundableCreditNoteResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ReopenResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListOrderResponse: + order: OrderResponse + + +@dataclass +class ListResponse: + list: List[ListOrderResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class OrdersForInvoiceOrderResponse: + order: OrderResponse + + +@dataclass +class OrdersForInvoiceResponse: + list: List[OrdersForInvoiceOrderResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ResendResponse: + order: OrderResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/order/types.py b/chargebee/models/order/types.py new file mode 100644 index 0000000..e345c0e --- /dev/null +++ b/chargebee/models/order/types.py @@ -0,0 +1,352 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, credit_note + + +class Status(Enum): + NEW = "new" + PROCESSING = "processing" + COMPLETE = "complete" + CANCELLED = "cancelled" + VOIDED = "voided" + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + + def __str__(self): + return self.value + + +class CancellationReason(Enum): + SHIPPING_CUT_OFF_PASSED = "shipping_cut_off_passed" + PRODUCT_UNSATISFACTORY = "product_unsatisfactory" + THIRD_PARTY_CANCELLATION = "third_party_cancellation" + PRODUCT_NOT_REQUIRED = "product_not_required" + DELIVERY_DATE_MISSED = "delivery_date_missed" + ALTERNATIVE_FOUND = "alternative_found" + INVOICE_WRITTEN_OFF = "invoice_written_off" + INVOICE_VOIDED = "invoice_voided" + FRAUDULENT_TRANSACTION = "fraudulent_transaction" + PAYMENT_DECLINED = "payment_declined" + SUBSCRIPTION_CANCELLED = "subscription_cancelled" + PRODUCT_NOT_AVAILABLE = "product_not_available" + OTHERS = "others" + ORDER_RESENT = "order_resent" + + def __str__(self): + return self.value + + +class PaymentStatus(Enum): + NOT_PAID = "not_paid" + PAID = "paid" + + def __str__(self): + return self.value + + +class OrderType(Enum): + MANUAL = "manual" + SYSTEM_GENERATED = "system_generated" + + def __str__(self): + return self.value + + +class ResentStatus(Enum): + FULLY_RESENT = "fully_resent" + PARTIALLY_RESENT = "partially_resent" + + def __str__(self): + return self.value + + +class OrderLineItemStatus(Enum): + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + CANCELLED = "cancelled" + + def __str__(self): + return self.value + + +class OrderLineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + CUSTOM_DISCOUNT = "custom_discount" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class OrderLineItemLinkedCreditType(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + +class OrderLineItemLinkedCreditStatus(Enum): + ADJUSTED = "adjusted" + REFUNDED = "refunded" + REFUND_DUE = "refund_due" + VOIDED = "voided" + + def __str__(self): + return self.value + + +class OrderLineItem(TypedDict): + id: Required[str] + invoice_id: Required[str] + invoice_line_item_id: Required[str] + unit_price: NotRequired[int] + description: NotRequired[str] + amount: NotRequired[int] + fulfillment_quantity: NotRequired[int] + fulfillment_amount: NotRequired[int] + tax_amount: NotRequired[int] + amount_paid: NotRequired[int] + amount_adjusted: NotRequired[int] + refundable_credits_issued: NotRequired[int] + refundable_credits: NotRequired[int] + is_shippable: Required[bool] + sku: NotRequired[str] + status: NotRequired[OrderLineItemStatus] + entity_type: Required[OrderLineItemEntityType] + item_level_discount_amount: NotRequired[int] + discount_amount: NotRequired[int] + entity_id: NotRequired[str] + + +class ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class BillingAddress(TypedDict): + 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 LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[LineItemDiscountDiscountType] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] + + +class LinkedCreditNote(TypedDict): + amount: NotRequired[int] + type: Required[OrderLineItemLinkedCreditType] + id: Required[str] + status: Required[OrderLineItemLinkedCreditStatus] + amount_adjusted: NotRequired[int] + amount_refunded: NotRequired[int] + + +class ResentOrder(TypedDict): + order_id: Required[str] + reason: NotRequired[str] + amount: NotRequired[int] + + +class Orders(TypedDict): + id: Required[str] + document_number: NotRequired[str] + invoice_id: NotRequired[str] + subscription_id: NotRequired[str] + customer_id: NotRequired[str] + status: NotRequired[Status] + cancellation_reason: NotRequired[CancellationReason] + payment_status: NotRequired[PaymentStatus] + order_type: NotRequired[OrderType] + price_type: Required[enums.PriceType] + reference_id: NotRequired[str] + fulfillment_status: NotRequired[str] + order_date: NotRequired[int] + shipping_date: NotRequired[int] + note: NotRequired[str] + tracking_id: NotRequired[str] + tracking_url: NotRequired[str] + batch_id: NotRequired[str] + created_by: NotRequired[str] + shipment_carrier: NotRequired[str] + invoice_round_off_amount: NotRequired[int] + tax: NotRequired[int] + amount_paid: NotRequired[int] + amount_adjusted: NotRequired[int] + refundable_credits_issued: NotRequired[int] + refundable_credits: NotRequired[int] + rounding_adjustement: NotRequired[int] + paid_on: NotRequired[int] + shipping_cut_off_date: NotRequired[int] + created_at: Required[int] + status_update_at: NotRequired[int] + delivered_at: NotRequired[int] + shipped_at: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + cancelled_at: NotRequired[int] + resent_status: NotRequired[ResentStatus] + is_resent: Required[bool] + original_order_id: NotRequired[str] + order_line_items: NotRequired[List[OrderLineItem]] + shipping_address: NotRequired[ShippingAddress] + billing_address: NotRequired[BillingAddress] + discount: NotRequired[int] + sub_total: NotRequired[int] + total: NotRequired[int] + line_item_taxes: NotRequired[List[LineItemTax]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + linked_credit_notes: NotRequired[List[LinkedCreditNote]] + deleted: Required[bool] + currency_code: NotRequired[str] + is_gifted: NotRequired[bool] + gift_note: NotRequired[str] + gift_id: NotRequired[str] + resend_reason: NotRequired[str] + resent_orders: NotRequired[List[ResentOrder]] + business_entity_id: NotRequired[str] + + +class UpdateOrderLineItemParams(TypedDict): + id: NotRequired[str] + status: NotRequired[OrderLineItemStatus] + sku: NotRequired[str] + + +class UpdateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportOrderShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportOrderBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CancelCreditNoteParams(TypedDict): + total: NotRequired[int] + + +class CreateRefundableCreditNoteCreditNoteParams(TypedDict): + reason_code: Required["credit_note.ReasonCode"] + total: Required[int] + + +class ResendOrderLineItemParams(TypedDict): + id: NotRequired[str] + fulfillment_quantity: NotRequired[int] diff --git a/chargebee/models/payment_intent/__init__.py b/chargebee/models/payment_intent/__init__.py new file mode 100644 index 0000000..9106803 --- /dev/null +++ b/chargebee/models/payment_intent/__init__.py @@ -0,0 +1,3 @@ +from .operations import PaymentIntent +from .responses import PaymentIntentResponse +from .types import PaymentIntents, PaymentAttempt, Status, PaymentMethodType diff --git a/chargebee/models/payment_intent/operations.py b/chargebee/models/payment_intent/operations.py new file mode 100644 index 0000000..be3a271 --- /dev/null +++ b/chargebee/models/payment_intent/operations.py @@ -0,0 +1,61 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class PaymentIntent: + + class CreateParams(TypedDict): + business_entity_id: NotRequired[str] + customer_id: NotRequired[str] + amount: Required[int] + currency_code: Required[str] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + payment_method_type: NotRequired[PaymentMethodType] + success_url: NotRequired[str] + failure_url: NotRequired[str] + + class UpdateParams(TypedDict): + amount: NotRequired[int] + currency_code: NotRequired[str] + gateway_account_id: NotRequired[str] + payment_method_type: NotRequired[PaymentMethodType] + success_url: NotRequired[str] + failure_url: NotRequired[str] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("payment_intents"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("payment_intents", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("payment_intents", id), + None, + env, + headers, + RetrieveResponse, + ) diff --git a/chargebee/models/payment_intent/responses.py b/chargebee/models/payment_intent/responses.py new file mode 100644 index 0000000..411c647 --- /dev/null +++ b/chargebee/models/payment_intent/responses.py @@ -0,0 +1,58 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import gateway_error_detail + + +@dataclass +class PaymentAttemptResponse(Model): + id: str = None + status: str = None + payment_method_type: str = None + id_at_gateway: str = None + error_code: str = None + error_text: str = None + created_at: int = None + modified_at: int = None + error_detail: gateway_error_detail.GatewayErrorDetails = None + + +@dataclass +class PaymentIntentResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + status: str = None + currency_code: str = None + amount: int = None + gateway_account_id: str = None + expires_at: int = None + reference_id: str = None + payment_method_type: str = None + success_url: str = None + failure_url: str = None + created_at: int = None + modified_at: int = None + resource_version: int = None + updated_at: int = None + customer_id: str = None + gateway: str = None + active_payment_attempt: PaymentAttemptResponse = None + business_entity_id: str = None + + +@dataclass +class CreateResponse: + payment_intent: PaymentIntentResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + payment_intent: PaymentIntentResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + payment_intent: PaymentIntentResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/payment_intent/types.py b/chargebee/models/payment_intent/types.py new file mode 100644 index 0000000..8e49323 --- /dev/null +++ b/chargebee/models/payment_intent/types.py @@ -0,0 +1,86 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import gateway_error_detail + + +class Status(Enum): + INITED = "inited" + IN_PROGRESS = "in_progress" + AUTHORIZED = "authorized" + CONSUMED = "consumed" + EXPIRED = "expired" + + def __str__(self): + return self.value + + +class PaymentMethodType(Enum): + CARD = "card" + IDEAL = "ideal" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GOOGLE_PAY = "google_pay" + DOTPAY = "dotpay" + GIROPAY = "giropay" + APPLE_PAY = "apple_pay" + UPI = "upi" + NETBANKING_EMANDATES = "netbanking_emandates" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + DIRECT_DEBIT = "direct_debit" + BOLETO = "boleto" + VENMO = "venmo" + AMAZON_PAYMENTS = "amazon_payments" + PAY_TO = "pay_to" + FASTER_PAYMENTS = "faster_payments" + SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" + KLARNA_PAY_NOW = "klarna_pay_now" + ONLINE_BANKING_POLAND = "online_banking_poland" + + def __str__(self): + return self.value + + +class PaymentAttemptStatus(Enum): + INITED = "inited" + REQUIRES_IDENTIFICATION = "requires_identification" + REQUIRES_CHALLENGE = "requires_challenge" + REQUIRES_REDIRECTION = "requires_redirection" + AUTHORIZED = "authorized" + REFUSED = "refused" + PENDING_AUTHORIZATION = "pending_authorization" + + def __str__(self): + return self.value + + +class PaymentAttempt(TypedDict): + id: NotRequired[str] + status: Required[PaymentAttemptStatus] + payment_method_type: NotRequired[PaymentMethodType] + id_at_gateway: NotRequired[str] + error_code: NotRequired[str] + error_text: NotRequired[str] + created_at: Required[int] + modified_at: Required[int] + error_detail: NotRequired[gateway_error_detail.GatewayErrorDetails] + + +class PaymentIntents(TypedDict): + id: Required[str] + status: Required[Status] + currency_code: NotRequired[str] + amount: Required[int] + gateway_account_id: Required[str] + expires_at: Required[int] + reference_id: NotRequired[str] + payment_method_type: NotRequired[PaymentMethodType] + success_url: NotRequired[str] + failure_url: NotRequired[str] + created_at: Required[int] + modified_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + customer_id: Required[str] + gateway: NotRequired[str] + active_payment_attempt: NotRequired[PaymentAttempt] + business_entity_id: NotRequired[str] diff --git a/chargebee/models/payment_reference_number/__init__.py b/chargebee/models/payment_reference_number/__init__.py new file mode 100644 index 0000000..a76e587 --- /dev/null +++ b/chargebee/models/payment_reference_number/__init__.py @@ -0,0 +1,3 @@ +from .operations import PaymentReferenceNumber +from .responses import PaymentReferenceNumberResponse +from .types import PaymentReferenceNumbers, Type diff --git a/chargebee/models/payment_reference_number/operations.py b/chargebee/models/payment_reference_number/operations.py new file mode 100644 index 0000000..296765b --- /dev/null +++ b/chargebee/models/payment_reference_number/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class PaymentReferenceNumber: + + pass diff --git a/chargebee/models/payment_reference_number/responses.py b/chargebee/models/payment_reference_number/responses.py new file mode 100644 index 0000000..7d9e3af --- /dev/null +++ b/chargebee/models/payment_reference_number/responses.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class PaymentReferenceNumberResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + type: str = None + number: str = None + invoice_id: str = None diff --git a/chargebee/models/payment_reference_number/types.py b/chargebee/models/payment_reference_number/types.py new file mode 100644 index 0000000..4df25bf --- /dev/null +++ b/chargebee/models/payment_reference_number/types.py @@ -0,0 +1,20 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Type(Enum): + KID = "kid" + OCR = "ocr" + FRN = "frn" + FIK = "fik" + SWISS_REFERENCE = "swiss_reference" + + def __str__(self): + return self.value + + +class PaymentReferenceNumbers(TypedDict): + id: Required[str] + type: Required[Type] + number: Required[str] + invoice_id: NotRequired[str] diff --git a/chargebee/models/payment_source/__init__.py b/chargebee/models/payment_source/__init__.py new file mode 100644 index 0000000..7a0ee75 --- /dev/null +++ b/chargebee/models/payment_source/__init__.py @@ -0,0 +1,16 @@ +from .operations import PaymentSource +from .responses import PaymentSourceResponse +from .types import ( + PaymentSources, + Card, + BankAccount, + CustVoucherSource, + BillingAddress, + AmazonPayment, + Upi, + Paypal, + Venmo, + KlarnaPayNow, + Mandate, + Status, +) diff --git a/chargebee/models/payment_source/operations.py b/chargebee/models/payment_source/operations.py new file mode 100644 index 0000000..b6d551f --- /dev/null +++ b/chargebee/models/payment_source/operations.py @@ -0,0 +1,289 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class PaymentSource: + + class CreateUsingTempTokenParams(TypedDict): + customer_id: Required[str] + gateway_account_id: NotRequired[str] + type: Required[enums.Type] + tmp_token: Required[str] + issuing_country: NotRequired[str] + replace_primary_payment_source: NotRequired[bool] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateUsingPermanentTokenParams(TypedDict): + customer_id: Required[str] + type: Required[enums.Type] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + issuing_country: NotRequired[str] + replace_primary_payment_source: NotRequired[bool] + payment_method_token: NotRequired[str] + customer_profile_token: NotRequired[str] + network_transaction_id: NotRequired[str] + mandate_id: NotRequired[str] + skip_retrieval: NotRequired[bool] + card: NotRequired[CreateUsingPermanentTokenCardParams] + billing_address: NotRequired[CreateUsingPermanentTokenBillingAddressParams] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateUsingTokenParams(TypedDict): + customer_id: Required[str] + replace_primary_payment_source: NotRequired[bool] + token_id: Required[str] + + class CreateUsingPaymentIntentParams(TypedDict): + customer_id: Required[str] + payment_intent: NotRequired[CreateUsingPaymentIntentPaymentIntentParams] + replace_primary_payment_source: NotRequired[bool] + + class CreateVoucherPaymentSourceParams(TypedDict): + customer_id: Required[str] + voucher_payment_source: Required[ + CreateVoucherPaymentSourceVoucherPaymentSourceParams + ] + + class CreateCardParams(TypedDict): + customer_id: Required[str] + card: Required[CreateCardCardParams] + replace_primary_payment_source: NotRequired[bool] + + class CreateBankAccountParams(TypedDict): + customer_id: Required[str] + bank_account: NotRequired[CreateBankAccountBankAccountParams] + issuing_country: NotRequired[str] + replace_primary_payment_source: NotRequired[bool] + + class UpdateCardParams(TypedDict): + card: NotRequired[UpdateCardCardParams] + gateway_meta_data: NotRequired[Dict[Any, Any]] + reference_transaction: NotRequired[str] + + class UpdateBankAccountParams(TypedDict): + bank_account: NotRequired[UpdateBankAccountBankAccountParams] + + class VerifyBankAccountParams(TypedDict): + amount1: Required[int] + amount2: Required[int] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + subscription_id: NotRequired[str] + customer_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + created_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + class SwitchGatewayAccountParams(TypedDict): + gateway_account_id: Required[str] + + class ExportPaymentSourceParams(TypedDict): + gateway_account_id: Required[str] + + @staticmethod + def create_using_temp_token( + params: CreateUsingTempTokenParams, env=None, headers=None + ) -> CreateUsingTempTokenResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_using_temp_token"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUsingTempTokenResponse, + ) + + @staticmethod + def create_using_permanent_token( + params: CreateUsingPermanentTokenParams, env=None, headers=None + ) -> CreateUsingPermanentTokenResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_using_permanent_token"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUsingPermanentTokenResponse, + ) + + @staticmethod + def create_using_token( + params: CreateUsingTokenParams, env=None, headers=None + ) -> CreateUsingTokenResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_using_token"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUsingTokenResponse, + ) + + @staticmethod + def create_using_payment_intent( + params: CreateUsingPaymentIntentParams, env=None, headers=None + ) -> CreateUsingPaymentIntentResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_using_payment_intent"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUsingPaymentIntentResponse, + ) + + @staticmethod + def create_voucher_payment_source( + params: CreateVoucherPaymentSourceParams, env=None, headers=None + ) -> CreateVoucherPaymentSourceResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_voucher_payment_source"), + cast(Dict[Any, Any], params), + env, + headers, + CreateVoucherPaymentSourceResponse, + ) + + @staticmethod + def create_card( + params: CreateCardParams, env=None, headers=None + ) -> CreateCardResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_card"), + cast(Dict[Any, Any], params), + env, + headers, + CreateCardResponse, + ) + + @staticmethod + def create_bank_account( + params: CreateBankAccountParams, env=None, headers=None + ) -> CreateBankAccountResponse: + return request.send( + "post", + request.uri_path("payment_sources", "create_bank_account"), + cast(Dict[Any, Any], params), + env, + headers, + CreateBankAccountResponse, + ) + + @staticmethod + def update_card( + id, params: UpdateCardParams = None, env=None, headers=None + ) -> UpdateCardResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "update_card"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateCardResponse, + ) + + @staticmethod + def update_bank_account( + id, params: UpdateBankAccountParams = None, env=None, headers=None + ) -> UpdateBankAccountResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "update_bank_account"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateBankAccountResponse, + ) + + @staticmethod + def verify_bank_account( + id, params: VerifyBankAccountParams, env=None, headers=None + ) -> VerifyBankAccountResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "verify_bank_account"), + cast(Dict[Any, Any], params), + env, + headers, + VerifyBankAccountResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("payment_sources", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("payment_sources"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def switch_gateway_account( + id, params: SwitchGatewayAccountParams, env=None, headers=None + ) -> SwitchGatewayAccountResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "switch_gateway_account"), + cast(Dict[Any, Any], params), + env, + headers, + SwitchGatewayAccountResponse, + ) + + @staticmethod + def export_payment_source( + id, params: ExportPaymentSourceParams, env=None, headers=None + ) -> ExportPaymentSourceResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "export_payment_source"), + cast(Dict[Any, Any], params), + env, + headers, + ExportPaymentSourceResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def delete_local(id, env=None, headers=None) -> DeleteLocalResponse: + return request.send( + "post", + request.uri_path("payment_sources", id, "delete_local"), + None, + env, + headers, + DeleteLocalResponse, + ) diff --git a/chargebee/models/payment_source/responses.py b/chargebee/models/payment_source/responses.py new file mode 100644 index 0000000..002ac8d --- /dev/null +++ b/chargebee/models/payment_source/responses.py @@ -0,0 +1,249 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + payment_intent, + customer, + third_party_payment_method, + download, +) + + +@dataclass +class CardResponse(Model): + first_name: str = None + last_name: str = None + iin: str = None + last4: str = None + brand: str = None + funding_type: str = None + expiry_month: int = None + expiry_year: int = None + billing_addr1: str = None + billing_addr2: str = None + billing_city: str = None + billing_state_code: str = None + billing_state: str = None + billing_country: str = None + billing_zip: str = None + masked_number: str = None + + +@dataclass +class BankAccountResponse(Model): + last4: str = None + name_on_account: str = None + first_name: str = None + last_name: str = None + direct_debit_scheme: str = None + bank_name: str = None + mandate_id: str = None + account_type: str = None + echeck_type: str = None + account_holder_type: str = None + email: str = None + + +@dataclass +class CustVoucherSourceResponse(Model): + last4: str = None + first_name: str = None + last_name: str = None + email: str = None + + +@dataclass +class BillingAddressResponse(Model): + 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 AmazonPaymentResponse(Model): + email: str = None + agreement_id: str = None + + +@dataclass +class UpiResponse(Model): + vpa: str = None + + +@dataclass +class PaypalResponse(Model): + email: str = None + agreement_id: str = None + + +@dataclass +class VenmoResponse(Model): + user_name: str = None + + +@dataclass +class KlarnaPayNowResponse(Model): + email: str = None + + +@dataclass +class MandateResponse(Model): + id: str = None + subscription_id: str = None + created_at: int = None + + +@dataclass +class PaymentSourceResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + customer_id: str = None + type: str = None + reference_id: str = None + status: str = None + gateway: str = None + gateway_account_id: str = None + ip_address: str = None + issuing_country: str = None + card: CardResponse = None + bank_account: BankAccountResponse = None + boleto: CustVoucherSourceResponse = None + billing_address: BillingAddressResponse = None + amazon_payment: AmazonPaymentResponse = None + upi: UpiResponse = None + paypal: PaypalResponse = None + venmo: VenmoResponse = None + klarna_pay_now: KlarnaPayNowResponse = None + mandates: List[MandateResponse] = None + deleted: bool = None + business_entity_id: str = None + + +@dataclass +class CreateUsingTempTokenResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateUsingPermanentTokenResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateUsingTokenResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateUsingPaymentIntentResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateVoucherPaymentSourceResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateCardResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateBankAccountResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateCardResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateBankAccountResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class VerifyBankAccountResponse: + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListPaymentSourceResponse: + payment_source: PaymentSourceResponse + + +@dataclass +class ListResponse: + list: List[ListPaymentSourceResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class SwitchGatewayAccountResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ExportPaymentSourceResponse: + third_party_payment_method: ( + "third_party_payment_method.ThirdPartyPaymentMethodResponse" + ) + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteLocalResponse: + customer: "customer.CustomerResponse" + payment_source: PaymentSourceResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/payment_source/types.py b/chargebee/models/payment_source/types.py new file mode 100644 index 0000000..7f18754 --- /dev/null +++ b/chargebee/models/payment_source/types.py @@ -0,0 +1,262 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, payment_intent + + +class Status(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + INVALID = "invalid" + PENDING_VERIFICATION = "pending_verification" + + def __str__(self): + return self.value + + +class CardBrand(Enum): + VISA = "visa" + MASTERCARD = "mastercard" + AMERICAN_EXPRESS = "american_express" + DISCOVER = "discover" + JCB = "jcb" + DINERS_CLUB = "diners_club" + OTHER = "other" + BANCONTACT = "bancontact" + CMR_FALABELLA = "cmr_falabella" + TARJETA_NARANJA = "tarjeta_naranja" + NATIVA = "nativa" + CENCOSUD = "cencosud" + CABAL = "cabal" + ARGENCARD = "argencard" + ELO = "elo" + HIPERCARD = "hipercard" + CARNET = "carnet" + RUPAY = "rupay" + MAESTRO = "maestro" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class CardFundingType(Enum): + CREDIT = "credit" + DEBIT = "debit" + PREPAID = "prepaid" + NOT_KNOWN = "not_known" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + +class Card(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + iin: Required[str] + last4: Required[str] + brand: Required[CardBrand] + funding_type: Required[CardFundingType] + expiry_month: Required[int] + expiry_year: Required[int] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_country: NotRequired[str] + billing_zip: NotRequired[str] + masked_number: NotRequired[str] + + +class BankAccount(TypedDict): + last4: Required[str] + name_on_account: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + direct_debit_scheme: NotRequired[enums.DirectDebitScheme] + bank_name: NotRequired[str] + mandate_id: NotRequired[str] + account_type: NotRequired[enums.AccountType] + echeck_type: NotRequired[enums.EcheckType] + account_holder_type: NotRequired[enums.AccountHolderType] + email: NotRequired[str] + + +class CustVoucherSource(TypedDict): + last4: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + + +class BillingAddress(TypedDict): + 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 AmazonPayment(TypedDict): + email: NotRequired[str] + agreement_id: NotRequired[str] + + +class Upi(TypedDict): + vpa: NotRequired[str] + + +class Paypal(TypedDict): + email: NotRequired[str] + agreement_id: NotRequired[str] + + +class Venmo(TypedDict): + user_name: NotRequired[str] + + +class KlarnaPayNow(TypedDict): + email: NotRequired[str] + + +class Mandate(TypedDict): + id: Required[str] + subscription_id: Required[str] + created_at: Required[int] + + +class PaymentSources(TypedDict): + id: Required[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + customer_id: Required[str] + type: Required[enums.Type] + reference_id: Required[str] + status: Required[Status] + gateway: Required[enums.Gateway] + gateway_account_id: NotRequired[str] + ip_address: NotRequired[str] + issuing_country: NotRequired[str] + card: NotRequired[Card] + bank_account: NotRequired[BankAccount] + boleto: NotRequired[CustVoucherSource] + billing_address: NotRequired[BillingAddress] + amazon_payment: NotRequired[AmazonPayment] + upi: NotRequired[Upi] + paypal: NotRequired[Paypal] + venmo: NotRequired[Venmo] + klarna_pay_now: NotRequired[KlarnaPayNow] + mandates: NotRequired[List[Mandate]] + deleted: Required[bool] + business_entity_id: NotRequired[str] + + +class CreateUsingPermanentTokenCardParams(TypedDict): + last4: NotRequired[str] + iin: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + brand: NotRequired[CardBrand] + funding_type: NotRequired[CardFundingType] + + +class CreateUsingPermanentTokenBillingAddressParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + + +class CreateUsingPaymentIntentPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_info: NotRequired[Dict[Any, Any]] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateVoucherPaymentSourceVoucherPaymentSourceParams(TypedDict): + voucher_type: Required[enums.VoucherType] + gateway_account_id: NotRequired[str] + tax_id: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class CreateCardCardParams(TypedDict): + gateway_account_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: Required[str] + expiry_month: Required[int] + expiry_year: Required[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBankAccountBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class UpdateCardCardParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_zip: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateBankAccountBankAccountParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] diff --git a/chargebee/models/payment_voucher/__init__.py b/chargebee/models/payment_voucher/__init__.py new file mode 100644 index 0000000..de705ac --- /dev/null +++ b/chargebee/models/payment_voucher/__init__.py @@ -0,0 +1,3 @@ +from .operations import PaymentVoucher +from .responses import PaymentVoucherResponse +from .types import PaymentVouchers, LinkedInvoice, Status diff --git a/chargebee/models/payment_voucher/operations.py b/chargebee/models/payment_voucher/operations.py new file mode 100644 index 0000000..a6c835a --- /dev/null +++ b/chargebee/models/payment_voucher/operations.py @@ -0,0 +1,74 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class PaymentVoucher: + + class CreateParams(TypedDict): + customer_id: Required[str] + voucher_payment_source: Required[CreateVoucherPaymentSourceParams] + invoice_allocations: Required[List[CreateInvoiceAllocationParams]] + payment_source_id: NotRequired[str] + + class PaymentVouchersForInvoiceParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + status: NotRequired[Filters.EnumFilter] + sort_by: NotRequired[Filters.SortFilter] + + class PaymentVouchersForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + status: NotRequired[Filters.EnumFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("payment_vouchers"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("payment_vouchers", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def payment_vouchers_for_invoice( + id, params: PaymentVouchersForInvoiceParams = None, env=None, headers=None + ) -> PaymentVouchersForInvoiceResponse: + return request.send( + "get", + request.uri_path("invoices", id, "payment_vouchers"), + cast(Dict[Any, Any], params), + env, + headers, + PaymentVouchersForInvoiceResponse, + ) + + @staticmethod + def payment_vouchers_for_customer( + id, params: PaymentVouchersForCustomerParams = None, env=None, headers=None + ) -> PaymentVouchersForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "payment_vouchers"), + cast(Dict[Any, Any], params), + env, + headers, + PaymentVouchersForCustomerResponse, + ) diff --git a/chargebee/models/payment_voucher/responses.py b/chargebee/models/payment_voucher/responses.py new file mode 100644 index 0000000..2ce6712 --- /dev/null +++ b/chargebee/models/payment_voucher/responses.py @@ -0,0 +1,71 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LinkedInvoiceResponse(Model): + invoice_id: str = None + txn_id: str = None + applied_at: int = None + + +@dataclass +class PaymentVoucherResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + id_at_gateway: str = None + payment_voucher_type: str = None + expires_at: int = None + status: str = None + subscription_id: str = None + currency_code: str = None + amount: int = None + gateway_account_id: str = None + payment_source_id: str = None + gateway: str = None + payload: str = None + error_code: str = None + error_text: str = None + url: str = None + date: int = None + resource_version: int = None + updated_at: int = None + customer_id: str = None + linked_invoices: List[LinkedInvoiceResponse] = None + + +@dataclass +class CreateResponse: + payment_voucher: PaymentVoucherResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + payment_voucher: PaymentVoucherResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class PaymentVouchersForInvoicePaymentVoucherResponse: + payment_voucher: PaymentVoucherResponse + + +@dataclass +class PaymentVouchersForInvoiceResponse: + list: List[PaymentVouchersForInvoicePaymentVoucherResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PaymentVouchersForCustomerPaymentVoucherResponse: + payment_voucher: PaymentVoucherResponse + + +@dataclass +class PaymentVouchersForCustomerResponse: + list: List[PaymentVouchersForCustomerPaymentVoucherResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/payment_voucher/types.py b/chargebee/models/payment_voucher/types.py new file mode 100644 index 0000000..7284da2 --- /dev/null +++ b/chargebee/models/payment_voucher/types.py @@ -0,0 +1,50 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + ACTIVE = "active" + CONSUMED = "consumed" + EXPIRED = "expired" + FAILURE = "failure" + + def __str__(self): + return self.value + + +class LinkedInvoice(TypedDict): + invoice_id: Required[str] + txn_id: Required[str] + applied_at: Required[int] + + +class PaymentVouchers(TypedDict): + id: Required[str] + id_at_gateway: NotRequired[str] + payment_voucher_type: Required[enums.PaymentVoucherType] + expires_at: NotRequired[int] + status: NotRequired[Status] + subscription_id: NotRequired[str] + currency_code: Required[str] + amount: NotRequired[int] + gateway_account_id: NotRequired[str] + payment_source_id: NotRequired[str] + gateway: Required[enums.Gateway] + payload: NotRequired[str] + error_code: NotRequired[str] + error_text: NotRequired[str] + url: NotRequired[str] + date: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + customer_id: Required[str] + linked_invoices: NotRequired[List[LinkedInvoice]] + + +class CreateVoucherPaymentSourceParams(TypedDict): + voucher_type: Required[enums.VoucherType] + + +class CreateInvoiceAllocationParams(TypedDict): + invoice_id: Required[str] diff --git a/chargebee/models/plan/__init__.py b/chargebee/models/plan/__init__.py new file mode 100644 index 0000000..3b93a17 --- /dev/null +++ b/chargebee/models/plan/__init__.py @@ -0,0 +1,17 @@ +from .operations import Plan +from .responses import PlanResponse +from .types import ( + Plans, + Tier, + TaxProvidersField, + ApplicableAddon, + AttachedAddon, + EventBasedAddon, + PeriodUnit, + TrialPeriodUnit, + TrialEndAction, + ChargeModel, + Status, + AddonApplicability, + ShippingFrequencyPeriodUnit, +) diff --git a/chargebee/models/plan/operations.py b/chargebee/models/plan/operations.py new file mode 100644 index 0000000..b521696 --- /dev/null +++ b/chargebee/models/plan/operations.py @@ -0,0 +1,210 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Plan: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + trial_period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_end_action: NotRequired[TrialEndAction] + period: NotRequired[int] + period_unit: NotRequired[PeriodUnit] + setup_cost: NotRequired[int] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + tiers: NotRequired[List[CreateTierParams]] + currency_code: NotRequired[str] + billing_cycles: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + charge_model: NotRequired[ChargeModel] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + addon_applicability: NotRequired[AddonApplicability] + downgrade_penalty: NotRequired[float] + redirect_url: NotRequired[str] + enabled_in_hosted_pages: NotRequired[bool] + enabled_in_portal: NotRequired[bool] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] + applicable_addons: NotRequired[List[CreateApplicableAddonParams]] + event_based_addons: NotRequired[List[CreateEventBasedAddonParams]] + attached_addons: NotRequired[List[CreateAttachedAddonParams]] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + giftable: NotRequired[bool] + status: NotRequired[Status] + claim_url: NotRequired[str] + + class UpdateParams(TypedDict): + name: NotRequired[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + trial_period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_end_action: NotRequired[TrialEndAction] + period: NotRequired[int] + period_unit: NotRequired[PeriodUnit] + setup_cost: NotRequired[int] + price: NotRequired[int] + price_in_decimal: NotRequired[str] + tiers: NotRequired[List[UpdateTierParams]] + currency_code: NotRequired[str] + billing_cycles: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + charge_model: NotRequired[ChargeModel] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + addon_applicability: NotRequired[AddonApplicability] + downgrade_penalty: NotRequired[float] + redirect_url: NotRequired[str] + enabled_in_hosted_pages: NotRequired[bool] + enabled_in_portal: NotRequired[bool] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] + applicable_addons: NotRequired[List[UpdateApplicableAddonParams]] + event_based_addons: NotRequired[List[UpdateEventBasedAddonParams]] + attached_addons: NotRequired[List[UpdateAttachedAddonParams]] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + price: NotRequired[Filters.NumberFilter] + period: NotRequired[Filters.NumberFilter] + period_unit: NotRequired[Filters.EnumFilter] + trial_period: NotRequired[Filters.NumberFilter] + trial_period_unit: NotRequired[Filters.EnumFilter] + addon_applicability: NotRequired[Filters.EnumFilter] + giftable: NotRequired[Filters.BooleanFilter] + charge_model: NotRequired[Filters.EnumFilter] + pricing_model: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + currency_code: NotRequired[Filters.StringFilter] + channel: NotRequired[Filters.EnumFilter] + include_deleted: NotRequired[bool] + + class CopyParams(TypedDict): + from_site: Required[str] + id_at_from_site: Required[str] + id: NotRequired[str] + for_site_merging: NotRequired[bool] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("plans"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("plans", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("plans"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("plans", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("plans", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + return request.send( + "post", + request.uri_path("plans", "copy"), + cast(Dict[Any, Any], params), + env, + headers, + CopyResponse, + ) + + @staticmethod + def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + return request.send( + "post", + request.uri_path("plans", id, "unarchive"), + None, + env, + headers, + UnarchiveResponse, + ) diff --git a/chargebee/models/plan/responses.py b/chargebee/models/plan/responses.py new file mode 100644 index 0000000..9ccb45f --- /dev/null +++ b/chargebee/models/plan/responses.py @@ -0,0 +1,152 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TierResponse(Model): + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + + +@dataclass +class TaxProvidersFieldResponse(Model): + provider_name: str = None + field_id: str = None + field_value: str = None + + +@dataclass +class ApplicableAddonResponse(Model): + id: str = None + + +@dataclass +class AttachedAddonResponse(Model): + id: str = None + quantity: int = None + billing_cycles: int = None + type: str = None + quantity_in_decimal: str = None + + +@dataclass +class EventBasedAddonResponse(Model): + id: str = None + quantity: int = None + on_event: str = None + charge_once: bool = None + quantity_in_decimal: str = None + + +@dataclass +class PlanResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + invoice_name: str = None + description: str = None + price: int = None + currency_code: str = None + period: int = None + period_unit: str = None + trial_period: int = None + trial_period_unit: str = None + trial_end_action: str = None + pricing_model: str = None + charge_model: str = None + free_quantity: int = None + setup_cost: int = None + downgrade_penalty: float = None + status: str = None + archived_at: int = None + billing_cycles: int = None + redirect_url: str = None + enabled_in_hosted_pages: bool = None + enabled_in_portal: bool = None + addon_applicability: str = None + tax_code: str = None + hsn_code: str = None + taxjar_product_code: str = None + avalara_sale_type: str = None + avalara_transaction_type: int = None + avalara_service_type: int = None + sku: str = None + accounting_code: str = None + accounting_category1: str = None + accounting_category2: str = None + accounting_category3: str = None + accounting_category4: str = None + is_shippable: bool = None + shipping_frequency_period: int = None + shipping_frequency_period_unit: str = None + resource_version: int = None + updated_at: int = None + giftable: bool = None + claim_url: str = None + free_quantity_in_decimal: str = None + price_in_decimal: str = None + channel: str = None + invoice_notes: str = None + taxable: bool = None + tax_profile_id: str = None + meta_data: Dict[Any, Any] = None + tiers: List[TierResponse] = None + tax_providers_fields: List[TaxProvidersFieldResponse] = None + applicable_addons: List[ApplicableAddonResponse] = None + attached_addons: List[AttachedAddonResponse] = None + event_based_addons: List[EventBasedAddonResponse] = None + show_description_in_invoices: bool = None + show_description_in_quotes: bool = None + + +@dataclass +class CreateResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListPlanResponse: + plan: PlanResponse + + +@dataclass +class ListResponse: + list: List[ListPlanResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CopyResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UnarchiveResponse: + plan: PlanResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/plan/types.py b/chargebee/models/plan/types.py new file mode 100644 index 0000000..62137eb --- /dev/null +++ b/chargebee/models/plan/types.py @@ -0,0 +1,240 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class TrialPeriodUnit(Enum): + DAY = "day" + MONTH = "month" + + def __str__(self): + return self.value + + +class TrialEndAction(Enum): + SITE_DEFAULT = "site_default" + ACTIVATE_SUBSCRIPTION = "activate_subscription" + CANCEL_SUBSCRIPTION = "cancel_subscription" + + def __str__(self): + return self.value + + +class ChargeModel(Enum): + FLAT_FEE = "flat_fee" + PER_UNIT = "per_unit" + TIERED = "tiered" + VOLUME = "volume" + STAIRSTEP = "stairstep" + + def __str__(self): + return self.value + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class AddonApplicability(Enum): + ALL = "all" + RESTRICTED = "restricted" + + def __str__(self): + return self.value + + +class ShippingFrequencyPeriodUnit(Enum): + YEAR = "year" + MONTH = "month" + WEEK = "week" + DAY = "day" + + def __str__(self): + return self.value + + +class AttachedAddonType(Enum): + RECOMMENDED = "recommended" + MANDATORY = "mandatory" + + def __str__(self): + return self.value + + +class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class ApplicableAddon(TypedDict): + id: Required[str] + + +class AttachedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + billing_cycles: NotRequired[int] + type: Required[AttachedAddonType] + quantity_in_decimal: NotRequired[str] + + +class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + + +class Plans(TypedDict): + id: Required[str] + name: Required[str] + invoice_name: NotRequired[str] + description: NotRequired[str] + price: NotRequired[int] + currency_code: Required[str] + period: Required[int] + period_unit: Required[PeriodUnit] + trial_period: NotRequired[int] + trial_period_unit: NotRequired[TrialPeriodUnit] + trial_end_action: NotRequired[TrialEndAction] + pricing_model: Required[enums.PricingModel] + charge_model: Required[ChargeModel] + free_quantity: Required[int] + setup_cost: NotRequired[int] + downgrade_penalty: NotRequired[float] + status: Required[Status] + archived_at: NotRequired[int] + billing_cycles: NotRequired[int] + redirect_url: NotRequired[str] + enabled_in_hosted_pages: Required[bool] + enabled_in_portal: Required[bool] + addon_applicability: Required[AddonApplicability] + tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + is_shippable: NotRequired[bool] + shipping_frequency_period: NotRequired[int] + shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + giftable: Required[bool] + claim_url: NotRequired[str] + free_quantity_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + channel: NotRequired[enums.Channel] + invoice_notes: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + tiers: NotRequired[List[Tier]] + tax_providers_fields: NotRequired[List[TaxProvidersField]] + applicable_addons: NotRequired[List[ApplicableAddon]] + attached_addons: NotRequired[List[AttachedAddon]] + event_based_addons: NotRequired[List[EventBasedAddon]] + show_description_in_invoices: NotRequired[bool] + show_description_in_quotes: NotRequired[bool] + + +class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class CreateApplicableAddonParams(TypedDict): + id: NotRequired[str] + + +class CreateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + +class CreateAttachedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + type: NotRequired[AttachedAddonType] + + +class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + +class UpdateApplicableAddonParams(TypedDict): + id: NotRequired[str] + + +class UpdateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + +class UpdateAttachedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + type: NotRequired[AttachedAddonType] diff --git a/chargebee/models/portal_session/__init__.py b/chargebee/models/portal_session/__init__.py new file mode 100644 index 0000000..c289acf --- /dev/null +++ b/chargebee/models/portal_session/__init__.py @@ -0,0 +1,3 @@ +from .operations import PortalSession +from .responses import PortalSessionResponse +from .types import PortalSessions, LinkedCustomer, Status diff --git a/chargebee/models/portal_session/operations.py b/chargebee/models/portal_session/operations.py new file mode 100644 index 0000000..38a38d5 --- /dev/null +++ b/chargebee/models/portal_session/operations.py @@ -0,0 +1,61 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class PortalSession: + + class CreateParams(TypedDict): + customer: Required[CreateCustomerParams] + redirect_url: NotRequired[str] + forward_url: NotRequired[str] + + class ActivateParams(TypedDict): + token: Required[str] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("portal_sessions"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("portal_sessions", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def logout(id, env=None, headers=None) -> LogoutResponse: + return request.send( + "post", + request.uri_path("portal_sessions", id, "logout"), + None, + env, + headers, + LogoutResponse, + ) + + @staticmethod + def activate( + id, params: ActivateParams, env=None, headers=None + ) -> ActivateResponse: + return request.send( + "post", + request.uri_path("portal_sessions", id, "activate"), + cast(Dict[Any, Any], params), + env, + headers, + ActivateResponse, + ) diff --git a/chargebee/models/portal_session/responses.py b/chargebee/models/portal_session/responses.py new file mode 100644 index 0000000..640a8b6 --- /dev/null +++ b/chargebee/models/portal_session/responses.py @@ -0,0 +1,54 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LinkedCustomerResponse(Model): + customer_id: str = None + email: str = None + has_billing_address: bool = None + has_payment_method: bool = None + has_active_subscription: bool = None + + +@dataclass +class PortalSessionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + token: str = None + access_url: str = None + redirect_url: str = None + status: str = None + created_at: int = None + expires_at: int = None + customer_id: str = None + login_at: int = None + logout_at: int = None + login_ipaddress: str = None + logout_ipaddress: str = None + linked_customers: List[LinkedCustomerResponse] = None + + +@dataclass +class CreateResponse: + portal_session: PortalSessionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + portal_session: PortalSessionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class LogoutResponse: + portal_session: PortalSessionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ActivateResponse: + portal_session: PortalSessionResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/portal_session/types.py b/chargebee/models/portal_session/types.py new file mode 100644 index 0000000..0cc15e1 --- /dev/null +++ b/chargebee/models/portal_session/types.py @@ -0,0 +1,41 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + CREATED = "created" + LOGGED_IN = "logged_in" + LOGGED_OUT = "logged_out" + NOT_YET_ACTIVATED = "not_yet_activated" + ACTIVATED = "activated" + + def __str__(self): + return self.value + + +class LinkedCustomer(TypedDict): + customer_id: Required[str] + email: NotRequired[str] + has_billing_address: Required[bool] + has_payment_method: Required[bool] + has_active_subscription: Required[bool] + + +class PortalSessions(TypedDict): + id: Required[str] + token: Required[str] + access_url: Required[str] + redirect_url: NotRequired[str] + status: Required[Status] + created_at: Required[int] + expires_at: NotRequired[int] + customer_id: Required[str] + login_at: NotRequired[int] + logout_at: NotRequired[int] + login_ipaddress: NotRequired[str] + logout_ipaddress: NotRequired[str] + linked_customers: NotRequired[List[LinkedCustomer]] + + +class CreateCustomerParams(TypedDict): + id: Required[str] diff --git a/chargebee/models/price_variant/__init__.py b/chargebee/models/price_variant/__init__.py new file mode 100644 index 0000000..ba93dff --- /dev/null +++ b/chargebee/models/price_variant/__init__.py @@ -0,0 +1,3 @@ +from .operations import PriceVariant +from .responses import PriceVariantResponse +from .types import PriceVariants, Attribute, Status diff --git a/chargebee/models/price_variant/operations.py b/chargebee/models/price_variant/operations.py new file mode 100644 index 0000000..64a5897 --- /dev/null +++ b/chargebee/models/price_variant/operations.py @@ -0,0 +1,89 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class PriceVariant: + + class CreateParams(TypedDict): + id: Required[str] + name: Required[str] + external_name: NotRequired[str] + description: NotRequired[str] + variant_group: NotRequired[str] + attributes: Required[List[CreateAttributeParams]] + + class UpdateParams(TypedDict): + name: NotRequired[str] + external_name: NotRequired[str] + description: NotRequired[str] + variant_group: NotRequired[str] + status: NotRequired[Status] + attributes: Required[List[UpdateAttributeParams]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + created_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("price_variants"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("price_variants", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("price_variants", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("price_variants", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("price_variants"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/price_variant/responses.py b/chargebee/models/price_variant/responses.py new file mode 100644 index 0000000..944093e --- /dev/null +++ b/chargebee/models/price_variant/responses.py @@ -0,0 +1,61 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class AttributeResponse(Model): + name: str = None + value: str = None + + +@dataclass +class PriceVariantResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + external_name: str = None + variant_group: str = None + description: str = None + status: str = None + created_at: int = None + resource_version: int = None + updated_at: int = None + archived_at: int = None + attributes: List[AttributeResponse] = None + + +@dataclass +class CreateResponse: + price_variant: PriceVariantResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + price_variant: PriceVariantResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + price_variant: PriceVariantResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + price_variant: PriceVariantResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListPriceVariantResponse: + price_variant: PriceVariantResponse + + +@dataclass +class ListResponse: + list: List[ListPriceVariantResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/price_variant/types.py b/chargebee/models/price_variant/types.py new file mode 100644 index 0000000..68d5b43 --- /dev/null +++ b/chargebee/models/price_variant/types.py @@ -0,0 +1,40 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + +class Attribute(TypedDict): + name: Required[str] + value: Required[str] + + +class PriceVariants(TypedDict): + id: Required[str] + name: Required[str] + external_name: NotRequired[str] + variant_group: NotRequired[str] + description: NotRequired[str] + status: NotRequired[Status] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + archived_at: NotRequired[int] + attributes: NotRequired[List[Attribute]] + + +class CreateAttributeParams(TypedDict): + name: Required[str] + value: Required[str] + + +class UpdateAttributeParams(TypedDict): + name: Required[str] + value: Required[str] diff --git a/chargebee/models/pricing_page_session/__init__.py b/chargebee/models/pricing_page_session/__init__.py new file mode 100644 index 0000000..8e0c9d2 --- /dev/null +++ b/chargebee/models/pricing_page_session/__init__.py @@ -0,0 +1,3 @@ +from .operations import PricingPageSession +from .responses import PricingPageSessionResponse +from .types import PricingPageSessions diff --git a/chargebee/models/pricing_page_session/operations.py b/chargebee/models/pricing_page_session/operations.py new file mode 100644 index 0000000..542c768 --- /dev/null +++ b/chargebee/models/pricing_page_session/operations.py @@ -0,0 +1,49 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class PricingPageSession: + + class CreateForNewSubscriptionParams(TypedDict): + redirect_url: NotRequired[str] + pricing_page: Required[CreateForNewSubscriptionPricingPageParams] + subscription: NotRequired[CreateForNewSubscriptionSubscriptionParams] + business_entity_id: NotRequired[str] + customer: NotRequired[CreateForNewSubscriptionCustomerParams] + billing_address: NotRequired[CreateForNewSubscriptionBillingAddressParams] + shipping_address: NotRequired[CreateForNewSubscriptionShippingAddressParams] + + class CreateForExistingSubscriptionParams(TypedDict): + redirect_url: NotRequired[str] + pricing_page: Required[CreateForExistingSubscriptionPricingPageParams] + subscription: Required[CreateForExistingSubscriptionSubscriptionParams] + + @staticmethod + def create_for_new_subscription( + params: CreateForNewSubscriptionParams, env=None, headers=None + ) -> CreateForNewSubscriptionResponse: + return request.send( + "post", + request.uri_path("pricing_page_sessions", "create_for_new_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForNewSubscriptionResponse, + ) + + @staticmethod + def create_for_existing_subscription( + params: CreateForExistingSubscriptionParams, env=None, headers=None + ) -> CreateForExistingSubscriptionResponse: + return request.send( + "post", + request.uri_path( + "pricing_page_sessions", "create_for_existing_subscription" + ), + cast(Dict[Any, Any], params), + env, + headers, + CreateForExistingSubscriptionResponse, + ) diff --git a/chargebee/models/pricing_page_session/responses.py b/chargebee/models/pricing_page_session/responses.py new file mode 100644 index 0000000..762697e --- /dev/null +++ b/chargebee/models/pricing_page_session/responses.py @@ -0,0 +1,24 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class PricingPageSessionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + url: str = None + created_at: int = None + expires_at: int = None + + +@dataclass +class CreateForNewSubscriptionResponse: + pricing_page_session: PricingPageSessionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForExistingSubscriptionResponse: + pricing_page_session: PricingPageSessionResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/pricing_page_session/types.py b/chargebee/models/pricing_page_session/types.py new file mode 100644 index 0000000..a72cf5f --- /dev/null +++ b/chargebee/models/pricing_page_session/types.py @@ -0,0 +1,69 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums + + +class PricingPageSessions(TypedDict): + id: NotRequired[str] + url: NotRequired[str] + created_at: NotRequired[int] + expires_at: NotRequired[int] + + +class CreateForNewSubscriptionPricingPageParams(TypedDict): + id: Required[str] + + +class CreateForNewSubscriptionSubscriptionParams(TypedDict): + id: NotRequired[str] + + +class CreateForNewSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + + +class CreateForNewSubscriptionBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForNewSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForExistingSubscriptionPricingPageParams(TypedDict): + id: Required[str] + + +class CreateForExistingSubscriptionSubscriptionParams(TypedDict): + id: Required[str] diff --git a/chargebee/models/promotional_credit/__init__.py b/chargebee/models/promotional_credit/__init__.py new file mode 100644 index 0000000..28914df --- /dev/null +++ b/chargebee/models/promotional_credit/__init__.py @@ -0,0 +1,3 @@ +from .operations import PromotionalCredit +from .responses import PromotionalCreditResponse +from .types import PromotionalCredits, Type diff --git a/chargebee/models/promotional_credit/operations.py b/chargebee/models/promotional_credit/operations.py new file mode 100644 index 0000000..a731be5 --- /dev/null +++ b/chargebee/models/promotional_credit/operations.py @@ -0,0 +1,98 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class PromotionalCredit: + + class AddParams(TypedDict): + customer_id: Required[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class DeductParams(TypedDict): + customer_id: Required[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class SetParams(TypedDict): + customer_id: Required[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + currency_code: NotRequired[str] + description: Required[str] + credit_type: NotRequired[enums.CreditType] + reference: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + created_at: NotRequired[Filters.TimestampFilter] + type: NotRequired[Filters.EnumFilter] + customer_id: NotRequired[Filters.StringFilter] + + @staticmethod + def add(params: AddParams, env=None, headers=None) -> AddResponse: + return request.send( + "post", + request.uri_path("promotional_credits", "add"), + cast(Dict[Any, Any], params), + env, + headers, + AddResponse, + ) + + @staticmethod + def deduct(params: DeductParams, env=None, headers=None) -> DeductResponse: + return request.send( + "post", + request.uri_path("promotional_credits", "deduct"), + cast(Dict[Any, Any], params), + env, + headers, + DeductResponse, + ) + + @staticmethod + def set(params: SetParams, env=None, headers=None) -> SetResponse: + return request.send( + "post", + request.uri_path("promotional_credits", "set"), + cast(Dict[Any, Any], params), + env, + headers, + SetResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("promotional_credits"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("promotional_credits", id), + None, + env, + headers, + RetrieveResponse, + ) diff --git a/chargebee/models/promotional_credit/responses.py b/chargebee/models/promotional_credit/responses.py new file mode 100644 index 0000000..cad8791 --- /dev/null +++ b/chargebee/models/promotional_credit/responses.py @@ -0,0 +1,60 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import customer + + +@dataclass +class PromotionalCreditResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + type: str = None + amount_in_decimal: str = None + amount: int = None + currency_code: str = None + description: str = None + credit_type: str = None + reference: str = None + closing_balance: int = None + done_by: str = None + created_at: int = None + + +@dataclass +class AddResponse: + customer: "customer.CustomerResponse" + promotional_credit: PromotionalCreditResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeductResponse: + customer: "customer.CustomerResponse" + promotional_credit: PromotionalCreditResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class SetResponse: + customer: "customer.CustomerResponse" + promotional_credit: PromotionalCreditResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListPromotionalCreditResponse: + promotional_credit: PromotionalCreditResponse + + +@dataclass +class ListResponse: + list: List[ListPromotionalCreditResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + promotional_credit: PromotionalCreditResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/promotional_credit/types.py b/chargebee/models/promotional_credit/types.py new file mode 100644 index 0000000..fe293f0 --- /dev/null +++ b/chargebee/models/promotional_credit/types.py @@ -0,0 +1,26 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Type(Enum): + INCREMENT = "increment" + DECREMENT = "decrement" + + def __str__(self): + return self.value + + +class PromotionalCredits(TypedDict): + id: Required[str] + customer_id: Required[str] + type: Required[Type] + amount_in_decimal: NotRequired[str] + amount: Required[int] + currency_code: Required[str] + description: Required[str] + credit_type: Required[enums.CreditType] + reference: NotRequired[str] + closing_balance: Required[int] + done_by: NotRequired[str] + created_at: Required[int] diff --git a/chargebee/models/purchase/__init__.py b/chargebee/models/purchase/__init__.py new file mode 100644 index 0000000..fc1f2b4 --- /dev/null +++ b/chargebee/models/purchase/__init__.py @@ -0,0 +1,3 @@ +from .operations import Purchase +from .responses import PurchaseResponse +from .types import Purchases diff --git a/chargebee/models/purchase/operations.py b/chargebee/models/purchase/operations.py new file mode 100644 index 0000000..859037f --- /dev/null +++ b/chargebee/models/purchase/operations.py @@ -0,0 +1,54 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Purchase: + + class CreateParams(TypedDict): + purchase_items: Required[List[CreatePurchaseItemParams]] + item_tiers: Required[List[CreateItemTierParams]] + shipping_addresses: NotRequired[List[CreateShippingAddressParams]] + discounts: NotRequired[List[CreateDiscountParams]] + subscription_info: Required[List[CreateSubscriptionInfoParams]] + contract_terms: Required[List[CreateContractTermParams]] + invoice_info: NotRequired[CreateInvoiceInfoParams] + statement_descriptor: NotRequired[CreateStatementDescriptorParams] + installment_info: NotRequired[CreateInstallmentInfoParams] + customer_id: Required[str] + payment_source_id: NotRequired[str] + + class EstimateParams(TypedDict): + purchase_items: Required[List[EstimatePurchaseItemParams]] + item_tiers: Required[List[EstimateItemTierParams]] + shipping_addresses: NotRequired[List[EstimateShippingAddressParams]] + discounts: NotRequired[List[EstimateDiscountParams]] + subscription_info: Required[List[EstimateSubscriptionInfoParams]] + contract_terms: Required[List[EstimateContractTermParams]] + customer: NotRequired[EstimateCustomerParams] + billing_address: NotRequired[EstimateBillingAddressParams] + client_profile_id: NotRequired[str] + customer_id: NotRequired[str] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("purchases"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def estimate(params: EstimateParams, env=None, headers=None) -> EstimateResponse: + return request.send( + "post", + request.uri_path("purchases", "estimate"), + cast(Dict[Any, Any], params), + env, + headers, + EstimateResponse, + ) diff --git a/chargebee/models/purchase/responses.py b/chargebee/models/purchase/responses.py new file mode 100644 index 0000000..feba67d --- /dev/null +++ b/chargebee/models/purchase/responses.py @@ -0,0 +1,27 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import contract_term, estimate + + +@dataclass +class PurchaseResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + created_at: int = None + modified_at: int = None + subscription_ids: List[str] = None + invoice_ids: List[str] = None + + +@dataclass +class CreateResponse: + purchase: PurchaseResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class EstimateResponse: + estimate: "estimate.EstimateResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/purchase/types.py b/chargebee/models/purchase/types.py new file mode 100644 index 0000000..24768e5 --- /dev/null +++ b/chargebee/models/purchase/types.py @@ -0,0 +1,164 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums, contract_term + + +class Purchases(TypedDict): + id: NotRequired[str] + customer_id: Required[str] + created_at: NotRequired[int] + modified_at: NotRequired[int] + subscription_ids: NotRequired[List[str]] + invoice_ids: NotRequired[List[str]] + + +class CreatePurchaseItemParams(TypedDict): + index: Required[int] + item_price_id: Required[str] + quantity: NotRequired[int] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + + +class CreateItemTierParams(TypedDict): + index: Required[int] + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateShippingAddressParams(TypedDict): + 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: NotRequired[str] + state_code: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateDiscountParams(TypedDict): + index: NotRequired[int] + coupon_id: NotRequired[str] + percentage: NotRequired[float] + amount: NotRequired[int] + included_in_mrr: NotRequired[bool] + + +class CreateSubscriptionInfoParams(TypedDict): + index: Required[int] + subscription_id: NotRequired[str] + billing_cycles: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] + + +class CreateContractTermParams(TypedDict): + index: Required[int] + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CreateInvoiceInfoParams(TypedDict): + po_number: NotRequired[str] + notes: NotRequired[str] + + +class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateInstallmentInfoParams(TypedDict): + config_id: NotRequired[str] + amount: NotRequired[int] + + +class EstimatePurchaseItemParams(TypedDict): + index: Required[int] + item_price_id: Required[str] + quantity: NotRequired[int] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + + +class EstimateItemTierParams(TypedDict): + index: Required[int] + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class EstimateShippingAddressParams(TypedDict): + 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: NotRequired[str] + state_code: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EstimateDiscountParams(TypedDict): + index: NotRequired[int] + coupon_id: NotRequired[str] + percentage: NotRequired[float] + amount: NotRequired[int] + included_in_mrr: NotRequired[bool] + + +class EstimateSubscriptionInfoParams(TypedDict): + index: Required[int] + subscription_id: NotRequired[str] + billing_cycles: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class EstimateContractTermParams(TypedDict): + index: Required[int] + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class EstimateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + +class EstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] diff --git a/chargebee/models/quote/__init__.py b/chargebee/models/quote/__init__.py new file mode 100644 index 0000000..67aa029 --- /dev/null +++ b/chargebee/models/quote/__init__.py @@ -0,0 +1,15 @@ +from .operations import Quote +from .responses import QuoteResponse +from .types import ( + Quotes, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + LineItemTier, + ShippingAddress, + BillingAddress, + Status, + OperationType, +) diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py new file mode 100644 index 0000000..c5b013d --- /dev/null +++ b/chargebee/models/quote/operations.py @@ -0,0 +1,545 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Quote: + + class CreateSubForCustomerQuoteParams(TypedDict): + name: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: Required[CreateSubForCustomerQuoteSubscriptionParams] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CreateSubForCustomerQuoteAddonParams]] + event_based_addons: NotRequired[ + List[CreateSubForCustomerQuoteEventBasedAddonParams] + ] + mandatory_addons_to_remove: NotRequired[List[str]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[CreateSubForCustomerQuoteShippingAddressParams] + contract_term: NotRequired[CreateSubForCustomerQuoteContractTermParams] + coupon_ids: NotRequired[List[str]] + + class EditCreateSubForCustomerQuoteParams(TypedDict): + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: Required[EditCreateSubForCustomerQuoteSubscriptionParams] + billing_cycles: NotRequired[int] + addons: NotRequired[List[EditCreateSubForCustomerQuoteAddonParams]] + event_based_addons: NotRequired[ + List[EditCreateSubForCustomerQuoteEventBasedAddonParams] + ] + mandatory_addons_to_remove: NotRequired[List[str]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[ + EditCreateSubForCustomerQuoteShippingAddressParams + ] + contract_term: NotRequired[EditCreateSubForCustomerQuoteContractTermParams] + coupon_ids: NotRequired[List[str]] + + class UpdateSubscriptionQuoteParams(TypedDict): + name: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: Required[UpdateSubscriptionQuoteSubscriptionParams] + addons: NotRequired[List[UpdateSubscriptionQuoteAddonParams]] + event_based_addons: NotRequired[ + List[UpdateSubscriptionQuoteEventBasedAddonParams] + ] + replace_addon_list: NotRequired[bool] + mandatory_addons_to_remove: NotRequired[List[str]] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + change_option: NotRequired[enums.ChangeOption] + changes_scheduled_at: NotRequired[int] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + billing_address: NotRequired[UpdateSubscriptionQuoteBillingAddressParams] + shipping_address: NotRequired[UpdateSubscriptionQuoteShippingAddressParams] + customer: NotRequired[UpdateSubscriptionQuoteCustomerParams] + contract_term: NotRequired[UpdateSubscriptionQuoteContractTermParams] + + class EditUpdateSubscriptionQuoteParams(TypedDict): + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: NotRequired[EditUpdateSubscriptionQuoteSubscriptionParams] + addons: NotRequired[List[EditUpdateSubscriptionQuoteAddonParams]] + event_based_addons: NotRequired[ + List[EditUpdateSubscriptionQuoteEventBasedAddonParams] + ] + replace_addon_list: NotRequired[bool] + mandatory_addons_to_remove: NotRequired[List[str]] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + change_option: NotRequired[enums.ChangeOption] + changes_scheduled_at: NotRequired[int] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + billing_address: NotRequired[EditUpdateSubscriptionQuoteBillingAddressParams] + shipping_address: NotRequired[EditUpdateSubscriptionQuoteShippingAddressParams] + customer: NotRequired[EditUpdateSubscriptionQuoteCustomerParams] + contract_term: NotRequired[EditUpdateSubscriptionQuoteContractTermParams] + + class CreateForOnetimeChargesParams(TypedDict): + name: NotRequired[str] + customer_id: Required[str] + po_number: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + currency_code: NotRequired[str] + addons: NotRequired[List[CreateForOnetimeChargesAddonParams]] + charges: NotRequired[List[CreateForOnetimeChargesChargeParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + shipping_address: NotRequired[CreateForOnetimeChargesShippingAddressParams] + tax_providers_fields: NotRequired[ + List[CreateForOnetimeChargesTaxProvidersFieldParams] + ] + + class EditOneTimeQuoteParams(TypedDict): + po_number: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + currency_code: NotRequired[str] + addons: NotRequired[List[EditOneTimeQuoteAddonParams]] + charges: NotRequired[List[EditOneTimeQuoteChargeParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + shipping_address: NotRequired[EditOneTimeQuoteShippingAddressParams] + tax_providers_fields: NotRequired[List[EditOneTimeQuoteTaxProvidersFieldParams]] + + class CreateSubItemsForCustomerQuoteParams(TypedDict): + name: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: NotRequired[CreateSubItemsForCustomerQuoteSubscriptionParams] + billing_cycles: NotRequired[int] + subscription_items: Required[ + List[CreateSubItemsForCustomerQuoteSubscriptionItemParams] + ] + discounts: Required[List[CreateSubItemsForCustomerQuoteDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[CreateSubItemsForCustomerQuoteItemTierParams]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[ + CreateSubItemsForCustomerQuoteShippingAddressParams + ] + contract_term: NotRequired[CreateSubItemsForCustomerQuoteContractTermParams] + coupon_ids: NotRequired[List[str]] + + class EditCreateSubCustomerQuoteForItemsParams(TypedDict): + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: NotRequired[EditCreateSubCustomerQuoteForItemsSubscriptionParams] + billing_cycles: NotRequired[int] + subscription_items: Required[ + List[EditCreateSubCustomerQuoteForItemsSubscriptionItemParams] + ] + discounts: Required[List[EditCreateSubCustomerQuoteForItemsDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[EditCreateSubCustomerQuoteForItemsItemTierParams]] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + shipping_address: NotRequired[ + EditCreateSubCustomerQuoteForItemsShippingAddressParams + ] + contract_term: NotRequired[EditCreateSubCustomerQuoteForItemsContractTermParams] + coupon_ids: NotRequired[List[str]] + + class UpdateSubscriptionQuoteForItemsParams(TypedDict): + name: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription: Required[UpdateSubscriptionQuoteForItemsSubscriptionParams] + subscription_items: Required[ + List[UpdateSubscriptionQuoteForItemsSubscriptionItemParams] + ] + mandatory_items_to_remove: NotRequired[List[str]] + replace_items_list: NotRequired[bool] + discounts: Required[List[UpdateSubscriptionQuoteForItemsDiscountParams]] + item_tiers: NotRequired[List[UpdateSubscriptionQuoteForItemsItemTierParams]] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + change_option: NotRequired[enums.ChangeOption] + changes_scheduled_at: NotRequired[int] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + billing_address: NotRequired[ + UpdateSubscriptionQuoteForItemsBillingAddressParams + ] + shipping_address: NotRequired[ + UpdateSubscriptionQuoteForItemsShippingAddressParams + ] + customer: NotRequired[UpdateSubscriptionQuoteForItemsCustomerParams] + contract_term: NotRequired[UpdateSubscriptionQuoteForItemsContractTermParams] + + class EditUpdateSubscriptionQuoteForItemsParams(TypedDict): + notes: NotRequired[str] + expires_at: NotRequired[int] + subscription_items: Required[ + List[EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams] + ] + mandatory_items_to_remove: NotRequired[List[str]] + replace_items_list: NotRequired[bool] + subscription: NotRequired[EditUpdateSubscriptionQuoteForItemsSubscriptionParams] + discounts: Required[List[EditUpdateSubscriptionQuoteForItemsDiscountParams]] + item_tiers: NotRequired[List[EditUpdateSubscriptionQuoteForItemsItemTierParams]] + billing_cycles: NotRequired[int] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + change_option: NotRequired[enums.ChangeOption] + changes_scheduled_at: NotRequired[int] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + billing_address: NotRequired[ + EditUpdateSubscriptionQuoteForItemsBillingAddressParams + ] + shipping_address: NotRequired[ + EditUpdateSubscriptionQuoteForItemsShippingAddressParams + ] + customer: NotRequired[EditUpdateSubscriptionQuoteForItemsCustomerParams] + contract_term: NotRequired[ + EditUpdateSubscriptionQuoteForItemsContractTermParams + ] + + class CreateForChargeItemsAndChargesParams(TypedDict): + name: NotRequired[str] + customer_id: Required[str] + po_number: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + currency_code: NotRequired[str] + item_prices: NotRequired[List[CreateForChargeItemsAndChargesItemPriceParams]] + item_tiers: NotRequired[List[CreateForChargeItemsAndChargesItemTierParams]] + charges: NotRequired[List[CreateForChargeItemsAndChargesChargeParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + shipping_address: NotRequired[ + CreateForChargeItemsAndChargesShippingAddressParams + ] + discounts: Required[List[CreateForChargeItemsAndChargesDiscountParams]] + tax_providers_fields: NotRequired[ + List[CreateForChargeItemsAndChargesTaxProvidersFieldParams] + ] + + class EditForChargeItemsAndChargesParams(TypedDict): + po_number: NotRequired[str] + notes: NotRequired[str] + expires_at: NotRequired[int] + currency_code: NotRequired[str] + item_prices: NotRequired[List[EditForChargeItemsAndChargesItemPriceParams]] + item_tiers: NotRequired[List[EditForChargeItemsAndChargesItemTierParams]] + charges: NotRequired[List[EditForChargeItemsAndChargesChargeParams]] + coupon: NotRequired[str] + coupon_ids: NotRequired[List[str]] + shipping_address: NotRequired[EditForChargeItemsAndChargesShippingAddressParams] + discounts: Required[List[EditForChargeItemsAndChargesDiscountParams]] + tax_providers_fields: NotRequired[ + List[EditForChargeItemsAndChargesTaxProvidersFieldParams] + ] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + class QuoteLineGroupsForQuoteParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class ConvertParams(TypedDict): + subscription: NotRequired[ConvertSubscriptionParams] + invoice_date: NotRequired[int] + create_pending_invoices: NotRequired[bool] + first_invoice_pending: NotRequired[bool] + + class UpdateStatusParams(TypedDict): + status: Required[Status] + comment: NotRequired[str] + + class ExtendExpiryDateParams(TypedDict): + valid_till: Required[int] + + class DeleteParams(TypedDict): + comment: NotRequired[str] + + class PdfParams(TypedDict): + consolidated_view: NotRequired[bool] + disposition_type: NotRequired[enums.DispositionType] + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("quotes", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def create_sub_for_customer_quote( + id, params: CreateSubForCustomerQuoteParams, env=None, headers=None + ) -> CreateSubForCustomerQuoteResponse: + return request.send( + "post", + request.uri_path("customers", id, "create_subscription_quote"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubForCustomerQuoteResponse, + ) + + @staticmethod + def edit_create_sub_for_customer_quote( + id, params: EditCreateSubForCustomerQuoteParams, env=None, headers=None + ) -> EditCreateSubForCustomerQuoteResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_create_subscription_quote"), + cast(Dict[Any, Any], params), + env, + headers, + EditCreateSubForCustomerQuoteResponse, + ) + + @staticmethod + def update_subscription_quote( + params: UpdateSubscriptionQuoteParams, env=None, headers=None + ) -> UpdateSubscriptionQuoteResponse: + return request.send( + "post", + request.uri_path("quotes", "update_subscription_quote"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateSubscriptionQuoteResponse, + ) + + @staticmethod + def edit_update_subscription_quote( + id, params: EditUpdateSubscriptionQuoteParams = None, env=None, headers=None + ) -> EditUpdateSubscriptionQuoteResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_update_subscription_quote"), + cast(Dict[Any, Any], params), + env, + headers, + EditUpdateSubscriptionQuoteResponse, + ) + + @staticmethod + def create_for_onetime_charges( + params: CreateForOnetimeChargesParams, env=None, headers=None + ) -> CreateForOnetimeChargesResponse: + return request.send( + "post", + request.uri_path("quotes", "create_for_onetime_charges"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForOnetimeChargesResponse, + ) + + @staticmethod + def edit_one_time_quote( + id, params: EditOneTimeQuoteParams = None, env=None, headers=None + ) -> EditOneTimeQuoteResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_one_time_quote"), + cast(Dict[Any, Any], params), + env, + headers, + EditOneTimeQuoteResponse, + ) + + @staticmethod + def create_sub_items_for_customer_quote( + id, params: CreateSubItemsForCustomerQuoteParams, env=None, headers=None + ) -> CreateSubItemsForCustomerQuoteResponse: + return request.send( + "post", + request.uri_path("customers", id, "create_subscription_quote_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateSubItemsForCustomerQuoteResponse, + ) + + @staticmethod + def edit_create_sub_customer_quote_for_items( + id, params: EditCreateSubCustomerQuoteForItemsParams, env=None, headers=None + ) -> EditCreateSubCustomerQuoteForItemsResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_create_subscription_quote_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + EditCreateSubCustomerQuoteForItemsResponse, + ) + + @staticmethod + def update_subscription_quote_for_items( + params: UpdateSubscriptionQuoteForItemsParams, env=None, headers=None + ) -> UpdateSubscriptionQuoteForItemsResponse: + return request.send( + "post", + request.uri_path("quotes", "update_subscription_quote_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateSubscriptionQuoteForItemsResponse, + ) + + @staticmethod + def edit_update_subscription_quote_for_items( + id, params: EditUpdateSubscriptionQuoteForItemsParams, env=None, headers=None + ) -> EditUpdateSubscriptionQuoteForItemsResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_update_subscription_quote_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + EditUpdateSubscriptionQuoteForItemsResponse, + ) + + @staticmethod + def create_for_charge_items_and_charges( + params: CreateForChargeItemsAndChargesParams, env=None, headers=None + ) -> CreateForChargeItemsAndChargesResponse: + return request.send( + "post", + request.uri_path("quotes", "create_for_charge_items_and_charges"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForChargeItemsAndChargesResponse, + ) + + @staticmethod + def edit_for_charge_items_and_charges( + id, params: EditForChargeItemsAndChargesParams, env=None, headers=None + ) -> EditForChargeItemsAndChargesResponse: + return request.send( + "post", + request.uri_path("quotes", id, "edit_for_charge_items_and_charges"), + cast(Dict[Any, Any], params), + env, + headers, + EditForChargeItemsAndChargesResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("quotes"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def quote_line_groups_for_quote( + id, params: QuoteLineGroupsForQuoteParams = None, env=None, headers=None + ) -> QuoteLineGroupsForQuoteResponse: + return request.send( + "get", + request.uri_path("quotes", id, "quote_line_groups"), + cast(Dict[Any, Any], params), + env, + headers, + QuoteLineGroupsForQuoteResponse, + ) + + @staticmethod + def convert( + id, params: ConvertParams = None, env=None, headers=None + ) -> ConvertResponse: + return request.send( + "post", + request.uri_path("quotes", id, "convert"), + cast(Dict[Any, Any], params), + env, + headers, + ConvertResponse, + ) + + @staticmethod + def update_status( + id, params: UpdateStatusParams, env=None, headers=None + ) -> UpdateStatusResponse: + return request.send( + "post", + request.uri_path("quotes", id, "update_status"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateStatusResponse, + ) + + @staticmethod + def extend_expiry_date( + id, params: ExtendExpiryDateParams, env=None, headers=None + ) -> ExtendExpiryDateResponse: + return request.send( + "post", + request.uri_path("quotes", id, "extend_expiry_date"), + cast(Dict[Any, Any], params), + env, + headers, + ExtendExpiryDateResponse, + ) + + @staticmethod + def delete( + id, params: DeleteParams = None, env=None, headers=None + ) -> DeleteResponse: + return request.send( + "post", + request.uri_path("quotes", id, "delete"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + return request.send( + "post", + request.uri_path("quotes", id, "pdf"), + cast(Dict[Any, Any], params), + env, + headers, + PdfResponse, + ) diff --git a/chargebee/models/quote/responses.py b/chargebee/models/quote/responses.py new file mode 100644 index 0000000..b538f0a --- /dev/null +++ b/chargebee/models/quote/responses.py @@ -0,0 +1,340 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + contract_term, + quoted_subscription, + quoted_charge, + quote_line_group, + download, + customer, + subscription, + invoice, + credit_note, + unbilled_charge, +) + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class LineItemTierResponse(Model): + 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 + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class BillingAddressResponse(Model): + 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 QuoteResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + name: str = None + po_number: str = None + customer_id: str = None + subscription_id: str = None + invoice_id: str = None + status: str = None + operation_type: str = None + vat_number: str = None + price_type: str = None + valid_till: int = None + date: int = None + total_payable: int = None + charge_on_acceptance: int = None + sub_total: int = None + total: int = None + credits_applied: int = None + amount_paid: int = None + amount_due: int = None + version: int = None + resource_version: int = None + updated_at: int = None + vat_number_prefix: str = 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 + line_item_tiers: List[LineItemTierResponse] = None + tax_category: str = None + currency_code: str = None + notes: List[Dict[Any, Any]] = None + shipping_address: ShippingAddressResponse = None + billing_address: BillingAddressResponse = None + contract_term_start: int = None + contract_term_end: int = None + contract_term_termination_fee: int = None + business_entity_id: str = None + + +@dataclass +class RetrieveResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateSubForCustomerQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditCreateSubForCustomerQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateSubscriptionQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditUpdateSubscriptionQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForOnetimeChargesResponse: + quote: QuoteResponse + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditOneTimeQuoteResponse: + quote: QuoteResponse + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateSubItemsForCustomerQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditCreateSubCustomerQuoteForItemsResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateSubscriptionQuoteForItemsResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditUpdateSubscriptionQuoteForItemsResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForChargeItemsAndChargesResponse: + quote: QuoteResponse + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditForChargeItemsAndChargesResponse: + quote: QuoteResponse + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListQuoteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + + +@dataclass +class ListResponse: + list: List[ListQuoteResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class QuoteLineGroupsForQuoteQuoteResponse: + quote_line_group: "quote_line_group.QuoteLineGroupResponse" + + +@dataclass +class QuoteLineGroupsForQuoteResponse: + list: List[QuoteLineGroupsForQuoteQuoteResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ConvertResponse: + quote: QuoteResponse + customer: "customer.CustomerResponse" + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + subscription: "subscription.SubscriptionResponse" = None + invoice: "invoice.InvoiceResponse" = None + credit_note: "credit_note.CreditNoteResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateStatusResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ExtendExpiryDateResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + quote: QuoteResponse + quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None + quoted_charge: "quoted_charge.QuotedChargeResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PdfResponse: + download: "download.DownloadResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/quote/types.py b/chargebee/models/quote/types.py new file mode 100644 index 0000000..d39a828 --- /dev/null +++ b/chargebee/models/quote/types.py @@ -0,0 +1,1028 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, contract_term + + +class Status(Enum): + OPEN = "open" + ACCEPTED = "accepted" + DECLINED = "declined" + INVOICED = "invoiced" + CLOSED = "closed" + + def __str__(self): + return self.value + + +class OperationType(Enum): + CREATE_SUBSCRIPTION_FOR_CUSTOMER = "create_subscription_for_customer" + CHANGE_SUBSCRIPTION = "change_subscription" + ONETIME_INVOICE = "onetime_invoice" + + def __str__(self): + return self.value + + +class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[LineItemDiscountDiscountType] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + +class ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class BillingAddress(TypedDict): + 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 Quotes(TypedDict): + id: Required[str] + name: NotRequired[str] + po_number: NotRequired[str] + customer_id: Required[str] + subscription_id: NotRequired[str] + invoice_id: NotRequired[str] + status: Required[Status] + operation_type: Required[OperationType] + vat_number: NotRequired[str] + price_type: Required[enums.PriceType] + valid_till: Required[int] + date: Required[int] + total_payable: NotRequired[int] + charge_on_acceptance: NotRequired[int] + sub_total: Required[int] + total: NotRequired[int] + credits_applied: NotRequired[int] + amount_paid: NotRequired[int] + amount_due: NotRequired[int] + version: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + vat_number_prefix: NotRequired[str] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] + line_item_tiers: NotRequired[List[LineItemTier]] + tax_category: NotRequired[str] + currency_code: Required[str] + notes: NotRequired[List[Dict[Any, Any]]] + shipping_address: NotRequired[ShippingAddress] + billing_address: NotRequired[BillingAddress] + contract_term_start: NotRequired[int] + contract_term_end: NotRequired[int] + contract_term_termination_fee: NotRequired[int] + business_entity_id: NotRequired[str] + + +class CreateSubForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CreateSubForCustomerQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class CreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CreateSubForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class EditCreateSubForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class EditCreateSubForCustomerQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class EditCreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class EditCreateSubForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditCreateSubForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class UpdateSubscriptionQuoteSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class UpdateSubscriptionQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + + +class UpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class UpdateSubscriptionQuoteBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionQuoteCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + +class UpdateSubscriptionQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class EditUpdateSubscriptionQuoteSubscriptionParams(TypedDict): + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class EditUpdateSubscriptionQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + + +class EditUpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class EditUpdateSubscriptionQuoteBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditUpdateSubscriptionQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditUpdateSubscriptionQuoteCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + +class EditUpdateSubscriptionQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CreateForOnetimeChargesAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period: NotRequired[int] + + +class CreateForOnetimeChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + +class CreateForOnetimeChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForOnetimeChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class EditOneTimeQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period: NotRequired[int] + + +class EditOneTimeQuoteChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + +class EditOneTimeQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditOneTimeQuoteTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateSubItemsForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class CreateSubItemsForCustomerQuoteSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class CreateSubItemsForCustomerQuoteDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class CreateSubItemsForCustomerQuoteItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateSubItemsForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateSubItemsForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class EditCreateSubCustomerQuoteForItemsSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class EditCreateSubCustomerQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class EditCreateSubCustomerQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class EditCreateSubCustomerQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditCreateSubCustomerQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class UpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class UpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + +class UpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + +class UpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + +class UpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + +class EditUpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + +class EditUpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + +class EditUpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class EditUpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditUpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditUpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + +class EditUpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + +class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + +class CreateForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + +class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + +class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class EditForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + +class EditForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class EditForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + +class EditForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class EditForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + +class EditForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class ConvertSubscriptionParams(TypedDict): + id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + po_number: NotRequired[str] + auto_close_invoices: NotRequired[bool] diff --git a/chargebee/models/quote_line_group/__init__.py b/chargebee/models/quote_line_group/__init__.py new file mode 100644 index 0000000..67c365c --- /dev/null +++ b/chargebee/models/quote_line_group/__init__.py @@ -0,0 +1,11 @@ +from .operations import QuoteLineGroup +from .responses import QuoteLineGroupResponse +from .types import ( + QuoteLineGroups, + LineItem, + Discount, + LineItemDiscount, + Tax, + LineItemTax, + ChargeEvent, +) diff --git a/chargebee/models/quote_line_group/operations.py b/chargebee/models/quote_line_group/operations.py new file mode 100644 index 0000000..ec7f72b --- /dev/null +++ b/chargebee/models/quote_line_group/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class QuoteLineGroup: + + pass diff --git a/chargebee/models/quote_line_group/responses.py b/chargebee/models/quote_line_group/responses.py new file mode 100644 index 0000000..550812b --- /dev/null +++ b/chargebee/models/quote_line_group/responses.py @@ -0,0 +1,94 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class LineItemResponse(Model): + id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + quantity: int = None + amount: int = None + pricing_model: str = None + is_taxed: bool = None + tax_amount: int = None + tax_rate: float = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + discount_amount: int = None + item_level_discount_amount: int = None + usage_percentage: str = None + reference_line_item_id: str = None + description: str = None + entity_description: str = None + entity_type: str = None + tax_exempt_reason: str = None + entity_id: str = None + customer_id: str = None + + +@dataclass +class DiscountResponse(Model): + amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + coupon_set_code: str = None + + +@dataclass +class LineItemDiscountResponse(Model): + line_item_id: str = None + discount_type: str = None + coupon_id: str = None + entity_id: str = None + discount_amount: int = None + + +@dataclass +class TaxResponse(Model): + name: str = None + amount: int = None + description: str = None + + +@dataclass +class LineItemTaxResponse(Model): + line_item_id: str = None + tax_name: str = None + tax_rate: float = None + date_to: int = None + date_from: int = None + prorated_taxable_amount: float = None + is_partial_tax_applied: bool = None + is_non_compliance_tax: bool = None + taxable_amount: int = None + tax_amount: int = None + tax_juris_type: str = None + tax_juris_name: str = None + tax_juris_code: str = None + tax_amount_in_local_currency: int = None + local_currency_code: str = None + + +@dataclass +class QuoteLineGroupResponse(Model): + raw_data: Dict[Any, Any] = None + version: int = None + id: str = None + sub_total: int = None + total: int = None + credits_applied: int = None + amount_paid: int = None + amount_due: int = None + 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 diff --git a/chargebee/models/quote_line_group/types.py b/chargebee/models/quote_line_group/types.py new file mode 100644 index 0000000..83fd174 --- /dev/null +++ b/chargebee/models/quote_line_group/types.py @@ -0,0 +1,136 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class ChargeEvent(Enum): + IMMEDIATE = "immediate" + SUBSCRIPTION_CREATION = "subscription_creation" + TRIAL_START = "trial_start" + SUBSCRIPTION_CHANGE = "subscription_change" + SUBSCRIPTION_RENEWAL = "subscription_renewal" + SUBSCRIPTION_CANCEL = "subscription_cancel" + + def __str__(self): + return self.value + + +class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + +class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required[LineItemEntityType] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + +class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required[DiscountEntityType] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + +class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required[LineItemDiscountDiscountType] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + +class QuoteLineGroups(TypedDict): + version: NotRequired[int] + id: NotRequired[str] + sub_total: Required[int] + total: NotRequired[int] + credits_applied: NotRequired[int] + amount_paid: NotRequired[int] + amount_due: NotRequired[int] + charge_event: NotRequired[ChargeEvent] + billing_cycle_number: NotRequired[int] + line_items: NotRequired[List[LineItem]] + discounts: NotRequired[List[Discount]] + line_item_discounts: NotRequired[List[LineItemDiscount]] + taxes: NotRequired[List[Tax]] + line_item_taxes: NotRequired[List[LineItemTax]] diff --git a/chargebee/models/quoted_charge/__init__.py b/chargebee/models/quoted_charge/__init__.py new file mode 100644 index 0000000..1167daf --- /dev/null +++ b/chargebee/models/quoted_charge/__init__.py @@ -0,0 +1,3 @@ +from .operations import QuotedCharge +from .responses import QuotedChargeResponse +from .types import QuotedCharges, Charge, Addon, InvoiceItem, ItemTier, Coupon diff --git a/chargebee/models/quoted_charge/operations.py b/chargebee/models/quoted_charge/operations.py new file mode 100644 index 0000000..ebb602c --- /dev/null +++ b/chargebee/models/quoted_charge/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class QuotedCharge: + + pass diff --git a/chargebee/models/quoted_charge/responses.py b/chargebee/models/quoted_charge/responses.py new file mode 100644 index 0000000..0657f9e --- /dev/null +++ b/chargebee/models/quoted_charge/responses.py @@ -0,0 +1,62 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ChargeResponse(Model): + amount: int = None + amount_in_decimal: str = None + description: str = None + service_period_in_days: int = None + avalara_sale_type: str = None + avalara_transaction_type: int = None + avalara_service_type: int = None + + +@dataclass +class InvoiceItemResponse(Model): + item_price_id: str = None + quantity: int = None + quantity_in_decimal: str = None + unit_price: int = None + unit_price_in_decimal: str = None + service_period_days: int = None + + +@dataclass +class ItemTierResponse(Model): + item_price_id: str = None + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + index: int = None + + +@dataclass +class CouponResponse(Model): + coupon_id: str = None + + +@dataclass +class AddonResponse(Model): + id: str = None + quantity: int = None + unit_price: int = None + quantity_in_decimal: str = None + unit_price_in_decimal: str = None + proration_type: str = None + service_period: int = None + + +@dataclass +class QuotedChargeResponse(Model): + raw_data: Dict[Any, Any] = None + charges: List[ChargeResponse] = None + addons: List[AddonResponse] = None + invoice_items: List[InvoiceItemResponse] = None + item_tiers: List[ItemTierResponse] = None + coupons: List[CouponResponse] = None diff --git a/chargebee/models/quoted_charge/types.py b/chargebee/models/quoted_charge/types.py new file mode 100644 index 0000000..268a3eb --- /dev/null +++ b/chargebee/models/quoted_charge/types.py @@ -0,0 +1,54 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums + + +class Charge(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + service_period_in_days: NotRequired[int] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + + +class InvoiceItem(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + +class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + +class Coupon(TypedDict): + coupon_id: Required[str] + + +class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] + service_period: NotRequired[int] + + +class QuotedCharges(TypedDict): + charges: NotRequired[List[Charge]] + addons: NotRequired[List[Addon]] + invoice_items: NotRequired[List[InvoiceItem]] + item_tiers: NotRequired[List[ItemTier]] + coupons: NotRequired[List[Coupon]] diff --git a/chargebee/models/quoted_subscription/__init__.py b/chargebee/models/quoted_subscription/__init__.py new file mode 100644 index 0000000..2b0d7f1 --- /dev/null +++ b/chargebee/models/quoted_subscription/__init__.py @@ -0,0 +1,13 @@ +from .operations import QuotedSubscription +from .responses import QuotedSubscriptionResponse +from .types import ( + QuotedSubscriptions, + Addon, + EventBasedAddon, + Coupon, + SubscriptionItem, + ItemTier, + QuotedContractTerm, + ChangeOption, + BillingPeriodUnit, +) diff --git a/chargebee/models/quoted_subscription/operations.py b/chargebee/models/quoted_subscription/operations.py new file mode 100644 index 0000000..108aeea --- /dev/null +++ b/chargebee/models/quoted_subscription/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class QuotedSubscription: + + pass diff --git a/chargebee/models/quoted_subscription/responses.py b/chargebee/models/quoted_subscription/responses.py new file mode 100644 index 0000000..145623f --- /dev/null +++ b/chargebee/models/quoted_subscription/responses.py @@ -0,0 +1,109 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class CouponResponse(Model): + coupon_id: str = None + + +@dataclass +class SubscriptionItemResponse(Model): + item_price_id: str = None + item_type: str = None + quantity: int = None + quantity_in_decimal: str = None + metered_quantity: str = None + last_calculated_at: int = None + unit_price: int = None + unit_price_in_decimal: str = None + amount: int = None + amount_in_decimal: str = None + billing_period: int = None + billing_period_unit: str = None + free_quantity: int = None + free_quantity_in_decimal: str = None + trial_end: int = None + billing_cycles: int = None + service_period_days: int = None + charge_on_event: str = None + charge_once: bool = None + charge_on_option: str = None + proration_type: str = None + + +@dataclass +class ItemTierResponse(Model): + item_price_id: str = None + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + index: int = None + + +@dataclass +class QuotedContractTermResponse(Model): + contract_start: int = None + contract_end: int = None + billing_cycle: int = None + action_at_term_end: str = None + total_contract_value: int = None + cancellation_cutoff_period: int = None + + +@dataclass +class EventBasedAddonResponse(Model): + id: str = None + quantity: int = None + unit_price: int = None + service_period_in_days: int = None + on_event: str = None + charge_once: bool = None + quantity_in_decimal: str = None + unit_price_in_decimal: str = None + + +@dataclass +class AddonResponse(Model): + id: str = None + quantity: int = None + unit_price: int = None + amount: int = None + trial_end: int = None + remaining_billing_cycles: int = None + quantity_in_decimal: str = None + unit_price_in_decimal: str = None + amount_in_decimal: str = None + proration_type: str = None + + +@dataclass +class QuotedSubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + plan_id: str = None + plan_quantity: int = None + plan_unit_price: int = None + setup_fee: int = None + billing_period: int = None + billing_period_unit: str = None + start_date: int = None + trial_end: int = None + remaining_billing_cycles: int = None + po_number: str = None + auto_collection: str = None + plan_quantity_in_decimal: str = None + plan_unit_price_in_decimal: str = None + changes_scheduled_at: int = None + change_option: str = None + contract_term_billing_cycle_on_renewal: int = None + addons: List[AddonResponse] = None + event_based_addons: List[EventBasedAddonResponse] = None + coupons: List[CouponResponse] = None + subscription_items: List[SubscriptionItemResponse] = None + item_tiers: List[ItemTierResponse] = None + quoted_contract_term: QuotedContractTermResponse = None diff --git a/chargebee/models/quoted_subscription/types.py b/chargebee/models/quoted_subscription/types.py new file mode 100644 index 0000000..1b95244 --- /dev/null +++ b/chargebee/models/quoted_subscription/types.py @@ -0,0 +1,130 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class ChangeOption(Enum): + END_OF_TERM = "end_of_term" + SPECIFIC_DATE = "specific_date" + IMMEDIATELY = "immediately" + + def __str__(self): + return self.value + + +class BillingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class QuotedContractTermActionAtTermEnd(Enum): + RENEW = "renew" + EVERGREEN = "evergreen" + CANCEL = "cancel" + RENEW_ONCE = "renew_once" + + def __str__(self): + return self.value + + +class Coupon(TypedDict): + coupon_id: Required[str] + + +class SubscriptionItem(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + metered_quantity: NotRequired[str] + last_calculated_at: NotRequired[int] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + billing_period: NotRequired[int] + billing_period_unit: NotRequired[BillingPeriodUnit] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + 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] + proration_type: NotRequired[enums.ProrationType] + + +class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + +class QuotedContractTerm(TypedDict): + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required[QuotedContractTermActionAtTermEnd] + total_contract_value: Required[int] + cancellation_cutoff_period: NotRequired[int] + + +class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + unit_price: Required[int] + service_period_in_days: NotRequired[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + amount: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] + + +class QuotedSubscriptions(TypedDict): + id: Required[str] + plan_id: Required[str] + plan_quantity: Required[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + billing_period: NotRequired[int] + billing_period_unit: NotRequired[BillingPeriodUnit] + start_date: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + po_number: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + changes_scheduled_at: NotRequired[int] + change_option: NotRequired[ChangeOption] + contract_term_billing_cycle_on_renewal: NotRequired[int] + addons: NotRequired[List[Addon]] + event_based_addons: NotRequired[List[EventBasedAddon]] + coupons: NotRequired[List[Coupon]] + subscription_items: NotRequired[List[SubscriptionItem]] + item_tiers: NotRequired[List[ItemTier]] + quoted_contract_term: NotRequired[QuotedContractTerm] diff --git a/chargebee/models/ramp/__init__.py b/chargebee/models/ramp/__init__.py new file mode 100644 index 0000000..f9ab636 --- /dev/null +++ b/chargebee/models/ramp/__init__.py @@ -0,0 +1,12 @@ +from .operations import Ramp +from .responses import RampResponse +from .types import ( + Ramps, + ItemsToAdd, + ItemsToUpdate, + CouponsToAdd, + DiscountsToAdd, + ItemTier, + StatusTransitionReason, + Status, +) diff --git a/chargebee/models/ramp/operations.py b/chargebee/models/ramp/operations.py new file mode 100644 index 0000000..2571a9f --- /dev/null +++ b/chargebee/models/ramp/operations.py @@ -0,0 +1,94 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Ramp: + + class CreateForSubscriptionParams(TypedDict): + effective_from: Required[int] + description: NotRequired[str] + coupons_to_remove: NotRequired[List[str]] + discounts_to_remove: NotRequired[List[str]] + items_to_remove: NotRequired[List[str]] + items_to_add: Required[List[CreateForSubscriptionItemsToAddParams]] + items_to_update: Required[List[CreateForSubscriptionItemsToUpdateParams]] + item_tiers: NotRequired[List[CreateForSubscriptionItemTierParams]] + coupons_to_add: NotRequired[List[CreateForSubscriptionCouponsToAddParams]] + discounts_to_add: Required[List[CreateForSubscriptionDiscountsToAddParams]] + + class UpdateParams(TypedDict): + effective_from: Required[int] + description: NotRequired[str] + coupons_to_remove: NotRequired[List[str]] + discounts_to_remove: NotRequired[List[str]] + items_to_remove: NotRequired[List[str]] + items_to_add: Required[List[UpdateItemsToAddParams]] + items_to_update: Required[List[UpdateItemsToUpdateParams]] + item_tiers: NotRequired[List[UpdateItemTierParams]] + coupons_to_add: NotRequired[List[UpdateCouponsToAddParams]] + discounts_to_add: Required[List[UpdateDiscountsToAddParams]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + status: NotRequired[Filters.EnumFilter] + subscription_id: Required[Filters.StringFilter] + effective_from: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + @staticmethod + def create_for_subscription( + id, params: CreateForSubscriptionParams, env=None, headers=None + ) -> CreateForSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "create_ramp"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForSubscriptionResponse, + ) + + @staticmethod + def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + return request.send( + "post", + request.uri_path("ramps", id, "update"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", request.uri_path("ramps", id), None, env, headers, RetrieveResponse + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("ramps", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("ramps"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/ramp/responses.py b/chargebee/models/ramp/responses.py new file mode 100644 index 0000000..fb6faec --- /dev/null +++ b/chargebee/models/ramp/responses.py @@ -0,0 +1,136 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ItemsToAddResponse(Model): + item_price_id: str = None + item_type: str = None + quantity: int = None + quantity_in_decimal: str = None + unit_price: int = None + unit_price_in_decimal: str = None + amount: int = None + amount_in_decimal: str = None + free_quantity: int = None + free_quantity_in_decimal: str = None + billing_cycles: int = None + service_period_days: int = None + metered_quantity: str = None + + +@dataclass +class ItemsToUpdateResponse(Model): + item_price_id: str = None + item_type: str = None + quantity: int = None + quantity_in_decimal: str = None + unit_price: int = None + unit_price_in_decimal: str = None + amount: int = None + amount_in_decimal: str = None + free_quantity: int = None + free_quantity_in_decimal: str = None + billing_cycles: int = None + service_period_days: int = None + metered_quantity: str = None + + +@dataclass +class CouponsToAddResponse(Model): + coupon_id: str = None + apply_till: int = None + + +@dataclass +class DiscountsToAddResponse(Model): + id: str = None + invoice_name: str = None + type: str = None + percentage: float = None + amount: int = None + duration_type: str = None + period: int = None + period_unit: str = None + included_in_mrr: bool = None + apply_on: str = None + item_price_id: str = None + created_at: int = None + + +@dataclass +class ItemTierResponse(Model): + item_price_id: str = None + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + index: int = None + + +@dataclass +class StatusTransitionReasonResponse(Model): + code: str = None + message: str = None + + +@dataclass +class RampResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + description: str = None + subscription_id: str = None + effective_from: int = None + status: str = None + created_at: int = None + resource_version: int = None + updated_at: int = None + items_to_add: List[ItemsToAddResponse] = None + items_to_update: List[ItemsToUpdateResponse] = None + coupons_to_add: List[CouponsToAddResponse] = None + discounts_to_add: List[DiscountsToAddResponse] = None + item_tiers: List[ItemTierResponse] = None + items_to_remove: List[str] = None + coupons_to_remove: List[str] = None + discounts_to_remove: List[str] = None + deleted: bool = None + status_transition_reason: StatusTransitionReasonResponse = None + + +@dataclass +class CreateForSubscriptionResponse: + ramp: RampResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + ramp: RampResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + ramp: RampResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + ramp: RampResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListRampResponse: + ramp: RampResponse + + +@dataclass +class ListResponse: + list: List[ListRampResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/ramp/types.py b/chargebee/models/ramp/types.py new file mode 100644 index 0000000..2eb166d --- /dev/null +++ b/chargebee/models/ramp/types.py @@ -0,0 +1,202 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + FAILED = "failed" + DRAFT = "draft" + + def __str__(self): + return self.value + + +class DiscountsToAddType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + +class ItemsToAdd(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + metered_quantity: NotRequired[str] + + +class ItemsToUpdate(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + metered_quantity: NotRequired[str] + + +class CouponsToAdd(TypedDict): + coupon_id: Required[str] + apply_till: NotRequired[int] + + +class DiscountsToAdd(TypedDict): + id: Required[str] + invoice_name: NotRequired[str] + type: Required[DiscountsToAddType] + percentage: NotRequired[float] + amount: NotRequired[int] + duration_type: Required[enums.DurationType] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: Required[bool] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + created_at: Required[int] + + +class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + +class StatusTransitionReason(TypedDict): + code: NotRequired[str] + message: NotRequired[str] + + +class Ramps(TypedDict): + id: Required[str] + description: NotRequired[str] + subscription_id: Required[str] + effective_from: Required[int] + status: Required[Status] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + items_to_add: NotRequired[List[ItemsToAdd]] + items_to_update: NotRequired[List[ItemsToUpdate]] + coupons_to_add: NotRequired[List[CouponsToAdd]] + discounts_to_add: NotRequired[List[DiscountsToAdd]] + item_tiers: NotRequired[List[ItemTier]] + items_to_remove: NotRequired[List[str]] + coupons_to_remove: NotRequired[List[str]] + discounts_to_remove: NotRequired[List[str]] + deleted: Required[bool] + status_transition_reason: NotRequired[StatusTransitionReason] + + +class CreateForSubscriptionItemsToAddParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + +class CreateForSubscriptionItemsToUpdateParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + +class CreateForSubscriptionItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateForSubscriptionCouponsToAddParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class CreateForSubscriptionDiscountsToAddParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class UpdateItemsToAddParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + +class UpdateItemsToUpdateParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + +class UpdateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateCouponsToAddParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class UpdateDiscountsToAddParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] diff --git a/chargebee/models/resource_migration/__init__.py b/chargebee/models/resource_migration/__init__.py new file mode 100644 index 0000000..277a228 --- /dev/null +++ b/chargebee/models/resource_migration/__init__.py @@ -0,0 +1,3 @@ +from .operations import ResourceMigration +from .responses import ResourceMigrationResponse +from .types import ResourceMigrations, Status diff --git a/chargebee/models/resource_migration/operations.py b/chargebee/models/resource_migration/operations.py new file mode 100644 index 0000000..ff1ce87 --- /dev/null +++ b/chargebee/models/resource_migration/operations.py @@ -0,0 +1,25 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ResourceMigration: + + class RetrieveLatestParams(TypedDict): + from_site: Required[str] + entity_type: Required[enums.EntityType] + entity_id: Required[str] + + @staticmethod + def retrieve_latest( + params: RetrieveLatestParams, env=None, headers=None + ) -> RetrieveLatestResponse: + return request.send( + "get", + request.uri_path("resource_migrations", "retrieve_latest"), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveLatestResponse, + ) diff --git a/chargebee/models/resource_migration/responses.py b/chargebee/models/resource_migration/responses.py new file mode 100644 index 0000000..7c74a50 --- /dev/null +++ b/chargebee/models/resource_migration/responses.py @@ -0,0 +1,21 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ResourceMigrationResponse(Model): + raw_data: Dict[Any, Any] = None + from_site: str = None + entity_type: str = None + entity_id: str = None + status: str = None + errors: str = None + created_at: int = None + updated_at: int = None + + +@dataclass +class RetrieveLatestResponse: + resource_migration: ResourceMigrationResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/resource_migration/types.py b/chargebee/models/resource_migration/types.py new file mode 100644 index 0000000..29e198f --- /dev/null +++ b/chargebee/models/resource_migration/types.py @@ -0,0 +1,22 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + SCHEDULED = "scheduled" + FAILED = "failed" + SUCCEEDED = "succeeded" + + def __str__(self): + return self.value + + +class ResourceMigrations(TypedDict): + from_site: Required[str] + entity_type: Required[enums.EntityType] + entity_id: Required[str] + status: Required[Status] + errors: NotRequired[str] + created_at: Required[int] + updated_at: Required[int] diff --git a/chargebee/models/site_migration_detail/__init__.py b/chargebee/models/site_migration_detail/__init__.py new file mode 100644 index 0000000..e34334c --- /dev/null +++ b/chargebee/models/site_migration_detail/__init__.py @@ -0,0 +1,3 @@ +from .operations import SiteMigrationDetail +from .responses import SiteMigrationDetailResponse +from .types import SiteMigrationDetails, Status diff --git a/chargebee/models/site_migration_detail/operations.py b/chargebee/models/site_migration_detail/operations.py new file mode 100644 index 0000000..396d793 --- /dev/null +++ b/chargebee/models/site_migration_detail/operations.py @@ -0,0 +1,28 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class SiteMigrationDetail: + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + entity_id_at_other_site: NotRequired[Filters.StringFilter] + other_site_name: NotRequired[Filters.StringFilter] + entity_id: NotRequired[Filters.StringFilter] + entity_type: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("site_migration_details"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) diff --git a/chargebee/models/site_migration_detail/responses.py b/chargebee/models/site_migration_detail/responses.py new file mode 100644 index 0000000..2ea461e --- /dev/null +++ b/chargebee/models/site_migration_detail/responses.py @@ -0,0 +1,26 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class SiteMigrationDetailResponse(Model): + raw_data: Dict[Any, Any] = None + entity_id: str = None + other_site_name: str = None + entity_id_at_other_site: str = None + migrated_at: int = None + entity_type: str = None + status: str = None + + +@dataclass +class ListSiteMigrationDetailResponse: + site_migration_detail: SiteMigrationDetailResponse + + +@dataclass +class ListResponse: + list: List[ListSiteMigrationDetailResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/site_migration_detail/types.py b/chargebee/models/site_migration_detail/types.py new file mode 100644 index 0000000..c886ffc --- /dev/null +++ b/chargebee/models/site_migration_detail/types.py @@ -0,0 +1,21 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + MOVED_IN = "moved_in" + MOVED_OUT = "moved_out" + MOVING_OUT = "moving_out" + + def __str__(self): + return self.value + + +class SiteMigrationDetails(TypedDict): + entity_id: Required[str] + other_site_name: Required[str] + entity_id_at_other_site: Required[str] + migrated_at: Required[int] + entity_type: Required[enums.EntityType] + status: Required[Status] diff --git a/chargebee/models/subscription/__init__.py b/chargebee/models/subscription/__init__.py new file mode 100644 index 0000000..b8becba --- /dev/null +++ b/chargebee/models/subscription/__init__.py @@ -0,0 +1,19 @@ +from .operations import Subscription +from .responses import SubscriptionResponse +from .types import ( + Subscriptions, + SubscriptionItem, + ItemTier, + ChargedItem, + Addon, + EventBasedAddon, + ChargedEventBasedAddon, + Coupon, + ShippingAddress, + ReferralInfo, + ContractTerm, + Discount, + Status, + CancelReason, + BillingPeriodUnit, +) diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py new file mode 100644 index 0000000..c93a174 --- /dev/null +++ b/chargebee/models/subscription/operations.py @@ -0,0 +1,996 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Subscription: + + class CreateParams(TypedDict): + id: NotRequired[str] + customer: NotRequired[CreateCustomerParams] + entity_identifiers: NotRequired[List[CreateEntityIdentifierParams]] + tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CreateAddonParams]] + event_based_addons: NotRequired[List[CreateEventBasedAddonParams]] + mandatory_addons_to_remove: NotRequired[List[str]] + start_date: NotRequired[int] + coupon: NotRequired[str] + 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]] + card: NotRequired[CreateCardParams] + bank_account: NotRequired[CreateBankAccountParams] + token_id: NotRequired[str] + payment_method: NotRequired[CreatePaymentMethodParams] + payment_intent: NotRequired[CreatePaymentIntentParams] + billing_address: NotRequired[CreateBillingAddressParams] + shipping_address: NotRequired[CreateShippingAddressParams] + statement_descriptor: NotRequired[CreateStatementDescriptorParams] + affiliate_token: NotRequired[str] + created_from_ip: NotRequired[str] + invoice_notes: NotRequired[str] + invoice_date: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] + invoice_immediately: NotRequired[bool] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term: NotRequired[CreateContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + client_profile_id: NotRequired[str] + payment_initiator: NotRequired[enums.PaymentInitiator] + coupons: NotRequired[List[CreateCouponParams]] + + class CreateForCustomerParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + addons: NotRequired[List[CreateForCustomerAddonParams]] + event_based_addons: NotRequired[List[CreateForCustomerEventBasedAddonParams]] + mandatory_addons_to_remove: NotRequired[List[str]] + start_date: NotRequired[int] + coupon: NotRequired[str] + 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] + override_relationship: NotRequired[bool] + shipping_address: NotRequired[CreateForCustomerShippingAddressParams] + statement_descriptor: NotRequired[CreateForCustomerStatementDescriptorParams] + invoice_notes: NotRequired[str] + invoice_date: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] + invoice_immediately: NotRequired[bool] + replace_primary_payment_source: NotRequired[bool] + payment_intent: NotRequired[CreateForCustomerPaymentIntentParams] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term: NotRequired[CreateForCustomerContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + payment_initiator: NotRequired[enums.PaymentInitiator] + coupons: NotRequired[List[CreateForCustomerCouponParams]] + + class CreateWithItemsParams(TypedDict): + id: NotRequired[str] + business_entity_id: NotRequired[str] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + subscription_items: Required[List[CreateWithItemsSubscriptionItemParams]] + setup_fee: NotRequired[int] + discounts: Required[List[CreateWithItemsDiscountParams]] + mandatory_items_to_remove: NotRequired[List[str]] + item_tiers: NotRequired[List[CreateWithItemsItemTierParams]] + net_term_days: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + terms_to_charge: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + payment_source_id: NotRequired[str] + override_relationship: NotRequired[bool] + shipping_address: NotRequired[CreateWithItemsShippingAddressParams] + statement_descriptor: NotRequired[CreateWithItemsStatementDescriptorParams] + invoice_notes: NotRequired[str] + invoice_date: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] + invoice_immediately: NotRequired[bool] + replace_primary_payment_source: NotRequired[bool] + payment_intent: NotRequired[CreateWithItemsPaymentIntentParams] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term: NotRequired[CreateWithItemsContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + create_pending_invoices: NotRequired[bool] + auto_close_invoices: NotRequired[bool] + first_invoice_pending: NotRequired[bool] + trial_end_action: NotRequired[enums.TrialEndAction] + payment_initiator: NotRequired[enums.PaymentInitiator] + coupons: NotRequired[List[CreateWithItemsCouponParams]] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + plan_id: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + item_price_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + cancel_reason: NotRequired[Filters.EnumFilter] + cancel_reason_code: NotRequired[Filters.StringFilter] + remaining_billing_cycles: NotRequired[Filters.NumberFilter] + created_at: NotRequired[Filters.TimestampFilter] + activated_at: NotRequired[Filters.TimestampFilter] + next_billing_at: NotRequired[Filters.TimestampFilter] + cancelled_at: NotRequired[Filters.TimestampFilter] + has_scheduled_changes: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + override_relationship: NotRequired[Filters.BooleanFilter] + sort_by: NotRequired[Filters.SortFilter] + business_entity_id: NotRequired[Filters.StringFilter] + channel: NotRequired[Filters.EnumFilter] + + class SubscriptionsForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class ContractTermsForSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class ListDiscountsParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class RemoveScheduledCancellationParams(TypedDict): + billing_cycles: NotRequired[int] + + class RemoveCouponsParams(TypedDict): + coupon_ids: NotRequired[List[str]] + + class UpdateParams(TypedDict): + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + addons: NotRequired[List[UpdateAddonParams]] + event_based_addons: NotRequired[List[UpdateEventBasedAddonParams]] + replace_addon_list: NotRequired[bool] + mandatory_addons_to_remove: NotRequired[List[str]] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + invoice_date: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + coupon: NotRequired[str] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + prorate: NotRequired[bool] + end_of_term: NotRequired[bool] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + card: NotRequired[UpdateCardParams] + token_id: NotRequired[str] + payment_method: NotRequired[UpdatePaymentMethodParams] + payment_intent: NotRequired[UpdatePaymentIntentParams] + billing_address: NotRequired[UpdateBillingAddressParams] + shipping_address: NotRequired[UpdateShippingAddressParams] + statement_descriptor: NotRequired[UpdateStatementDescriptorParams] + customer: NotRequired[UpdateCustomerParams] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + invoice_immediately: NotRequired[bool] + override_relationship: NotRequired[bool] + changes_scheduled_at: NotRequired[int] + change_option: NotRequired[enums.ChangeOption] + contract_term: NotRequired[UpdateContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + trial_end_action: NotRequired[enums.TrialEndAction] + coupons: NotRequired[List[UpdateCouponParams]] + + class UpdateForItemsParams(TypedDict): + subscription_items: Required[List[UpdateForItemsSubscriptionItemParams]] + mandatory_items_to_remove: NotRequired[List[str]] + replace_items_list: NotRequired[bool] + setup_fee: NotRequired[int] + discounts: Required[List[UpdateForItemsDiscountParams]] + item_tiers: NotRequired[List[UpdateForItemsItemTierParams]] + net_term_days: NotRequired[int] + invoice_date: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + coupon: NotRequired[str] + terms_to_charge: NotRequired[int] + reactivate_from: NotRequired[int] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] + prorate: NotRequired[bool] + end_of_term: NotRequired[bool] + force_term_reset: NotRequired[bool] + reactivate: NotRequired[bool] + card: NotRequired[UpdateForItemsCardParams] + token_id: NotRequired[str] + payment_method: NotRequired[UpdateForItemsPaymentMethodParams] + payment_intent: NotRequired[UpdateForItemsPaymentIntentParams] + billing_address: NotRequired[UpdateForItemsBillingAddressParams] + shipping_address: NotRequired[UpdateForItemsShippingAddressParams] + statement_descriptor: NotRequired[UpdateForItemsStatementDescriptorParams] + customer: NotRequired[UpdateForItemsCustomerParams] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + invoice_immediately: NotRequired[bool] + override_relationship: NotRequired[bool] + changes_scheduled_at: NotRequired[int] + change_option: NotRequired[enums.ChangeOption] + contract_term: NotRequired[UpdateForItemsContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + create_pending_invoices: NotRequired[bool] + auto_close_invoices: NotRequired[bool] + trial_end_action: NotRequired[enums.TrialEndAction] + payment_initiator: NotRequired[enums.PaymentInitiator] + coupons: NotRequired[List[UpdateForItemsCouponParams]] + invoice_usages: NotRequired[bool] + + class ChangeTermEndParams(TypedDict): + term_ends_at: Required[int] + prorate: NotRequired[bool] + invoice_immediately: NotRequired[bool] + + class ReactivateParams(TypedDict): + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + trial_period_days: NotRequired[int] + reactivate_from: NotRequired[int] + invoice_immediately: NotRequired[bool] + billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] + terms_to_charge: NotRequired[int] + invoice_date: NotRequired[int] + contract_term: NotRequired[ReactivateContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + payment_initiator: NotRequired[enums.PaymentInitiator] + statement_descriptor: NotRequired[ReactivateStatementDescriptorParams] + payment_intent: NotRequired[ReactivatePaymentIntentParams] + + class AddChargeAtTermEndParams(TypedDict): + amount: NotRequired[int] + description: Required[str] + amount_in_decimal: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class ChargeAddonAtTermEndParams(TypedDict): + addon_id: Required[str] + addon_quantity: NotRequired[int] + addon_unit_price: NotRequired[int] + addon_quantity_in_decimal: NotRequired[str] + addon_unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class ChargeFutureRenewalsParams(TypedDict): + terms_to_charge: NotRequired[int] + specific_dates_schedule: NotRequired[ + List[ChargeFutureRenewalsSpecificDatesScheduleParams] + ] + fixed_interval_schedule: NotRequired[ + ChargeFutureRenewalsFixedIntervalScheduleParams + ] + invoice_immediately: NotRequired[bool] + schedule_type: NotRequired[enums.ScheduleType] + + class EditAdvanceInvoiceScheduleParams(TypedDict): + terms_to_charge: NotRequired[int] + schedule_type: NotRequired[enums.ScheduleType] + specific_dates_schedule: NotRequired[ + List[EditAdvanceInvoiceScheduleSpecificDatesScheduleParams] + ] + fixed_interval_schedule: NotRequired[ + EditAdvanceInvoiceScheduleFixedIntervalScheduleParams + ] + + class RemoveAdvanceInvoiceScheduleParams(TypedDict): + specific_dates_schedule: NotRequired[ + List[RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams] + ] + + class RegenerateInvoiceParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + prorate: NotRequired[bool] + invoice_immediately: NotRequired[bool] + + class ImportSubscriptionParams(TypedDict): + id: NotRequired[str] + customer: NotRequired[ImportSubscriptionCustomerParams] + client_profile_id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + addons: NotRequired[List[ImportSubscriptionAddonParams]] + event_based_addons: NotRequired[List[ImportSubscriptionEventBasedAddonParams]] + charged_event_based_addons: NotRequired[ + List[ImportSubscriptionChargedEventBasedAddonParams] + ] + start_date: NotRequired[int] + auto_collection: NotRequired[enums.AutoCollection] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + contract_term: NotRequired[ImportSubscriptionContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + status: Required[Status] + current_term_end: NotRequired[int] + current_term_start: NotRequired[int] + trial_start: NotRequired[int] + cancelled_at: NotRequired[int] + started_at: NotRequired[int] + activated_at: NotRequired[int] + pause_date: NotRequired[int] + resume_date: NotRequired[int] + create_current_term_invoice: NotRequired[bool] + card: NotRequired[ImportSubscriptionCardParams] + payment_method: NotRequired[ImportSubscriptionPaymentMethodParams] + billing_address: NotRequired[ImportSubscriptionBillingAddressParams] + shipping_address: NotRequired[ImportSubscriptionShippingAddressParams] + affiliate_token: NotRequired[str] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + transaction: NotRequired[ImportSubscriptionTransactionParams] + coupons: NotRequired[List[ImportSubscriptionCouponParams]] + + class ImportForCustomerParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + addons: NotRequired[List[ImportForCustomerAddonParams]] + event_based_addons: NotRequired[List[ImportForCustomerEventBasedAddonParams]] + charged_event_based_addons: NotRequired[ + List[ImportForCustomerChargedEventBasedAddonParams] + ] + start_date: NotRequired[int] + auto_collection: NotRequired[enums.AutoCollection] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + payment_source_id: NotRequired[str] + status: Required[Status] + current_term_end: NotRequired[int] + current_term_start: NotRequired[int] + trial_start: NotRequired[int] + cancelled_at: NotRequired[int] + started_at: NotRequired[int] + activated_at: NotRequired[int] + pause_date: NotRequired[int] + resume_date: NotRequired[int] + contract_term: NotRequired[ImportForCustomerContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + create_current_term_invoice: NotRequired[bool] + transaction: NotRequired[ImportForCustomerTransactionParams] + shipping_address: NotRequired[ImportForCustomerShippingAddressParams] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + coupons: NotRequired[List[ImportForCustomerCouponParams]] + + class ImportContractTermParams(TypedDict): + contract_term: NotRequired[ImportContractTermContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class ImportUnbilledChargesParams(TypedDict): + unbilled_charges: Required[List[ImportUnbilledChargesUnbilledChargeParams]] + discounts: Required[List[ImportUnbilledChargesDiscountParams]] + tiers: Required[List[ImportUnbilledChargesTierParams]] + + class ImportForItemsParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + billing_cycles: NotRequired[int] + subscription_items: Required[List[ImportForItemsSubscriptionItemParams]] + setup_fee: NotRequired[int] + discounts: Required[List[ImportForItemsDiscountParams]] + charged_items: NotRequired[List[ImportForItemsChargedItemParams]] + item_tiers: NotRequired[List[ImportForItemsItemTierParams]] + net_term_days: NotRequired[int] + start_date: NotRequired[int] + auto_collection: NotRequired[enums.AutoCollection] + po_number: NotRequired[str] + coupon_ids: NotRequired[List[str]] + payment_source_id: NotRequired[str] + status: Required[Status] + current_term_end: NotRequired[int] + current_term_start: NotRequired[int] + trial_start: NotRequired[int] + cancelled_at: NotRequired[int] + started_at: NotRequired[int] + activated_at: NotRequired[int] + pause_date: NotRequired[int] + resume_date: NotRequired[int] + contract_term: NotRequired[ImportForItemsContractTermParams] + contract_term_billing_cycle_on_renewal: NotRequired[int] + create_current_term_invoice: NotRequired[bool] + transaction: NotRequired[ImportForItemsTransactionParams] + shipping_address: NotRequired[ImportForItemsShippingAddressParams] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + cancel_reason_code: NotRequired[str] + create_pending_invoices: NotRequired[bool] + auto_close_invoices: NotRequired[bool] + coupons: NotRequired[List[ImportForItemsCouponParams]] + + class OverrideBillingProfileParams(TypedDict): + payment_source_id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + + class PauseParams(TypedDict): + pause_option: NotRequired[enums.PauseOption] + pause_date: NotRequired[int] + unbilled_charges_handling: NotRequired[enums.UnbilledChargesHandling] + invoice_dunning_handling: NotRequired[enums.InvoiceDunningHandling] + skip_billing_cycles: NotRequired[int] + resume_date: NotRequired[int] + + class CancelParams(TypedDict): + cancel_option: NotRequired[enums.CancelOption] + end_of_term: NotRequired[bool] + cancel_at: NotRequired[int] + credit_option_for_current_term_charges: NotRequired[ + enums.CreditOptionForCurrentTermCharges + ] + unbilled_charges_option: NotRequired[enums.UnbilledChargesOption] + account_receivables_handling: NotRequired[enums.AccountReceivablesHandling] + refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] + contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] + invoice_date: NotRequired[int] + event_based_addons: NotRequired[List[CancelEventBasedAddonParams]] + cancel_reason_code: NotRequired[str] + + class CancelForItemsParams(TypedDict): + cancel_option: NotRequired[enums.CancelOption] + end_of_term: NotRequired[bool] + cancel_at: NotRequired[int] + credit_option_for_current_term_charges: NotRequired[ + enums.CreditOptionForCurrentTermCharges + ] + unbilled_charges_option: NotRequired[enums.UnbilledChargesOption] + account_receivables_handling: NotRequired[enums.AccountReceivablesHandling] + refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] + contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] + invoice_date: NotRequired[int] + subscription_items: NotRequired[List[CancelForItemsSubscriptionItemParams]] + cancel_reason_code: NotRequired[str] + + class ResumeParams(TypedDict): + resume_option: NotRequired[enums.ResumeOption] + resume_date: NotRequired[int] + charges_handling: NotRequired[enums.ChargesHandling] + unpaid_invoices_handling: NotRequired[enums.UnpaidInvoicesHandling] + payment_initiator: NotRequired[enums.PaymentInitiator] + payment_intent: NotRequired[ResumePaymentIntentParams] + + class MoveParams(TypedDict): + to_customer_id: Required[str] + copy_payment_source: NotRequired[bool] + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("subscriptions"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def create_for_customer( + id, params: CreateForCustomerParams, env=None, headers=None + ) -> CreateForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "subscriptions"), + cast(Dict[Any, Any], params), + env, + headers, + CreateForCustomerResponse, + ) + + @staticmethod + def create_with_items( + id, params: CreateWithItemsParams, env=None, headers=None + ) -> CreateWithItemsResponse: + return request.send( + "post", + request.uri_path("customers", id, "subscription_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CreateWithItemsResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("subscriptions"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def subscriptions_for_customer( + id, params: SubscriptionsForCustomerParams = None, env=None, headers=None + ) -> SubscriptionsForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "subscriptions"), + cast(Dict[Any, Any], params), + env, + headers, + SubscriptionsForCustomerResponse, + ) + + @staticmethod + def contract_terms_for_subscription( + id, params: ContractTermsForSubscriptionParams = None, env=None, headers=None + ) -> ContractTermsForSubscriptionResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "contract_terms"), + cast(Dict[Any, Any], params), + env, + headers, + ContractTermsForSubscriptionResponse, + ) + + @staticmethod + def list_discounts( + id, params: ListDiscountsParams = None, env=None, headers=None + ) -> ListDiscountsResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "discounts"), + cast(Dict[Any, Any], params), + env, + headers, + ListDiscountsResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("subscriptions", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def retrieve_with_scheduled_changes( + id, env=None, headers=None + ) -> RetrieveWithScheduledChangesResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "retrieve_with_scheduled_changes"), + None, + env, + headers, + RetrieveWithScheduledChangesResponse, + ) + + @staticmethod + def remove_scheduled_changes( + id, env=None, headers=None + ) -> RemoveScheduledChangesResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_scheduled_changes"), + None, + env, + headers, + RemoveScheduledChangesResponse, + ) + + @staticmethod + def remove_scheduled_cancellation( + id, params: RemoveScheduledCancellationParams = None, env=None, headers=None + ) -> RemoveScheduledCancellationResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_scheduled_cancellation"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveScheduledCancellationResponse, + ) + + @staticmethod + def remove_coupons( + id, params: RemoveCouponsParams = None, env=None, headers=None + ) -> RemoveCouponsResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_coupons"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveCouponsResponse, + ) + + @staticmethod + def update( + id, params: UpdateParams = None, env=None, headers=None + ) -> UpdateResponse: + return request.send( + "post", + request.uri_path("subscriptions", id), + cast(Dict[Any, Any], params), + env, + headers, + UpdateResponse, + ) + + @staticmethod + def update_for_items( + id, params: UpdateForItemsParams, env=None, headers=None + ) -> UpdateForItemsResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "update_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + UpdateForItemsResponse, + ) + + @staticmethod + def change_term_end( + id, params: ChangeTermEndParams, env=None, headers=None + ) -> ChangeTermEndResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "change_term_end"), + cast(Dict[Any, Any], params), + env, + headers, + ChangeTermEndResponse, + ) + + @staticmethod + def reactivate( + id, params: ReactivateParams = None, env=None, headers=None + ) -> ReactivateResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "reactivate"), + cast(Dict[Any, Any], params), + env, + headers, + ReactivateResponse, + ) + + @staticmethod + def add_charge_at_term_end( + id, params: AddChargeAtTermEndParams, env=None, headers=None + ) -> AddChargeAtTermEndResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "add_charge_at_term_end"), + cast(Dict[Any, Any], params), + env, + headers, + AddChargeAtTermEndResponse, + ) + + @staticmethod + def charge_addon_at_term_end( + id, params: ChargeAddonAtTermEndParams, env=None, headers=None + ) -> ChargeAddonAtTermEndResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "charge_addon_at_term_end"), + cast(Dict[Any, Any], params), + env, + headers, + ChargeAddonAtTermEndResponse, + ) + + @staticmethod + def charge_future_renewals( + id, params: ChargeFutureRenewalsParams = None, env=None, headers=None + ) -> ChargeFutureRenewalsResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "charge_future_renewals"), + cast(Dict[Any, Any], params), + env, + headers, + ChargeFutureRenewalsResponse, + ) + + @staticmethod + def edit_advance_invoice_schedule( + id, params: EditAdvanceInvoiceScheduleParams = None, env=None, headers=None + ) -> EditAdvanceInvoiceScheduleResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "edit_advance_invoice_schedule"), + cast(Dict[Any, Any], params), + env, + headers, + EditAdvanceInvoiceScheduleResponse, + ) + + @staticmethod + def retrieve_advance_invoice_schedule( + id, env=None, headers=None + ) -> RetrieveAdvanceInvoiceScheduleResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "retrieve_advance_invoice_schedule"), + None, + env, + headers, + RetrieveAdvanceInvoiceScheduleResponse, + ) + + @staticmethod + def remove_advance_invoice_schedule( + id, params: RemoveAdvanceInvoiceScheduleParams = None, env=None, headers=None + ) -> RemoveAdvanceInvoiceScheduleResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_advance_invoice_schedule"), + cast(Dict[Any, Any], params), + env, + headers, + RemoveAdvanceInvoiceScheduleResponse, + ) + + @staticmethod + def regenerate_invoice( + id, params: RegenerateInvoiceParams = None, env=None, headers=None + ) -> RegenerateInvoiceResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "regenerate_invoice"), + cast(Dict[Any, Any], params), + env, + headers, + RegenerateInvoiceResponse, + ) + + @staticmethod + def import_subscription( + params: ImportSubscriptionParams, env=None, headers=None + ) -> ImportSubscriptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", "import_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + ImportSubscriptionResponse, + ) + + @staticmethod + def import_for_customer( + id, params: ImportForCustomerParams, env=None, headers=None + ) -> ImportForCustomerResponse: + return request.send( + "post", + request.uri_path("customers", id, "import_subscription"), + cast(Dict[Any, Any], params), + env, + headers, + ImportForCustomerResponse, + ) + + @staticmethod + def import_contract_term( + id, params: ImportContractTermParams = None, env=None, headers=None + ) -> ImportContractTermResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "import_contract_term"), + cast(Dict[Any, Any], params), + env, + headers, + ImportContractTermResponse, + ) + + @staticmethod + def import_unbilled_charges( + id, params: ImportUnbilledChargesParams, env=None, headers=None + ) -> ImportUnbilledChargesResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "import_unbilled_charges"), + cast(Dict[Any, Any], params), + env, + headers, + ImportUnbilledChargesResponse, + ) + + @staticmethod + def import_for_items( + id, params: ImportForItemsParams, env=None, headers=None + ) -> ImportForItemsResponse: + return request.send( + "post", + request.uri_path("customers", id, "import_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + ImportForItemsResponse, + ) + + @staticmethod + def override_billing_profile( + id, params: OverrideBillingProfileParams = None, env=None, headers=None + ) -> OverrideBillingProfileResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "override_billing_profile"), + cast(Dict[Any, Any], params), + env, + headers, + OverrideBillingProfileResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def pause(id, params: PauseParams = None, env=None, headers=None) -> PauseResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "pause"), + cast(Dict[Any, Any], params), + env, + headers, + PauseResponse, + ) + + @staticmethod + def cancel( + id, params: CancelParams = None, env=None, headers=None + ) -> CancelResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "cancel"), + cast(Dict[Any, Any], params), + env, + headers, + CancelResponse, + ) + + @staticmethod + def cancel_for_items( + id, params: CancelForItemsParams = None, env=None, headers=None + ) -> CancelForItemsResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "cancel_for_items"), + cast(Dict[Any, Any], params), + env, + headers, + CancelForItemsResponse, + ) + + @staticmethod + def resume( + id, params: ResumeParams = None, env=None, headers=None + ) -> ResumeResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "resume"), + cast(Dict[Any, Any], params), + env, + headers, + ResumeResponse, + ) + + @staticmethod + def remove_scheduled_pause( + id, env=None, headers=None + ) -> RemoveScheduledPauseResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_scheduled_pause"), + None, + env, + headers, + RemoveScheduledPauseResponse, + ) + + @staticmethod + def remove_scheduled_resumption( + id, env=None, headers=None + ) -> RemoveScheduledResumptionResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "remove_scheduled_resumption"), + None, + env, + headers, + RemoveScheduledResumptionResponse, + ) + + @staticmethod + def move(id, params: MoveParams, env=None, headers=None) -> MoveResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "move"), + cast(Dict[Any, Any], params), + env, + headers, + MoveResponse, + ) diff --git a/chargebee/models/subscription/responses.py b/chargebee/models/subscription/responses.py new file mode 100644 index 0000000..a1f77a6 --- /dev/null +++ b/chargebee/models/subscription/responses.py @@ -0,0 +1,597 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import ( + unbilled_charge, + payment_intent, + invoice, + advance_invoice_schedule, + customer, + card, + invoice, + unbilled_charge, + credit_note, + estimate, + contract_term, + payment_source, + discount, +) + + +@dataclass +class SubscriptionItemResponse(Model): + item_price_id: str = None + item_type: str = None + quantity: int = None + quantity_in_decimal: str = None + metered_quantity: str = None + last_calculated_at: int = None + unit_price: int = None + unit_price_in_decimal: str = None + amount: int = None + amount_in_decimal: str = None + billing_period: int = None + billing_period_unit: str = None + free_quantity: int = None + free_quantity_in_decimal: str = None + trial_end: int = None + billing_cycles: int = None + service_period_days: int = None + charge_on_event: str = None + charge_once: bool = None + charge_on_option: str = None + proration_type: str = None + + +@dataclass +class ItemTierResponse(Model): + item_price_id: str = None + starting_unit: int = None + ending_unit: int = None + price: int = None + starting_unit_in_decimal: str = None + ending_unit_in_decimal: str = None + price_in_decimal: str = None + index: int = None + + +@dataclass +class ChargedItemResponse(Model): + item_price_id: str = None + last_charged_at: int = None + + +@dataclass +class CouponResponse(Model): + coupon_id: str = None + apply_till: int = None + applied_count: int = None + coupon_code: str = None + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class ReferralInfoResponse(Model): + referral_code: str = None + coupon_code: str = None + referrer_id: str = None + external_reference_id: str = None + reward_status: str = None + referral_system: str = None + account_id: str = None + campaign_id: str = None + external_campaign_id: str = None + friend_offer_type: str = None + referrer_reward_type: str = None + notify_referral_system: str = None + destination_url: str = None + post_purchase_widget_enabled: bool = None + + +@dataclass +class ContractTermResponse(Model): + id: str = None + status: str = None + contract_start: int = None + contract_end: int = None + billing_cycle: int = None + action_at_term_end: str = None + total_contract_value: int = None + total_contract_value_before_tax: int = None + cancellation_cutoff_period: int = None + created_at: int = None + subscription_id: str = None + remaining_billing_cycles: int = None + + +@dataclass +class DiscountResponse(Model): + id: str = None + invoice_name: str = None + type: str = None + percentage: float = None + amount: int = None + currency_code: str = None + duration_type: str = None + period: int = None + period_unit: str = None + included_in_mrr: bool = None + apply_on: str = None + item_price_id: str = None + created_at: int = None + apply_till: int = None + applied_count: int = None + coupon_id: str = None + index: int = None + + +@dataclass +class AddonResponse(Model): + id: str = None + quantity: int = None + unit_price: int = None + amount: int = None + trial_end: int = None + remaining_billing_cycles: int = None + quantity_in_decimal: str = None + unit_price_in_decimal: str = None + amount_in_decimal: str = None + proration_type: str = None + + +@dataclass +class ChargedEventBasedAddonResponse(Model): + id: str = None + last_charged_at: int = None + + +@dataclass +class EventBasedAddonResponse(Model): + id: str = None + quantity: int = None + unit_price: int = None + service_period_in_days: int = None + on_event: str = None + charge_once: bool = None + quantity_in_decimal: str = None + unit_price_in_decimal: str = None + + +@dataclass +class SubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + currency_code: str = None + plan_id: str = None + plan_quantity: int = None + plan_unit_price: int = None + setup_fee: int = None + billing_period: int = None + billing_period_unit: str = None + start_date: int = None + trial_end: int = None + remaining_billing_cycles: int = None + po_number: str = None + auto_collection: str = None + plan_quantity_in_decimal: str = None + plan_unit_price_in_decimal: str = None + customer_id: str = None + plan_amount: int = None + plan_free_quantity: int = None + status: str = None + trial_start: int = None + trial_end_action: str = None + current_term_start: int = None + current_term_end: int = None + next_billing_at: int = None + created_at: int = None + started_at: int = None + activated_at: int = None + gift_id: str = None + contract_term_billing_cycle_on_renewal: int = None + override_relationship: bool = None + pause_date: int = None + resume_date: int = None + cancelled_at: int = None + cancel_reason: str = None + affiliate_token: str = None + created_from_ip: str = None + resource_version: int = None + updated_at: int = None + has_scheduled_advance_invoices: bool = None + has_scheduled_changes: bool = None + payment_source_id: str = None + plan_free_quantity_in_decimal: str = None + plan_amount_in_decimal: str = None + cancel_schedule_created_at: int = None + offline_payment_method: str = None + channel: str = None + net_term_days: int = None + active_id: str = None + subscription_items: List[SubscriptionItemResponse] = None + item_tiers: List[ItemTierResponse] = None + charged_items: List[ChargedItemResponse] = None + due_invoices_count: int = None + due_since: int = None + total_dues: int = None + mrr: int = None + arr: int = None + exchange_rate: float = None + base_currency_code: str = None + addons: List[AddonResponse] = None + event_based_addons: List[EventBasedAddonResponse] = None + charged_event_based_addons: List[ChargedEventBasedAddonResponse] = None + coupon: str = None + coupons: List[CouponResponse] = None + shipping_address: ShippingAddressResponse = None + referral_info: ReferralInfoResponse = None + invoice_notes: str = None + meta_data: Dict[Any, Any] = None + metadata: Dict[Any, Any] = None + deleted: bool = None + changes_scheduled_at: int = None + contract_term: ContractTermResponse = None + cancel_reason_code: str = None + free_period: int = None + free_period_unit: str = None + create_pending_invoices: bool = None + auto_close_invoices: bool = None + discounts: List[DiscountResponse] = None + business_entity_id: str = None + + +@dataclass +class CreateResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateForCustomerResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateWithItemsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListSubscriptionResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + + +@dataclass +class ListResponse: + list: List[ListSubscriptionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class SubscriptionsForCustomerSubscriptionResponse: + subscription: SubscriptionResponse + + +@dataclass +class SubscriptionsForCustomerResponse: + list: List[SubscriptionsForCustomerSubscriptionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ContractTermsForSubscriptionSubscriptionResponse: + contract_term: "contract_term.ContractTermResponse" + + +@dataclass +class ContractTermsForSubscriptionResponse: + list: List[ContractTermsForSubscriptionSubscriptionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListDiscountsSubscriptionResponse: + discount: "discount.DiscountResponse" + + +@dataclass +class ListDiscountsResponse: + list: List[ListDiscountsSubscriptionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveWithScheduledChangesResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveScheduledChangesResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveScheduledCancellationResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveCouponsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class UpdateForItemsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChangeTermEndResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ReactivateResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class AddChargeAtTermEndResponse: + estimate: "estimate.EstimateResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChargeAddonAtTermEndResponse: + estimate: "estimate.EstimateResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class ChargeFutureRenewalsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + advance_invoice_schedules: List[ + "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" + ] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class EditAdvanceInvoiceScheduleResponse: + advance_invoice_schedules: List[ + "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" + ] + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveAdvanceInvoiceScheduleResponse: + advance_invoice_schedules: List[ + "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" + ] + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveAdvanceInvoiceScheduleResponse: + subscription: SubscriptionResponse + advance_invoice_schedules: List[ + "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" + ] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RegenerateInvoiceResponse: + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportSubscriptionResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportForCustomerResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportContractTermResponse: + contract_term: "contract_term.ContractTermResponse" + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportUnbilledChargesResponse: + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] + response_headers: Dict[Any, Any] = None + + +@dataclass +class ImportForItemsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class OverrideBillingProfileResponse: + subscription: SubscriptionResponse + payment_source: "payment_source.PaymentSourceResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PauseResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CancelForItemsResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + credit_notes: List["credit_note.CreditNoteResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class ResumeResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + invoice: "invoice.InvoiceResponse" = None + unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveScheduledPauseResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RemoveScheduledResumptionResponse: + subscription: SubscriptionResponse + customer: "customer.CustomerResponse" + card: "card.CardResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class MoveResponse: + subscription: SubscriptionResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/subscription/types.py b/chargebee/models/subscription/types.py new file mode 100644 index 0000000..e689ed5 --- /dev/null +++ b/chargebee/models/subscription/types.py @@ -0,0 +1,1283 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, unbilled_charge, payment_intent, invoice + + +class Status(Enum): + FUTURE = "future" + IN_TRIAL = "in_trial" + ACTIVE = "active" + NON_RENEWING = "non_renewing" + PAUSED = "paused" + CANCELLED = "cancelled" + TRANSFERRED = "transferred" + + def __str__(self): + return self.value + + +class CancelReason(Enum): + NOT_PAID = "not_paid" + NO_CARD = "no_card" + FRAUD_REVIEW_FAILED = "fraud_review_failed" + NON_COMPLIANT_EU_CUSTOMER = "non_compliant_eu_customer" + TAX_CALCULATION_FAILED = "tax_calculation_failed" + CURRENCY_INCOMPATIBLE_WITH_GATEWAY = "currency_incompatible_with_gateway" + NON_COMPLIANT_CUSTOMER = "non_compliant_customer" + + def __str__(self): + return self.value + + +class BillingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + +class ReferralInfoRewardStatus(Enum): + PENDING = "pending" + PAID = "paid" + INVALID = "invalid" + + def __str__(self): + return self.value + + +class ContractTermStatus(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + 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 DiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + +class SubscriptionItem(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + metered_quantity: NotRequired[str] + last_calculated_at: NotRequired[int] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + billing_period: NotRequired[int] + billing_period_unit: NotRequired[BillingPeriodUnit] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + 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] + proration_type: NotRequired[enums.ProrationType] + + +class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + +class ChargedItem(TypedDict): + item_price_id: Required[str] + last_charged_at: Required[int] + + +class Coupon(TypedDict): + coupon_id: Required[str] + apply_till: NotRequired[int] + applied_count: Required[int] + coupon_code: NotRequired[str] + + +class ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class ReferralInfo(TypedDict): + referral_code: NotRequired[str] + coupon_code: NotRequired[str] + referrer_id: NotRequired[str] + external_reference_id: NotRequired[str] + reward_status: NotRequired[ReferralInfoRewardStatus] + referral_system: NotRequired[enums.ReferralSystem] + account_id: Required[str] + campaign_id: Required[str] + external_campaign_id: NotRequired[str] + friend_offer_type: NotRequired[enums.FriendOfferType] + referrer_reward_type: NotRequired[enums.ReferrerRewardType] + notify_referral_system: NotRequired[enums.NotifyReferralSystem] + destination_url: NotRequired[str] + post_purchase_widget_enabled: Required[bool] + + +class ContractTerm(TypedDict): + id: Required[str] + status: Required[ContractTermStatus] + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required[ContractTermActionAtTermEnd] + total_contract_value: Required[int] + total_contract_value_before_tax: Required[int] + cancellation_cutoff_period: NotRequired[int] + created_at: Required[int] + subscription_id: Required[str] + remaining_billing_cycles: NotRequired[int] + + +class Discount(TypedDict): + id: Required[str] + invoice_name: NotRequired[str] + type: Required[DiscountType] + percentage: NotRequired[float] + amount: NotRequired[int] + currency_code: NotRequired[str] + duration_type: Required[enums.DurationType] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: Required[bool] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + created_at: Required[int] + apply_till: NotRequired[int] + applied_count: NotRequired[int] + coupon_id: Required[str] + index: Required[int] + + +class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + amount: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] + + +class ChargedEventBasedAddon(TypedDict): + id: Required[str] + last_charged_at: Required[int] + + +class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + unit_price: Required[int] + service_period_in_days: NotRequired[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class Subscriptions(TypedDict): + id: Required[str] + currency_code: Required[str] + plan_id: Required[str] + plan_quantity: Required[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + billing_period: NotRequired[int] + billing_period_unit: NotRequired[BillingPeriodUnit] + start_date: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + po_number: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + customer_id: Required[str] + plan_amount: NotRequired[int] + plan_free_quantity: NotRequired[int] + status: Required[Status] + trial_start: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + current_term_start: NotRequired[int] + current_term_end: NotRequired[int] + next_billing_at: NotRequired[int] + created_at: NotRequired[int] + started_at: NotRequired[int] + activated_at: NotRequired[int] + gift_id: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + override_relationship: NotRequired[bool] + pause_date: NotRequired[int] + resume_date: NotRequired[int] + cancelled_at: NotRequired[int] + cancel_reason: NotRequired[CancelReason] + affiliate_token: NotRequired[str] + created_from_ip: NotRequired[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + has_scheduled_advance_invoices: Required[bool] + has_scheduled_changes: Required[bool] + payment_source_id: NotRequired[str] + plan_free_quantity_in_decimal: NotRequired[str] + plan_amount_in_decimal: NotRequired[str] + cancel_schedule_created_at: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + channel: NotRequired[enums.Channel] + net_term_days: NotRequired[int] + active_id: NotRequired[str] + subscription_items: NotRequired[List[SubscriptionItem]] + item_tiers: NotRequired[List[ItemTier]] + charged_items: NotRequired[List[ChargedItem]] + due_invoices_count: NotRequired[int] + due_since: NotRequired[int] + total_dues: NotRequired[int] + mrr: NotRequired[int] + arr: NotRequired[int] + exchange_rate: NotRequired[float] + base_currency_code: NotRequired[str] + addons: NotRequired[List[Addon]] + event_based_addons: NotRequired[List[EventBasedAddon]] + charged_event_based_addons: NotRequired[List[ChargedEventBasedAddon]] + coupon: NotRequired[str] + coupons: NotRequired[List[Coupon]] + shipping_address: NotRequired[ShippingAddress] + referral_info: NotRequired[ReferralInfo] + invoice_notes: NotRequired[str] + meta_data: NotRequired[Dict[Any, Any]] + metadata: NotRequired[Dict[Any, Any]] + deleted: Required[bool] + changes_scheduled_at: NotRequired[int] + contract_term: NotRequired[ContractTerm] + cancel_reason_code: NotRequired[str] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + create_pending_invoices: NotRequired[bool] + auto_close_invoices: NotRequired[bool] + discounts: NotRequired[List[Discount]] + business_entity_id: NotRequired[str] + + +class CreateCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + net_term_days: NotRequired[int] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + allow_direct_debit: NotRequired[bool] + consolidated_invoicing: NotRequired[bool] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + registered_for_gst: NotRequired[bool] + business_customer_without_vat_number: NotRequired[bool] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + +class CreateEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + standard: NotRequired[str] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class CreateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + +class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class CreateCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class CreateForCustomerAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + +class CreateForCustomerEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + +class CreateForCustomerShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateForCustomerStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateForCustomerPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateForCustomerContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class CreateForCustomerCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class CreateWithItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + +class CreateWithItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class CreateWithItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateWithItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class CreateWithItemsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class CreateWithItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class CreateWithItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + +class CreateWithItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class UpdateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + proration_type: NotRequired[enums.ProrationType] + + +class UpdateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + +class UpdateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class UpdateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + entity_identifier_standard: NotRequired[str] + business_customer_without_vat_number: NotRequired[bool] + registered_for_gst: NotRequired[bool] + + +class UpdateContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class UpdateCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class UpdateForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + proration_type: NotRequired[enums.ProrationType] + + +class UpdateForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + +class UpdateForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class UpdateForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateForItemsPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class UpdateForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class UpdateForItemsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class UpdateForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + entity_identifier_standard: NotRequired[str] + business_customer_without_vat_number: NotRequired[bool] + registered_for_gst: NotRequired[bool] + + +class UpdateForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + contract_start: NotRequired[int] + + +class UpdateForItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class ReactivateContractTermParams(TypedDict): + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class ReactivateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + +class ReactivatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class ChargeFutureRenewalsSpecificDatesScheduleParams(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + +class ChargeFutureRenewalsFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + +class EditAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): + id: NotRequired[str] + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + +class EditAdvanceInvoiceScheduleFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + +class RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): + id: NotRequired[str] + + +class ImportSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + net_term_days: NotRequired[int] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + customer_type: NotRequired[enums.CustomerType] + auto_collection: NotRequired[enums.AutoCollection] + allow_direct_debit: NotRequired[bool] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + +class ImportSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + +class ImportSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + +class ImportSubscriptionChargedEventBasedAddonParams(TypedDict): + id: NotRequired[str] + last_charged_at: NotRequired[int] + + +class ImportSubscriptionContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class ImportSubscriptionCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class ImportSubscriptionPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + +class ImportSubscriptionBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportSubscriptionTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + +class ImportSubscriptionCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class ImportForCustomerAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + +class ImportForCustomerEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + +class ImportForCustomerChargedEventBasedAddonParams(TypedDict): + id: NotRequired[str] + last_charged_at: NotRequired[int] + + +class ImportForCustomerContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class ImportForCustomerTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + +class ImportForCustomerShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportForCustomerCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class ImportContractTermContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + contract_end: NotRequired[int] + status: NotRequired[ContractTermStatus] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + total_contract_value: NotRequired[int] + total_contract_value_before_tax: NotRequired[int] + billing_cycle: NotRequired[int] + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class ImportUnbilledChargesUnbilledChargeParams(TypedDict): + id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + entity_type: Required["unbilled_charge.EntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + use_for_proration: NotRequired[bool] + is_advance_charge: NotRequired[bool] + + +class ImportUnbilledChargesDiscountParams(TypedDict): + unbilled_charge_id: NotRequired[str] + entity_type: NotRequired["invoice.DiscountEntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + +class ImportUnbilledChargesTierParams(TypedDict): + unbilled_charge_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + +class ImportForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + + +class ImportForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + +class ImportForItemsChargedItemParams(TypedDict): + item_price_id: NotRequired[str] + last_charged_at: NotRequired[int] + + +class ImportForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class ImportForItemsContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired[ContractTermActionAtTermEnd] + cancellation_cutoff_period: NotRequired[int] + + +class ImportForItemsTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + +class ImportForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + +class ImportForItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + +class CancelEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + + +class CancelForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + +class ResumePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired["payment_intent.PaymentMethodType"] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/subscription_entitlement/__init__.py b/chargebee/models/subscription_entitlement/__init__.py new file mode 100644 index 0000000..4716d06 --- /dev/null +++ b/chargebee/models/subscription_entitlement/__init__.py @@ -0,0 +1,3 @@ +from .operations import SubscriptionEntitlement +from .responses import SubscriptionEntitlementResponse +from .types import SubscriptionEntitlements, Component, ScheduleStatus diff --git a/chargebee/models/subscription_entitlement/operations.py b/chargebee/models/subscription_entitlement/operations.py new file mode 100644 index 0000000..e6cb466 --- /dev/null +++ b/chargebee/models/subscription_entitlement/operations.py @@ -0,0 +1,51 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class SubscriptionEntitlement: + + class SubscriptionEntitlementsForSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_drafts: NotRequired[bool] + embed: NotRequired[str] + include_scheduled_overrides: NotRequired[bool] + + class SetSubscriptionEntitlementAvailabilityParams(TypedDict): + is_enabled: Required[bool] + subscription_entitlements: Required[ + List[SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams] + ] + + @staticmethod + def subscription_entitlements_for_subscription( + id, + params: SubscriptionEntitlementsForSubscriptionParams = None, + env=None, + headers=None, + ) -> SubscriptionEntitlementsForSubscriptionResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "subscription_entitlements"), + cast(Dict[Any, Any], params), + env, + headers, + SubscriptionEntitlementsForSubscriptionResponse, + ) + + @staticmethod + def set_subscription_entitlement_availability( + id, params: SetSubscriptionEntitlementAvailabilityParams, env=None, headers=None + ) -> SetSubscriptionEntitlementAvailabilityResponse: + return request.send( + "post", + request.uri_path( + "subscriptions", id, "subscription_entitlements/set_availability" + ), + cast(Dict[Any, Any], params), + env, + headers, + SetSubscriptionEntitlementAvailabilityResponse, + ) diff --git a/chargebee/models/subscription_entitlement/responses.py b/chargebee/models/subscription_entitlement/responses.py new file mode 100644 index 0000000..e6351d8 --- /dev/null +++ b/chargebee/models/subscription_entitlement/responses.py @@ -0,0 +1,45 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import entitlement_override + + +@dataclass +class ComponentResponse(Model): + entitlement_overrides: entitlement_override.EntitlementOverrides = None + + +@dataclass +class SubscriptionEntitlementResponse(Model): + raw_data: Dict[Any, Any] = None + subscription_id: str = None + feature_id: str = None + feature_name: str = None + feature_unit: str = None + feature_type: str = None + value: str = None + name: str = None + is_overridden: bool = None + is_enabled: bool = None + effective_from: int = None + schedule_status: str = None + expires_at: int = None + components: ComponentResponse = None + + +@dataclass +class SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementResponse: + subscription_entitlement: SubscriptionEntitlementResponse + + +@dataclass +class SubscriptionEntitlementsForSubscriptionResponse: + list: List[SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class SetSubscriptionEntitlementAvailabilityResponse: + subscription_entitlement: SubscriptionEntitlementResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/subscription_entitlement/types.py b/chargebee/models/subscription_entitlement/types.py new file mode 100644 index 0000000..c951508 --- /dev/null +++ b/chargebee/models/subscription_entitlement/types.py @@ -0,0 +1,36 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import entitlement_override + + +class ScheduleStatus(Enum): + ACTIVATED = "activated" + SCHEDULED = "scheduled" + FAILED = "failed" + + def __str__(self): + return self.value + + +class Component(TypedDict): + entitlement_overrides: NotRequired[entitlement_override.EntitlementOverrides] + + +class SubscriptionEntitlements(TypedDict): + subscription_id: Required[str] + feature_id: NotRequired[str] + feature_name: NotRequired[str] + feature_unit: NotRequired[str] + feature_type: NotRequired[str] + value: NotRequired[str] + name: NotRequired[str] + is_overridden: Required[bool] + is_enabled: Required[bool] + effective_from: NotRequired[int] + schedule_status: NotRequired[ScheduleStatus] + expires_at: NotRequired[int] + components: NotRequired[Component] + + +class SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams(TypedDict): + feature_id: Required[str] diff --git a/chargebee/models/subscription_estimate/__init__.py b/chargebee/models/subscription_estimate/__init__.py new file mode 100644 index 0000000..5223a94 --- /dev/null +++ b/chargebee/models/subscription_estimate/__init__.py @@ -0,0 +1,3 @@ +from .operations import SubscriptionEstimate +from .responses import SubscriptionEstimateResponse +from .types import SubscriptionEstimates, ShippingAddress, ContractTerm, Status diff --git a/chargebee/models/subscription_estimate/operations.py b/chargebee/models/subscription_estimate/operations.py new file mode 100644 index 0000000..1aadf2b --- /dev/null +++ b/chargebee/models/subscription_estimate/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class SubscriptionEstimate: + + pass diff --git a/chargebee/models/subscription_estimate/responses.py b/chargebee/models/subscription_estimate/responses.py new file mode 100644 index 0000000..fc347f3 --- /dev/null +++ b/chargebee/models/subscription_estimate/responses.py @@ -0,0 +1,52 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ShippingAddressResponse(Model): + 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 + index: int = None + + +@dataclass +class ContractTermResponse(Model): + id: str = None + status: str = None + contract_start: int = None + contract_end: int = None + billing_cycle: int = None + action_at_term_end: str = None + total_contract_value: int = None + total_contract_value_before_tax: int = None + cancellation_cutoff_period: int = None + created_at: int = None + subscription_id: str = None + remaining_billing_cycles: int = None + + +@dataclass +class SubscriptionEstimateResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + currency_code: str = None + status: str = None + trial_end_action: str = None + next_billing_at: int = None + pause_date: int = None + resume_date: int = None + shipping_address: ShippingAddressResponse = None + contract_term: ContractTermResponse = None diff --git a/chargebee/models/subscription_estimate/types.py b/chargebee/models/subscription_estimate/types.py new file mode 100644 index 0000000..67a9ec9 --- /dev/null +++ b/chargebee/models/subscription_estimate/types.py @@ -0,0 +1,81 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + FUTURE = "future" + IN_TRIAL = "in_trial" + ACTIVE = "active" + NON_RENEWING = "non_renewing" + PAUSED = "paused" + CANCELLED = "cancelled" + TRANSFERRED = "transferred" + + def __str__(self): + return self.value + + +class ContractTermStatus(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + 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 ShippingAddress(TypedDict): + 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] + index: Required[int] + + +class ContractTerm(TypedDict): + id: Required[str] + status: Required[ContractTermStatus] + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required[ContractTermActionAtTermEnd] + total_contract_value: Required[int] + total_contract_value_before_tax: Required[int] + cancellation_cutoff_period: NotRequired[int] + created_at: Required[int] + subscription_id: Required[str] + remaining_billing_cycles: NotRequired[int] + + +class SubscriptionEstimates(TypedDict): + id: NotRequired[str] + currency_code: Required[str] + status: NotRequired[Status] + trial_end_action: NotRequired[enums.TrialEndAction] + next_billing_at: NotRequired[int] + pause_date: NotRequired[int] + resume_date: NotRequired[int] + shipping_address: NotRequired[ShippingAddress] + contract_term: NotRequired[ContractTerm] diff --git a/chargebee/models/tax_withheld/__init__.py b/chargebee/models/tax_withheld/__init__.py new file mode 100644 index 0000000..12d8138 --- /dev/null +++ b/chargebee/models/tax_withheld/__init__.py @@ -0,0 +1,3 @@ +from .operations import TaxWithheld +from .responses import TaxWithheldResponse +from .types import TaxWithhelds, Type, PaymentMethod diff --git a/chargebee/models/tax_withheld/operations.py b/chargebee/models/tax_withheld/operations.py new file mode 100644 index 0000000..5f47200 --- /dev/null +++ b/chargebee/models/tax_withheld/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class TaxWithheld: + + pass diff --git a/chargebee/models/tax_withheld/responses.py b/chargebee/models/tax_withheld/responses.py new file mode 100644 index 0000000..18a854a --- /dev/null +++ b/chargebee/models/tax_withheld/responses.py @@ -0,0 +1,20 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TaxWithheldResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + user: str = None + reference_number: str = None + description: str = None + type: str = None + payment_method: str = None + date: int = None + currency_code: str = None + amount: int = None + resource_version: int = None + updated_at: int = None + exchange_rate: float = None diff --git a/chargebee/models/tax_withheld/types.py b/chargebee/models/tax_withheld/types.py new file mode 100644 index 0000000..3cafb0d --- /dev/null +++ b/chargebee/models/tax_withheld/types.py @@ -0,0 +1,36 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class Type(Enum): + PAYMENT = "payment" + REFUND = "refund" + + def __str__(self): + return self.value + + +class PaymentMethod(Enum): + CASH = "cash" + CHECK = "check" + CHARGEBACK = "chargeback" + BANK_TRANSFER = "bank_transfer" + OTHER = "other" + + def __str__(self): + return self.value + + +class TaxWithhelds(TypedDict): + id: Required[str] + user: NotRequired[str] + reference_number: NotRequired[str] + description: NotRequired[str] + type: Required[Type] + payment_method: Required[PaymentMethod] + date: NotRequired[int] + currency_code: Required[str] + amount: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + exchange_rate: NotRequired[float] diff --git a/chargebee/models/third_party_payment_method/__init__.py b/chargebee/models/third_party_payment_method/__init__.py new file mode 100644 index 0000000..39b5d0b --- /dev/null +++ b/chargebee/models/third_party_payment_method/__init__.py @@ -0,0 +1,3 @@ +from .operations import ThirdPartyPaymentMethod +from .responses import ThirdPartyPaymentMethodResponse +from .types import ThirdPartyPaymentMethods diff --git a/chargebee/models/third_party_payment_method/operations.py b/chargebee/models/third_party_payment_method/operations.py new file mode 100644 index 0000000..04939e6 --- /dev/null +++ b/chargebee/models/third_party_payment_method/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class ThirdPartyPaymentMethod: + + pass diff --git a/chargebee/models/third_party_payment_method/responses.py b/chargebee/models/third_party_payment_method/responses.py new file mode 100644 index 0000000..80bf0e4 --- /dev/null +++ b/chargebee/models/third_party_payment_method/responses.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ThirdPartyPaymentMethodResponse(Model): + raw_data: Dict[Any, Any] = None + type: str = None + gateway: str = None + gateway_account_id: str = None + reference_id: str = None diff --git a/chargebee/models/third_party_payment_method/types.py b/chargebee/models/third_party_payment_method/types.py new file mode 100644 index 0000000..6311e84 --- /dev/null +++ b/chargebee/models/third_party_payment_method/types.py @@ -0,0 +1,9 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums + + +class ThirdPartyPaymentMethods(TypedDict): + type: Required[enums.Type] + gateway: Required[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: Required[str] diff --git a/chargebee/models/time_machine/__init__.py b/chargebee/models/time_machine/__init__.py new file mode 100644 index 0000000..1044951 --- /dev/null +++ b/chargebee/models/time_machine/__init__.py @@ -0,0 +1,3 @@ +from .operations import TimeMachine +from .responses import TimeMachineResponse +from .types import TimeMachines, TimeTravelStatus diff --git a/chargebee/models/time_machine/operations.py b/chargebee/models/time_machine/operations.py new file mode 100644 index 0000000..79d016b --- /dev/null +++ b/chargebee/models/time_machine/operations.py @@ -0,0 +1,52 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +import json +from chargebee import OperationFailedError + + +class TimeMachine: + + class StartAfreshParams(TypedDict): + genesis_time: NotRequired[int] + + class TravelForwardParams(TypedDict): + destination_time: NotRequired[int] + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("time_machines", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def start_afresh( + id, params: StartAfreshParams = None, env=None, headers=None + ) -> StartAfreshResponse: + return request.send( + "post", + request.uri_path("time_machines", id, "start_afresh"), + cast(Dict[Any, Any], params), + env, + headers, + StartAfreshResponse, + ) + + @staticmethod + def travel_forward( + id, params: TravelForwardParams = None, env=None, headers=None + ) -> TravelForwardResponse: + return request.send( + "post", + request.uri_path("time_machines", id, "travel_forward"), + cast(Dict[Any, Any], params), + env, + headers, + TravelForwardResponse, + ) diff --git a/chargebee/models/time_machine/responses.py b/chargebee/models/time_machine/responses.py new file mode 100644 index 0000000..1f2eea1 --- /dev/null +++ b/chargebee/models/time_machine/responses.py @@ -0,0 +1,33 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TimeMachineResponse(Model): + raw_data: Dict[Any, Any] = None + name: str = None + time_travel_status: str = None + genesis_time: int = None + destination_time: int = None + failure_code: str = None + failure_reason: str = None + error_json: str = None + + +@dataclass +class RetrieveResponse: + time_machine: TimeMachineResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class StartAfreshResponse: + time_machine: TimeMachineResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class TravelForwardResponse: + time_machine: TimeMachineResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/time_machine/types.py b/chargebee/models/time_machine/types.py new file mode 100644 index 0000000..a1b5f99 --- /dev/null +++ b/chargebee/models/time_machine/types.py @@ -0,0 +1,22 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum + + +class TimeTravelStatus(Enum): + NOT_ENABLED = "not_enabled" + IN_PROGRESS = "in_progress" + SUCCEEDED = "succeeded" + FAILED = "failed" + + def __str__(self): + return self.value + + +class TimeMachines(TypedDict): + name: Required[str] + time_travel_status: Required[TimeTravelStatus] + genesis_time: Required[int] + destination_time: Required[int] + failure_code: NotRequired[str] + failure_reason: NotRequired[str] + error_json: NotRequired[str] diff --git a/chargebee/models/token/__init__.py b/chargebee/models/token/__init__.py new file mode 100644 index 0000000..869d7c6 --- /dev/null +++ b/chargebee/models/token/__init__.py @@ -0,0 +1,3 @@ +from .operations import Token +from .responses import TokenResponse +from .types import Tokens, Status, Vault diff --git a/chargebee/models/token/operations.py b/chargebee/models/token/operations.py new file mode 100644 index 0000000..4c19d1f --- /dev/null +++ b/chargebee/models/token/operations.py @@ -0,0 +1,9 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any + + +class Token: + + pass diff --git a/chargebee/models/token/responses.py b/chargebee/models/token/responses.py new file mode 100644 index 0000000..4c9ec46 --- /dev/null +++ b/chargebee/models/token/responses.py @@ -0,0 +1,20 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class TokenResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + gateway: str = None + gateway_account_id: str = None + payment_method_type: str = None + status: str = None + id_at_vault: str = None + vault: str = None + ip_address: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + expired_at: int = None diff --git a/chargebee/models/token/types.py b/chargebee/models/token/types.py new file mode 100644 index 0000000..834d8f6 --- /dev/null +++ b/chargebee/models/token/types.py @@ -0,0 +1,35 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Status(Enum): + NEW = "new" + EXPIRED = "expired" + CONSUMED = "consumed" + + def __str__(self): + return self.value + + +class Vault(Enum): + SPREEDLY = "spreedly" + GATEWAY = "gateway" + + def __str__(self): + return self.value + + +class Tokens(TypedDict): + id: Required[str] + gateway: Required[enums.Gateway] + gateway_account_id: Required[str] + payment_method_type: Required[enums.PaymentMethodType] + status: Required[Status] + id_at_vault: Required[str] + vault: Required[Vault] + ip_address: NotRequired[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + expired_at: NotRequired[int] diff --git a/chargebee/models/transaction/__init__.py b/chargebee/models/transaction/__init__.py new file mode 100644 index 0000000..8bd53b8 --- /dev/null +++ b/chargebee/models/transaction/__init__.py @@ -0,0 +1,15 @@ +from .operations import Transaction +from .responses import TransactionResponse +from .types import ( + Transactions, + LinkedInvoice, + LinkedCreditNote, + LinkedRefund, + LinkedPayment, + GatewayErrorDetail, + Type, + Status, + FraudFlag, + InitiatorType, + AuthorizationReason, +) diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py new file mode 100644 index 0000000..dbc9827 --- /dev/null +++ b/chargebee/models/transaction/operations.py @@ -0,0 +1,204 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Transaction: + + class CreateAuthorizationParams(TypedDict): + customer_id: Required[str] + payment_source_id: NotRequired[str] + currency_code: NotRequired[str] + amount: Required[int] + + class RecordRefundParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + date: Required[int] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + comment: NotRequired[str] + + class ReconcileParams(TypedDict): + id_at_gateway: NotRequired[str] + customer_id: NotRequired[str] + status: NotRequired[Status] + + class RefundParams(TypedDict): + amount: NotRequired[int] + comment: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + payment_source_id: NotRequired[Filters.StringFilter] + payment_method: NotRequired[Filters.EnumFilter] + gateway: NotRequired[Filters.EnumFilter] + gateway_account_id: NotRequired[Filters.StringFilter] + id_at_gateway: NotRequired[Filters.StringFilter] + reference_number: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + amount: NotRequired[Filters.NumberFilter] + amount_capturable: NotRequired[Filters.NumberFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + sort_by: NotRequired[Filters.SortFilter] + + class TransactionsForCustomerParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class TransactionsForSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class PaymentsForInvoiceParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + class DeleteOfflineTransactionParams(TypedDict): + comment: NotRequired[str] + + @staticmethod + def create_authorization( + params: CreateAuthorizationParams, env=None, headers=None + ) -> CreateAuthorizationResponse: + return request.send( + "post", + request.uri_path("transactions", "create_authorization"), + cast(Dict[Any, Any], params), + env, + headers, + CreateAuthorizationResponse, + ) + + @staticmethod + def void_transaction(id, env=None, headers=None) -> VoidTransactionResponse: + return request.send( + "post", + request.uri_path("transactions", id, "void"), + None, + env, + headers, + VoidTransactionResponse, + ) + + @staticmethod + def record_refund( + id, params: RecordRefundParams, env=None, headers=None + ) -> RecordRefundResponse: + return request.send( + "post", + request.uri_path("transactions", id, "record_refund"), + cast(Dict[Any, Any], params), + env, + headers, + RecordRefundResponse, + ) + + @staticmethod + def reconcile( + id, params: ReconcileParams = None, env=None, headers=None + ) -> ReconcileResponse: + return request.send( + "post", + request.uri_path("transactions", id, "reconcile"), + cast(Dict[Any, Any], params), + env, + headers, + ReconcileResponse, + ) + + @staticmethod + def refund( + id, params: RefundParams = None, env=None, headers=None + ) -> RefundResponse: + return request.send( + "post", + request.uri_path("transactions", id, "refund"), + cast(Dict[Any, Any], params), + env, + headers, + RefundResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("transactions"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def transactions_for_customer( + id, params: TransactionsForCustomerParams = None, env=None, headers=None + ) -> TransactionsForCustomerResponse: + return request.send( + "get", + request.uri_path("customers", id, "transactions"), + cast(Dict[Any, Any], params), + env, + headers, + TransactionsForCustomerResponse, + ) + + @staticmethod + def transactions_for_subscription( + id, params: TransactionsForSubscriptionParams = None, env=None, headers=None + ) -> TransactionsForSubscriptionResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "transactions"), + cast(Dict[Any, Any], params), + env, + headers, + TransactionsForSubscriptionResponse, + ) + + @staticmethod + def payments_for_invoice( + id, params: PaymentsForInvoiceParams = None, env=None, headers=None + ) -> PaymentsForInvoiceResponse: + return request.send( + "get", + request.uri_path("invoices", id, "payments"), + cast(Dict[Any, Any], params), + env, + headers, + PaymentsForInvoiceResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("transactions", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def delete_offline_transaction( + id, params: DeleteOfflineTransactionParams = None, env=None, headers=None + ) -> DeleteOfflineTransactionResponse: + return request.send( + "post", + request.uri_path("transactions", id, "delete_offline_transaction"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteOfflineTransactionResponse, + ) diff --git a/chargebee/models/transaction/responses.py b/chargebee/models/transaction/responses.py new file mode 100644 index 0000000..7cf27cb --- /dev/null +++ b/chargebee/models/transaction/responses.py @@ -0,0 +1,201 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import credit_note, invoice, transaction + + +@dataclass +class LinkedInvoiceResponse(Model): + invoice_id: str = None + applied_amount: int = None + applied_at: int = None + invoice_date: int = None + invoice_total: int = None + invoice_status: str = None + + +@dataclass +class LinkedCreditNoteResponse(Model): + cn_id: str = None + applied_amount: int = None + applied_at: int = None + cn_reason_code: str = None + cn_create_reason_code: str = None + cn_date: int = None + cn_total: int = None + cn_status: str = None + cn_reference_invoice_id: str = None + + +@dataclass +class LinkedRefundResponse(Model): + txn_id: str = None + txn_status: str = None + txn_date: int = None + txn_amount: int = None + + +@dataclass +class LinkedPaymentResponse(Model): + id: str = None + status: str = None + amount: int = None + date: int = None + + +@dataclass +class GatewayErrorDetailResponse(Model): + request_id: str = None + error_category: str = None + error_code: str = None + error_message: str = None + decline_code: str = None + decline_message: str = None + network_error_code: str = None + network_error_message: str = None + error_field: str = None + recommendation_code: str = None + recommendation_message: str = None + processor_error_code: str = None + processor_error_message: str = None + + +@dataclass +class TransactionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + subscription_id: str = None + gateway_account_id: str = None + payment_source_id: str = None + payment_method: str = None + reference_number: str = None + gateway: str = None + type: str = None + date: int = None + settled_at: int = None + exchange_rate: float = None + currency_code: str = None + amount: int = None + id_at_gateway: str = None + status: str = None + fraud_flag: str = None + initiator_type: str = None + three_d_secure: bool = None + authorization_reason: str = None + error_code: str = None + error_text: str = None + voided_at: int = None + resource_version: int = None + updated_at: int = None + fraud_reason: str = None + custom_payment_method_id: str = None + amount_unused: int = None + masked_card_number: str = None + reference_transaction_id: str = None + refunded_txn_id: str = None + reference_authorization_id: str = None + amount_capturable: int = None + reversal_transaction_id: str = None + linked_invoices: List[LinkedInvoiceResponse] = None + linked_credit_notes: List[LinkedCreditNoteResponse] = None + linked_refunds: List[LinkedRefundResponse] = None + linked_payments: List[LinkedPaymentResponse] = None + deleted: bool = None + iin: str = None + last4: str = None + merchant_reference_id: str = None + business_entity_id: str = None + payment_method_details: str = None + error_detail: GatewayErrorDetailResponse = None + custom_payment_method_name: str = None + + +@dataclass +class CreateAuthorizationResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class VoidTransactionResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RecordRefundResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ReconcileResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RefundResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListTransactionResponse: + transaction: TransactionResponse + + +@dataclass +class ListResponse: + list: List[ListTransactionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class TransactionsForCustomerTransactionResponse: + transaction: TransactionResponse + + +@dataclass +class TransactionsForCustomerResponse: + list: List[TransactionsForCustomerTransactionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class TransactionsForSubscriptionTransactionResponse: + transaction: TransactionResponse + + +@dataclass +class TransactionsForSubscriptionResponse: + list: List[TransactionsForSubscriptionTransactionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PaymentsForInvoiceTransactionResponse: + transaction: TransactionResponse + + +@dataclass +class PaymentsForInvoiceResponse: + list: List[PaymentsForInvoiceTransactionResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteOfflineTransactionResponse: + transaction: TransactionResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/transaction/types.py b/chargebee/models/transaction/types.py new file mode 100644 index 0000000..ea11719 --- /dev/null +++ b/chargebee/models/transaction/types.py @@ -0,0 +1,162 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums, credit_note, invoice, transaction + + +class Type(Enum): + AUTHORIZATION = "authorization" + PAYMENT = "payment" + REFUND = "refund" + PAYMENT_REVERSAL = "payment_reversal" + + def __str__(self): + return self.value + + +class Status(Enum): + IN_PROGRESS = "in_progress" + SUCCESS = "success" + VOIDED = "voided" + FAILURE = "failure" + TIMEOUT = "timeout" + NEEDS_ATTENTION = "needs_attention" + + def __str__(self): + return self.value + + +class FraudFlag(Enum): + SAFE = "safe" + SUSPICIOUS = "suspicious" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + +class InitiatorType(Enum): + CUSTOMER = "customer" + MERCHANT = "merchant" + + def __str__(self): + return self.value + + +class AuthorizationReason(Enum): + BLOCKING_FUNDS = "blocking_funds" + VERIFICATION = "verification" + + def __str__(self): + return self.value + + +class LinkedPaymentStatus(Enum): + IN_PROGRESS = "in_progress" + SUCCESS = "success" + VOIDED = "voided" + FAILURE = "failure" + TIMEOUT = "timeout" + NEEDS_ATTENTION = "needs_attention" + + def __str__(self): + return self.value + + +class LinkedInvoice(TypedDict): + invoice_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + invoice_date: NotRequired[int] + invoice_total: NotRequired[int] + invoice_status: Required["invoice.Status"] + + +class LinkedCreditNote(TypedDict): + cn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + cn_reason_code: NotRequired["credit_note.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.Status"] + cn_reference_invoice_id: Required[str] + + +class LinkedRefund(TypedDict): + txn_id: Required[str] + txn_status: Required["transaction.Status"] + txn_date: Required[int] + txn_amount: Required[int] + + +class LinkedPayment(TypedDict): + id: Required[str] + status: NotRequired[LinkedPaymentStatus] + amount: NotRequired[int] + date: NotRequired[int] + + +class GatewayErrorDetail(TypedDict): + request_id: NotRequired[str] + error_category: NotRequired[str] + error_code: NotRequired[str] + error_message: NotRequired[str] + decline_code: NotRequired[str] + decline_message: NotRequired[str] + network_error_code: NotRequired[str] + network_error_message: NotRequired[str] + error_field: NotRequired[str] + recommendation_code: NotRequired[str] + recommendation_message: NotRequired[str] + processor_error_code: NotRequired[str] + processor_error_message: NotRequired[str] + + +class Transactions(TypedDict): + id: Required[str] + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + gateway_account_id: NotRequired[str] + payment_source_id: NotRequired[str] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + gateway: Required[enums.Gateway] + type: Required[Type] + date: NotRequired[int] + settled_at: NotRequired[int] + exchange_rate: NotRequired[float] + currency_code: Required[str] + amount: NotRequired[int] + id_at_gateway: NotRequired[str] + status: NotRequired[Status] + fraud_flag: NotRequired[FraudFlag] + initiator_type: NotRequired[InitiatorType] + three_d_secure: NotRequired[bool] + authorization_reason: NotRequired[AuthorizationReason] + error_code: NotRequired[str] + error_text: NotRequired[str] + voided_at: NotRequired[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + fraud_reason: NotRequired[str] + custom_payment_method_id: NotRequired[str] + amount_unused: NotRequired[int] + masked_card_number: NotRequired[str] + reference_transaction_id: NotRequired[str] + refunded_txn_id: NotRequired[str] + reference_authorization_id: NotRequired[str] + amount_capturable: NotRequired[int] + reversal_transaction_id: NotRequired[str] + linked_invoices: NotRequired[List[LinkedInvoice]] + linked_credit_notes: NotRequired[List[LinkedCreditNote]] + linked_refunds: NotRequired[List[LinkedRefund]] + linked_payments: NotRequired[List[LinkedPayment]] + deleted: Required[bool] + iin: NotRequired[str] + last4: NotRequired[str] + merchant_reference_id: NotRequired[str] + business_entity_id: NotRequired[str] + payment_method_details: NotRequired[str] + error_detail: NotRequired[GatewayErrorDetail] + custom_payment_method_name: NotRequired[str] diff --git a/chargebee/models/unbilled_charge/__init__.py b/chargebee/models/unbilled_charge/__init__.py new file mode 100644 index 0000000..2e87b72 --- /dev/null +++ b/chargebee/models/unbilled_charge/__init__.py @@ -0,0 +1,3 @@ +from .operations import UnbilledCharge +from .responses import UnbilledChargeResponse +from .types import UnbilledCharges, Tier, EntityType diff --git a/chargebee/models/unbilled_charge/operations.py b/chargebee/models/unbilled_charge/operations.py new file mode 100644 index 0000000..0fe1b56 --- /dev/null +++ b/chargebee/models/unbilled_charge/operations.py @@ -0,0 +1,113 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class UnbilledCharge: + + class CreateUnbilledChargeParams(TypedDict): + subscription_id: Required[str] + currency_code: NotRequired[str] + addons: NotRequired[List[CreateUnbilledChargeAddonParams]] + charges: NotRequired[List[CreateUnbilledChargeChargeParams]] + tax_providers_fields: NotRequired[ + List[CreateUnbilledChargeTaxProvidersFieldParams] + ] + + class CreateParams(TypedDict): + subscription_id: Required[str] + currency_code: NotRequired[str] + item_prices: NotRequired[List[CreateItemPriceParams]] + item_tiers: NotRequired[List[CreateItemTierParams]] + charges: NotRequired[List[CreateChargeParams]] + tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + + class InvoiceUnbilledChargesParams(TypedDict): + subscription_id: NotRequired[str] + customer_id: NotRequired[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + include_deleted: NotRequired[bool] + is_voided: NotRequired[bool] + subscription_id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + + class InvoiceNowEstimateParams(TypedDict): + subscription_id: NotRequired[str] + customer_id: NotRequired[str] + + @staticmethod + def create_unbilled_charge( + params: CreateUnbilledChargeParams, env=None, headers=None + ) -> CreateUnbilledChargeResponse: + return request.send( + "post", + request.uri_path("unbilled_charges", "create"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUnbilledChargeResponse, + ) + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("unbilled_charges"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def invoice_unbilled_charges( + params: InvoiceUnbilledChargesParams = None, env=None, headers=None + ) -> InvoiceUnbilledChargesResponse: + return request.send( + "post", + request.uri_path("unbilled_charges", "invoice_unbilled_charges"), + cast(Dict[Any, Any], params), + env, + headers, + InvoiceUnbilledChargesResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("unbilled_charges", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("unbilled_charges"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def invoice_now_estimate( + params: InvoiceNowEstimateParams = None, env=None, headers=None + ) -> InvoiceNowEstimateResponse: + return request.send( + "post", + request.uri_path("unbilled_charges", "invoice_now_estimate"), + cast(Dict[Any, Any], params), + env, + headers, + InvoiceNowEstimateResponse, + ) diff --git a/chargebee/models/unbilled_charge/responses.py b/chargebee/models/unbilled_charge/responses.py new file mode 100644 index 0000000..cc1693c --- /dev/null +++ b/chargebee/models/unbilled_charge/responses.py @@ -0,0 +1,87 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import estimate, invoice + + +@dataclass +class TierResponse(Model): + 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 + + +@dataclass +class UnbilledChargeResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + subscription_id: str = None + date_from: int = None + date_to: int = None + unit_amount: int = None + pricing_model: str = None + quantity: int = None + amount: int = None + currency_code: str = None + discount_amount: int = None + description: str = None + entity_type: str = None + entity_id: str = None + is_voided: bool = None + voided_at: int = None + unit_amount_in_decimal: str = None + quantity_in_decimal: str = None + amount_in_decimal: str = None + updated_at: int = None + tiers: List[TierResponse] = None + is_advance_charge: bool = None + business_entity_id: str = None + deleted: bool = None + + +@dataclass +class CreateUnbilledChargeResponse: + unbilled_charges: List[UnbilledChargeResponse] + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + unbilled_charges: List[UnbilledChargeResponse] + response_headers: Dict[Any, Any] = None + + +@dataclass +class InvoiceUnbilledChargesResponse: + invoices: List["invoice.InvoiceResponse"] + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + unbilled_charge: UnbilledChargeResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListUnbilledChargeResponse: + unbilled_charge: UnbilledChargeResponse + + +@dataclass +class ListResponse: + list: List[ListUnbilledChargeResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class InvoiceNowEstimateResponse: + estimate: "estimate.EstimateResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/unbilled_charge/types.py b/chargebee/models/unbilled_charge/types.py new file mode 100644 index 0000000..1a92acf --- /dev/null +++ b/chargebee/models/unbilled_charge/types.py @@ -0,0 +1,128 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class EntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + +class Tier(TypedDict): + 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] + + +class UnbilledCharges(TypedDict): + id: NotRequired[str] + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + unit_amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + quantity: NotRequired[int] + amount: NotRequired[int] + currency_code: Required[str] + discount_amount: NotRequired[int] + description: NotRequired[str] + entity_type: Required[EntityType] + entity_id: NotRequired[str] + is_voided: Required[bool] + voided_at: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + updated_at: Required[int] + tiers: NotRequired[List[Tier]] + is_advance_charge: NotRequired[bool] + business_entity_id: NotRequired[str] + deleted: Required[bool] + + +class CreateUnbilledChargeAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateUnbilledChargeChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateUnbilledChargeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + +class CreateItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + +class CreateChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + +class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] diff --git a/chargebee/models/usage/__init__.py b/chargebee/models/usage/__init__.py new file mode 100644 index 0000000..cd7694b --- /dev/null +++ b/chargebee/models/usage/__init__.py @@ -0,0 +1,3 @@ +from .operations import Usage +from .responses import UsageResponse +from .types import Usages diff --git a/chargebee/models/usage/operations.py b/chargebee/models/usage/operations.py new file mode 100644 index 0000000..e44eda7 --- /dev/null +++ b/chargebee/models/usage/operations.py @@ -0,0 +1,95 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class Usage: + + class CreateParams(TypedDict): + id: NotRequired[str] + item_price_id: Required[str] + quantity: Required[str] + usage_date: Required[int] + dedupe_option: NotRequired[enums.DedupeOption] + note: NotRequired[str] + + class RetrieveParams(TypedDict): + id: Required[str] + + class DeleteParams(TypedDict): + id: Required[str] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + usage_date: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + item_price_id: NotRequired[Filters.StringFilter] + invoice_id: NotRequired[Filters.StringFilter] + source: NotRequired[Filters.EnumFilter] + sort_by: NotRequired[Filters.SortFilter] + + class PdfParams(TypedDict): + invoice: Required[PdfInvoiceParams] + disposition_type: NotRequired[enums.DispositionType] + + @staticmethod + def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "usages"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve( + id, params: RetrieveParams, env=None, headers=None + ) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("subscriptions", id, "usages"), + cast(Dict[Any, Any], params), + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("subscriptions", id, "delete_usage"), + cast(Dict[Any, Any], params), + env, + headers, + DeleteResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("usages"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def pdf(params: PdfParams, env=None, headers=None) -> PdfResponse: + return request.send( + "post", + request.uri_path("usages", "pdf"), + cast(Dict[Any, Any], params), + env, + headers, + PdfResponse, + ) diff --git a/chargebee/models/usage/responses.py b/chargebee/models/usage/responses.py new file mode 100644 index 0000000..c8822ea --- /dev/null +++ b/chargebee/models/usage/responses.py @@ -0,0 +1,57 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import download + + +@dataclass +class UsageResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + usage_date: int = None + subscription_id: str = None + item_price_id: str = None + invoice_id: str = None + line_item_id: str = None + quantity: str = None + source: str = None + note: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + + +@dataclass +class CreateResponse: + usage: UsageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + usage: UsageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + usage: UsageResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListUsageResponse: + usage: UsageResponse + + +@dataclass +class ListResponse: + list: List[ListUsageResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class PdfResponse: + download: "download.DownloadResponse" + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/usage/types.py b/chargebee/models/usage/types.py new file mode 100644 index 0000000..7a18702 --- /dev/null +++ b/chargebee/models/usage/types.py @@ -0,0 +1,21 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from chargebee.models import enums + + +class Usages(TypedDict): + id: NotRequired[str] + usage_date: Required[int] + subscription_id: Required[str] + item_price_id: Required[str] + invoice_id: NotRequired[str] + line_item_id: NotRequired[str] + quantity: Required[str] + source: NotRequired[enums.Source] + note: NotRequired[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + + +class PdfInvoiceParams(TypedDict): + id: Required[str] diff --git a/chargebee/models/virtual_bank_account/__init__.py b/chargebee/models/virtual_bank_account/__init__.py new file mode 100644 index 0000000..313ba02 --- /dev/null +++ b/chargebee/models/virtual_bank_account/__init__.py @@ -0,0 +1,3 @@ +from .operations import VirtualBankAccount +from .responses import VirtualBankAccountResponse +from .types import VirtualBankAccounts, Scheme diff --git a/chargebee/models/virtual_bank_account/operations.py b/chargebee/models/virtual_bank_account/operations.py new file mode 100644 index 0000000..866e73a --- /dev/null +++ b/chargebee/models/virtual_bank_account/operations.py @@ -0,0 +1,93 @@ +from .types import * +from .responses import * +from chargebee import request +from typing import cast, Any +from chargebee.filters import Filters + + +class VirtualBankAccount: + + class CreateUsingPermanentTokenParams(TypedDict): + customer_id: Required[str] + reference_id: Required[str] + scheme: NotRequired[Scheme] + + class CreateParams(TypedDict): + customer_id: Required[str] + email: NotRequired[str] + scheme: NotRequired[Scheme] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + customer_id: NotRequired[Filters.StringFilter] + updated_at: NotRequired[Filters.TimestampFilter] + created_at: NotRequired[Filters.TimestampFilter] + + @staticmethod + def create_using_permanent_token( + params: CreateUsingPermanentTokenParams, env=None, headers=None + ) -> CreateUsingPermanentTokenResponse: + return request.send( + "post", + request.uri_path("virtual_bank_accounts", "create_using_permanent_token"), + cast(Dict[Any, Any], params), + env, + headers, + CreateUsingPermanentTokenResponse, + ) + + @staticmethod + def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("virtual_bank_accounts"), + cast(Dict[Any, Any], params), + env, + headers, + CreateResponse, + ) + + @staticmethod + def retrieve(id, env=None, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("virtual_bank_accounts", id), + None, + env, + headers, + RetrieveResponse, + ) + + @staticmethod + def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("virtual_bank_accounts"), + cast(Dict[Any, Any], params), + env, + headers, + ListResponse, + ) + + @staticmethod + def delete(id, env=None, headers=None) -> DeleteResponse: + return request.send( + "post", + request.uri_path("virtual_bank_accounts", id, "delete"), + None, + env, + headers, + DeleteResponse, + ) + + @staticmethod + def delete_local(id, env=None, headers=None) -> DeleteLocalResponse: + return request.send( + "post", + request.uri_path("virtual_bank_accounts", id, "delete_local"), + None, + env, + headers, + DeleteLocalResponse, + ) diff --git a/chargebee/models/virtual_bank_account/responses.py b/chargebee/models/virtual_bank_account/responses.py new file mode 100644 index 0000000..ebef004 --- /dev/null +++ b/chargebee/models/virtual_bank_account/responses.py @@ -0,0 +1,68 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import customer, transaction + + +@dataclass +class VirtualBankAccountResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + email: str = None + scheme: str = None + bank_name: str = None + account_number: str = None + routing_number: str = None + swift_code: str = None + gateway: str = None + gateway_account_id: str = None + resource_version: int = None + updated_at: int = None + created_at: int = None + reference_id: str = None + deleted: bool = None + + +@dataclass +class CreateUsingPermanentTokenResponse: + virtual_bank_account: VirtualBankAccountResponse + customer: "customer.CustomerResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class CreateResponse: + virtual_bank_account: VirtualBankAccountResponse + customer: "customer.CustomerResponse" = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class RetrieveResponse: + virtual_bank_account: VirtualBankAccountResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class ListVirtualBankAccountResponse: + virtual_bank_account: VirtualBankAccountResponse + + +@dataclass +class ListResponse: + list: List[ListVirtualBankAccountResponse] + next_offset: str = None + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteResponse: + virtual_bank_account: VirtualBankAccountResponse + response_headers: Dict[Any, Any] = None + + +@dataclass +class DeleteLocalResponse: + virtual_bank_account: VirtualBankAccountResponse + response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/virtual_bank_account/types.py b/chargebee/models/virtual_bank_account/types.py new file mode 100644 index 0000000..8977c3a --- /dev/null +++ b/chargebee/models/virtual_bank_account/types.py @@ -0,0 +1,34 @@ +from typing import TypedDict, Required, NotRequired, Dict, List, Any +from enum import Enum +from chargebee.models import enums + + +class Scheme(Enum): + ACH_CREDIT = "ach_credit" + SEPA_CREDIT = "sepa_credit" + US_AUTOMATED_BANK_TRANSFER = "us_automated_bank_transfer" + GB_AUTOMATED_BANK_TRANSFER = "gb_automated_bank_transfer" + EU_AUTOMATED_BANK_TRANSFER = "eu_automated_bank_transfer" + JP_AUTOMATED_BANK_TRANSFER = "jp_automated_bank_transfer" + MX_AUTOMATED_BANK_TRANSFER = "mx_automated_bank_transfer" + + def __str__(self): + return self.value + + +class VirtualBankAccounts(TypedDict): + id: Required[str] + customer_id: Required[str] + email: Required[str] + scheme: NotRequired[Scheme] + bank_name: NotRequired[str] + account_number: Required[str] + routing_number: NotRequired[str] + swift_code: Required[str] + gateway: Required[enums.Gateway] + gateway_account_id: Required[str] + resource_version: NotRequired[int] + updated_at: NotRequired[int] + created_at: Required[int] + reference_id: Required[str] + deleted: Required[bool] diff --git a/chargebee/request.py b/chargebee/request.py new file mode 100644 index 0000000..32b86cb --- /dev/null +++ b/chargebee/request.py @@ -0,0 +1,62 @@ +import urllib +from chargebee import util, http_request +from chargebee.main import ChargeBee +from chargebee import compat +import json + + +def lowercase_keys(data): + if isinstance(data, dict): + return {k.lower(): lowercase_keys(v) for k, v in data.items()} + elif isinstance(data, list): + return [lowercase_keys(item) for item in data] + else: + return data + + +def send_list_request( + method, url, params=None, env=None, headers=None, response_type=None +): + serialized = {} + + if params is None: + params = {} + + for k, v in list(params.items()): + if isinstance(v, list): + v = json.dumps(v) + serialized.update({k: v}) + return send(method, url, serialized, env, headers, response_type) + + +def send(method, url, params=None, env=None, headers=None, response_type=None): + params = lowercase_keys(params) + + if params is None: + params = {} + + env = env or ChargeBee.default_env + + ser_params = util.serialize(params) + + response, response_headers = http_request.request( + method, url, env, ser_params, headers + ) + + from chargebee.responses import Response + + if "list" in response: + return Response(response_type, response, response_headers).parse_list_response() + return Response(response_type, response, response_headers).parse_response() + + +def uri_path(*paths): + url = "" + for path in paths: + if path is None or len(str(path).strip()) < 1: + raise Exception("Id is None or empty") + if compat.py_major_v >= 3: + url = url + "/" + urllib.parse.quote(str(path).strip()) + else: + url = url + "/" + urllib.quote(str(util.get_val(path))) + return url diff --git a/chargebee/responses.py b/chargebee/responses.py new file mode 100644 index 0000000..f2690bc --- /dev/null +++ b/chargebee/responses.py @@ -0,0 +1,87 @@ +from dataclasses import fields +from typing import Type, TypeVar + +T = TypeVar("T") + + +def _is_primitive(field_type): + return field_type in (int, str, float, bool) + + +class Response(object): + IDEMPOTENCY_REPLAYED_HEADER = "chargebee-idempotency-replayed" + + def __init__(self, response_type: Type[T], response, response_header=None): + self._response = response + if "list" in response: + self._response = response["list"] + self._next_offset = response.get("next_offset", None) + self._response_header = response_header + self._response_type = response_type + self.is_idempotency_replayed() + + def is_idempotency_replayed(self): + self._response_header[self.IDEMPOTENCY_REPLAYED_HEADER] = bool( + self._response_header.get(self.IDEMPOTENCY_REPLAYED_HEADER, False) + ) + + def parse_response(self) -> T: + init_data = {} + for field in fields(self._response_type): + field_name = field.name + field_type = field.type + + if field_name in self._response: + if hasattr(field_type, "__origin__") and field_type.__origin__ == list: + list_data = [] + for response in self._response: + data = {} + for inner_field in fields(field_type.__args__[0]): + inner_field_name = inner_field.name + inner_field_type = inner_field.type + if inner_field_name in response: + if _is_primitive(inner_field_type): + data[inner_field_name] = response[inner_field_name] + else: + data[inner_field_name] = inner_field_type.construct( + response[inner_field_name] + ) + list_data.append(field_type.__args__[0](**data)) + init_data[field_name] = list_data + elif _is_primitive(field_type): + init_data[field_name] = self._response[field_name] + else: + init_data[field_name] = field_type.construct( + self._response[field_name] + ) + + init_data["response_headers"] = self._response_header + return self._response_type(**init_data) + + def parse_list_response(self) -> T: + result = {} + for field in fields(self._response_type): + field_name = field.name + field_type = field.type + + if hasattr(field_type, "__origin__") and field_type.__origin__ == list: + list_data = [] + for response in self._response: + data = {} + for inner_field in fields(field_type.__args__[0]): + inner_field_name = inner_field.name + inner_field_type = inner_field.type + if inner_field_name in response: + if _is_primitive(inner_field_type): + data[inner_field_name] = response[inner_field_name] + else: + data[inner_field_name] = inner_field_type.construct( + response[inner_field_name] + ) + list_data.append(field_type.__args__[0](**data)) + + result[field_name] = list_data + result["next_offset"] = self._next_offset + result["response_headers"] = self._response_header + + return self._response_type(**result) diff --git a/chargebee/ssl/ca-certs.crt b/chargebee/ssl/ca-certs.crt new file mode 100644 index 0000000..2a40e3a --- /dev/null +++ b/chargebee/ssl/ca-certs.crt @@ -0,0 +1,3385 @@ +## +## lib/ca-bundle.crt -- Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Tue Mar 27 15:43:20 2012 +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## + +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is the Netscape security libraries. +# +# The Initial Developer of the Original Code is +# Netscape Communications Corporation. +# Portions created by the Initial Developer are Copyright (C) 1994-2000 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.82 $ $Date: 2012/02/18 21:41:46 $ + +GTE CyberTrust Global Root +========================== +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg +Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG +A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz +MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL +Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 +IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u +sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql +HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID +AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW +M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF +NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +Thawte Server CA +================ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE +AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j +b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV +BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u +c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG +A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 +ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl +/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 +1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J +GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ +GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +Thawte Premium Server CA +======================== +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE +AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl +ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT +AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 +aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ +cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 +aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh +Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ +qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm +SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf +8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t +UCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +Equifax Secure CA +================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT +B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR +fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW +8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE +CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS +spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 +zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB +BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 +70+sB3c4 +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 1 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy +MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE +NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i +o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq +kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 +RbyhkwS7hp86W0N6w4pl +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 3 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy +MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD +VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS +xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi +up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1 +mPnHfxsb1gYgAlihw6ID +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA +TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah +WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf +Tqj/ZA1k +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO +FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 +lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB +MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT +1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD +Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 +-----END CERTIFICATE----- + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 +ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp +s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN +S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL +TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C +ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i +YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN +BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp +9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +ValiCert Class 1 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy +MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi +GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm +DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG +lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX +icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP +Orf1LXLI +-----END CERTIFICATE----- + +ValiCert Class 2 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC +CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf +ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ +SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV +UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 +W9ViH0Pd +-----END CERTIFICATE----- + +RSA Root Certificate 1 +====================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td +3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H +BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs +3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF +V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r +on+jjBXu +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Verisign Class 4 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS +tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM +8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW +Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX +Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt +mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd +RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG +UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +Entrust.net Secure Server CA +============================ +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg +cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl +ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG +A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi +eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p +dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ +aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 +gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw +ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw +CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l +dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw +NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow +HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA +BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN +Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 +n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC +AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER +gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B +AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo +oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS +o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z +2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX +OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ== +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Equifax Secure Global eBusiness CA +================================== +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp +bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx +HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds +b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV +PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN +qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn +hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j +BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs +MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN +I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY +NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 1 +============================= +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB +LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE +ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz +IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ +1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a +IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk +MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW +Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF +AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 +lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ +KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 2 +============================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE +ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y +MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT +DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn +2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5 +BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx +JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e +uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 +jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia +78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm +V+GRMOrN +-----END CERTIFICATE----- + +AddTrust Low-Value Services Root +================================ +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU +cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw +CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO +ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 +54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr +oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 +Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui +GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w +HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT +RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw +HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt +ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph +iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr +mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj +ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +AddTrust Public Services Root +============================= +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU +cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ +BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l +dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu +nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i +d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG +Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw +HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G +A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G +A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 +JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL ++YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 +Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H +EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +AddTrust Qualified Certificates Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU +cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx +CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ +IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx +64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 +KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o +L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR +wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU +MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE +BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y +azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG +GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze +RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB +iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz +A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww +Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 +j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN +rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 +MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH +hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +RSA Security 2048 v3 +==================== +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK +ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy +MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb +BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 +Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb +WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH +KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP ++Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E +FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY +v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj +0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj +VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 +nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA +pKnXwiJPZ9d37CAFYd4= +-----END CERTIFICATE----- + +GeoTrust Global CA +================== +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw +MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo +BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet +8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc +T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU +vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk +DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q +zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 +d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 +mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Global CA 2 +==================== +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw +MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ +NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k +LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA +Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b +HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH +K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 +srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh +ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL +OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC +x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF +H4z1Ir+rzoPz4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 +MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg +SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 +DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 +j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q +JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a +QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 +WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP +20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn +ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC +SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG +8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 ++/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +America Online Root Certification Authority 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG +v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z +DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh +sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP +8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z +o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf +GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF +VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft +3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g +Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +America Online Root Certification Authority 2 +============================================= +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en +fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 +f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO +qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN +RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 +gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn +6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid +FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 +Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj +B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op +aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY +T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p ++DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg +JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy +zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO +ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh +1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf +GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff +Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP +cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= +-----END CERTIFICATE----- + +Visa eCommerce Root +=================== +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG +EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug +QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 +WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm +VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL +F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b +RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 +TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI +/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs +GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc +CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW +YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz +zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu +YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +Certum Root CA +============== +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK +ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla +Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u +by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x +wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL +kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ +89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K +Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P +NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ +GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg +GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ +0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS +qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW +Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH +Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK +Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f +BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl +cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz +LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm +7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +Comodo Secure Services root +=========================== +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw +MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu +Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi +BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP +9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc +rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC +oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V +p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E +FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w +gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj +YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm +aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm +4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL +DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw +pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H +RR3B7Hzs/Sk= +-----END CERTIFICATE----- + +Comodo Trusted Services root +============================ +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw +MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h +bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw +IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 +3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y +/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 +juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS +ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud +DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp +ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl +cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw +uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA +BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l +R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O +9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y +ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 +MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj +YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs +ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie +J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud +DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU +a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg +DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij +KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K +DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv +BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp +p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 +nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX +MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM +Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz +uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT +BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj +YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB +BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA +============================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE +ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w +HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh +bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt +vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P +jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca +C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth +vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 +22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV +HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v +dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN +BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR +EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw +MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y +nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- + +TDC Internet Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE +ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx +NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu +ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j +xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL +znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc +5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 +otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI +AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM +VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM +MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC +AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe +UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G +CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m +gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb +O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU +Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- + +TDC OCES Root CA +================ +-----BEGIN CERTIFICATE----- +MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE +ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5 +MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH +nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0 +zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV +iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde +dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO +3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB +5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k +ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm +cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp +Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x +LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM +MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm +aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy +MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647 ++RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6 +NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4 +A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc +A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9 +AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1 +AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw== +-----END CERTIFICATE----- + +UTN DATACorp SGC Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ +BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa +MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w +HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy +dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys +raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo +wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA +9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv +33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud +DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 +BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD +LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 +DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 +I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx +EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP +DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +UTN USERFirst Hardware Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd +BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx +OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 +eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz +ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI +wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd +tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 +i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf +Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw +gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF +lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF +UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF +BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW +XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 +lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn +iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 +nfhmqA== +-----END CERTIFICATE----- + +Camerfirma Chambers of Commerce Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx +NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp +cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn +MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU +xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH +NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW +DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV +d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud +EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v +cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P +AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh +bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD +VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi +fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD +L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN +UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n +ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 +erfutGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +Camerfirma Global Chambersign Root +================================== +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx +NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt +YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg +MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw +ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J +1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O +by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl +6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c +8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ +BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j +aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B +Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj +aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y +ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA +PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y +gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ +PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 +IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes +t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +NetLock Notary (Class A) Root +============================= +-----BEGIN CERTIFICATE----- +MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI +EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j +ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX +DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH +EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD +VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz +cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM +D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ +z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC +/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 +tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 +4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG +A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC +Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv +bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu +IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn +LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 +ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz +IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh +IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu +b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg +Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp +bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 +ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP +ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB +CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr +KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM +8CgHrTwXZoi1/baI +-----END CERTIFICATE----- + +NetLock Business (Class B) Root +=============================== +-----BEGIN CERTIFICATE----- +MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg +VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD +VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv +bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg +VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S +o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr +1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV +HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ +RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh +dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 +ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv +c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg +YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh +c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz +Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA +bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl +IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 +YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj +cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM +43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR +stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI +-----END CERTIFICATE----- + +NetLock Express (Class C) Root +============================== +-----BEGIN CERTIFICATE----- +MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD +KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ +BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j +ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z +W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 +euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw +DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN +RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn +YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB +IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i +aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 +ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs +ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo +dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y +emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k +IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ +UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg +YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 +xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW +gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE +zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs +AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry +xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap +oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC +AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc +/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n +nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz +8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +Go Daddy Class 2 CA +=================== +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY +VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG +A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g +RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD +ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv +2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj +YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH +AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw +Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg +U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 +LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh +cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT +dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC +AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh +3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm +vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk +fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 +fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ +EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl +1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ +lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro +g14= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO +htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov +J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 +Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t +B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB +O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 +lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV +HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 +09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj +Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 +Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU +D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz +DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +Firmaprofesional Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT +GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp +Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA +ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL +MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT +OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2 +ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V +j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH +lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf +3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8 +NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww +KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG +AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD +ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq +u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf +wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm +7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG +VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA= +-----END CERTIFICATE----- + +Wells Fargo Root CA +=================== +-----BEGIN CERTIFICATE----- +MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl +bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv +MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX +x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3 +E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5 +OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j +sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj +YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF +BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD +ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv +m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R +OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx +x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023 +tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= +-----END CERTIFICATE----- + +Swisscom Root CA 1 +================== +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG +EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy +dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 +MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln +aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC +IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM +MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF +NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe +AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC +b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn +7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN +cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp +WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 +haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY +MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw +HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 +MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn +jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ +MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H +VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl +vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl +OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 +1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq +nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy +x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW +NY6E0F/6MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t +Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS +OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 +MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ +NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe +h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY +JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ +V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp +myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK +mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R +TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ +7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW +//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +DST Root CA X3 +============== +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK +ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X +DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 +cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT +rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 +UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy +xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d +utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +DST ACES CA X6 +============== +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT +MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha +MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE +CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI +DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa +pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow +GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy +MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu +Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy +dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU +CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 +5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t +Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs +vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 +oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 1 +============================================== +-----BEGIN CERTIFICATE----- +MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP +MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 +acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx +MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg +U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB +TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC +aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX +yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i +Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ +8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 +W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 +sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE +q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy +B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY +nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2 +============================================== +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN +MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr +dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G +A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls +acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe +LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI +x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g +QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr +5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB +AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt +Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ +hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P +9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 +UrbnBEI= +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF +ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR +AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend +jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO +peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR +7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi +GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 +FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs +ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc +celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X +CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB +tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P +4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F +kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L +3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx +/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa +DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP +e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu +WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI +hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K +Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN +NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa +Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG +1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +thawte Primary Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 +MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg +SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv +KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT +FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln +biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh +dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz +j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD +Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ +Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r +fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv +Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG +SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ +X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE +KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC +Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE +ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +SecureTrust CA +============== +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy +dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe +BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX +OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t +DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH +GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b +01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH +ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu +SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf +mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ +nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +Secure Global CA +================ +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH +bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg +MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +WellsSecure Public Root Certificate Authority +============================================= +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM +F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw +NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl +bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD +VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 +iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 +i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 +bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB +K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB +AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu +cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm +lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB +i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww +GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI +K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 +bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj +qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es +E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ +tylv2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +IGC/A +===== +-----BEGIN CERTIFICATE----- +MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD +VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE +Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy +MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI +EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT +STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 +TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW +So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy +HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd +frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ +tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB +egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC +iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK +q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q +MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg +Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI +lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF +0mBWWg== +-----END CERTIFICATE----- + +Security Communication EV RootCA1 +================================= +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE +BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl +Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO +/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX +WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z +ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 +bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK +9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm +iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG +Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW +mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW +T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 +IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 +Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg +Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD +d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ +/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R +LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm +MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 ++vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY +okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA +========================= +-----BEGIN CERTIFICATE----- +MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE +BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL +EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 +MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz +dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT +GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG +d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N +oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc +QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ +PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb +MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG +IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD +VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 +LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A +dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn +AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA +4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg +AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA +egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 +Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO +PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv +c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h +cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw +IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT +WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV +MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER +MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp +Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal +HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT +nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE +aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a +86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK +yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB +S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 +MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI +Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q +XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH +GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p +ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg +DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf +Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ +tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ +BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J +SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA +hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ +ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. +====================================== +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT +AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg +LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w +HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ +U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh +IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN +yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU +2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 +4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP +2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm +8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf +HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa +Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK +5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b +czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g +ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF +BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug +cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf +AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX +EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v +/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 +MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 +3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk +eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f +/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h +RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU +Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 2 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw +MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw +IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 +xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ +Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u +SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G +dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ +KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj +TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP +JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk +vQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 3 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw +MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W +yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo +6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ +uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk +2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE +O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 +yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 +IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal +092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc +5A== +-----END CERTIFICATE----- + +TC TrustCenter Universal CA I +============================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN +MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg +VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw +JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC +qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv +xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw +ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O +gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j +BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG +1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy +vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 +ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a +7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +ComSign Secured CA +================== +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE +AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w +NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD +QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs +49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH +7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB +kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 +9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw +AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t +U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA +j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC +AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a +BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp +FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP +51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 +============================================================================================================================= +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH +DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q +aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry +b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV +BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg +S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 +MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl +IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF +n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl +IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft +dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl +cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO +Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 +xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR +6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd +BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 +N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT +y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh +LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M +dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +Buypass Class 2 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 +MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M +cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 +0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 +0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R +uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV +1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt +7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 +fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w +wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- + +Buypass Class 3 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 +MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx +ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 +n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia +AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c +1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 +pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA +EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 +htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj +el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- + +EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 +========================================================================== +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg +QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe +Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt +IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by +X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b +gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr +eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ +TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy +Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn +uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI +qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm +ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 +Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW +Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t +FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm +zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k +XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT +bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU +RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK +1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt +2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ +Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 +AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +CNNIC ROOT +========== +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE +ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw +OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD +o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz +VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT +VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or +czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK +y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC +wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S +lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 +Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM +O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 +BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 +G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m +mxE= +-----END CERTIFICATE----- + +ApplicationCA - Japanese Government +=================================== +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT +SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw +MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl +cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 +fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN +wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE +jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu +nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU +WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV +BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD +vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs +o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g +/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD +io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW +dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo +YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT +LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j +K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE +c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C +IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu +dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr +2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 +cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE +Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s +t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +thawte Primary Root CA - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w +ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD +VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG +A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At +P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC ++BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY +7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW +vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ +KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 +b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz +ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU +cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo +b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 +Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz +rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw +HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u +Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD +A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx +AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +============================================ +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj +CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil +e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR +OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI +CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 +48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi +trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 +qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB +AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC +ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA +A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz ++51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj +f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN +kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +CA Disig +======== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK +QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw +MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz +bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm +GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD +Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo +hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt +ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w +gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P +AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz +aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff +ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa +BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t +WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 +mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K +ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA +4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- + +Juur-SK +======= +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA +c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw +DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG +SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy +aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf +TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC ++Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw +UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa +Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF +MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD +HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh +AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA +cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr +AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw +cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G +A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo +ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL +abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 +IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh +Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 +yyqcjg== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +ACEDICOM Root +============= +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD +T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 +MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG +A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk +WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD +YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew +MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb +m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk +HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT +xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 +3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 +2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq +TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz +4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU +9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg +aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP +eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk +zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 +ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI +KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq +nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE +I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp +MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o +tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky +CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX +bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ +D/xwzoiQ +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE +BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt +U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA +fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG +0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA +pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm +1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC +AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi +=================================================== +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz +ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 +MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 +cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u +aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY +8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y +jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI +JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk +9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG +SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d +F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq +D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 +Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq +fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +TC TrustCenter Universal CA III +=============================== +-----BEGIN CERTIFICATE----- +MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe +Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU +QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex +KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt +QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO +juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut +CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 +M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G +A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA +g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ +KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK +BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV +CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq +woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX +LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK +bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU +vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud +EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH +DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA +bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx +ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ +0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB +leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID +AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ +SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG +NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l +Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ +ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk +NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g +D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 +lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ +0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 +EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI +G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ +BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh +bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh +bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC +CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH +AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 +wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg +Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ +QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf +VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf +XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 +ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB +/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA +TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M +H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe +Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF +HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB +AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT +BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE +BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm +aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm +aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp +1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 +dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG +/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 +ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s +dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg +9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH +foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du +qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr +P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq +c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy +dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn +BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV +5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs ++7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd +GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R +p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI +S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 +6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +Certinomis - Autorité Racine +============================= +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg +LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG +A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw +JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa +wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly +Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw +2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N +jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q +c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC +lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb +xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g +530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna +4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x +WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva +R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 +nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B +CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv +JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE +qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b +WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE +wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ +vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +Root CA Generalitat Valenciana +============================== +-----BEGIN CERTIFICATE----- +MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE +ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 +IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 +WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE +CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 +F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B +ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ +D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte +JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB +AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n +dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB +ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl +AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA +YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy +AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA +aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt +AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA +YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu +AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA +OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 +dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV +BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G +A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S +b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh +TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz +Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 +NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH +iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt ++GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= +-----END CERTIFICATE----- + +A-Trust-nQual-03 +================ +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE +Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy +a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R +dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw +RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 +ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 +c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA +zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n +yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE +SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 +iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V +cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV +eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 +ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr +sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd +JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 +ahq97BvIxYSazQ== +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk +3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q +tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 +mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +EC-ACC +====== +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE +BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w +ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD +VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE +CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT +BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 +MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt +SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl +Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh +cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK +w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT +ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 +HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a +E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw +0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- diff --git a/chargebee/util.py b/chargebee/util.py new file mode 100644 index 0000000..4dc96b8 --- /dev/null +++ b/chargebee/util.py @@ -0,0 +1,55 @@ +from chargebee import compat +from collections import OrderedDict + + +def serialize(value, prefix=None, idx=None): + + serialized = OrderedDict() + + if isinstance(value, dict): + for k, v in list(value.items()): + if k in ("meta_data", "metaData", "checkout_info") and isinstance(v, dict): + serialized.update({k: v}) + elif k in ( + "exemption_details", + "item_family_ids", + "item_price_periods", + "currencies", + ) and isinstance(v, list): + serialized.update({k: v}) + elif isinstance(v, (dict, list, tuple)): + serialized.update(serialize(v, k)) + else: + key = "".join( + [ + prefix or "", + "[%s]" % k if prefix is not None else k, + "[%s]" % idx if idx is not None else "", + ] + ) + serialized.update({key: get_val(v)}) + + elif isinstance(value, (list, tuple)): + for i, v in enumerate(value): + serialized.update(serialize(v, prefix, i)) + + else: + if prefix is not None and idx is not None: + key = prefix + "[" + str(idx) + "]" + serialized.update({key: get_val(value)}) + else: + raise TypeError("only hash or arrays are allowed as value") + + return serialized + + +def get_val(val): + if val is None: + return "" + elif isinstance(val, bool): + return str(val).lower() + else: + if compat.py_major_v < 3 and isinstance(val, unicode): + return val.encode("utf-8") + else: + return val diff --git a/chargebee/version.py b/chargebee/version.py new file mode 100644 index 0000000..284c7b5 --- /dev/null +++ b/chargebee/version.py @@ -0,0 +1 @@ +VERSION = "3.0.0b1" diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6c63980 --- /dev/null +++ b/setup.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- + +from setuptools import setup, find_packages +import sys +import os + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'chargebee')) +if sys.version_info < (3,11): + sys.exit('Sorry, Python < 3.11 is not supported') +from chargebee import version + +requires = ['requests', 'typing'] + +setup( + name='chargebee', + version=version.VERSION, + author='Chargebee', + author_email='dx@chargebee.com', + url='https://apidocs.chargebee.com/docs/api?lang=python', + description='Python wrapper for the Chargebee Subscription Billing API', + packages=find_packages(exclude=["tests"]), + package_data={'chargebee': ['ssl/*.crt']}, + python_requires='>=3.11', + install_requires=requires, + test_suite='tests', +) From 91e2524f13fe62f6dc52bdb9a89fa01d444c22d8 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Fri, 13 Sep 2024 10:22:31 +0530 Subject: [PATCH 03/19] adding README.md file --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index e69de29..9f61b50 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,72 @@ +# Chargebee Python Client Library - API V2 + + +This is the Python Library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com). + +## Requirements + +Python 3.11 or higher. + +## Installation + +Install the latest version 3.x.x of the library with the following command: + + + $ python setup.py install + +## Documentation + +See our [Python API Reference](https://apidocs.chargebee.com/docs/api?lang=python "API Reference"). + +## Usage + +### To create a new subscription: + +```python +import chargebee +from chargebee import Subscription +chargebee.configure(api_key, site) +response = chargebee.Subscription.create(Subscription.CreateParams( + plan_id= "basic" + )) +print(response.subscription) +``` + +### Create an idempotent request: + +[Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests. + +```python +import chargebee +from chargebee.models import customer +from chargebee import Customer +chargebee.configure(api_key, site) +response = Customer.create(Customer.CreateParams( + first_name="John", + last_name="Doe", + email="john@test.com", + locale="fr-CA", + billing_address=customer.BillingAddress( + first_name="John", + last_name=" Doe", + line1="PO Box 9999", + city="Walnut", + state="California", + zip="91789", + country="US" + ) + ), + None, + {"chargebee-idempotency-key": "<>"} # Replace <> with a unique string + ) +customer = response.customer +card = response.card +responseHeaders = response.response_headers # Retrieves response headers +print(responseHeaders) +idempotencyReplayedValue = response.response_headers["chargebee-idempotency-key"] # Retrieves Idempotency replayed header value +print(idempotencyReplayedValue) +``` + +## License + +See the [LICENSE](./LICENSE) file. From 688bdbdecab4283e558c533708ec24a968214a67 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Fri, 13 Sep 2024 17:14:41 +0530 Subject: [PATCH 04/19] updated requirements --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6c63980..9837d6b 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ sys.exit('Sorry, Python < 3.11 is not supported') from chargebee import version -requires = ['requests', 'typing'] +requires = ['requests'] setup( name='chargebee', From 7658bc97d6bf215f683f3f7f5953f0aceb1debd3 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Fri, 13 Sep 2024 18:21:56 +0530 Subject: [PATCH 05/19] added requirements to pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0837f83 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=66", "wheel", "requests>=2.29.0"] +build-backend = "setuptools.build_meta" From 52e6c9a68354129f72a78348c7d12826c0f8b001 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Wed, 18 Sep 2024 14:18:04 +0530 Subject: [PATCH 06/19] updated imports in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9837d6b..d16819e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'chargebee')) if sys.version_info < (3,11): sys.exit('Sorry, Python < 3.11 is not supported') -from chargebee import version +import version requires = ['requests'] From a6304c09c26432d836c4ddc645670e0467f69a47 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Fri, 20 Sep 2024 17:51:51 +0530 Subject: [PATCH 07/19] refactor: removed obsolete code --- chargebee/models/__init__.py | 147 +++++------------- chargebee/models/addon/__init__.py | 1 - chargebee/models/addon/operations.py | 1 + chargebee/models/addon/types.py | 47 ------ chargebee/models/address/__init__.py | 1 - chargebee/models/address/operations.py | 1 + chargebee/models/address/types.py | 19 --- .../advance_invoice_schedule/__init__.py | 7 +- .../models/advance_invoice_schedule/types.py | 7 - chargebee/models/attached_item/__init__.py | 2 +- chargebee/models/attached_item/operations.py | 1 + chargebee/models/attached_item/types.py | 17 -- chargebee/models/attribute/__init__.py | 1 - chargebee/models/attribute/types.py | 5 - chargebee/models/business_entity/__init__.py | 2 +- chargebee/models/business_entity/types.py | 10 -- .../business_entity_transfer/__init__.py | 2 +- .../models/business_entity_transfer/types.py | 11 -- chargebee/models/card/__init__.py | 2 +- chargebee/models/card/operations.py | 1 + chargebee/models/card/types.py | 31 ---- chargebee/models/comment/__init__.py | 2 +- chargebee/models/comment/operations.py | 1 + chargebee/models/comment/types.py | 10 -- chargebee/models/contact/__init__.py | 1 - chargebee/models/contact/types.py | 12 -- chargebee/models/contract_term/__init__.py | 2 +- chargebee/models/contract_term/types.py | 15 -- chargebee/models/coupon/__init__.py | 1 - chargebee/models/coupon/operations.py | 1 + chargebee/models/coupon/types.py | 35 ----- chargebee/models/coupon_code/__init__.py | 2 +- chargebee/models/coupon_code/types.py | 8 - chargebee/models/coupon_set/__init__.py | 1 - chargebee/models/coupon_set/types.py | 10 -- chargebee/models/credit_note/__init__.py | 1 - chargebee/models/credit_note/types.py | 49 ------ .../models/credit_note_estimate/__init__.py | 1 - .../models/credit_note_estimate/types.py | 19 --- chargebee/models/currency/__init__.py | 2 +- chargebee/models/currency/types.py | 9 -- chargebee/models/customer/__init__.py | 1 - chargebee/models/customer/types.py | 69 -------- .../models/customer_entitlement/__init__.py | 1 - .../models/customer_entitlement/types.py | 9 -- .../models/differential_price/__init__.py | 2 +- chargebee/models/differential_price/types.py | 16 -- chargebee/models/discount/__init__.py | 2 +- chargebee/models/discount/types.py | 20 --- chargebee/models/download/__init__.py | 1 - chargebee/models/download/types.py | 6 - chargebee/models/entitlement/__init__.py | 2 +- chargebee/models/entitlement/types.py | 10 -- .../models/entitlement_override/__init__.py | 2 +- .../models/entitlement_override/types.py | 13 -- chargebee/models/estimate/__init__.py | 1 - chargebee/models/estimate/types.py | 13 -- chargebee/models/event/__init__.py | 2 +- chargebee/models/event/types.py | 14 -- chargebee/models/export/__init__.py | 2 +- chargebee/models/export/types.py | 9 -- chargebee/models/feature/__init__.py | 2 +- chargebee/models/feature/types.py | 13 -- .../models/gateway_error_detail/__init__.py | 1 - .../models/gateway_error_detail/types.py | 16 -- chargebee/models/gift/__init__.py | 2 +- chargebee/models/gift/types.py | 14 -- chargebee/models/hierarchy/__init__.py | 1 - chargebee/models/hierarchy/types.py | 8 - chargebee/models/hosted_page/__init__.py | 2 +- chargebee/models/hosted_page/types.py | 17 -- chargebee/models/impacted_item/__init__.py | 2 +- chargebee/models/impacted_item/types.py | 6 - .../models/impacted_item_price/__init__.py | 2 +- chargebee/models/impacted_item_price/types.py | 6 - .../models/impacted_subscription/__init__.py | 2 +- .../models/impacted_subscription/types.py | 6 - .../models/in_app_subscription/__init__.py | 2 +- chargebee/models/in_app_subscription/types.py | 9 -- chargebee/models/installment/__init__.py | 2 +- chargebee/models/installment/types.py | 11 -- .../models/installment_config/__init__.py | 2 +- chargebee/models/installment_config/types.py | 13 -- .../models/installment_detail/__init__.py | 2 +- chargebee/models/installment_detail/types.py | 7 - chargebee/models/invoice/__init__.py | 1 - chargebee/models/invoice/types.py | 69 -------- chargebee/models/invoice_estimate/__init__.py | 10 +- chargebee/models/invoice_estimate/types.py | 19 --- chargebee/models/item/__init__.py | 9 +- chargebee/models/item/types.py | 27 ---- chargebee/models/item_entitlement/__init__.py | 2 +- chargebee/models/item_entitlement/types.py | 10 -- chargebee/models/item_family/__init__.py | 2 +- chargebee/models/item_family/types.py | 10 -- chargebee/models/item_price/__init__.py | 1 - chargebee/models/item_price/types.py | 46 ------ chargebee/models/metadata/__init__.py | 1 - chargebee/models/metadata/types.py | 4 - chargebee/models/order/__init__.py | 1 - chargebee/models/order/types.py | 59 ------- chargebee/models/payment_intent/__init__.py | 2 +- chargebee/models/payment_intent/responses.py | 2 +- chargebee/models/payment_intent/types.py | 23 +-- .../payment_reference_number/__init__.py | 2 +- .../models/payment_reference_number/types.py | 7 - chargebee/models/payment_source/__init__.py | 1 - chargebee/models/payment_source/types.py | 27 ---- chargebee/models/payment_voucher/__init__.py | 2 +- chargebee/models/payment_voucher/types.py | 23 --- chargebee/models/plan/__init__.py | 1 - chargebee/models/plan/types.py | 59 ------- chargebee/models/portal_session/__init__.py | 2 +- chargebee/models/portal_session/types.py | 16 -- chargebee/models/price_variant/__init__.py | 2 +- chargebee/models/price_variant/types.py | 14 -- .../models/pricing_page_session/__init__.py | 1 - .../models/pricing_page_session/types.py | 7 - .../models/promotional_credit/__init__.py | 2 +- .../models/promotional_credit/operations.py | 1 + chargebee/models/promotional_credit/types.py | 15 -- chargebee/models/purchase/__init__.py | 1 - chargebee/models/purchase/types.py | 9 -- chargebee/models/quote/__init__.py | 1 - chargebee/models/quote/types.py | 41 ----- chargebee/models/quote_line_group/__init__.py | 10 +- chargebee/models/quote_line_group/types.py | 17 -- chargebee/models/quoted_charge/__init__.py | 2 +- chargebee/models/quoted_charge/types.py | 8 - .../models/quoted_subscription/__init__.py | 1 - chargebee/models/quoted_subscription/types.py | 26 ---- chargebee/models/ramp/__init__.py | 1 - chargebee/models/ramp/types.py | 21 --- .../models/resource_migration/__init__.py | 2 +- .../models/resource_migration/operations.py | 1 + chargebee/models/resource_migration/types.py | 10 -- .../models/site_migration_detail/__init__.py | 2 +- .../models/site_migration_detail/types.py | 9 -- chargebee/models/subscription/__init__.py | 1 - chargebee/models/subscription/types.py | 81 ---------- .../subscription_entitlement/__init__.py | 2 +- .../subscription_entitlement/responses.py | 2 +- .../models/subscription_entitlement/types.py | 18 +-- .../models/subscription_estimate/__init__.py | 2 +- .../models/subscription_estimate/types.py | 12 -- chargebee/models/tax_withheld/__init__.py | 2 +- chargebee/models/tax_withheld/types.py | 15 -- .../third_party_payment_method/__init__.py | 1 - .../third_party_payment_method/types.py | 7 - chargebee/models/time_machine/__init__.py | 2 +- chargebee/models/time_machine/types.py | 10 -- chargebee/models/token/__init__.py | 2 +- chargebee/models/token/types.py | 15 -- chargebee/models/transaction/__init__.py | 1 - chargebee/models/transaction/operations.py | 1 + chargebee/models/transaction/types.py | 49 ------ chargebee/models/unbilled_charge/__init__.py | 2 +- chargebee/models/unbilled_charge/types.py | 27 ---- chargebee/models/usage/__init__.py | 1 - chargebee/models/usage/operations.py | 1 + chargebee/models/usage/types.py | 15 -- .../models/virtual_bank_account/__init__.py | 2 +- .../models/virtual_bank_account/types.py | 18 --- 163 files changed, 99 insertions(+), 1673 deletions(-) diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 0e11645..60dc5eb 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -81,7 +81,6 @@ from chargebee.models.addon.operations import Addon from chargebee.models.addon.types import ( - Addons, Tier, TaxProvidersField, Type, @@ -93,47 +92,38 @@ ) from chargebee.models.address.operations import Address -from chargebee.models.address.types import Addresses from chargebee.models.advance_invoice_schedule.operations import AdvanceInvoiceSchedule from chargebee.models.advance_invoice_schedule.types import ( - AdvanceInvoiceSchedules, FixedIntervalSchedule, SpecificDatesSchedule, ScheduleType, ) from chargebee.models.attached_item.operations import AttachedItem -from chargebee.models.attached_item.types import AttachedItems, Type, Status +from chargebee.models.attached_item.types import Type, Status from chargebee.models.attribute.operations import Attribute -from chargebee.models.attribute.types import Attributes from chargebee.models.business_entity.operations import BusinessEntity -from chargebee.models.business_entity.types import BusinessEntities, Status +from chargebee.models.business_entity.types import Status from chargebee.models.business_entity_transfer.operations import BusinessEntityTransfer -from chargebee.models.business_entity_transfer.types import ( - BusinessEntityTransfers, - ResourceType, - ReasonCode, -) +from chargebee.models.business_entity_transfer.types import ResourceType, ReasonCode from chargebee.models.card.operations import Card -from chargebee.models.card.types import Cards, Status, CardType, FundingType, PoweredBy +from chargebee.models.card.types import Status, CardType, FundingType, PoweredBy from chargebee.models.comment.operations import Comment -from chargebee.models.comment.types import Comments, Type +from chargebee.models.comment.types import Type from chargebee.models.contact.operations import Contact -from chargebee.models.contact.types import Contacts from chargebee.models.contract_term.operations import ContractTerm -from chargebee.models.contract_term.types import ContractTerms, Status, ActionAtTermEnd +from chargebee.models.contract_term.types import Status, ActionAtTermEnd from chargebee.models.coupon.operations import Coupon from chargebee.models.coupon.types import ( - Coupons, ItemConstraint, ItemConstraintCriteria, CouponConstraint, @@ -147,14 +137,12 @@ ) from chargebee.models.coupon_code.operations import CouponCode -from chargebee.models.coupon_code.types import CouponCodes, Status +from chargebee.models.coupon_code.types import Status from chargebee.models.coupon_set.operations import CouponSet -from chargebee.models.coupon_set.types import CouponSets from chargebee.models.credit_note.operations import CreditNote from chargebee.models.credit_note.types import ( - CreditNotes, Einvoice, LineItem, Discount, @@ -175,7 +163,6 @@ from chargebee.models.credit_note_estimate.operations import CreditNoteEstimate from chargebee.models.credit_note_estimate.types import ( - CreditNoteEstimates, LineItem, Discount, Tax, @@ -186,11 +173,10 @@ ) from chargebee.models.currency.operations import Currency -from chargebee.models.currency.types import Currencies, ForexType +from chargebee.models.currency.types import ForexType from chargebee.models.customer.operations import Customer from chargebee.models.customer.types import ( - Customers, BillingAddress, ReferralUrl, Contact, @@ -209,89 +195,65 @@ ) from chargebee.models.customer_entitlement.operations import CustomerEntitlement -from chargebee.models.customer_entitlement.types import CustomerEntitlements from chargebee.models.differential_price.operations import DifferentialPrice -from chargebee.models.differential_price.types import ( - DifferentialPrices, - Tier, - ParentPeriod, - Status, -) +from chargebee.models.differential_price.types import Tier, ParentPeriod, Status from chargebee.models.discount.operations import Discount -from chargebee.models.discount.types import Discounts, Type +from chargebee.models.discount.types import Type from chargebee.models.download.operations import Download -from chargebee.models.download.types import Downloads from chargebee.models.entitlement.operations import Entitlement -from chargebee.models.entitlement.types import Entitlements, EntityType +from chargebee.models.entitlement.types import EntityType from chargebee.models.entitlement_override.operations import EntitlementOverride -from chargebee.models.entitlement_override.types import ( - EntitlementOverrides, - ScheduleStatus, -) +from chargebee.models.entitlement_override.types import ScheduleStatus from chargebee.models.estimate.operations import Estimate -from chargebee.models.estimate.types import Estimates from chargebee.models.event.operations import Event -from chargebee.models.event.types import Events, Webhook, WebhookStatus +from chargebee.models.event.types import Webhook, WebhookStatus from chargebee.models.export.operations import Export -from chargebee.models.export.types import Exports, Download, MimeType, Status +from chargebee.models.export.types import Download, MimeType, Status from chargebee.models.feature.operations import Feature -from chargebee.models.feature.types import Features, Level, Status, Type +from chargebee.models.feature.types import Level, Status, Type from chargebee.models.gateway_error_detail.operations import GatewayErrorDetail -from chargebee.models.gateway_error_detail.types import GatewayErrorDetails from chargebee.models.gift.operations import Gift -from chargebee.models.gift.types import ( - Gifts, - Gifter, - GiftReceiver, - GiftTimeline, - Status, -) +from chargebee.models.gift.types import Gifter, GiftReceiver, GiftTimeline, Status from chargebee.models.hierarchy.operations import Hierarchy -from chargebee.models.hierarchy.types import Hierarchies from chargebee.models.hosted_page.operations import HostedPage -from chargebee.models.hosted_page.types import HostedPages, Type, State, FailureReason +from chargebee.models.hosted_page.types import Type, State, FailureReason from chargebee.models.impacted_item.operations import ImpactedItem -from chargebee.models.impacted_item.types import ImpactedItems, Download +from chargebee.models.impacted_item.types import Download from chargebee.models.impacted_item_price.operations import ImpactedItemPrice -from chargebee.models.impacted_item_price.types import ImpactedItemPrices, Download +from chargebee.models.impacted_item_price.types import Download from chargebee.models.impacted_subscription.operations import ImpactedSubscription -from chargebee.models.impacted_subscription.types import ImpactedSubscriptions, Download +from chargebee.models.impacted_subscription.types import Download from chargebee.models.in_app_subscription.operations import InAppSubscription -from chargebee.models.in_app_subscription.types import InAppSubscriptions, StoreStatus +from chargebee.models.in_app_subscription.types import StoreStatus from chargebee.models.installment.operations import Installment -from chargebee.models.installment.types import Installments, Status +from chargebee.models.installment.types import Status from chargebee.models.installment_config.operations import InstallmentConfig -from chargebee.models.installment_config.types import ( - InstallmentConfigs, - Installment, - PeriodUnit, -) +from chargebee.models.installment_config.types import Installment, PeriodUnit from chargebee.models.installment_detail.operations import InstallmentDetail -from chargebee.models.installment_detail.types import InstallmentDetails, Installment +from chargebee.models.installment_detail.types import Installment from chargebee.models.invoice.operations import Invoice from chargebee.models.invoice.types import ( - Invoices, LineItem, Discount, LineItemDiscount, @@ -317,7 +279,6 @@ from chargebee.models.invoice_estimate.operations import InvoiceEstimate from chargebee.models.invoice_estimate.types import ( - InvoiceEstimates, LineItem, Discount, Tax, @@ -328,7 +289,6 @@ from chargebee.models.item.operations import Item from chargebee.models.item.types import ( - Items, ApplicableItem, Status, Type, @@ -337,14 +297,13 @@ ) from chargebee.models.item_entitlement.operations import ItemEntitlement -from chargebee.models.item_entitlement.types import ItemEntitlements, ItemType +from chargebee.models.item_entitlement.types import ItemType from chargebee.models.item_family.operations import ItemFamily -from chargebee.models.item_family.types import ItemFamilies, Status +from chargebee.models.item_family.types import Status from chargebee.models.item_price.operations import ItemPrice from chargebee.models.item_price.types import ( - ItemPrices, Tier, TaxDetail, TaxProvidersField, @@ -358,11 +317,9 @@ ) from chargebee.models.metadata.operations import Metadata -from chargebee.models.metadata.types import Metadata from chargebee.models.order.operations import Order from chargebee.models.order.types import ( - Orders, OrderLineItem, ShippingAddress, BillingAddress, @@ -379,21 +336,16 @@ from chargebee.models.payment_intent.operations import PaymentIntent from chargebee.models.payment_intent.types import ( - PaymentIntents, PaymentAttempt, Status, PaymentMethodType, ) from chargebee.models.payment_reference_number.operations import PaymentReferenceNumber -from chargebee.models.payment_reference_number.types import ( - PaymentReferenceNumbers, - Type, -) +from chargebee.models.payment_reference_number.types import Type from chargebee.models.payment_source.operations import PaymentSource from chargebee.models.payment_source.types import ( - PaymentSources, Card, BankAccount, CustVoucherSource, @@ -408,15 +360,10 @@ ) from chargebee.models.payment_voucher.operations import PaymentVoucher -from chargebee.models.payment_voucher.types import ( - PaymentVouchers, - LinkedInvoice, - Status, -) +from chargebee.models.payment_voucher.types import LinkedInvoice, Status from chargebee.models.plan.operations import Plan from chargebee.models.plan.types import ( - Plans, Tier, TaxProvidersField, ApplicableAddon, @@ -432,23 +379,20 @@ ) from chargebee.models.portal_session.operations import PortalSession -from chargebee.models.portal_session.types import PortalSessions, LinkedCustomer, Status +from chargebee.models.portal_session.types import LinkedCustomer, Status from chargebee.models.price_variant.operations import PriceVariant -from chargebee.models.price_variant.types import PriceVariants, Attribute, Status +from chargebee.models.price_variant.types import Attribute, Status from chargebee.models.pricing_page_session.operations import PricingPageSession -from chargebee.models.pricing_page_session.types import PricingPageSessions from chargebee.models.promotional_credit.operations import PromotionalCredit -from chargebee.models.promotional_credit.types import PromotionalCredits, Type +from chargebee.models.promotional_credit.types import Type from chargebee.models.purchase.operations import Purchase -from chargebee.models.purchase.types import Purchases from chargebee.models.quote.operations import Quote from chargebee.models.quote.types import ( - Quotes, LineItem, Discount, LineItemDiscount, @@ -463,7 +407,6 @@ from chargebee.models.quote_line_group.operations import QuoteLineGroup from chargebee.models.quote_line_group.types import ( - QuoteLineGroups, LineItem, Discount, LineItemDiscount, @@ -474,7 +417,6 @@ from chargebee.models.quoted_charge.operations import QuotedCharge from chargebee.models.quoted_charge.types import ( - QuotedCharges, Charge, Addon, InvoiceItem, @@ -484,7 +426,6 @@ from chargebee.models.quoted_subscription.operations import QuotedSubscription from chargebee.models.quoted_subscription.types import ( - QuotedSubscriptions, Addon, EventBasedAddon, Coupon, @@ -497,7 +438,6 @@ from chargebee.models.ramp.operations import Ramp from chargebee.models.ramp.types import ( - Ramps, ItemsToAdd, ItemsToUpdate, CouponsToAdd, @@ -508,14 +448,13 @@ ) from chargebee.models.resource_migration.operations import ResourceMigration -from chargebee.models.resource_migration.types import ResourceMigrations, Status +from chargebee.models.resource_migration.types import Status from chargebee.models.site_migration_detail.operations import SiteMigrationDetail -from chargebee.models.site_migration_detail.types import SiteMigrationDetails, Status +from chargebee.models.site_migration_detail.types import Status from chargebee.models.subscription.operations import Subscription from chargebee.models.subscription.types import ( - Subscriptions, SubscriptionItem, ItemTier, ChargedItem, @@ -533,37 +472,30 @@ ) from chargebee.models.subscription_entitlement.operations import SubscriptionEntitlement -from chargebee.models.subscription_entitlement.types import ( - SubscriptionEntitlements, - Component, - ScheduleStatus, -) +from chargebee.models.subscription_entitlement.types import Component, ScheduleStatus from chargebee.models.subscription_estimate.operations import SubscriptionEstimate from chargebee.models.subscription_estimate.types import ( - SubscriptionEstimates, ShippingAddress, ContractTerm, Status, ) from chargebee.models.tax_withheld.operations import TaxWithheld -from chargebee.models.tax_withheld.types import TaxWithhelds, Type, PaymentMethod +from chargebee.models.tax_withheld.types import Type, PaymentMethod from chargebee.models.third_party_payment_method.operations import ( ThirdPartyPaymentMethod, ) -from chargebee.models.third_party_payment_method.types import ThirdPartyPaymentMethods from chargebee.models.time_machine.operations import TimeMachine -from chargebee.models.time_machine.types import TimeMachines, TimeTravelStatus +from chargebee.models.time_machine.types import TimeTravelStatus from chargebee.models.token.operations import Token -from chargebee.models.token.types import Tokens, Status, Vault +from chargebee.models.token.types import Status, Vault from chargebee.models.transaction.operations import Transaction from chargebee.models.transaction.types import ( - Transactions, LinkedInvoice, LinkedCreditNote, LinkedRefund, @@ -577,10 +509,9 @@ ) from chargebee.models.unbilled_charge.operations import UnbilledCharge -from chargebee.models.unbilled_charge.types import UnbilledCharges, Tier, EntityType +from chargebee.models.unbilled_charge.types import Tier, EntityType from chargebee.models.usage.operations import Usage -from chargebee.models.usage.types import Usages from chargebee.models.virtual_bank_account.operations import VirtualBankAccount -from chargebee.models.virtual_bank_account.types import VirtualBankAccounts, Scheme +from chargebee.models.virtual_bank_account.types import Scheme diff --git a/chargebee/models/addon/__init__.py b/chargebee/models/addon/__init__.py index 05c9bd8..f72ff81 100644 --- a/chargebee/models/addon/__init__.py +++ b/chargebee/models/addon/__init__.py @@ -1,7 +1,6 @@ from .operations import Addon from .responses import AddonResponse from .types import ( - Addons, Tier, TaxProvidersField, Type, diff --git a/chargebee/models/addon/operations.py b/chargebee/models/addon/operations.py index dbf7b4d..d57b980 100644 --- a/chargebee/models/addon/operations.py +++ b/chargebee/models/addon/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/addon/types.py b/chargebee/models/addon/types.py index 14e717c..db11fe3 100644 --- a/chargebee/models/addon/types.py +++ b/chargebee/models/addon/types.py @@ -76,53 +76,6 @@ class TaxProvidersField(TypedDict): field_value: Required[str] -class Addons(TypedDict): - id: Required[str] - name: Required[str] - invoice_name: NotRequired[str] - description: NotRequired[str] - pricing_model: Required[enums.PricingModel] - type: Required[Type] - charge_type: Required[ChargeType] - price: NotRequired[int] - currency_code: Required[str] - period: NotRequired[int] - period_unit: Required[PeriodUnit] - unit: NotRequired[str] - status: Required[Status] - archived_at: NotRequired[int] - enabled_in_portal: Required[bool] - tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - sku: NotRequired[str] - accounting_code: NotRequired[str] - accounting_category1: NotRequired[str] - accounting_category2: NotRequired[str] - accounting_category3: NotRequired[str] - accounting_category4: NotRequired[str] - is_shippable: NotRequired[bool] - shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - price_in_decimal: NotRequired[str] - included_in_mrr: NotRequired[bool] - channel: NotRequired[enums.Channel] - proration_type: NotRequired[ProrationType] - invoice_notes: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - meta_data: NotRequired[Dict[Any, Any]] - tiers: NotRequired[List[Tier]] - tax_providers_fields: NotRequired[List[TaxProvidersField]] - show_description_in_invoices: NotRequired[bool] - show_description_in_quotes: NotRequired[bool] - - class CreateTierParams(TypedDict): starting_unit: NotRequired[int] ending_unit: NotRequired[int] diff --git a/chargebee/models/address/__init__.py b/chargebee/models/address/__init__.py index e7273a0..6f2e73a 100644 --- a/chargebee/models/address/__init__.py +++ b/chargebee/models/address/__init__.py @@ -1,3 +1,2 @@ from .operations import Address from .responses import AddressResponse -from .types import Addresses diff --git a/chargebee/models/address/operations.py b/chargebee/models/address/operations.py index 1978a6c..5d7566b 100644 --- a/chargebee/models/address/operations.py +++ b/chargebee/models/address/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums class Address: diff --git a/chargebee/models/address/types.py b/chargebee/models/address/types.py index b98a814..55d7118 100644 --- a/chargebee/models/address/types.py +++ b/chargebee/models/address/types.py @@ -1,21 +1,2 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any from chargebee.models import enums - - -class Addresses(TypedDict): - label: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - addr: NotRequired[str] - extended_addr: NotRequired[str] - extended_addr2: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - state: NotRequired[str] - country: NotRequired[str] - zip: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - subscription_id: Required[str] diff --git a/chargebee/models/advance_invoice_schedule/__init__.py b/chargebee/models/advance_invoice_schedule/__init__.py index 6b1bd22..e782b08 100644 --- a/chargebee/models/advance_invoice_schedule/__init__.py +++ b/chargebee/models/advance_invoice_schedule/__init__.py @@ -1,8 +1,3 @@ from .operations import AdvanceInvoiceSchedule from .responses import AdvanceInvoiceScheduleResponse -from .types import ( - AdvanceInvoiceSchedules, - FixedIntervalSchedule, - SpecificDatesSchedule, - ScheduleType, -) +from .types import FixedIntervalSchedule, SpecificDatesSchedule, ScheduleType diff --git a/chargebee/models/advance_invoice_schedule/types.py b/chargebee/models/advance_invoice_schedule/types.py index de3c2d1..bc340c3 100644 --- a/chargebee/models/advance_invoice_schedule/types.py +++ b/chargebee/models/advance_invoice_schedule/types.py @@ -24,10 +24,3 @@ class SpecificDatesSchedule(TypedDict): terms_to_charge: NotRequired[int] date: NotRequired[int] created_at: Required[int] - - -class AdvanceInvoiceSchedules(TypedDict): - id: Required[str] - schedule_type: NotRequired[ScheduleType] - fixed_interval_schedule: NotRequired[FixedIntervalSchedule] - specific_dates_schedule: NotRequired[SpecificDatesSchedule] diff --git a/chargebee/models/attached_item/__init__.py b/chargebee/models/attached_item/__init__.py index 09bf50a..970b044 100644 --- a/chargebee/models/attached_item/__init__.py +++ b/chargebee/models/attached_item/__init__.py @@ -1,3 +1,3 @@ from .operations import AttachedItem from .responses import AttachedItemResponse -from .types import AttachedItems, Type, Status +from .types import Type, Status diff --git a/chargebee/models/attached_item/operations.py b/chargebee/models/attached_item/operations.py index ddbd58e..e33edd9 100644 --- a/chargebee/models/attached_item/operations.py +++ b/chargebee/models/attached_item/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/attached_item/types.py b/chargebee/models/attached_item/types.py index 0642a3d..1a44e82 100644 --- a/chargebee/models/attached_item/types.py +++ b/chargebee/models/attached_item/types.py @@ -19,20 +19,3 @@ class Status(Enum): def __str__(self): return self.value - - -class AttachedItems(TypedDict): - id: Required[str] - parent_item_id: Required[str] - item_id: Required[str] - type: Required[Type] - status: NotRequired[Status] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - charge_on_event: Required[enums.ChargeOnEvent] - charge_once: Required[bool] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - channel: NotRequired[enums.Channel] diff --git a/chargebee/models/attribute/__init__.py b/chargebee/models/attribute/__init__.py index 3139f39..c29ff3e 100644 --- a/chargebee/models/attribute/__init__.py +++ b/chargebee/models/attribute/__init__.py @@ -1,3 +1,2 @@ from .operations import Attribute from .responses import AttributeResponse -from .types import Attributes diff --git a/chargebee/models/attribute/types.py b/chargebee/models/attribute/types.py index 98bc980..191e8d2 100644 --- a/chargebee/models/attribute/types.py +++ b/chargebee/models/attribute/types.py @@ -1,6 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Attributes(TypedDict): - name: Required[str] - value: Required[str] diff --git a/chargebee/models/business_entity/__init__.py b/chargebee/models/business_entity/__init__.py index 47afccc..18415b5 100644 --- a/chargebee/models/business_entity/__init__.py +++ b/chargebee/models/business_entity/__init__.py @@ -1,3 +1,3 @@ from .operations import BusinessEntity from .responses import BusinessEntityResponse -from .types import BusinessEntities, Status +from .types import Status diff --git a/chargebee/models/business_entity/types.py b/chargebee/models/business_entity/types.py index 589598e..a902e82 100644 --- a/chargebee/models/business_entity/types.py +++ b/chargebee/models/business_entity/types.py @@ -8,13 +8,3 @@ class Status(Enum): def __str__(self): return self.value - - -class BusinessEntities(TypedDict): - id: Required[str] - name: Required[str] - status: Required[Status] - deleted: Required[bool] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] diff --git a/chargebee/models/business_entity_transfer/__init__.py b/chargebee/models/business_entity_transfer/__init__.py index 19ecdc1..662d38e 100644 --- a/chargebee/models/business_entity_transfer/__init__.py +++ b/chargebee/models/business_entity_transfer/__init__.py @@ -1,3 +1,3 @@ from .operations import BusinessEntityTransfer from .responses import BusinessEntityTransferResponse -from .types import BusinessEntityTransfers, ResourceType, ReasonCode +from .types import ResourceType, ReasonCode diff --git a/chargebee/models/business_entity_transfer/types.py b/chargebee/models/business_entity_transfer/types.py index 9a3c812..99888c6 100644 --- a/chargebee/models/business_entity_transfer/types.py +++ b/chargebee/models/business_entity_transfer/types.py @@ -15,14 +15,3 @@ class ReasonCode(Enum): def __str__(self): return self.value - - -class BusinessEntityTransfers(TypedDict): - id: Required[str] - resource_type: Required[ResourceType] - resource_id: Required[str] - active_resource_id: Required[str] - destination_business_entity_id: Required[str] - source_business_entity_id: Required[str] - reason_code: Required[ReasonCode] - created_at: Required[int] diff --git a/chargebee/models/card/__init__.py b/chargebee/models/card/__init__.py index 231d570..8387499 100644 --- a/chargebee/models/card/__init__.py +++ b/chargebee/models/card/__init__.py @@ -1,3 +1,3 @@ from .operations import Card from .responses import CardResponse -from .types import Cards, Status, CardType, FundingType, PoweredBy +from .types import Status, CardType, FundingType, PoweredBy diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py index 479b242..e692043 100644 --- a/chargebee/models/card/operations.py +++ b/chargebee/models/card/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums class Card: diff --git a/chargebee/models/card/types.py b/chargebee/models/card/types.py index 0dff5d6..fe4a148 100644 --- a/chargebee/models/card/types.py +++ b/chargebee/models/card/types.py @@ -62,36 +62,5 @@ def __str__(self): return self.value -class Cards(TypedDict): - payment_source_id: Required[str] - status: Required[Status] - gateway: Required[enums.Gateway] - gateway_account_id: NotRequired[str] - ref_tx_id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - iin: Required[str] - last4: Required[str] - card_type: NotRequired[CardType] - funding_type: Required[FundingType] - expiry_month: Required[int] - expiry_year: Required[int] - issuing_country: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_country: NotRequired[str] - billing_zip: NotRequired[str] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - ip_address: NotRequired[str] - powered_by: NotRequired[PoweredBy] - customer_id: Required[str] - masked_number: NotRequired[str] - - class UpdateCardForCustomerCustomerParams(TypedDict): vat_number: NotRequired[str] diff --git a/chargebee/models/comment/__init__.py b/chargebee/models/comment/__init__.py index 8f72b7b..ff1e19f 100644 --- a/chargebee/models/comment/__init__.py +++ b/chargebee/models/comment/__init__.py @@ -1,3 +1,3 @@ from .operations import Comment from .responses import CommentResponse -from .types import Comments, Type +from .types import Type diff --git a/chargebee/models/comment/operations.py b/chargebee/models/comment/operations.py index 764422a..759c040 100644 --- a/chargebee/models/comment/operations.py +++ b/chargebee/models/comment/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/comment/types.py b/chargebee/models/comment/types.py index c80bb86..c096b9c 100644 --- a/chargebee/models/comment/types.py +++ b/chargebee/models/comment/types.py @@ -9,13 +9,3 @@ class Type(Enum): def __str__(self): return self.value - - -class Comments(TypedDict): - id: Required[str] - entity_type: Required[enums.EntityType] - added_by: NotRequired[str] - notes: Required[str] - created_at: Required[int] - type: Required[Type] - entity_id: Required[str] diff --git a/chargebee/models/contact/__init__.py b/chargebee/models/contact/__init__.py index dc53e05..b2b080d 100644 --- a/chargebee/models/contact/__init__.py +++ b/chargebee/models/contact/__init__.py @@ -1,3 +1,2 @@ from .operations import Contact from .responses import ContactResponse -from .types import Contacts diff --git a/chargebee/models/contact/types.py b/chargebee/models/contact/types.py index 03404bc..191e8d2 100644 --- a/chargebee/models/contact/types.py +++ b/chargebee/models/contact/types.py @@ -1,13 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Contacts(TypedDict): - id: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: Required[str] - phone: NotRequired[str] - label: NotRequired[str] - enabled: Required[bool] - send_account_email: Required[bool] - send_billing_email: Required[bool] diff --git a/chargebee/models/contract_term/__init__.py b/chargebee/models/contract_term/__init__.py index 58269c5..5637d07 100644 --- a/chargebee/models/contract_term/__init__.py +++ b/chargebee/models/contract_term/__init__.py @@ -1,3 +1,3 @@ from .operations import ContractTerm from .responses import ContractTermResponse -from .types import ContractTerms, Status, ActionAtTermEnd +from .types import Status, ActionAtTermEnd diff --git a/chargebee/models/contract_term/types.py b/chargebee/models/contract_term/types.py index 440f439..970e20d 100644 --- a/chargebee/models/contract_term/types.py +++ b/chargebee/models/contract_term/types.py @@ -20,18 +20,3 @@ class ActionAtTermEnd(Enum): def __str__(self): return self.value - - -class ContractTerms(TypedDict): - id: Required[str] - status: Required[Status] - contract_start: Required[int] - contract_end: Required[int] - billing_cycle: Required[int] - action_at_term_end: Required[ActionAtTermEnd] - total_contract_value: Required[int] - total_contract_value_before_tax: Required[int] - cancellation_cutoff_period: NotRequired[int] - created_at: Required[int] - subscription_id: Required[str] - remaining_billing_cycles: NotRequired[int] diff --git a/chargebee/models/coupon/__init__.py b/chargebee/models/coupon/__init__.py index 79872c5..0973359 100644 --- a/chargebee/models/coupon/__init__.py +++ b/chargebee/models/coupon/__init__.py @@ -1,7 +1,6 @@ from .operations import Coupon from .responses import CouponResponse from .types import ( - Coupons, ItemConstraint, ItemConstraintCriteria, CouponConstraint, diff --git a/chargebee/models/coupon/operations.py b/chargebee/models/coupon/operations.py index 716ecc3..678eb7d 100644 --- a/chargebee/models/coupon/operations.py +++ b/chargebee/models/coupon/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/coupon/types.py b/chargebee/models/coupon/types.py index a25f118..bf8c7c4 100644 --- a/chargebee/models/coupon/types.py +++ b/chargebee/models/coupon/types.py @@ -130,41 +130,6 @@ class CouponConstraint(TypedDict): value: NotRequired[str] -class Coupons(TypedDict): - id: Required[str] - name: Required[str] - invoice_name: NotRequired[str] - discount_type: Required[DiscountType] - discount_percentage: NotRequired[float] - discount_amount: NotRequired[int] - discount_quantity: NotRequired[int] - currency_code: NotRequired[str] - duration_type: Required[DurationType] - duration_month: NotRequired[int] - valid_till: NotRequired[int] - max_redemptions: NotRequired[int] - status: NotRequired[Status] - apply_discount_on: Required[ApplyDiscountOn] - apply_on: Required[ApplyOn] - plan_constraint: Required[PlanConstraint] - addon_constraint: Required[AddonConstraint] - created_at: Required[int] - archived_at: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - included_in_mrr: NotRequired[bool] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - plan_ids: NotRequired[List[str]] - addon_ids: NotRequired[List[str]] - item_constraints: NotRequired[List[ItemConstraint]] - item_constraint_criteria: NotRequired[List[ItemConstraintCriteria]] - redemptions: NotRequired[int] - invoice_notes: NotRequired[str] - meta_data: NotRequired[Dict[Any, Any]] - coupon_constraints: NotRequired[List[CouponConstraint]] - - class CreateForItemsItemConstraintParams(TypedDict): constraint: Required[ItemConstraintConstraint] item_type: Required[ItemConstraintItemType] diff --git a/chargebee/models/coupon_code/__init__.py b/chargebee/models/coupon_code/__init__.py index 0fc50bf..e147c5c 100644 --- a/chargebee/models/coupon_code/__init__.py +++ b/chargebee/models/coupon_code/__init__.py @@ -1,3 +1,3 @@ from .operations import CouponCode from .responses import CouponCodeResponse -from .types import CouponCodes, Status +from .types import Status diff --git a/chargebee/models/coupon_code/types.py b/chargebee/models/coupon_code/types.py index d51c137..9e43a6c 100644 --- a/chargebee/models/coupon_code/types.py +++ b/chargebee/models/coupon_code/types.py @@ -9,11 +9,3 @@ class Status(Enum): def __str__(self): return self.value - - -class CouponCodes(TypedDict): - code: Required[str] - status: Required[Status] - coupon_id: Required[str] - coupon_set_id: Required[str] - coupon_set_name: Required[str] diff --git a/chargebee/models/coupon_set/__init__.py b/chargebee/models/coupon_set/__init__.py index 8739705..6593116 100644 --- a/chargebee/models/coupon_set/__init__.py +++ b/chargebee/models/coupon_set/__init__.py @@ -1,3 +1,2 @@ from .operations import CouponSet from .responses import CouponSetResponse -from .types import CouponSets diff --git a/chargebee/models/coupon_set/types.py b/chargebee/models/coupon_set/types.py index 35b9ea7..191e8d2 100644 --- a/chargebee/models/coupon_set/types.py +++ b/chargebee/models/coupon_set/types.py @@ -1,11 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class CouponSets(TypedDict): - id: Required[str] - coupon_id: Required[str] - name: Required[str] - total_count: NotRequired[int] - redeemed_count: NotRequired[int] - archived_count: NotRequired[int] - meta_data: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/credit_note/__init__.py b/chargebee/models/credit_note/__init__.py index 9e464f8..0cfdb07 100644 --- a/chargebee/models/credit_note/__init__.py +++ b/chargebee/models/credit_note/__init__.py @@ -1,7 +1,6 @@ from .operations import CreditNote from .responses import CreditNoteResponse from .types import ( - CreditNotes, Einvoice, LineItem, Discount, diff --git a/chargebee/models/credit_note/types.py b/chargebee/models/credit_note/types.py index bded736..7508665 100644 --- a/chargebee/models/credit_note/types.py +++ b/chargebee/models/credit_note/types.py @@ -238,55 +238,6 @@ class TaxOrigin(TypedDict): registration_number: NotRequired[str] -class CreditNotes(TypedDict): - id: Required[str] - customer_id: Required[str] - subscription_id: NotRequired[str] - reference_invoice_id: NotRequired[str] - type: Required[Type] - reason_code: NotRequired[ReasonCode] - status: Required[Status] - vat_number: NotRequired[str] - date: NotRequired[int] - price_type: Required[enums.PriceType] - currency_code: Required[str] - total: NotRequired[int] - amount_allocated: NotRequired[int] - amount_refunded: NotRequired[int] - amount_available: NotRequired[int] - refunded_at: NotRequired[int] - voided_at: NotRequired[int] - generated_at: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - channel: NotRequired[enums.Channel] - einvoice: NotRequired[Einvoice] - sub_total: Required[int] - sub_total_in_local_currency: NotRequired[int] - total_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] - round_off_amount: NotRequired[int] - fractional_correction: NotRequired[int] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - line_item_tiers: NotRequired[List[LineItemTier]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] - linked_refunds: NotRequired[List[LinkedRefund]] - allocations: NotRequired[List[Allocation]] - deleted: Required[bool] - tax_category: NotRequired[str] - local_currency_exchange_rate: NotRequired[float] - create_reason_code: NotRequired[str] - vat_number_prefix: NotRequired[str] - business_entity_id: NotRequired[str] - shipping_address: NotRequired[ShippingAddress] - billing_address: NotRequired[BillingAddress] - site_details_at_creation: NotRequired[SiteDetailsAtCreation] - tax_origin: NotRequired[TaxOrigin] - - class CreateLineItemParams(TypedDict): reference_line_item_id: NotRequired[str] unit_amount: NotRequired[int] diff --git a/chargebee/models/credit_note_estimate/__init__.py b/chargebee/models/credit_note_estimate/__init__.py index 679b1ef..0ec1c92 100644 --- a/chargebee/models/credit_note_estimate/__init__.py +++ b/chargebee/models/credit_note_estimate/__init__.py @@ -1,7 +1,6 @@ from .operations import CreditNoteEstimate from .responses import CreditNoteEstimateResponse from .types import ( - CreditNoteEstimates, LineItem, Discount, Tax, diff --git a/chargebee/models/credit_note_estimate/types.py b/chargebee/models/credit_note_estimate/types.py index bf9eb64..38f11d4 100644 --- a/chargebee/models/credit_note_estimate/types.py +++ b/chargebee/models/credit_note_estimate/types.py @@ -125,22 +125,3 @@ class LineItemTier(TypedDict): ending_unit_in_decimal: NotRequired[str] quantity_used_in_decimal: NotRequired[str] unit_amount_in_decimal: NotRequired[str] - - -class CreditNoteEstimates(TypedDict): - reference_invoice_id: Required[str] - type: Required[Type] - price_type: Required[enums.PriceType] - currency_code: Required[str] - sub_total: Required[int] - total: Required[int] - amount_allocated: Required[int] - amount_available: Required[int] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - line_item_tiers: NotRequired[List[LineItemTier]] - round_off_amount: NotRequired[int] - customer_id: NotRequired[str] diff --git a/chargebee/models/currency/__init__.py b/chargebee/models/currency/__init__.py index c6beab8..cda0487 100644 --- a/chargebee/models/currency/__init__.py +++ b/chargebee/models/currency/__init__.py @@ -1,3 +1,3 @@ from .operations import Currency from .responses import CurrencyResponse -from .types import Currencies, ForexType +from .types import ForexType diff --git a/chargebee/models/currency/types.py b/chargebee/models/currency/types.py index c170a8e..0ef2015 100644 --- a/chargebee/models/currency/types.py +++ b/chargebee/models/currency/types.py @@ -8,12 +8,3 @@ class ForexType(Enum): def __str__(self): return self.value - - -class Currencies(TypedDict): - id: NotRequired[str] - enabled: Required[bool] - forex_type: NotRequired[ForexType] - currency_code: NotRequired[str] - is_base_currency: NotRequired[bool] - manual_exchange_rate: NotRequired[str] diff --git a/chargebee/models/customer/__init__.py b/chargebee/models/customer/__init__.py index 81cd2c5..5448ec1 100644 --- a/chargebee/models/customer/__init__.py +++ b/chargebee/models/customer/__init__.py @@ -1,7 +1,6 @@ from .operations import Customer from .responses import CustomerResponse from .types import ( - Customers, BillingAddress, ReferralUrl, Contact, diff --git a/chargebee/models/customer/types.py b/chargebee/models/customer/types.py index 77c8037..e9f037c 100644 --- a/chargebee/models/customer/types.py +++ b/chargebee/models/customer/types.py @@ -199,75 +199,6 @@ class ChildAccountAccess(TypedDict): send_payment_emails: Required[bool] -class Customers(TypedDict): - id: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - company: NotRequired[str] - vat_number: NotRequired[str] - auto_collection: Required[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - net_term_days: Required[int] - vat_number_validated_time: NotRequired[int] - vat_number_status: NotRequired[VatNumberStatus] - allow_direct_debit: Required[bool] - is_location_valid: NotRequired[bool] - created_at: Required[int] - created_from_ip: NotRequired[str] - exemption_details: NotRequired[List[Dict[Any, Any]]] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - locale: NotRequired[str] - billing_date: NotRequired[int] - billing_month: NotRequired[int] - billing_date_mode: NotRequired[enums.BillingDateMode] - billing_day_of_week: NotRequired[BillingDayOfWeek] - billing_day_of_week_mode: NotRequired[enums.BillingDayOfWeekMode] - pii_cleared: NotRequired[PiiCleared] - auto_close_invoices: NotRequired[bool] - channel: NotRequired[enums.Channel] - active_id: NotRequired[str] - card_status: NotRequired[CardStatus] - fraud_flag: NotRequired[FraudFlag] - primary_payment_source_id: NotRequired[str] - backup_payment_source_id: NotRequired[str] - billing_address: NotRequired[BillingAddress] - referral_urls: NotRequired[List[ReferralUrl]] - contacts: NotRequired[List[Contact]] - payment_method: NotRequired[PaymentMethod] - invoice_notes: NotRequired[str] - business_entity_id: NotRequired[str] - preferred_currency_code: NotRequired[str] - promotional_credits: Required[int] - unbilled_charges: Required[int] - refundable_credits: Required[int] - excess_payments: Required[int] - balances: NotRequired[List[Balance]] - entity_identifiers: NotRequired[List[EntityIdentifier]] - tax_providers_fields: NotRequired[List[TaxProvidersField]] - is_einvoice_enabled: NotRequired[bool] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - meta_data: NotRequired[Dict[Any, Any]] - deleted: Required[bool] - registered_for_gst: NotRequired[bool] - consolidated_invoicing: NotRequired[bool] - customer_type: NotRequired[enums.CustomerType] - business_customer_without_vat_number: NotRequired[bool] - client_profile_id: NotRequired[str] - relationship: NotRequired[Relationship] - use_default_hierarchy_settings: NotRequired[bool] - parent_account_access: NotRequired[ParentAccountAccess] - child_account_access: NotRequired[ChildAccountAccess] - vat_number_prefix: NotRequired[str] - entity_identifier_scheme: NotRequired[str] - entity_identifier_standard: NotRequired[str] - - class CreateCardParams(TypedDict): gateway: NotRequired[enums.Gateway] gateway_account_id: NotRequired[str] diff --git a/chargebee/models/customer_entitlement/__init__.py b/chargebee/models/customer_entitlement/__init__.py index 085f98b..40e3ce7 100644 --- a/chargebee/models/customer_entitlement/__init__.py +++ b/chargebee/models/customer_entitlement/__init__.py @@ -1,3 +1,2 @@ from .operations import CustomerEntitlement from .responses import CustomerEntitlementResponse -from .types import CustomerEntitlements diff --git a/chargebee/models/customer_entitlement/types.py b/chargebee/models/customer_entitlement/types.py index 9d92b02..191e8d2 100644 --- a/chargebee/models/customer_entitlement/types.py +++ b/chargebee/models/customer_entitlement/types.py @@ -1,10 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class CustomerEntitlements(TypedDict): - customer_id: Required[str] - subscription_id: NotRequired[str] - feature_id: NotRequired[str] - value: NotRequired[str] - name: NotRequired[str] - is_enabled: Required[bool] diff --git a/chargebee/models/differential_price/__init__.py b/chargebee/models/differential_price/__init__.py index df7eeec..6505b58 100644 --- a/chargebee/models/differential_price/__init__.py +++ b/chargebee/models/differential_price/__init__.py @@ -1,3 +1,3 @@ from .operations import DifferentialPrice from .responses import DifferentialPriceResponse -from .types import DifferentialPrices, Tier, ParentPeriod, Status +from .types import Tier, ParentPeriod, Status diff --git a/chargebee/models/differential_price/types.py b/chargebee/models/differential_price/types.py index fd42290..fd90e56 100644 --- a/chargebee/models/differential_price/types.py +++ b/chargebee/models/differential_price/types.py @@ -34,22 +34,6 @@ class ParentPeriod(TypedDict): period: NotRequired[List[Dict[Any, Any]]] -class DifferentialPrices(TypedDict): - id: Required[str] - item_price_id: Required[str] - parent_item_id: Required[str] - price: NotRequired[int] - price_in_decimal: NotRequired[str] - status: NotRequired[Status] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - modified_at: Required[int] - tiers: NotRequired[List[Tier]] - currency_code: Required[str] - parent_periods: NotRequired[List[ParentPeriod]] - - class CreateParentPeriodParams(TypedDict): period_unit: Required[ParentPeriodPeriodUnit] period: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/discount/__init__.py b/chargebee/models/discount/__init__.py index 2965af8..b40997b 100644 --- a/chargebee/models/discount/__init__.py +++ b/chargebee/models/discount/__init__.py @@ -1,3 +1,3 @@ from .operations import Discount from .responses import DiscountResponse -from .types import Discounts, Type +from .types import Type diff --git a/chargebee/models/discount/types.py b/chargebee/models/discount/types.py index 2e9e14c..317772a 100644 --- a/chargebee/models/discount/types.py +++ b/chargebee/models/discount/types.py @@ -9,23 +9,3 @@ class Type(Enum): def __str__(self): return self.value - - -class Discounts(TypedDict): - id: Required[str] - invoice_name: NotRequired[str] - type: Required[Type] - percentage: NotRequired[float] - amount: NotRequired[int] - currency_code: NotRequired[str] - duration_type: Required[enums.DurationType] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: Required[bool] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - created_at: Required[int] - apply_till: NotRequired[int] - applied_count: NotRequired[int] - coupon_id: Required[str] - index: Required[int] diff --git a/chargebee/models/download/__init__.py b/chargebee/models/download/__init__.py index f24997d..73e654b 100644 --- a/chargebee/models/download/__init__.py +++ b/chargebee/models/download/__init__.py @@ -1,3 +1,2 @@ from .operations import Download from .responses import DownloadResponse -from .types import Downloads diff --git a/chargebee/models/download/types.py b/chargebee/models/download/types.py index 31d971a..191e8d2 100644 --- a/chargebee/models/download/types.py +++ b/chargebee/models/download/types.py @@ -1,7 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Downloads(TypedDict): - download_url: Required[str] - valid_till: Required[int] - mime_type: NotRequired[str] diff --git a/chargebee/models/entitlement/__init__.py b/chargebee/models/entitlement/__init__.py index be80fe7..152ed3b 100644 --- a/chargebee/models/entitlement/__init__.py +++ b/chargebee/models/entitlement/__init__.py @@ -1,3 +1,3 @@ from .operations import Entitlement from .responses import EntitlementResponse -from .types import Entitlements, EntityType +from .types import EntityType diff --git a/chargebee/models/entitlement/types.py b/chargebee/models/entitlement/types.py index ba146be..bfd05cb 100644 --- a/chargebee/models/entitlement/types.py +++ b/chargebee/models/entitlement/types.py @@ -13,16 +13,6 @@ def __str__(self): return self.value -class Entitlements(TypedDict): - id: Required[str] - entity_id: NotRequired[str] - entity_type: NotRequired[EntityType] - feature_id: NotRequired[str] - feature_name: NotRequired[str] - value: NotRequired[str] - name: NotRequired[str] - - class CreateEntitlementParams(TypedDict): entity_id: Required[str] feature_id: Required[str] diff --git a/chargebee/models/entitlement_override/__init__.py b/chargebee/models/entitlement_override/__init__.py index 2cd69ac..5845b3e 100644 --- a/chargebee/models/entitlement_override/__init__.py +++ b/chargebee/models/entitlement_override/__init__.py @@ -1,3 +1,3 @@ from .operations import EntitlementOverride from .responses import EntitlementOverrideResponse -from .types import EntitlementOverrides, ScheduleStatus +from .types import ScheduleStatus diff --git a/chargebee/models/entitlement_override/types.py b/chargebee/models/entitlement_override/types.py index 2e3a1af..598564f 100644 --- a/chargebee/models/entitlement_override/types.py +++ b/chargebee/models/entitlement_override/types.py @@ -11,19 +11,6 @@ def __str__(self): return self.value -class EntitlementOverrides(TypedDict): - id: Required[str] - entity_id: NotRequired[str] - entity_type: NotRequired[str] - feature_id: NotRequired[str] - feature_name: NotRequired[str] - value: NotRequired[str] - name: NotRequired[str] - expires_at: NotRequired[int] - effective_from: NotRequired[int] - schedule_status: NotRequired[ScheduleStatus] - - class AddEntitlementOverrideForSubscriptionEntitlementOverrideParams(TypedDict): feature_id: Required[str] value: NotRequired[str] diff --git a/chargebee/models/estimate/__init__.py b/chargebee/models/estimate/__init__.py index 8d2146a..0475835 100644 --- a/chargebee/models/estimate/__init__.py +++ b/chargebee/models/estimate/__init__.py @@ -1,3 +1,2 @@ from .operations import Estimate from .responses import EstimateResponse -from .types import Estimates diff --git a/chargebee/models/estimate/types.py b/chargebee/models/estimate/types.py index 7a2f04e..4264342 100644 --- a/chargebee/models/estimate/types.py +++ b/chargebee/models/estimate/types.py @@ -24,19 +24,6 @@ def __str__(self): return self.value -class Estimates(TypedDict): - created_at: Required[int] - subscription_estimate: NotRequired[subscription_estimate.SubscriptionEstimates] - subscription_estimates: NotRequired[ - List[subscription_estimate.SubscriptionEstimates] - ] - invoice_estimate: NotRequired[invoice_estimate.InvoiceEstimates] - invoice_estimates: NotRequired[List[invoice_estimate.InvoiceEstimates]] - next_invoice_estimate: NotRequired[invoice_estimate.InvoiceEstimates] - credit_note_estimates: NotRequired[List[credit_note_estimate.CreditNoteEstimate]] - unbilled_charge_estimates: NotRequired[List[unbilled_charge.UnbilledCharge]] - - class CreateSubscriptionSubscriptionParams(TypedDict): id: NotRequired[str] plan_id: Required[str] diff --git a/chargebee/models/event/__init__.py b/chargebee/models/event/__init__.py index 2a42706..19028fc 100644 --- a/chargebee/models/event/__init__.py +++ b/chargebee/models/event/__init__.py @@ -1,3 +1,3 @@ from .operations import Event from .responses import EventResponse -from .types import Events, Webhook, WebhookStatus +from .types import Webhook, WebhookStatus diff --git a/chargebee/models/event/types.py b/chargebee/models/event/types.py index 818dc3e..82a43b3 100644 --- a/chargebee/models/event/types.py +++ b/chargebee/models/event/types.py @@ -32,17 +32,3 @@ def __str__(self): class Webhook(TypedDict): id: Required[str] webhook_status: Required[WebhookWebhookStatus] - - -class Events(TypedDict): - id: Required[str] - occurred_at: Required[int] - source: Required[enums.Source] - user: NotRequired[str] - webhook_status: Required[WebhookStatus] - webhook_failure_reason: NotRequired[str] - webhooks: NotRequired[List[Webhook]] - event_type: NotRequired[enums.EventType] - api_version: NotRequired[enums.ApiVersion] - content: Required[Dict[Any, Any]] - origin_user: NotRequired[str] diff --git a/chargebee/models/export/__init__.py b/chargebee/models/export/__init__.py index 64675e1..e5ace51 100644 --- a/chargebee/models/export/__init__.py +++ b/chargebee/models/export/__init__.py @@ -1,3 +1,3 @@ from .operations import Export from .responses import ExportResponse -from .types import Exports, Download, MimeType, Status +from .types import Download, MimeType, Status diff --git a/chargebee/models/export/types.py b/chargebee/models/export/types.py index 6d7f7b7..77ca480 100644 --- a/chargebee/models/export/types.py +++ b/chargebee/models/export/types.py @@ -26,15 +26,6 @@ class Download(TypedDict): mime_type: NotRequired[str] -class Exports(TypedDict): - id: Required[str] - operation_type: Required[str] - mime_type: Required[MimeType] - status: Required[Status] - created_at: Required[int] - download: NotRequired[Download] - - class RevenueRecognitionInvoiceParams(TypedDict): Id: NotRequired[Filters.StringFilter] Recurring: NotRequired[Filters.BooleanFilter] diff --git a/chargebee/models/feature/__init__.py b/chargebee/models/feature/__init__.py index 6545f62..02550c6 100644 --- a/chargebee/models/feature/__init__.py +++ b/chargebee/models/feature/__init__.py @@ -1,3 +1,3 @@ from .operations import Feature from .responses import FeatureResponse -from .types import Features, Level, Status, Type +from .types import Level, Status, Type diff --git a/chargebee/models/feature/types.py b/chargebee/models/feature/types.py index 41bd693..df48170 100644 --- a/chargebee/models/feature/types.py +++ b/chargebee/models/feature/types.py @@ -28,19 +28,6 @@ class Level(TypedDict): is_unlimited: Required[bool] -class Features(TypedDict): - id: Required[str] - name: Required[str] - description: NotRequired[str] - status: NotRequired[Status] - type: NotRequired[Type] - unit: NotRequired[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - levels: NotRequired[List[Level]] - - class CreateLevelParams(TypedDict): name: NotRequired[str] value: NotRequired[str] diff --git a/chargebee/models/gateway_error_detail/__init__.py b/chargebee/models/gateway_error_detail/__init__.py index 7079a5c..e15bbb5 100644 --- a/chargebee/models/gateway_error_detail/__init__.py +++ b/chargebee/models/gateway_error_detail/__init__.py @@ -1,3 +1,2 @@ from .operations import GatewayErrorDetail from .responses import GatewayErrorDetailResponse -from .types import GatewayErrorDetails diff --git a/chargebee/models/gateway_error_detail/types.py b/chargebee/models/gateway_error_detail/types.py index 6c50577..191e8d2 100644 --- a/chargebee/models/gateway_error_detail/types.py +++ b/chargebee/models/gateway_error_detail/types.py @@ -1,17 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class GatewayErrorDetails(TypedDict): - request_id: NotRequired[str] - error_category: NotRequired[str] - error_code: NotRequired[str] - error_message: NotRequired[str] - decline_code: NotRequired[str] - decline_message: NotRequired[str] - network_error_code: NotRequired[str] - network_error_message: NotRequired[str] - error_field: NotRequired[str] - recommendation_code: NotRequired[str] - recommendation_message: NotRequired[str] - processor_error_code: NotRequired[str] - processor_error_message: NotRequired[str] diff --git a/chargebee/models/gift/__init__.py b/chargebee/models/gift/__init__.py index cdf8bc0..b2a7065 100644 --- a/chargebee/models/gift/__init__.py +++ b/chargebee/models/gift/__init__.py @@ -1,3 +1,3 @@ from .operations import Gift from .responses import GiftResponse -from .types import Gifts, Gifter, GiftReceiver, GiftTimeline, Status +from .types import Gifter, GiftReceiver, GiftTimeline, Status diff --git a/chargebee/models/gift/types.py b/chargebee/models/gift/types.py index 40e351c..21613de 100644 --- a/chargebee/models/gift/types.py +++ b/chargebee/models/gift/types.py @@ -35,20 +35,6 @@ class GiftTimeline(TypedDict): occurred_at: NotRequired[int] -class Gifts(TypedDict): - id: Required[str] - status: Required[Status] - scheduled_at: NotRequired[int] - auto_claim: Required[bool] - no_expiry: Required[bool] - claim_expiry_date: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - gifter: Required[Gifter] - gift_receiver: Required[GiftReceiver] - gift_timelines: NotRequired[List[GiftTimeline]] - - class CreateGifterParams(TypedDict): customer_id: Required[str] signature: Required[str] diff --git a/chargebee/models/hierarchy/__init__.py b/chargebee/models/hierarchy/__init__.py index 96f134c..891128c 100644 --- a/chargebee/models/hierarchy/__init__.py +++ b/chargebee/models/hierarchy/__init__.py @@ -1,3 +1,2 @@ from .operations import Hierarchy from .responses import HierarchyResponse -from .types import Hierarchies diff --git a/chargebee/models/hierarchy/types.py b/chargebee/models/hierarchy/types.py index 6561246..191e8d2 100644 --- a/chargebee/models/hierarchy/types.py +++ b/chargebee/models/hierarchy/types.py @@ -1,9 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Hierarchies(TypedDict): - customer_id: Required[str] - parent_id: NotRequired[str] - payment_owner_id: Required[str] - invoice_owner_id: Required[str] - children_ids: NotRequired[List[str]] diff --git a/chargebee/models/hosted_page/__init__.py b/chargebee/models/hosted_page/__init__.py index 5fe8ba5..948a035 100644 --- a/chargebee/models/hosted_page/__init__.py +++ b/chargebee/models/hosted_page/__init__.py @@ -1,3 +1,3 @@ from .operations import HostedPage from .responses import HostedPageResponse -from .types import HostedPages, Type, State, FailureReason +from .types import Type, State, FailureReason diff --git a/chargebee/models/hosted_page/types.py b/chargebee/models/hosted_page/types.py index aa1b44e..5a0acbc 100644 --- a/chargebee/models/hosted_page/types.py +++ b/chargebee/models/hosted_page/types.py @@ -39,23 +39,6 @@ def __str__(self): return self.value -class HostedPages(TypedDict): - id: NotRequired[str] - type: NotRequired[Type] - url: NotRequired[str] - state: NotRequired[State] - failure_reason: NotRequired[FailureReason] - pass_thru_content: NotRequired[str] - embed: Required[bool] - created_at: NotRequired[int] - expires_at: NotRequired[int] - content: Required[Dict[Any, Any]] - updated_at: NotRequired[int] - resource_version: NotRequired[int] - checkout_info: NotRequired[Dict[Any, Any]] - business_entity_id: NotRequired[str] - - class CheckoutNewSubscriptionParams(TypedDict): id: NotRequired[str] plan_id: Required[str] diff --git a/chargebee/models/impacted_item/__init__.py b/chargebee/models/impacted_item/__init__.py index a05d4b2..9d82cd3 100644 --- a/chargebee/models/impacted_item/__init__.py +++ b/chargebee/models/impacted_item/__init__.py @@ -1,3 +1,3 @@ from .operations import ImpactedItem from .responses import ImpactedItemResponse -from .types import ImpactedItems, Download +from .types import Download diff --git a/chargebee/models/impacted_item/types.py b/chargebee/models/impacted_item/types.py index 49e6bd5..1e17062 100644 --- a/chargebee/models/impacted_item/types.py +++ b/chargebee/models/impacted_item/types.py @@ -5,9 +5,3 @@ class Download(TypedDict): download_url: Required[str] valid_till: Required[int] mime_type: NotRequired[str] - - -class ImpactedItems(TypedDict): - count: NotRequired[int] - download: NotRequired[Download] - items: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/impacted_item_price/__init__.py b/chargebee/models/impacted_item_price/__init__.py index 936bb78..eaf18bc 100644 --- a/chargebee/models/impacted_item_price/__init__.py +++ b/chargebee/models/impacted_item_price/__init__.py @@ -1,3 +1,3 @@ from .operations import ImpactedItemPrice from .responses import ImpactedItemPriceResponse -from .types import ImpactedItemPrices, Download +from .types import Download diff --git a/chargebee/models/impacted_item_price/types.py b/chargebee/models/impacted_item_price/types.py index 1596acf..1e17062 100644 --- a/chargebee/models/impacted_item_price/types.py +++ b/chargebee/models/impacted_item_price/types.py @@ -5,9 +5,3 @@ class Download(TypedDict): download_url: Required[str] valid_till: Required[int] mime_type: NotRequired[str] - - -class ImpactedItemPrices(TypedDict): - count: NotRequired[int] - download: NotRequired[Download] - item_prices: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/impacted_subscription/__init__.py b/chargebee/models/impacted_subscription/__init__.py index aa666ad..46b10f6 100644 --- a/chargebee/models/impacted_subscription/__init__.py +++ b/chargebee/models/impacted_subscription/__init__.py @@ -1,3 +1,3 @@ from .operations import ImpactedSubscription from .responses import ImpactedSubscriptionResponse -from .types import ImpactedSubscriptions, Download +from .types import Download diff --git a/chargebee/models/impacted_subscription/types.py b/chargebee/models/impacted_subscription/types.py index 21aed30..1e17062 100644 --- a/chargebee/models/impacted_subscription/types.py +++ b/chargebee/models/impacted_subscription/types.py @@ -5,9 +5,3 @@ class Download(TypedDict): download_url: Required[str] valid_till: Required[int] mime_type: NotRequired[str] - - -class ImpactedSubscriptions(TypedDict): - count: NotRequired[int] - download: NotRequired[Download] - subscription_ids: NotRequired[List[Dict[Any, Any]]] diff --git a/chargebee/models/in_app_subscription/__init__.py b/chargebee/models/in_app_subscription/__init__.py index 85a7d4a..da3ca00 100644 --- a/chargebee/models/in_app_subscription/__init__.py +++ b/chargebee/models/in_app_subscription/__init__.py @@ -1,3 +1,3 @@ from .operations import InAppSubscription from .responses import InAppSubscriptionResponse -from .types import InAppSubscriptions, StoreStatus +from .types import StoreStatus diff --git a/chargebee/models/in_app_subscription/types.py b/chargebee/models/in_app_subscription/types.py index f532825..04af273 100644 --- a/chargebee/models/in_app_subscription/types.py +++ b/chargebee/models/in_app_subscription/types.py @@ -12,15 +12,6 @@ def __str__(self): return self.value -class InAppSubscriptions(TypedDict): - app_id: Required[str] - subscription_id: Required[str] - customer_id: NotRequired[str] - plan_id: NotRequired[str] - store_status: NotRequired[StoreStatus] - invoice_id: NotRequired[str] - - class ProcessReceiptProductParams(TypedDict): id: Required[str] currency_code: Required[str] diff --git a/chargebee/models/installment/__init__.py b/chargebee/models/installment/__init__.py index 8bdf519..2b1cf1b 100644 --- a/chargebee/models/installment/__init__.py +++ b/chargebee/models/installment/__init__.py @@ -1,3 +1,3 @@ from .operations import Installment from .responses import InstallmentResponse -from .types import Installments, Status +from .types import Status diff --git a/chargebee/models/installment/types.py b/chargebee/models/installment/types.py index 9d83870..0fb4c60 100644 --- a/chargebee/models/installment/types.py +++ b/chargebee/models/installment/types.py @@ -9,14 +9,3 @@ class Status(Enum): def __str__(self): return self.value - - -class Installments(TypedDict): - id: Required[str] - invoice_id: Required[str] - date: Required[int] - amount: Required[int] - status: Required[Status] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] diff --git a/chargebee/models/installment_config/__init__.py b/chargebee/models/installment_config/__init__.py index b479f0b..54eba36 100644 --- a/chargebee/models/installment_config/__init__.py +++ b/chargebee/models/installment_config/__init__.py @@ -1,3 +1,3 @@ from .operations import InstallmentConfig from .responses import InstallmentConfigResponse -from .types import InstallmentConfigs, Installment, PeriodUnit +from .types import Installment, PeriodUnit diff --git a/chargebee/models/installment_config/types.py b/chargebee/models/installment_config/types.py index 7d42166..8710dd6 100644 --- a/chargebee/models/installment_config/types.py +++ b/chargebee/models/installment_config/types.py @@ -16,19 +16,6 @@ class Installment(TypedDict): amount_percentage: NotRequired[float] -class InstallmentConfigs(TypedDict): - id: Required[str] - description: NotRequired[str] - number_of_installments: Required[int] - period_unit: Required[PeriodUnit] - period: NotRequired[int] - preferred_day: NotRequired[int] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - installments: NotRequired[List[Installment]] - - class CreateInstallmentParams(TypedDict): period: NotRequired[int] amount_percentage: NotRequired[float] diff --git a/chargebee/models/installment_detail/__init__.py b/chargebee/models/installment_detail/__init__.py index b1278fb..f97e23f 100644 --- a/chargebee/models/installment_detail/__init__.py +++ b/chargebee/models/installment_detail/__init__.py @@ -1,3 +1,3 @@ from .operations import InstallmentDetail from .responses import InstallmentDetailResponse -from .types import InstallmentDetails, Installment +from .types import Installment diff --git a/chargebee/models/installment_detail/types.py b/chargebee/models/installment_detail/types.py index e77c73e..2c691c8 100644 --- a/chargebee/models/installment_detail/types.py +++ b/chargebee/models/installment_detail/types.py @@ -20,10 +20,3 @@ class Installment(TypedDict): created_at: Required[int] resource_version: NotRequired[int] updated_at: NotRequired[int] - - -class InstallmentDetails(TypedDict): - id: NotRequired[str] - invoice_id: NotRequired[str] - amount: NotRequired[int] - installments: NotRequired[List[Installment]] diff --git a/chargebee/models/invoice/__init__.py b/chargebee/models/invoice/__init__.py index d7ad80f..4b2a293 100644 --- a/chargebee/models/invoice/__init__.py +++ b/chargebee/models/invoice/__init__.py @@ -1,7 +1,6 @@ from .operations import Invoice from .responses import InvoiceResponse from .types import ( - Invoices, LineItem, Discount, LineItemDiscount, diff --git a/chargebee/models/invoice/types.py b/chargebee/models/invoice/types.py index e28b0cd..843b49d 100644 --- a/chargebee/models/invoice/types.py +++ b/chargebee/models/invoice/types.py @@ -321,75 +321,6 @@ class TaxOrigin(TypedDict): registration_number: NotRequired[str] -class Invoices(TypedDict): - id: Required[str] - po_number: NotRequired[str] - customer_id: Required[str] - subscription_id: NotRequired[str] - recurring: Required[bool] - status: Required[Status] - vat_number: NotRequired[str] - price_type: Required[enums.PriceType] - date: NotRequired[int] - due_date: NotRequired[int] - net_term_days: NotRequired[int] - exchange_rate: NotRequired[float] - currency_code: Required[str] - total: NotRequired[int] - amount_paid: NotRequired[int] - amount_adjusted: NotRequired[int] - write_off_amount: NotRequired[int] - credits_applied: NotRequired[int] - amount_due: NotRequired[int] - paid_at: NotRequired[int] - dunning_status: NotRequired[DunningStatus] - next_retry_at: NotRequired[int] - voided_at: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - sub_total: Required[int] - sub_total_in_local_currency: NotRequired[int] - total_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] - tax: Required[int] - local_currency_exchange_rate: NotRequired[float] - first_invoice: NotRequired[bool] - new_sales_amount: NotRequired[int] - has_advance_charges: NotRequired[bool] - term_finalized: Required[bool] - is_gifted: Required[bool] - generated_at: NotRequired[int] - expected_payment_date: NotRequired[int] - amount_to_collect: NotRequired[int] - round_off_amount: NotRequired[int] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] - line_item_tiers: NotRequired[List[LineItemTier]] - linked_payments: NotRequired[List[LinkedPayment]] - dunning_attempts: NotRequired[List[DunningAttempt]] - applied_credits: NotRequired[List[AppliedCredit]] - adjustment_credit_notes: NotRequired[List[AdjustmentCreditNote]] - issued_credit_notes: NotRequired[List[IssuedCreditNote]] - linked_orders: NotRequired[List[LinkedOrder]] - notes: NotRequired[List[Note]] - shipping_address: NotRequired[ShippingAddress] - statement_descriptor: NotRequired[StatementDescriptor] - billing_address: NotRequired[BillingAddress] - einvoice: NotRequired[Einvoice] - payment_owner: NotRequired[str] - void_reason_code: NotRequired[str] - deleted: Required[bool] - tax_category: NotRequired[str] - vat_number_prefix: NotRequired[str] - channel: NotRequired[enums.Channel] - business_entity_id: NotRequired[str] - site_details_at_creation: NotRequired[SiteDetailsAtCreation] - tax_origin: NotRequired[TaxOrigin] - - class CreateAddonParams(TypedDict): id: NotRequired[str] quantity: NotRequired[int] diff --git a/chargebee/models/invoice_estimate/__init__.py b/chargebee/models/invoice_estimate/__init__.py index b6bb8c8..521c66f 100644 --- a/chargebee/models/invoice_estimate/__init__.py +++ b/chargebee/models/invoice_estimate/__init__.py @@ -1,11 +1,3 @@ from .operations import InvoiceEstimate from .responses import InvoiceEstimateResponse -from .types import ( - InvoiceEstimates, - LineItem, - Discount, - Tax, - LineItemTax, - LineItemTier, - LineItemDiscount, -) +from .types import LineItem, Discount, Tax, LineItemTax, LineItemTier, LineItemDiscount diff --git a/chargebee/models/invoice_estimate/types.py b/chargebee/models/invoice_estimate/types.py index 76684a9..7643368 100644 --- a/chargebee/models/invoice_estimate/types.py +++ b/chargebee/models/invoice_estimate/types.py @@ -117,22 +117,3 @@ class LineItemDiscount(TypedDict): coupon_id: NotRequired[str] entity_id: NotRequired[str] discount_amount: Required[int] - - -class InvoiceEstimates(TypedDict): - recurring: Required[bool] - price_type: Required[enums.PriceType] - currency_code: Required[str] - sub_total: Required[int] - total: NotRequired[int] - credits_applied: NotRequired[int] - amount_paid: NotRequired[int] - amount_due: NotRequired[int] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] - line_item_tiers: NotRequired[List[LineItemTier]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - round_off_amount: NotRequired[int] - customer_id: NotRequired[str] diff --git a/chargebee/models/item/__init__.py b/chargebee/models/item/__init__.py index 2f5a4fb..da0b9af 100644 --- a/chargebee/models/item/__init__.py +++ b/chargebee/models/item/__init__.py @@ -1,10 +1,3 @@ from .operations import Item from .responses import ItemResponse -from .types import ( - Items, - ApplicableItem, - Status, - Type, - ItemApplicability, - UsageCalculation, -) +from .types import ApplicableItem, Status, Type, ItemApplicability, UsageCalculation diff --git a/chargebee/models/item/types.py b/chargebee/models/item/types.py index a2e6c3e..fbaa256 100644 --- a/chargebee/models/item/types.py +++ b/chargebee/models/item/types.py @@ -40,30 +40,3 @@ def __str__(self): class ApplicableItem(TypedDict): id: NotRequired[str] - - -class Items(TypedDict): - id: Required[str] - name: Required[str] - external_name: NotRequired[str] - description: NotRequired[str] - status: NotRequired[Status] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - item_family_id: NotRequired[str] - type: Required[Type] - is_shippable: NotRequired[bool] - is_giftable: Required[bool] - redirect_url: NotRequired[str] - enabled_for_checkout: Required[bool] - enabled_in_portal: Required[bool] - included_in_mrr: NotRequired[bool] - item_applicability: Required[ItemApplicability] - gift_claim_redirect_url: NotRequired[str] - unit: NotRequired[str] - metered: Required[bool] - usage_calculation: NotRequired[UsageCalculation] - archived_at: NotRequired[int] - channel: NotRequired[enums.Channel] - applicable_items: NotRequired[List[ApplicableItem]] - metadata: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/item_entitlement/__init__.py b/chargebee/models/item_entitlement/__init__.py index e7999ed..64e4fec 100644 --- a/chargebee/models/item_entitlement/__init__.py +++ b/chargebee/models/item_entitlement/__init__.py @@ -1,3 +1,3 @@ from .operations import ItemEntitlement from .responses import ItemEntitlementResponse -from .types import ItemEntitlements, ItemType +from .types import ItemType diff --git a/chargebee/models/item_entitlement/types.py b/chargebee/models/item_entitlement/types.py index 6d44639..cd8e149 100644 --- a/chargebee/models/item_entitlement/types.py +++ b/chargebee/models/item_entitlement/types.py @@ -13,16 +13,6 @@ def __str__(self): return self.value -class ItemEntitlements(TypedDict): - id: Required[str] - item_id: NotRequired[str] - item_type: NotRequired[ItemType] - feature_id: NotRequired[str] - feature_name: NotRequired[str] - value: NotRequired[str] - name: NotRequired[str] - - class AddItemEntitlementsItemEntitlementParams(TypedDict): item_id: Required[str] item_type: NotRequired[ItemType] diff --git a/chargebee/models/item_family/__init__.py b/chargebee/models/item_family/__init__.py index 0958dba..d2a2d8a 100644 --- a/chargebee/models/item_family/__init__.py +++ b/chargebee/models/item_family/__init__.py @@ -1,3 +1,3 @@ from .operations import ItemFamily from .responses import ItemFamilyResponse -from .types import ItemFamilies, Status +from .types import Status diff --git a/chargebee/models/item_family/types.py b/chargebee/models/item_family/types.py index e1368ad..6d0e9bb 100644 --- a/chargebee/models/item_family/types.py +++ b/chargebee/models/item_family/types.py @@ -9,13 +9,3 @@ class Status(Enum): def __str__(self): return self.value - - -class ItemFamilies(TypedDict): - id: Required[str] - name: Required[str] - description: NotRequired[str] - status: NotRequired[Status] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - channel: NotRequired[enums.Channel] diff --git a/chargebee/models/item_price/__init__.py b/chargebee/models/item_price/__init__.py index 434545d..da7cce1 100644 --- a/chargebee/models/item_price/__init__.py +++ b/chargebee/models/item_price/__init__.py @@ -1,7 +1,6 @@ from .operations import ItemPrice from .responses import ItemPriceResponse from .types import ( - ItemPrices, Tier, TaxDetail, TaxProvidersField, diff --git a/chargebee/models/item_price/types.py b/chargebee/models/item_price/types.py index df0b7ec..844d610 100644 --- a/chargebee/models/item_price/types.py +++ b/chargebee/models/item_price/types.py @@ -92,52 +92,6 @@ class AccountingDetail(TypedDict): accounting_category4: NotRequired[str] -class ItemPrices(TypedDict): - id: Required[str] - name: Required[str] - item_family_id: NotRequired[str] - item_id: NotRequired[str] - description: NotRequired[str] - status: NotRequired[Status] - external_name: NotRequired[str] - price_variant_id: NotRequired[str] - proration_type: NotRequired[ProrationType] - pricing_model: Required[enums.PricingModel] - price: NotRequired[int] - price_in_decimal: NotRequired[str] - period: NotRequired[int] - currency_code: Required[str] - period_unit: NotRequired[PeriodUnit] - trial_period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] - trial_end_action: NotRequired[TrialEndAction] - shipping_period: NotRequired[int] - shipping_period_unit: NotRequired[ShippingPeriodUnit] - billing_cycles: NotRequired[int] - free_quantity: Required[int] - free_quantity_in_decimal: NotRequired[str] - channel: NotRequired[enums.Channel] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - usage_accumulation_reset_frequency: NotRequired[ - enums.UsageAccumulationResetFrequency - ] - archived_at: NotRequired[int] - invoice_notes: NotRequired[str] - tiers: NotRequired[List[Tier]] - is_taxable: NotRequired[bool] - tax_detail: NotRequired[TaxDetail] - tax_providers_fields: NotRequired[List[TaxProvidersField]] - accounting_detail: NotRequired[AccountingDetail] - metadata: NotRequired[Dict[Any, Any]] - item_type: NotRequired[enums.ItemType] - archivable: NotRequired[bool] - parent_item_id: NotRequired[str] - show_description_in_invoices: NotRequired[bool] - show_description_in_quotes: NotRequired[bool] - - class CreateTierParams(TypedDict): starting_unit: NotRequired[int] ending_unit: NotRequired[int] diff --git a/chargebee/models/metadata/__init__.py b/chargebee/models/metadata/__init__.py index a62e82c..4709d09 100644 --- a/chargebee/models/metadata/__init__.py +++ b/chargebee/models/metadata/__init__.py @@ -1,3 +1,2 @@ from .operations import Metadata from .responses import MetadataResponse -from .types import Metadata diff --git a/chargebee/models/metadata/types.py b/chargebee/models/metadata/types.py index b1f665e..191e8d2 100644 --- a/chargebee/models/metadata/types.py +++ b/chargebee/models/metadata/types.py @@ -1,5 +1 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Metadata(TypedDict): - change_type: NotRequired[str] diff --git a/chargebee/models/order/__init__.py b/chargebee/models/order/__init__.py index c452184..2c5c0df 100644 --- a/chargebee/models/order/__init__.py +++ b/chargebee/models/order/__init__.py @@ -1,7 +1,6 @@ from .operations import Order from .responses import OrderResponse from .types import ( - Orders, OrderLineItem, ShippingAddress, BillingAddress, diff --git a/chargebee/models/order/types.py b/chargebee/models/order/types.py index e345c0e..19882cb 100644 --- a/chargebee/models/order/types.py +++ b/chargebee/models/order/types.py @@ -222,65 +222,6 @@ class ResentOrder(TypedDict): amount: NotRequired[int] -class Orders(TypedDict): - id: Required[str] - document_number: NotRequired[str] - invoice_id: NotRequired[str] - subscription_id: NotRequired[str] - customer_id: NotRequired[str] - status: NotRequired[Status] - cancellation_reason: NotRequired[CancellationReason] - payment_status: NotRequired[PaymentStatus] - order_type: NotRequired[OrderType] - price_type: Required[enums.PriceType] - reference_id: NotRequired[str] - fulfillment_status: NotRequired[str] - order_date: NotRequired[int] - shipping_date: NotRequired[int] - note: NotRequired[str] - tracking_id: NotRequired[str] - tracking_url: NotRequired[str] - batch_id: NotRequired[str] - created_by: NotRequired[str] - shipment_carrier: NotRequired[str] - invoice_round_off_amount: NotRequired[int] - tax: NotRequired[int] - amount_paid: NotRequired[int] - amount_adjusted: NotRequired[int] - refundable_credits_issued: NotRequired[int] - refundable_credits: NotRequired[int] - rounding_adjustement: NotRequired[int] - paid_on: NotRequired[int] - shipping_cut_off_date: NotRequired[int] - created_at: Required[int] - status_update_at: NotRequired[int] - delivered_at: NotRequired[int] - shipped_at: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - cancelled_at: NotRequired[int] - resent_status: NotRequired[ResentStatus] - is_resent: Required[bool] - original_order_id: NotRequired[str] - order_line_items: NotRequired[List[OrderLineItem]] - shipping_address: NotRequired[ShippingAddress] - billing_address: NotRequired[BillingAddress] - discount: NotRequired[int] - sub_total: NotRequired[int] - total: NotRequired[int] - line_item_taxes: NotRequired[List[LineItemTax]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - linked_credit_notes: NotRequired[List[LinkedCreditNote]] - deleted: Required[bool] - currency_code: NotRequired[str] - is_gifted: NotRequired[bool] - gift_note: NotRequired[str] - gift_id: NotRequired[str] - resend_reason: NotRequired[str] - resent_orders: NotRequired[List[ResentOrder]] - business_entity_id: NotRequired[str] - - class UpdateOrderLineItemParams(TypedDict): id: NotRequired[str] status: NotRequired[OrderLineItemStatus] diff --git a/chargebee/models/payment_intent/__init__.py b/chargebee/models/payment_intent/__init__.py index 9106803..e54f2d0 100644 --- a/chargebee/models/payment_intent/__init__.py +++ b/chargebee/models/payment_intent/__init__.py @@ -1,3 +1,3 @@ from .operations import PaymentIntent from .responses import PaymentIntentResponse -from .types import PaymentIntents, PaymentAttempt, Status, PaymentMethodType +from .types import PaymentAttempt, Status, PaymentMethodType diff --git a/chargebee/models/payment_intent/responses.py b/chargebee/models/payment_intent/responses.py index 411c647..f3ddb35 100644 --- a/chargebee/models/payment_intent/responses.py +++ b/chargebee/models/payment_intent/responses.py @@ -14,7 +14,7 @@ class PaymentAttemptResponse(Model): error_text: str = None created_at: int = None modified_at: int = None - error_detail: gateway_error_detail.GatewayErrorDetails = None + error_detail: gateway_error_detail.GatewayErrorDetailResponse = None @dataclass diff --git a/chargebee/models/payment_intent/types.py b/chargebee/models/payment_intent/types.py index 8e49323..11826bc 100644 --- a/chargebee/models/payment_intent/types.py +++ b/chargebee/models/payment_intent/types.py @@ -62,25 +62,4 @@ class PaymentAttempt(TypedDict): error_text: NotRequired[str] created_at: Required[int] modified_at: Required[int] - error_detail: NotRequired[gateway_error_detail.GatewayErrorDetails] - - -class PaymentIntents(TypedDict): - id: Required[str] - status: Required[Status] - currency_code: NotRequired[str] - amount: Required[int] - gateway_account_id: Required[str] - expires_at: Required[int] - reference_id: NotRequired[str] - payment_method_type: NotRequired[PaymentMethodType] - success_url: NotRequired[str] - failure_url: NotRequired[str] - created_at: Required[int] - modified_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - customer_id: Required[str] - gateway: NotRequired[str] - active_payment_attempt: NotRequired[PaymentAttempt] - business_entity_id: NotRequired[str] + error_detail: NotRequired[gateway_error_detail.GatewayErrorDetailResponse] diff --git a/chargebee/models/payment_reference_number/__init__.py b/chargebee/models/payment_reference_number/__init__.py index a76e587..fbd9d75 100644 --- a/chargebee/models/payment_reference_number/__init__.py +++ b/chargebee/models/payment_reference_number/__init__.py @@ -1,3 +1,3 @@ from .operations import PaymentReferenceNumber from .responses import PaymentReferenceNumberResponse -from .types import PaymentReferenceNumbers, Type +from .types import Type diff --git a/chargebee/models/payment_reference_number/types.py b/chargebee/models/payment_reference_number/types.py index 4df25bf..af74175 100644 --- a/chargebee/models/payment_reference_number/types.py +++ b/chargebee/models/payment_reference_number/types.py @@ -11,10 +11,3 @@ class Type(Enum): def __str__(self): return self.value - - -class PaymentReferenceNumbers(TypedDict): - id: Required[str] - type: Required[Type] - number: Required[str] - invoice_id: NotRequired[str] diff --git a/chargebee/models/payment_source/__init__.py b/chargebee/models/payment_source/__init__.py index 7a0ee75..eda106c 100644 --- a/chargebee/models/payment_source/__init__.py +++ b/chargebee/models/payment_source/__init__.py @@ -1,7 +1,6 @@ from .operations import PaymentSource from .responses import PaymentSourceResponse from .types import ( - PaymentSources, Card, BankAccount, CustVoucherSource, diff --git a/chargebee/models/payment_source/types.py b/chargebee/models/payment_source/types.py index 7f18754..07f2835 100644 --- a/chargebee/models/payment_source/types.py +++ b/chargebee/models/payment_source/types.py @@ -136,33 +136,6 @@ class Mandate(TypedDict): created_at: Required[int] -class PaymentSources(TypedDict): - id: Required[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - customer_id: Required[str] - type: Required[enums.Type] - reference_id: Required[str] - status: Required[Status] - gateway: Required[enums.Gateway] - gateway_account_id: NotRequired[str] - ip_address: NotRequired[str] - issuing_country: NotRequired[str] - card: NotRequired[Card] - bank_account: NotRequired[BankAccount] - boleto: NotRequired[CustVoucherSource] - billing_address: NotRequired[BillingAddress] - amazon_payment: NotRequired[AmazonPayment] - upi: NotRequired[Upi] - paypal: NotRequired[Paypal] - venmo: NotRequired[Venmo] - klarna_pay_now: NotRequired[KlarnaPayNow] - mandates: NotRequired[List[Mandate]] - deleted: Required[bool] - business_entity_id: NotRequired[str] - - class CreateUsingPermanentTokenCardParams(TypedDict): last4: NotRequired[str] iin: NotRequired[str] diff --git a/chargebee/models/payment_voucher/__init__.py b/chargebee/models/payment_voucher/__init__.py index de705ac..7f44fc3 100644 --- a/chargebee/models/payment_voucher/__init__.py +++ b/chargebee/models/payment_voucher/__init__.py @@ -1,3 +1,3 @@ from .operations import PaymentVoucher from .responses import PaymentVoucherResponse -from .types import PaymentVouchers, LinkedInvoice, Status +from .types import LinkedInvoice, Status diff --git a/chargebee/models/payment_voucher/types.py b/chargebee/models/payment_voucher/types.py index 7284da2..d5934e5 100644 --- a/chargebee/models/payment_voucher/types.py +++ b/chargebee/models/payment_voucher/types.py @@ -19,29 +19,6 @@ class LinkedInvoice(TypedDict): applied_at: Required[int] -class PaymentVouchers(TypedDict): - id: Required[str] - id_at_gateway: NotRequired[str] - payment_voucher_type: Required[enums.PaymentVoucherType] - expires_at: NotRequired[int] - status: NotRequired[Status] - subscription_id: NotRequired[str] - currency_code: Required[str] - amount: NotRequired[int] - gateway_account_id: NotRequired[str] - payment_source_id: NotRequired[str] - gateway: Required[enums.Gateway] - payload: NotRequired[str] - error_code: NotRequired[str] - error_text: NotRequired[str] - url: NotRequired[str] - date: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - customer_id: Required[str] - linked_invoices: NotRequired[List[LinkedInvoice]] - - class CreateVoucherPaymentSourceParams(TypedDict): voucher_type: Required[enums.VoucherType] diff --git a/chargebee/models/plan/__init__.py b/chargebee/models/plan/__init__.py index 3b93a17..2c8a170 100644 --- a/chargebee/models/plan/__init__.py +++ b/chargebee/models/plan/__init__.py @@ -1,7 +1,6 @@ from .operations import Plan from .responses import PlanResponse from .types import ( - Plans, Tier, TaxProvidersField, ApplicableAddon, diff --git a/chargebee/models/plan/types.py b/chargebee/models/plan/types.py index 62137eb..a2793e7 100644 --- a/chargebee/models/plan/types.py +++ b/chargebee/models/plan/types.py @@ -111,65 +111,6 @@ class EventBasedAddon(TypedDict): quantity_in_decimal: NotRequired[str] -class Plans(TypedDict): - id: Required[str] - name: Required[str] - invoice_name: NotRequired[str] - description: NotRequired[str] - price: NotRequired[int] - currency_code: Required[str] - period: Required[int] - period_unit: Required[PeriodUnit] - trial_period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] - trial_end_action: NotRequired[TrialEndAction] - pricing_model: Required[enums.PricingModel] - charge_model: Required[ChargeModel] - free_quantity: Required[int] - setup_cost: NotRequired[int] - downgrade_penalty: NotRequired[float] - status: Required[Status] - archived_at: NotRequired[int] - billing_cycles: NotRequired[int] - redirect_url: NotRequired[str] - enabled_in_hosted_pages: Required[bool] - enabled_in_portal: Required[bool] - addon_applicability: Required[AddonApplicability] - tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - sku: NotRequired[str] - accounting_code: NotRequired[str] - accounting_category1: NotRequired[str] - accounting_category2: NotRequired[str] - accounting_category3: NotRequired[str] - accounting_category4: NotRequired[str] - is_shippable: NotRequired[bool] - shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - giftable: Required[bool] - claim_url: NotRequired[str] - free_quantity_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - channel: NotRequired[enums.Channel] - invoice_notes: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - meta_data: NotRequired[Dict[Any, Any]] - tiers: NotRequired[List[Tier]] - tax_providers_fields: NotRequired[List[TaxProvidersField]] - applicable_addons: NotRequired[List[ApplicableAddon]] - attached_addons: NotRequired[List[AttachedAddon]] - event_based_addons: NotRequired[List[EventBasedAddon]] - show_description_in_invoices: NotRequired[bool] - show_description_in_quotes: NotRequired[bool] - - class CreateTierParams(TypedDict): starting_unit: NotRequired[int] ending_unit: NotRequired[int] diff --git a/chargebee/models/portal_session/__init__.py b/chargebee/models/portal_session/__init__.py index c289acf..6415c7c 100644 --- a/chargebee/models/portal_session/__init__.py +++ b/chargebee/models/portal_session/__init__.py @@ -1,3 +1,3 @@ from .operations import PortalSession from .responses import PortalSessionResponse -from .types import PortalSessions, LinkedCustomer, Status +from .types import LinkedCustomer, Status diff --git a/chargebee/models/portal_session/types.py b/chargebee/models/portal_session/types.py index 0cc15e1..c083bb7 100644 --- a/chargebee/models/portal_session/types.py +++ b/chargebee/models/portal_session/types.py @@ -21,21 +21,5 @@ class LinkedCustomer(TypedDict): has_active_subscription: Required[bool] -class PortalSessions(TypedDict): - id: Required[str] - token: Required[str] - access_url: Required[str] - redirect_url: NotRequired[str] - status: Required[Status] - created_at: Required[int] - expires_at: NotRequired[int] - customer_id: Required[str] - login_at: NotRequired[int] - logout_at: NotRequired[int] - login_ipaddress: NotRequired[str] - logout_ipaddress: NotRequired[str] - linked_customers: NotRequired[List[LinkedCustomer]] - - class CreateCustomerParams(TypedDict): id: Required[str] diff --git a/chargebee/models/price_variant/__init__.py b/chargebee/models/price_variant/__init__.py index ba93dff..ebb1a6e 100644 --- a/chargebee/models/price_variant/__init__.py +++ b/chargebee/models/price_variant/__init__.py @@ -1,3 +1,3 @@ from .operations import PriceVariant from .responses import PriceVariantResponse -from .types import PriceVariants, Attribute, Status +from .types import Attribute, Status diff --git a/chargebee/models/price_variant/types.py b/chargebee/models/price_variant/types.py index 68d5b43..11c1501 100644 --- a/chargebee/models/price_variant/types.py +++ b/chargebee/models/price_variant/types.py @@ -16,20 +16,6 @@ class Attribute(TypedDict): value: Required[str] -class PriceVariants(TypedDict): - id: Required[str] - name: Required[str] - external_name: NotRequired[str] - variant_group: NotRequired[str] - description: NotRequired[str] - status: NotRequired[Status] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - archived_at: NotRequired[int] - attributes: NotRequired[List[Attribute]] - - class CreateAttributeParams(TypedDict): name: Required[str] value: Required[str] diff --git a/chargebee/models/pricing_page_session/__init__.py b/chargebee/models/pricing_page_session/__init__.py index 8e0c9d2..2d7ecbc 100644 --- a/chargebee/models/pricing_page_session/__init__.py +++ b/chargebee/models/pricing_page_session/__init__.py @@ -1,3 +1,2 @@ from .operations import PricingPageSession from .responses import PricingPageSessionResponse -from .types import PricingPageSessions diff --git a/chargebee/models/pricing_page_session/types.py b/chargebee/models/pricing_page_session/types.py index a72cf5f..43cedb5 100644 --- a/chargebee/models/pricing_page_session/types.py +++ b/chargebee/models/pricing_page_session/types.py @@ -2,13 +2,6 @@ from chargebee.models import enums -class PricingPageSessions(TypedDict): - id: NotRequired[str] - url: NotRequired[str] - created_at: NotRequired[int] - expires_at: NotRequired[int] - - class CreateForNewSubscriptionPricingPageParams(TypedDict): id: Required[str] diff --git a/chargebee/models/promotional_credit/__init__.py b/chargebee/models/promotional_credit/__init__.py index 28914df..60c0756 100644 --- a/chargebee/models/promotional_credit/__init__.py +++ b/chargebee/models/promotional_credit/__init__.py @@ -1,3 +1,3 @@ from .operations import PromotionalCredit from .responses import PromotionalCreditResponse -from .types import PromotionalCredits, Type +from .types import Type diff --git a/chargebee/models/promotional_credit/operations.py b/chargebee/models/promotional_credit/operations.py index a731be5..343b585 100644 --- a/chargebee/models/promotional_credit/operations.py +++ b/chargebee/models/promotional_credit/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/promotional_credit/types.py b/chargebee/models/promotional_credit/types.py index fe293f0..f4f85bc 100644 --- a/chargebee/models/promotional_credit/types.py +++ b/chargebee/models/promotional_credit/types.py @@ -9,18 +9,3 @@ class Type(Enum): def __str__(self): return self.value - - -class PromotionalCredits(TypedDict): - id: Required[str] - customer_id: Required[str] - type: Required[Type] - amount_in_decimal: NotRequired[str] - amount: Required[int] - currency_code: Required[str] - description: Required[str] - credit_type: Required[enums.CreditType] - reference: NotRequired[str] - closing_balance: Required[int] - done_by: NotRequired[str] - created_at: Required[int] diff --git a/chargebee/models/purchase/__init__.py b/chargebee/models/purchase/__init__.py index fc1f2b4..7a6a72f 100644 --- a/chargebee/models/purchase/__init__.py +++ b/chargebee/models/purchase/__init__.py @@ -1,3 +1,2 @@ from .operations import Purchase from .responses import PurchaseResponse -from .types import Purchases diff --git a/chargebee/models/purchase/types.py b/chargebee/models/purchase/types.py index 24768e5..c38b45d 100644 --- a/chargebee/models/purchase/types.py +++ b/chargebee/models/purchase/types.py @@ -2,15 +2,6 @@ from chargebee.models import enums, contract_term -class Purchases(TypedDict): - id: NotRequired[str] - customer_id: Required[str] - created_at: NotRequired[int] - modified_at: NotRequired[int] - subscription_ids: NotRequired[List[str]] - invoice_ids: NotRequired[List[str]] - - class CreatePurchaseItemParams(TypedDict): index: Required[int] item_price_id: Required[str] diff --git a/chargebee/models/quote/__init__.py b/chargebee/models/quote/__init__.py index 67aa029..bd26c11 100644 --- a/chargebee/models/quote/__init__.py +++ b/chargebee/models/quote/__init__.py @@ -1,7 +1,6 @@ from .operations import Quote from .responses import QuoteResponse from .types import ( - Quotes, LineItem, Discount, LineItemDiscount, diff --git a/chargebee/models/quote/types.py b/chargebee/models/quote/types.py index d39a828..873e00c 100644 --- a/chargebee/models/quote/types.py +++ b/chargebee/models/quote/types.py @@ -174,47 +174,6 @@ class BillingAddress(TypedDict): validation_status: NotRequired[enums.ValidationStatus] -class Quotes(TypedDict): - id: Required[str] - name: NotRequired[str] - po_number: NotRequired[str] - customer_id: Required[str] - subscription_id: NotRequired[str] - invoice_id: NotRequired[str] - status: Required[Status] - operation_type: Required[OperationType] - vat_number: NotRequired[str] - price_type: Required[enums.PriceType] - valid_till: Required[int] - date: Required[int] - total_payable: NotRequired[int] - charge_on_acceptance: NotRequired[int] - sub_total: Required[int] - total: NotRequired[int] - credits_applied: NotRequired[int] - amount_paid: NotRequired[int] - amount_due: NotRequired[int] - version: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - vat_number_prefix: NotRequired[str] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] - line_item_tiers: NotRequired[List[LineItemTier]] - tax_category: NotRequired[str] - currency_code: Required[str] - notes: NotRequired[List[Dict[Any, Any]]] - shipping_address: NotRequired[ShippingAddress] - billing_address: NotRequired[BillingAddress] - contract_term_start: NotRequired[int] - contract_term_end: NotRequired[int] - contract_term_termination_fee: NotRequired[int] - business_entity_id: NotRequired[str] - - class CreateSubForCustomerQuoteSubscriptionParams(TypedDict): id: NotRequired[str] po_number: NotRequired[str] diff --git a/chargebee/models/quote_line_group/__init__.py b/chargebee/models/quote_line_group/__init__.py index 67c365c..fd768e0 100644 --- a/chargebee/models/quote_line_group/__init__.py +++ b/chargebee/models/quote_line_group/__init__.py @@ -1,11 +1,3 @@ from .operations import QuoteLineGroup from .responses import QuoteLineGroupResponse -from .types import ( - QuoteLineGroups, - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - ChargeEvent, -) +from .types import LineItem, Discount, LineItemDiscount, Tax, LineItemTax, ChargeEvent diff --git a/chargebee/models/quote_line_group/types.py b/chargebee/models/quote_line_group/types.py index 83fd174..7b268d9 100644 --- a/chargebee/models/quote_line_group/types.py +++ b/chargebee/models/quote_line_group/types.py @@ -117,20 +117,3 @@ class LineItemTax(TypedDict): tax_juris_code: NotRequired[str] tax_amount_in_local_currency: NotRequired[int] local_currency_code: NotRequired[str] - - -class QuoteLineGroups(TypedDict): - version: NotRequired[int] - id: NotRequired[str] - sub_total: Required[int] - total: NotRequired[int] - credits_applied: NotRequired[int] - amount_paid: NotRequired[int] - amount_due: NotRequired[int] - charge_event: NotRequired[ChargeEvent] - billing_cycle_number: NotRequired[int] - line_items: NotRequired[List[LineItem]] - discounts: NotRequired[List[Discount]] - line_item_discounts: NotRequired[List[LineItemDiscount]] - taxes: NotRequired[List[Tax]] - line_item_taxes: NotRequired[List[LineItemTax]] diff --git a/chargebee/models/quoted_charge/__init__.py b/chargebee/models/quoted_charge/__init__.py index 1167daf..6356128 100644 --- a/chargebee/models/quoted_charge/__init__.py +++ b/chargebee/models/quoted_charge/__init__.py @@ -1,3 +1,3 @@ from .operations import QuotedCharge from .responses import QuotedChargeResponse -from .types import QuotedCharges, Charge, Addon, InvoiceItem, ItemTier, Coupon +from .types import Charge, Addon, InvoiceItem, ItemTier, Coupon diff --git a/chargebee/models/quoted_charge/types.py b/chargebee/models/quoted_charge/types.py index 268a3eb..f85eb39 100644 --- a/chargebee/models/quoted_charge/types.py +++ b/chargebee/models/quoted_charge/types.py @@ -44,11 +44,3 @@ class Addon(TypedDict): unit_price_in_decimal: NotRequired[str] proration_type: NotRequired[enums.ProrationType] service_period: NotRequired[int] - - -class QuotedCharges(TypedDict): - charges: NotRequired[List[Charge]] - addons: NotRequired[List[Addon]] - invoice_items: NotRequired[List[InvoiceItem]] - item_tiers: NotRequired[List[ItemTier]] - coupons: NotRequired[List[Coupon]] diff --git a/chargebee/models/quoted_subscription/__init__.py b/chargebee/models/quoted_subscription/__init__.py index 2b0d7f1..301f7ec 100644 --- a/chargebee/models/quoted_subscription/__init__.py +++ b/chargebee/models/quoted_subscription/__init__.py @@ -1,7 +1,6 @@ from .operations import QuotedSubscription from .responses import QuotedSubscriptionResponse from .types import ( - QuotedSubscriptions, Addon, EventBasedAddon, Coupon, diff --git a/chargebee/models/quoted_subscription/types.py b/chargebee/models/quoted_subscription/types.py index 1b95244..b90d64d 100644 --- a/chargebee/models/quoted_subscription/types.py +++ b/chargebee/models/quoted_subscription/types.py @@ -102,29 +102,3 @@ class Addon(TypedDict): unit_price_in_decimal: NotRequired[str] amount_in_decimal: NotRequired[str] proration_type: NotRequired[enums.ProrationType] - - -class QuotedSubscriptions(TypedDict): - id: Required[str] - plan_id: Required[str] - plan_quantity: Required[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - billing_period: NotRequired[int] - billing_period_unit: NotRequired[BillingPeriodUnit] - start_date: NotRequired[int] - trial_end: NotRequired[int] - remaining_billing_cycles: NotRequired[int] - po_number: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - changes_scheduled_at: NotRequired[int] - change_option: NotRequired[ChangeOption] - contract_term_billing_cycle_on_renewal: NotRequired[int] - addons: NotRequired[List[Addon]] - event_based_addons: NotRequired[List[EventBasedAddon]] - coupons: NotRequired[List[Coupon]] - subscription_items: NotRequired[List[SubscriptionItem]] - item_tiers: NotRequired[List[ItemTier]] - quoted_contract_term: NotRequired[QuotedContractTerm] diff --git a/chargebee/models/ramp/__init__.py b/chargebee/models/ramp/__init__.py index f9ab636..6776aab 100644 --- a/chargebee/models/ramp/__init__.py +++ b/chargebee/models/ramp/__init__.py @@ -1,7 +1,6 @@ from .operations import Ramp from .responses import RampResponse from .types import ( - Ramps, ItemsToAdd, ItemsToUpdate, CouponsToAdd, diff --git a/chargebee/models/ramp/types.py b/chargebee/models/ramp/types.py index 2eb166d..fcd2aed 100644 --- a/chargebee/models/ramp/types.py +++ b/chargebee/models/ramp/types.py @@ -89,27 +89,6 @@ class StatusTransitionReason(TypedDict): message: NotRequired[str] -class Ramps(TypedDict): - id: Required[str] - description: NotRequired[str] - subscription_id: Required[str] - effective_from: Required[int] - status: Required[Status] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - items_to_add: NotRequired[List[ItemsToAdd]] - items_to_update: NotRequired[List[ItemsToUpdate]] - coupons_to_add: NotRequired[List[CouponsToAdd]] - discounts_to_add: NotRequired[List[DiscountsToAdd]] - item_tiers: NotRequired[List[ItemTier]] - items_to_remove: NotRequired[List[str]] - coupons_to_remove: NotRequired[List[str]] - discounts_to_remove: NotRequired[List[str]] - deleted: Required[bool] - status_transition_reason: NotRequired[StatusTransitionReason] - - class CreateForSubscriptionItemsToAddParams(TypedDict): item_price_id: Required[str] quantity: NotRequired[int] diff --git a/chargebee/models/resource_migration/__init__.py b/chargebee/models/resource_migration/__init__.py index 277a228..e3bd196 100644 --- a/chargebee/models/resource_migration/__init__.py +++ b/chargebee/models/resource_migration/__init__.py @@ -1,3 +1,3 @@ from .operations import ResourceMigration from .responses import ResourceMigrationResponse -from .types import ResourceMigrations, Status +from .types import Status diff --git a/chargebee/models/resource_migration/operations.py b/chargebee/models/resource_migration/operations.py index ff1ce87..ec35b54 100644 --- a/chargebee/models/resource_migration/operations.py +++ b/chargebee/models/resource_migration/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums class ResourceMigration: diff --git a/chargebee/models/resource_migration/types.py b/chargebee/models/resource_migration/types.py index 29e198f..30fdbc4 100644 --- a/chargebee/models/resource_migration/types.py +++ b/chargebee/models/resource_migration/types.py @@ -10,13 +10,3 @@ class Status(Enum): def __str__(self): return self.value - - -class ResourceMigrations(TypedDict): - from_site: Required[str] - entity_type: Required[enums.EntityType] - entity_id: Required[str] - status: Required[Status] - errors: NotRequired[str] - created_at: Required[int] - updated_at: Required[int] diff --git a/chargebee/models/site_migration_detail/__init__.py b/chargebee/models/site_migration_detail/__init__.py index e34334c..3c232c8 100644 --- a/chargebee/models/site_migration_detail/__init__.py +++ b/chargebee/models/site_migration_detail/__init__.py @@ -1,3 +1,3 @@ from .operations import SiteMigrationDetail from .responses import SiteMigrationDetailResponse -from .types import SiteMigrationDetails, Status +from .types import Status diff --git a/chargebee/models/site_migration_detail/types.py b/chargebee/models/site_migration_detail/types.py index c886ffc..67f6d41 100644 --- a/chargebee/models/site_migration_detail/types.py +++ b/chargebee/models/site_migration_detail/types.py @@ -10,12 +10,3 @@ class Status(Enum): def __str__(self): return self.value - - -class SiteMigrationDetails(TypedDict): - entity_id: Required[str] - other_site_name: Required[str] - entity_id_at_other_site: Required[str] - migrated_at: Required[int] - entity_type: Required[enums.EntityType] - status: Required[Status] diff --git a/chargebee/models/subscription/__init__.py b/chargebee/models/subscription/__init__.py index b8becba..cc7f22a 100644 --- a/chargebee/models/subscription/__init__.py +++ b/chargebee/models/subscription/__init__.py @@ -1,7 +1,6 @@ from .operations import Subscription from .responses import SubscriptionResponse from .types import ( - Subscriptions, SubscriptionItem, ItemTier, ChargedItem, diff --git a/chargebee/models/subscription/types.py b/chargebee/models/subscription/types.py index e689ed5..00dd528 100644 --- a/chargebee/models/subscription/types.py +++ b/chargebee/models/subscription/types.py @@ -222,87 +222,6 @@ class EventBasedAddon(TypedDict): unit_price_in_decimal: NotRequired[str] -class Subscriptions(TypedDict): - id: Required[str] - currency_code: Required[str] - plan_id: Required[str] - plan_quantity: Required[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - billing_period: NotRequired[int] - billing_period_unit: NotRequired[BillingPeriodUnit] - start_date: NotRequired[int] - trial_end: NotRequired[int] - remaining_billing_cycles: NotRequired[int] - po_number: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - customer_id: Required[str] - plan_amount: NotRequired[int] - plan_free_quantity: NotRequired[int] - status: Required[Status] - trial_start: NotRequired[int] - trial_end_action: NotRequired[enums.TrialEndAction] - current_term_start: NotRequired[int] - current_term_end: NotRequired[int] - next_billing_at: NotRequired[int] - created_at: NotRequired[int] - started_at: NotRequired[int] - activated_at: NotRequired[int] - gift_id: NotRequired[str] - contract_term_billing_cycle_on_renewal: NotRequired[int] - override_relationship: NotRequired[bool] - pause_date: NotRequired[int] - resume_date: NotRequired[int] - cancelled_at: NotRequired[int] - cancel_reason: NotRequired[CancelReason] - affiliate_token: NotRequired[str] - created_from_ip: NotRequired[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - has_scheduled_advance_invoices: Required[bool] - has_scheduled_changes: Required[bool] - payment_source_id: NotRequired[str] - plan_free_quantity_in_decimal: NotRequired[str] - plan_amount_in_decimal: NotRequired[str] - cancel_schedule_created_at: NotRequired[int] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - channel: NotRequired[enums.Channel] - net_term_days: NotRequired[int] - active_id: NotRequired[str] - subscription_items: NotRequired[List[SubscriptionItem]] - item_tiers: NotRequired[List[ItemTier]] - charged_items: NotRequired[List[ChargedItem]] - due_invoices_count: NotRequired[int] - due_since: NotRequired[int] - total_dues: NotRequired[int] - mrr: NotRequired[int] - arr: NotRequired[int] - exchange_rate: NotRequired[float] - base_currency_code: NotRequired[str] - addons: NotRequired[List[Addon]] - event_based_addons: NotRequired[List[EventBasedAddon]] - charged_event_based_addons: NotRequired[List[ChargedEventBasedAddon]] - coupon: NotRequired[str] - coupons: NotRequired[List[Coupon]] - shipping_address: NotRequired[ShippingAddress] - referral_info: NotRequired[ReferralInfo] - invoice_notes: NotRequired[str] - meta_data: NotRequired[Dict[Any, Any]] - metadata: NotRequired[Dict[Any, Any]] - deleted: Required[bool] - changes_scheduled_at: NotRequired[int] - contract_term: NotRequired[ContractTerm] - cancel_reason_code: NotRequired[str] - free_period: NotRequired[int] - free_period_unit: NotRequired[enums.FreePeriodUnit] - create_pending_invoices: NotRequired[bool] - auto_close_invoices: NotRequired[bool] - discounts: NotRequired[List[Discount]] - business_entity_id: NotRequired[str] - - class CreateCustomerParams(TypedDict): id: NotRequired[str] email: NotRequired[str] diff --git a/chargebee/models/subscription_entitlement/__init__.py b/chargebee/models/subscription_entitlement/__init__.py index 4716d06..31ce737 100644 --- a/chargebee/models/subscription_entitlement/__init__.py +++ b/chargebee/models/subscription_entitlement/__init__.py @@ -1,3 +1,3 @@ from .operations import SubscriptionEntitlement from .responses import SubscriptionEntitlementResponse -from .types import SubscriptionEntitlements, Component, ScheduleStatus +from .types import Component, ScheduleStatus diff --git a/chargebee/models/subscription_entitlement/responses.py b/chargebee/models/subscription_entitlement/responses.py index e6351d8..a36f7b8 100644 --- a/chargebee/models/subscription_entitlement/responses.py +++ b/chargebee/models/subscription_entitlement/responses.py @@ -6,7 +6,7 @@ @dataclass class ComponentResponse(Model): - entitlement_overrides: entitlement_override.EntitlementOverrides = None + entitlement_overrides: entitlement_override.EntitlementOverrideResponse = None @dataclass diff --git a/chargebee/models/subscription_entitlement/types.py b/chargebee/models/subscription_entitlement/types.py index c951508..c83eb89 100644 --- a/chargebee/models/subscription_entitlement/types.py +++ b/chargebee/models/subscription_entitlement/types.py @@ -13,23 +13,7 @@ def __str__(self): class Component(TypedDict): - entitlement_overrides: NotRequired[entitlement_override.EntitlementOverrides] - - -class SubscriptionEntitlements(TypedDict): - subscription_id: Required[str] - feature_id: NotRequired[str] - feature_name: NotRequired[str] - feature_unit: NotRequired[str] - feature_type: NotRequired[str] - value: NotRequired[str] - name: NotRequired[str] - is_overridden: Required[bool] - is_enabled: Required[bool] - effective_from: NotRequired[int] - schedule_status: NotRequired[ScheduleStatus] - expires_at: NotRequired[int] - components: NotRequired[Component] + entitlement_overrides: NotRequired[entitlement_override.EntitlementOverrideResponse] class SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams(TypedDict): diff --git a/chargebee/models/subscription_estimate/__init__.py b/chargebee/models/subscription_estimate/__init__.py index 5223a94..563fde4 100644 --- a/chargebee/models/subscription_estimate/__init__.py +++ b/chargebee/models/subscription_estimate/__init__.py @@ -1,3 +1,3 @@ from .operations import SubscriptionEstimate from .responses import SubscriptionEstimateResponse -from .types import SubscriptionEstimates, ShippingAddress, ContractTerm, Status +from .types import ShippingAddress, ContractTerm, Status diff --git a/chargebee/models/subscription_estimate/types.py b/chargebee/models/subscription_estimate/types.py index 67a9ec9..a2ef74e 100644 --- a/chargebee/models/subscription_estimate/types.py +++ b/chargebee/models/subscription_estimate/types.py @@ -67,15 +67,3 @@ class ContractTerm(TypedDict): created_at: Required[int] subscription_id: Required[str] remaining_billing_cycles: NotRequired[int] - - -class SubscriptionEstimates(TypedDict): - id: NotRequired[str] - currency_code: Required[str] - status: NotRequired[Status] - trial_end_action: NotRequired[enums.TrialEndAction] - next_billing_at: NotRequired[int] - pause_date: NotRequired[int] - resume_date: NotRequired[int] - shipping_address: NotRequired[ShippingAddress] - contract_term: NotRequired[ContractTerm] diff --git a/chargebee/models/tax_withheld/__init__.py b/chargebee/models/tax_withheld/__init__.py index 12d8138..15920f9 100644 --- a/chargebee/models/tax_withheld/__init__.py +++ b/chargebee/models/tax_withheld/__init__.py @@ -1,3 +1,3 @@ from .operations import TaxWithheld from .responses import TaxWithheldResponse -from .types import TaxWithhelds, Type, PaymentMethod +from .types import Type, PaymentMethod diff --git a/chargebee/models/tax_withheld/types.py b/chargebee/models/tax_withheld/types.py index 3cafb0d..08b56c0 100644 --- a/chargebee/models/tax_withheld/types.py +++ b/chargebee/models/tax_withheld/types.py @@ -19,18 +19,3 @@ class PaymentMethod(Enum): def __str__(self): return self.value - - -class TaxWithhelds(TypedDict): - id: Required[str] - user: NotRequired[str] - reference_number: NotRequired[str] - description: NotRequired[str] - type: Required[Type] - payment_method: Required[PaymentMethod] - date: NotRequired[int] - currency_code: Required[str] - amount: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - exchange_rate: NotRequired[float] diff --git a/chargebee/models/third_party_payment_method/__init__.py b/chargebee/models/third_party_payment_method/__init__.py index 39b5d0b..de33cb4 100644 --- a/chargebee/models/third_party_payment_method/__init__.py +++ b/chargebee/models/third_party_payment_method/__init__.py @@ -1,3 +1,2 @@ from .operations import ThirdPartyPaymentMethod from .responses import ThirdPartyPaymentMethodResponse -from .types import ThirdPartyPaymentMethods diff --git a/chargebee/models/third_party_payment_method/types.py b/chargebee/models/third_party_payment_method/types.py index 6311e84..55d7118 100644 --- a/chargebee/models/third_party_payment_method/types.py +++ b/chargebee/models/third_party_payment_method/types.py @@ -1,9 +1,2 @@ from typing import TypedDict, Required, NotRequired, Dict, List, Any from chargebee.models import enums - - -class ThirdPartyPaymentMethods(TypedDict): - type: Required[enums.Type] - gateway: Required[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: Required[str] diff --git a/chargebee/models/time_machine/__init__.py b/chargebee/models/time_machine/__init__.py index 1044951..2b3e42d 100644 --- a/chargebee/models/time_machine/__init__.py +++ b/chargebee/models/time_machine/__init__.py @@ -1,3 +1,3 @@ from .operations import TimeMachine from .responses import TimeMachineResponse -from .types import TimeMachines, TimeTravelStatus +from .types import TimeTravelStatus diff --git a/chargebee/models/time_machine/types.py b/chargebee/models/time_machine/types.py index a1b5f99..7a3e6a1 100644 --- a/chargebee/models/time_machine/types.py +++ b/chargebee/models/time_machine/types.py @@ -10,13 +10,3 @@ class TimeTravelStatus(Enum): def __str__(self): return self.value - - -class TimeMachines(TypedDict): - name: Required[str] - time_travel_status: Required[TimeTravelStatus] - genesis_time: Required[int] - destination_time: Required[int] - failure_code: NotRequired[str] - failure_reason: NotRequired[str] - error_json: NotRequired[str] diff --git a/chargebee/models/token/__init__.py b/chargebee/models/token/__init__.py index 869d7c6..2764ec1 100644 --- a/chargebee/models/token/__init__.py +++ b/chargebee/models/token/__init__.py @@ -1,3 +1,3 @@ from .operations import Token from .responses import TokenResponse -from .types import Tokens, Status, Vault +from .types import Status, Vault diff --git a/chargebee/models/token/types.py b/chargebee/models/token/types.py index 834d8f6..de70b7a 100644 --- a/chargebee/models/token/types.py +++ b/chargebee/models/token/types.py @@ -18,18 +18,3 @@ class Vault(Enum): def __str__(self): return self.value - - -class Tokens(TypedDict): - id: Required[str] - gateway: Required[enums.Gateway] - gateway_account_id: Required[str] - payment_method_type: Required[enums.PaymentMethodType] - status: Required[Status] - id_at_vault: Required[str] - vault: Required[Vault] - ip_address: NotRequired[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - expired_at: NotRequired[int] diff --git a/chargebee/models/transaction/__init__.py b/chargebee/models/transaction/__init__.py index 8bd53b8..e53a9bd 100644 --- a/chargebee/models/transaction/__init__.py +++ b/chargebee/models/transaction/__init__.py @@ -1,7 +1,6 @@ from .operations import Transaction from .responses import TransactionResponse from .types import ( - Transactions, LinkedInvoice, LinkedCreditNote, LinkedRefund, diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py index dbc9827..6150d8c 100644 --- a/chargebee/models/transaction/operations.py +++ b/chargebee/models/transaction/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/transaction/types.py b/chargebee/models/transaction/types.py index ea11719..a623663 100644 --- a/chargebee/models/transaction/types.py +++ b/chargebee/models/transaction/types.py @@ -111,52 +111,3 @@ class GatewayErrorDetail(TypedDict): recommendation_message: NotRequired[str] processor_error_code: NotRequired[str] processor_error_message: NotRequired[str] - - -class Transactions(TypedDict): - id: Required[str] - customer_id: NotRequired[str] - subscription_id: NotRequired[str] - gateway_account_id: NotRequired[str] - payment_source_id: NotRequired[str] - payment_method: Required[enums.PaymentMethod] - reference_number: NotRequired[str] - gateway: Required[enums.Gateway] - type: Required[Type] - date: NotRequired[int] - settled_at: NotRequired[int] - exchange_rate: NotRequired[float] - currency_code: Required[str] - amount: NotRequired[int] - id_at_gateway: NotRequired[str] - status: NotRequired[Status] - fraud_flag: NotRequired[FraudFlag] - initiator_type: NotRequired[InitiatorType] - three_d_secure: NotRequired[bool] - authorization_reason: NotRequired[AuthorizationReason] - error_code: NotRequired[str] - error_text: NotRequired[str] - voided_at: NotRequired[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - fraud_reason: NotRequired[str] - custom_payment_method_id: NotRequired[str] - amount_unused: NotRequired[int] - masked_card_number: NotRequired[str] - reference_transaction_id: NotRequired[str] - refunded_txn_id: NotRequired[str] - reference_authorization_id: NotRequired[str] - amount_capturable: NotRequired[int] - reversal_transaction_id: NotRequired[str] - linked_invoices: NotRequired[List[LinkedInvoice]] - linked_credit_notes: NotRequired[List[LinkedCreditNote]] - linked_refunds: NotRequired[List[LinkedRefund]] - linked_payments: NotRequired[List[LinkedPayment]] - deleted: Required[bool] - iin: NotRequired[str] - last4: NotRequired[str] - merchant_reference_id: NotRequired[str] - business_entity_id: NotRequired[str] - payment_method_details: NotRequired[str] - error_detail: NotRequired[GatewayErrorDetail] - custom_payment_method_name: NotRequired[str] diff --git a/chargebee/models/unbilled_charge/__init__.py b/chargebee/models/unbilled_charge/__init__.py index 2e87b72..8b1df01 100644 --- a/chargebee/models/unbilled_charge/__init__.py +++ b/chargebee/models/unbilled_charge/__init__.py @@ -1,3 +1,3 @@ from .operations import UnbilledCharge from .responses import UnbilledChargeResponse -from .types import UnbilledCharges, Tier, EntityType +from .types import Tier, EntityType diff --git a/chargebee/models/unbilled_charge/types.py b/chargebee/models/unbilled_charge/types.py index 1a92acf..f84ff5d 100644 --- a/chargebee/models/unbilled_charge/types.py +++ b/chargebee/models/unbilled_charge/types.py @@ -27,33 +27,6 @@ class Tier(TypedDict): unit_amount_in_decimal: NotRequired[str] -class UnbilledCharges(TypedDict): - id: NotRequired[str] - customer_id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - unit_amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - quantity: NotRequired[int] - amount: NotRequired[int] - currency_code: Required[str] - discount_amount: NotRequired[int] - description: NotRequired[str] - entity_type: Required[EntityType] - entity_id: NotRequired[str] - is_voided: Required[bool] - voided_at: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - updated_at: Required[int] - tiers: NotRequired[List[Tier]] - is_advance_charge: NotRequired[bool] - business_entity_id: NotRequired[str] - deleted: Required[bool] - - class CreateUnbilledChargeAddonParams(TypedDict): id: NotRequired[str] quantity: NotRequired[int] diff --git a/chargebee/models/usage/__init__.py b/chargebee/models/usage/__init__.py index cd7694b..7831f5d 100644 --- a/chargebee/models/usage/__init__.py +++ b/chargebee/models/usage/__init__.py @@ -1,3 +1,2 @@ from .operations import Usage from .responses import UsageResponse -from .types import Usages diff --git a/chargebee/models/usage/operations.py b/chargebee/models/usage/operations.py index e44eda7..9195505 100644 --- a/chargebee/models/usage/operations.py +++ b/chargebee/models/usage/operations.py @@ -2,6 +2,7 @@ from .responses import * from chargebee import request from typing import cast, Any +from chargebee.models import enums from chargebee.filters import Filters diff --git a/chargebee/models/usage/types.py b/chargebee/models/usage/types.py index 7a18702..b5f193e 100644 --- a/chargebee/models/usage/types.py +++ b/chargebee/models/usage/types.py @@ -2,20 +2,5 @@ from chargebee.models import enums -class Usages(TypedDict): - id: NotRequired[str] - usage_date: Required[int] - subscription_id: Required[str] - item_price_id: Required[str] - invoice_id: NotRequired[str] - line_item_id: NotRequired[str] - quantity: Required[str] - source: NotRequired[enums.Source] - note: NotRequired[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - - class PdfInvoiceParams(TypedDict): id: Required[str] diff --git a/chargebee/models/virtual_bank_account/__init__.py b/chargebee/models/virtual_bank_account/__init__.py index 313ba02..7c4f8c9 100644 --- a/chargebee/models/virtual_bank_account/__init__.py +++ b/chargebee/models/virtual_bank_account/__init__.py @@ -1,3 +1,3 @@ from .operations import VirtualBankAccount from .responses import VirtualBankAccountResponse -from .types import VirtualBankAccounts, Scheme +from .types import Scheme diff --git a/chargebee/models/virtual_bank_account/types.py b/chargebee/models/virtual_bank_account/types.py index 8977c3a..761ccca 100644 --- a/chargebee/models/virtual_bank_account/types.py +++ b/chargebee/models/virtual_bank_account/types.py @@ -14,21 +14,3 @@ class Scheme(Enum): def __str__(self): return self.value - - -class VirtualBankAccounts(TypedDict): - id: Required[str] - customer_id: Required[str] - email: Required[str] - scheme: NotRequired[Scheme] - bank_name: NotRequired[str] - account_number: Required[str] - routing_number: NotRequired[str] - swift_code: Required[str] - gateway: Required[enums.Gateway] - gateway_account_id: Required[str] - resource_version: NotRequired[int] - updated_at: NotRequired[int] - created_at: Required[int] - reference_id: Required[str] - deleted: Required[bool] From a4df4d16f3c0f9b72031b9f133b961dec3154e0a Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Tue, 1 Oct 2024 16:13:22 +0530 Subject: [PATCH 08/19] Updated response handling, serialiser for filter params --- chargebee/models/__init__.py | 285 ---- chargebee/models/addon/__init__.py | 10 - chargebee/models/addon/operations.py | 126 +- chargebee/models/addon/types.py | 106 -- chargebee/models/address/operations.py | 3 +- chargebee/models/address/types.py | 2 - .../advance_invoice_schedule/__init__.py | 1 - .../advance_invoice_schedule/operations.py | 24 +- .../models/advance_invoice_schedule/types.py | 26 - chargebee/models/attached_item/__init__.py | 1 - chargebee/models/attached_item/operations.py | 25 +- chargebee/models/attached_item/types.py | 21 - chargebee/models/attribute/operations.py | 3 +- chargebee/models/attribute/types.py | 1 - chargebee/models/business_entity/__init__.py | 1 - .../models/business_entity/operations.py | 10 +- chargebee/models/business_entity/types.py | 10 - .../business_entity_transfer/__init__.py | 1 - .../business_entity_transfer/operations.py | 16 +- .../models/business_entity_transfer/types.py | 17 - chargebee/models/card/__init__.py | 1 - chargebee/models/card/operations.py | 63 +- chargebee/models/card/types.py | 66 - chargebee/models/comment/__init__.py | 1 - chargebee/models/comment/operations.py | 12 +- chargebee/models/comment/types.py | 11 - chargebee/models/contact/operations.py | 3 +- chargebee/models/contact/types.py | 1 - chargebee/models/contract_term/__init__.py | 1 - chargebee/models/contract_term/operations.py | 21 +- chargebee/models/contract_term/types.py | 22 - chargebee/models/coupon/__init__.py | 12 - chargebee/models/coupon/operations.py | 201 ++- chargebee/models/coupon/types.py | 168 -- chargebee/models/coupon_code/__init__.py | 1 - chargebee/models/coupon_code/operations.py | 11 +- chargebee/models/coupon_code/types.py | 11 - chargebee/models/coupon_set/operations.py | 3 +- chargebee/models/coupon_set/types.py | 1 - chargebee/models/credit_note/__init__.py | 18 - chargebee/models/credit_note/operations.py | 350 ++++- chargebee/models/credit_note/types.py | 351 ----- .../models/credit_note_estimate/__init__.py | 9 - .../models/credit_note_estimate/operations.py | 118 +- .../models/credit_note_estimate/types.py | 127 -- chargebee/models/currency/__init__.py | 1 - chargebee/models/currency/operations.py | 14 +- chargebee/models/currency/types.py | 10 - chargebee/models/customer/__init__.py | 17 - chargebee/models/customer/operations.py | 513 ++++++- chargebee/models/customer/types.py | 473 ------ .../models/customer_entitlement/operations.py | 3 +- .../models/customer_entitlement/types.py | 1 - .../models/differential_price/__init__.py | 1 - .../models/differential_price/operations.py | 63 +- chargebee/models/differential_price/types.py | 62 - chargebee/models/discount/__init__.py | 1 - chargebee/models/discount/operations.py | 10 +- chargebee/models/discount/types.py | 11 - chargebee/models/download/operations.py | 3 +- chargebee/models/download/types.py | 1 - chargebee/models/entitlement/__init__.py | 1 - chargebee/models/entitlement/operations.py | 23 +- chargebee/models/entitlement/types.py | 20 - .../models/entitlement_override/__init__.py | 1 - .../models/entitlement_override/operations.py | 21 +- .../models/entitlement_override/types.py | 18 - chargebee/models/estimate/operations.py | 896 ++++++++++- chargebee/models/estimate/types.py | 771 ---------- chargebee/models/event/__init__.py | 1 - chargebee/models/event/operations.py | 53 +- chargebee/models/event/types.py | 34 - chargebee/models/export/__init__.py | 1 - chargebee/models/export/operations.py | 396 ++++- chargebee/models/export/types.py | 355 ----- chargebee/models/feature/__init__.py | 1 - chargebee/models/feature/operations.py | 44 +- chargebee/models/feature/types.py | 42 - .../models/gateway_error_detail/operations.py | 3 +- .../models/gateway_error_detail/types.py | 1 - chargebee/models/gift/__init__.py | 1 - chargebee/models/gift/operations.py | 160 +- chargebee/models/gift/types.py | 144 -- chargebee/models/hierarchy/operations.py | 3 +- chargebee/models/hierarchy/types.py | 1 - chargebee/models/hosted_page/__init__.py | 1 - chargebee/models/hosted_page/operations.py | 762 +++++++++- chargebee/models/hosted_page/types.py | 671 -------- chargebee/models/impacted_item/__init__.py | 1 - chargebee/models/impacted_item/operations.py | 8 +- chargebee/models/impacted_item/types.py | 7 - .../models/impacted_item_price/__init__.py | 1 - .../models/impacted_item_price/operations.py | 8 +- chargebee/models/impacted_item_price/types.py | 7 - .../models/impacted_subscription/__init__.py | 1 - .../impacted_subscription/operations.py | 8 +- .../models/impacted_subscription/types.py | 7 - .../models/in_app_subscription/__init__.py | 1 - .../models/in_app_subscription/operations.py | 60 +- chargebee/models/in_app_subscription/types.py | 54 - chargebee/models/installment/__init__.py | 1 - chargebee/models/installment/operations.py | 11 +- chargebee/models/installment/types.py | 11 - .../models/installment_config/__init__.py | 1 - .../models/installment_config/operations.py | 23 +- chargebee/models/installment_config/types.py | 21 - .../models/installment_detail/__init__.py | 1 - .../models/installment_detail/operations.py | 21 +- chargebee/models/installment_detail/types.py | 22 - chargebee/models/invoice/__init__.py | 23 - chargebee/models/invoice/operations.py | 918 ++++++++++- chargebee/models/invoice/types.py | 869 ----------- chargebee/models/invoice_estimate/__init__.py | 1 - .../models/invoice_estimate/operations.py | 111 +- chargebee/models/invoice_estimate/types.py | 119 -- chargebee/models/item/__init__.py | 1 - chargebee/models/item/operations.py | 47 +- chargebee/models/item/types.py | 42 - chargebee/models/item_entitlement/__init__.py | 1 - .../models/item_entitlement/operations.py | 30 +- chargebee/models/item_entitlement/types.py | 24 - chargebee/models/item_family/__init__.py | 1 - chargebee/models/item_family/operations.py | 10 +- chargebee/models/item_family/types.py | 11 - chargebee/models/item_price/__init__.py | 12 - chargebee/models/item_price/operations.py | 181 ++- chargebee/models/item_price/types.py | 160 -- chargebee/models/metadata/operations.py | 3 +- chargebee/models/metadata/types.py | 1 - chargebee/models/order/__init__.py | 14 - chargebee/models/order/operations.py | 296 +++- chargebee/models/order/types.py | 293 ---- chargebee/models/payment_intent/__init__.py | 1 - chargebee/models/payment_intent/operations.py | 66 +- chargebee/models/payment_intent/types.py | 65 - .../payment_reference_number/__init__.py | 1 - .../payment_reference_number/operations.py | 13 +- .../models/payment_reference_number/types.py | 13 - chargebee/models/payment_source/__init__.py | 13 - chargebee/models/payment_source/operations.py | 237 ++- chargebee/models/payment_source/types.py | 235 --- chargebee/models/payment_voucher/__init__.py | 1 - .../models/payment_voucher/operations.py | 32 +- chargebee/models/payment_voucher/types.py | 27 - chargebee/models/plan/__init__.py | 14 - chargebee/models/plan/operations.py | 205 ++- chargebee/models/plan/types.py | 181 --- chargebee/models/portal_session/__init__.py | 1 - chargebee/models/portal_session/operations.py | 25 +- chargebee/models/portal_session/types.py | 25 - chargebee/models/price_variant/__init__.py | 1 - chargebee/models/price_variant/operations.py | 29 +- chargebee/models/price_variant/types.py | 26 - .../models/pricing_page_session/operations.py | 85 +- .../models/pricing_page_session/types.py | 62 - .../models/promotional_credit/__init__.py | 1 - .../models/promotional_credit/operations.py | 12 +- chargebee/models/promotional_credit/types.py | 11 - chargebee/models/purchase/operations.py | 174 ++- chargebee/models/purchase/types.py | 155 -- chargebee/models/quote/__init__.py | 12 - chargebee/models/quote/operations.py | 1104 +++++++++++++- chargebee/models/quote/types.py | 987 ------------ chargebee/models/quote_line_group/__init__.py | 1 - .../models/quote_line_group/operations.py | 111 +- chargebee/models/quote_line_group/types.py | 119 -- chargebee/models/quoted_charge/__init__.py | 1 - chargebee/models/quoted_charge/operations.py | 43 +- chargebee/models/quoted_charge/types.py | 46 - .../models/quoted_subscription/__init__.py | 10 - .../models/quoted_subscription/operations.py | 98 +- chargebee/models/quoted_subscription/types.py | 104 -- chargebee/models/ramp/__init__.py | 9 - chargebee/models/ramp/operations.py | 188 ++- chargebee/models/ramp/types.py | 181 --- .../models/resource_migration/__init__.py | 1 - .../models/resource_migration/operations.py | 11 +- chargebee/models/resource_migration/types.py | 12 - .../models/site_migration_detail/__init__.py | 1 - .../site_migration_detail/operations.py | 11 +- .../models/site_migration_detail/types.py | 12 - chargebee/models/subscription/__init__.py | 16 - chargebee/models/subscription/operations.py | 1352 +++++++++++++++-- chargebee/models/subscription/types.py | 1202 --------------- .../subscription_entitlement/__init__.py | 1 - .../subscription_entitlement/operations.py | 26 +- .../models/subscription_entitlement/types.py | 20 - .../models/subscription_estimate/__init__.py | 1 - .../subscription_estimate/operations.py | 65 +- .../models/subscription_estimate/types.py | 69 - chargebee/models/tax_withheld/__init__.py | 1 - chargebee/models/tax_withheld/operations.py | 20 +- chargebee/models/tax_withheld/types.py | 21 - .../third_party_payment_method/operations.py | 3 +- .../third_party_payment_method/types.py | 2 - chargebee/models/time_machine/__init__.py | 1 - chargebee/models/time_machine/operations.py | 43 +- chargebee/models/time_machine/types.py | 12 - chargebee/models/token/__init__.py | 1 - chargebee/models/token/operations.py | 18 +- chargebee/models/token/types.py | 20 - chargebee/models/transaction/__init__.py | 12 - chargebee/models/transaction/operations.py | 106 +- chargebee/models/transaction/types.py | 113 -- chargebee/models/unbilled_charge/__init__.py | 1 - .../models/unbilled_charge/operations.py | 109 +- chargebee/models/unbilled_charge/types.py | 101 -- chargebee/models/usage/operations.py | 10 +- chargebee/models/usage/types.py | 6 - .../models/virtual_bank_account/__init__.py | 1 - .../models/virtual_bank_account/operations.py | 19 +- .../models/virtual_bank_account/types.py | 16 - chargebee/responses.py | 18 + chargebee/util.py | 20 +- 214 files changed, 9149 insertions(+), 10374 deletions(-) delete mode 100644 chargebee/models/addon/types.py delete mode 100644 chargebee/models/address/types.py delete mode 100644 chargebee/models/advance_invoice_schedule/types.py delete mode 100644 chargebee/models/attached_item/types.py delete mode 100644 chargebee/models/attribute/types.py delete mode 100644 chargebee/models/business_entity/types.py delete mode 100644 chargebee/models/business_entity_transfer/types.py delete mode 100644 chargebee/models/card/types.py delete mode 100644 chargebee/models/comment/types.py delete mode 100644 chargebee/models/contact/types.py delete mode 100644 chargebee/models/contract_term/types.py delete mode 100644 chargebee/models/coupon/types.py delete mode 100644 chargebee/models/coupon_code/types.py delete mode 100644 chargebee/models/coupon_set/types.py delete mode 100644 chargebee/models/credit_note/types.py delete mode 100644 chargebee/models/credit_note_estimate/types.py delete mode 100644 chargebee/models/currency/types.py delete mode 100644 chargebee/models/customer/types.py delete mode 100644 chargebee/models/customer_entitlement/types.py delete mode 100644 chargebee/models/differential_price/types.py delete mode 100644 chargebee/models/discount/types.py delete mode 100644 chargebee/models/download/types.py delete mode 100644 chargebee/models/entitlement/types.py delete mode 100644 chargebee/models/entitlement_override/types.py delete mode 100644 chargebee/models/estimate/types.py delete mode 100644 chargebee/models/event/types.py delete mode 100644 chargebee/models/export/types.py delete mode 100644 chargebee/models/feature/types.py delete mode 100644 chargebee/models/gateway_error_detail/types.py delete mode 100644 chargebee/models/gift/types.py delete mode 100644 chargebee/models/hierarchy/types.py delete mode 100644 chargebee/models/hosted_page/types.py delete mode 100644 chargebee/models/impacted_item/types.py delete mode 100644 chargebee/models/impacted_item_price/types.py delete mode 100644 chargebee/models/impacted_subscription/types.py delete mode 100644 chargebee/models/in_app_subscription/types.py delete mode 100644 chargebee/models/installment/types.py delete mode 100644 chargebee/models/installment_config/types.py delete mode 100644 chargebee/models/installment_detail/types.py delete mode 100644 chargebee/models/invoice/types.py delete mode 100644 chargebee/models/invoice_estimate/types.py delete mode 100644 chargebee/models/item/types.py delete mode 100644 chargebee/models/item_entitlement/types.py delete mode 100644 chargebee/models/item_family/types.py delete mode 100644 chargebee/models/item_price/types.py delete mode 100644 chargebee/models/metadata/types.py delete mode 100644 chargebee/models/order/types.py delete mode 100644 chargebee/models/payment_intent/types.py delete mode 100644 chargebee/models/payment_reference_number/types.py delete mode 100644 chargebee/models/payment_source/types.py delete mode 100644 chargebee/models/payment_voucher/types.py delete mode 100644 chargebee/models/plan/types.py delete mode 100644 chargebee/models/portal_session/types.py delete mode 100644 chargebee/models/price_variant/types.py delete mode 100644 chargebee/models/pricing_page_session/types.py delete mode 100644 chargebee/models/promotional_credit/types.py delete mode 100644 chargebee/models/purchase/types.py delete mode 100644 chargebee/models/quote/types.py delete mode 100644 chargebee/models/quote_line_group/types.py delete mode 100644 chargebee/models/quoted_charge/types.py delete mode 100644 chargebee/models/quoted_subscription/types.py delete mode 100644 chargebee/models/ramp/types.py delete mode 100644 chargebee/models/resource_migration/types.py delete mode 100644 chargebee/models/site_migration_detail/types.py delete mode 100644 chargebee/models/subscription/types.py delete mode 100644 chargebee/models/subscription_entitlement/types.py delete mode 100644 chargebee/models/subscription_estimate/types.py delete mode 100644 chargebee/models/tax_withheld/types.py delete mode 100644 chargebee/models/third_party_payment_method/types.py delete mode 100644 chargebee/models/time_machine/types.py delete mode 100644 chargebee/models/token/types.py delete mode 100644 chargebee/models/transaction/types.py delete mode 100644 chargebee/models/unbilled_charge/types.py delete mode 100644 chargebee/models/usage/types.py delete mode 100644 chargebee/models/virtual_bank_account/types.py diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 60dc5eb..22c7554 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -80,438 +80,153 @@ ) from chargebee.models.addon.operations import Addon -from chargebee.models.addon.types import ( - Tier, - TaxProvidersField, - Type, - ChargeType, - PeriodUnit, - Status, - ShippingFrequencyPeriodUnit, - ProrationType, -) from chargebee.models.address.operations import Address from chargebee.models.advance_invoice_schedule.operations import AdvanceInvoiceSchedule -from chargebee.models.advance_invoice_schedule.types import ( - FixedIntervalSchedule, - SpecificDatesSchedule, - ScheduleType, -) from chargebee.models.attached_item.operations import AttachedItem -from chargebee.models.attached_item.types import Type, Status from chargebee.models.attribute.operations import Attribute from chargebee.models.business_entity.operations import BusinessEntity -from chargebee.models.business_entity.types import Status from chargebee.models.business_entity_transfer.operations import BusinessEntityTransfer -from chargebee.models.business_entity_transfer.types import ResourceType, ReasonCode from chargebee.models.card.operations import Card -from chargebee.models.card.types import Status, CardType, FundingType, PoweredBy from chargebee.models.comment.operations import Comment -from chargebee.models.comment.types import Type from chargebee.models.contact.operations import Contact from chargebee.models.contract_term.operations import ContractTerm -from chargebee.models.contract_term.types import Status, ActionAtTermEnd from chargebee.models.coupon.operations import Coupon -from chargebee.models.coupon.types import ( - ItemConstraint, - ItemConstraintCriteria, - CouponConstraint, - DiscountType, - DurationType, - Status, - ApplyDiscountOn, - ApplyOn, - AddonConstraint, - PlanConstraint, -) from chargebee.models.coupon_code.operations import CouponCode -from chargebee.models.coupon_code.types import Status from chargebee.models.coupon_set.operations import CouponSet from chargebee.models.credit_note.operations import CreditNote -from chargebee.models.credit_note.types import ( - Einvoice, - LineItem, - Discount, - LineItemDiscount, - LineItemTier, - Tax, - LineItemTax, - LinkedRefund, - Allocation, - ShippingAddress, - BillingAddress, - SiteDetailsAtCreation, - TaxOrigin, - Type, - ReasonCode, - Status, -) from chargebee.models.credit_note_estimate.operations import CreditNoteEstimate -from chargebee.models.credit_note_estimate.types import ( - LineItem, - Discount, - Tax, - LineItemTax, - LineItemDiscount, - LineItemTier, - Type, -) from chargebee.models.currency.operations import Currency -from chargebee.models.currency.types import ForexType from chargebee.models.customer.operations import Customer -from chargebee.models.customer.types import ( - BillingAddress, - ReferralUrl, - Contact, - PaymentMethod, - Balance, - EntityIdentifier, - TaxProvidersField, - Relationship, - ParentAccountAccess, - ChildAccountAccess, - VatNumberStatus, - BillingDayOfWeek, - PiiCleared, - CardStatus, - FraudFlag, -) from chargebee.models.customer_entitlement.operations import CustomerEntitlement from chargebee.models.differential_price.operations import DifferentialPrice -from chargebee.models.differential_price.types import Tier, ParentPeriod, Status from chargebee.models.discount.operations import Discount -from chargebee.models.discount.types import Type from chargebee.models.download.operations import Download from chargebee.models.entitlement.operations import Entitlement -from chargebee.models.entitlement.types import EntityType from chargebee.models.entitlement_override.operations import EntitlementOverride -from chargebee.models.entitlement_override.types import ScheduleStatus from chargebee.models.estimate.operations import Estimate from chargebee.models.event.operations import Event -from chargebee.models.event.types import Webhook, WebhookStatus from chargebee.models.export.operations import Export -from chargebee.models.export.types import Download, MimeType, Status from chargebee.models.feature.operations import Feature -from chargebee.models.feature.types import Level, Status, Type from chargebee.models.gateway_error_detail.operations import GatewayErrorDetail from chargebee.models.gift.operations import Gift -from chargebee.models.gift.types import Gifter, GiftReceiver, GiftTimeline, Status from chargebee.models.hierarchy.operations import Hierarchy from chargebee.models.hosted_page.operations import HostedPage -from chargebee.models.hosted_page.types import Type, State, FailureReason from chargebee.models.impacted_item.operations import ImpactedItem -from chargebee.models.impacted_item.types import Download from chargebee.models.impacted_item_price.operations import ImpactedItemPrice -from chargebee.models.impacted_item_price.types import Download from chargebee.models.impacted_subscription.operations import ImpactedSubscription -from chargebee.models.impacted_subscription.types import Download from chargebee.models.in_app_subscription.operations import InAppSubscription -from chargebee.models.in_app_subscription.types import StoreStatus from chargebee.models.installment.operations import Installment -from chargebee.models.installment.types import Status from chargebee.models.installment_config.operations import InstallmentConfig -from chargebee.models.installment_config.types import Installment, PeriodUnit from chargebee.models.installment_detail.operations import InstallmentDetail -from chargebee.models.installment_detail.types import Installment from chargebee.models.invoice.operations import Invoice -from chargebee.models.invoice.types import ( - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - LineItemTier, - LinkedPayment, - DunningAttempt, - AppliedCredit, - AdjustmentCreditNote, - IssuedCreditNote, - LinkedOrder, - Note, - ShippingAddress, - StatementDescriptor, - BillingAddress, - Einvoice, - SiteDetailsAtCreation, - TaxOrigin, - Status, - DunningStatus, -) from chargebee.models.invoice_estimate.operations import InvoiceEstimate -from chargebee.models.invoice_estimate.types import ( - LineItem, - Discount, - Tax, - LineItemTax, - LineItemTier, - LineItemDiscount, -) from chargebee.models.item.operations import Item -from chargebee.models.item.types import ( - ApplicableItem, - Status, - Type, - ItemApplicability, - UsageCalculation, -) from chargebee.models.item_entitlement.operations import ItemEntitlement -from chargebee.models.item_entitlement.types import ItemType from chargebee.models.item_family.operations import ItemFamily -from chargebee.models.item_family.types import Status from chargebee.models.item_price.operations import ItemPrice -from chargebee.models.item_price.types import ( - Tier, - TaxDetail, - TaxProvidersField, - AccountingDetail, - Status, - ProrationType, - PeriodUnit, - TrialPeriodUnit, - TrialEndAction, - ShippingPeriodUnit, -) from chargebee.models.metadata.operations import Metadata from chargebee.models.order.operations import Order -from chargebee.models.order.types import ( - OrderLineItem, - ShippingAddress, - BillingAddress, - LineItemTax, - LineItemDiscount, - LinkedCreditNote, - ResentOrder, - Status, - CancellationReason, - PaymentStatus, - OrderType, - ResentStatus, -) from chargebee.models.payment_intent.operations import PaymentIntent -from chargebee.models.payment_intent.types import ( - PaymentAttempt, - Status, - PaymentMethodType, -) from chargebee.models.payment_reference_number.operations import PaymentReferenceNumber -from chargebee.models.payment_reference_number.types import Type from chargebee.models.payment_source.operations import PaymentSource -from chargebee.models.payment_source.types import ( - Card, - BankAccount, - CustVoucherSource, - BillingAddress, - AmazonPayment, - Upi, - Paypal, - Venmo, - KlarnaPayNow, - Mandate, - Status, -) from chargebee.models.payment_voucher.operations import PaymentVoucher -from chargebee.models.payment_voucher.types import LinkedInvoice, Status from chargebee.models.plan.operations import Plan -from chargebee.models.plan.types import ( - Tier, - TaxProvidersField, - ApplicableAddon, - AttachedAddon, - EventBasedAddon, - PeriodUnit, - TrialPeriodUnit, - TrialEndAction, - ChargeModel, - Status, - AddonApplicability, - ShippingFrequencyPeriodUnit, -) from chargebee.models.portal_session.operations import PortalSession -from chargebee.models.portal_session.types import LinkedCustomer, Status from chargebee.models.price_variant.operations import PriceVariant -from chargebee.models.price_variant.types import Attribute, Status from chargebee.models.pricing_page_session.operations import PricingPageSession from chargebee.models.promotional_credit.operations import PromotionalCredit -from chargebee.models.promotional_credit.types import Type from chargebee.models.purchase.operations import Purchase from chargebee.models.quote.operations import Quote -from chargebee.models.quote.types import ( - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - LineItemTier, - ShippingAddress, - BillingAddress, - Status, - OperationType, -) from chargebee.models.quote_line_group.operations import QuoteLineGroup -from chargebee.models.quote_line_group.types import ( - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - ChargeEvent, -) from chargebee.models.quoted_charge.operations import QuotedCharge -from chargebee.models.quoted_charge.types import ( - Charge, - Addon, - InvoiceItem, - ItemTier, - Coupon, -) from chargebee.models.quoted_subscription.operations import QuotedSubscription -from chargebee.models.quoted_subscription.types import ( - Addon, - EventBasedAddon, - Coupon, - SubscriptionItem, - ItemTier, - QuotedContractTerm, - ChangeOption, - BillingPeriodUnit, -) from chargebee.models.ramp.operations import Ramp -from chargebee.models.ramp.types import ( - ItemsToAdd, - ItemsToUpdate, - CouponsToAdd, - DiscountsToAdd, - ItemTier, - StatusTransitionReason, - Status, -) from chargebee.models.resource_migration.operations import ResourceMigration -from chargebee.models.resource_migration.types import Status from chargebee.models.site_migration_detail.operations import SiteMigrationDetail -from chargebee.models.site_migration_detail.types import Status from chargebee.models.subscription.operations import Subscription -from chargebee.models.subscription.types import ( - SubscriptionItem, - ItemTier, - ChargedItem, - Addon, - EventBasedAddon, - ChargedEventBasedAddon, - Coupon, - ShippingAddress, - ReferralInfo, - ContractTerm, - Discount, - Status, - CancelReason, - BillingPeriodUnit, -) from chargebee.models.subscription_entitlement.operations import SubscriptionEntitlement -from chargebee.models.subscription_entitlement.types import Component, ScheduleStatus from chargebee.models.subscription_estimate.operations import SubscriptionEstimate -from chargebee.models.subscription_estimate.types import ( - ShippingAddress, - ContractTerm, - Status, -) from chargebee.models.tax_withheld.operations import TaxWithheld -from chargebee.models.tax_withheld.types import Type, PaymentMethod from chargebee.models.third_party_payment_method.operations import ( ThirdPartyPaymentMethod, ) from chargebee.models.time_machine.operations import TimeMachine -from chargebee.models.time_machine.types import TimeTravelStatus from chargebee.models.token.operations import Token -from chargebee.models.token.types import Status, Vault from chargebee.models.transaction.operations import Transaction -from chargebee.models.transaction.types import ( - LinkedInvoice, - LinkedCreditNote, - LinkedRefund, - LinkedPayment, - GatewayErrorDetail, - Type, - Status, - FraudFlag, - InitiatorType, - AuthorizationReason, -) from chargebee.models.unbilled_charge.operations import UnbilledCharge -from chargebee.models.unbilled_charge.types import Tier, EntityType from chargebee.models.usage.operations import Usage from chargebee.models.virtual_bank_account.operations import VirtualBankAccount -from chargebee.models.virtual_bank_account.types import Scheme diff --git a/chargebee/models/addon/__init__.py b/chargebee/models/addon/__init__.py index f72ff81..1fe460e 100644 --- a/chargebee/models/addon/__init__.py +++ b/chargebee/models/addon/__init__.py @@ -1,12 +1,2 @@ from .operations import Addon from .responses import AddonResponse -from .types import ( - Tier, - TaxProvidersField, - Type, - ChargeType, - PeriodUnit, - Status, - ShippingFrequencyPeriodUnit, - ProrationType, -) diff --git a/chargebee/models/addon/operations.py b/chargebee/models/addon/operations.py index d57b980..2a61f4b 100644 --- a/chargebee/models/addon/operations.py +++ b/chargebee/models/addon/operations.py @@ -1,26 +1,116 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Addon: + class Type(Enum): + ON_OFF = "on_off" + QUANTITY = "quantity" + TIERED = "tiered" + VOLUME = "volume" + STAIRSTEP = "stairstep" + + def __str__(self): + return self.value + + class ChargeType(Enum): + RECURRING = "recurring" + NON_RECURRING = "non_recurring" + + def __str__(self): + return self.value + + class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class ShippingFrequencyPeriodUnit(Enum): + YEAR = "year" + MONTH = "month" + WEEK = "week" + DAY = "day" + + def __str__(self): + return self.value + + class ProrationType(Enum): + SITE_DEFAULT = "site_default" + PARTIAL_TERM = "partial_term" + FULL_TERM = "full_term" + + def __str__(self): + return self.value + + class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] class CreateParams(TypedDict): id: Required[str] name: Required[str] invoice_name: NotRequired[str] description: NotRequired[str] - charge_type: Required[ChargeType] + charge_type: Required["Addon.ChargeType"] price: NotRequired[int] - tiers: NotRequired[List[CreateTierParams]] + tiers: NotRequired[List["Addon.CreateTierParams"]] currency_code: NotRequired[str] period: NotRequired[int] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["Addon.PeriodUnit"] pricing_model: NotRequired[enums.PricingModel] - type: NotRequired[Type] + type: NotRequired["Addon.Type"] unit: NotRequired[str] enabled_in_portal: NotRequired[bool] taxable: NotRequired[bool] @@ -41,27 +131,27 @@ class CreateParams(TypedDict): accounting_category4: NotRequired[str] is_shippable: NotRequired[bool] shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + shipping_frequency_period_unit: NotRequired["Addon.ShippingFrequencyPeriodUnit"] included_in_mrr: NotRequired[bool] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] price_in_decimal: NotRequired[str] - tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] - proration_type: NotRequired[ProrationType] - status: NotRequired[Status] + tax_providers_fields: Required[List["Addon.CreateTaxProvidersFieldParams"]] + proration_type: NotRequired["Addon.ProrationType"] + status: NotRequired["Addon.Status"] class UpdateParams(TypedDict): name: NotRequired[str] invoice_name: NotRequired[str] description: NotRequired[str] - charge_type: NotRequired[ChargeType] + charge_type: NotRequired["Addon.ChargeType"] price: NotRequired[int] - tiers: NotRequired[List[UpdateTierParams]] + tiers: NotRequired[List["Addon.UpdateTierParams"]] currency_code: NotRequired[str] period: NotRequired[int] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["Addon.PeriodUnit"] pricing_model: NotRequired[enums.PricingModel] - type: NotRequired[Type] + type: NotRequired["Addon.Type"] unit: NotRequired[str] enabled_in_portal: NotRequired[bool] taxable: NotRequired[bool] @@ -82,13 +172,13 @@ class UpdateParams(TypedDict): accounting_category4: NotRequired[str] is_shippable: NotRequired[bool] shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] + shipping_frequency_period_unit: NotRequired["Addon.ShippingFrequencyPeriodUnit"] included_in_mrr: NotRequired[bool] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] price_in_decimal: NotRequired[str] - tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] - proration_type: NotRequired[ProrationType] + tax_providers_fields: Required[List["Addon.UpdateTaxProvidersFieldParams"]] + proration_type: NotRequired["Addon.ProrationType"] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/addon/types.py b/chargebee/models/addon/types.py deleted file mode 100644 index db11fe3..0000000 --- a/chargebee/models/addon/types.py +++ /dev/null @@ -1,106 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - ON_OFF = "on_off" - QUANTITY = "quantity" - TIERED = "tiered" - VOLUME = "volume" - STAIRSTEP = "stairstep" - - def __str__(self): - return self.value - - -class ChargeType(Enum): - RECURRING = "recurring" - NON_RECURRING = "non_recurring" - - def __str__(self): - return self.value - - -class PeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class ShippingFrequencyPeriodUnit(Enum): - YEAR = "year" - MONTH = "month" - WEEK = "week" - DAY = "day" - - def __str__(self): - return self.value - - -class ProrationType(Enum): - SITE_DEFAULT = "site_default" - PARTIAL_TERM = "partial_term" - FULL_TERM = "full_term" - - def __str__(self): - return self.value - - -class Tier(TypedDict): - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class TaxProvidersField(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class CreateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class UpdateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] diff --git a/chargebee/models/address/operations.py b/chargebee/models/address/operations.py index 5d7566b..9fe83ff 100644 --- a/chargebee/models/address/operations.py +++ b/chargebee/models/address/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.models import enums diff --git a/chargebee/models/address/types.py b/chargebee/models/address/types.py deleted file mode 100644 index 55d7118..0000000 --- a/chargebee/models/address/types.py +++ /dev/null @@ -1,2 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums diff --git a/chargebee/models/advance_invoice_schedule/__init__.py b/chargebee/models/advance_invoice_schedule/__init__.py index e782b08..230fe82 100644 --- a/chargebee/models/advance_invoice_schedule/__init__.py +++ b/chargebee/models/advance_invoice_schedule/__init__.py @@ -1,3 +1,2 @@ from .operations import AdvanceInvoiceSchedule from .responses import AdvanceInvoiceScheduleResponse -from .types import FixedIntervalSchedule, SpecificDatesSchedule, ScheduleType diff --git a/chargebee/models/advance_invoice_schedule/operations.py b/chargebee/models/advance_invoice_schedule/operations.py index 3b589e9..83b0515 100644 --- a/chargebee/models/advance_invoice_schedule/operations.py +++ b/chargebee/models/advance_invoice_schedule/operations.py @@ -1,9 +1,29 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class AdvanceInvoiceSchedule: + class ScheduleType(Enum): + FIXED_INTERVALS = "fixed_intervals" + SPECIFIC_DATES = "specific_dates" + + def __str__(self): + return self.value + + class FixedIntervalSchedule(TypedDict): + end_schedule_on: NotRequired[enums.EndScheduleOn] + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_date: NotRequired[int] + created_at: Required[int] + terms_to_charge: NotRequired[int] + + class SpecificDatesSchedule(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + created_at: Required[int] pass diff --git a/chargebee/models/advance_invoice_schedule/types.py b/chargebee/models/advance_invoice_schedule/types.py deleted file mode 100644 index bc340c3..0000000 --- a/chargebee/models/advance_invoice_schedule/types.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class ScheduleType(Enum): - FIXED_INTERVALS = "fixed_intervals" - SPECIFIC_DATES = "specific_dates" - - def __str__(self): - return self.value - - -class FixedIntervalSchedule(TypedDict): - end_schedule_on: NotRequired[enums.EndScheduleOn] - number_of_occurrences: NotRequired[int] - days_before_renewal: NotRequired[int] - end_date: NotRequired[int] - created_at: Required[int] - terms_to_charge: NotRequired[int] - - -class SpecificDatesSchedule(TypedDict): - terms_to_charge: NotRequired[int] - date: NotRequired[int] - created_at: Required[int] diff --git a/chargebee/models/attached_item/__init__.py b/chargebee/models/attached_item/__init__.py index 970b044..c49cb9c 100644 --- a/chargebee/models/attached_item/__init__.py +++ b/chargebee/models/attached_item/__init__.py @@ -1,3 +1,2 @@ from .operations import AttachedItem from .responses import AttachedItemResponse -from .types import Type, Status diff --git a/chargebee/models/attached_item/operations.py b/chargebee/models/attached_item/operations.py index e33edd9..49940ba 100644 --- a/chargebee/models/attached_item/operations.py +++ b/chargebee/models/attached_item/operations.py @@ -1,16 +1,31 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class AttachedItem: + class Type(Enum): + RECOMMENDED = "recommended" + MANDATORY = "mandatory" + OPTIONAL = "optional" + + def __str__(self): + return self.value + + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value class CreateParams(TypedDict): item_id: Required[str] - type: NotRequired[Type] + type: NotRequired["AttachedItem.Type"] billing_cycles: NotRequired[int] quantity: NotRequired[int] quantity_in_decimal: NotRequired[str] @@ -19,7 +34,7 @@ class CreateParams(TypedDict): class UpdateParams(TypedDict): parent_item_id: Required[str] - type: NotRequired[Type] + type: NotRequired["AttachedItem.Type"] billing_cycles: NotRequired[int] quantity: NotRequired[int] quantity_in_decimal: NotRequired[str] diff --git a/chargebee/models/attached_item/types.py b/chargebee/models/attached_item/types.py deleted file mode 100644 index 1a44e82..0000000 --- a/chargebee/models/attached_item/types.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - RECOMMENDED = "recommended" - MANDATORY = "mandatory" - OPTIONAL = "optional" - - def __str__(self): - return self.value - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value diff --git a/chargebee/models/attribute/operations.py b/chargebee/models/attribute/operations.py index df99085..2d47f75 100644 --- a/chargebee/models/attribute/operations.py +++ b/chargebee/models/attribute/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class Attribute: diff --git a/chargebee/models/attribute/types.py b/chargebee/models/attribute/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/attribute/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/business_entity/__init__.py b/chargebee/models/business_entity/__init__.py index 18415b5..efc7b7f 100644 --- a/chargebee/models/business_entity/__init__.py +++ b/chargebee/models/business_entity/__init__.py @@ -1,3 +1,2 @@ from .operations import BusinessEntity from .responses import BusinessEntityResponse -from .types import Status diff --git a/chargebee/models/business_entity/operations.py b/chargebee/models/business_entity/operations.py index cd74ca6..bac971d 100644 --- a/chargebee/models/business_entity/operations.py +++ b/chargebee/models/business_entity/operations.py @@ -1,11 +1,17 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class BusinessEntity: + class Status(Enum): + ACTIVE = "active" + INACTIVE = "inactive" + + def __str__(self): + return self.value class CreateTransfersParams(TypedDict): active_resource_ids: Required[List[str]] diff --git a/chargebee/models/business_entity/types.py b/chargebee/models/business_entity/types.py deleted file mode 100644 index a902e82..0000000 --- a/chargebee/models/business_entity/types.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - ACTIVE = "active" - INACTIVE = "inactive" - - def __str__(self): - return self.value diff --git a/chargebee/models/business_entity_transfer/__init__.py b/chargebee/models/business_entity_transfer/__init__.py index 662d38e..f0d47e5 100644 --- a/chargebee/models/business_entity_transfer/__init__.py +++ b/chargebee/models/business_entity_transfer/__init__.py @@ -1,3 +1,2 @@ from .operations import BusinessEntityTransfer from .responses import BusinessEntityTransferResponse -from .types import ResourceType, ReasonCode diff --git a/chargebee/models/business_entity_transfer/operations.py b/chargebee/models/business_entity_transfer/operations.py index 272fbfc..1f8aaba 100644 --- a/chargebee/models/business_entity_transfer/operations.py +++ b/chargebee/models/business_entity_transfer/operations.py @@ -1,9 +1,21 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class BusinessEntityTransfer: + class ResourceType(Enum): + CUSTOMER = "customer" + SUBSCRIPTION = "subscription" + + def __str__(self): + return self.value + + class ReasonCode(Enum): + CORRECTION = "correction" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/business_entity_transfer/types.py b/chargebee/models/business_entity_transfer/types.py deleted file mode 100644 index 99888c6..0000000 --- a/chargebee/models/business_entity_transfer/types.py +++ /dev/null @@ -1,17 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class ResourceType(Enum): - CUSTOMER = "customer" - SUBSCRIPTION = "subscription" - - def __str__(self): - return self.value - - -class ReasonCode(Enum): - CORRECTION = "correction" - - def __str__(self): - return self.value diff --git a/chargebee/models/card/__init__.py b/chargebee/models/card/__init__.py index 8387499..d6915bc 100644 --- a/chargebee/models/card/__init__.py +++ b/chargebee/models/card/__init__.py @@ -1,3 +1,2 @@ from .operations import Card from .responses import CardResponse -from .types import Status, CardType, FundingType, PoweredBy diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py index e692043..ba7b236 100644 --- a/chargebee/models/card/operations.py +++ b/chargebee/models/card/operations.py @@ -1,11 +1,68 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.models import enums class Card: + class Status(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + + def __str__(self): + return self.value + + class CardType(Enum): + VISA = "visa" + MASTERCARD = "mastercard" + AMERICAN_EXPRESS = "american_express" + DISCOVER = "discover" + JCB = "jcb" + DINERS_CLUB = "diners_club" + BANCONTACT = "bancontact" + CMR_FALABELLA = "cmr_falabella" + TARJETA_NARANJA = "tarjeta_naranja" + NATIVA = "nativa" + CENCOSUD = "cencosud" + CABAL = "cabal" + ARGENCARD = "argencard" + ELO = "elo" + HIPERCARD = "hipercard" + CARNET = "carnet" + RUPAY = "rupay" + MAESTRO = "maestro" + OTHER = "other" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class FundingType(Enum): + CREDIT = "credit" + DEBIT = "debit" + PREPAID = "prepaid" + NOT_KNOWN = "not_known" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class PoweredBy(Enum): + IDEAL = "ideal" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GIROPAY = "giropay" + CARD = "card" + LATAM_LOCAL_CARD = "latam_local_card" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class UpdateCardForCustomerCustomerParams(TypedDict): + vat_number: NotRequired[str] class UpdateCardForCustomerParams(TypedDict): gateway: NotRequired[enums.Gateway] @@ -25,7 +82,7 @@ class UpdateCardForCustomerParams(TypedDict): billing_zip: NotRequired[str] billing_country: NotRequired[str] ip_address: NotRequired[str] - customer: NotRequired[UpdateCardForCustomerCustomerParams] + customer: NotRequired["Card.UpdateCardForCustomerCustomerParams"] class SwitchGatewayForCustomerParams(TypedDict): gateway: NotRequired[enums.Gateway] diff --git a/chargebee/models/card/types.py b/chargebee/models/card/types.py deleted file mode 100644 index fe4a148..0000000 --- a/chargebee/models/card/types.py +++ /dev/null @@ -1,66 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - VALID = "valid" - EXPIRING = "expiring" - EXPIRED = "expired" - - def __str__(self): - return self.value - - -class CardType(Enum): - VISA = "visa" - MASTERCARD = "mastercard" - AMERICAN_EXPRESS = "american_express" - DISCOVER = "discover" - JCB = "jcb" - DINERS_CLUB = "diners_club" - BANCONTACT = "bancontact" - CMR_FALABELLA = "cmr_falabella" - TARJETA_NARANJA = "tarjeta_naranja" - NATIVA = "nativa" - CENCOSUD = "cencosud" - CABAL = "cabal" - ARGENCARD = "argencard" - ELO = "elo" - HIPERCARD = "hipercard" - CARNET = "carnet" - RUPAY = "rupay" - MAESTRO = "maestro" - OTHER = "other" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class FundingType(Enum): - CREDIT = "credit" - DEBIT = "debit" - PREPAID = "prepaid" - NOT_KNOWN = "not_known" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class PoweredBy(Enum): - IDEAL = "ideal" - SOFORT = "sofort" - BANCONTACT = "bancontact" - GIROPAY = "giropay" - CARD = "card" - LATAM_LOCAL_CARD = "latam_local_card" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class UpdateCardForCustomerCustomerParams(TypedDict): - vat_number: NotRequired[str] diff --git a/chargebee/models/comment/__init__.py b/chargebee/models/comment/__init__.py index ff1e19f..ca4db64 100644 --- a/chargebee/models/comment/__init__.py +++ b/chargebee/models/comment/__init__.py @@ -1,3 +1,2 @@ from .operations import Comment from .responses import CommentResponse -from .types import Type diff --git a/chargebee/models/comment/operations.py b/chargebee/models/comment/operations.py index 759c040..0ef974f 100644 --- a/chargebee/models/comment/operations.py +++ b/chargebee/models/comment/operations.py @@ -1,12 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Comment: + class Type(Enum): + USER = "user" + SYSTEM = "system" + + def __str__(self): + return self.value class CreateParams(TypedDict): entity_type: Required[enums.EntityType] diff --git a/chargebee/models/comment/types.py b/chargebee/models/comment/types.py deleted file mode 100644 index c096b9c..0000000 --- a/chargebee/models/comment/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - USER = "user" - SYSTEM = "system" - - def __str__(self): - return self.value diff --git a/chargebee/models/contact/operations.py b/chargebee/models/contact/operations.py index c113e4e..994d7a8 100644 --- a/chargebee/models/contact/operations.py +++ b/chargebee/models/contact/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class Contact: diff --git a/chargebee/models/contact/types.py b/chargebee/models/contact/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/contact/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/contract_term/__init__.py b/chargebee/models/contract_term/__init__.py index 5637d07..72ca169 100644 --- a/chargebee/models/contract_term/__init__.py +++ b/chargebee/models/contract_term/__init__.py @@ -1,3 +1,2 @@ from .operations import ContractTerm from .responses import ContractTermResponse -from .types import Status, ActionAtTermEnd diff --git a/chargebee/models/contract_term/operations.py b/chargebee/models/contract_term/operations.py index e2800b9..5cfed9d 100644 --- a/chargebee/models/contract_term/operations.py +++ b/chargebee/models/contract_term/operations.py @@ -1,9 +1,26 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class ContractTerm: + class Status(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + def __str__(self): + return self.value + + class ActionAtTermEnd(Enum): + RENEW = "renew" + EVERGREEN = "evergreen" + CANCEL = "cancel" + RENEW_ONCE = "renew_once" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/contract_term/types.py b/chargebee/models/contract_term/types.py deleted file mode 100644 index 970e20d..0000000 --- a/chargebee/models/contract_term/types.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - ACTIVE = "active" - COMPLETED = "completed" - CANCELLED = "cancelled" - TERMINATED = "terminated" - - def __str__(self): - return self.value - - -class ActionAtTermEnd(Enum): - RENEW = "renew" - EVERGREEN = "evergreen" - CANCEL = "cancel" - RENEW_ONCE = "renew_once" - - def __str__(self): - return self.value diff --git a/chargebee/models/coupon/__init__.py b/chargebee/models/coupon/__init__.py index 0973359..7c9b3bf 100644 --- a/chargebee/models/coupon/__init__.py +++ b/chargebee/models/coupon/__init__.py @@ -1,14 +1,2 @@ from .operations import Coupon from .responses import CouponResponse -from .types import ( - ItemConstraint, - ItemConstraintCriteria, - CouponConstraint, - DiscountType, - DurationType, - Status, - ApplyDiscountOn, - ApplyOn, - AddonConstraint, - PlanConstraint, -) diff --git a/chargebee/models/coupon/operations.py b/chargebee/models/coupon/operations.py index 678eb7d..21eeac3 100644 --- a/chargebee/models/coupon/operations.py +++ b/chargebee/models/coupon/operations.py @@ -1,24 +1,167 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Coupon: + class DiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + class DurationType(Enum): + ONE_TIME = "one_time" + FOREVER = "forever" + LIMITED_PERIOD = "limited_period" + + def __str__(self): + return self.value + + class Status(Enum): + ACTIVE = "active" + EXPIRED = "expired" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class ApplyDiscountOn(Enum): + PLANS = "plans" + PLANS_AND_ADDONS = "plans_and_addons" + PLANS_WITH_QUANTITY = "plans_with_quantity" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class ApplyOn(Enum): + INVOICE_AMOUNT = "invoice_amount" + EACH_SPECIFIED_ITEM = "each_specified_item" + + def __str__(self): + return self.value + + class AddonConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class PlanConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class ItemConstraintItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + class ItemConstraintConstraint(Enum): + NONE = "none" + ALL = "all" + SPECIFIC = "specific" + CRITERIA = "criteria" + + def __str__(self): + return self.value + + class ItemConstraintCriteriaItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + class CouponConstraintEntityType(Enum): + CUSTOMER = "customer" + + def __str__(self): + return self.value + + class CouponConstraintType(Enum): + MAX_REDEMPTIONS = "max_redemptions" + UNIQUE_BY = "unique_by" + + def __str__(self): + return self.value + + class ItemConstraint(TypedDict): + item_type: Required["Coupon.ItemConstraintItemType"] + constraint: Required["Coupon.ItemConstraintConstraint"] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + class ItemConstraintCriteria(TypedDict): + item_type: Required["Coupon.ItemConstraintCriteriaItemType"] + currencies: NotRequired[List[Dict[Any, Any]]] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + class CouponConstraint(TypedDict): + entity_type: Required["Coupon.CouponConstraintEntityType"] + type: Required["Coupon.CouponConstraintType"] + value: NotRequired[str] + + class CreateForItemsItemConstraintParams(TypedDict): + constraint: Required["Coupon.ItemConstraintConstraint"] + item_type: Required["Coupon.ItemConstraintItemType"] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + class CreateForItemsItemConstraintCriteriaParams(TypedDict): + item_type: NotRequired["Coupon.ItemConstraintCriteriaItemType"] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + currencies: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + class CreateForItemsCouponConstraintParams(TypedDict): + entity_type: Required["Coupon.CouponConstraintEntityType"] + type: Required["Coupon.CouponConstraintType"] + value: NotRequired[str] + + class UpdateForItemsItemConstraintParams(TypedDict): + constraint: Required["Coupon.ItemConstraintConstraint"] + item_type: Required["Coupon.ItemConstraintItemType"] + item_price_ids: NotRequired[List[Dict[Any, Any]]] + + class UpdateForItemsItemConstraintCriteriaParams(TypedDict): + item_type: NotRequired["Coupon.ItemConstraintCriteriaItemType"] + item_family_ids: NotRequired[List[Dict[Any, Any]]] + currencies: NotRequired[List[Dict[Any, Any]]] + item_price_periods: NotRequired[List[Dict[Any, Any]]] + + class UpdateForItemsCouponConstraintParams(TypedDict): + entity_type: Required["Coupon.CouponConstraintEntityType"] + type: Required["Coupon.CouponConstraintType"] + value: NotRequired[str] class CreateParams(TypedDict): id: Required[str] name: Required[str] invoice_name: NotRequired[str] - discount_type: NotRequired[DiscountType] + discount_type: NotRequired["Coupon.DiscountType"] discount_amount: NotRequired[int] currency_code: NotRequired[str] discount_percentage: NotRequired[float] discount_quantity: NotRequired[int] - apply_on: Required[ApplyOn] - duration_type: NotRequired[DurationType] + apply_on: Required["Coupon.ApplyOn"] + duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] @@ -27,23 +170,23 @@ class CreateParams(TypedDict): included_in_mrr: NotRequired[bool] period: NotRequired[int] period_unit: NotRequired[enums.PeriodUnit] - plan_constraint: NotRequired[PlanConstraint] - addon_constraint: NotRequired[AddonConstraint] + plan_constraint: NotRequired["Coupon.PlanConstraint"] + addon_constraint: NotRequired["Coupon.AddonConstraint"] plan_ids: NotRequired[List[str]] addon_ids: NotRequired[List[str]] - status: NotRequired[Status] + status: NotRequired["Coupon.Status"] class CreateForItemsParams(TypedDict): id: Required[str] name: Required[str] invoice_name: NotRequired[str] - discount_type: NotRequired[DiscountType] + discount_type: NotRequired["Coupon.DiscountType"] discount_amount: NotRequired[int] currency_code: NotRequired[str] discount_percentage: NotRequired[float] discount_quantity: NotRequired[int] - apply_on: Required[ApplyOn] - duration_type: NotRequired[DurationType] + apply_on: Required["Coupon.ApplyOn"] + duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] @@ -52,23 +195,25 @@ class CreateForItemsParams(TypedDict): included_in_mrr: NotRequired[bool] period: NotRequired[int] period_unit: NotRequired[enums.PeriodUnit] - item_constraints: Required[List[CreateForItemsItemConstraintParams]] + item_constraints: Required[List["Coupon.CreateForItemsItemConstraintParams"]] item_constraint_criteria: NotRequired[ - List[CreateForItemsItemConstraintCriteriaParams] + List["Coupon.CreateForItemsItemConstraintCriteriaParams"] + ] + status: NotRequired["Coupon.Status"] + coupon_constraints: Required[ + List["Coupon.CreateForItemsCouponConstraintParams"] ] - status: NotRequired[Status] - coupon_constraints: Required[List[CreateForItemsCouponConstraintParams]] class UpdateForItemsParams(TypedDict): name: NotRequired[str] invoice_name: NotRequired[str] - discount_type: NotRequired[DiscountType] + discount_type: NotRequired["Coupon.DiscountType"] discount_amount: NotRequired[int] currency_code: NotRequired[str] discount_percentage: NotRequired[float] discount_quantity: NotRequired[int] - apply_on: NotRequired[ApplyOn] - duration_type: NotRequired[DurationType] + apply_on: NotRequired["Coupon.ApplyOn"] + duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] @@ -77,11 +222,13 @@ class UpdateForItemsParams(TypedDict): included_in_mrr: NotRequired[bool] period: NotRequired[int] period_unit: NotRequired[enums.PeriodUnit] - item_constraints: Required[List[UpdateForItemsItemConstraintParams]] + item_constraints: Required[List["Coupon.UpdateForItemsItemConstraintParams"]] item_constraint_criteria: NotRequired[ - List[UpdateForItemsItemConstraintCriteriaParams] + List["Coupon.UpdateForItemsItemConstraintCriteriaParams"] + ] + coupon_constraints: Required[ + List["Coupon.UpdateForItemsCouponConstraintParams"] ] - coupon_constraints: Required[List[UpdateForItemsCouponConstraintParams]] class ListParams(TypedDict): limit: NotRequired[int] @@ -100,13 +247,13 @@ class ListParams(TypedDict): class UpdateParams(TypedDict): name: NotRequired[str] invoice_name: NotRequired[str] - discount_type: NotRequired[DiscountType] + discount_type: NotRequired["Coupon.DiscountType"] discount_amount: NotRequired[int] currency_code: NotRequired[str] discount_percentage: NotRequired[float] discount_quantity: NotRequired[int] - apply_on: NotRequired[ApplyOn] - duration_type: NotRequired[DurationType] + apply_on: NotRequired["Coupon.ApplyOn"] + duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] @@ -115,8 +262,8 @@ class UpdateParams(TypedDict): included_in_mrr: NotRequired[bool] period: NotRequired[int] period_unit: NotRequired[enums.PeriodUnit] - plan_constraint: NotRequired[PlanConstraint] - addon_constraint: NotRequired[AddonConstraint] + plan_constraint: NotRequired["Coupon.PlanConstraint"] + addon_constraint: NotRequired["Coupon.AddonConstraint"] plan_ids: NotRequired[List[str]] addon_ids: NotRequired[List[str]] diff --git a/chargebee/models/coupon/types.py b/chargebee/models/coupon/types.py deleted file mode 100644 index bf8c7c4..0000000 --- a/chargebee/models/coupon/types.py +++ /dev/null @@ -1,168 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class DiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - -class DurationType(Enum): - ONE_TIME = "one_time" - FOREVER = "forever" - LIMITED_PERIOD = "limited_period" - - def __str__(self): - return self.value - - -class Status(Enum): - ACTIVE = "active" - EXPIRED = "expired" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class ApplyDiscountOn(Enum): - PLANS = "plans" - PLANS_AND_ADDONS = "plans_and_addons" - PLANS_WITH_QUANTITY = "plans_with_quantity" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class ApplyOn(Enum): - INVOICE_AMOUNT = "invoice_amount" - EACH_SPECIFIED_ITEM = "each_specified_item" - - def __str__(self): - return self.value - - -class AddonConstraint(Enum): - NONE = "none" - ALL = "all" - SPECIFIC = "specific" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class PlanConstraint(Enum): - NONE = "none" - ALL = "all" - SPECIFIC = "specific" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class ItemConstraintItemType(Enum): - PLAN = "plan" - ADDON = "addon" - CHARGE = "charge" - - def __str__(self): - return self.value - - -class ItemConstraintConstraint(Enum): - NONE = "none" - ALL = "all" - SPECIFIC = "specific" - CRITERIA = "criteria" - - def __str__(self): - return self.value - - -class ItemConstraintCriteriaItemType(Enum): - PLAN = "plan" - ADDON = "addon" - CHARGE = "charge" - - def __str__(self): - return self.value - - -class CouponConstraintEntityType(Enum): - CUSTOMER = "customer" - - def __str__(self): - return self.value - - -class CouponConstraintType(Enum): - MAX_REDEMPTIONS = "max_redemptions" - UNIQUE_BY = "unique_by" - - def __str__(self): - return self.value - - -class ItemConstraint(TypedDict): - item_type: Required[ItemConstraintItemType] - constraint: Required[ItemConstraintConstraint] - item_price_ids: NotRequired[List[Dict[Any, Any]]] - - -class ItemConstraintCriteria(TypedDict): - item_type: Required[ItemConstraintCriteriaItemType] - currencies: NotRequired[List[Dict[Any, Any]]] - item_family_ids: NotRequired[List[Dict[Any, Any]]] - item_price_periods: NotRequired[List[Dict[Any, Any]]] - - -class CouponConstraint(TypedDict): - entity_type: Required[CouponConstraintEntityType] - type: Required[CouponConstraintType] - value: NotRequired[str] - - -class CreateForItemsItemConstraintParams(TypedDict): - constraint: Required[ItemConstraintConstraint] - item_type: Required[ItemConstraintItemType] - item_price_ids: NotRequired[List[Dict[Any, Any]]] - - -class CreateForItemsItemConstraintCriteriaParams(TypedDict): - item_type: NotRequired[ItemConstraintCriteriaItemType] - item_family_ids: NotRequired[List[Dict[Any, Any]]] - currencies: NotRequired[List[Dict[Any, Any]]] - item_price_periods: NotRequired[List[Dict[Any, Any]]] - - -class CreateForItemsCouponConstraintParams(TypedDict): - entity_type: Required[CouponConstraintEntityType] - type: Required[CouponConstraintType] - value: NotRequired[str] - - -class UpdateForItemsItemConstraintParams(TypedDict): - constraint: Required[ItemConstraintConstraint] - item_type: Required[ItemConstraintItemType] - item_price_ids: NotRequired[List[Dict[Any, Any]]] - - -class UpdateForItemsItemConstraintCriteriaParams(TypedDict): - item_type: NotRequired[ItemConstraintCriteriaItemType] - item_family_ids: NotRequired[List[Dict[Any, Any]]] - currencies: NotRequired[List[Dict[Any, Any]]] - item_price_periods: NotRequired[List[Dict[Any, Any]]] - - -class UpdateForItemsCouponConstraintParams(TypedDict): - entity_type: Required[CouponConstraintEntityType] - type: Required[CouponConstraintType] - value: NotRequired[str] diff --git a/chargebee/models/coupon_code/__init__.py b/chargebee/models/coupon_code/__init__.py index e147c5c..126336d 100644 --- a/chargebee/models/coupon_code/__init__.py +++ b/chargebee/models/coupon_code/__init__.py @@ -1,3 +1,2 @@ from .operations import CouponCode from .responses import CouponCodeResponse -from .types import Status diff --git a/chargebee/models/coupon_code/operations.py b/chargebee/models/coupon_code/operations.py index f8f3635..414260e 100644 --- a/chargebee/models/coupon_code/operations.py +++ b/chargebee/models/coupon_code/operations.py @@ -1,11 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class CouponCode: + class Status(Enum): + NOT_REDEEMED = "not_redeemed" + REDEEMED = "redeemed" + ARCHIVED = "archived" + + def __str__(self): + return self.value class CreateParams(TypedDict): coupon_id: Required[str] diff --git a/chargebee/models/coupon_code/types.py b/chargebee/models/coupon_code/types.py deleted file mode 100644 index 9e43a6c..0000000 --- a/chargebee/models/coupon_code/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - NOT_REDEEMED = "not_redeemed" - REDEEMED = "redeemed" - ARCHIVED = "archived" - - def __str__(self): - return self.value diff --git a/chargebee/models/coupon_set/operations.py b/chargebee/models/coupon_set/operations.py index 85d0c24..44a896c 100644 --- a/chargebee/models/coupon_set/operations.py +++ b/chargebee/models/coupon_set/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.filters import Filters diff --git a/chargebee/models/coupon_set/types.py b/chargebee/models/coupon_set/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/coupon_set/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/credit_note/__init__.py b/chargebee/models/credit_note/__init__.py index 0cfdb07..6b717bb 100644 --- a/chargebee/models/credit_note/__init__.py +++ b/chargebee/models/credit_note/__init__.py @@ -1,20 +1,2 @@ from .operations import CreditNote from .responses import CreditNoteResponse -from .types import ( - Einvoice, - LineItem, - Discount, - LineItemDiscount, - LineItemTier, - Tax, - LineItemTax, - LinkedRefund, - Allocation, - ShippingAddress, - BillingAddress, - SiteDetailsAtCreation, - TaxOrigin, - Type, - ReasonCode, - Status, -) diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index f31fbe3..940b70e 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -1,22 +1,340 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, invoice, transaction class CreditNote: + class Type(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + class ReasonCode(Enum): + WRITE_OFF = "write_off" + SUBSCRIPTION_CHANGE = "subscription_change" + SUBSCRIPTION_CANCELLATION = "subscription_cancellation" + SUBSCRIPTION_PAUSE = "subscription_pause" + CHARGEBACK = "chargeback" + PRODUCT_UNSATISFACTORY = "product_unsatisfactory" + SERVICE_UNSATISFACTORY = "service_unsatisfactory" + ORDER_CHANGE = "order_change" + ORDER_CANCELLATION = "order_cancellation" + WAIVER = "waiver" + OTHER = "other" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + class Status(Enum): + ADJUSTED = "adjusted" + REFUNDED = "refunded" + REFUND_DUE = "refund_due" + VOIDED = "voided" + + 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" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class Einvoice(TypedDict): + id: Required[str] + reference_number: NotRequired[str] + status: Required["CreditNote.EinvoiceStatus"] + message: NotRequired[str] + + class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["CreditNote.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["CreditNote.DiscountEntityType"] + 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] + 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] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + class LinkedRefund(TypedDict): + txn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + txn_status: NotRequired["transaction.Transaction.Status"] + txn_date: NotRequired[int] + txn_amount: NotRequired[int] + refund_reason_code: NotRequired[str] + + class Allocation(TypedDict): + invoice_id: Required[str] + allocated_amount: Required[int] + allocated_at: Required[int] + invoice_date: NotRequired[int] + invoice_status: Required["invoice.Invoice.Status"] + + class ShippingAddress(TypedDict): + 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] + index: Required[int] + + class BillingAddress(TypedDict): + 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 SiteDetailsAtCreation(TypedDict): + timezone: NotRequired[str] + organization_address: NotRequired[Dict[Any, Any]] + + class TaxOrigin(TypedDict): + country: NotRequired[str] + registration_number: NotRequired[str] + + class CreateLineItemParams(TypedDict): + reference_line_item_id: NotRequired[str] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + amount: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + description: NotRequired[str] + entity_type: NotRequired["CreditNote.LineItemEntityType"] + entity_id: NotRequired[str] + + class RecordRefundTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + date: Required[int] + + class ListEinvoiceParams(TypedDict): + status: NotRequired[Filters.EnumFilter] + + class RemoveTaxWithheldRefundTaxWithheldParams(TypedDict): + id: Required[str] + + class ImportCreditNoteLineItemParams(TypedDict): + reference_line_item_id: NotRequired[str] + id: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + subscription_id: NotRequired[str] + description: Required[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + entity_type: NotRequired["CreditNote.LineItemEntityType"] + entity_id: NotRequired[str] + item_level_discount1_entity_id: NotRequired[str] + item_level_discount1_amount: NotRequired[int] + item_level_discount2_entity_id: NotRequired[str] + item_level_discount2_amount: NotRequired[int] + tax1_name: NotRequired[str] + tax1_amount: NotRequired[int] + tax2_name: NotRequired[str] + tax2_amount: NotRequired[int] + tax3_name: NotRequired[str] + tax3_amount: NotRequired[int] + tax4_name: NotRequired[str] + tax4_amount: NotRequired[int] + tax5_name: NotRequired[str] + tax5_amount: NotRequired[int] + tax6_name: NotRequired[str] + tax6_amount: NotRequired[int] + tax7_name: NotRequired[str] + tax7_amount: NotRequired[int] + tax8_name: NotRequired[str] + tax8_amount: NotRequired[int] + tax9_name: NotRequired[str] + tax9_amount: NotRequired[int] + tax10_name: NotRequired[str] + tax10_amount: NotRequired[int] + + class ImportCreditNoteLineItemTierParams(TypedDict): + line_item_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + class ImportCreditNoteDiscountParams(TypedDict): + entity_type: Required["CreditNote.DiscountEntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + class ImportCreditNoteTaxParams(TypedDict): + name: Required[str] + rate: Required[float] + amount: NotRequired[int] + description: NotRequired[str] + juris_type: NotRequired[enums.TaxJurisType] + juris_name: NotRequired[str] + juris_code: NotRequired[str] + + class ImportCreditNoteAllocationParams(TypedDict): + invoice_id: Required[str] + allocated_amount: Required[int] + allocated_at: Required[int] + + class ImportCreditNoteLinkedRefundParams(TypedDict): + amount: Required[int] + payment_method: Required[enums.PaymentMethod] + date: Required[int] + reference_number: NotRequired[str] class CreateParams(TypedDict): reference_invoice_id: NotRequired[str] customer_id: NotRequired[str] total: NotRequired[int] - type: Required[Type] - reason_code: NotRequired[ReasonCode] + type: Required["CreditNote.Type"] + reason_code: NotRequired["CreditNote.ReasonCode"] create_reason_code: NotRequired[str] date: NotRequired[int] customer_notes: NotRequired[str] currency_code: NotRequired[str] - line_items: NotRequired[List[CreateLineItemParams]] + line_items: NotRequired[List["CreditNote.CreateLineItemParams"]] comment: NotRequired[str] class PdfParams(TypedDict): @@ -28,7 +346,7 @@ class RefundParams(TypedDict): refund_reason_code: NotRequired[str] class RecordRefundParams(TypedDict): - transaction: Required[RecordRefundTransactionParams] + transaction: Required["CreditNote.RecordRefundTransactionParams"] refund_reason_code: NotRequired[str] comment: NotRequired[str] @@ -38,7 +356,7 @@ class VoidCreditNoteParams(TypedDict): class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] - einvoice: NotRequired[ListEinvoiceParams] + einvoice: NotRequired["CreditNote.ListEinvoiceParams"] include_deleted: NotRequired[bool] id: NotRequired[Filters.StringFilter] customer_id: NotRequired[Filters.StringFilter] @@ -67,18 +385,18 @@ class DeleteParams(TypedDict): comment: NotRequired[str] class RemoveTaxWithheldRefundParams(TypedDict): - tax_withheld: Required[RemoveTaxWithheldRefundTaxWithheldParams] + tax_withheld: Required["CreditNote.RemoveTaxWithheldRefundTaxWithheldParams"] class ImportCreditNoteParams(TypedDict): id: Required[str] customer_id: NotRequired[str] subscription_id: NotRequired[str] reference_invoice_id: Required[str] - type: Required[Type] + type: Required["CreditNote.Type"] currency_code: NotRequired[str] create_reason_code: Required[str] date: Required[int] - status: NotRequired[Status] + status: NotRequired["CreditNote.Status"] total: NotRequired[int] refunded_at: NotRequired[int] voided_at: NotRequired[int] @@ -86,12 +404,12 @@ class ImportCreditNoteParams(TypedDict): round_off_amount: NotRequired[int] fractional_correction: NotRequired[int] vat_number_prefix: NotRequired[str] - line_items: Required[List[ImportCreditNoteLineItemParams]] - line_item_tiers: Required[List[ImportCreditNoteLineItemTierParams]] - discounts: Required[List[ImportCreditNoteDiscountParams]] - taxes: Required[List[ImportCreditNoteTaxParams]] - allocations: Required[List[ImportCreditNoteAllocationParams]] - linked_refunds: Required[List[ImportCreditNoteLinkedRefundParams]] + line_items: Required[List["CreditNote.ImportCreditNoteLineItemParams"]] + line_item_tiers: Required[List["CreditNote.ImportCreditNoteLineItemTierParams"]] + discounts: Required[List["CreditNote.ImportCreditNoteDiscountParams"]] + taxes: Required[List["CreditNote.ImportCreditNoteTaxParams"]] + allocations: Required[List["CreditNote.ImportCreditNoteAllocationParams"]] + linked_refunds: Required[List["CreditNote.ImportCreditNoteLinkedRefundParams"]] @staticmethod def create(params: CreateParams, env=None, headers=None) -> CreateResponse: diff --git a/chargebee/models/credit_note/types.py b/chargebee/models/credit_note/types.py deleted file mode 100644 index 7508665..0000000 --- a/chargebee/models/credit_note/types.py +++ /dev/null @@ -1,351 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.filters import Filters -from chargebee.models import enums, invoice, transaction - - -class Type(Enum): - ADJUSTMENT = "adjustment" - REFUNDABLE = "refundable" - - def __str__(self): - return self.value - - -class ReasonCode(Enum): - WRITE_OFF = "write_off" - SUBSCRIPTION_CHANGE = "subscription_change" - SUBSCRIPTION_CANCELLATION = "subscription_cancellation" - SUBSCRIPTION_PAUSE = "subscription_pause" - CHARGEBACK = "chargeback" - PRODUCT_UNSATISFACTORY = "product_unsatisfactory" - SERVICE_UNSATISFACTORY = "service_unsatisfactory" - ORDER_CHANGE = "order_change" - ORDER_CANCELLATION = "order_cancellation" - WAIVER = "waiver" - OTHER = "other" - FRAUDULENT = "fraudulent" - - def __str__(self): - return self.value - - -class Status(Enum): - ADJUSTED = "adjusted" - REFUNDED = "refunded" - REFUND_DUE = "refund_due" - VOIDED = "voided" - - 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" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class Einvoice(TypedDict): - id: Required[str] - reference_number: NotRequired[str] - status: Required[EinvoiceStatus] - message: NotRequired[str] - - -class LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[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] - 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] - - -class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] - - -class LineItemTax(TypedDict): - line_item_id: NotRequired[str] - tax_name: Required[str] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - tax_amount_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] - - -class LinkedRefund(TypedDict): - txn_id: Required[str] - applied_amount: Required[int] - applied_at: Required[int] - txn_status: NotRequired["transaction.Status"] - txn_date: NotRequired[int] - txn_amount: NotRequired[int] - refund_reason_code: NotRequired[str] - - -class Allocation(TypedDict): - invoice_id: Required[str] - allocated_amount: Required[int] - allocated_at: Required[int] - invoice_date: NotRequired[int] - invoice_status: Required["invoice.Status"] - - -class ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class BillingAddress(TypedDict): - 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 SiteDetailsAtCreation(TypedDict): - timezone: NotRequired[str] - organization_address: NotRequired[Dict[Any, Any]] - - -class TaxOrigin(TypedDict): - country: NotRequired[str] - registration_number: NotRequired[str] - - -class CreateLineItemParams(TypedDict): - reference_line_item_id: NotRequired[str] - unit_amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - amount: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - description: NotRequired[str] - entity_type: NotRequired[LineItemEntityType] - entity_id: NotRequired[str] - - -class RecordRefundTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: Required[enums.PaymentMethod] - reference_number: NotRequired[str] - custom_payment_method_id: NotRequired[str] - date: Required[int] - - -class ListEinvoiceParams(TypedDict): - Status: NotRequired[Filters.EnumFilter] - - -class RemoveTaxWithheldRefundTaxWithheldParams(TypedDict): - id: Required[str] - - -class ImportCreditNoteLineItemParams(TypedDict): - reference_line_item_id: NotRequired[str] - id: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - subscription_id: NotRequired[str] - description: Required[str] - unit_amount: NotRequired[int] - quantity: NotRequired[int] - amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - entity_type: NotRequired[LineItemEntityType] - entity_id: NotRequired[str] - item_level_discount1_entity_id: NotRequired[str] - item_level_discount1_amount: NotRequired[int] - item_level_discount2_entity_id: NotRequired[str] - item_level_discount2_amount: NotRequired[int] - tax1_name: NotRequired[str] - tax1_amount: NotRequired[int] - tax2_name: NotRequired[str] - tax2_amount: NotRequired[int] - tax3_name: NotRequired[str] - tax3_amount: NotRequired[int] - tax4_name: NotRequired[str] - tax4_amount: NotRequired[int] - tax5_name: NotRequired[str] - tax5_amount: NotRequired[int] - tax6_name: NotRequired[str] - tax6_amount: NotRequired[int] - tax7_name: NotRequired[str] - tax7_amount: NotRequired[int] - tax8_name: NotRequired[str] - tax8_amount: NotRequired[int] - tax9_name: NotRequired[str] - tax9_amount: NotRequired[int] - tax10_name: NotRequired[str] - tax10_amount: NotRequired[int] - - -class ImportCreditNoteLineItemTierParams(TypedDict): - line_item_id: Required[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - quantity_used: NotRequired[int] - unit_amount: NotRequired[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] - - -class ImportCreditNoteDiscountParams(TypedDict): - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - description: NotRequired[str] - amount: Required[int] - - -class ImportCreditNoteTaxParams(TypedDict): - name: Required[str] - rate: Required[float] - amount: NotRequired[int] - description: NotRequired[str] - juris_type: NotRequired[enums.TaxJurisType] - juris_name: NotRequired[str] - juris_code: NotRequired[str] - - -class ImportCreditNoteAllocationParams(TypedDict): - invoice_id: Required[str] - allocated_amount: Required[int] - allocated_at: Required[int] - - -class ImportCreditNoteLinkedRefundParams(TypedDict): - amount: Required[int] - payment_method: Required[enums.PaymentMethod] - date: Required[int] - reference_number: NotRequired[str] diff --git a/chargebee/models/credit_note_estimate/__init__.py b/chargebee/models/credit_note_estimate/__init__.py index 0ec1c92..6ccc472 100644 --- a/chargebee/models/credit_note_estimate/__init__.py +++ b/chargebee/models/credit_note_estimate/__init__.py @@ -1,11 +1,2 @@ from .operations import CreditNoteEstimate from .responses import CreditNoteEstimateResponse -from .types import ( - LineItem, - Discount, - Tax, - LineItemTax, - LineItemDiscount, - LineItemTier, - Type, -) diff --git a/chargebee/models/credit_note_estimate/operations.py b/chargebee/models/credit_note_estimate/operations.py index 6d0231f..a250180 100644 --- a/chargebee/models/credit_note_estimate/operations.py +++ b/chargebee/models/credit_note_estimate/operations.py @@ -1,9 +1,123 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class CreditNoteEstimate: + class Type(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["CreditNoteEstimate.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["CreditNoteEstimate.DiscountEntityType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + entity_id: NotRequired[str] + discount_amount: Required[int] + + 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] pass diff --git a/chargebee/models/credit_note_estimate/types.py b/chargebee/models/credit_note_estimate/types.py deleted file mode 100644 index 38f11d4..0000000 --- a/chargebee/models/credit_note_estimate/types.py +++ /dev/null @@ -1,127 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - ADJUSTMENT = "adjustment" - REFUNDABLE = "refundable" - - def __str__(self): - return self.value - - -class LineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] - - -class LineItemTax(TypedDict): - line_item_id: NotRequired[str] - tax_name: Required[str] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - tax_amount_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[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] - 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] diff --git a/chargebee/models/currency/__init__.py b/chargebee/models/currency/__init__.py index cda0487..bda00c5 100644 --- a/chargebee/models/currency/__init__.py +++ b/chargebee/models/currency/__init__.py @@ -1,3 +1,2 @@ from .operations import Currency from .responses import CurrencyResponse -from .types import ForexType diff --git a/chargebee/models/currency/operations.py b/chargebee/models/currency/operations.py index b00f976..0534b2f 100644 --- a/chargebee/models/currency/operations.py +++ b/chargebee/models/currency/operations.py @@ -1,18 +1,24 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class Currency: + class ForexType(Enum): + MANUAL = "manual" + AUTO = "auto" + + def __str__(self): + return self.value class CreateParams(TypedDict): currency_code: Required[str] - forex_type: Required[ForexType] + forex_type: Required["Currency.ForexType"] manual_exchange_rate: NotRequired[str] class UpdateParams(TypedDict): - forex_type: Required[ForexType] + forex_type: Required["Currency.ForexType"] manual_exchange_rate: NotRequired[str] class AddScheduleParams(TypedDict): diff --git a/chargebee/models/currency/types.py b/chargebee/models/currency/types.py deleted file mode 100644 index 0ef2015..0000000 --- a/chargebee/models/currency/types.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class ForexType(Enum): - MANUAL = "manual" - AUTO = "auto" - - def __str__(self): - return self.value diff --git a/chargebee/models/customer/__init__.py b/chargebee/models/customer/__init__.py index 5448ec1..25966bb 100644 --- a/chargebee/models/customer/__init__.py +++ b/chargebee/models/customer/__init__.py @@ -1,19 +1,2 @@ from .operations import Customer from .responses import CustomerResponse -from .types import ( - BillingAddress, - ReferralUrl, - Contact, - PaymentMethod, - Balance, - EntityIdentifier, - TaxProvidersField, - Relationship, - ParentAccountAccess, - ChildAccountAccess, - VatNumberStatus, - BillingDayOfWeek, - PiiCleared, - CardStatus, - FraudFlag, -) diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py index 6f3e092..587ddf5 100644 --- a/chargebee/models/customer/operations.py +++ b/chargebee/models/customer/operations.py @@ -1,10 +1,449 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, payment_intent class Customer: + class VatNumberStatus(Enum): + VALID = "valid" + INVALID = "invalid" + NOT_VALIDATED = "not_validated" + UNDETERMINED = "undetermined" + + def __str__(self): + return self.value + + class BillingDayOfWeek(Enum): + SUNDAY = "sunday" + MONDAY = "monday" + TUESDAY = "tuesday" + WEDNESDAY = "wednesday" + THURSDAY = "thursday" + FRIDAY = "friday" + SATURDAY = "saturday" + + def __str__(self): + return self.value + + class PiiCleared(Enum): + ACTIVE = "active" + SCHEDULED_FOR_CLEAR = "scheduled_for_clear" + CLEARED = "cleared" + + def __str__(self): + return self.value + + class CardStatus(Enum): + NO_CARD = "no_card" + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + PENDING_VERIFICATION = "pending_verification" + INVALID = "invalid" + + def __str__(self): + return self.value + + class FraudFlag(Enum): + SAFE = "safe" + SUSPICIOUS = "suspicious" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + class PaymentMethodStatus(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + INVALID = "invalid" + PENDING_VERIFICATION = "pending_verification" + + def __str__(self): + return self.value + + class ParentAccountAccessPortalEditChildSubscriptions(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + class ParentAccountAccessPortalDownloadChildInvoices(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + class ChildAccountAccessPortalEditSubscriptions(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + + def __str__(self): + return self.value + + class ChildAccountAccessPortalDownloadInvoices(Enum): + YES = "yes" + VIEW_ONLY = "view_only" + NO = "no" + + def __str__(self): + return self.value + + class BillingAddress(TypedDict): + 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 ReferralUrl(TypedDict): + external_customer_id: NotRequired[str] + referral_sharing_url: Required[str] + created_at: Required[int] + updated_at: Required[int] + referral_campaign_id: Required[str] + referral_account_id: Required[str] + referral_external_campaign_id: NotRequired[str] + referral_system: Required[enums.ReferralSystem] + + class Contact(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: Required[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: Required[bool] + send_account_email: Required[bool] + send_billing_email: Required[bool] + + class PaymentMethod(TypedDict): + type: Required[enums.Type] + gateway: Required[enums.Gateway] + gateway_account_id: NotRequired[str] + status: Required["Customer.PaymentMethodStatus"] + reference_id: Required[str] + + class Balance(TypedDict): + promotional_credits: Required[int] + excess_payments: Required[int] + refundable_credits: Required[int] + unbilled_charges: Required[int] + currency_code: Required[str] + balance_currency_code: Required[str] + + class EntityIdentifier(TypedDict): + id: Required[str] + value: NotRequired[str] + scheme: Required[str] + standard: NotRequired[str] + + class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class Relationship(TypedDict): + parent_id: NotRequired[str] + payment_owner_id: Required[str] + invoice_owner_id: Required[str] + + class ParentAccountAccess(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + "Customer.ParentAccountAccessPortalEditChildSubscriptions" + ] + portal_download_child_invoices: NotRequired[ + "Customer.ParentAccountAccessPortalDownloadChildInvoices" + ] + send_subscription_emails: Required[bool] + send_invoice_emails: Required[bool] + send_payment_emails: Required[bool] + + class ChildAccountAccess(TypedDict): + portal_edit_subscriptions: NotRequired[ + "Customer.ChildAccountAccessPortalEditSubscriptions" + ] + portal_download_invoices: NotRequired[ + "Customer.ChildAccountAccessPortalDownloadInvoices" + ] + send_subscription_emails: Required[bool] + send_invoice_emails: Required[bool] + send_payment_emails: Required[bool] + + class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + standard: NotRequired[str] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class ListRelationshipParams(TypedDict): + parent_id: NotRequired[Filters.StringFilter] + payment_owner_id: NotRequired[Filters.StringFilter] + invoice_owner_id: NotRequired[Filters.StringFilter] + + class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class UpdatePaymentMethodPaymentMethodParams(TypedDict): + type: Required[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateBillingInfoBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateBillingInfoEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + class UpdateBillingInfoTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class AddContactContactParams(TypedDict): + id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: Required[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: NotRequired[bool] + send_billing_email: NotRequired[bool] + send_account_email: NotRequired[bool] + + class UpdateContactContactParams(TypedDict): + id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + label: NotRequired[str] + enabled: NotRequired[bool] + send_billing_email: NotRequired[bool] + send_account_email: NotRequired[bool] + + class DeleteContactContactParams(TypedDict): + id: Required[str] + + class RecordExcessPaymentTransactionParams(TypedDict): + amount: Required[int] + currency_code: NotRequired[str] + date: Required[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + + class CollectPaymentInvoiceAllocationParams(TypedDict): + invoice_id: Required[str] + allocation_amount: NotRequired[int] + + class CollectPaymentPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CollectPaymentCardParams(TypedDict): + gateway_account_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CollectPaymentPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + gw_payment_method_id: NotRequired[str] + reference_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class MoveTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class MergeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class RelationshipsParentAccountAccessParams(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + "Customer.ParentAccountAccessPortalEditChildSubscriptions" + ] + portal_download_child_invoices: NotRequired[ + "Customer.ParentAccountAccessPortalDownloadChildInvoices" + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + class RelationshipsChildAccountAccessParams(TypedDict): + portal_edit_subscriptions: NotRequired[ + "Customer.ChildAccountAccessPortalEditSubscriptions" + ] + portal_download_invoices: NotRequired[ + "Customer.ChildAccountAccessPortalDownloadInvoices" + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + class UpdateHierarchySettingsParentAccountAccessParams(TypedDict): + portal_edit_child_subscriptions: NotRequired[ + "Customer.ParentAccountAccessPortalEditChildSubscriptions" + ] + portal_download_child_invoices: NotRequired[ + "Customer.ParentAccountAccessPortalDownloadChildInvoices" + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] + + class UpdateHierarchySettingsChildAccountAccessParams(TypedDict): + portal_edit_subscriptions: NotRequired[ + "Customer.ChildAccountAccessPortalEditSubscriptions" + ] + portal_download_invoices: NotRequired[ + "Customer.ChildAccountAccessPortalDownloadInvoices" + ] + send_subscription_emails: NotRequired[bool] + send_payment_emails: NotRequired[bool] + send_invoice_emails: NotRequired[bool] class CreateParams(TypedDict): id: NotRequired[str] @@ -37,22 +476,24 @@ class CreateParams(TypedDict): offline_payment_method: NotRequired[enums.OfflinePaymentMethod] auto_close_invoices: NotRequired[bool] consolidated_invoicing: NotRequired[bool] - card: NotRequired[CreateCardParams] - bank_account: NotRequired[CreateBankAccountParams] + card: NotRequired["Customer.CreateCardParams"] + bank_account: NotRequired["Customer.CreateBankAccountParams"] token_id: NotRequired[str] - payment_method: NotRequired[CreatePaymentMethodParams] - payment_intent: NotRequired[CreatePaymentIntentParams] - billing_address: NotRequired[CreateBillingAddressParams] - entity_identifiers: NotRequired[List[CreateEntityIdentifierParams]] + payment_method: NotRequired["Customer.CreatePaymentMethodParams"] + payment_intent: NotRequired["Customer.CreatePaymentIntentParams"] + billing_address: NotRequired["Customer.CreateBillingAddressParams"] + entity_identifiers: NotRequired[List["Customer.CreateEntityIdentifierParams"]] business_entity_id: NotRequired[str] - tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + tax_providers_fields: NotRequired[ + List["Customer.CreateTaxProvidersFieldParams"] + ] created_from_ip: NotRequired[str] invoice_notes: NotRequired[str] class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] - relationship: NotRequired[ListRelationshipParams] + relationship: NotRequired["Customer.ListRelationshipParams"] include_deleted: NotRequired[bool] id: NotRequired[Filters.StringFilter] first_name: NotRequired[Filters.StringFilter] @@ -92,16 +533,20 @@ class UpdateParams(TypedDict): invoice_notes: NotRequired[str] auto_close_invoices: NotRequired[bool] meta_data: NotRequired[Dict[Any, Any]] - fraud_flag: NotRequired[FraudFlag] + fraud_flag: NotRequired["Customer.FraudFlag"] consolidated_invoicing: NotRequired[bool] - tax_providers_fields: NotRequired[List[UpdateTaxProvidersFieldParams]] + tax_providers_fields: NotRequired[ + List["Customer.UpdateTaxProvidersFieldParams"] + ] class UpdatePaymentMethodParams(TypedDict): - payment_method: Required[UpdatePaymentMethodPaymentMethodParams] + payment_method: Required["Customer.UpdatePaymentMethodPaymentMethodParams"] class UpdateBillingInfoParams(TypedDict): - billing_address: NotRequired[UpdateBillingInfoBillingAddressParams] - entity_identifiers: NotRequired[List[UpdateBillingInfoEntityIdentifierParams]] + billing_address: NotRequired["Customer.UpdateBillingInfoBillingAddressParams"] + entity_identifiers: NotRequired[ + List["Customer.UpdateBillingInfoEntityIdentifierParams"] + ] vat_number: NotRequired[str] vat_number_prefix: NotRequired[str] entity_identifier_scheme: NotRequired[str] @@ -111,7 +556,7 @@ class UpdateBillingInfoParams(TypedDict): is_einvoice_enabled: NotRequired[bool] einvoicing_method: NotRequired[enums.EinvoicingMethod] tax_providers_fields: NotRequired[ - List[UpdateBillingInfoTaxProvidersFieldParams] + List["Customer.UpdateBillingInfoTaxProvidersFieldParams"] ] class ContactsForCustomerParams(TypedDict): @@ -123,13 +568,13 @@ class AssignPaymentRoleParams(TypedDict): role: Required[enums.Role] class AddContactParams(TypedDict): - contact: Required[AddContactContactParams] + contact: Required["Customer.AddContactContactParams"] class UpdateContactParams(TypedDict): - contact: Required[UpdateContactContactParams] + contact: Required["Customer.UpdateContactContactParams"] class DeleteContactParams(TypedDict): - contact: Required[DeleteContactContactParams] + contact: Required["Customer.DeleteContactContactParams"] class AddPromotionalCreditsParams(TypedDict): amount: Required[int] @@ -153,17 +598,19 @@ class SetPromotionalCreditsParams(TypedDict): reference: NotRequired[str] class RecordExcessPaymentParams(TypedDict): - transaction: Required[RecordExcessPaymentTransactionParams] + transaction: Required["Customer.RecordExcessPaymentTransactionParams"] comment: NotRequired[str] class CollectPaymentParams(TypedDict): amount: NotRequired[int] - invoice_allocations: Required[List[CollectPaymentInvoiceAllocationParams]] + invoice_allocations: Required[ + List["Customer.CollectPaymentInvoiceAllocationParams"] + ] payment_source_id: NotRequired[str] token_id: NotRequired[str] - payment_method: NotRequired[CollectPaymentPaymentMethodParams] - card: NotRequired[CollectPaymentCardParams] - payment_intent: NotRequired[CollectPaymentPaymentIntentParams] + payment_method: NotRequired["Customer.CollectPaymentPaymentMethodParams"] + card: NotRequired["Customer.CollectPaymentCardParams"] + payment_intent: NotRequired["Customer.CollectPaymentPaymentIntentParams"] replace_primary_payment_source: NotRequired[bool] retain_payment_source: NotRequired[bool] payment_initiator: NotRequired[enums.PaymentInitiator] @@ -174,27 +621,31 @@ class DeleteParams(TypedDict): class MoveParams(TypedDict): id_at_from_site: Required[str] from_site: Required[str] - tax_providers_fields: NotRequired[List[MoveTaxProvidersFieldParams]] + tax_providers_fields: NotRequired[List["Customer.MoveTaxProvidersFieldParams"]] class ChangeBillingDateParams(TypedDict): billing_date: NotRequired[int] billing_month: NotRequired[int] billing_date_mode: NotRequired[enums.BillingDateMode] - billing_day_of_week: NotRequired[BillingDayOfWeek] + billing_day_of_week: NotRequired["Customer.BillingDayOfWeek"] billing_day_of_week_mode: NotRequired[enums.BillingDayOfWeekMode] class MergeParams(TypedDict): from_customer_id: Required[str] to_customer_id: Required[str] - tax_providers_fields: NotRequired[List[MergeTaxProvidersFieldParams]] + tax_providers_fields: NotRequired[List["Customer.MergeTaxProvidersFieldParams"]] class RelationshipsParams(TypedDict): parent_id: NotRequired[str] payment_owner_id: NotRequired[str] invoice_owner_id: NotRequired[str] use_default_hierarchy_settings: NotRequired[bool] - parent_account_access: NotRequired[RelationshipsParentAccountAccessParams] - child_account_access: NotRequired[RelationshipsChildAccountAccessParams] + parent_account_access: NotRequired[ + "Customer.RelationshipsParentAccountAccessParams" + ] + child_account_access: NotRequired[ + "Customer.RelationshipsChildAccountAccessParams" + ] class HierarchyParams(TypedDict): hierarchy_operation_type: Required[enums.HierarchyOperationType] @@ -202,10 +653,10 @@ class HierarchyParams(TypedDict): class UpdateHierarchySettingsParams(TypedDict): use_default_hierarchy_settings: NotRequired[bool] parent_account_access: NotRequired[ - UpdateHierarchySettingsParentAccountAccessParams + "Customer.UpdateHierarchySettingsParentAccountAccessParams" ] child_account_access: NotRequired[ - UpdateHierarchySettingsChildAccountAccessParams + "Customer.UpdateHierarchySettingsChildAccountAccessParams" ] @staticmethod diff --git a/chargebee/models/customer/types.py b/chargebee/models/customer/types.py deleted file mode 100644 index e9f037c..0000000 --- a/chargebee/models/customer/types.py +++ /dev/null @@ -1,473 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.filters import Filters -from chargebee.models import enums, payment_intent - - -class VatNumberStatus(Enum): - VALID = "valid" - INVALID = "invalid" - NOT_VALIDATED = "not_validated" - UNDETERMINED = "undetermined" - - def __str__(self): - return self.value - - -class BillingDayOfWeek(Enum): - SUNDAY = "sunday" - MONDAY = "monday" - TUESDAY = "tuesday" - WEDNESDAY = "wednesday" - THURSDAY = "thursday" - FRIDAY = "friday" - SATURDAY = "saturday" - - def __str__(self): - return self.value - - -class PiiCleared(Enum): - ACTIVE = "active" - SCHEDULED_FOR_CLEAR = "scheduled_for_clear" - CLEARED = "cleared" - - def __str__(self): - return self.value - - -class CardStatus(Enum): - NO_CARD = "no_card" - VALID = "valid" - EXPIRING = "expiring" - EXPIRED = "expired" - PENDING_VERIFICATION = "pending_verification" - INVALID = "invalid" - - def __str__(self): - return self.value - - -class FraudFlag(Enum): - SAFE = "safe" - SUSPICIOUS = "suspicious" - FRAUDULENT = "fraudulent" - - def __str__(self): - return self.value - - -class PaymentMethodStatus(Enum): - VALID = "valid" - EXPIRING = "expiring" - EXPIRED = "expired" - INVALID = "invalid" - PENDING_VERIFICATION = "pending_verification" - - def __str__(self): - return self.value - - -class ParentAccountAccessPortalEditChildSubscriptions(Enum): - YES = "yes" - VIEW_ONLY = "view_only" - NO = "no" - - def __str__(self): - return self.value - - -class ParentAccountAccessPortalDownloadChildInvoices(Enum): - YES = "yes" - VIEW_ONLY = "view_only" - NO = "no" - - def __str__(self): - return self.value - - -class ChildAccountAccessPortalEditSubscriptions(Enum): - YES = "yes" - VIEW_ONLY = "view_only" - - def __str__(self): - return self.value - - -class ChildAccountAccessPortalDownloadInvoices(Enum): - YES = "yes" - VIEW_ONLY = "view_only" - NO = "no" - - def __str__(self): - return self.value - - -class BillingAddress(TypedDict): - 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 ReferralUrl(TypedDict): - external_customer_id: NotRequired[str] - referral_sharing_url: Required[str] - created_at: Required[int] - updated_at: Required[int] - referral_campaign_id: Required[str] - referral_account_id: Required[str] - referral_external_campaign_id: NotRequired[str] - referral_system: Required[enums.ReferralSystem] - - -class Contact(TypedDict): - id: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: Required[str] - phone: NotRequired[str] - label: NotRequired[str] - enabled: Required[bool] - send_account_email: Required[bool] - send_billing_email: Required[bool] - - -class PaymentMethod(TypedDict): - type: Required[enums.Type] - gateway: Required[enums.Gateway] - gateway_account_id: NotRequired[str] - status: Required[PaymentMethodStatus] - reference_id: Required[str] - - -class Balance(TypedDict): - promotional_credits: Required[int] - excess_payments: Required[int] - refundable_credits: Required[int] - unbilled_charges: Required[int] - currency_code: Required[str] - balance_currency_code: Required[str] - - -class EntityIdentifier(TypedDict): - id: Required[str] - value: NotRequired[str] - scheme: Required[str] - standard: NotRequired[str] - - -class TaxProvidersField(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class Relationship(TypedDict): - parent_id: NotRequired[str] - payment_owner_id: Required[str] - invoice_owner_id: Required[str] - - -class ParentAccountAccess(TypedDict): - portal_edit_child_subscriptions: NotRequired[ - ParentAccountAccessPortalEditChildSubscriptions - ] - portal_download_child_invoices: NotRequired[ - ParentAccountAccessPortalDownloadChildInvoices - ] - send_subscription_emails: Required[bool] - send_invoice_emails: Required[bool] - send_payment_emails: Required[bool] - - -class ChildAccountAccess(TypedDict): - portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] - portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] - send_subscription_emails: Required[bool] - send_invoice_emails: Required[bool] - send_payment_emails: Required[bool] - - -class CreateCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBankAccountParams(TypedDict): - gateway_account_id: NotRequired[str] - iban: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - bank_name: NotRequired[str] - account_number: NotRequired[str] - routing_number: NotRequired[str] - bank_code: NotRequired[str] - account_type: NotRequired[enums.AccountType] - account_holder_type: NotRequired[enums.AccountHolderType] - echeck_type: NotRequired[enums.EcheckType] - issuing_country: NotRequired[str] - swedish_identity_number: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class CreatePaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - standard: NotRequired[str] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class ListRelationshipParams(TypedDict): - ParentId: NotRequired[Filters.StringFilter] - PaymentOwnerId: NotRequired[Filters.StringFilter] - InvoiceOwnerId: NotRequired[Filters.StringFilter] - - -class UpdateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class UpdatePaymentMethodPaymentMethodParams(TypedDict): - type: Required[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateBillingInfoBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateBillingInfoEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - operation: NotRequired[enums.Operation] - standard: NotRequired[str] - - -class UpdateBillingInfoTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class AddContactContactParams(TypedDict): - id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: Required[str] - phone: NotRequired[str] - label: NotRequired[str] - enabled: NotRequired[bool] - send_billing_email: NotRequired[bool] - send_account_email: NotRequired[bool] - - -class UpdateContactContactParams(TypedDict): - id: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - label: NotRequired[str] - enabled: NotRequired[bool] - send_billing_email: NotRequired[bool] - send_account_email: NotRequired[bool] - - -class DeleteContactContactParams(TypedDict): - id: Required[str] - - -class RecordExcessPaymentTransactionParams(TypedDict): - amount: Required[int] - currency_code: NotRequired[str] - date: Required[int] - payment_method: Required[enums.PaymentMethod] - reference_number: NotRequired[str] - custom_payment_method_id: NotRequired[str] - - -class CollectPaymentInvoiceAllocationParams(TypedDict): - invoice_id: Required[str] - allocation_amount: NotRequired[int] - - -class CollectPaymentPaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CollectPaymentCardParams(TypedDict): - gateway_account_id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CollectPaymentPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - gw_payment_method_id: NotRequired[str] - reference_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class MoveTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class MergeTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class RelationshipsParentAccountAccessParams(TypedDict): - portal_edit_child_subscriptions: NotRequired[ - ParentAccountAccessPortalEditChildSubscriptions - ] - portal_download_child_invoices: NotRequired[ - ParentAccountAccessPortalDownloadChildInvoices - ] - send_subscription_emails: NotRequired[bool] - send_payment_emails: NotRequired[bool] - send_invoice_emails: NotRequired[bool] - - -class RelationshipsChildAccountAccessParams(TypedDict): - portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] - portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] - send_subscription_emails: NotRequired[bool] - send_payment_emails: NotRequired[bool] - send_invoice_emails: NotRequired[bool] - - -class UpdateHierarchySettingsParentAccountAccessParams(TypedDict): - portal_edit_child_subscriptions: NotRequired[ - ParentAccountAccessPortalEditChildSubscriptions - ] - portal_download_child_invoices: NotRequired[ - ParentAccountAccessPortalDownloadChildInvoices - ] - send_subscription_emails: NotRequired[bool] - send_payment_emails: NotRequired[bool] - send_invoice_emails: NotRequired[bool] - - -class UpdateHierarchySettingsChildAccountAccessParams(TypedDict): - portal_edit_subscriptions: NotRequired[ChildAccountAccessPortalEditSubscriptions] - portal_download_invoices: NotRequired[ChildAccountAccessPortalDownloadInvoices] - send_subscription_emails: NotRequired[bool] - send_payment_emails: NotRequired[bool] - send_invoice_emails: NotRequired[bool] diff --git a/chargebee/models/customer_entitlement/operations.py b/chargebee/models/customer_entitlement/operations.py index 4f9ded5..f4f89a0 100644 --- a/chargebee/models/customer_entitlement/operations.py +++ b/chargebee/models/customer_entitlement/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class CustomerEntitlement: diff --git a/chargebee/models/customer_entitlement/types.py b/chargebee/models/customer_entitlement/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/customer_entitlement/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/differential_price/__init__.py b/chargebee/models/differential_price/__init__.py index 6505b58..0f715a9 100644 --- a/chargebee/models/differential_price/__init__.py +++ b/chargebee/models/differential_price/__init__.py @@ -1,3 +1,2 @@ from .operations import DifferentialPrice from .responses import DifferentialPriceResponse -from .types import Tier, ParentPeriod, Status diff --git a/chargebee/models/differential_price/operations.py b/chargebee/models/differential_price/operations.py index 2dc5fb8..acde21d 100644 --- a/chargebee/models/differential_price/operations.py +++ b/chargebee/models/differential_price/operations.py @@ -1,18 +1,69 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class DifferentialPrice: + class Status(Enum): + ACTIVE = "active" + DELETED = "deleted" + + def __str__(self): + return self.value + + class ParentPeriodPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class ParentPeriod(TypedDict): + period_unit: Required["DifferentialPrice.ParentPeriodPeriodUnit"] + period: NotRequired[List[Dict[Any, Any]]] + + class CreateParentPeriodParams(TypedDict): + period_unit: Required["DifferentialPrice.ParentPeriodPeriodUnit"] + period: NotRequired[List[Dict[Any, Any]]] + + class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateParentPeriodParams(TypedDict): + period_unit: Required["DifferentialPrice.ParentPeriodPeriodUnit"] + period: NotRequired[List[Dict[Any, Any]]] + + class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] class CreateParams(TypedDict): parent_item_id: Required[str] price: NotRequired[int] price_in_decimal: NotRequired[str] - parent_periods: Required[List[CreateParentPeriodParams]] - tiers: NotRequired[List[CreateTierParams]] + parent_periods: Required[List["DifferentialPrice.CreateParentPeriodParams"]] + tiers: NotRequired[List["DifferentialPrice.CreateTierParams"]] class RetrieveParams(TypedDict): item_price_id: Required[str] @@ -21,8 +72,8 @@ class UpdateParams(TypedDict): item_price_id: Required[str] price: NotRequired[int] price_in_decimal: NotRequired[str] - parent_periods: Required[List[UpdateParentPeriodParams]] - tiers: NotRequired[List[UpdateTierParams]] + parent_periods: Required[List["DifferentialPrice.UpdateParentPeriodParams"]] + tiers: NotRequired[List["DifferentialPrice.UpdateTierParams"]] class DeleteParams(TypedDict): item_price_id: Required[str] diff --git a/chargebee/models/differential_price/types.py b/chargebee/models/differential_price/types.py deleted file mode 100644 index fd90e56..0000000 --- a/chargebee/models/differential_price/types.py +++ /dev/null @@ -1,62 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - ACTIVE = "active" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class ParentPeriodPeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class Tier(TypedDict): - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class ParentPeriod(TypedDict): - period_unit: Required[ParentPeriodPeriodUnit] - period: NotRequired[List[Dict[Any, Any]]] - - -class CreateParentPeriodParams(TypedDict): - period_unit: Required[ParentPeriodPeriodUnit] - period: NotRequired[List[Dict[Any, Any]]] - - -class CreateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateParentPeriodParams(TypedDict): - period_unit: Required[ParentPeriodPeriodUnit] - period: NotRequired[List[Dict[Any, Any]]] - - -class UpdateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] diff --git a/chargebee/models/discount/__init__.py b/chargebee/models/discount/__init__.py index b40997b..1bd43b5 100644 --- a/chargebee/models/discount/__init__.py +++ b/chargebee/models/discount/__init__.py @@ -1,3 +1,2 @@ from .operations import Discount from .responses import DiscountResponse -from .types import Type diff --git a/chargebee/models/discount/operations.py b/chargebee/models/discount/operations.py index 2e010a0..787e8f2 100644 --- a/chargebee/models/discount/operations.py +++ b/chargebee/models/discount/operations.py @@ -1,9 +1,15 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class Discount: + class Type(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/discount/types.py b/chargebee/models/discount/types.py deleted file mode 100644 index 317772a..0000000 --- a/chargebee/models/discount/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value diff --git a/chargebee/models/download/operations.py b/chargebee/models/download/operations.py index cbe56a3..a893bdf 100644 --- a/chargebee/models/download/operations.py +++ b/chargebee/models/download/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class Download: diff --git a/chargebee/models/download/types.py b/chargebee/models/download/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/download/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/entitlement/__init__.py b/chargebee/models/entitlement/__init__.py index 152ed3b..4474143 100644 --- a/chargebee/models/entitlement/__init__.py +++ b/chargebee/models/entitlement/__init__.py @@ -1,3 +1,2 @@ from .operations import Entitlement from .responses import EntitlementResponse -from .types import EntityType diff --git a/chargebee/models/entitlement/operations.py b/chargebee/models/entitlement/operations.py index 39f408c..62689f2 100644 --- a/chargebee/models/entitlement/operations.py +++ b/chargebee/models/entitlement/operations.py @@ -1,12 +1,27 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Entitlement: + class EntityType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + PLAN_PRICE = "plan_price" + ADDON_PRICE = "addon_price" + + def __str__(self): + return self.value + + class CreateEntitlementParams(TypedDict): + entity_id: Required[str] + feature_id: Required[str] + entity_type: NotRequired["Entitlement.EntityType"] + value: NotRequired[str] class ListParams(TypedDict): limit: NotRequired[int] @@ -19,7 +34,7 @@ class ListParams(TypedDict): class CreateParams(TypedDict): action: Required[enums.Action] - entitlements: Required[List[CreateEntitlementParams]] + entitlements: Required[List["Entitlement.CreateEntitlementParams"]] @staticmethod def list(params: ListParams = None, env=None, headers=None) -> ListResponse: diff --git a/chargebee/models/entitlement/types.py b/chargebee/models/entitlement/types.py deleted file mode 100644 index bfd05cb..0000000 --- a/chargebee/models/entitlement/types.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class EntityType(Enum): - PLAN = "plan" - ADDON = "addon" - CHARGE = "charge" - PLAN_PRICE = "plan_price" - ADDON_PRICE = "addon_price" - - def __str__(self): - return self.value - - -class CreateEntitlementParams(TypedDict): - entity_id: Required[str] - feature_id: Required[str] - entity_type: NotRequired[EntityType] - value: NotRequired[str] diff --git a/chargebee/models/entitlement_override/__init__.py b/chargebee/models/entitlement_override/__init__.py index 5845b3e..650508d 100644 --- a/chargebee/models/entitlement_override/__init__.py +++ b/chargebee/models/entitlement_override/__init__.py @@ -1,3 +1,2 @@ from .operations import EntitlementOverride from .responses import EntitlementOverrideResponse -from .types import ScheduleStatus diff --git a/chargebee/models/entitlement_override/operations.py b/chargebee/models/entitlement_override/operations.py index 6194376..6b7a9ec 100644 --- a/chargebee/models/entitlement_override/operations.py +++ b/chargebee/models/entitlement_override/operations.py @@ -1,16 +1,31 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.models import enums class EntitlementOverride: + class ScheduleStatus(Enum): + ACTIVATED = "activated" + SCHEDULED = "scheduled" + FAILED = "failed" + + def __str__(self): + return self.value + + class AddEntitlementOverrideForSubscriptionEntitlementOverrideParams(TypedDict): + feature_id: Required[str] + value: NotRequired[str] + expires_at: NotRequired[int] + effective_from: NotRequired[int] class AddEntitlementOverrideForSubscriptionParams(TypedDict): action: NotRequired[enums.Action] entitlement_overrides: Required[ - List[AddEntitlementOverrideForSubscriptionEntitlementOverrideParams] + List[ + "EntitlementOverride.AddEntitlementOverrideForSubscriptionEntitlementOverrideParams" + ] ] class ListEntitlementOverrideForSubscriptionParams(TypedDict): diff --git a/chargebee/models/entitlement_override/types.py b/chargebee/models/entitlement_override/types.py deleted file mode 100644 index 598564f..0000000 --- a/chargebee/models/entitlement_override/types.py +++ /dev/null @@ -1,18 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class ScheduleStatus(Enum): - ACTIVATED = "activated" - SCHEDULED = "scheduled" - FAILED = "failed" - - def __str__(self): - return self.value - - -class AddEntitlementOverrideForSubscriptionEntitlementOverrideParams(TypedDict): - feature_id: Required[str] - value: NotRequired[str] - expires_at: NotRequired[int] - effective_from: NotRequired[int] diff --git a/chargebee/models/estimate/operations.py b/chargebee/models/estimate/operations.py index 55d8f69..bcc4c73 100644 --- a/chargebee/models/estimate/operations.py +++ b/chargebee/models/estimate/operations.py @@ -1,98 +1,820 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import ( + enums, + payment_intent, + contract_term, + subscription_estimate, + invoice_estimate, + credit_note_estimate, + unbilled_charge, +) class Estimate: + class UnbilledChargeEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class CreateSubscriptionSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: 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] + trial_end_action: NotRequired[enums.TrialEndAction] + + class CreateSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class CreateSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CreateSubscriptionBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubscriptionShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubscriptionCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + class CreateSubscriptionContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateSubscriptionTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateSubItemEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + + class CreateSubItemEstimateSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class CreateSubItemEstimateDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class CreateSubItemEstimateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateSubItemEstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubItemEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubItemEstimateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + class CreateSubItemEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + class CreateSubItemEstimateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateSubForCustomerEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: 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] + trial_end_action: NotRequired[enums.TrialEndAction] + + class CreateSubForCustomerEstimateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class CreateSubForCustomerEstimateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CreateSubForCustomerEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubForCustomerEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateSubItemForCustomerEstimateSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + contract_term_billing_cycle_on_renewal: NotRequired[int] + trial_end_action: NotRequired[enums.TrialEndAction] + + class CreateSubItemForCustomerEstimateSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class CreateSubItemForCustomerEstimateDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class CreateSubItemForCustomerEstimateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateSubItemForCustomerEstimateShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubItemForCustomerEstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubItemForCustomerEstimateContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + class UpdateSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + trial_end_action: NotRequired[enums.TrialEndAction] + + class UpdateSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + proration_type: NotRequired[enums.ProrationType] + + class UpdateSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class UpdateSubscriptionBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + + class UpdateSubscriptionForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + free_period: NotRequired[int] + free_period_unit: NotRequired[enums.FreePeriodUnit] + trial_end_action: NotRequired[enums.TrialEndAction] + + class UpdateSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + proration_type: NotRequired[enums.ProrationType] + + class UpdateSubscriptionForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + class UpdateSubscriptionForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateSubscriptionForItemsBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionForItemsShippingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + + class AdvanceInvoiceEstimateSpecificDatesScheduleParams(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + class AdvanceInvoiceEstimateFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + class CancelSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + + class CancelSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + class PauseSubscriptionSubscriptionParams(TypedDict): + pause_date: NotRequired[int] + resume_date: NotRequired[int] + skip_billing_cycles: NotRequired[int] + + class ResumeSubscriptionSubscriptionParams(TypedDict): + resume_date: NotRequired[int] + + class GiftSubscriptionGiftParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + + class GiftSubscriptionGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + class GiftSubscriptionGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + class GiftSubscriptionPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class GiftSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class GiftSubscriptionSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + + class GiftSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class GiftSubscriptionForItemsGiftParams(TypedDict): + scheduled_at: NotRequired[int] + auto_claim: NotRequired[bool] + no_expiry: NotRequired[bool] + claim_expiry_date: NotRequired[int] + + class GiftSubscriptionForItemsGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + class GiftSubscriptionForItemsGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + class GiftSubscriptionForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class GiftSubscriptionForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class GiftSubscriptionForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class CreateInvoiceInvoiceParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + po_number: NotRequired[str] + + class CreateInvoiceAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateInvoiceChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateInvoiceNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + class CreateInvoiceShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateInvoiceTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateInvoiceForItemsInvoiceParams(TypedDict): + customer_id: NotRequired[str] + subscription_id: NotRequired[str] + po_number: NotRequired[str] + + class CreateInvoiceForItemsItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateInvoiceForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateInvoiceForItemsChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateInvoiceForItemsNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + class CreateInvoiceForItemsDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + class CreateInvoiceForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateInvoiceForItemsTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] class CreateSubscriptionParams(TypedDict): - subscription: Required[CreateSubscriptionSubscriptionParams] + subscription: Required["Estimate.CreateSubscriptionSubscriptionParams"] billing_cycles: NotRequired[int] - addons: NotRequired[List[CreateSubscriptionAddonParams]] - event_based_addons: NotRequired[List[CreateSubscriptionEventBasedAddonParams]] + addons: NotRequired[List["Estimate.CreateSubscriptionAddonParams"]] + event_based_addons: NotRequired[ + List["Estimate.CreateSubscriptionEventBasedAddonParams"] + ] mandatory_addons_to_remove: NotRequired[List[str]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] - billing_address: NotRequired[CreateSubscriptionBillingAddressParams] - shipping_address: NotRequired[CreateSubscriptionShippingAddressParams] - customer: NotRequired[CreateSubscriptionCustomerParams] + billing_address: NotRequired["Estimate.CreateSubscriptionBillingAddressParams"] + shipping_address: NotRequired[ + "Estimate.CreateSubscriptionShippingAddressParams" + ] + customer: NotRequired["Estimate.CreateSubscriptionCustomerParams"] invoice_immediately: NotRequired[bool] invoice_date: NotRequired[int] - contract_term: NotRequired[CreateSubscriptionContractTermParams] + contract_term: NotRequired["Estimate.CreateSubscriptionContractTermParams"] tax_providers_fields: NotRequired[ - List[CreateSubscriptionTaxProvidersFieldParams] + List["Estimate.CreateSubscriptionTaxProvidersFieldParams"] ] client_profile_id: NotRequired[str] class CreateSubItemEstimateParams(TypedDict): - subscription: NotRequired[CreateSubItemEstimateSubscriptionParams] + subscription: NotRequired["Estimate.CreateSubItemEstimateSubscriptionParams"] billing_cycles: NotRequired[int] - subscription_items: Required[List[CreateSubItemEstimateSubscriptionItemParams]] - discounts: Required[List[CreateSubItemEstimateDiscountParams]] + subscription_items: Required[ + List["Estimate.CreateSubItemEstimateSubscriptionItemParams"] + ] + discounts: Required[List["Estimate.CreateSubItemEstimateDiscountParams"]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[CreateSubItemEstimateItemTierParams]] + item_tiers: NotRequired[List["Estimate.CreateSubItemEstimateItemTierParams"]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] - billing_address: NotRequired[CreateSubItemEstimateBillingAddressParams] - shipping_address: NotRequired[CreateSubItemEstimateShippingAddressParams] - customer: NotRequired[CreateSubItemEstimateCustomerParams] + billing_address: NotRequired[ + "Estimate.CreateSubItemEstimateBillingAddressParams" + ] + shipping_address: NotRequired[ + "Estimate.CreateSubItemEstimateShippingAddressParams" + ] + customer: NotRequired["Estimate.CreateSubItemEstimateCustomerParams"] invoice_immediately: NotRequired[bool] invoice_date: NotRequired[int] client_profile_id: NotRequired[str] - contract_term: NotRequired[CreateSubItemEstimateContractTermParams] + contract_term: NotRequired["Estimate.CreateSubItemEstimateContractTermParams"] tax_providers_fields: NotRequired[ - List[CreateSubItemEstimateTaxProvidersFieldParams] + List["Estimate.CreateSubItemEstimateTaxProvidersFieldParams"] ] class CreateSubForCustomerEstimateParams(TypedDict): use_existing_balances: NotRequired[bool] - subscription: NotRequired[CreateSubForCustomerEstimateSubscriptionParams] + subscription: NotRequired[ + "Estimate.CreateSubForCustomerEstimateSubscriptionParams" + ] invoice_immediately: NotRequired[bool] billing_cycles: NotRequired[int] - addons: NotRequired[List[CreateSubForCustomerEstimateAddonParams]] + addons: NotRequired[List["Estimate.CreateSubForCustomerEstimateAddonParams"]] event_based_addons: NotRequired[ - List[CreateSubForCustomerEstimateEventBasedAddonParams] + List["Estimate.CreateSubForCustomerEstimateEventBasedAddonParams"] ] mandatory_addons_to_remove: NotRequired[List[str]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] - shipping_address: NotRequired[CreateSubForCustomerEstimateShippingAddressParams] + shipping_address: NotRequired[ + "Estimate.CreateSubForCustomerEstimateShippingAddressParams" + ] invoice_date: NotRequired[int] coupon_ids: NotRequired[List[str]] - contract_term: NotRequired[CreateSubForCustomerEstimateContractTermParams] + contract_term: NotRequired[ + "Estimate.CreateSubForCustomerEstimateContractTermParams" + ] class CreateSubItemForCustomerEstimateParams(TypedDict): use_existing_balances: NotRequired[bool] - subscription: NotRequired[CreateSubItemForCustomerEstimateSubscriptionParams] + subscription: NotRequired[ + "Estimate.CreateSubItemForCustomerEstimateSubscriptionParams" + ] invoice_immediately: NotRequired[bool] billing_cycles: NotRequired[int] subscription_items: Required[ - List[CreateSubItemForCustomerEstimateSubscriptionItemParams] + List["Estimate.CreateSubItemForCustomerEstimateSubscriptionItemParams"] + ] + discounts: Required[ + List["Estimate.CreateSubItemForCustomerEstimateDiscountParams"] ] - discounts: Required[List[CreateSubItemForCustomerEstimateDiscountParams]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[CreateSubItemForCustomerEstimateItemTierParams]] + item_tiers: NotRequired[ + List["Estimate.CreateSubItemForCustomerEstimateItemTierParams"] + ] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] shipping_address: NotRequired[ - CreateSubItemForCustomerEstimateShippingAddressParams + "Estimate.CreateSubItemForCustomerEstimateShippingAddressParams" ] billing_address: NotRequired[ - CreateSubItemForCustomerEstimateBillingAddressParams + "Estimate.CreateSubItemForCustomerEstimateBillingAddressParams" ] invoice_date: NotRequired[int] coupon_ids: NotRequired[List[str]] - contract_term: NotRequired[CreateSubItemForCustomerEstimateContractTermParams] + contract_term: NotRequired[ + "Estimate.CreateSubItemForCustomerEstimateContractTermParams" + ] class UpdateSubscriptionParams(TypedDict): - subscription: Required[UpdateSubscriptionSubscriptionParams] + subscription: Required["Estimate.UpdateSubscriptionSubscriptionParams"] changes_scheduled_at: NotRequired[int] change_option: NotRequired[enums.ChangeOption] - addons: NotRequired[List[UpdateSubscriptionAddonParams]] - event_based_addons: NotRequired[List[UpdateSubscriptionEventBasedAddonParams]] + addons: NotRequired[List["Estimate.UpdateSubscriptionAddonParams"]] + event_based_addons: NotRequired[ + List["Estimate.UpdateSubscriptionEventBasedAddonParams"] + ] replace_addon_list: NotRequired[bool] mandatory_addons_to_remove: NotRequired[List[str]] invoice_date: NotRequired[int] @@ -108,22 +830,26 @@ class UpdateSubscriptionParams(TypedDict): reactivate: NotRequired[bool] include_delayed_charges: NotRequired[bool] use_existing_balances: NotRequired[bool] - billing_address: NotRequired[UpdateSubscriptionBillingAddressParams] - shipping_address: NotRequired[UpdateSubscriptionShippingAddressParams] - customer: NotRequired[UpdateSubscriptionCustomerParams] + billing_address: NotRequired["Estimate.UpdateSubscriptionBillingAddressParams"] + shipping_address: NotRequired[ + "Estimate.UpdateSubscriptionShippingAddressParams" + ] + customer: NotRequired["Estimate.UpdateSubscriptionCustomerParams"] invoice_immediately: NotRequired[bool] class UpdateSubscriptionForItemsParams(TypedDict): - subscription: Required[UpdateSubscriptionForItemsSubscriptionParams] + subscription: Required["Estimate.UpdateSubscriptionForItemsSubscriptionParams"] changes_scheduled_at: NotRequired[int] change_option: NotRequired[enums.ChangeOption] subscription_items: Required[ - List[UpdateSubscriptionForItemsSubscriptionItemParams] + List["Estimate.UpdateSubscriptionForItemsSubscriptionItemParams"] ] mandatory_items_to_remove: NotRequired[List[str]] replace_items_list: NotRequired[bool] - discounts: Required[List[UpdateSubscriptionForItemsDiscountParams]] - item_tiers: NotRequired[List[UpdateSubscriptionForItemsItemTierParams]] + discounts: Required[List["Estimate.UpdateSubscriptionForItemsDiscountParams"]] + item_tiers: NotRequired[ + List["Estimate.UpdateSubscriptionForItemsItemTierParams"] + ] invoice_date: NotRequired[int] billing_cycles: NotRequired[int] terms_to_charge: NotRequired[int] @@ -137,9 +863,13 @@ class UpdateSubscriptionForItemsParams(TypedDict): reactivate: NotRequired[bool] include_delayed_charges: NotRequired[bool] use_existing_balances: NotRequired[bool] - billing_address: NotRequired[UpdateSubscriptionForItemsBillingAddressParams] - shipping_address: NotRequired[UpdateSubscriptionForItemsShippingAddressParams] - customer: NotRequired[UpdateSubscriptionForItemsCustomerParams] + billing_address: NotRequired[ + "Estimate.UpdateSubscriptionForItemsBillingAddressParams" + ] + shipping_address: NotRequired[ + "Estimate.UpdateSubscriptionForItemsShippingAddressParams" + ] + customer: NotRequired["Estimate.UpdateSubscriptionForItemsCustomerParams"] invoice_immediately: NotRequired[bool] invoice_usages: NotRequired[bool] @@ -152,10 +882,10 @@ class RenewalEstimateParams(TypedDict): class AdvanceInvoiceEstimateParams(TypedDict): terms_to_charge: NotRequired[int] specific_dates_schedule: NotRequired[ - List[AdvanceInvoiceEstimateSpecificDatesScheduleParams] + List["Estimate.AdvanceInvoiceEstimateSpecificDatesScheduleParams"] ] fixed_interval_schedule: NotRequired[ - AdvanceInvoiceEstimateFixedIntervalScheduleParams + "Estimate.AdvanceInvoiceEstimateFixedIntervalScheduleParams" ] invoice_immediately: NotRequired[bool] schedule_type: NotRequired[enums.ScheduleType] @@ -183,7 +913,9 @@ class CancelSubscriptionParams(TypedDict): refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] invoice_date: NotRequired[int] - event_based_addons: NotRequired[List[CancelSubscriptionEventBasedAddonParams]] + event_based_addons: NotRequired[ + List["Estimate.CancelSubscriptionEventBasedAddonParams"] + ] cancel_reason_code: NotRequired[str] class CancelSubscriptionForItemsParams(TypedDict): @@ -199,76 +931,86 @@ class CancelSubscriptionForItemsParams(TypedDict): contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] invoice_date: NotRequired[int] subscription_items: NotRequired[ - List[CancelSubscriptionForItemsSubscriptionItemParams] + List["Estimate.CancelSubscriptionForItemsSubscriptionItemParams"] ] cancel_reason_code: NotRequired[str] class PauseSubscriptionParams(TypedDict): pause_option: NotRequired[enums.PauseOption] - subscription: NotRequired[PauseSubscriptionSubscriptionParams] + subscription: NotRequired["Estimate.PauseSubscriptionSubscriptionParams"] unbilled_charges_handling: NotRequired[enums.UnbilledChargesHandling] class ResumeSubscriptionParams(TypedDict): resume_option: NotRequired[enums.ResumeOption] - subscription: NotRequired[ResumeSubscriptionSubscriptionParams] + subscription: NotRequired["Estimate.ResumeSubscriptionSubscriptionParams"] charges_handling: NotRequired[enums.ChargesHandling] class GiftSubscriptionParams(TypedDict): - gift: NotRequired[GiftSubscriptionGiftParams] - gifter: Required[GiftSubscriptionGifterParams] - gift_receiver: Required[GiftSubscriptionGiftReceiverParams] + gift: NotRequired["Estimate.GiftSubscriptionGiftParams"] + gifter: Required["Estimate.GiftSubscriptionGifterParams"] + gift_receiver: Required["Estimate.GiftSubscriptionGiftReceiverParams"] coupon_ids: NotRequired[List[str]] - payment_intent: NotRequired[GiftSubscriptionPaymentIntentParams] - shipping_address: NotRequired[GiftSubscriptionShippingAddressParams] - subscription: Required[GiftSubscriptionSubscriptionParams] - addons: NotRequired[List[GiftSubscriptionAddonParams]] + payment_intent: NotRequired["Estimate.GiftSubscriptionPaymentIntentParams"] + shipping_address: NotRequired["Estimate.GiftSubscriptionShippingAddressParams"] + subscription: Required["Estimate.GiftSubscriptionSubscriptionParams"] + addons: NotRequired[List["Estimate.GiftSubscriptionAddonParams"]] class GiftSubscriptionForItemsParams(TypedDict): - gift: NotRequired[GiftSubscriptionForItemsGiftParams] - gifter: Required[GiftSubscriptionForItemsGifterParams] - gift_receiver: Required[GiftSubscriptionForItemsGiftReceiverParams] + gift: NotRequired["Estimate.GiftSubscriptionForItemsGiftParams"] + gifter: Required["Estimate.GiftSubscriptionForItemsGifterParams"] + gift_receiver: Required["Estimate.GiftSubscriptionForItemsGiftReceiverParams"] coupon_ids: NotRequired[List[str]] - payment_intent: NotRequired[GiftSubscriptionForItemsPaymentIntentParams] - shipping_address: NotRequired[GiftSubscriptionForItemsShippingAddressParams] + payment_intent: NotRequired[ + "Estimate.GiftSubscriptionForItemsPaymentIntentParams" + ] + shipping_address: NotRequired[ + "Estimate.GiftSubscriptionForItemsShippingAddressParams" + ] subscription_items: NotRequired[ - List[GiftSubscriptionForItemsSubscriptionItemParams] + List["Estimate.GiftSubscriptionForItemsSubscriptionItemParams"] ] class CreateInvoiceParams(TypedDict): - invoice: NotRequired[CreateInvoiceInvoiceParams] + invoice: NotRequired["Estimate.CreateInvoiceInvoiceParams"] currency_code: NotRequired[str] - addons: NotRequired[List[CreateInvoiceAddonParams]] - charges: NotRequired[List[CreateInvoiceChargeParams]] + addons: NotRequired[List["Estimate.CreateInvoiceAddonParams"]] + charges: NotRequired[List["Estimate.CreateInvoiceChargeParams"]] invoice_note: NotRequired[str] remove_general_note: NotRequired[bool] - notes_to_remove: NotRequired[List[CreateInvoiceNotesToRemoveParams]] + notes_to_remove: NotRequired[List["Estimate.CreateInvoiceNotesToRemoveParams"]] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] authorization_transaction_id: NotRequired[str] payment_source_id: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] invoice_date: NotRequired[int] - shipping_address: NotRequired[CreateInvoiceShippingAddressParams] - tax_providers_fields: NotRequired[List[CreateInvoiceTaxProvidersFieldParams]] + shipping_address: NotRequired["Estimate.CreateInvoiceShippingAddressParams"] + tax_providers_fields: NotRequired[ + List["Estimate.CreateInvoiceTaxProvidersFieldParams"] + ] class CreateInvoiceForItemsParams(TypedDict): - invoice: NotRequired[CreateInvoiceForItemsInvoiceParams] + invoice: NotRequired["Estimate.CreateInvoiceForItemsInvoiceParams"] currency_code: NotRequired[str] - item_prices: NotRequired[List[CreateInvoiceForItemsItemPriceParams]] - item_tiers: NotRequired[List[CreateInvoiceForItemsItemTierParams]] - charges: NotRequired[List[CreateInvoiceForItemsChargeParams]] + item_prices: NotRequired[List["Estimate.CreateInvoiceForItemsItemPriceParams"]] + item_tiers: NotRequired[List["Estimate.CreateInvoiceForItemsItemTierParams"]] + charges: NotRequired[List["Estimate.CreateInvoiceForItemsChargeParams"]] invoice_note: NotRequired[str] remove_general_note: NotRequired[bool] - notes_to_remove: NotRequired[List[CreateInvoiceForItemsNotesToRemoveParams]] + notes_to_remove: NotRequired[ + List["Estimate.CreateInvoiceForItemsNotesToRemoveParams"] + ] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] authorization_transaction_id: NotRequired[str] payment_source_id: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] - discounts: Required[List[CreateInvoiceForItemsDiscountParams]] - shipping_address: NotRequired[CreateInvoiceForItemsShippingAddressParams] + discounts: Required[List["Estimate.CreateInvoiceForItemsDiscountParams"]] + shipping_address: NotRequired[ + "Estimate.CreateInvoiceForItemsShippingAddressParams" + ] tax_providers_fields: NotRequired[ - List[CreateInvoiceForItemsTaxProvidersFieldParams] + List["Estimate.CreateInvoiceForItemsTaxProvidersFieldParams"] ] invoice_date: NotRequired[int] diff --git a/chargebee/models/estimate/types.py b/chargebee/models/estimate/types.py deleted file mode 100644 index 4264342..0000000 --- a/chargebee/models/estimate/types.py +++ /dev/null @@ -1,771 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import ( - enums, - payment_intent, - contract_term, - subscription_estimate, - invoice_estimate, - credit_note_estimate, - unbilled_charge, -) - - -class UnbilledChargeEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class CreateSubscriptionSubscriptionParams(TypedDict): - id: NotRequired[str] - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price: NotRequired[int] - plan_unit_price_in_decimal: NotRequired[str] - setup_fee: NotRequired[int] - trial_end: 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] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class CreateSubscriptionAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class CreateSubscriptionEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CreateSubscriptionBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubscriptionShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubscriptionCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - exemption_details: NotRequired[List[Dict[Any, Any]]] - customer_type: NotRequired[enums.CustomerType] - - -class CreateSubscriptionContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CreateSubscriptionTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateSubItemEstimateSubscriptionParams(TypedDict): - id: NotRequired[str] - trial_end: NotRequired[int] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - coupon: NotRequired[str] - free_period: NotRequired[int] - free_period_unit: NotRequired[enums.FreePeriodUnit] - contract_term_billing_cycle_on_renewal: NotRequired[int] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class CreateSubItemEstimateSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class CreateSubItemEstimateDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class CreateSubItemEstimateItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateSubItemEstimateBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubItemEstimateShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubItemEstimateCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - exemption_details: NotRequired[List[Dict[Any, Any]]] - customer_type: NotRequired[enums.CustomerType] - - -class CreateSubItemEstimateContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - contract_start: NotRequired[int] - cancellation_cutoff_period: NotRequired[int] - - -class CreateSubItemEstimateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateSubForCustomerEstimateSubscriptionParams(TypedDict): - id: NotRequired[str] - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price: NotRequired[int] - plan_unit_price_in_decimal: NotRequired[str] - setup_fee: NotRequired[int] - trial_end: 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] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class CreateSubForCustomerEstimateAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class CreateSubForCustomerEstimateEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CreateSubForCustomerEstimateShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubForCustomerEstimateContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CreateSubItemForCustomerEstimateSubscriptionParams(TypedDict): - id: NotRequired[str] - trial_end: NotRequired[int] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - free_period: NotRequired[int] - free_period_unit: NotRequired[enums.FreePeriodUnit] - contract_term_billing_cycle_on_renewal: NotRequired[int] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class CreateSubItemForCustomerEstimateSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class CreateSubItemForCustomerEstimateDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class CreateSubItemForCustomerEstimateItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateSubItemForCustomerEstimateShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubItemForCustomerEstimateBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubItemForCustomerEstimateContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - contract_start: NotRequired[int] - cancellation_cutoff_period: NotRequired[int] - - -class UpdateSubscriptionSubscriptionParams(TypedDict): - id: Required[str] - plan_id: NotRequired[str] - plan_quantity: NotRequired[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - free_period: NotRequired[int] - free_period_unit: NotRequired[enums.FreePeriodUnit] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class UpdateSubscriptionAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - proration_type: NotRequired[enums.ProrationType] - - -class UpdateSubscriptionEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - charge_on: NotRequired[enums.ChargeOn] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class UpdateSubscriptionBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - taxability: NotRequired[enums.Taxability] - - -class UpdateSubscriptionForItemsSubscriptionParams(TypedDict): - id: Required[str] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - free_period: NotRequired[int] - free_period_unit: NotRequired[enums.FreePeriodUnit] - trial_end_action: NotRequired[enums.TrialEndAction] - - -class UpdateSubscriptionForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - charge_on_option: NotRequired[enums.ChargeOnOption] - item_type: NotRequired[enums.ItemType] - proration_type: NotRequired[enums.ProrationType] - - -class UpdateSubscriptionForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - operation_type: Required[enums.OperationType] - id: NotRequired[str] - - -class UpdateSubscriptionForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateSubscriptionForItemsBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionForItemsShippingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionForItemsCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - taxability: NotRequired[enums.Taxability] - - -class AdvanceInvoiceEstimateSpecificDatesScheduleParams(TypedDict): - terms_to_charge: NotRequired[int] - date: NotRequired[int] - - -class AdvanceInvoiceEstimateFixedIntervalScheduleParams(TypedDict): - number_of_occurrences: NotRequired[int] - days_before_renewal: NotRequired[int] - end_schedule_on: NotRequired[enums.EndScheduleOn] - end_date: NotRequired[int] - - -class CancelSubscriptionEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - - -class CancelSubscriptionForItemsSubscriptionItemParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period_days: NotRequired[int] - - -class PauseSubscriptionSubscriptionParams(TypedDict): - pause_date: NotRequired[int] - resume_date: NotRequired[int] - skip_billing_cycles: NotRequired[int] - - -class ResumeSubscriptionSubscriptionParams(TypedDict): - resume_date: NotRequired[int] - - -class GiftSubscriptionGiftParams(TypedDict): - scheduled_at: NotRequired[int] - auto_claim: NotRequired[bool] - no_expiry: NotRequired[bool] - claim_expiry_date: NotRequired[int] - - -class GiftSubscriptionGifterParams(TypedDict): - customer_id: Required[str] - signature: Required[str] - note: NotRequired[str] - payment_src_id: NotRequired[str] - - -class GiftSubscriptionGiftReceiverParams(TypedDict): - customer_id: Required[str] - first_name: Required[str] - last_name: Required[str] - email: Required[str] - - -class GiftSubscriptionPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class GiftSubscriptionShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class GiftSubscriptionSubscriptionParams(TypedDict): - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - - -class GiftSubscriptionAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class GiftSubscriptionForItemsGiftParams(TypedDict): - scheduled_at: NotRequired[int] - auto_claim: NotRequired[bool] - no_expiry: NotRequired[bool] - claim_expiry_date: NotRequired[int] - - -class GiftSubscriptionForItemsGifterParams(TypedDict): - customer_id: Required[str] - signature: Required[str] - note: NotRequired[str] - payment_src_id: NotRequired[str] - - -class GiftSubscriptionForItemsGiftReceiverParams(TypedDict): - customer_id: Required[str] - first_name: Required[str] - last_name: Required[str] - email: Required[str] - - -class GiftSubscriptionForItemsPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class GiftSubscriptionForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class GiftSubscriptionForItemsSubscriptionItemParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class CreateInvoiceInvoiceParams(TypedDict): - customer_id: NotRequired[str] - subscription_id: NotRequired[str] - po_number: NotRequired[str] - - -class CreateInvoiceAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateInvoiceChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateInvoiceNotesToRemoveParams(TypedDict): - entity_type: NotRequired[enums.EntityType] - entity_id: NotRequired[str] - - -class CreateInvoiceShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateInvoiceTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateInvoiceForItemsInvoiceParams(TypedDict): - customer_id: NotRequired[str] - subscription_id: NotRequired[str] - po_number: NotRequired[str] - - -class CreateInvoiceForItemsItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateInvoiceForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateInvoiceForItemsChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateInvoiceForItemsNotesToRemoveParams(TypedDict): - entity_type: NotRequired[enums.EntityType] - entity_id: NotRequired[str] - - -class CreateInvoiceForItemsDiscountParams(TypedDict): - percentage: NotRequired[float] - amount: NotRequired[int] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - - -class CreateInvoiceForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateInvoiceForItemsTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] diff --git a/chargebee/models/event/__init__.py b/chargebee/models/event/__init__.py index 19028fc..21962c0 100644 --- a/chargebee/models/event/__init__.py +++ b/chargebee/models/event/__init__.py @@ -1,3 +1,2 @@ from .operations import Event from .responses import EventResponse -from .types import Webhook, WebhookStatus diff --git a/chargebee/models/event/operations.py b/chargebee/models/event/operations.py index a699e7a..f4480f9 100644 --- a/chargebee/models/event/operations.py +++ b/chargebee/models/event/operations.py @@ -1,13 +1,62 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum import json from chargebee.main import Environment from chargebee.filters import Filters class Event: + class WebhookStatus(Enum): + NOT_CONFIGURED = "not_configured" + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + RE_SCHEDULED = "re_scheduled" + FAILED = "failed" + SKIPPED = "skipped" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class WebhookWebhookStatus(Enum): + NOT_CONFIGURED = "not_configured" + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + RE_SCHEDULED = "re_scheduled" + FAILED = "failed" + SKIPPED = "skipped" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class Webhook(TypedDict): + id: Required[str] + webhook_status: Required["Event.WebhookWebhookStatus"] + + @staticmethod + def deserialize(json_data) -> EventResponse: + try: + webhook_data = json.loads(json_data) + except (TypeError, ValueError) as ex: + raise Exception( + "The passed json_data is not JSON formatted . " + ex.message + ) + + api_version = webhook_data.get("api_version", None) + env_version = Environment.API_VERSION + if api_version != None and api_version.upper() != env_version.upper(): + raise Exception( + "API version [" + + api_version.upper() + + "] in response does not match " + + "with client library API version [" + + env_version.upper() + + "]" + ) + return EventResponse.construct(webhook_data) class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/event/types.py b/chargebee/models/event/types.py deleted file mode 100644 index 82a43b3..0000000 --- a/chargebee/models/event/types.py +++ /dev/null @@ -1,34 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class WebhookStatus(Enum): - NOT_CONFIGURED = "not_configured" - SCHEDULED = "scheduled" - SUCCEEDED = "succeeded" - RE_SCHEDULED = "re_scheduled" - FAILED = "failed" - SKIPPED = "skipped" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class WebhookWebhookStatus(Enum): - NOT_CONFIGURED = "not_configured" - SCHEDULED = "scheduled" - SUCCEEDED = "succeeded" - RE_SCHEDULED = "re_scheduled" - FAILED = "failed" - SKIPPED = "skipped" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class Webhook(TypedDict): - id: Required[str] - webhook_status: Required[WebhookWebhookStatus] diff --git a/chargebee/models/export/__init__.py b/chargebee/models/export/__init__.py index e5ace51..18ac5cf 100644 --- a/chargebee/models/export/__init__.py +++ b/chargebee/models/export/__init__.py @@ -1,3 +1,2 @@ from .operations import Export from .responses import ExportResponse -from .types import Download, MimeType, Status diff --git a/chargebee/models/export/operations.py b/chargebee/models/export/operations.py index 195806b..fc6ff17 100644 --- a/chargebee/models/export/operations.py +++ b/chargebee/models/export/operations.py @@ -1,17 +1,359 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.filters import Filters from chargebee.models import enums class Export: + class MimeType(Enum): + PDF = "pdf" + ZIP = "zip" + + def __str__(self): + return self.value + + class Status(Enum): + IN_PROCESS = "in_process" + COMPLETED = "completed" + FAILED = "failed" + + def __str__(self): + return self.value + + class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + + class RevenueRecognitionInvoiceParams(TypedDict): + id: NotRequired[Filters.StringFilter] + recurring: NotRequired[Filters.BooleanFilter] + status: NotRequired[Filters.EnumFilter] + price_type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + paid_at: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + amount_paid: NotRequired[Filters.NumberFilter] + amount_adjusted: NotRequired[Filters.NumberFilter] + credits_applied: NotRequired[Filters.NumberFilter] + amount_due: NotRequired[Filters.NumberFilter] + dunning_status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class RevenueRecognitionSubscriptionParams(TypedDict): + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + cancel_reason: NotRequired[Filters.EnumFilter] + remaining_billing_cycles: NotRequired[Filters.NumberFilter] + created_at: NotRequired[Filters.TimestampFilter] + activated_at: NotRequired[Filters.TimestampFilter] + next_billing_at: NotRequired[Filters.TimestampFilter] + cancelled_at: NotRequired[Filters.TimestampFilter] + has_scheduled_changes: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + plan_id: NotRequired[Filters.StringFilter] + + class RevenueRecognitionCustomerParams(TypedDict): + id: NotRequired[Filters.StringFilter] + first_name: NotRequired[Filters.StringFilter] + last_name: NotRequired[Filters.StringFilter] + email: NotRequired[Filters.StringFilter] + company: NotRequired[Filters.StringFilter] + phone: NotRequired[Filters.StringFilter] + auto_collection: NotRequired[Filters.EnumFilter] + taxability: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + + class RevenueRecognitionRelationshipParams(TypedDict): + parent_id: NotRequired[Filters.StringFilter] + payment_owner_id: NotRequired[Filters.StringFilter] + invoice_owner_id: NotRequired[Filters.StringFilter] + + class DeferredRevenueInvoiceParams(TypedDict): + id: NotRequired[Filters.StringFilter] + recurring: NotRequired[Filters.BooleanFilter] + status: NotRequired[Filters.EnumFilter] + price_type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + paid_at: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + amount_paid: NotRequired[Filters.NumberFilter] + amount_adjusted: NotRequired[Filters.NumberFilter] + credits_applied: NotRequired[Filters.NumberFilter] + amount_due: NotRequired[Filters.NumberFilter] + dunning_status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class DeferredRevenueSubscriptionParams(TypedDict): + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + cancel_reason: NotRequired[Filters.EnumFilter] + remaining_billing_cycles: NotRequired[Filters.NumberFilter] + created_at: NotRequired[Filters.TimestampFilter] + activated_at: NotRequired[Filters.TimestampFilter] + next_billing_at: NotRequired[Filters.TimestampFilter] + cancelled_at: NotRequired[Filters.TimestampFilter] + has_scheduled_changes: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + plan_id: NotRequired[Filters.StringFilter] + + class DeferredRevenueCustomerParams(TypedDict): + id: NotRequired[Filters.StringFilter] + first_name: NotRequired[Filters.StringFilter] + last_name: NotRequired[Filters.StringFilter] + email: NotRequired[Filters.StringFilter] + company: NotRequired[Filters.StringFilter] + phone: NotRequired[Filters.StringFilter] + auto_collection: NotRequired[Filters.EnumFilter] + taxability: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + + class DeferredRevenueRelationshipParams(TypedDict): + parent_id: NotRequired[Filters.StringFilter] + payment_owner_id: NotRequired[Filters.StringFilter] + invoice_owner_id: NotRequired[Filters.StringFilter] + + class PlansPlanParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + price: NotRequired[Filters.NumberFilter] + period: NotRequired[Filters.NumberFilter] + period_unit: NotRequired[Filters.EnumFilter] + trial_period: NotRequired[Filters.NumberFilter] + trial_period_unit: NotRequired[Filters.EnumFilter] + addon_applicability: NotRequired[Filters.EnumFilter] + giftable: NotRequired[Filters.BooleanFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class AddonsAddonParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + charge_type: NotRequired[Filters.EnumFilter] + price: NotRequired[Filters.NumberFilter] + period: NotRequired[Filters.NumberFilter] + period_unit: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class CouponsCouponParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + discount_type: NotRequired[Filters.EnumFilter] + duration_type: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + apply_on: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + class CustomersCustomerParams(TypedDict): + id: NotRequired[Filters.StringFilter] + first_name: NotRequired[Filters.StringFilter] + last_name: NotRequired[Filters.StringFilter] + email: NotRequired[Filters.StringFilter] + company: NotRequired[Filters.StringFilter] + phone: NotRequired[Filters.StringFilter] + auto_collection: NotRequired[Filters.EnumFilter] + taxability: NotRequired[Filters.EnumFilter] + created_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + + class CustomersRelationshipParams(TypedDict): + parent_id: NotRequired[Filters.StringFilter] + payment_owner_id: NotRequired[Filters.StringFilter] + invoice_owner_id: NotRequired[Filters.StringFilter] + + class SubscriptionsSubscriptionParams(TypedDict): + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + cancel_reason: NotRequired[Filters.EnumFilter] + remaining_billing_cycles: NotRequired[Filters.NumberFilter] + created_at: NotRequired[Filters.TimestampFilter] + activated_at: NotRequired[Filters.TimestampFilter] + next_billing_at: NotRequired[Filters.TimestampFilter] + cancelled_at: NotRequired[Filters.TimestampFilter] + has_scheduled_changes: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + offline_payment_method: NotRequired[Filters.EnumFilter] + auto_close_invoices: NotRequired[Filters.BooleanFilter] + channel: NotRequired[Filters.EnumFilter] + plan_id: NotRequired[Filters.StringFilter] + + class InvoicesInvoiceParams(TypedDict): + id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + recurring: NotRequired[Filters.BooleanFilter] + status: NotRequired[Filters.EnumFilter] + price_type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + paid_at: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + amount_paid: NotRequired[Filters.NumberFilter] + amount_adjusted: NotRequired[Filters.NumberFilter] + credits_applied: NotRequired[Filters.NumberFilter] + amount_due: NotRequired[Filters.NumberFilter] + dunning_status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class CreditNotesCreditNoteParams(TypedDict): + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + reference_invoice_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + reason_code: NotRequired[Filters.EnumFilter] + create_reason_code: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + total: NotRequired[Filters.NumberFilter] + price_type: NotRequired[Filters.EnumFilter] + amount_allocated: NotRequired[Filters.NumberFilter] + amount_refunded: NotRequired[Filters.NumberFilter] + amount_available: NotRequired[Filters.NumberFilter] + voided_at: NotRequired[Filters.TimestampFilter] + updated_at: NotRequired[Filters.TimestampFilter] + channel: NotRequired[Filters.EnumFilter] + + class TransactionsTransactionParams(TypedDict): + id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + payment_source_id: NotRequired[Filters.StringFilter] + payment_method: NotRequired[Filters.EnumFilter] + gateway: NotRequired[Filters.EnumFilter] + gateway_account_id: NotRequired[Filters.StringFilter] + id_at_gateway: NotRequired[Filters.StringFilter] + reference_number: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + date: NotRequired[Filters.TimestampFilter] + amount: NotRequired[Filters.NumberFilter] + amount_capturable: NotRequired[Filters.NumberFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + class OrdersOrderParams(TypedDict): + id: NotRequired[Filters.StringFilter] + subscription_id: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + price_type: NotRequired[Filters.EnumFilter] + order_date: NotRequired[Filters.TimestampFilter] + shipping_date: NotRequired[Filters.TimestampFilter] + shipped_at: NotRequired[Filters.TimestampFilter] + delivered_at: NotRequired[Filters.TimestampFilter] + cancelled_at: NotRequired[Filters.TimestampFilter] + amount_paid: NotRequired[Filters.NumberFilter] + refundable_credits: NotRequired[Filters.NumberFilter] + refundable_credits_issued: NotRequired[Filters.NumberFilter] + updated_at: NotRequired[Filters.TimestampFilter] + resent_status: NotRequired[Filters.EnumFilter] + is_resent: NotRequired[Filters.BooleanFilter] + original_order_id: NotRequired[Filters.StringFilter] + + class ItemFamiliesItemFamilyParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + updated_at: NotRequired[Filters.TimestampFilter] + + class ItemsItemParams(TypedDict): + id: NotRequired[Filters.StringFilter] + item_family_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + name: NotRequired[Filters.StringFilter] + item_applicability: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + is_giftable: NotRequired[Filters.BooleanFilter] + updated_at: NotRequired[Filters.TimestampFilter] + enabled_for_checkout: NotRequired[Filters.BooleanFilter] + enabled_in_portal: NotRequired[Filters.BooleanFilter] + metered: NotRequired[Filters.BooleanFilter] + usage_calculation: NotRequired[Filters.EnumFilter] + channel: NotRequired[Filters.EnumFilter] + + class ItemPricesItemPriceParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + pricing_model: NotRequired[Filters.EnumFilter] + item_id: NotRequired[Filters.StringFilter] + price_variant_id: NotRequired[Filters.StringFilter] + trial_period: NotRequired[Filters.NumberFilter] + trial_period_unit: NotRequired[Filters.EnumFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + period_unit: NotRequired[Filters.EnumFilter] + period: NotRequired[Filters.NumberFilter] + channel: NotRequired[Filters.EnumFilter] + + class AttachedItemsAttachedItemParams(TypedDict): + id: NotRequired[Filters.StringFilter] + item_id: NotRequired[Filters.StringFilter] + type: NotRequired[Filters.EnumFilter] + charge_on_event: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + parent_item_id: NotRequired[Filters.StringFilter] + + class DifferentialPricesDifferentialPriceParams(TypedDict): + item_price_id: NotRequired[Filters.StringFilter] + id: NotRequired[Filters.StringFilter] + parent_item_id: NotRequired[Filters.StringFilter] + + class PriceVariantsPriceVariantParams(TypedDict): + id: NotRequired[Filters.StringFilter] + name: NotRequired[Filters.StringFilter] + status: NotRequired[Filters.EnumFilter] + updated_at: NotRequired[Filters.TimestampFilter] + created_at: NotRequired[Filters.TimestampFilter] + + def wait_for_export_completion( + export: ExportResponse, env=None, headers=None + ) -> RetrieveResponse: + import time + + count = 0 + sleep_time_millis = (10000 if env == None else env.export_sleep_millis) / 1000.0 + + while export.status == "in_process": + if count > 50: + raise RuntimeError("Export is taking too long") + count += 1 + time.sleep(sleep_time_millis) + response = Export.retrieve(export.id, env, headers) + export = response.export + return response class RevenueRecognitionParams(TypedDict): - invoice: NotRequired[RevenueRecognitionInvoiceParams] - subscription: NotRequired[RevenueRecognitionSubscriptionParams] - customer: NotRequired[RevenueRecognitionCustomerParams] - relationship: NotRequired[RevenueRecognitionRelationshipParams] + invoice: NotRequired["Export.RevenueRecognitionInvoiceParams"] + subscription: NotRequired["Export.RevenueRecognitionSubscriptionParams"] + customer: NotRequired["Export.RevenueRecognitionCustomerParams"] + relationship: NotRequired["Export.RevenueRecognitionRelationshipParams"] report_by: Required[enums.ReportBy] currency_code: NotRequired[str] report_from_month: Required[int] @@ -26,10 +368,10 @@ class RevenueRecognitionParams(TypedDict): business_entity_id: NotRequired[Filters.StringFilter] class DeferredRevenueParams(TypedDict): - invoice: NotRequired[DeferredRevenueInvoiceParams] - subscription: NotRequired[DeferredRevenueSubscriptionParams] - customer: NotRequired[DeferredRevenueCustomerParams] - relationship: NotRequired[DeferredRevenueRelationshipParams] + invoice: NotRequired["Export.DeferredRevenueInvoiceParams"] + subscription: NotRequired["Export.DeferredRevenueSubscriptionParams"] + customer: NotRequired["Export.DeferredRevenueCustomerParams"] + relationship: NotRequired["Export.DeferredRevenueRelationshipParams"] report_by: Required[enums.ReportBy] currency_code: NotRequired[str] report_from_month: Required[int] @@ -44,66 +386,68 @@ class DeferredRevenueParams(TypedDict): business_entity_id: NotRequired[Filters.StringFilter] class PlansParams(TypedDict): - plan: NotRequired[PlansPlanParams] + plan: NotRequired["Export.PlansPlanParams"] currency_code: NotRequired[Filters.StringFilter] class AddonsParams(TypedDict): - addon: NotRequired[AddonsAddonParams] + addon: NotRequired["Export.AddonsAddonParams"] currency_code: NotRequired[Filters.StringFilter] class CouponsParams(TypedDict): - coupon: NotRequired[CouponsCouponParams] + coupon: NotRequired["Export.CouponsCouponParams"] currency_code: NotRequired[Filters.StringFilter] class CustomersParams(TypedDict): - customer: NotRequired[CustomersCustomerParams] - relationship: NotRequired[CustomersRelationshipParams] + customer: NotRequired["Export.CustomersCustomerParams"] + relationship: NotRequired["Export.CustomersRelationshipParams"] export_type: NotRequired[enums.ExportType] business_entity_id: NotRequired[Filters.StringFilter] class SubscriptionsParams(TypedDict): - subscription: NotRequired[SubscriptionsSubscriptionParams] + subscription: NotRequired["Export.SubscriptionsSubscriptionParams"] export_type: NotRequired[enums.ExportType] item_id: NotRequired[Filters.StringFilter] item_price_id: NotRequired[Filters.StringFilter] cancel_reason_code: NotRequired[Filters.StringFilter] class InvoicesParams(TypedDict): - invoice: NotRequired[InvoicesInvoiceParams] + invoice: NotRequired["Export.InvoicesInvoiceParams"] payment_owner: NotRequired[Filters.StringFilter] class CreditNotesParams(TypedDict): - credit_note: NotRequired[CreditNotesCreditNoteParams] + credit_note: NotRequired["Export.CreditNotesCreditNoteParams"] class TransactionsParams(TypedDict): - transaction: NotRequired[TransactionsTransactionParams] + transaction: NotRequired["Export.TransactionsTransactionParams"] class OrdersParams(TypedDict): - order: NotRequired[OrdersOrderParams] + order: NotRequired["Export.OrdersOrderParams"] total: NotRequired[Filters.NumberFilter] class ItemFamiliesParams(TypedDict): - item_family: NotRequired[ItemFamiliesItemFamilyParams] + item_family: NotRequired["Export.ItemFamiliesItemFamilyParams"] class ItemsParams(TypedDict): - item: NotRequired[ItemsItemParams] + item: NotRequired["Export.ItemsItemParams"] class ItemPricesParams(TypedDict): - item_price: NotRequired[ItemPricesItemPriceParams] + item_price: NotRequired["Export.ItemPricesItemPriceParams"] item_family_id: NotRequired[Filters.StringFilter] item_type: NotRequired[Filters.EnumFilter] currency_code: NotRequired[Filters.StringFilter] class AttachedItemsParams(TypedDict): - attached_item: NotRequired[AttachedItemsAttachedItemParams] + attached_item: NotRequired["Export.AttachedItemsAttachedItemParams"] item_type: NotRequired[Filters.EnumFilter] class DifferentialPricesParams(TypedDict): - differential_price: NotRequired[DifferentialPricesDifferentialPriceParams] + differential_price: NotRequired[ + "Export.DifferentialPricesDifferentialPriceParams" + ] item_id: NotRequired[Filters.StringFilter] class PriceVariantsParams(TypedDict): - price_variant: NotRequired[PriceVariantsPriceVariantParams] + price_variant: NotRequired["Export.PriceVariantsPriceVariantParams"] @staticmethod def retrieve(id, env=None, headers=None) -> RetrieveResponse: diff --git a/chargebee/models/export/types.py b/chargebee/models/export/types.py deleted file mode 100644 index 77ca480..0000000 --- a/chargebee/models/export/types.py +++ /dev/null @@ -1,355 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.filters import Filters - - -class MimeType(Enum): - PDF = "pdf" - ZIP = "zip" - - def __str__(self): - return self.value - - -class Status(Enum): - IN_PROCESS = "in_process" - COMPLETED = "completed" - FAILED = "failed" - - def __str__(self): - return self.value - - -class Download(TypedDict): - download_url: Required[str] - valid_till: Required[int] - mime_type: NotRequired[str] - - -class RevenueRecognitionInvoiceParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Recurring: NotRequired[Filters.BooleanFilter] - Status: NotRequired[Filters.EnumFilter] - PriceType: NotRequired[Filters.EnumFilter] - Date: NotRequired[Filters.TimestampFilter] - PaidAt: NotRequired[Filters.TimestampFilter] - Total: NotRequired[Filters.NumberFilter] - AmountPaid: NotRequired[Filters.NumberFilter] - AmountAdjusted: NotRequired[Filters.NumberFilter] - CreditsApplied: NotRequired[Filters.NumberFilter] - AmountDue: NotRequired[Filters.NumberFilter] - DunningStatus: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class RevenueRecognitionSubscriptionParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - CancelReason: NotRequired[Filters.EnumFilter] - RemainingBillingCycles: NotRequired[Filters.NumberFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - ActivatedAt: NotRequired[Filters.TimestampFilter] - NextBillingAt: NotRequired[Filters.TimestampFilter] - CancelledAt: NotRequired[Filters.TimestampFilter] - HasScheduledChanges: NotRequired[Filters.BooleanFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - PlanId: NotRequired[Filters.StringFilter] - - -class RevenueRecognitionCustomerParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - FirstName: NotRequired[Filters.StringFilter] - LastName: NotRequired[Filters.StringFilter] - Email: NotRequired[Filters.StringFilter] - Company: NotRequired[Filters.StringFilter] - Phone: NotRequired[Filters.StringFilter] - AutoCollection: NotRequired[Filters.EnumFilter] - Taxability: NotRequired[Filters.EnumFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class RevenueRecognitionRelationshipParams(TypedDict): - ParentId: NotRequired[Filters.StringFilter] - PaymentOwnerId: NotRequired[Filters.StringFilter] - InvoiceOwnerId: NotRequired[Filters.StringFilter] - - -class DeferredRevenueInvoiceParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Recurring: NotRequired[Filters.BooleanFilter] - Status: NotRequired[Filters.EnumFilter] - PriceType: NotRequired[Filters.EnumFilter] - Date: NotRequired[Filters.TimestampFilter] - PaidAt: NotRequired[Filters.TimestampFilter] - Total: NotRequired[Filters.NumberFilter] - AmountPaid: NotRequired[Filters.NumberFilter] - AmountAdjusted: NotRequired[Filters.NumberFilter] - CreditsApplied: NotRequired[Filters.NumberFilter] - AmountDue: NotRequired[Filters.NumberFilter] - DunningStatus: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class DeferredRevenueSubscriptionParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - CancelReason: NotRequired[Filters.EnumFilter] - RemainingBillingCycles: NotRequired[Filters.NumberFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - ActivatedAt: NotRequired[Filters.TimestampFilter] - NextBillingAt: NotRequired[Filters.TimestampFilter] - CancelledAt: NotRequired[Filters.TimestampFilter] - HasScheduledChanges: NotRequired[Filters.BooleanFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - PlanId: NotRequired[Filters.StringFilter] - - -class DeferredRevenueCustomerParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - FirstName: NotRequired[Filters.StringFilter] - LastName: NotRequired[Filters.StringFilter] - Email: NotRequired[Filters.StringFilter] - Company: NotRequired[Filters.StringFilter] - Phone: NotRequired[Filters.StringFilter] - AutoCollection: NotRequired[Filters.EnumFilter] - Taxability: NotRequired[Filters.EnumFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class DeferredRevenueRelationshipParams(TypedDict): - ParentId: NotRequired[Filters.StringFilter] - PaymentOwnerId: NotRequired[Filters.StringFilter] - InvoiceOwnerId: NotRequired[Filters.StringFilter] - - -class PlansPlanParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - Price: NotRequired[Filters.NumberFilter] - Period: NotRequired[Filters.NumberFilter] - PeriodUnit: NotRequired[Filters.EnumFilter] - TrialPeriod: NotRequired[Filters.NumberFilter] - TrialPeriodUnit: NotRequired[Filters.EnumFilter] - AddonApplicability: NotRequired[Filters.EnumFilter] - Giftable: NotRequired[Filters.BooleanFilter] - Status: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class AddonsAddonParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - ChargeType: NotRequired[Filters.EnumFilter] - Price: NotRequired[Filters.NumberFilter] - Period: NotRequired[Filters.NumberFilter] - PeriodUnit: NotRequired[Filters.EnumFilter] - Status: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class CouponsCouponParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - DiscountType: NotRequired[Filters.EnumFilter] - DurationType: NotRequired[Filters.EnumFilter] - Status: NotRequired[Filters.EnumFilter] - ApplyOn: NotRequired[Filters.EnumFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - - -class CustomersCustomerParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - FirstName: NotRequired[Filters.StringFilter] - LastName: NotRequired[Filters.StringFilter] - Email: NotRequired[Filters.StringFilter] - Company: NotRequired[Filters.StringFilter] - Phone: NotRequired[Filters.StringFilter] - AutoCollection: NotRequired[Filters.EnumFilter] - Taxability: NotRequired[Filters.EnumFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class CustomersRelationshipParams(TypedDict): - ParentId: NotRequired[Filters.StringFilter] - PaymentOwnerId: NotRequired[Filters.StringFilter] - InvoiceOwnerId: NotRequired[Filters.StringFilter] - - -class SubscriptionsSubscriptionParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - CancelReason: NotRequired[Filters.EnumFilter] - RemainingBillingCycles: NotRequired[Filters.NumberFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] - ActivatedAt: NotRequired[Filters.TimestampFilter] - NextBillingAt: NotRequired[Filters.TimestampFilter] - CancelledAt: NotRequired[Filters.TimestampFilter] - HasScheduledChanges: NotRequired[Filters.BooleanFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - OfflinePaymentMethod: NotRequired[Filters.EnumFilter] - AutoCloseInvoices: NotRequired[Filters.BooleanFilter] - Channel: NotRequired[Filters.EnumFilter] - PlanId: NotRequired[Filters.StringFilter] - - -class InvoicesInvoiceParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - SubscriptionId: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - Recurring: NotRequired[Filters.BooleanFilter] - Status: NotRequired[Filters.EnumFilter] - PriceType: NotRequired[Filters.EnumFilter] - Date: NotRequired[Filters.TimestampFilter] - PaidAt: NotRequired[Filters.TimestampFilter] - Total: NotRequired[Filters.NumberFilter] - AmountPaid: NotRequired[Filters.NumberFilter] - AmountAdjusted: NotRequired[Filters.NumberFilter] - CreditsApplied: NotRequired[Filters.NumberFilter] - AmountDue: NotRequired[Filters.NumberFilter] - DunningStatus: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class CreditNotesCreditNoteParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - SubscriptionId: NotRequired[Filters.StringFilter] - ReferenceInvoiceId: NotRequired[Filters.StringFilter] - Type: NotRequired[Filters.EnumFilter] - ReasonCode: NotRequired[Filters.EnumFilter] - CreateReasonCode: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - Date: NotRequired[Filters.TimestampFilter] - Total: NotRequired[Filters.NumberFilter] - PriceType: NotRequired[Filters.EnumFilter] - AmountAllocated: NotRequired[Filters.NumberFilter] - AmountRefunded: NotRequired[Filters.NumberFilter] - AmountAvailable: NotRequired[Filters.NumberFilter] - VoidedAt: NotRequired[Filters.TimestampFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class TransactionsTransactionParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - SubscriptionId: NotRequired[Filters.StringFilter] - PaymentSourceId: NotRequired[Filters.StringFilter] - PaymentMethod: NotRequired[Filters.EnumFilter] - Gateway: NotRequired[Filters.EnumFilter] - GatewayAccountId: NotRequired[Filters.StringFilter] - IdAtGateway: NotRequired[Filters.StringFilter] - ReferenceNumber: NotRequired[Filters.StringFilter] - Type: NotRequired[Filters.EnumFilter] - Date: NotRequired[Filters.TimestampFilter] - Amount: NotRequired[Filters.NumberFilter] - AmountCapturable: NotRequired[Filters.NumberFilter] - Status: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - - -class OrdersOrderParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - SubscriptionId: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - PriceType: NotRequired[Filters.EnumFilter] - OrderDate: NotRequired[Filters.TimestampFilter] - ShippingDate: NotRequired[Filters.TimestampFilter] - ShippedAt: NotRequired[Filters.TimestampFilter] - DeliveredAt: NotRequired[Filters.TimestampFilter] - CancelledAt: NotRequired[Filters.TimestampFilter] - AmountPaid: NotRequired[Filters.NumberFilter] - RefundableCredits: NotRequired[Filters.NumberFilter] - RefundableCreditsIssued: NotRequired[Filters.NumberFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - ResentStatus: NotRequired[Filters.EnumFilter] - IsResent: NotRequired[Filters.BooleanFilter] - OriginalOrderId: NotRequired[Filters.StringFilter] - - -class ItemFamiliesItemFamilyParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - - -class ItemsItemParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - ItemFamilyId: NotRequired[Filters.StringFilter] - Type: NotRequired[Filters.EnumFilter] - Name: NotRequired[Filters.StringFilter] - ItemApplicability: NotRequired[Filters.EnumFilter] - Status: NotRequired[Filters.EnumFilter] - IsGiftable: NotRequired[Filters.BooleanFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - EnabledForCheckout: NotRequired[Filters.BooleanFilter] - EnabledInPortal: NotRequired[Filters.BooleanFilter] - Metered: NotRequired[Filters.BooleanFilter] - UsageCalculation: NotRequired[Filters.EnumFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class ItemPricesItemPriceParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - PricingModel: NotRequired[Filters.EnumFilter] - ItemId: NotRequired[Filters.StringFilter] - PriceVariantId: NotRequired[Filters.StringFilter] - TrialPeriod: NotRequired[Filters.NumberFilter] - TrialPeriodUnit: NotRequired[Filters.EnumFilter] - Status: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - PeriodUnit: NotRequired[Filters.EnumFilter] - Period: NotRequired[Filters.NumberFilter] - Channel: NotRequired[Filters.EnumFilter] - - -class AttachedItemsAttachedItemParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - ItemId: NotRequired[Filters.StringFilter] - Type: NotRequired[Filters.EnumFilter] - ChargeOnEvent: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - ParentItemId: NotRequired[Filters.StringFilter] - - -class DifferentialPricesDifferentialPriceParams(TypedDict): - ItemPriceId: NotRequired[Filters.StringFilter] - Id: NotRequired[Filters.StringFilter] - ParentItemId: NotRequired[Filters.StringFilter] - - -class PriceVariantsPriceVariantParams(TypedDict): - Id: NotRequired[Filters.StringFilter] - Name: NotRequired[Filters.StringFilter] - Status: NotRequired[Filters.EnumFilter] - UpdatedAt: NotRequired[Filters.TimestampFilter] - CreatedAt: NotRequired[Filters.TimestampFilter] diff --git a/chargebee/models/feature/__init__.py b/chargebee/models/feature/__init__.py index 02550c6..4349fa3 100644 --- a/chargebee/models/feature/__init__.py +++ b/chargebee/models/feature/__init__.py @@ -1,3 +1,2 @@ from .operations import Feature from .responses import FeatureResponse -from .types import Level, Status, Type diff --git a/chargebee/models/feature/operations.py b/chargebee/models/feature/operations.py index a4fd6c6..d76fc94 100644 --- a/chargebee/models/feature/operations.py +++ b/chargebee/models/feature/operations.py @@ -1,11 +1,45 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class Feature: + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DRAFT = "draft" + + def __str__(self): + return self.value + + class Type(Enum): + SWITCH = "switch" + CUSTOM = "custom" + QUANTITY = "quantity" + RANGE = "range" + + def __str__(self): + return self.value + + class Level(TypedDict): + name: NotRequired[str] + value: Required[str] + level: Required[int] + is_unlimited: Required[bool] + + class CreateLevelParams(TypedDict): + name: NotRequired[str] + value: NotRequired[str] + is_unlimited: NotRequired[bool] + level: NotRequired[int] + + class UpdateLevelParams(TypedDict): + name: NotRequired[str] + value: NotRequired[str] + is_unlimited: NotRequired[bool] + level: NotRequired[int] class ListParams(TypedDict): limit: NotRequired[int] @@ -19,15 +53,15 @@ class CreateParams(TypedDict): id: NotRequired[str] name: Required[str] description: NotRequired[str] - type: NotRequired[Type] + type: NotRequired["Feature.Type"] unit: NotRequired[str] - levels: NotRequired[List[CreateLevelParams]] + levels: NotRequired[List["Feature.CreateLevelParams"]] class UpdateParams(TypedDict): name: NotRequired[str] description: NotRequired[str] unit: NotRequired[str] - levels: NotRequired[List[UpdateLevelParams]] + levels: NotRequired[List["Feature.UpdateLevelParams"]] @staticmethod def list(params: ListParams = None, env=None, headers=None) -> ListResponse: diff --git a/chargebee/models/feature/types.py b/chargebee/models/feature/types.py deleted file mode 100644 index df48170..0000000 --- a/chargebee/models/feature/types.py +++ /dev/null @@ -1,42 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DRAFT = "draft" - - def __str__(self): - return self.value - - -class Type(Enum): - SWITCH = "switch" - CUSTOM = "custom" - QUANTITY = "quantity" - RANGE = "range" - - def __str__(self): - return self.value - - -class Level(TypedDict): - name: NotRequired[str] - value: Required[str] - level: Required[int] - is_unlimited: Required[bool] - - -class CreateLevelParams(TypedDict): - name: NotRequired[str] - value: NotRequired[str] - is_unlimited: NotRequired[bool] - level: NotRequired[int] - - -class UpdateLevelParams(TypedDict): - name: NotRequired[str] - value: NotRequired[str] - is_unlimited: NotRequired[bool] - level: NotRequired[int] diff --git a/chargebee/models/gateway_error_detail/operations.py b/chargebee/models/gateway_error_detail/operations.py index cd40c4d..7e61c88 100644 --- a/chargebee/models/gateway_error_detail/operations.py +++ b/chargebee/models/gateway_error_detail/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class GatewayErrorDetail: diff --git a/chargebee/models/gateway_error_detail/types.py b/chargebee/models/gateway_error_detail/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/gateway_error_detail/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/gift/__init__.py b/chargebee/models/gift/__init__.py index b2a7065..f68256d 100644 --- a/chargebee/models/gift/__init__.py +++ b/chargebee/models/gift/__init__.py @@ -1,3 +1,2 @@ from .operations import Gift from .responses import GiftResponse -from .types import Gifter, GiftReceiver, GiftTimeline, Status diff --git a/chargebee/models/gift/operations.py b/chargebee/models/gift/operations.py index 0ba298e..77f8f32 100644 --- a/chargebee/models/gift/operations.py +++ b/chargebee/models/gift/operations.py @@ -1,41 +1,171 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import enums, payment_intent class Gift: + class Status(Enum): + SCHEDULED = "scheduled" + UNCLAIMED = "unclaimed" + CLAIMED = "claimed" + CANCELLED = "cancelled" + EXPIRED = "expired" + + def __str__(self): + return self.value + + class Gifter(TypedDict): + customer_id: Required[str] + invoice_id: NotRequired[str] + signature: NotRequired[str] + note: NotRequired[str] + + class GiftReceiver(TypedDict): + customer_id: Required[str] + subscription_id: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + + class GiftTimeline(TypedDict): + status: Required["Gift.Status"] + occurred_at: NotRequired[int] + + class CreateGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + class CreateGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + + class CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class CreateForItemsGifterParams(TypedDict): + customer_id: Required[str] + signature: Required[str] + note: NotRequired[str] + payment_src_id: NotRequired[str] + + class CreateForItemsGiftReceiverParams(TypedDict): + customer_id: Required[str] + first_name: Required[str] + last_name: Required[str] + email: Required[str] + + class CreateForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class ListGiftReceiverParams(TypedDict): + email: NotRequired[Filters.StringFilter] + customer_id: NotRequired[Filters.StringFilter] + + class ListGifterParams(TypedDict): + customer_id: NotRequired[Filters.StringFilter] class CreateParams(TypedDict): scheduled_at: NotRequired[int] auto_claim: NotRequired[bool] no_expiry: NotRequired[bool] claim_expiry_date: NotRequired[int] - gifter: Required[CreateGifterParams] - gift_receiver: Required[CreateGiftReceiverParams] + gifter: Required["Gift.CreateGifterParams"] + gift_receiver: Required["Gift.CreateGiftReceiverParams"] coupon_ids: NotRequired[List[str]] - payment_intent: NotRequired[CreatePaymentIntentParams] - shipping_address: NotRequired[CreateShippingAddressParams] - subscription: Required[CreateSubscriptionParams] - addons: NotRequired[List[CreateAddonParams]] + payment_intent: NotRequired["Gift.CreatePaymentIntentParams"] + shipping_address: NotRequired["Gift.CreateShippingAddressParams"] + subscription: Required["Gift.CreateSubscriptionParams"] + addons: NotRequired[List["Gift.CreateAddonParams"]] class CreateForItemsParams(TypedDict): scheduled_at: NotRequired[int] auto_claim: NotRequired[bool] no_expiry: NotRequired[bool] claim_expiry_date: NotRequired[int] - gifter: Required[CreateForItemsGifterParams] - gift_receiver: Required[CreateForItemsGiftReceiverParams] + gifter: Required["Gift.CreateForItemsGifterParams"] + gift_receiver: Required["Gift.CreateForItemsGiftReceiverParams"] coupon_ids: NotRequired[List[str]] - payment_intent: NotRequired[CreateForItemsPaymentIntentParams] - shipping_address: NotRequired[CreateForItemsShippingAddressParams] - subscription_items: NotRequired[List[CreateForItemsSubscriptionItemParams]] + payment_intent: NotRequired["Gift.CreateForItemsPaymentIntentParams"] + shipping_address: NotRequired["Gift.CreateForItemsShippingAddressParams"] + subscription_items: NotRequired[ + List["Gift.CreateForItemsSubscriptionItemParams"] + ] class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] - gift_receiver: NotRequired[ListGiftReceiverParams] - gifter: NotRequired[ListGifterParams] + gift_receiver: NotRequired["Gift.ListGiftReceiverParams"] + gifter: NotRequired["Gift.ListGifterParams"] status: NotRequired[Filters.EnumFilter] class UpdateGiftParams(TypedDict): diff --git a/chargebee/models/gift/types.py b/chargebee/models/gift/types.py deleted file mode 100644 index 21613de..0000000 --- a/chargebee/models/gift/types.py +++ /dev/null @@ -1,144 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.filters import Filters -from chargebee.models import enums, payment_intent - - -class Status(Enum): - SCHEDULED = "scheduled" - UNCLAIMED = "unclaimed" - CLAIMED = "claimed" - CANCELLED = "cancelled" - EXPIRED = "expired" - - def __str__(self): - return self.value - - -class Gifter(TypedDict): - customer_id: Required[str] - invoice_id: NotRequired[str] - signature: NotRequired[str] - note: NotRequired[str] - - -class GiftReceiver(TypedDict): - customer_id: Required[str] - subscription_id: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - - -class GiftTimeline(TypedDict): - status: Required[Status] - occurred_at: NotRequired[int] - - -class CreateGifterParams(TypedDict): - customer_id: Required[str] - signature: Required[str] - note: NotRequired[str] - payment_src_id: NotRequired[str] - - -class CreateGiftReceiverParams(TypedDict): - customer_id: Required[str] - first_name: Required[str] - last_name: Required[str] - email: Required[str] - - -class CreatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubscriptionParams(TypedDict): - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - - -class CreateAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class CreateForItemsGifterParams(TypedDict): - customer_id: Required[str] - signature: Required[str] - note: NotRequired[str] - payment_src_id: NotRequired[str] - - -class CreateForItemsGiftReceiverParams(TypedDict): - customer_id: Required[str] - first_name: Required[str] - last_name: Required[str] - email: Required[str] - - -class CreateForItemsPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForItemsSubscriptionItemParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class ListGiftReceiverParams(TypedDict): - Email: NotRequired[Filters.StringFilter] - CustomerId: NotRequired[Filters.StringFilter] - - -class ListGifterParams(TypedDict): - CustomerId: NotRequired[Filters.StringFilter] diff --git a/chargebee/models/hierarchy/operations.py b/chargebee/models/hierarchy/operations.py index e1267a8..0682ffa 100644 --- a/chargebee/models/hierarchy/operations.py +++ b/chargebee/models/hierarchy/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class Hierarchy: diff --git a/chargebee/models/hierarchy/types.py b/chargebee/models/hierarchy/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/hierarchy/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/hosted_page/__init__.py b/chargebee/models/hosted_page/__init__.py index 948a035..5fc8a81 100644 --- a/chargebee/models/hosted_page/__init__.py +++ b/chargebee/models/hosted_page/__init__.py @@ -1,3 +1,2 @@ from .operations import HostedPage from .responses import HostedPageResponse -from .types import Type, State, FailureReason diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index 36da927..2ea4959 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -1,101 +1,717 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, contract_term class HostedPage: + class Type(Enum): + CHECKOUT_NEW = "checkout_new" + CHECKOUT_EXISTING = "checkout_existing" + UPDATE_PAYMENT_METHOD = "update_payment_method" + MANAGE_PAYMENT_SOURCES = "manage_payment_sources" + COLLECT_NOW = "collect_now" + EXTEND_SUBSCRIPTION = "extend_subscription" + CHECKOUT_ONE_TIME = "checkout_one_time" + PRE_CANCEL = "pre_cancel" + VIEW_VOUCHER = "view_voucher" + CHECKOUT_GIFT = "checkout_gift" + CLAIM_GIFT = "claim_gift" + + def __str__(self): + return self.value + + class State(Enum): + CREATED = "created" + REQUESTED = "requested" + SUCCEEDED = "succeeded" + CANCELLED = "cancelled" + ACKNOWLEDGED = "acknowledged" + + def __str__(self): + return self.value + + class FailureReason(Enum): + CARD_ERROR = "card_error" + SERVER_ERROR = "server_error" + + def __str__(self): + return self.value + + class CheckoutNewSubscriptionParams(TypedDict): + id: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + affiliate_token: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CheckoutNewCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + class CheckoutNewAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + class CheckoutNewEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CheckoutNewCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutNewBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutNewShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutNewContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CheckoutOneTimeCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + class CheckoutOneTimeAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CheckoutOneTimeChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CheckoutOneTimeInvoiceParams(TypedDict): + po_number: NotRequired[str] + + class CheckoutOneTimeCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutOneTimeBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutOneTimeShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutOneTimeForItemsCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + consolidated_invoicing: NotRequired[bool] + + class CheckoutOneTimeForItemsItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CheckoutOneTimeForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CheckoutOneTimeForItemsChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CheckoutOneTimeForItemsDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + class CheckoutOneTimeForItemsInvoiceParams(TypedDict): + po_number: NotRequired[str] + + class CheckoutOneTimeForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutOneTimeForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + class CheckoutOneTimeForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutOneTimeForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutNewForItemsSubscriptionParams(TypedDict): + id: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CheckoutNewForItemsCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + + class CheckoutNewForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class CheckoutNewForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class CheckoutNewForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CheckoutNewForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutNewForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + class CheckoutNewForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutNewForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CheckoutNewForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CheckoutExistingSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CheckoutExistingAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class CheckoutExistingEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class CheckoutExistingCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + class CheckoutExistingCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutExistingContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CheckoutExistingForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + invoice_notes: NotRequired[str] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CheckoutExistingForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + class CheckoutExistingForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + class CheckoutExistingForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CheckoutExistingForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + + class CheckoutExistingForItemsEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + operation: NotRequired[enums.Operation] + standard: NotRequired[str] + + class CheckoutExistingForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CheckoutExistingForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class UpdateCardCustomerParams(TypedDict): + id: Required[str] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + class UpdateCardCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class UpdatePaymentMethodCustomerParams(TypedDict): + id: Required[str] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + class UpdatePaymentMethodCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class ManagePaymentSourcesCustomerParams(TypedDict): + id: Required[str] + + class ManagePaymentSourcesCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class CollectNowCustomerParams(TypedDict): + id: Required[str] + + class CollectNowCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + + class AcceptQuoteQuoteParams(TypedDict): + id: Required[str] + + class ExtendSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + + class CheckoutGiftGifterParams(TypedDict): + customer_id: NotRequired[str] + + class CheckoutGiftSubscriptionParams(TypedDict): + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + coupon: NotRequired[str] + + class CheckoutGiftAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class CheckoutGiftForItemsGifterParams(TypedDict): + customer_id: NotRequired[str] + + class CheckoutGiftForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + + class ClaimGiftGiftParams(TypedDict): + id: Required[str] + + class ClaimGiftCustomerParams(TypedDict): + locale: NotRequired[str] + + class PreCancelSubscriptionParams(TypedDict): + id: Required[str] + + class ViewVoucherPaymentVoucherParams(TypedDict): + id: Required[str] + + class ViewVoucherCustomerParams(TypedDict): + locale: NotRequired[str] class CheckoutNewParams(TypedDict): - subscription: Required[CheckoutNewSubscriptionParams] - customer: NotRequired[CheckoutNewCustomerParams] + subscription: Required["HostedPage.CheckoutNewSubscriptionParams"] + customer: NotRequired["HostedPage.CheckoutNewCustomerParams"] billing_cycles: NotRequired[int] - addons: NotRequired[List[CheckoutNewAddonParams]] - event_based_addons: NotRequired[List[CheckoutNewEventBasedAddonParams]] + addons: NotRequired[List["HostedPage.CheckoutNewAddonParams"]] + event_based_addons: NotRequired[ + List["HostedPage.CheckoutNewEventBasedAddonParams"] + ] mandatory_addons_to_remove: NotRequired[List[str]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] - card: NotRequired[CheckoutNewCardParams] + card: NotRequired["HostedPage.CheckoutNewCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] embed: NotRequired[bool] iframe_messaging: NotRequired[bool] allow_offline_payment_methods: NotRequired[bool] - billing_address: NotRequired[CheckoutNewBillingAddressParams] - shipping_address: NotRequired[CheckoutNewShippingAddressParams] - contract_term: NotRequired[CheckoutNewContractTermParams] + billing_address: NotRequired["HostedPage.CheckoutNewBillingAddressParams"] + shipping_address: NotRequired["HostedPage.CheckoutNewShippingAddressParams"] + contract_term: NotRequired["HostedPage.CheckoutNewContractTermParams"] class CheckoutOneTimeParams(TypedDict): - customer: NotRequired[CheckoutOneTimeCustomerParams] - addons: NotRequired[List[CheckoutOneTimeAddonParams]] + customer: NotRequired["HostedPage.CheckoutOneTimeCustomerParams"] + addons: NotRequired[List["HostedPage.CheckoutOneTimeAddonParams"]] currency_code: NotRequired[str] - charges: NotRequired[List[CheckoutOneTimeChargeParams]] + charges: NotRequired[List["HostedPage.CheckoutOneTimeChargeParams"]] invoice_note: NotRequired[str] - invoice: NotRequired[CheckoutOneTimeInvoiceParams] + invoice: NotRequired["HostedPage.CheckoutOneTimeInvoiceParams"] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] - card: NotRequired[CheckoutOneTimeCardParams] + card: NotRequired["HostedPage.CheckoutOneTimeCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] embed: NotRequired[bool] iframe_messaging: NotRequired[bool] - billing_address: NotRequired[CheckoutOneTimeBillingAddressParams] - shipping_address: NotRequired[CheckoutOneTimeShippingAddressParams] + billing_address: NotRequired["HostedPage.CheckoutOneTimeBillingAddressParams"] + shipping_address: NotRequired["HostedPage.CheckoutOneTimeShippingAddressParams"] class CheckoutOneTimeForItemsParams(TypedDict): business_entity_id: NotRequired[str] layout: NotRequired[enums.Layout] - customer: NotRequired[CheckoutOneTimeForItemsCustomerParams] - item_prices: NotRequired[List[CheckoutOneTimeForItemsItemPriceParams]] - item_tiers: NotRequired[List[CheckoutOneTimeForItemsItemTierParams]] - charges: NotRequired[List[CheckoutOneTimeForItemsChargeParams]] - discounts: Required[List[CheckoutOneTimeForItemsDiscountParams]] + customer: NotRequired["HostedPage.CheckoutOneTimeForItemsCustomerParams"] + item_prices: NotRequired[ + List["HostedPage.CheckoutOneTimeForItemsItemPriceParams"] + ] + item_tiers: NotRequired[ + List["HostedPage.CheckoutOneTimeForItemsItemTierParams"] + ] + charges: NotRequired[List["HostedPage.CheckoutOneTimeForItemsChargeParams"]] + discounts: Required[List["HostedPage.CheckoutOneTimeForItemsDiscountParams"]] invoice_note: NotRequired[str] - invoice: NotRequired[CheckoutOneTimeForItemsInvoiceParams] + invoice: NotRequired["HostedPage.CheckoutOneTimeForItemsInvoiceParams"] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] currency_code: NotRequired[str] - card: NotRequired[CheckoutOneTimeForItemsCardParams] + card: NotRequired["HostedPage.CheckoutOneTimeForItemsCardParams"] entity_identifiers: NotRequired[ - List[CheckoutOneTimeForItemsEntityIdentifierParams] + List["HostedPage.CheckoutOneTimeForItemsEntityIdentifierParams"] ] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] - billing_address: NotRequired[CheckoutOneTimeForItemsBillingAddressParams] - shipping_address: NotRequired[CheckoutOneTimeForItemsShippingAddressParams] + billing_address: NotRequired[ + "HostedPage.CheckoutOneTimeForItemsBillingAddressParams" + ] + shipping_address: NotRequired[ + "HostedPage.CheckoutOneTimeForItemsShippingAddressParams" + ] class CheckoutNewForItemsParams(TypedDict): - subscription: NotRequired[CheckoutNewForItemsSubscriptionParams] + subscription: NotRequired["HostedPage.CheckoutNewForItemsSubscriptionParams"] layout: NotRequired[enums.Layout] - customer: NotRequired[CheckoutNewForItemsCustomerParams] + customer: NotRequired["HostedPage.CheckoutNewForItemsCustomerParams"] business_entity_id: NotRequired[str] billing_cycles: NotRequired[int] - subscription_items: Required[List[CheckoutNewForItemsSubscriptionItemParams]] - discounts: Required[List[CheckoutNewForItemsDiscountParams]] + subscription_items: Required[ + List["HostedPage.CheckoutNewForItemsSubscriptionItemParams"] + ] + discounts: Required[List["HostedPage.CheckoutNewForItemsDiscountParams"]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[CheckoutNewForItemsItemTierParams]] + item_tiers: NotRequired[List["HostedPage.CheckoutNewForItemsItemTierParams"]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] - card: NotRequired[CheckoutNewForItemsCardParams] - entity_identifiers: NotRequired[List[CheckoutNewForItemsEntityIdentifierParams]] + card: NotRequired["HostedPage.CheckoutNewForItemsCardParams"] + entity_identifiers: NotRequired[ + List["HostedPage.CheckoutNewForItemsEntityIdentifierParams"] + ] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] allow_offline_payment_methods: NotRequired[bool] - billing_address: NotRequired[CheckoutNewForItemsBillingAddressParams] - shipping_address: NotRequired[CheckoutNewForItemsShippingAddressParams] - contract_term: NotRequired[CheckoutNewForItemsContractTermParams] + billing_address: NotRequired[ + "HostedPage.CheckoutNewForItemsBillingAddressParams" + ] + shipping_address: NotRequired[ + "HostedPage.CheckoutNewForItemsShippingAddressParams" + ] + contract_term: NotRequired["HostedPage.CheckoutNewForItemsContractTermParams"] class CheckoutExistingParams(TypedDict): - subscription: Required[CheckoutExistingSubscriptionParams] - addons: NotRequired[List[CheckoutExistingAddonParams]] - event_based_addons: NotRequired[List[CheckoutExistingEventBasedAddonParams]] + subscription: Required["HostedPage.CheckoutExistingSubscriptionParams"] + addons: NotRequired[List["HostedPage.CheckoutExistingAddonParams"]] + event_based_addons: NotRequired[ + List["HostedPage.CheckoutExistingEventBasedAddonParams"] + ] replace_addon_list: NotRequired[bool] mandatory_addons_to_remove: NotRequired[List[str]] invoice_date: NotRequired[int] @@ -106,26 +722,28 @@ class CheckoutExistingParams(TypedDict): coupon_ids: NotRequired[List[str]] reactivate: NotRequired[bool] force_term_reset: NotRequired[bool] - customer: NotRequired[CheckoutExistingCustomerParams] - card: NotRequired[CheckoutExistingCardParams] + customer: NotRequired["HostedPage.CheckoutExistingCustomerParams"] + card: NotRequired["HostedPage.CheckoutExistingCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] embed: NotRequired[bool] iframe_messaging: NotRequired[bool] allow_offline_payment_methods: NotRequired[bool] - contract_term: NotRequired[CheckoutExistingContractTermParams] + contract_term: NotRequired["HostedPage.CheckoutExistingContractTermParams"] class CheckoutExistingForItemsParams(TypedDict): layout: NotRequired[enums.Layout] - subscription: Required[CheckoutExistingForItemsSubscriptionParams] + subscription: Required["HostedPage.CheckoutExistingForItemsSubscriptionParams"] subscription_items: Required[ - List[CheckoutExistingForItemsSubscriptionItemParams] + List["HostedPage.CheckoutExistingForItemsSubscriptionItemParams"] ] mandatory_items_to_remove: NotRequired[List[str]] replace_items_list: NotRequired[bool] - discounts: Required[List[CheckoutExistingForItemsDiscountParams]] - item_tiers: NotRequired[List[CheckoutExistingForItemsItemTierParams]] + discounts: Required[List["HostedPage.CheckoutExistingForItemsDiscountParams"]] + item_tiers: NotRequired[ + List["HostedPage.CheckoutExistingForItemsItemTierParams"] + ] invoice_date: NotRequired[int] billing_cycles: NotRequired[int] terms_to_charge: NotRequired[int] @@ -136,20 +754,22 @@ class CheckoutExistingForItemsParams(TypedDict): force_term_reset: NotRequired[bool] change_option: NotRequired[enums.ChangeOption] changes_scheduled_at: NotRequired[int] - customer: NotRequired[CheckoutExistingForItemsCustomerParams] + customer: NotRequired["HostedPage.CheckoutExistingForItemsCustomerParams"] entity_identifiers: NotRequired[ - List[CheckoutExistingForItemsEntityIdentifierParams] + List["HostedPage.CheckoutExistingForItemsEntityIdentifierParams"] ] - card: NotRequired[CheckoutExistingForItemsCardParams] + card: NotRequired["HostedPage.CheckoutExistingForItemsCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] allow_offline_payment_methods: NotRequired[bool] - contract_term: NotRequired[CheckoutExistingForItemsContractTermParams] + contract_term: NotRequired[ + "HostedPage.CheckoutExistingForItemsContractTermParams" + ] class UpdateCardParams(TypedDict): - customer: Required[UpdateCardCustomerParams] - card: NotRequired[UpdateCardCardParams] + customer: Required["HostedPage.UpdateCardCustomerParams"] + card: NotRequired["HostedPage.UpdateCardCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] @@ -157,8 +777,8 @@ class UpdateCardParams(TypedDict): iframe_messaging: NotRequired[bool] class UpdatePaymentMethodParams(TypedDict): - customer: Required[UpdatePaymentMethodCustomerParams] - card: NotRequired[UpdatePaymentMethodCardParams] + customer: Required["HostedPage.UpdatePaymentMethodCustomerParams"] + card: NotRequired["HostedPage.UpdatePaymentMethodCardParams"] redirect_url: NotRequired[str] cancel_url: NotRequired[str] pass_thru_content: NotRequired[str] @@ -166,46 +786,46 @@ class UpdatePaymentMethodParams(TypedDict): iframe_messaging: NotRequired[bool] class ManagePaymentSourcesParams(TypedDict): - customer: Required[ManagePaymentSourcesCustomerParams] + customer: Required["HostedPage.ManagePaymentSourcesCustomerParams"] redirect_url: NotRequired[str] - card: NotRequired[ManagePaymentSourcesCardParams] + card: NotRequired["HostedPage.ManagePaymentSourcesCardParams"] class CollectNowParams(TypedDict): - customer: Required[CollectNowCustomerParams] + customer: Required["HostedPage.CollectNowCustomerParams"] redirect_url: NotRequired[str] - card: NotRequired[CollectNowCardParams] + card: NotRequired["HostedPage.CollectNowCardParams"] currency_code: NotRequired[str] class AcceptQuoteParams(TypedDict): - quote: Required[AcceptQuoteQuoteParams] + quote: Required["HostedPage.AcceptQuoteQuoteParams"] redirect_url: NotRequired[str] layout: NotRequired[enums.Layout] class ExtendSubscriptionParams(TypedDict): - subscription: Required[ExtendSubscriptionSubscriptionParams] + subscription: Required["HostedPage.ExtendSubscriptionSubscriptionParams"] expiry: NotRequired[int] billing_cycle: NotRequired[int] class CheckoutGiftParams(TypedDict): - gifter: NotRequired[CheckoutGiftGifterParams] + gifter: NotRequired["HostedPage.CheckoutGiftGifterParams"] redirect_url: NotRequired[str] - subscription: Required[CheckoutGiftSubscriptionParams] - addons: NotRequired[List[CheckoutGiftAddonParams]] + subscription: Required["HostedPage.CheckoutGiftSubscriptionParams"] + addons: NotRequired[List["HostedPage.CheckoutGiftAddonParams"]] coupon_ids: NotRequired[List[str]] class CheckoutGiftForItemsParams(TypedDict): business_entity_id: NotRequired[str] - gifter: NotRequired[CheckoutGiftForItemsGifterParams] + gifter: NotRequired["HostedPage.CheckoutGiftForItemsGifterParams"] redirect_url: NotRequired[str] subscription_items: NotRequired[ - List[CheckoutGiftForItemsSubscriptionItemParams] + List["HostedPage.CheckoutGiftForItemsSubscriptionItemParams"] ] coupon_ids: NotRequired[List[str]] class ClaimGiftParams(TypedDict): - gift: Required[ClaimGiftGiftParams] + gift: Required["HostedPage.ClaimGiftGiftParams"] redirect_url: NotRequired[str] - customer: NotRequired[ClaimGiftCustomerParams] + customer: NotRequired["HostedPage.ClaimGiftCustomerParams"] class RetrieveAgreementPdfParams(TypedDict): payment_source_id: Required[str] @@ -219,7 +839,7 @@ class ListParams(TypedDict): updated_at: NotRequired[Filters.TimestampFilter] class PreCancelParams(TypedDict): - subscription: Required[PreCancelSubscriptionParams] + subscription: Required["HostedPage.PreCancelSubscriptionParams"] pass_thru_content: NotRequired[str] cancel_url: NotRequired[str] redirect_url: NotRequired[str] @@ -230,8 +850,8 @@ class EventsParams(TypedDict): event_data: Required[Dict[Any, Any]] class ViewVoucherParams(TypedDict): - payment_voucher: Required[ViewVoucherPaymentVoucherParams] - customer: NotRequired[ViewVoucherCustomerParams] + payment_voucher: Required["HostedPage.ViewVoucherPaymentVoucherParams"] + customer: NotRequired["HostedPage.ViewVoucherCustomerParams"] @staticmethod def checkout_new( diff --git a/chargebee/models/hosted_page/types.py b/chargebee/models/hosted_page/types.py deleted file mode 100644 index 5a0acbc..0000000 --- a/chargebee/models/hosted_page/types.py +++ /dev/null @@ -1,671 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, contract_term - - -class Type(Enum): - CHECKOUT_NEW = "checkout_new" - CHECKOUT_EXISTING = "checkout_existing" - UPDATE_PAYMENT_METHOD = "update_payment_method" - MANAGE_PAYMENT_SOURCES = "manage_payment_sources" - COLLECT_NOW = "collect_now" - EXTEND_SUBSCRIPTION = "extend_subscription" - CHECKOUT_ONE_TIME = "checkout_one_time" - PRE_CANCEL = "pre_cancel" - VIEW_VOUCHER = "view_voucher" - CHECKOUT_GIFT = "checkout_gift" - CLAIM_GIFT = "claim_gift" - - def __str__(self): - return self.value - - -class State(Enum): - CREATED = "created" - REQUESTED = "requested" - SUCCEEDED = "succeeded" - CANCELLED = "cancelled" - ACKNOWLEDGED = "acknowledged" - - def __str__(self): - return self.value - - -class FailureReason(Enum): - CARD_ERROR = "card_error" - SERVER_ERROR = "server_error" - - def __str__(self): - return self.value - - -class CheckoutNewSubscriptionParams(TypedDict): - id: NotRequired[str] - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price: NotRequired[int] - plan_unit_price_in_decimal: NotRequired[str] - setup_fee: NotRequired[int] - trial_end: NotRequired[int] - start_date: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - invoice_notes: NotRequired[str] - affiliate_token: NotRequired[str] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CheckoutNewCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - consolidated_invoicing: NotRequired[bool] - - -class CheckoutNewAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - - -class CheckoutNewEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CheckoutNewCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutNewBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutNewShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutNewContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CheckoutOneTimeCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - consolidated_invoicing: NotRequired[bool] - - -class CheckoutOneTimeAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CheckoutOneTimeChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CheckoutOneTimeInvoiceParams(TypedDict): - po_number: NotRequired[str] - - -class CheckoutOneTimeCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutOneTimeBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutOneTimeShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutOneTimeForItemsCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - is_einvoice_enabled: NotRequired[bool] - entity_identifier_scheme: NotRequired[str] - entity_identifier_standard: NotRequired[str] - consolidated_invoicing: NotRequired[bool] - - -class CheckoutOneTimeForItemsItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CheckoutOneTimeForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CheckoutOneTimeForItemsChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CheckoutOneTimeForItemsDiscountParams(TypedDict): - percentage: NotRequired[float] - amount: NotRequired[int] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - - -class CheckoutOneTimeForItemsInvoiceParams(TypedDict): - po_number: NotRequired[str] - - -class CheckoutOneTimeForItemsCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutOneTimeForItemsEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - operation: NotRequired[enums.Operation] - standard: NotRequired[str] - - -class CheckoutOneTimeForItemsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutOneTimeForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutNewForItemsSubscriptionParams(TypedDict): - id: NotRequired[str] - trial_end: NotRequired[int] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - invoice_notes: NotRequired[str] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CheckoutNewForItemsCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - is_einvoice_enabled: NotRequired[bool] - entity_identifier_scheme: NotRequired[str] - entity_identifier_standard: NotRequired[str] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - - -class CheckoutNewForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class CheckoutNewForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class CheckoutNewForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CheckoutNewForItemsCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutNewForItemsEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - operation: NotRequired[enums.Operation] - standard: NotRequired[str] - - -class CheckoutNewForItemsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutNewForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CheckoutNewForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CheckoutExistingSubscriptionParams(TypedDict): - id: Required[str] - plan_id: NotRequired[str] - plan_quantity: NotRequired[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - invoice_notes: NotRequired[str] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CheckoutExistingAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class CheckoutExistingEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - charge_on: NotRequired[enums.ChargeOn] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class CheckoutExistingCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - - -class CheckoutExistingCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutExistingContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CheckoutExistingForItemsSubscriptionParams(TypedDict): - id: Required[str] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - invoice_notes: NotRequired[str] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CheckoutExistingForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - charge_on_option: NotRequired[enums.ChargeOnOption] - item_type: NotRequired[enums.ItemType] - - -class CheckoutExistingForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - operation_type: Required[enums.OperationType] - id: NotRequired[str] - - -class CheckoutExistingForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CheckoutExistingForItemsCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - is_einvoice_enabled: NotRequired[bool] - entity_identifier_scheme: NotRequired[str] - entity_identifier_standard: NotRequired[str] - - -class CheckoutExistingForItemsEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - operation: NotRequired[enums.Operation] - standard: NotRequired[str] - - -class CheckoutExistingForItemsCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CheckoutExistingForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class UpdateCardCustomerParams(TypedDict): - id: Required[str] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - - -class UpdateCardCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class UpdatePaymentMethodCustomerParams(TypedDict): - id: Required[str] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - - -class UpdatePaymentMethodCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class ManagePaymentSourcesCustomerParams(TypedDict): - id: Required[str] - - -class ManagePaymentSourcesCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class CollectNowCustomerParams(TypedDict): - id: Required[str] - - -class CollectNowCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - - -class AcceptQuoteQuoteParams(TypedDict): - id: Required[str] - - -class ExtendSubscriptionSubscriptionParams(TypedDict): - id: Required[str] - - -class CheckoutGiftGifterParams(TypedDict): - customer_id: NotRequired[str] - - -class CheckoutGiftSubscriptionParams(TypedDict): - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - coupon: NotRequired[str] - - -class CheckoutGiftAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class CheckoutGiftForItemsGifterParams(TypedDict): - customer_id: NotRequired[str] - - -class CheckoutGiftForItemsSubscriptionItemParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - - -class ClaimGiftGiftParams(TypedDict): - id: Required[str] - - -class ClaimGiftCustomerParams(TypedDict): - locale: NotRequired[str] - - -class PreCancelSubscriptionParams(TypedDict): - id: Required[str] - - -class ViewVoucherPaymentVoucherParams(TypedDict): - id: Required[str] - - -class ViewVoucherCustomerParams(TypedDict): - locale: NotRequired[str] diff --git a/chargebee/models/impacted_item/__init__.py b/chargebee/models/impacted_item/__init__.py index 9d82cd3..a45ea56 100644 --- a/chargebee/models/impacted_item/__init__.py +++ b/chargebee/models/impacted_item/__init__.py @@ -1,3 +1,2 @@ from .operations import ImpactedItem from .responses import ImpactedItemResponse -from .types import Download diff --git a/chargebee/models/impacted_item/operations.py b/chargebee/models/impacted_item/operations.py index 55da9fb..7c4afb7 100644 --- a/chargebee/models/impacted_item/operations.py +++ b/chargebee/models/impacted_item/operations.py @@ -1,9 +1,13 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class ImpactedItem: + class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + pass diff --git a/chargebee/models/impacted_item/types.py b/chargebee/models/impacted_item/types.py deleted file mode 100644 index 1e17062..0000000 --- a/chargebee/models/impacted_item/types.py +++ /dev/null @@ -1,7 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Download(TypedDict): - download_url: Required[str] - valid_till: Required[int] - mime_type: NotRequired[str] diff --git a/chargebee/models/impacted_item_price/__init__.py b/chargebee/models/impacted_item_price/__init__.py index eaf18bc..a9825ab 100644 --- a/chargebee/models/impacted_item_price/__init__.py +++ b/chargebee/models/impacted_item_price/__init__.py @@ -1,3 +1,2 @@ from .operations import ImpactedItemPrice from .responses import ImpactedItemPriceResponse -from .types import Download diff --git a/chargebee/models/impacted_item_price/operations.py b/chargebee/models/impacted_item_price/operations.py index 62a9537..0752d07 100644 --- a/chargebee/models/impacted_item_price/operations.py +++ b/chargebee/models/impacted_item_price/operations.py @@ -1,9 +1,13 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class ImpactedItemPrice: + class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + pass diff --git a/chargebee/models/impacted_item_price/types.py b/chargebee/models/impacted_item_price/types.py deleted file mode 100644 index 1e17062..0000000 --- a/chargebee/models/impacted_item_price/types.py +++ /dev/null @@ -1,7 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Download(TypedDict): - download_url: Required[str] - valid_till: Required[int] - mime_type: NotRequired[str] diff --git a/chargebee/models/impacted_subscription/__init__.py b/chargebee/models/impacted_subscription/__init__.py index 46b10f6..e7e8269 100644 --- a/chargebee/models/impacted_subscription/__init__.py +++ b/chargebee/models/impacted_subscription/__init__.py @@ -1,3 +1,2 @@ from .operations import ImpactedSubscription from .responses import ImpactedSubscriptionResponse -from .types import Download diff --git a/chargebee/models/impacted_subscription/operations.py b/chargebee/models/impacted_subscription/operations.py index aed0e1f..6851388 100644 --- a/chargebee/models/impacted_subscription/operations.py +++ b/chargebee/models/impacted_subscription/operations.py @@ -1,9 +1,13 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class ImpactedSubscription: + class Download(TypedDict): + download_url: Required[str] + valid_till: Required[int] + mime_type: NotRequired[str] + pass diff --git a/chargebee/models/impacted_subscription/types.py b/chargebee/models/impacted_subscription/types.py deleted file mode 100644 index 1e17062..0000000 --- a/chargebee/models/impacted_subscription/types.py +++ /dev/null @@ -1,7 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any - - -class Download(TypedDict): - download_url: Required[str] - valid_till: Required[int] - mime_type: NotRequired[str] diff --git a/chargebee/models/in_app_subscription/__init__.py b/chargebee/models/in_app_subscription/__init__.py index da3ca00..8608154 100644 --- a/chargebee/models/in_app_subscription/__init__.py +++ b/chargebee/models/in_app_subscription/__init__.py @@ -1,3 +1,2 @@ from .operations import InAppSubscription from .responses import InAppSubscriptionResponse -from .types import StoreStatus diff --git a/chargebee/models/in_app_subscription/operations.py b/chargebee/models/in_app_subscription/operations.py index 9a0a0ca..a82b42f 100644 --- a/chargebee/models/in_app_subscription/operations.py +++ b/chargebee/models/in_app_subscription/operations.py @@ -1,24 +1,68 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class InAppSubscription: + class StoreStatus(Enum): + IN_TRIAL = "in_trial" + ACTIVE = "active" + CANCELLED = "cancelled" + PAUSED = "paused" + + def __str__(self): + return self.value + + class ProcessReceiptProductParams(TypedDict): + id: Required[str] + currency_code: Required[str] + price: Required[int] + name: NotRequired[str] + price_in_decimal: NotRequired[str] + period: NotRequired[str] + period_unit: NotRequired[str] + + class ProcessReceiptCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + + class ImportReceiptProductParams(TypedDict): + currency_code: Required[str] + + class ImportReceiptCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + + class ImportSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + started_at: Required[int] + term_start: Required[int] + term_end: Required[int] + product_id: Required[str] + currency_code: Required[str] + transaction_id: Required[str] + is_trial: NotRequired[bool] + + class ImportSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] class ProcessReceiptParams(TypedDict): receipt: Required[str] - product: Required[ProcessReceiptProductParams] - customer: NotRequired[ProcessReceiptCustomerParams] + product: Required["InAppSubscription.ProcessReceiptProductParams"] + customer: NotRequired["InAppSubscription.ProcessReceiptCustomerParams"] class ImportReceiptParams(TypedDict): receipt: Required[str] - product: Required[ImportReceiptProductParams] - customer: NotRequired[ImportReceiptCustomerParams] + product: Required["InAppSubscription.ImportReceiptProductParams"] + customer: NotRequired["InAppSubscription.ImportReceiptCustomerParams"] class ImportSubscriptionParams(TypedDict): - subscription: Required[ImportSubscriptionSubscriptionParams] - customer: NotRequired[ImportSubscriptionCustomerParams] + subscription: Required["InAppSubscription.ImportSubscriptionSubscriptionParams"] + customer: NotRequired["InAppSubscription.ImportSubscriptionCustomerParams"] class RetrieveStoreSubsParams(TypedDict): receipt: Required[str] diff --git a/chargebee/models/in_app_subscription/types.py b/chargebee/models/in_app_subscription/types.py deleted file mode 100644 index 04af273..0000000 --- a/chargebee/models/in_app_subscription/types.py +++ /dev/null @@ -1,54 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class StoreStatus(Enum): - IN_TRIAL = "in_trial" - ACTIVE = "active" - CANCELLED = "cancelled" - PAUSED = "paused" - - def __str__(self): - return self.value - - -class ProcessReceiptProductParams(TypedDict): - id: Required[str] - currency_code: Required[str] - price: Required[int] - name: NotRequired[str] - price_in_decimal: NotRequired[str] - period: NotRequired[str] - period_unit: NotRequired[str] - - -class ProcessReceiptCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - - -class ImportReceiptProductParams(TypedDict): - currency_code: Required[str] - - -class ImportReceiptCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - - -class ImportSubscriptionSubscriptionParams(TypedDict): - id: Required[str] - started_at: Required[int] - term_start: Required[int] - term_end: Required[int] - product_id: Required[str] - currency_code: Required[str] - transaction_id: Required[str] - is_trial: NotRequired[bool] - - -class ImportSubscriptionCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] diff --git a/chargebee/models/installment/__init__.py b/chargebee/models/installment/__init__.py index 2b1cf1b..62d4203 100644 --- a/chargebee/models/installment/__init__.py +++ b/chargebee/models/installment/__init__.py @@ -1,3 +1,2 @@ from .operations import Installment from .responses import InstallmentResponse -from .types import Status diff --git a/chargebee/models/installment/operations.py b/chargebee/models/installment/operations.py index 27253fd..5421973 100644 --- a/chargebee/models/installment/operations.py +++ b/chargebee/models/installment/operations.py @@ -1,11 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class Installment: + class Status(Enum): + POSTED = "posted" + PAYMENT_DUE = "payment_due" + PAID = "paid" + + def __str__(self): + return self.value class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/installment/types.py b/chargebee/models/installment/types.py deleted file mode 100644 index 0fb4c60..0000000 --- a/chargebee/models/installment/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - POSTED = "posted" - PAYMENT_DUE = "payment_due" - PAID = "paid" - - def __str__(self): - return self.value diff --git a/chargebee/models/installment_config/__init__.py b/chargebee/models/installment_config/__init__.py index 54eba36..8da266c 100644 --- a/chargebee/models/installment_config/__init__.py +++ b/chargebee/models/installment_config/__init__.py @@ -1,3 +1,2 @@ from .operations import InstallmentConfig from .responses import InstallmentConfigResponse -from .types import Installment, PeriodUnit diff --git a/chargebee/models/installment_config/operations.py b/chargebee/models/installment_config/operations.py index e752950..cb15c35 100644 --- a/chargebee/models/installment_config/operations.py +++ b/chargebee/models/installment_config/operations.py @@ -1,18 +1,33 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class InstallmentConfig: + class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + + def __str__(self): + return self.value + + class Installment(TypedDict): + period: NotRequired[int] + amount_percentage: NotRequired[float] + + class CreateInstallmentParams(TypedDict): + period: NotRequired[int] + amount_percentage: NotRequired[float] class CreateParams(TypedDict): number_of_installments: Required[int] - period_unit: Required[PeriodUnit] + period_unit: Required["InstallmentConfig.PeriodUnit"] period: NotRequired[int] preferred_day: NotRequired[int] description: NotRequired[str] - installments: NotRequired[List[CreateInstallmentParams]] + installments: NotRequired[List["InstallmentConfig.CreateInstallmentParams"]] @staticmethod def create(params: CreateParams, env=None, headers=None) -> CreateResponse: diff --git a/chargebee/models/installment_config/types.py b/chargebee/models/installment_config/types.py deleted file mode 100644 index 8710dd6..0000000 --- a/chargebee/models/installment_config/types.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class PeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - - def __str__(self): - return self.value - - -class Installment(TypedDict): - period: NotRequired[int] - amount_percentage: NotRequired[float] - - -class CreateInstallmentParams(TypedDict): - period: NotRequired[int] - amount_percentage: NotRequired[float] diff --git a/chargebee/models/installment_detail/__init__.py b/chargebee/models/installment_detail/__init__.py index f97e23f..45d1fea 100644 --- a/chargebee/models/installment_detail/__init__.py +++ b/chargebee/models/installment_detail/__init__.py @@ -1,3 +1,2 @@ from .operations import InstallmentDetail from .responses import InstallmentDetailResponse -from .types import Installment diff --git a/chargebee/models/installment_detail/operations.py b/chargebee/models/installment_detail/operations.py index fb7db5d..52b5164 100644 --- a/chargebee/models/installment_detail/operations.py +++ b/chargebee/models/installment_detail/operations.py @@ -1,9 +1,26 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class InstallmentDetail: + class InstallmentStatus(Enum): + POSTED = "posted" + PAYMENT_DUE = "payment_due" + PAID = "paid" + + def __str__(self): + return self.value + + class Installment(TypedDict): + id: Required[str] + invoice_id: Required[str] + date: Required[int] + amount: Required[int] + status: Required["InstallmentDetail.InstallmentStatus"] + created_at: Required[int] + resource_version: NotRequired[int] + updated_at: NotRequired[int] pass diff --git a/chargebee/models/installment_detail/types.py b/chargebee/models/installment_detail/types.py deleted file mode 100644 index 2c691c8..0000000 --- a/chargebee/models/installment_detail/types.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class InstallmentStatus(Enum): - POSTED = "posted" - PAYMENT_DUE = "payment_due" - PAID = "paid" - - def __str__(self): - return self.value - - -class Installment(TypedDict): - id: Required[str] - invoice_id: Required[str] - date: Required[int] - amount: Required[int] - status: Required[InstallmentStatus] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] diff --git a/chargebee/models/invoice/__init__.py b/chargebee/models/invoice/__init__.py index 4b2a293..3fa6dee 100644 --- a/chargebee/models/invoice/__init__.py +++ b/chargebee/models/invoice/__init__.py @@ -1,25 +1,2 @@ from .operations import Invoice from .responses import InvoiceResponse -from .types import ( - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - LineItemTier, - LinkedPayment, - DunningAttempt, - AppliedCredit, - AdjustmentCreditNote, - IssuedCreditNote, - LinkedOrder, - Note, - ShippingAddress, - StatementDescriptor, - BillingAddress, - Einvoice, - SiteDetailsAtCreation, - TaxOrigin, - Status, - DunningStatus, -) diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index 8db56d1..eebe46b 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -1,35 +1,821 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.filters import Filters +from chargebee.models import ( + enums, + credit_note, + payment_reference_number, + payment_intent, + transaction, +) class Invoice: + class Status(Enum): + PAID = "paid" + POSTED = "posted" + PAYMENT_DUE = "payment_due" + NOT_PAID = "not_paid" + VOIDED = "voided" + PENDING = "pending" + + def __str__(self): + return self.value + + class DunningStatus(Enum): + IN_PROGRESS = "in_progress" + EXHAUSTED = "exhausted" + STOPPED = "stopped" + SUCCESS = "success" + + def __str__(self): + return self.value + + class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LinkedOrderStatus(Enum): + NEW = "new" + PROCESSING = "processing" + COMPLETE = "complete" + CANCELLED = "cancelled" + VOIDED = "voided" + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + + def __str__(self): + return self.value + + class LinkedOrderOrderType(Enum): + MANUAL = "manual" + SYSTEM_GENERATED = "system_generated" + + def __str__(self): + return self.value + + class NoteEntityType(Enum): + COUPON = "coupon" + SUBSCRIPTION = "subscription" + CUSTOMER = "customer" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + TAX = "tax" + PLAN = "plan" + ADDON = "addon" + + 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 LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["Invoice.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["Invoice.DiscountEntityType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["Invoice.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + class LinkedPayment(TypedDict): + txn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + txn_status: NotRequired["transaction.Transaction.Status"] + txn_date: NotRequired[int] + txn_amount: NotRequired[int] + + class DunningAttempt(TypedDict): + attempt: Required[int] + transaction_id: NotRequired[str] + dunning_type: Required[enums.DunningType] + created_at: NotRequired[int] + txn_status: NotRequired["transaction.Transaction.Status"] + txn_amount: NotRequired[int] + + class AppliedCredit(TypedDict): + cn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + cn_reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_status: Required["credit_note.CreditNote.Status"] + + class AdjustmentCreditNote(TypedDict): + cn_id: Required[str] + cn_reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.CreditNote.Status"] + + class IssuedCreditNote(TypedDict): + cn_id: Required[str] + cn_reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.CreditNote.Status"] + + class LinkedOrder(TypedDict): + id: Required[str] + document_number: NotRequired[str] + status: NotRequired["Invoice.LinkedOrderStatus"] + order_type: NotRequired["Invoice.LinkedOrderOrderType"] + reference_id: NotRequired[str] + fulfillment_status: NotRequired[str] + batch_id: NotRequired[str] + created_at: Required[int] + + class Note(TypedDict): + entity_type: Required["Invoice.NoteEntityType"] + note: Required[str] + entity_id: NotRequired[str] + + class ShippingAddress(TypedDict): + 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] + index: Required[int] + + class StatementDescriptor(TypedDict): + id: Required[str] + descriptor: NotRequired[str] + + class BillingAddress(TypedDict): + 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 Einvoice(TypedDict): + id: Required[str] + reference_number: NotRequired[str] + status: Required["Invoice.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 CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateForChargeItemsAndChargesNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForChargeItemsAndChargesStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateForChargeItemsAndChargesCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateForChargeItemsAndChargesBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class CreateForChargeItemsAndChargesPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateForChargeItemsAndChargesPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class ChargeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateForChargeItemItemPriceParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateForChargeItemItemTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class ImportInvoiceLineItemParams(TypedDict): + id: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + subscription_id: NotRequired[str] + description: Required[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + entity_type: NotRequired["Invoice.LineItemEntityType"] + entity_id: NotRequired[str] + item_level_discount1_entity_id: NotRequired[str] + item_level_discount1_amount: NotRequired[int] + item_level_discount2_entity_id: NotRequired[str] + item_level_discount2_amount: NotRequired[int] + tax1_name: NotRequired[str] + tax1_amount: NotRequired[int] + tax2_name: NotRequired[str] + tax2_amount: NotRequired[int] + tax3_name: NotRequired[str] + tax3_amount: NotRequired[int] + tax4_name: NotRequired[str] + tax4_amount: NotRequired[int] + tax5_name: NotRequired[str] + tax5_amount: NotRequired[int] + tax6_name: NotRequired[str] + tax6_amount: NotRequired[int] + tax7_name: NotRequired[str] + tax7_amount: NotRequired[int] + tax8_name: NotRequired[str] + tax8_amount: NotRequired[int] + tax9_name: NotRequired[str] + tax9_amount: NotRequired[int] + tax10_name: NotRequired[str] + tax10_amount: NotRequired[int] + + class ImportInvoicePaymentReferenceNumberParams(TypedDict): + id: NotRequired[str] + type: Required["payment_reference_number.PaymentReferenceNumber.Type"] + number: Required[str] + + class ImportInvoiceLineItemTierParams(TypedDict): + line_item_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + class ImportInvoiceDiscountParams(TypedDict): + entity_type: Required["Invoice.DiscountEntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + class ImportInvoiceTaxParams(TypedDict): + name: Required[str] + rate: Required[float] + amount: NotRequired[int] + description: NotRequired[str] + juris_type: NotRequired[enums.TaxJurisType] + juris_name: NotRequired[str] + juris_code: NotRequired[str] + + class ImportInvoiceCreditNoteParams(TypedDict): + id: NotRequired[str] + + class ImportInvoicePaymentParams(TypedDict): + amount: Required[int] + payment_method: Required[enums.PaymentMethod] + date: NotRequired[int] + reference_number: NotRequired[str] + + class ImportInvoiceNoteParams(TypedDict): + entity_type: NotRequired["Invoice.NoteEntityType"] + entity_id: NotRequired[str] + note: NotRequired[str] + + class ImportInvoiceBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportInvoiceShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ApplyPaymentsTransactionParams(TypedDict): + id: NotRequired[str] + amount: NotRequired[int] + + class DeleteLineItemsLineItemParams(TypedDict): + id: NotRequired[str] + + class ApplyCreditsCreditNoteParams(TypedDict): + id: NotRequired[str] + + class ListEinvoiceParams(TypedDict): + status: NotRequired[Filters.EnumFilter] + + class ListPaymentReferenceNumbersPaymentReferenceNumberParams(TypedDict): + number: NotRequired[Filters.StringFilter] + + class AddChargeLineItemParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + + class AddAddonChargeLineItemParams(TypedDict): + date_from: NotRequired[int] + date_to: NotRequired[int] + + class AddChargeItemItemPriceParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class AddChargeItemItemTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CloseNotesToRemoveParams(TypedDict): + entity_type: NotRequired[enums.EntityType] + entity_id: NotRequired[str] + + class RecordPaymentTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + id_at_gateway: NotRequired[str] + status: NotRequired["transaction.Transaction.Status"] + date: NotRequired[int] + error_code: NotRequired[str] + error_text: NotRequired[str] + + class RecordTaxWithheldTaxWithheldParams(TypedDict): + amount: Required[int] + reference_number: NotRequired[str] + date: NotRequired[int] + description: NotRequired[str] + + class RemoveTaxWithheldTaxWithheldParams(TypedDict): + id: Required[str] + + class RefundCreditNoteParams(TypedDict): + reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + create_reason_code: NotRequired[str] + + class RecordRefundTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: Required[enums.PaymentMethod] + reference_number: NotRequired[str] + custom_payment_method_id: NotRequired[str] + date: Required[int] + + class RecordRefundCreditNoteParams(TypedDict): + reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + create_reason_code: NotRequired[str] + + class RemovePaymentTransactionParams(TypedDict): + id: Required[str] + + class RemoveCreditNoteCreditNoteParams(TypedDict): + id: Required[str] + + class UpdateDetailsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateDetailsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateDetailsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] class CreateParams(TypedDict): customer_id: NotRequired[str] subscription_id: NotRequired[str] currency_code: NotRequired[str] - addons: NotRequired[List[CreateAddonParams]] + addons: NotRequired[List["Invoice.CreateAddonParams"]] invoice_date: NotRequired[int] - charges: NotRequired[List[CreateChargeParams]] - tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + charges: NotRequired[List["Invoice.CreateChargeParams"]] + tax_providers_fields: NotRequired[List["Invoice.CreateTaxProvidersFieldParams"]] invoice_note: NotRequired[str] remove_general_note: NotRequired[bool] - notes_to_remove: NotRequired[List[CreateNotesToRemoveParams]] + notes_to_remove: NotRequired[List["Invoice.CreateNotesToRemoveParams"]] po_number: NotRequired[str] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] authorization_transaction_id: NotRequired[str] payment_source_id: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] - shipping_address: NotRequired[CreateShippingAddressParams] - statement_descriptor: NotRequired[CreateStatementDescriptorParams] - card: NotRequired[CreateCardParams] - bank_account: NotRequired[CreateBankAccountParams] + shipping_address: NotRequired["Invoice.CreateShippingAddressParams"] + statement_descriptor: NotRequired["Invoice.CreateStatementDescriptorParams"] + card: NotRequired["Invoice.CreateCardParams"] + bank_account: NotRequired["Invoice.CreateBankAccountParams"] token_id: NotRequired[str] - payment_method: NotRequired[CreatePaymentMethodParams] - payment_intent: NotRequired[CreatePaymentIntentParams] + payment_method: NotRequired["Invoice.CreatePaymentMethodParams"] + payment_intent: NotRequired["Invoice.CreatePaymentIntentParams"] replace_primary_payment_source: NotRequired[bool] retain_payment_source: NotRequired[bool] payment_initiator: NotRequired[enums.PaymentInitiator] @@ -38,13 +824,17 @@ class CreateForChargeItemsAndChargesParams(TypedDict): customer_id: NotRequired[str] subscription_id: NotRequired[str] currency_code: NotRequired[str] - item_prices: NotRequired[List[CreateForChargeItemsAndChargesItemPriceParams]] - item_tiers: NotRequired[List[CreateForChargeItemsAndChargesItemTierParams]] - charges: NotRequired[List[CreateForChargeItemsAndChargesChargeParams]] + item_prices: NotRequired[ + List["Invoice.CreateForChargeItemsAndChargesItemPriceParams"] + ] + item_tiers: NotRequired[ + List["Invoice.CreateForChargeItemsAndChargesItemTierParams"] + ] + charges: NotRequired[List["Invoice.CreateForChargeItemsAndChargesChargeParams"]] invoice_note: NotRequired[str] remove_general_note: NotRequired[bool] notes_to_remove: NotRequired[ - List[CreateForChargeItemsAndChargesNotesToRemoveParams] + List["Invoice.CreateForChargeItemsAndChargesNotesToRemoveParams"] ] po_number: NotRequired[str] coupon: NotRequired[str] @@ -53,21 +843,29 @@ class CreateForChargeItemsAndChargesParams(TypedDict): payment_source_id: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] tax_providers_fields: NotRequired[ - List[CreateForChargeItemsAndChargesTaxProvidersFieldParams] + List["Invoice.CreateForChargeItemsAndChargesTaxProvidersFieldParams"] + ] + discounts: Required[ + List["Invoice.CreateForChargeItemsAndChargesDiscountParams"] ] - discounts: Required[List[CreateForChargeItemsAndChargesDiscountParams]] invoice_date: NotRequired[int] shipping_address: NotRequired[ - CreateForChargeItemsAndChargesShippingAddressParams + "Invoice.CreateForChargeItemsAndChargesShippingAddressParams" ] statement_descriptor: NotRequired[ - CreateForChargeItemsAndChargesStatementDescriptorParams + "Invoice.CreateForChargeItemsAndChargesStatementDescriptorParams" + ] + card: NotRequired["Invoice.CreateForChargeItemsAndChargesCardParams"] + bank_account: NotRequired[ + "Invoice.CreateForChargeItemsAndChargesBankAccountParams" ] - card: NotRequired[CreateForChargeItemsAndChargesCardParams] - bank_account: NotRequired[CreateForChargeItemsAndChargesBankAccountParams] token_id: NotRequired[str] - payment_method: NotRequired[CreateForChargeItemsAndChargesPaymentMethodParams] - payment_intent: NotRequired[CreateForChargeItemsAndChargesPaymentIntentParams] + payment_method: NotRequired[ + "Invoice.CreateForChargeItemsAndChargesPaymentMethodParams" + ] + payment_intent: NotRequired[ + "Invoice.CreateForChargeItemsAndChargesPaymentIntentParams" + ] replace_primary_payment_source: NotRequired[bool] retain_payment_source: NotRequired[bool] payment_initiator: NotRequired[enums.PaymentInitiator] @@ -88,7 +886,7 @@ class ChargeParams(TypedDict): avalara_service_type: NotRequired[int] po_number: NotRequired[str] invoice_date: NotRequired[int] - tax_providers_fields: NotRequired[List[ChargeTaxProvidersFieldParams]] + tax_providers_fields: NotRequired[List["Invoice.ChargeTaxProvidersFieldParams"]] payment_source_id: NotRequired[str] payment_initiator: NotRequired[enums.PaymentInitiator] @@ -112,8 +910,8 @@ class ChargeAddonParams(TypedDict): class CreateForChargeItemParams(TypedDict): customer_id: NotRequired[str] subscription_id: NotRequired[str] - item_price: Required[CreateForChargeItemItemPriceParams] - item_tiers: NotRequired[List[CreateForChargeItemItemTierParams]] + item_price: Required["Invoice.CreateForChargeItemItemPriceParams"] + item_tiers: NotRequired[List["Invoice.CreateForChargeItemItemTierParams"]] po_number: NotRequired[str] coupon: NotRequired[str] payment_source_id: NotRequired[str] @@ -136,7 +934,7 @@ class ImportInvoiceParams(TypedDict): date: Required[int] total: Required[int] round_off: NotRequired[int] - status: NotRequired[Status] + status: NotRequired["Invoice.Status"] voided_at: NotRequired[int] void_reason_code: NotRequired[str] is_written_off: NotRequired[bool] @@ -146,34 +944,34 @@ class ImportInvoiceParams(TypedDict): net_term_days: NotRequired[int] has_advance_charges: NotRequired[bool] use_for_proration: NotRequired[bool] - line_items: Required[List[ImportInvoiceLineItemParams]] + line_items: Required[List["Invoice.ImportInvoiceLineItemParams"]] payment_reference_numbers: Required[ - List[ImportInvoicePaymentReferenceNumberParams] + List["Invoice.ImportInvoicePaymentReferenceNumberParams"] ] - line_item_tiers: Required[List[ImportInvoiceLineItemTierParams]] - discounts: Required[List[ImportInvoiceDiscountParams]] - taxes: Required[List[ImportInvoiceTaxParams]] - credit_note: NotRequired[ImportInvoiceCreditNoteParams] - payments: Required[List[ImportInvoicePaymentParams]] - notes: NotRequired[List[ImportInvoiceNoteParams]] - billing_address: NotRequired[ImportInvoiceBillingAddressParams] - shipping_address: NotRequired[ImportInvoiceShippingAddressParams] + line_item_tiers: Required[List["Invoice.ImportInvoiceLineItemTierParams"]] + discounts: Required[List["Invoice.ImportInvoiceDiscountParams"]] + taxes: Required[List["Invoice.ImportInvoiceTaxParams"]] + credit_note: NotRequired["Invoice.ImportInvoiceCreditNoteParams"] + payments: Required[List["Invoice.ImportInvoicePaymentParams"]] + notes: NotRequired[List["Invoice.ImportInvoiceNoteParams"]] + billing_address: NotRequired["Invoice.ImportInvoiceBillingAddressParams"] + shipping_address: NotRequired["Invoice.ImportInvoiceShippingAddressParams"] class ApplyPaymentsParams(TypedDict): - transactions: NotRequired[List[ApplyPaymentsTransactionParams]] + transactions: NotRequired[List["Invoice.ApplyPaymentsTransactionParams"]] comment: NotRequired[str] class DeleteLineItemsParams(TypedDict): - line_items: NotRequired[List[DeleteLineItemsLineItemParams]] + line_items: NotRequired[List["Invoice.DeleteLineItemsLineItemParams"]] class ApplyCreditsParams(TypedDict): - credit_notes: NotRequired[List[ApplyCreditsCreditNoteParams]] + credit_notes: NotRequired[List["Invoice.ApplyCreditsCreditNoteParams"]] comment: NotRequired[str] class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] - einvoice: NotRequired[ListEinvoiceParams] + einvoice: NotRequired["Invoice.ListEinvoiceParams"] paid_on_after: NotRequired[int] include_deleted: NotRequired[bool] id: NotRequired[Filters.StringFilter] @@ -212,7 +1010,7 @@ class ListPaymentReferenceNumbersParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] payment_reference_number: NotRequired[ - ListPaymentReferenceNumbersPaymentReferenceNumberParams + "Invoice.ListPaymentReferenceNumbersPaymentReferenceNumberParams" ] id: NotRequired[Filters.StringFilter] @@ -225,7 +1023,7 @@ class AddChargeParams(TypedDict): avalara_tax_code: NotRequired[str] hsn_code: NotRequired[str] taxjar_product_code: NotRequired[str] - line_item: NotRequired[AddChargeLineItemParams] + line_item: NotRequired["Invoice.AddChargeLineItemParams"] comment: NotRequired[str] subscription_id: NotRequired[str] @@ -235,13 +1033,13 @@ class AddAddonChargeParams(TypedDict): addon_unit_price: NotRequired[int] addon_quantity_in_decimal: NotRequired[str] addon_unit_price_in_decimal: NotRequired[str] - line_item: NotRequired[AddAddonChargeLineItemParams] + line_item: NotRequired["Invoice.AddAddonChargeLineItemParams"] comment: NotRequired[str] subscription_id: NotRequired[str] class AddChargeItemParams(TypedDict): - item_price: Required[AddChargeItemItemPriceParams] - item_tiers: NotRequired[List[AddChargeItemItemTierParams]] + item_price: Required["Invoice.AddChargeItemItemPriceParams"] + item_tiers: NotRequired[List["Invoice.AddChargeItemItemTierParams"]] comment: NotRequired[str] subscription_id: NotRequired[str] @@ -249,7 +1047,7 @@ class CloseParams(TypedDict): comment: NotRequired[str] invoice_note: NotRequired[str] remove_general_note: NotRequired[bool] - notes_to_remove: NotRequired[List[CloseNotesToRemoveParams]] + notes_to_remove: NotRequired[List["Invoice.CloseNotesToRemoveParams"]] invoice_date: NotRequired[int] class CollectPaymentParams(TypedDict): @@ -260,32 +1058,32 @@ class CollectPaymentParams(TypedDict): payment_initiator: NotRequired[enums.PaymentInitiator] class RecordPaymentParams(TypedDict): - transaction: Required[RecordPaymentTransactionParams] + transaction: Required["Invoice.RecordPaymentTransactionParams"] comment: NotRequired[str] class RecordTaxWithheldParams(TypedDict): - tax_withheld: Required[RecordTaxWithheldTaxWithheldParams] + tax_withheld: Required["Invoice.RecordTaxWithheldTaxWithheldParams"] class RemoveTaxWithheldParams(TypedDict): - tax_withheld: Required[RemoveTaxWithheldTaxWithheldParams] + tax_withheld: Required["Invoice.RemoveTaxWithheldTaxWithheldParams"] class RefundParams(TypedDict): refund_amount: NotRequired[int] - credit_note: NotRequired[RefundCreditNoteParams] + credit_note: NotRequired["Invoice.RefundCreditNoteParams"] comment: NotRequired[str] customer_notes: NotRequired[str] class RecordRefundParams(TypedDict): - transaction: Required[RecordRefundTransactionParams] - credit_note: NotRequired[RecordRefundCreditNoteParams] + transaction: Required["Invoice.RecordRefundTransactionParams"] + credit_note: NotRequired["Invoice.RecordRefundCreditNoteParams"] comment: NotRequired[str] customer_notes: NotRequired[str] class RemovePaymentParams(TypedDict): - transaction: Required[RemovePaymentTransactionParams] + transaction: Required["Invoice.RemovePaymentTransactionParams"] class RemoveCreditNoteParams(TypedDict): - credit_note: Required[RemoveCreditNoteCreditNoteParams] + credit_note: Required["Invoice.RemoveCreditNoteCreditNoteParams"] class VoidInvoiceParams(TypedDict): comment: NotRequired[str] @@ -298,9 +1096,11 @@ class DeleteParams(TypedDict): comment: NotRequired[str] class UpdateDetailsParams(TypedDict): - billing_address: NotRequired[UpdateDetailsBillingAddressParams] - shipping_address: NotRequired[UpdateDetailsShippingAddressParams] - statement_descriptor: NotRequired[UpdateDetailsStatementDescriptorParams] + billing_address: NotRequired["Invoice.UpdateDetailsBillingAddressParams"] + shipping_address: NotRequired["Invoice.UpdateDetailsShippingAddressParams"] + statement_descriptor: NotRequired[ + "Invoice.UpdateDetailsStatementDescriptorParams" + ] vat_number: NotRequired[str] vat_number_prefix: NotRequired[str] po_number: NotRequired[str] diff --git a/chargebee/models/invoice/types.py b/chargebee/models/invoice/types.py deleted file mode 100644 index 843b49d..0000000 --- a/chargebee/models/invoice/types.py +++ /dev/null @@ -1,869 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.filters import Filters -from chargebee.models import ( - enums, - credit_note, - payment_reference_number, - payment_intent, - transaction, -) - - -class Status(Enum): - PAID = "paid" - POSTED = "posted" - PAYMENT_DUE = "payment_due" - NOT_PAID = "not_paid" - VOIDED = "voided" - PENDING = "pending" - - def __str__(self): - return self.value - - -class DunningStatus(Enum): - IN_PROGRESS = "in_progress" - EXHAUSTED = "exhausted" - STOPPED = "stopped" - SUCCESS = "success" - - def __str__(self): - return self.value - - -class LineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LinkedOrderStatus(Enum): - NEW = "new" - PROCESSING = "processing" - COMPLETE = "complete" - CANCELLED = "cancelled" - VOIDED = "voided" - QUEUED = "queued" - AWAITING_SHIPMENT = "awaiting_shipment" - ON_HOLD = "on_hold" - DELIVERED = "delivered" - SHIPPED = "shipped" - PARTIALLY_DELIVERED = "partially_delivered" - RETURNED = "returned" - - def __str__(self): - return self.value - - -class LinkedOrderOrderType(Enum): - MANUAL = "manual" - SYSTEM_GENERATED = "system_generated" - - def __str__(self): - return self.value - - -class NoteEntityType(Enum): - COUPON = "coupon" - SUBSCRIPTION = "subscription" - CUSTOMER = "customer" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - TAX = "tax" - PLAN = "plan" - ADDON = "addon" - - 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 LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[LineItemDiscountDiscountType] - coupon_id: NotRequired[str] - 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] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - 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] - - -class LinkedPayment(TypedDict): - txn_id: Required[str] - applied_amount: Required[int] - applied_at: Required[int] - txn_status: NotRequired["transaction.Status"] - txn_date: NotRequired[int] - txn_amount: NotRequired[int] - - -class DunningAttempt(TypedDict): - attempt: Required[int] - transaction_id: NotRequired[str] - dunning_type: Required[enums.DunningType] - created_at: NotRequired[int] - txn_status: NotRequired["transaction.Status"] - txn_amount: NotRequired[int] - - -class AppliedCredit(TypedDict): - cn_id: Required[str] - applied_amount: Required[int] - applied_at: Required[int] - cn_reason_code: NotRequired["credit_note.ReasonCode"] - cn_create_reason_code: NotRequired[str] - cn_date: NotRequired[int] - cn_status: Required["credit_note.Status"] - - -class AdjustmentCreditNote(TypedDict): - cn_id: Required[str] - cn_reason_code: NotRequired["credit_note.ReasonCode"] - cn_create_reason_code: NotRequired[str] - cn_date: NotRequired[int] - cn_total: NotRequired[int] - cn_status: Required["credit_note.Status"] - - -class IssuedCreditNote(TypedDict): - cn_id: Required[str] - cn_reason_code: NotRequired["credit_note.ReasonCode"] - cn_create_reason_code: NotRequired[str] - cn_date: NotRequired[int] - cn_total: NotRequired[int] - cn_status: Required["credit_note.Status"] - - -class LinkedOrder(TypedDict): - id: Required[str] - document_number: NotRequired[str] - status: NotRequired[LinkedOrderStatus] - order_type: NotRequired[LinkedOrderOrderType] - reference_id: NotRequired[str] - fulfillment_status: NotRequired[str] - batch_id: NotRequired[str] - created_at: Required[int] - - -class Note(TypedDict): - entity_type: Required[NoteEntityType] - note: Required[str] - entity_id: NotRequired[str] - - -class ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class StatementDescriptor(TypedDict): - id: Required[str] - descriptor: NotRequired[str] - - -class BillingAddress(TypedDict): - 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 Einvoice(TypedDict): - id: Required[str] - reference_number: NotRequired[str] - status: Required[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 CreateAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateNotesToRemoveParams(TypedDict): - entity_type: NotRequired[enums.EntityType] - entity_id: NotRequired[str] - - -class CreateShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBankAccountParams(TypedDict): - gateway_account_id: NotRequired[str] - iban: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - bank_name: NotRequired[str] - account_number: NotRequired[str] - routing_number: NotRequired[str] - bank_code: NotRequired[str] - account_type: NotRequired[enums.AccountType] - account_holder_type: NotRequired[enums.AccountHolderType] - echeck_type: NotRequired[enums.EcheckType] - issuing_country: NotRequired[str] - swedish_identity_number: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class CreatePaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateForChargeItemsAndChargesItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateForChargeItemsAndChargesChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateForChargeItemsAndChargesNotesToRemoveParams(TypedDict): - entity_type: NotRequired[enums.EntityType] - entity_id: NotRequired[str] - - -class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateForChargeItemsAndChargesDiscountParams(TypedDict): - percentage: NotRequired[float] - amount: NotRequired[int] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - - -class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForChargeItemsAndChargesStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateForChargeItemsAndChargesCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateForChargeItemsAndChargesBankAccountParams(TypedDict): - gateway_account_id: NotRequired[str] - iban: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - bank_name: NotRequired[str] - account_number: NotRequired[str] - routing_number: NotRequired[str] - bank_code: NotRequired[str] - account_type: NotRequired[enums.AccountType] - account_holder_type: NotRequired[enums.AccountHolderType] - echeck_type: NotRequired[enums.EcheckType] - issuing_country: NotRequired[str] - swedish_identity_number: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class CreateForChargeItemsAndChargesPaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateForChargeItemsAndChargesPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class ChargeTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateForChargeItemItemPriceParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateForChargeItemItemTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class ImportInvoiceLineItemParams(TypedDict): - id: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - subscription_id: NotRequired[str] - description: Required[str] - unit_amount: NotRequired[int] - quantity: NotRequired[int] - amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - entity_type: NotRequired[LineItemEntityType] - entity_id: NotRequired[str] - item_level_discount1_entity_id: NotRequired[str] - item_level_discount1_amount: NotRequired[int] - item_level_discount2_entity_id: NotRequired[str] - item_level_discount2_amount: NotRequired[int] - tax1_name: NotRequired[str] - tax1_amount: NotRequired[int] - tax2_name: NotRequired[str] - tax2_amount: NotRequired[int] - tax3_name: NotRequired[str] - tax3_amount: NotRequired[int] - tax4_name: NotRequired[str] - tax4_amount: NotRequired[int] - tax5_name: NotRequired[str] - tax5_amount: NotRequired[int] - tax6_name: NotRequired[str] - tax6_amount: NotRequired[int] - tax7_name: NotRequired[str] - tax7_amount: NotRequired[int] - tax8_name: NotRequired[str] - tax8_amount: NotRequired[int] - tax9_name: NotRequired[str] - tax9_amount: NotRequired[int] - tax10_name: NotRequired[str] - tax10_amount: NotRequired[int] - - -class ImportInvoicePaymentReferenceNumberParams(TypedDict): - id: NotRequired[str] - type: Required["payment_reference_number.Type"] - number: Required[str] - - -class ImportInvoiceLineItemTierParams(TypedDict): - line_item_id: Required[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - quantity_used: NotRequired[int] - unit_amount: NotRequired[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] - - -class ImportInvoiceDiscountParams(TypedDict): - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - description: NotRequired[str] - amount: Required[int] - - -class ImportInvoiceTaxParams(TypedDict): - name: Required[str] - rate: Required[float] - amount: NotRequired[int] - description: NotRequired[str] - juris_type: NotRequired[enums.TaxJurisType] - juris_name: NotRequired[str] - juris_code: NotRequired[str] - - -class ImportInvoiceCreditNoteParams(TypedDict): - id: NotRequired[str] - - -class ImportInvoicePaymentParams(TypedDict): - amount: Required[int] - payment_method: Required[enums.PaymentMethod] - date: NotRequired[int] - reference_number: NotRequired[str] - - -class ImportInvoiceNoteParams(TypedDict): - entity_type: NotRequired[NoteEntityType] - entity_id: NotRequired[str] - note: NotRequired[str] - - -class ImportInvoiceBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportInvoiceShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ApplyPaymentsTransactionParams(TypedDict): - id: NotRequired[str] - amount: NotRequired[int] - - -class DeleteLineItemsLineItemParams(TypedDict): - id: NotRequired[str] - - -class ApplyCreditsCreditNoteParams(TypedDict): - id: NotRequired[str] - - -class ListEinvoiceParams(TypedDict): - Status: NotRequired[Filters.EnumFilter] - - -class ListPaymentReferenceNumbersPaymentReferenceNumberParams(TypedDict): - Number: NotRequired[Filters.StringFilter] - - -class AddChargeLineItemParams(TypedDict): - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class AddAddonChargeLineItemParams(TypedDict): - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class AddChargeItemItemPriceParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class AddChargeItemItemTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CloseNotesToRemoveParams(TypedDict): - entity_type: NotRequired[enums.EntityType] - entity_id: NotRequired[str] - - -class RecordPaymentTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: Required[enums.PaymentMethod] - reference_number: NotRequired[str] - custom_payment_method_id: NotRequired[str] - id_at_gateway: NotRequired[str] - status: NotRequired["transaction.Status"] - date: NotRequired[int] - error_code: NotRequired[str] - error_text: NotRequired[str] - - -class RecordTaxWithheldTaxWithheldParams(TypedDict): - amount: Required[int] - reference_number: NotRequired[str] - date: NotRequired[int] - description: NotRequired[str] - - -class RemoveTaxWithheldTaxWithheldParams(TypedDict): - id: Required[str] - - -class RefundCreditNoteParams(TypedDict): - reason_code: NotRequired["credit_note.ReasonCode"] - create_reason_code: NotRequired[str] - - -class RecordRefundTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: Required[enums.PaymentMethod] - reference_number: NotRequired[str] - custom_payment_method_id: NotRequired[str] - date: Required[int] - - -class RecordRefundCreditNoteParams(TypedDict): - reason_code: NotRequired["credit_note.ReasonCode"] - create_reason_code: NotRequired[str] - - -class RemovePaymentTransactionParams(TypedDict): - id: Required[str] - - -class RemoveCreditNoteCreditNoteParams(TypedDict): - id: Required[str] - - -class UpdateDetailsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateDetailsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateDetailsStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] diff --git a/chargebee/models/invoice_estimate/__init__.py b/chargebee/models/invoice_estimate/__init__.py index 521c66f..80b0b53 100644 --- a/chargebee/models/invoice_estimate/__init__.py +++ b/chargebee/models/invoice_estimate/__init__.py @@ -1,3 +1,2 @@ from .operations import InvoiceEstimate from .responses import InvoiceEstimateResponse -from .types import LineItem, Discount, Tax, LineItemTax, LineItemTier, LineItemDiscount diff --git a/chargebee/models/invoice_estimate/operations.py b/chargebee/models/invoice_estimate/operations.py index 406738e..f90d4c2 100644 --- a/chargebee/models/invoice_estimate/operations.py +++ b/chargebee/models/invoice_estimate/operations.py @@ -1,9 +1,116 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class InvoiceEstimate: + class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["InvoiceEstimate.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["InvoiceEstimate.DiscountEntityType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class Tax(TypedDict): + name: Required[str] + amount: Required[int] + description: NotRequired[str] + + class LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + 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] pass diff --git a/chargebee/models/invoice_estimate/types.py b/chargebee/models/invoice_estimate/types.py deleted file mode 100644 index 7643368..0000000 --- a/chargebee/models/invoice_estimate/types.py +++ /dev/null @@ -1,119 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class LineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class Tax(TypedDict): - name: Required[str] - amount: Required[int] - description: NotRequired[str] - - -class LineItemTax(TypedDict): - line_item_id: NotRequired[str] - tax_name: Required[str] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - 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] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[LineItemDiscountDiscountType] - coupon_id: NotRequired[str] - entity_id: NotRequired[str] - discount_amount: Required[int] diff --git a/chargebee/models/item/__init__.py b/chargebee/models/item/__init__.py index da0b9af..e10de29 100644 --- a/chargebee/models/item/__init__.py +++ b/chargebee/models/item/__init__.py @@ -1,3 +1,2 @@ from .operations import Item from .responses import ItemResponse -from .types import ApplicableItem, Status, Type, ItemApplicability, UsageCalculation diff --git a/chargebee/models/item/operations.py b/chargebee/models/item/operations.py index 33fea57..b8204ee 100644 --- a/chargebee/models/item/operations.py +++ b/chargebee/models/item/operations.py @@ -1,16 +1,49 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class Item: + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class Type(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + + def __str__(self): + return self.value + + class ItemApplicability(Enum): + ALL = "all" + RESTRICTED = "restricted" + + def __str__(self): + return self.value + + class UsageCalculation(Enum): + SUM_OF_USAGES = "sum_of_usages" + LAST_USAGE = "last_usage" + MAX_USAGE = "max_usage" + + def __str__(self): + return self.value + + class ApplicableItem(TypedDict): + id: NotRequired[str] class CreateParams(TypedDict): id: Required[str] name: Required[str] - type: Required[Type] + type: Required["Item.Type"] description: NotRequired[str] item_family_id: Required[str] is_giftable: NotRequired[bool] @@ -19,13 +52,13 @@ class CreateParams(TypedDict): enabled_in_portal: NotRequired[bool] redirect_url: NotRequired[str] enabled_for_checkout: NotRequired[bool] - item_applicability: NotRequired[ItemApplicability] + item_applicability: NotRequired["Item.ItemApplicability"] applicable_items: NotRequired[List[str]] unit: NotRequired[str] gift_claim_redirect_url: NotRequired[str] included_in_mrr: NotRequired[bool] metered: NotRequired[bool] - usage_calculation: NotRequired[UsageCalculation] + usage_calculation: NotRequired["Item.UsageCalculation"] metadata: NotRequired[Dict[Any, Any]] class UpdateParams(TypedDict): @@ -37,14 +70,14 @@ class UpdateParams(TypedDict): enabled_in_portal: NotRequired[bool] redirect_url: NotRequired[str] enabled_for_checkout: NotRequired[bool] - item_applicability: NotRequired[ItemApplicability] + item_applicability: NotRequired["Item.ItemApplicability"] clear_applicable_items: NotRequired[bool] applicable_items: NotRequired[List[str]] unit: NotRequired[str] gift_claim_redirect_url: NotRequired[str] metadata: NotRequired[Dict[Any, Any]] included_in_mrr: NotRequired[bool] - status: NotRequired[Status] + status: NotRequired["Item.Status"] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/item/types.py b/chargebee/models/item/types.py deleted file mode 100644 index fbaa256..0000000 --- a/chargebee/models/item/types.py +++ /dev/null @@ -1,42 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class Type(Enum): - PLAN = "plan" - ADDON = "addon" - CHARGE = "charge" - - def __str__(self): - return self.value - - -class ItemApplicability(Enum): - ALL = "all" - RESTRICTED = "restricted" - - def __str__(self): - return self.value - - -class UsageCalculation(Enum): - SUM_OF_USAGES = "sum_of_usages" - LAST_USAGE = "last_usage" - MAX_USAGE = "max_usage" - - def __str__(self): - return self.value - - -class ApplicableItem(TypedDict): - id: NotRequired[str] diff --git a/chargebee/models/item_entitlement/__init__.py b/chargebee/models/item_entitlement/__init__.py index 64e4fec..d5b0004 100644 --- a/chargebee/models/item_entitlement/__init__.py +++ b/chargebee/models/item_entitlement/__init__.py @@ -1,3 +1,2 @@ from .operations import ItemEntitlement from .responses import ItemEntitlementResponse -from .types import ItemType diff --git a/chargebee/models/item_entitlement/operations.py b/chargebee/models/item_entitlement/operations.py index 2148e3f..34f0c0d 100644 --- a/chargebee/models/item_entitlement/operations.py +++ b/chargebee/models/item_entitlement/operations.py @@ -1,11 +1,29 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.models import enums class ItemEntitlement: + class ItemType(Enum): + PLAN = "plan" + ADDON = "addon" + CHARGE = "charge" + SUBSCRIPTION = "subscription" + ITEM = "item" + + def __str__(self): + return self.value + + class AddItemEntitlementsItemEntitlementParams(TypedDict): + item_id: Required[str] + item_type: NotRequired["ItemEntitlement.ItemType"] + value: NotRequired[str] + + class UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams(TypedDict): + feature_id: Required[str] + value: NotRequired[str] class ItemEntitlementsForItemParams(TypedDict): limit: NotRequired[int] @@ -20,12 +38,16 @@ class ItemEntitlementsForFeatureParams(TypedDict): class AddItemEntitlementsParams(TypedDict): action: Required[enums.Action] - item_entitlements: Required[List[AddItemEntitlementsItemEntitlementParams]] + item_entitlements: Required[ + List["ItemEntitlement.AddItemEntitlementsItemEntitlementParams"] + ] class UpsertOrRemoveItemEntitlementsForItemParams(TypedDict): action: Required[enums.Action] item_entitlements: Required[ - List[UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams] + List[ + "ItemEntitlement.UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams" + ] ] @staticmethod diff --git a/chargebee/models/item_entitlement/types.py b/chargebee/models/item_entitlement/types.py deleted file mode 100644 index cd8e149..0000000 --- a/chargebee/models/item_entitlement/types.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class ItemType(Enum): - PLAN = "plan" - ADDON = "addon" - CHARGE = "charge" - SUBSCRIPTION = "subscription" - ITEM = "item" - - def __str__(self): - return self.value - - -class AddItemEntitlementsItemEntitlementParams(TypedDict): - item_id: Required[str] - item_type: NotRequired[ItemType] - value: NotRequired[str] - - -class UpsertOrRemoveItemEntitlementsForItemItemEntitlementParams(TypedDict): - feature_id: Required[str] - value: NotRequired[str] diff --git a/chargebee/models/item_family/__init__.py b/chargebee/models/item_family/__init__.py index d2a2d8a..3600d99 100644 --- a/chargebee/models/item_family/__init__.py +++ b/chargebee/models/item_family/__init__.py @@ -1,3 +1,2 @@ from .operations import ItemFamily from .responses import ItemFamilyResponse -from .types import Status diff --git a/chargebee/models/item_family/operations.py b/chargebee/models/item_family/operations.py index 11eab81..fc680f2 100644 --- a/chargebee/models/item_family/operations.py +++ b/chargebee/models/item_family/operations.py @@ -1,11 +1,17 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class ItemFamily: + class Status(Enum): + ACTIVE = "active" + DELETED = "deleted" + + def __str__(self): + return self.value class CreateParams(TypedDict): id: Required[str] diff --git a/chargebee/models/item_family/types.py b/chargebee/models/item_family/types.py deleted file mode 100644 index 6d0e9bb..0000000 --- a/chargebee/models/item_family/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - ACTIVE = "active" - DELETED = "deleted" - - def __str__(self): - return self.value diff --git a/chargebee/models/item_price/__init__.py b/chargebee/models/item_price/__init__.py index da7cce1..70050a0 100644 --- a/chargebee/models/item_price/__init__.py +++ b/chargebee/models/item_price/__init__.py @@ -1,14 +1,2 @@ from .operations import ItemPrice from .responses import ItemPriceResponse -from .types import ( - Tier, - TaxDetail, - TaxProvidersField, - AccountingDetail, - Status, - ProrationType, - PeriodUnit, - TrialPeriodUnit, - TrialEndAction, - ShippingPeriodUnit, -) diff --git a/chargebee/models/item_price/operations.py b/chargebee/models/item_price/operations.py index ec19d14..ad42939 100644 --- a/chargebee/models/item_price/operations.py +++ b/chargebee/models/item_price/operations.py @@ -1,11 +1,150 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class ItemPrice: + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class ProrationType(Enum): + SITE_DEFAULT = "site_default" + PARTIAL_TERM = "partial_term" + FULL_TERM = "full_term" + + def __str__(self): + return self.value + + class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class TrialPeriodUnit(Enum): + DAY = "day" + MONTH = "month" + + def __str__(self): + return self.value + + class TrialEndAction(Enum): + SITE_DEFAULT = "site_default" + ACTIVATE_SUBSCRIPTION = "activate_subscription" + CANCEL_SUBSCRIPTION = "cancel_subscription" + + def __str__(self): + return self.value + + class ShippingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class TaxDetail(TypedDict): + tax_profile_id: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + + class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class AccountingDetail(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + + class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateTaxDetailParams(TypedDict): + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + taxjar_product_code: NotRequired[str] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class CreateAccountingDetailParams(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] + + class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateTaxDetailParams(TypedDict): + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + taxjar_product_code: NotRequired[str] + + class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class UpdateAccountingDetailParams(TypedDict): + sku: NotRequired[str] + accounting_code: NotRequired[str] + accounting_category1: NotRequired[str] + accounting_category2: NotRequired[str] + accounting_category3: NotRequired[str] + accounting_category4: NotRequired[str] class CreateParams(TypedDict): id: Required[str] @@ -13,7 +152,7 @@ class CreateParams(TypedDict): description: NotRequired[str] item_id: Required[str] invoice_notes: NotRequired[str] - proration_type: NotRequired[ProrationType] + proration_type: NotRequired["ItemPrice.ProrationType"] external_name: NotRequired[str] currency_code: NotRequired[str] price_variant_id: NotRequired[str] @@ -27,27 +166,27 @@ class CreateParams(TypedDict): enums.UsageAccumulationResetFrequency ] pricing_model: NotRequired[enums.PricingModel] - tiers: NotRequired[List[CreateTierParams]] + tiers: NotRequired[List["ItemPrice.CreateTierParams"]] price: NotRequired[int] price_in_decimal: NotRequired[str] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["ItemPrice.PeriodUnit"] period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] + trial_period_unit: NotRequired["ItemPrice.TrialPeriodUnit"] trial_period: NotRequired[int] shipping_period: NotRequired[int] - shipping_period_unit: NotRequired[ShippingPeriodUnit] + shipping_period_unit: NotRequired["ItemPrice.ShippingPeriodUnit"] billing_cycles: NotRequired[int] - trial_end_action: NotRequired[TrialEndAction] - tax_detail: NotRequired[CreateTaxDetailParams] - tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] - accounting_detail: NotRequired[CreateAccountingDetailParams] + trial_end_action: NotRequired["ItemPrice.TrialEndAction"] + tax_detail: NotRequired["ItemPrice.CreateTaxDetailParams"] + tax_providers_fields: Required[List["ItemPrice.CreateTaxProvidersFieldParams"]] + accounting_detail: NotRequired["ItemPrice.CreateAccountingDetailParams"] class UpdateParams(TypedDict): name: NotRequired[str] description: NotRequired[str] - proration_type: NotRequired[ProrationType] + proration_type: NotRequired["ItemPrice.ProrationType"] price_variant_id: NotRequired[str] - status: NotRequired[Status] + status: NotRequired["ItemPrice.Status"] external_name: NotRequired[str] usage_accumulation_reset_frequency: NotRequired[ enums.UsageAccumulationResetFrequency @@ -59,20 +198,20 @@ class UpdateParams(TypedDict): free_quantity_in_decimal: NotRequired[str] metadata: NotRequired[Dict[Any, Any]] pricing_model: NotRequired[enums.PricingModel] - tiers: NotRequired[List[UpdateTierParams]] + tiers: NotRequired[List["ItemPrice.UpdateTierParams"]] price: NotRequired[int] price_in_decimal: NotRequired[str] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["ItemPrice.PeriodUnit"] period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] + trial_period_unit: NotRequired["ItemPrice.TrialPeriodUnit"] trial_period: NotRequired[int] shipping_period: NotRequired[int] - shipping_period_unit: NotRequired[ShippingPeriodUnit] + shipping_period_unit: NotRequired["ItemPrice.ShippingPeriodUnit"] billing_cycles: NotRequired[int] - trial_end_action: NotRequired[TrialEndAction] - tax_detail: NotRequired[UpdateTaxDetailParams] - tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] - accounting_detail: NotRequired[UpdateAccountingDetailParams] + trial_end_action: NotRequired["ItemPrice.TrialEndAction"] + tax_detail: NotRequired["ItemPrice.UpdateTaxDetailParams"] + tax_providers_fields: Required[List["ItemPrice.UpdateTaxProvidersFieldParams"]] + accounting_detail: NotRequired["ItemPrice.UpdateAccountingDetailParams"] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] diff --git a/chargebee/models/item_price/types.py b/chargebee/models/item_price/types.py deleted file mode 100644 index 844d610..0000000 --- a/chargebee/models/item_price/types.py +++ /dev/null @@ -1,160 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class ProrationType(Enum): - SITE_DEFAULT = "site_default" - PARTIAL_TERM = "partial_term" - FULL_TERM = "full_term" - - def __str__(self): - return self.value - - -class PeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class TrialPeriodUnit(Enum): - DAY = "day" - MONTH = "month" - - def __str__(self): - return self.value - - -class TrialEndAction(Enum): - SITE_DEFAULT = "site_default" - ACTIVATE_SUBSCRIPTION = "activate_subscription" - CANCEL_SUBSCRIPTION = "cancel_subscription" - - def __str__(self): - return self.value - - -class ShippingPeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class Tier(TypedDict): - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class TaxDetail(TypedDict): - tax_profile_id: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - - -class TaxProvidersField(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class AccountingDetail(TypedDict): - sku: NotRequired[str] - accounting_code: NotRequired[str] - accounting_category1: NotRequired[str] - accounting_category2: NotRequired[str] - accounting_category3: NotRequired[str] - accounting_category4: NotRequired[str] - - -class CreateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateTaxDetailParams(TypedDict): - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - taxjar_product_code: NotRequired[str] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class CreateAccountingDetailParams(TypedDict): - sku: NotRequired[str] - accounting_code: NotRequired[str] - accounting_category1: NotRequired[str] - accounting_category2: NotRequired[str] - accounting_category3: NotRequired[str] - accounting_category4: NotRequired[str] - - -class UpdateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateTaxDetailParams(TypedDict): - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - taxjar_product_code: NotRequired[str] - - -class UpdateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class UpdateAccountingDetailParams(TypedDict): - sku: NotRequired[str] - accounting_code: NotRequired[str] - accounting_category1: NotRequired[str] - accounting_category2: NotRequired[str] - accounting_category3: NotRequired[str] - accounting_category4: NotRequired[str] diff --git a/chargebee/models/metadata/operations.py b/chargebee/models/metadata/operations.py index ef368e5..5665d19 100644 --- a/chargebee/models/metadata/operations.py +++ b/chargebee/models/metadata/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class Metadata: diff --git a/chargebee/models/metadata/types.py b/chargebee/models/metadata/types.py deleted file mode 100644 index 191e8d2..0000000 --- a/chargebee/models/metadata/types.py +++ /dev/null @@ -1 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any diff --git a/chargebee/models/order/__init__.py b/chargebee/models/order/__init__.py index 2c5c0df..573a063 100644 --- a/chargebee/models/order/__init__.py +++ b/chargebee/models/order/__init__.py @@ -1,16 +1,2 @@ from .operations import Order from .responses import OrderResponse -from .types import ( - OrderLineItem, - ShippingAddress, - BillingAddress, - LineItemTax, - LineItemDiscount, - LinkedCreditNote, - ResentOrder, - Status, - CancellationReason, - PaymentStatus, - OrderType, - ResentStatus, -) diff --git a/chargebee/models/order/operations.py b/chargebee/models/order/operations.py index f3ff4dc..0187a8f 100644 --- a/chargebee/models/order/operations.py +++ b/chargebee/models/order/operations.py @@ -1,16 +1,282 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, credit_note class Order: + class Status(Enum): + NEW = "new" + PROCESSING = "processing" + COMPLETE = "complete" + CANCELLED = "cancelled" + VOIDED = "voided" + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + + def __str__(self): + return self.value + + class CancellationReason(Enum): + SHIPPING_CUT_OFF_PASSED = "shipping_cut_off_passed" + PRODUCT_UNSATISFACTORY = "product_unsatisfactory" + THIRD_PARTY_CANCELLATION = "third_party_cancellation" + PRODUCT_NOT_REQUIRED = "product_not_required" + DELIVERY_DATE_MISSED = "delivery_date_missed" + ALTERNATIVE_FOUND = "alternative_found" + INVOICE_WRITTEN_OFF = "invoice_written_off" + INVOICE_VOIDED = "invoice_voided" + FRAUDULENT_TRANSACTION = "fraudulent_transaction" + PAYMENT_DECLINED = "payment_declined" + SUBSCRIPTION_CANCELLED = "subscription_cancelled" + PRODUCT_NOT_AVAILABLE = "product_not_available" + OTHERS = "others" + ORDER_RESENT = "order_resent" + + def __str__(self): + return self.value + + class PaymentStatus(Enum): + NOT_PAID = "not_paid" + PAID = "paid" + + def __str__(self): + return self.value + + class OrderType(Enum): + MANUAL = "manual" + SYSTEM_GENERATED = "system_generated" + + def __str__(self): + return self.value + + class ResentStatus(Enum): + FULLY_RESENT = "fully_resent" + PARTIALLY_RESENT = "partially_resent" + + def __str__(self): + return self.value + + class OrderLineItemStatus(Enum): + QUEUED = "queued" + AWAITING_SHIPMENT = "awaiting_shipment" + ON_HOLD = "on_hold" + DELIVERED = "delivered" + SHIPPED = "shipped" + PARTIALLY_DELIVERED = "partially_delivered" + RETURNED = "returned" + CANCELLED = "cancelled" + + def __str__(self): + return self.value + + class OrderLineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + CUSTOM_DISCOUNT = "custom_discount" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class OrderLineItemLinkedCreditType(Enum): + ADJUSTMENT = "adjustment" + REFUNDABLE = "refundable" + + def __str__(self): + return self.value + + class OrderLineItemLinkedCreditStatus(Enum): + ADJUSTED = "adjusted" + REFUNDED = "refunded" + REFUND_DUE = "refund_due" + VOIDED = "voided" + + def __str__(self): + return self.value + + class OrderLineItem(TypedDict): + id: Required[str] + invoice_id: Required[str] + invoice_line_item_id: Required[str] + unit_price: NotRequired[int] + description: NotRequired[str] + amount: NotRequired[int] + fulfillment_quantity: NotRequired[int] + fulfillment_amount: NotRequired[int] + tax_amount: NotRequired[int] + amount_paid: NotRequired[int] + amount_adjusted: NotRequired[int] + refundable_credits_issued: NotRequired[int] + refundable_credits: NotRequired[int] + is_shippable: Required[bool] + sku: NotRequired[str] + status: NotRequired["Order.OrderLineItemStatus"] + entity_type: Required["Order.OrderLineItemEntityType"] + item_level_discount_amount: NotRequired[int] + discount_amount: NotRequired[int] + entity_id: NotRequired[str] + + class ShippingAddress(TypedDict): + 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] + index: Required[int] + + class BillingAddress(TypedDict): + 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 LineItemTax(TypedDict): + line_item_id: NotRequired[str] + tax_name: Required[str] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] + + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["Order.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + entity_id: NotRequired[str] + discount_amount: Required[int] + + class LinkedCreditNote(TypedDict): + amount: NotRequired[int] + type: Required["Order.OrderLineItemLinkedCreditType"] + id: Required[str] + status: Required["Order.OrderLineItemLinkedCreditStatus"] + amount_adjusted: NotRequired[int] + amount_refunded: NotRequired[int] + + class ResentOrder(TypedDict): + order_id: Required[str] + reason: NotRequired[str] + amount: NotRequired[int] + + class UpdateOrderLineItemParams(TypedDict): + id: NotRequired[str] + status: NotRequired["Order.OrderLineItemStatus"] + sku: NotRequired[str] + + class UpdateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportOrderShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportOrderBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CancelCreditNoteParams(TypedDict): + total: NotRequired[int] + + class CreateRefundableCreditNoteCreditNoteParams(TypedDict): + reason_code: Required["credit_note.CreditNote.ReasonCode"] + total: Required[int] + + class ResendOrderLineItemParams(TypedDict): + id: NotRequired[str] + fulfillment_quantity: NotRequired[int] class CreateParams(TypedDict): id: NotRequired[str] invoice_id: Required[str] - status: NotRequired[Status] + status: NotRequired["Order.Status"] reference_id: NotRequired[str] fulfillment_status: NotRequired[str] note: NotRequired[str] @@ -25,22 +291,22 @@ class UpdateParams(TypedDict): shipping_date: NotRequired[int] order_date: NotRequired[int] cancelled_at: NotRequired[int] - cancellation_reason: NotRequired[CancellationReason] + cancellation_reason: NotRequired["Order.CancellationReason"] shipped_at: NotRequired[int] delivered_at: NotRequired[int] - order_line_items: NotRequired[List[UpdateOrderLineItemParams]] + order_line_items: NotRequired[List["Order.UpdateOrderLineItemParams"]] tracking_url: NotRequired[str] tracking_id: NotRequired[str] shipment_carrier: NotRequired[str] fulfillment_status: NotRequired[str] - status: NotRequired[Status] - shipping_address: NotRequired[UpdateShippingAddressParams] + status: NotRequired["Order.Status"] + shipping_address: NotRequired["Order.UpdateShippingAddressParams"] class ImportOrderParams(TypedDict): id: NotRequired[str] document_number: NotRequired[str] invoice_id: Required[str] - status: Required[Status] + status: Required["Order.Status"] subscription_id: NotRequired[str] customer_id: NotRequired[str] created_at: Required[int] @@ -57,20 +323,20 @@ class ImportOrderParams(TypedDict): delivered_at: NotRequired[int] shipped_at: NotRequired[int] cancelled_at: NotRequired[int] - cancellation_reason: NotRequired[CancellationReason] + cancellation_reason: NotRequired["Order.CancellationReason"] refundable_credits_issued: NotRequired[int] - shipping_address: NotRequired[ImportOrderShippingAddressParams] - billing_address: NotRequired[ImportOrderBillingAddressParams] + shipping_address: NotRequired["Order.ImportOrderShippingAddressParams"] + billing_address: NotRequired["Order.ImportOrderBillingAddressParams"] class CancelParams(TypedDict): - cancellation_reason: Required[CancellationReason] - credit_note: NotRequired[CancelCreditNoteParams] + cancellation_reason: Required["Order.CancellationReason"] + credit_note: NotRequired["Order.CancelCreditNoteParams"] customer_notes: NotRequired[str] comment: NotRequired[str] cancelled_at: NotRequired[int] class CreateRefundableCreditNoteParams(TypedDict): - credit_note: Required[CreateRefundableCreditNoteCreditNoteParams] + credit_note: Required["Order.CreateRefundableCreditNoteCreditNoteParams"] customer_notes: NotRequired[str] comment: NotRequired[str] @@ -105,7 +371,7 @@ class OrdersForInvoiceParams(TypedDict): class ResendParams(TypedDict): shipping_date: NotRequired[int] resend_reason: NotRequired[str] - order_line_items: NotRequired[List[ResendOrderLineItemParams]] + order_line_items: NotRequired[List["Order.ResendOrderLineItemParams"]] @staticmethod def create(params: CreateParams, env=None, headers=None) -> CreateResponse: diff --git a/chargebee/models/order/types.py b/chargebee/models/order/types.py deleted file mode 100644 index 19882cb..0000000 --- a/chargebee/models/order/types.py +++ /dev/null @@ -1,293 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, credit_note - - -class Status(Enum): - NEW = "new" - PROCESSING = "processing" - COMPLETE = "complete" - CANCELLED = "cancelled" - VOIDED = "voided" - QUEUED = "queued" - AWAITING_SHIPMENT = "awaiting_shipment" - ON_HOLD = "on_hold" - DELIVERED = "delivered" - SHIPPED = "shipped" - PARTIALLY_DELIVERED = "partially_delivered" - RETURNED = "returned" - - def __str__(self): - return self.value - - -class CancellationReason(Enum): - SHIPPING_CUT_OFF_PASSED = "shipping_cut_off_passed" - PRODUCT_UNSATISFACTORY = "product_unsatisfactory" - THIRD_PARTY_CANCELLATION = "third_party_cancellation" - PRODUCT_NOT_REQUIRED = "product_not_required" - DELIVERY_DATE_MISSED = "delivery_date_missed" - ALTERNATIVE_FOUND = "alternative_found" - INVOICE_WRITTEN_OFF = "invoice_written_off" - INVOICE_VOIDED = "invoice_voided" - FRAUDULENT_TRANSACTION = "fraudulent_transaction" - PAYMENT_DECLINED = "payment_declined" - SUBSCRIPTION_CANCELLED = "subscription_cancelled" - PRODUCT_NOT_AVAILABLE = "product_not_available" - OTHERS = "others" - ORDER_RESENT = "order_resent" - - def __str__(self): - return self.value - - -class PaymentStatus(Enum): - NOT_PAID = "not_paid" - PAID = "paid" - - def __str__(self): - return self.value - - -class OrderType(Enum): - MANUAL = "manual" - SYSTEM_GENERATED = "system_generated" - - def __str__(self): - return self.value - - -class ResentStatus(Enum): - FULLY_RESENT = "fully_resent" - PARTIALLY_RESENT = "partially_resent" - - def __str__(self): - return self.value - - -class OrderLineItemStatus(Enum): - QUEUED = "queued" - AWAITING_SHIPMENT = "awaiting_shipment" - ON_HOLD = "on_hold" - DELIVERED = "delivered" - SHIPPED = "shipped" - PARTIALLY_DELIVERED = "partially_delivered" - RETURNED = "returned" - CANCELLED = "cancelled" - - def __str__(self): - return self.value - - -class OrderLineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - CUSTOM_DISCOUNT = "custom_discount" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class OrderLineItemLinkedCreditType(Enum): - ADJUSTMENT = "adjustment" - REFUNDABLE = "refundable" - - def __str__(self): - return self.value - - -class OrderLineItemLinkedCreditStatus(Enum): - ADJUSTED = "adjusted" - REFUNDED = "refunded" - REFUND_DUE = "refund_due" - VOIDED = "voided" - - def __str__(self): - return self.value - - -class OrderLineItem(TypedDict): - id: Required[str] - invoice_id: Required[str] - invoice_line_item_id: Required[str] - unit_price: NotRequired[int] - description: NotRequired[str] - amount: NotRequired[int] - fulfillment_quantity: NotRequired[int] - fulfillment_amount: NotRequired[int] - tax_amount: NotRequired[int] - amount_paid: NotRequired[int] - amount_adjusted: NotRequired[int] - refundable_credits_issued: NotRequired[int] - refundable_credits: NotRequired[int] - is_shippable: Required[bool] - sku: NotRequired[str] - status: NotRequired[OrderLineItemStatus] - entity_type: Required[OrderLineItemEntityType] - item_level_discount_amount: NotRequired[int] - discount_amount: NotRequired[int] - entity_id: NotRequired[str] - - -class ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class BillingAddress(TypedDict): - 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 LineItemTax(TypedDict): - line_item_id: NotRequired[str] - tax_name: Required[str] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - tax_amount_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[LineItemDiscountDiscountType] - coupon_id: NotRequired[str] - entity_id: NotRequired[str] - discount_amount: Required[int] - - -class LinkedCreditNote(TypedDict): - amount: NotRequired[int] - type: Required[OrderLineItemLinkedCreditType] - id: Required[str] - status: Required[OrderLineItemLinkedCreditStatus] - amount_adjusted: NotRequired[int] - amount_refunded: NotRequired[int] - - -class ResentOrder(TypedDict): - order_id: Required[str] - reason: NotRequired[str] - amount: NotRequired[int] - - -class UpdateOrderLineItemParams(TypedDict): - id: NotRequired[str] - status: NotRequired[OrderLineItemStatus] - sku: NotRequired[str] - - -class UpdateShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportOrderShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportOrderBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CancelCreditNoteParams(TypedDict): - total: NotRequired[int] - - -class CreateRefundableCreditNoteCreditNoteParams(TypedDict): - reason_code: Required["credit_note.ReasonCode"] - total: Required[int] - - -class ResendOrderLineItemParams(TypedDict): - id: NotRequired[str] - fulfillment_quantity: NotRequired[int] diff --git a/chargebee/models/payment_intent/__init__.py b/chargebee/models/payment_intent/__init__.py index e54f2d0..c34a227 100644 --- a/chargebee/models/payment_intent/__init__.py +++ b/chargebee/models/payment_intent/__init__.py @@ -1,3 +1,2 @@ from .operations import PaymentIntent from .responses import PaymentIntentResponse -from .types import PaymentAttempt, Status, PaymentMethodType diff --git a/chargebee/models/payment_intent/operations.py b/chargebee/models/payment_intent/operations.py index be3a271..b275688 100644 --- a/chargebee/models/payment_intent/operations.py +++ b/chargebee/models/payment_intent/operations.py @@ -1,10 +1,68 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import gateway_error_detail class PaymentIntent: + class Status(Enum): + INITED = "inited" + IN_PROGRESS = "in_progress" + AUTHORIZED = "authorized" + CONSUMED = "consumed" + EXPIRED = "expired" + + def __str__(self): + return self.value + + class PaymentMethodType(Enum): + CARD = "card" + IDEAL = "ideal" + SOFORT = "sofort" + BANCONTACT = "bancontact" + GOOGLE_PAY = "google_pay" + DOTPAY = "dotpay" + GIROPAY = "giropay" + APPLE_PAY = "apple_pay" + UPI = "upi" + NETBANKING_EMANDATES = "netbanking_emandates" + PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" + DIRECT_DEBIT = "direct_debit" + BOLETO = "boleto" + VENMO = "venmo" + AMAZON_PAYMENTS = "amazon_payments" + PAY_TO = "pay_to" + FASTER_PAYMENTS = "faster_payments" + SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" + KLARNA_PAY_NOW = "klarna_pay_now" + ONLINE_BANKING_POLAND = "online_banking_poland" + + def __str__(self): + return self.value + + class PaymentAttemptStatus(Enum): + INITED = "inited" + REQUIRES_IDENTIFICATION = "requires_identification" + REQUIRES_CHALLENGE = "requires_challenge" + REQUIRES_REDIRECTION = "requires_redirection" + AUTHORIZED = "authorized" + REFUSED = "refused" + PENDING_AUTHORIZATION = "pending_authorization" + + def __str__(self): + return self.value + + class PaymentAttempt(TypedDict): + id: NotRequired[str] + status: Required["PaymentIntent.PaymentAttemptStatus"] + payment_method_type: NotRequired["PaymentIntent.PaymentMethodType"] + id_at_gateway: NotRequired[str] + error_code: NotRequired[str] + error_text: NotRequired[str] + created_at: Required[int] + modified_at: Required[int] + error_detail: NotRequired[gateway_error_detail.GatewayErrorDetailResponse] class CreateParams(TypedDict): business_entity_id: NotRequired[str] @@ -13,7 +71,7 @@ class CreateParams(TypedDict): currency_code: Required[str] gateway_account_id: NotRequired[str] reference_id: NotRequired[str] - payment_method_type: NotRequired[PaymentMethodType] + payment_method_type: NotRequired["PaymentIntent.PaymentMethodType"] success_url: NotRequired[str] failure_url: NotRequired[str] @@ -21,7 +79,7 @@ class UpdateParams(TypedDict): amount: NotRequired[int] currency_code: NotRequired[str] gateway_account_id: NotRequired[str] - payment_method_type: NotRequired[PaymentMethodType] + payment_method_type: NotRequired["PaymentIntent.PaymentMethodType"] success_url: NotRequired[str] failure_url: NotRequired[str] diff --git a/chargebee/models/payment_intent/types.py b/chargebee/models/payment_intent/types.py deleted file mode 100644 index 11826bc..0000000 --- a/chargebee/models/payment_intent/types.py +++ /dev/null @@ -1,65 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import gateway_error_detail - - -class Status(Enum): - INITED = "inited" - IN_PROGRESS = "in_progress" - AUTHORIZED = "authorized" - CONSUMED = "consumed" - EXPIRED = "expired" - - def __str__(self): - return self.value - - -class PaymentMethodType(Enum): - CARD = "card" - IDEAL = "ideal" - SOFORT = "sofort" - BANCONTACT = "bancontact" - GOOGLE_PAY = "google_pay" - DOTPAY = "dotpay" - GIROPAY = "giropay" - APPLE_PAY = "apple_pay" - UPI = "upi" - NETBANKING_EMANDATES = "netbanking_emandates" - PAYPAL_EXPRESS_CHECKOUT = "paypal_express_checkout" - DIRECT_DEBIT = "direct_debit" - BOLETO = "boleto" - VENMO = "venmo" - AMAZON_PAYMENTS = "amazon_payments" - PAY_TO = "pay_to" - FASTER_PAYMENTS = "faster_payments" - SEPA_INSTANT_TRANSFER = "sepa_instant_transfer" - KLARNA_PAY_NOW = "klarna_pay_now" - ONLINE_BANKING_POLAND = "online_banking_poland" - - def __str__(self): - return self.value - - -class PaymentAttemptStatus(Enum): - INITED = "inited" - REQUIRES_IDENTIFICATION = "requires_identification" - REQUIRES_CHALLENGE = "requires_challenge" - REQUIRES_REDIRECTION = "requires_redirection" - AUTHORIZED = "authorized" - REFUSED = "refused" - PENDING_AUTHORIZATION = "pending_authorization" - - def __str__(self): - return self.value - - -class PaymentAttempt(TypedDict): - id: NotRequired[str] - status: Required[PaymentAttemptStatus] - payment_method_type: NotRequired[PaymentMethodType] - id_at_gateway: NotRequired[str] - error_code: NotRequired[str] - error_text: NotRequired[str] - created_at: Required[int] - modified_at: Required[int] - error_detail: NotRequired[gateway_error_detail.GatewayErrorDetailResponse] diff --git a/chargebee/models/payment_reference_number/__init__.py b/chargebee/models/payment_reference_number/__init__.py index fbd9d75..246e40a 100644 --- a/chargebee/models/payment_reference_number/__init__.py +++ b/chargebee/models/payment_reference_number/__init__.py @@ -1,3 +1,2 @@ from .operations import PaymentReferenceNumber from .responses import PaymentReferenceNumberResponse -from .types import Type diff --git a/chargebee/models/payment_reference_number/operations.py b/chargebee/models/payment_reference_number/operations.py index 296765b..6459a29 100644 --- a/chargebee/models/payment_reference_number/operations.py +++ b/chargebee/models/payment_reference_number/operations.py @@ -1,9 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class PaymentReferenceNumber: + class Type(Enum): + KID = "kid" + OCR = "ocr" + FRN = "frn" + FIK = "fik" + SWISS_REFERENCE = "swiss_reference" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/payment_reference_number/types.py b/chargebee/models/payment_reference_number/types.py deleted file mode 100644 index af74175..0000000 --- a/chargebee/models/payment_reference_number/types.py +++ /dev/null @@ -1,13 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Type(Enum): - KID = "kid" - OCR = "ocr" - FRN = "frn" - FIK = "fik" - SWISS_REFERENCE = "swiss_reference" - - def __str__(self): - return self.value diff --git a/chargebee/models/payment_source/__init__.py b/chargebee/models/payment_source/__init__.py index eda106c..9f2489c 100644 --- a/chargebee/models/payment_source/__init__.py +++ b/chargebee/models/payment_source/__init__.py @@ -1,15 +1,2 @@ from .operations import PaymentSource from .responses import PaymentSourceResponse -from .types import ( - Card, - BankAccount, - CustVoucherSource, - BillingAddress, - AmazonPayment, - Upi, - Paypal, - Venmo, - KlarnaPayNow, - Mandate, - Status, -) diff --git a/chargebee/models/payment_source/operations.py b/chargebee/models/payment_source/operations.py index b6d551f..23cb200 100644 --- a/chargebee/models/payment_source/operations.py +++ b/chargebee/models/payment_source/operations.py @@ -1,11 +1,224 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, payment_intent class PaymentSource: + class Status(Enum): + VALID = "valid" + EXPIRING = "expiring" + EXPIRED = "expired" + INVALID = "invalid" + PENDING_VERIFICATION = "pending_verification" + + def __str__(self): + return self.value + + class CardBrand(Enum): + VISA = "visa" + MASTERCARD = "mastercard" + AMERICAN_EXPRESS = "american_express" + DISCOVER = "discover" + JCB = "jcb" + DINERS_CLUB = "diners_club" + OTHER = "other" + BANCONTACT = "bancontact" + CMR_FALABELLA = "cmr_falabella" + TARJETA_NARANJA = "tarjeta_naranja" + NATIVA = "nativa" + CENCOSUD = "cencosud" + CABAL = "cabal" + ARGENCARD = "argencard" + ELO = "elo" + HIPERCARD = "hipercard" + CARNET = "carnet" + RUPAY = "rupay" + MAESTRO = "maestro" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class CardFundingType(Enum): + CREDIT = "credit" + DEBIT = "debit" + PREPAID = "prepaid" + NOT_KNOWN = "not_known" + NOT_APPLICABLE = "not_applicable" + + def __str__(self): + return self.value + + class Card(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + iin: Required[str] + last4: Required[str] + brand: Required["PaymentSource.CardBrand"] + funding_type: Required["PaymentSource.CardFundingType"] + expiry_month: Required[int] + expiry_year: Required[int] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_country: NotRequired[str] + billing_zip: NotRequired[str] + masked_number: NotRequired[str] + + class BankAccount(TypedDict): + last4: Required[str] + name_on_account: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + direct_debit_scheme: NotRequired[enums.DirectDebitScheme] + bank_name: NotRequired[str] + mandate_id: NotRequired[str] + account_type: NotRequired[enums.AccountType] + echeck_type: NotRequired[enums.EcheckType] + account_holder_type: NotRequired[enums.AccountHolderType] + email: NotRequired[str] + + class CustVoucherSource(TypedDict): + last4: Required[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + + class BillingAddress(TypedDict): + 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 AmazonPayment(TypedDict): + email: NotRequired[str] + agreement_id: NotRequired[str] + + class Upi(TypedDict): + vpa: NotRequired[str] + + class Paypal(TypedDict): + email: NotRequired[str] + agreement_id: NotRequired[str] + + class Venmo(TypedDict): + user_name: NotRequired[str] + + class KlarnaPayNow(TypedDict): + email: NotRequired[str] + + class Mandate(TypedDict): + id: Required[str] + subscription_id: Required[str] + created_at: Required[int] + + class CreateUsingPermanentTokenCardParams(TypedDict): + last4: NotRequired[str] + iin: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + brand: NotRequired["PaymentSource.CardBrand"] + funding_type: NotRequired["PaymentSource.CardFundingType"] + + class CreateUsingPermanentTokenBillingAddressParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + state: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + + class CreateUsingPaymentIntentPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_info: NotRequired[Dict[Any, Any]] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateVoucherPaymentSourceVoucherPaymentSourceParams(TypedDict): + voucher_type: Required[enums.VoucherType] + gateway_account_id: NotRequired[str] + tax_id: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class CreateCardCardParams(TypedDict): + gateway_account_id: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: Required[str] + expiry_month: Required[int] + expiry_year: Required[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBankAccountBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class UpdateCardCardParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_zip: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateBankAccountBankAccountParams(TypedDict): + first_name: NotRequired[str] + last_name: NotRequired[str] + email: NotRequired[str] class CreateUsingTempTokenParams(TypedDict): customer_id: Required[str] @@ -28,8 +241,10 @@ class CreateUsingPermanentTokenParams(TypedDict): network_transaction_id: NotRequired[str] mandate_id: NotRequired[str] skip_retrieval: NotRequired[bool] - card: NotRequired[CreateUsingPermanentTokenCardParams] - billing_address: NotRequired[CreateUsingPermanentTokenBillingAddressParams] + card: NotRequired["PaymentSource.CreateUsingPermanentTokenCardParams"] + billing_address: NotRequired[ + "PaymentSource.CreateUsingPermanentTokenBillingAddressParams" + ] additional_information: NotRequired[Dict[Any, Any]] class CreateUsingTokenParams(TypedDict): @@ -39,33 +254,35 @@ class CreateUsingTokenParams(TypedDict): class CreateUsingPaymentIntentParams(TypedDict): customer_id: Required[str] - payment_intent: NotRequired[CreateUsingPaymentIntentPaymentIntentParams] + payment_intent: NotRequired[ + "PaymentSource.CreateUsingPaymentIntentPaymentIntentParams" + ] replace_primary_payment_source: NotRequired[bool] class CreateVoucherPaymentSourceParams(TypedDict): customer_id: Required[str] voucher_payment_source: Required[ - CreateVoucherPaymentSourceVoucherPaymentSourceParams + "PaymentSource.CreateVoucherPaymentSourceVoucherPaymentSourceParams" ] class CreateCardParams(TypedDict): customer_id: Required[str] - card: Required[CreateCardCardParams] + card: Required["PaymentSource.CreateCardCardParams"] replace_primary_payment_source: NotRequired[bool] class CreateBankAccountParams(TypedDict): customer_id: Required[str] - bank_account: NotRequired[CreateBankAccountBankAccountParams] + bank_account: NotRequired["PaymentSource.CreateBankAccountBankAccountParams"] issuing_country: NotRequired[str] replace_primary_payment_source: NotRequired[bool] class UpdateCardParams(TypedDict): - card: NotRequired[UpdateCardCardParams] + card: NotRequired["PaymentSource.UpdateCardCardParams"] gateway_meta_data: NotRequired[Dict[Any, Any]] reference_transaction: NotRequired[str] class UpdateBankAccountParams(TypedDict): - bank_account: NotRequired[UpdateBankAccountBankAccountParams] + bank_account: NotRequired["PaymentSource.UpdateBankAccountBankAccountParams"] class VerifyBankAccountParams(TypedDict): amount1: Required[int] diff --git a/chargebee/models/payment_source/types.py b/chargebee/models/payment_source/types.py deleted file mode 100644 index 07f2835..0000000 --- a/chargebee/models/payment_source/types.py +++ /dev/null @@ -1,235 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, payment_intent - - -class Status(Enum): - VALID = "valid" - EXPIRING = "expiring" - EXPIRED = "expired" - INVALID = "invalid" - PENDING_VERIFICATION = "pending_verification" - - def __str__(self): - return self.value - - -class CardBrand(Enum): - VISA = "visa" - MASTERCARD = "mastercard" - AMERICAN_EXPRESS = "american_express" - DISCOVER = "discover" - JCB = "jcb" - DINERS_CLUB = "diners_club" - OTHER = "other" - BANCONTACT = "bancontact" - CMR_FALABELLA = "cmr_falabella" - TARJETA_NARANJA = "tarjeta_naranja" - NATIVA = "nativa" - CENCOSUD = "cencosud" - CABAL = "cabal" - ARGENCARD = "argencard" - ELO = "elo" - HIPERCARD = "hipercard" - CARNET = "carnet" - RUPAY = "rupay" - MAESTRO = "maestro" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class CardFundingType(Enum): - CREDIT = "credit" - DEBIT = "debit" - PREPAID = "prepaid" - NOT_KNOWN = "not_known" - NOT_APPLICABLE = "not_applicable" - - def __str__(self): - return self.value - - -class Card(TypedDict): - first_name: NotRequired[str] - last_name: NotRequired[str] - iin: Required[str] - last4: Required[str] - brand: Required[CardBrand] - funding_type: Required[CardFundingType] - expiry_month: Required[int] - expiry_year: Required[int] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_country: NotRequired[str] - billing_zip: NotRequired[str] - masked_number: NotRequired[str] - - -class BankAccount(TypedDict): - last4: Required[str] - name_on_account: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - direct_debit_scheme: NotRequired[enums.DirectDebitScheme] - bank_name: NotRequired[str] - mandate_id: NotRequired[str] - account_type: NotRequired[enums.AccountType] - echeck_type: NotRequired[enums.EcheckType] - account_holder_type: NotRequired[enums.AccountHolderType] - email: NotRequired[str] - - -class CustVoucherSource(TypedDict): - last4: Required[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - - -class BillingAddress(TypedDict): - 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 AmazonPayment(TypedDict): - email: NotRequired[str] - agreement_id: NotRequired[str] - - -class Upi(TypedDict): - vpa: NotRequired[str] - - -class Paypal(TypedDict): - email: NotRequired[str] - agreement_id: NotRequired[str] - - -class Venmo(TypedDict): - user_name: NotRequired[str] - - -class KlarnaPayNow(TypedDict): - email: NotRequired[str] - - -class Mandate(TypedDict): - id: Required[str] - subscription_id: Required[str] - created_at: Required[int] - - -class CreateUsingPermanentTokenCardParams(TypedDict): - last4: NotRequired[str] - iin: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - brand: NotRequired[CardBrand] - funding_type: NotRequired[CardFundingType] - - -class CreateUsingPermanentTokenBillingAddressParams(TypedDict): - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - state: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - - -class CreateUsingPaymentIntentPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_info: NotRequired[Dict[Any, Any]] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateVoucherPaymentSourceVoucherPaymentSourceParams(TypedDict): - voucher_type: Required[enums.VoucherType] - gateway_account_id: NotRequired[str] - tax_id: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class CreateCardCardParams(TypedDict): - gateway_account_id: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: Required[str] - expiry_month: Required[int] - expiry_year: Required[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBankAccountBankAccountParams(TypedDict): - gateway_account_id: NotRequired[str] - iban: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - bank_name: NotRequired[str] - account_number: NotRequired[str] - routing_number: NotRequired[str] - bank_code: NotRequired[str] - account_type: NotRequired[enums.AccountType] - account_holder_type: NotRequired[enums.AccountHolderType] - echeck_type: NotRequired[enums.EcheckType] - swedish_identity_number: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class UpdateCardCardParams(TypedDict): - first_name: NotRequired[str] - last_name: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_zip: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateBankAccountBankAccountParams(TypedDict): - first_name: NotRequired[str] - last_name: NotRequired[str] - email: NotRequired[str] diff --git a/chargebee/models/payment_voucher/__init__.py b/chargebee/models/payment_voucher/__init__.py index 7f44fc3..aa0bb04 100644 --- a/chargebee/models/payment_voucher/__init__.py +++ b/chargebee/models/payment_voucher/__init__.py @@ -1,3 +1,2 @@ from .operations import PaymentVoucher from .responses import PaymentVoucherResponse -from .types import LinkedInvoice, Status diff --git a/chargebee/models/payment_voucher/operations.py b/chargebee/models/payment_voucher/operations.py index a6c835a..511aa72 100644 --- a/chargebee/models/payment_voucher/operations.py +++ b/chargebee/models/payment_voucher/operations.py @@ -1,16 +1,40 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class PaymentVoucher: + class Status(Enum): + ACTIVE = "active" + CONSUMED = "consumed" + EXPIRED = "expired" + FAILURE = "failure" + + def __str__(self): + return self.value + + class LinkedInvoice(TypedDict): + invoice_id: Required[str] + txn_id: Required[str] + applied_at: Required[int] + + class CreateVoucherPaymentSourceParams(TypedDict): + voucher_type: Required[enums.VoucherType] + + class CreateInvoiceAllocationParams(TypedDict): + invoice_id: Required[str] class CreateParams(TypedDict): customer_id: Required[str] - voucher_payment_source: Required[CreateVoucherPaymentSourceParams] - invoice_allocations: Required[List[CreateInvoiceAllocationParams]] + voucher_payment_source: Required[ + "PaymentVoucher.CreateVoucherPaymentSourceParams" + ] + invoice_allocations: Required[ + List["PaymentVoucher.CreateInvoiceAllocationParams"] + ] payment_source_id: NotRequired[str] class PaymentVouchersForInvoiceParams(TypedDict): diff --git a/chargebee/models/payment_voucher/types.py b/chargebee/models/payment_voucher/types.py deleted file mode 100644 index d5934e5..0000000 --- a/chargebee/models/payment_voucher/types.py +++ /dev/null @@ -1,27 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - ACTIVE = "active" - CONSUMED = "consumed" - EXPIRED = "expired" - FAILURE = "failure" - - def __str__(self): - return self.value - - -class LinkedInvoice(TypedDict): - invoice_id: Required[str] - txn_id: Required[str] - applied_at: Required[int] - - -class CreateVoucherPaymentSourceParams(TypedDict): - voucher_type: Required[enums.VoucherType] - - -class CreateInvoiceAllocationParams(TypedDict): - invoice_id: Required[str] diff --git a/chargebee/models/plan/__init__.py b/chargebee/models/plan/__init__.py index 2c8a170..5297011 100644 --- a/chargebee/models/plan/__init__.py +++ b/chargebee/models/plan/__init__.py @@ -1,16 +1,2 @@ from .operations import Plan from .responses import PlanResponse -from .types import ( - Tier, - TaxProvidersField, - ApplicableAddon, - AttachedAddon, - EventBasedAddon, - PeriodUnit, - TrialPeriodUnit, - TrialEndAction, - ChargeModel, - Status, - AddonApplicability, - ShippingFrequencyPeriodUnit, -) diff --git a/chargebee/models/plan/operations.py b/chargebee/models/plan/operations.py index b521696..a71b9f7 100644 --- a/chargebee/models/plan/operations.py +++ b/chargebee/models/plan/operations.py @@ -1,11 +1,166 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Plan: + class PeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class TrialPeriodUnit(Enum): + DAY = "day" + MONTH = "month" + + def __str__(self): + return self.value + + class TrialEndAction(Enum): + SITE_DEFAULT = "site_default" + ACTIVATE_SUBSCRIPTION = "activate_subscription" + CANCEL_SUBSCRIPTION = "cancel_subscription" + + def __str__(self): + return self.value + + class ChargeModel(Enum): + FLAT_FEE = "flat_fee" + PER_UNIT = "per_unit" + TIERED = "tiered" + VOLUME = "volume" + STAIRSTEP = "stairstep" + + def __str__(self): + return self.value + + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class AddonApplicability(Enum): + ALL = "all" + RESTRICTED = "restricted" + + def __str__(self): + return self.value + + class ShippingFrequencyPeriodUnit(Enum): + YEAR = "year" + MONTH = "month" + WEEK = "week" + DAY = "day" + + def __str__(self): + return self.value + + class AttachedAddonType(Enum): + RECOMMENDED = "recommended" + MANDATORY = "mandatory" + + def __str__(self): + return self.value + + class Tier(TypedDict): + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class TaxProvidersField(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class ApplicableAddon(TypedDict): + id: Required[str] + + class AttachedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + billing_cycles: NotRequired[int] + type: Required["Plan.AttachedAddonType"] + quantity_in_decimal: NotRequired[str] + + class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + + class CreateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class CreateApplicableAddonParams(TypedDict): + id: NotRequired[str] + + class CreateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + class CreateAttachedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + type: NotRequired["Plan.AttachedAddonType"] + + class UpdateTierParams(TypedDict): + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateTaxProvidersFieldParams(TypedDict): + provider_name: Required[str] + field_id: Required[str] + field_value: Required[str] + + class UpdateApplicableAddonParams(TypedDict): + id: NotRequired[str] + + class UpdateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + class UpdateAttachedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + type: NotRequired["Plan.AttachedAddonType"] class CreateParams(TypedDict): id: Required[str] @@ -13,21 +168,21 @@ class CreateParams(TypedDict): invoice_name: NotRequired[str] description: NotRequired[str] trial_period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] - trial_end_action: NotRequired[TrialEndAction] + trial_period_unit: NotRequired["Plan.TrialPeriodUnit"] + trial_end_action: NotRequired["Plan.TrialEndAction"] period: NotRequired[int] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["Plan.PeriodUnit"] setup_cost: NotRequired[int] price: NotRequired[int] price_in_decimal: NotRequired[str] - tiers: NotRequired[List[CreateTierParams]] + tiers: NotRequired[List["Plan.CreateTierParams"]] currency_code: NotRequired[str] billing_cycles: NotRequired[int] pricing_model: NotRequired[enums.PricingModel] - charge_model: NotRequired[ChargeModel] + charge_model: NotRequired["Plan.ChargeModel"] free_quantity: NotRequired[int] free_quantity_in_decimal: NotRequired[str] - addon_applicability: NotRequired[AddonApplicability] + addon_applicability: NotRequired["Plan.AddonApplicability"] downgrade_penalty: NotRequired[float] redirect_url: NotRequired[str] enabled_in_hosted_pages: NotRequired[bool] @@ -48,17 +203,17 @@ class CreateParams(TypedDict): accounting_category4: NotRequired[str] is_shippable: NotRequired[bool] shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] - tax_providers_fields: Required[List[CreateTaxProvidersFieldParams]] - applicable_addons: NotRequired[List[CreateApplicableAddonParams]] - event_based_addons: NotRequired[List[CreateEventBasedAddonParams]] - attached_addons: NotRequired[List[CreateAttachedAddonParams]] + shipping_frequency_period_unit: NotRequired["Plan.ShippingFrequencyPeriodUnit"] + tax_providers_fields: Required[List["Plan.CreateTaxProvidersFieldParams"]] + applicable_addons: NotRequired[List["Plan.CreateApplicableAddonParams"]] + event_based_addons: NotRequired[List["Plan.CreateEventBasedAddonParams"]] + attached_addons: NotRequired[List["Plan.CreateAttachedAddonParams"]] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] giftable: NotRequired[bool] - status: NotRequired[Status] + status: NotRequired["Plan.Status"] claim_url: NotRequired[str] class UpdateParams(TypedDict): @@ -66,21 +221,21 @@ class UpdateParams(TypedDict): invoice_name: NotRequired[str] description: NotRequired[str] trial_period: NotRequired[int] - trial_period_unit: NotRequired[TrialPeriodUnit] - trial_end_action: NotRequired[TrialEndAction] + trial_period_unit: NotRequired["Plan.TrialPeriodUnit"] + trial_end_action: NotRequired["Plan.TrialEndAction"] period: NotRequired[int] - period_unit: NotRequired[PeriodUnit] + period_unit: NotRequired["Plan.PeriodUnit"] setup_cost: NotRequired[int] price: NotRequired[int] price_in_decimal: NotRequired[str] - tiers: NotRequired[List[UpdateTierParams]] + tiers: NotRequired[List["Plan.UpdateTierParams"]] currency_code: NotRequired[str] billing_cycles: NotRequired[int] pricing_model: NotRequired[enums.PricingModel] - charge_model: NotRequired[ChargeModel] + charge_model: NotRequired["Plan.ChargeModel"] free_quantity: NotRequired[int] free_quantity_in_decimal: NotRequired[str] - addon_applicability: NotRequired[AddonApplicability] + addon_applicability: NotRequired["Plan.AddonApplicability"] downgrade_penalty: NotRequired[float] redirect_url: NotRequired[str] enabled_in_hosted_pages: NotRequired[bool] @@ -101,11 +256,11 @@ class UpdateParams(TypedDict): accounting_category4: NotRequired[str] is_shippable: NotRequired[bool] shipping_frequency_period: NotRequired[int] - shipping_frequency_period_unit: NotRequired[ShippingFrequencyPeriodUnit] - tax_providers_fields: Required[List[UpdateTaxProvidersFieldParams]] - applicable_addons: NotRequired[List[UpdateApplicableAddonParams]] - event_based_addons: NotRequired[List[UpdateEventBasedAddonParams]] - attached_addons: NotRequired[List[UpdateAttachedAddonParams]] + shipping_frequency_period_unit: NotRequired["Plan.ShippingFrequencyPeriodUnit"] + tax_providers_fields: Required[List["Plan.UpdateTaxProvidersFieldParams"]] + applicable_addons: NotRequired[List["Plan.UpdateApplicableAddonParams"]] + event_based_addons: NotRequired[List["Plan.UpdateEventBasedAddonParams"]] + attached_addons: NotRequired[List["Plan.UpdateAttachedAddonParams"]] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] show_description_in_invoices: NotRequired[bool] diff --git a/chargebee/models/plan/types.py b/chargebee/models/plan/types.py deleted file mode 100644 index a2793e7..0000000 --- a/chargebee/models/plan/types.py +++ /dev/null @@ -1,181 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class PeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class TrialPeriodUnit(Enum): - DAY = "day" - MONTH = "month" - - def __str__(self): - return self.value - - -class TrialEndAction(Enum): - SITE_DEFAULT = "site_default" - ACTIVATE_SUBSCRIPTION = "activate_subscription" - CANCEL_SUBSCRIPTION = "cancel_subscription" - - def __str__(self): - return self.value - - -class ChargeModel(Enum): - FLAT_FEE = "flat_fee" - PER_UNIT = "per_unit" - TIERED = "tiered" - VOLUME = "volume" - STAIRSTEP = "stairstep" - - def __str__(self): - return self.value - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class AddonApplicability(Enum): - ALL = "all" - RESTRICTED = "restricted" - - def __str__(self): - return self.value - - -class ShippingFrequencyPeriodUnit(Enum): - YEAR = "year" - MONTH = "month" - WEEK = "week" - DAY = "day" - - def __str__(self): - return self.value - - -class AttachedAddonType(Enum): - RECOMMENDED = "recommended" - MANDATORY = "mandatory" - - def __str__(self): - return self.value - - -class Tier(TypedDict): - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class TaxProvidersField(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class ApplicableAddon(TypedDict): - id: Required[str] - - -class AttachedAddon(TypedDict): - id: Required[str] - quantity: Required[int] - billing_cycles: NotRequired[int] - type: Required[AttachedAddonType] - quantity_in_decimal: NotRequired[str] - - -class EventBasedAddon(TypedDict): - id: Required[str] - quantity: Required[int] - on_event: Required[enums.OnEvent] - charge_once: Required[bool] - quantity_in_decimal: NotRequired[str] - - -class CreateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class CreateApplicableAddonParams(TypedDict): - id: NotRequired[str] - - -class CreateEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - - -class CreateAttachedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - type: NotRequired[AttachedAddonType] - - -class UpdateTierParams(TypedDict): - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateTaxProvidersFieldParams(TypedDict): - provider_name: Required[str] - field_id: Required[str] - field_value: Required[str] - - -class UpdateApplicableAddonParams(TypedDict): - id: NotRequired[str] - - -class UpdateEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - - -class UpdateAttachedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - type: NotRequired[AttachedAddonType] diff --git a/chargebee/models/portal_session/__init__.py b/chargebee/models/portal_session/__init__.py index 6415c7c..96d0bc5 100644 --- a/chargebee/models/portal_session/__init__.py +++ b/chargebee/models/portal_session/__init__.py @@ -1,3 +1,2 @@ from .operations import PortalSession from .responses import PortalSessionResponse -from .types import LinkedCustomer, Status diff --git a/chargebee/models/portal_session/operations.py b/chargebee/models/portal_session/operations.py index 38a38d5..26b330b 100644 --- a/chargebee/models/portal_session/operations.py +++ b/chargebee/models/portal_session/operations.py @@ -1,13 +1,32 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class PortalSession: + class Status(Enum): + CREATED = "created" + LOGGED_IN = "logged_in" + LOGGED_OUT = "logged_out" + NOT_YET_ACTIVATED = "not_yet_activated" + ACTIVATED = "activated" + + def __str__(self): + return self.value + + class LinkedCustomer(TypedDict): + customer_id: Required[str] + email: NotRequired[str] + has_billing_address: Required[bool] + has_payment_method: Required[bool] + has_active_subscription: Required[bool] + + class CreateCustomerParams(TypedDict): + id: Required[str] class CreateParams(TypedDict): - customer: Required[CreateCustomerParams] + customer: Required["PortalSession.CreateCustomerParams"] redirect_url: NotRequired[str] forward_url: NotRequired[str] diff --git a/chargebee/models/portal_session/types.py b/chargebee/models/portal_session/types.py deleted file mode 100644 index c083bb7..0000000 --- a/chargebee/models/portal_session/types.py +++ /dev/null @@ -1,25 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - CREATED = "created" - LOGGED_IN = "logged_in" - LOGGED_OUT = "logged_out" - NOT_YET_ACTIVATED = "not_yet_activated" - ACTIVATED = "activated" - - def __str__(self): - return self.value - - -class LinkedCustomer(TypedDict): - customer_id: Required[str] - email: NotRequired[str] - has_billing_address: Required[bool] - has_payment_method: Required[bool] - has_active_subscription: Required[bool] - - -class CreateCustomerParams(TypedDict): - id: Required[str] diff --git a/chargebee/models/price_variant/__init__.py b/chargebee/models/price_variant/__init__.py index ebb1a6e..fd1f066 100644 --- a/chargebee/models/price_variant/__init__.py +++ b/chargebee/models/price_variant/__init__.py @@ -1,3 +1,2 @@ from .operations import PriceVariant from .responses import PriceVariantResponse -from .types import Attribute, Status diff --git a/chargebee/models/price_variant/operations.py b/chargebee/models/price_variant/operations.py index 64a5897..ea9ff85 100644 --- a/chargebee/models/price_variant/operations.py +++ b/chargebee/models/price_variant/operations.py @@ -1,11 +1,30 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class PriceVariant: + class Status(Enum): + ACTIVE = "active" + ARCHIVED = "archived" + DELETED = "deleted" + + def __str__(self): + return self.value + + class Attribute(TypedDict): + name: Required[str] + value: Required[str] + + class CreateAttributeParams(TypedDict): + name: Required[str] + value: Required[str] + + class UpdateAttributeParams(TypedDict): + name: Required[str] + value: Required[str] class CreateParams(TypedDict): id: Required[str] @@ -13,15 +32,15 @@ class CreateParams(TypedDict): external_name: NotRequired[str] description: NotRequired[str] variant_group: NotRequired[str] - attributes: Required[List[CreateAttributeParams]] + attributes: Required[List["PriceVariant.CreateAttributeParams"]] class UpdateParams(TypedDict): name: NotRequired[str] external_name: NotRequired[str] description: NotRequired[str] variant_group: NotRequired[str] - status: NotRequired[Status] - attributes: Required[List[UpdateAttributeParams]] + status: NotRequired["PriceVariant.Status"] + attributes: Required[List["PriceVariant.UpdateAttributeParams"]] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/price_variant/types.py b/chargebee/models/price_variant/types.py deleted file mode 100644 index 11c1501..0000000 --- a/chargebee/models/price_variant/types.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Status(Enum): - ACTIVE = "active" - ARCHIVED = "archived" - DELETED = "deleted" - - def __str__(self): - return self.value - - -class Attribute(TypedDict): - name: Required[str] - value: Required[str] - - -class CreateAttributeParams(TypedDict): - name: Required[str] - value: Required[str] - - -class UpdateAttributeParams(TypedDict): - name: Required[str] - value: Required[str] diff --git a/chargebee/models/pricing_page_session/operations.py b/chargebee/models/pricing_page_session/operations.py index 542c768..5e3685c 100644 --- a/chargebee/models/pricing_page_session/operations.py +++ b/chargebee/models/pricing_page_session/operations.py @@ -1,24 +1,91 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from chargebee.models import enums class PricingPageSession: + class CreateForNewSubscriptionPricingPageParams(TypedDict): + id: Required[str] + + class CreateForNewSubscriptionSubscriptionParams(TypedDict): + id: NotRequired[str] + + class CreateForNewSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + + class CreateForNewSubscriptionBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForNewSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForExistingSubscriptionPricingPageParams(TypedDict): + id: Required[str] + + class CreateForExistingSubscriptionSubscriptionParams(TypedDict): + id: Required[str] + class CreateForNewSubscriptionParams(TypedDict): redirect_url: NotRequired[str] - pricing_page: Required[CreateForNewSubscriptionPricingPageParams] - subscription: NotRequired[CreateForNewSubscriptionSubscriptionParams] + pricing_page: Required[ + "PricingPageSession.CreateForNewSubscriptionPricingPageParams" + ] + subscription: NotRequired[ + "PricingPageSession.CreateForNewSubscriptionSubscriptionParams" + ] business_entity_id: NotRequired[str] - customer: NotRequired[CreateForNewSubscriptionCustomerParams] - billing_address: NotRequired[CreateForNewSubscriptionBillingAddressParams] - shipping_address: NotRequired[CreateForNewSubscriptionShippingAddressParams] + customer: NotRequired[ + "PricingPageSession.CreateForNewSubscriptionCustomerParams" + ] + billing_address: NotRequired[ + "PricingPageSession.CreateForNewSubscriptionBillingAddressParams" + ] + shipping_address: NotRequired[ + "PricingPageSession.CreateForNewSubscriptionShippingAddressParams" + ] class CreateForExistingSubscriptionParams(TypedDict): redirect_url: NotRequired[str] - pricing_page: Required[CreateForExistingSubscriptionPricingPageParams] - subscription: Required[CreateForExistingSubscriptionSubscriptionParams] + pricing_page: Required[ + "PricingPageSession.CreateForExistingSubscriptionPricingPageParams" + ] + subscription: Required[ + "PricingPageSession.CreateForExistingSubscriptionSubscriptionParams" + ] @staticmethod def create_for_new_subscription( diff --git a/chargebee/models/pricing_page_session/types.py b/chargebee/models/pricing_page_session/types.py deleted file mode 100644 index 43cedb5..0000000 --- a/chargebee/models/pricing_page_session/types.py +++ /dev/null @@ -1,62 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums - - -class CreateForNewSubscriptionPricingPageParams(TypedDict): - id: Required[str] - - -class CreateForNewSubscriptionSubscriptionParams(TypedDict): - id: NotRequired[str] - - -class CreateForNewSubscriptionCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - - -class CreateForNewSubscriptionBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForNewSubscriptionShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForExistingSubscriptionPricingPageParams(TypedDict): - id: Required[str] - - -class CreateForExistingSubscriptionSubscriptionParams(TypedDict): - id: Required[str] diff --git a/chargebee/models/promotional_credit/__init__.py b/chargebee/models/promotional_credit/__init__.py index 60c0756..4e9a1ec 100644 --- a/chargebee/models/promotional_credit/__init__.py +++ b/chargebee/models/promotional_credit/__init__.py @@ -1,3 +1,2 @@ from .operations import PromotionalCredit from .responses import PromotionalCreditResponse -from .types import Type diff --git a/chargebee/models/promotional_credit/operations.py b/chargebee/models/promotional_credit/operations.py index 343b585..4ea157a 100644 --- a/chargebee/models/promotional_credit/operations.py +++ b/chargebee/models/promotional_credit/operations.py @@ -1,12 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class PromotionalCredit: + class Type(Enum): + INCREMENT = "increment" + DECREMENT = "decrement" + + def __str__(self): + return self.value class AddParams(TypedDict): customer_id: Required[str] diff --git a/chargebee/models/promotional_credit/types.py b/chargebee/models/promotional_credit/types.py deleted file mode 100644 index f4f85bc..0000000 --- a/chargebee/models/promotional_credit/types.py +++ /dev/null @@ -1,11 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Type(Enum): - INCREMENT = "increment" - DECREMENT = "decrement" - - def __str__(self): - return self.value diff --git a/chargebee/models/purchase/operations.py b/chargebee/models/purchase/operations.py index 859037f..b514ff9 100644 --- a/chargebee/models/purchase/operations.py +++ b/chargebee/models/purchase/operations.py @@ -1,33 +1,169 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from chargebee.models import enums, contract_term class Purchase: + class CreatePurchaseItemParams(TypedDict): + index: Required[int] + item_price_id: Required[str] + quantity: NotRequired[int] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + + class CreateItemTierParams(TypedDict): + index: Required[int] + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateShippingAddressParams(TypedDict): + 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: NotRequired[str] + state_code: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateDiscountParams(TypedDict): + index: NotRequired[int] + coupon_id: NotRequired[str] + percentage: NotRequired[float] + amount: NotRequired[int] + included_in_mrr: NotRequired[bool] + + class CreateSubscriptionInfoParams(TypedDict): + index: Required[int] + subscription_id: NotRequired[str] + billing_cycles: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + meta_data: NotRequired[Dict[Any, Any]] + + class CreateContractTermParams(TypedDict): + index: Required[int] + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateInvoiceInfoParams(TypedDict): + po_number: NotRequired[str] + notes: NotRequired[str] + + class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateInstallmentInfoParams(TypedDict): + config_id: NotRequired[str] + amount: NotRequired[int] + + class EstimatePurchaseItemParams(TypedDict): + index: Required[int] + item_price_id: Required[str] + quantity: NotRequired[int] + unit_amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + + class EstimateItemTierParams(TypedDict): + index: Required[int] + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class EstimateShippingAddressParams(TypedDict): + 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: NotRequired[str] + state_code: NotRequired[str] + country: NotRequired[str] + zip: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EstimateDiscountParams(TypedDict): + index: NotRequired[int] + coupon_id: NotRequired[str] + percentage: NotRequired[float] + amount: NotRequired[int] + included_in_mrr: NotRequired[bool] + + class EstimateSubscriptionInfoParams(TypedDict): + index: Required[int] + subscription_id: NotRequired[str] + billing_cycles: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class EstimateContractTermParams(TypedDict): + index: Required[int] + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class EstimateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + class EstimateBillingAddressParams(TypedDict): + line1: NotRequired[str] + line2: NotRequired[str] + line3: NotRequired[str] + city: NotRequired[str] + state_code: NotRequired[str] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + class CreateParams(TypedDict): - purchase_items: Required[List[CreatePurchaseItemParams]] - item_tiers: Required[List[CreateItemTierParams]] - shipping_addresses: NotRequired[List[CreateShippingAddressParams]] - discounts: NotRequired[List[CreateDiscountParams]] - subscription_info: Required[List[CreateSubscriptionInfoParams]] - contract_terms: Required[List[CreateContractTermParams]] - invoice_info: NotRequired[CreateInvoiceInfoParams] - statement_descriptor: NotRequired[CreateStatementDescriptorParams] - installment_info: NotRequired[CreateInstallmentInfoParams] + purchase_items: Required[List["Purchase.CreatePurchaseItemParams"]] + item_tiers: Required[List["Purchase.CreateItemTierParams"]] + shipping_addresses: NotRequired[List["Purchase.CreateShippingAddressParams"]] + discounts: NotRequired[List["Purchase.CreateDiscountParams"]] + subscription_info: Required[List["Purchase.CreateSubscriptionInfoParams"]] + contract_terms: Required[List["Purchase.CreateContractTermParams"]] + invoice_info: NotRequired["Purchase.CreateInvoiceInfoParams"] + statement_descriptor: NotRequired["Purchase.CreateStatementDescriptorParams"] + installment_info: NotRequired["Purchase.CreateInstallmentInfoParams"] customer_id: Required[str] payment_source_id: NotRequired[str] class EstimateParams(TypedDict): - purchase_items: Required[List[EstimatePurchaseItemParams]] - item_tiers: Required[List[EstimateItemTierParams]] - shipping_addresses: NotRequired[List[EstimateShippingAddressParams]] - discounts: NotRequired[List[EstimateDiscountParams]] - subscription_info: Required[List[EstimateSubscriptionInfoParams]] - contract_terms: Required[List[EstimateContractTermParams]] - customer: NotRequired[EstimateCustomerParams] - billing_address: NotRequired[EstimateBillingAddressParams] + purchase_items: Required[List["Purchase.EstimatePurchaseItemParams"]] + item_tiers: Required[List["Purchase.EstimateItemTierParams"]] + shipping_addresses: NotRequired[List["Purchase.EstimateShippingAddressParams"]] + discounts: NotRequired[List["Purchase.EstimateDiscountParams"]] + subscription_info: Required[List["Purchase.EstimateSubscriptionInfoParams"]] + contract_terms: Required[List["Purchase.EstimateContractTermParams"]] + customer: NotRequired["Purchase.EstimateCustomerParams"] + billing_address: NotRequired["Purchase.EstimateBillingAddressParams"] client_profile_id: NotRequired[str] customer_id: NotRequired[str] diff --git a/chargebee/models/purchase/types.py b/chargebee/models/purchase/types.py deleted file mode 100644 index c38b45d..0000000 --- a/chargebee/models/purchase/types.py +++ /dev/null @@ -1,155 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums, contract_term - - -class CreatePurchaseItemParams(TypedDict): - index: Required[int] - item_price_id: Required[str] - quantity: NotRequired[int] - unit_amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - - -class CreateItemTierParams(TypedDict): - index: Required[int] - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateShippingAddressParams(TypedDict): - 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: NotRequired[str] - state_code: NotRequired[str] - country: NotRequired[str] - zip: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateDiscountParams(TypedDict): - index: NotRequired[int] - coupon_id: NotRequired[str] - percentage: NotRequired[float] - amount: NotRequired[int] - included_in_mrr: NotRequired[bool] - - -class CreateSubscriptionInfoParams(TypedDict): - index: Required[int] - subscription_id: NotRequired[str] - billing_cycles: NotRequired[int] - contract_term_billing_cycle_on_renewal: NotRequired[int] - meta_data: NotRequired[Dict[Any, Any]] - - -class CreateContractTermParams(TypedDict): - index: Required[int] - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CreateInvoiceInfoParams(TypedDict): - po_number: NotRequired[str] - notes: NotRequired[str] - - -class CreateStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateInstallmentInfoParams(TypedDict): - config_id: NotRequired[str] - amount: NotRequired[int] - - -class EstimatePurchaseItemParams(TypedDict): - index: Required[int] - item_price_id: Required[str] - quantity: NotRequired[int] - unit_amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - - -class EstimateItemTierParams(TypedDict): - index: Required[int] - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class EstimateShippingAddressParams(TypedDict): - 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: NotRequired[str] - state_code: NotRequired[str] - country: NotRequired[str] - zip: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EstimateDiscountParams(TypedDict): - index: NotRequired[int] - coupon_id: NotRequired[str] - percentage: NotRequired[float] - amount: NotRequired[int] - included_in_mrr: NotRequired[bool] - - -class EstimateSubscriptionInfoParams(TypedDict): - index: Required[int] - subscription_id: NotRequired[str] - billing_cycles: NotRequired[int] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class EstimateContractTermParams(TypedDict): - index: Required[int] - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class EstimateCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - exemption_details: NotRequired[List[Dict[Any, Any]]] - customer_type: NotRequired[enums.CustomerType] - - -class EstimateBillingAddressParams(TypedDict): - line1: NotRequired[str] - line2: NotRequired[str] - line3: NotRequired[str] - city: NotRequired[str] - state_code: NotRequired[str] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] diff --git a/chargebee/models/quote/__init__.py b/chargebee/models/quote/__init__.py index bd26c11..a1a5297 100644 --- a/chargebee/models/quote/__init__.py +++ b/chargebee/models/quote/__init__.py @@ -1,14 +1,2 @@ from .operations import Quote from .responses import QuoteResponse -from .types import ( - LineItem, - Discount, - LineItemDiscount, - Tax, - LineItemTax, - LineItemTier, - ShippingAddress, - BillingAddress, - Status, - OperationType, -) diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index c5b013d..971bc0d 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -1,55 +1,957 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, contract_term class Quote: + class Status(Enum): + OPEN = "open" + ACCEPTED = "accepted" + DECLINED = "declined" + INVOICED = "invoiced" + CLOSED = "closed" + + def __str__(self): + return self.value + + class OperationType(Enum): + CREATE_SUBSCRIPTION_FOR_CUSTOMER = "create_subscription_for_customer" + CHANGE_SUBSCRIPTION = "change_subscription" + ONETIME_INVOICE = "onetime_invoice" + + def __str__(self): + return self.value + + class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["Quote.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["Quote.DiscountEntityType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["Quote.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + 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] + + class ShippingAddress(TypedDict): + 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] + index: Required[int] + + class BillingAddress(TypedDict): + 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 CreateSubForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CreateSubForCustomerQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class CreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CreateSubForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class EditCreateSubForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + plan_id: Required[str] + plan_quantity: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price: NotRequired[int] + plan_unit_price_in_decimal: NotRequired[str] + setup_fee: NotRequired[int] + trial_end: NotRequired[int] + start_date: NotRequired[int] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class EditCreateSubForCustomerQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class EditCreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class EditCreateSubForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditCreateSubForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class UpdateSubscriptionQuoteSubscriptionParams(TypedDict): + id: Required[str] + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class UpdateSubscriptionQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + + class UpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class UpdateSubscriptionQuoteBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionQuoteCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + class UpdateSubscriptionQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class EditUpdateSubscriptionQuoteSubscriptionParams(TypedDict): + plan_id: NotRequired[str] + plan_quantity: NotRequired[int] + plan_unit_price: NotRequired[int] + setup_fee: NotRequired[int] + plan_quantity_in_decimal: NotRequired[str] + plan_unit_price_in_decimal: NotRequired[str] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class EditUpdateSubscriptionQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + + class EditUpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class EditUpdateSubscriptionQuoteBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditUpdateSubscriptionQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditUpdateSubscriptionQuoteCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + class EditUpdateSubscriptionQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateForOnetimeChargesAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period: NotRequired[int] + + class CreateForOnetimeChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + class CreateForOnetimeChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForOnetimeChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class EditOneTimeQuoteAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period: NotRequired[int] + + class EditOneTimeQuoteChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + class EditOneTimeQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditOneTimeQuoteTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateSubItemsForCustomerQuoteSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class CreateSubItemsForCustomerQuoteSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class CreateSubItemsForCustomerQuoteDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class CreateSubItemsForCustomerQuoteItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateSubItemsForCustomerQuoteShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateSubItemsForCustomerQuoteContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class EditCreateSubCustomerQuoteForItemsSubscriptionParams(TypedDict): + id: NotRequired[str] + po_number: NotRequired[str] + trial_end: NotRequired[int] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class EditCreateSubCustomerQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class EditCreateSubCustomerQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class EditCreateSubCustomerQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditCreateSubCustomerQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class UpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): + id: Required[str] + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class UpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + class UpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + class UpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + class UpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + + class EditUpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): + setup_fee: NotRequired[int] + start_date: NotRequired[int] + trial_end: NotRequired[int] + coupon: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + contract_term_billing_cycle_on_renewal: NotRequired[int] + + class EditUpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + class EditUpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class EditUpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditUpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditUpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + registered_for_gst: NotRequired[bool] + + class EditUpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["contract_term.ContractTerm.ActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + class CreateForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class EditForChargeItemsAndChargesItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + class EditForChargeItemsAndChargesItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class EditForChargeItemsAndChargesChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + service_period: NotRequired[int] + + class EditForChargeItemsAndChargesShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class EditForChargeItemsAndChargesDiscountParams(TypedDict): + percentage: NotRequired[float] + amount: NotRequired[int] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + + class EditForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class ConvertSubscriptionParams(TypedDict): + id: NotRequired[str] + auto_collection: NotRequired[enums.AutoCollection] + po_number: NotRequired[str] + auto_close_invoices: NotRequired[bool] class CreateSubForCustomerQuoteParams(TypedDict): name: NotRequired[str] notes: NotRequired[str] expires_at: NotRequired[int] - subscription: Required[CreateSubForCustomerQuoteSubscriptionParams] + subscription: Required["Quote.CreateSubForCustomerQuoteSubscriptionParams"] billing_cycles: NotRequired[int] - addons: NotRequired[List[CreateSubForCustomerQuoteAddonParams]] + addons: NotRequired[List["Quote.CreateSubForCustomerQuoteAddonParams"]] event_based_addons: NotRequired[ - List[CreateSubForCustomerQuoteEventBasedAddonParams] + List["Quote.CreateSubForCustomerQuoteEventBasedAddonParams"] ] mandatory_addons_to_remove: NotRequired[List[str]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] - shipping_address: NotRequired[CreateSubForCustomerQuoteShippingAddressParams] - contract_term: NotRequired[CreateSubForCustomerQuoteContractTermParams] + shipping_address: NotRequired[ + "Quote.CreateSubForCustomerQuoteShippingAddressParams" + ] + contract_term: NotRequired["Quote.CreateSubForCustomerQuoteContractTermParams"] coupon_ids: NotRequired[List[str]] class EditCreateSubForCustomerQuoteParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] - subscription: Required[EditCreateSubForCustomerQuoteSubscriptionParams] + subscription: Required["Quote.EditCreateSubForCustomerQuoteSubscriptionParams"] billing_cycles: NotRequired[int] - addons: NotRequired[List[EditCreateSubForCustomerQuoteAddonParams]] + addons: NotRequired[List["Quote.EditCreateSubForCustomerQuoteAddonParams"]] event_based_addons: NotRequired[ - List[EditCreateSubForCustomerQuoteEventBasedAddonParams] + List["Quote.EditCreateSubForCustomerQuoteEventBasedAddonParams"] ] mandatory_addons_to_remove: NotRequired[List[str]] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] shipping_address: NotRequired[ - EditCreateSubForCustomerQuoteShippingAddressParams + "Quote.EditCreateSubForCustomerQuoteShippingAddressParams" + ] + contract_term: NotRequired[ + "Quote.EditCreateSubForCustomerQuoteContractTermParams" ] - contract_term: NotRequired[EditCreateSubForCustomerQuoteContractTermParams] coupon_ids: NotRequired[List[str]] class UpdateSubscriptionQuoteParams(TypedDict): name: NotRequired[str] notes: NotRequired[str] expires_at: NotRequired[int] - subscription: Required[UpdateSubscriptionQuoteSubscriptionParams] - addons: NotRequired[List[UpdateSubscriptionQuoteAddonParams]] + subscription: Required["Quote.UpdateSubscriptionQuoteSubscriptionParams"] + addons: NotRequired[List["Quote.UpdateSubscriptionQuoteAddonParams"]] event_based_addons: NotRequired[ - List[UpdateSubscriptionQuoteEventBasedAddonParams] + List["Quote.UpdateSubscriptionQuoteEventBasedAddonParams"] ] replace_addon_list: NotRequired[bool] mandatory_addons_to_remove: NotRequired[List[str]] @@ -63,18 +965,22 @@ class UpdateSubscriptionQuoteParams(TypedDict): changes_scheduled_at: NotRequired[int] force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] - billing_address: NotRequired[UpdateSubscriptionQuoteBillingAddressParams] - shipping_address: NotRequired[UpdateSubscriptionQuoteShippingAddressParams] - customer: NotRequired[UpdateSubscriptionQuoteCustomerParams] - contract_term: NotRequired[UpdateSubscriptionQuoteContractTermParams] + billing_address: NotRequired[ + "Quote.UpdateSubscriptionQuoteBillingAddressParams" + ] + shipping_address: NotRequired[ + "Quote.UpdateSubscriptionQuoteShippingAddressParams" + ] + customer: NotRequired["Quote.UpdateSubscriptionQuoteCustomerParams"] + contract_term: NotRequired["Quote.UpdateSubscriptionQuoteContractTermParams"] class EditUpdateSubscriptionQuoteParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] - subscription: NotRequired[EditUpdateSubscriptionQuoteSubscriptionParams] - addons: NotRequired[List[EditUpdateSubscriptionQuoteAddonParams]] + subscription: NotRequired["Quote.EditUpdateSubscriptionQuoteSubscriptionParams"] + addons: NotRequired[List["Quote.EditUpdateSubscriptionQuoteAddonParams"]] event_based_addons: NotRequired[ - List[EditUpdateSubscriptionQuoteEventBasedAddonParams] + List["Quote.EditUpdateSubscriptionQuoteEventBasedAddonParams"] ] replace_addon_list: NotRequired[bool] mandatory_addons_to_remove: NotRequired[List[str]] @@ -88,10 +994,16 @@ class EditUpdateSubscriptionQuoteParams(TypedDict): changes_scheduled_at: NotRequired[int] force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] - billing_address: NotRequired[EditUpdateSubscriptionQuoteBillingAddressParams] - shipping_address: NotRequired[EditUpdateSubscriptionQuoteShippingAddressParams] - customer: NotRequired[EditUpdateSubscriptionQuoteCustomerParams] - contract_term: NotRequired[EditUpdateSubscriptionQuoteContractTermParams] + billing_address: NotRequired[ + "Quote.EditUpdateSubscriptionQuoteBillingAddressParams" + ] + shipping_address: NotRequired[ + "Quote.EditUpdateSubscriptionQuoteShippingAddressParams" + ] + customer: NotRequired["Quote.EditUpdateSubscriptionQuoteCustomerParams"] + contract_term: NotRequired[ + "Quote.EditUpdateSubscriptionQuoteContractTermParams" + ] class CreateForOnetimeChargesParams(TypedDict): name: NotRequired[str] @@ -100,13 +1012,15 @@ class CreateForOnetimeChargesParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] currency_code: NotRequired[str] - addons: NotRequired[List[CreateForOnetimeChargesAddonParams]] - charges: NotRequired[List[CreateForOnetimeChargesChargeParams]] + addons: NotRequired[List["Quote.CreateForOnetimeChargesAddonParams"]] + charges: NotRequired[List["Quote.CreateForOnetimeChargesChargeParams"]] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] - shipping_address: NotRequired[CreateForOnetimeChargesShippingAddressParams] + shipping_address: NotRequired[ + "Quote.CreateForOnetimeChargesShippingAddressParams" + ] tax_providers_fields: NotRequired[ - List[CreateForOnetimeChargesTaxProvidersFieldParams] + List["Quote.CreateForOnetimeChargesTaxProvidersFieldParams"] ] class EditOneTimeQuoteParams(TypedDict): @@ -114,64 +1028,84 @@ class EditOneTimeQuoteParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] currency_code: NotRequired[str] - addons: NotRequired[List[EditOneTimeQuoteAddonParams]] - charges: NotRequired[List[EditOneTimeQuoteChargeParams]] + addons: NotRequired[List["Quote.EditOneTimeQuoteAddonParams"]] + charges: NotRequired[List["Quote.EditOneTimeQuoteChargeParams"]] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] - shipping_address: NotRequired[EditOneTimeQuoteShippingAddressParams] - tax_providers_fields: NotRequired[List[EditOneTimeQuoteTaxProvidersFieldParams]] + shipping_address: NotRequired["Quote.EditOneTimeQuoteShippingAddressParams"] + tax_providers_fields: NotRequired[ + List["Quote.EditOneTimeQuoteTaxProvidersFieldParams"] + ] class CreateSubItemsForCustomerQuoteParams(TypedDict): name: NotRequired[str] notes: NotRequired[str] expires_at: NotRequired[int] - subscription: NotRequired[CreateSubItemsForCustomerQuoteSubscriptionParams] + subscription: NotRequired[ + "Quote.CreateSubItemsForCustomerQuoteSubscriptionParams" + ] billing_cycles: NotRequired[int] subscription_items: Required[ - List[CreateSubItemsForCustomerQuoteSubscriptionItemParams] + List["Quote.CreateSubItemsForCustomerQuoteSubscriptionItemParams"] ] - discounts: Required[List[CreateSubItemsForCustomerQuoteDiscountParams]] + discounts: Required[List["Quote.CreateSubItemsForCustomerQuoteDiscountParams"]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[CreateSubItemsForCustomerQuoteItemTierParams]] + item_tiers: NotRequired[ + List["Quote.CreateSubItemsForCustomerQuoteItemTierParams"] + ] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] shipping_address: NotRequired[ - CreateSubItemsForCustomerQuoteShippingAddressParams + "Quote.CreateSubItemsForCustomerQuoteShippingAddressParams" + ] + contract_term: NotRequired[ + "Quote.CreateSubItemsForCustomerQuoteContractTermParams" ] - contract_term: NotRequired[CreateSubItemsForCustomerQuoteContractTermParams] coupon_ids: NotRequired[List[str]] class EditCreateSubCustomerQuoteForItemsParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] - subscription: NotRequired[EditCreateSubCustomerQuoteForItemsSubscriptionParams] + subscription: NotRequired[ + "Quote.EditCreateSubCustomerQuoteForItemsSubscriptionParams" + ] billing_cycles: NotRequired[int] subscription_items: Required[ - List[EditCreateSubCustomerQuoteForItemsSubscriptionItemParams] + List["Quote.EditCreateSubCustomerQuoteForItemsSubscriptionItemParams"] + ] + discounts: Required[ + List["Quote.EditCreateSubCustomerQuoteForItemsDiscountParams"] ] - discounts: Required[List[EditCreateSubCustomerQuoteForItemsDiscountParams]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[EditCreateSubCustomerQuoteForItemsItemTierParams]] + item_tiers: NotRequired[ + List["Quote.EditCreateSubCustomerQuoteForItemsItemTierParams"] + ] terms_to_charge: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] shipping_address: NotRequired[ - EditCreateSubCustomerQuoteForItemsShippingAddressParams + "Quote.EditCreateSubCustomerQuoteForItemsShippingAddressParams" + ] + contract_term: NotRequired[ + "Quote.EditCreateSubCustomerQuoteForItemsContractTermParams" ] - contract_term: NotRequired[EditCreateSubCustomerQuoteForItemsContractTermParams] coupon_ids: NotRequired[List[str]] class UpdateSubscriptionQuoteForItemsParams(TypedDict): name: NotRequired[str] notes: NotRequired[str] expires_at: NotRequired[int] - subscription: Required[UpdateSubscriptionQuoteForItemsSubscriptionParams] + subscription: Required[ + "Quote.UpdateSubscriptionQuoteForItemsSubscriptionParams" + ] subscription_items: Required[ - List[UpdateSubscriptionQuoteForItemsSubscriptionItemParams] + List["Quote.UpdateSubscriptionQuoteForItemsSubscriptionItemParams"] ] mandatory_items_to_remove: NotRequired[List[str]] replace_items_list: NotRequired[bool] - discounts: Required[List[UpdateSubscriptionQuoteForItemsDiscountParams]] - item_tiers: NotRequired[List[UpdateSubscriptionQuoteForItemsItemTierParams]] + discounts: Required[List["Quote.UpdateSubscriptionQuoteForItemsDiscountParams"]] + item_tiers: NotRequired[ + List["Quote.UpdateSubscriptionQuoteForItemsItemTierParams"] + ] billing_cycles: NotRequired[int] terms_to_charge: NotRequired[int] reactivate_from: NotRequired[int] @@ -183,25 +1117,33 @@ class UpdateSubscriptionQuoteForItemsParams(TypedDict): force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] billing_address: NotRequired[ - UpdateSubscriptionQuoteForItemsBillingAddressParams + "Quote.UpdateSubscriptionQuoteForItemsBillingAddressParams" ] shipping_address: NotRequired[ - UpdateSubscriptionQuoteForItemsShippingAddressParams + "Quote.UpdateSubscriptionQuoteForItemsShippingAddressParams" + ] + customer: NotRequired["Quote.UpdateSubscriptionQuoteForItemsCustomerParams"] + contract_term: NotRequired[ + "Quote.UpdateSubscriptionQuoteForItemsContractTermParams" ] - customer: NotRequired[UpdateSubscriptionQuoteForItemsCustomerParams] - contract_term: NotRequired[UpdateSubscriptionQuoteForItemsContractTermParams] class EditUpdateSubscriptionQuoteForItemsParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] subscription_items: Required[ - List[EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams] + List["Quote.EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams"] ] mandatory_items_to_remove: NotRequired[List[str]] replace_items_list: NotRequired[bool] - subscription: NotRequired[EditUpdateSubscriptionQuoteForItemsSubscriptionParams] - discounts: Required[List[EditUpdateSubscriptionQuoteForItemsDiscountParams]] - item_tiers: NotRequired[List[EditUpdateSubscriptionQuoteForItemsItemTierParams]] + subscription: NotRequired[ + "Quote.EditUpdateSubscriptionQuoteForItemsSubscriptionParams" + ] + discounts: Required[ + List["Quote.EditUpdateSubscriptionQuoteForItemsDiscountParams"] + ] + item_tiers: NotRequired[ + List["Quote.EditUpdateSubscriptionQuoteForItemsItemTierParams"] + ] billing_cycles: NotRequired[int] terms_to_charge: NotRequired[int] reactivate_from: NotRequired[int] @@ -213,14 +1155,14 @@ class EditUpdateSubscriptionQuoteForItemsParams(TypedDict): force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] billing_address: NotRequired[ - EditUpdateSubscriptionQuoteForItemsBillingAddressParams + "Quote.EditUpdateSubscriptionQuoteForItemsBillingAddressParams" ] shipping_address: NotRequired[ - EditUpdateSubscriptionQuoteForItemsShippingAddressParams + "Quote.EditUpdateSubscriptionQuoteForItemsShippingAddressParams" ] - customer: NotRequired[EditUpdateSubscriptionQuoteForItemsCustomerParams] + customer: NotRequired["Quote.EditUpdateSubscriptionQuoteForItemsCustomerParams"] contract_term: NotRequired[ - EditUpdateSubscriptionQuoteForItemsContractTermParams + "Quote.EditUpdateSubscriptionQuoteForItemsContractTermParams" ] class CreateForChargeItemsAndChargesParams(TypedDict): @@ -230,17 +1172,21 @@ class CreateForChargeItemsAndChargesParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] currency_code: NotRequired[str] - item_prices: NotRequired[List[CreateForChargeItemsAndChargesItemPriceParams]] - item_tiers: NotRequired[List[CreateForChargeItemsAndChargesItemTierParams]] - charges: NotRequired[List[CreateForChargeItemsAndChargesChargeParams]] + item_prices: NotRequired[ + List["Quote.CreateForChargeItemsAndChargesItemPriceParams"] + ] + item_tiers: NotRequired[ + List["Quote.CreateForChargeItemsAndChargesItemTierParams"] + ] + charges: NotRequired[List["Quote.CreateForChargeItemsAndChargesChargeParams"]] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] shipping_address: NotRequired[ - CreateForChargeItemsAndChargesShippingAddressParams + "Quote.CreateForChargeItemsAndChargesShippingAddressParams" ] - discounts: Required[List[CreateForChargeItemsAndChargesDiscountParams]] + discounts: Required[List["Quote.CreateForChargeItemsAndChargesDiscountParams"]] tax_providers_fields: NotRequired[ - List[CreateForChargeItemsAndChargesTaxProvidersFieldParams] + List["Quote.CreateForChargeItemsAndChargesTaxProvidersFieldParams"] ] class EditForChargeItemsAndChargesParams(TypedDict): @@ -248,15 +1194,21 @@ class EditForChargeItemsAndChargesParams(TypedDict): notes: NotRequired[str] expires_at: NotRequired[int] currency_code: NotRequired[str] - item_prices: NotRequired[List[EditForChargeItemsAndChargesItemPriceParams]] - item_tiers: NotRequired[List[EditForChargeItemsAndChargesItemTierParams]] - charges: NotRequired[List[EditForChargeItemsAndChargesChargeParams]] + item_prices: NotRequired[ + List["Quote.EditForChargeItemsAndChargesItemPriceParams"] + ] + item_tiers: NotRequired[ + List["Quote.EditForChargeItemsAndChargesItemTierParams"] + ] + charges: NotRequired[List["Quote.EditForChargeItemsAndChargesChargeParams"]] coupon: NotRequired[str] coupon_ids: NotRequired[List[str]] - shipping_address: NotRequired[EditForChargeItemsAndChargesShippingAddressParams] - discounts: Required[List[EditForChargeItemsAndChargesDiscountParams]] + shipping_address: NotRequired[ + "Quote.EditForChargeItemsAndChargesShippingAddressParams" + ] + discounts: Required[List["Quote.EditForChargeItemsAndChargesDiscountParams"]] tax_providers_fields: NotRequired[ - List[EditForChargeItemsAndChargesTaxProvidersFieldParams] + List["Quote.EditForChargeItemsAndChargesTaxProvidersFieldParams"] ] class ListParams(TypedDict): @@ -276,13 +1228,13 @@ class QuoteLineGroupsForQuoteParams(TypedDict): offset: NotRequired[str] class ConvertParams(TypedDict): - subscription: NotRequired[ConvertSubscriptionParams] + subscription: NotRequired["Quote.ConvertSubscriptionParams"] invoice_date: NotRequired[int] create_pending_invoices: NotRequired[bool] first_invoice_pending: NotRequired[bool] class UpdateStatusParams(TypedDict): - status: Required[Status] + status: Required["Quote.Status"] comment: NotRequired[str] class ExtendExpiryDateParams(TypedDict): diff --git a/chargebee/models/quote/types.py b/chargebee/models/quote/types.py deleted file mode 100644 index 873e00c..0000000 --- a/chargebee/models/quote/types.py +++ /dev/null @@ -1,987 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, contract_term - - -class Status(Enum): - OPEN = "open" - ACCEPTED = "accepted" - DECLINED = "declined" - INVOICED = "invoiced" - CLOSED = "closed" - - def __str__(self): - return self.value - - -class OperationType(Enum): - CREATE_SUBSCRIPTION_FOR_CUSTOMER = "create_subscription_for_customer" - CHANGE_SUBSCRIPTION = "change_subscription" - ONETIME_INVOICE = "onetime_invoice" - - def __str__(self): - return self.value - - -class LineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[LineItemDiscountDiscountType] - coupon_id: NotRequired[str] - 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] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - 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] - - -class ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class BillingAddress(TypedDict): - 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 CreateSubForCustomerQuoteSubscriptionParams(TypedDict): - id: NotRequired[str] - po_number: NotRequired[str] - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price: NotRequired[int] - plan_unit_price_in_decimal: NotRequired[str] - setup_fee: NotRequired[int] - trial_end: NotRequired[int] - start_date: NotRequired[int] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CreateSubForCustomerQuoteAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class CreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CreateSubForCustomerQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubForCustomerQuoteContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class EditCreateSubForCustomerQuoteSubscriptionParams(TypedDict): - id: NotRequired[str] - po_number: NotRequired[str] - plan_id: Required[str] - plan_quantity: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price: NotRequired[int] - plan_unit_price_in_decimal: NotRequired[str] - setup_fee: NotRequired[int] - trial_end: NotRequired[int] - start_date: NotRequired[int] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class EditCreateSubForCustomerQuoteAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class EditCreateSubForCustomerQuoteEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class EditCreateSubForCustomerQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditCreateSubForCustomerQuoteContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class UpdateSubscriptionQuoteSubscriptionParams(TypedDict): - id: Required[str] - plan_id: NotRequired[str] - plan_quantity: NotRequired[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class UpdateSubscriptionQuoteAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - - -class UpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - charge_on: NotRequired[enums.ChargeOn] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class UpdateSubscriptionQuoteBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionQuoteCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - - -class UpdateSubscriptionQuoteContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class EditUpdateSubscriptionQuoteSubscriptionParams(TypedDict): - plan_id: NotRequired[str] - plan_quantity: NotRequired[int] - plan_unit_price: NotRequired[int] - setup_fee: NotRequired[int] - plan_quantity_in_decimal: NotRequired[str] - plan_unit_price_in_decimal: NotRequired[str] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class EditUpdateSubscriptionQuoteAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - - -class EditUpdateSubscriptionQuoteEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - charge_on: NotRequired[enums.ChargeOn] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class EditUpdateSubscriptionQuoteBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditUpdateSubscriptionQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditUpdateSubscriptionQuoteCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - - -class EditUpdateSubscriptionQuoteContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CreateForOnetimeChargesAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period: NotRequired[int] - - -class CreateForOnetimeChargesChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - service_period: NotRequired[int] - - -class CreateForOnetimeChargesShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForOnetimeChargesTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class EditOneTimeQuoteAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period: NotRequired[int] - - -class EditOneTimeQuoteChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - service_period: NotRequired[int] - - -class EditOneTimeQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditOneTimeQuoteTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateSubItemsForCustomerQuoteSubscriptionParams(TypedDict): - id: NotRequired[str] - po_number: NotRequired[str] - trial_end: NotRequired[int] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class CreateSubItemsForCustomerQuoteSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class CreateSubItemsForCustomerQuoteDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class CreateSubItemsForCustomerQuoteItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateSubItemsForCustomerQuoteShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateSubItemsForCustomerQuoteContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class EditCreateSubCustomerQuoteForItemsSubscriptionParams(TypedDict): - id: NotRequired[str] - po_number: NotRequired[str] - trial_end: NotRequired[int] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class EditCreateSubCustomerQuoteForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class EditCreateSubCustomerQuoteForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class EditCreateSubCustomerQuoteForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class EditCreateSubCustomerQuoteForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditCreateSubCustomerQuoteForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class UpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): - id: Required[str] - setup_fee: NotRequired[int] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class UpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - charge_on_option: NotRequired[enums.ChargeOnOption] - item_type: NotRequired[enums.ItemType] - - -class UpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - operation_type: Required[enums.OperationType] - id: NotRequired[str] - - -class UpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - - -class UpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class EditUpdateSubscriptionQuoteForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - charge_on_option: NotRequired[enums.ChargeOnOption] - item_type: NotRequired[enums.ItemType] - - -class EditUpdateSubscriptionQuoteForItemsSubscriptionParams(TypedDict): - setup_fee: NotRequired[int] - start_date: NotRequired[int] - trial_end: NotRequired[int] - coupon: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - contract_term_billing_cycle_on_renewal: NotRequired[int] - - -class EditUpdateSubscriptionQuoteForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - operation_type: Required[enums.OperationType] - id: NotRequired[str] - - -class EditUpdateSubscriptionQuoteForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class EditUpdateSubscriptionQuoteForItemsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditUpdateSubscriptionQuoteForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditUpdateSubscriptionQuoteForItemsCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - registered_for_gst: NotRequired[bool] - - -class EditUpdateSubscriptionQuoteForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired["contract_term.ActionAtTermEnd"] - cancellation_cutoff_period: NotRequired[int] - - -class CreateForChargeItemsAndChargesItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period_days: NotRequired[int] - - -class CreateForChargeItemsAndChargesItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateForChargeItemsAndChargesChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - service_period: NotRequired[int] - - -class CreateForChargeItemsAndChargesShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForChargeItemsAndChargesDiscountParams(TypedDict): - percentage: NotRequired[float] - amount: NotRequired[int] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - - -class CreateForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class EditForChargeItemsAndChargesItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period_days: NotRequired[int] - - -class EditForChargeItemsAndChargesItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class EditForChargeItemsAndChargesChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - service_period: NotRequired[int] - - -class EditForChargeItemsAndChargesShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class EditForChargeItemsAndChargesDiscountParams(TypedDict): - percentage: NotRequired[float] - amount: NotRequired[int] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - - -class EditForChargeItemsAndChargesTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class ConvertSubscriptionParams(TypedDict): - id: NotRequired[str] - auto_collection: NotRequired[enums.AutoCollection] - po_number: NotRequired[str] - auto_close_invoices: NotRequired[bool] diff --git a/chargebee/models/quote_line_group/__init__.py b/chargebee/models/quote_line_group/__init__.py index fd768e0..395b783 100644 --- a/chargebee/models/quote_line_group/__init__.py +++ b/chargebee/models/quote_line_group/__init__.py @@ -1,3 +1,2 @@ from .operations import QuoteLineGroup from .responses import QuoteLineGroupResponse -from .types import LineItem, Discount, LineItemDiscount, Tax, LineItemTax, ChargeEvent diff --git a/chargebee/models/quote_line_group/operations.py b/chargebee/models/quote_line_group/operations.py index ec7f72b..8fcdb97 100644 --- a/chargebee/models/quote_line_group/operations.py +++ b/chargebee/models/quote_line_group/operations.py @@ -1,9 +1,116 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class QuoteLineGroup: + class ChargeEvent(Enum): + IMMEDIATE = "immediate" + SUBSCRIPTION_CREATION = "subscription_creation" + TRIAL_START = "trial_start" + SUBSCRIPTION_CHANGE = "subscription_change" + SUBSCRIPTION_RENEWAL = "subscription_renewal" + SUBSCRIPTION_CANCEL = "subscription_cancel" + + def __str__(self): + return self.value + + class LineItemEntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class DiscountEntityType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItemDiscountDiscountType(Enum): + ITEM_LEVEL_COUPON = "item_level_coupon" + DOCUMENT_LEVEL_COUPON = "document_level_coupon" + PROMOTIONAL_CREDITS = "promotional_credits" + PRORATED_CREDITS = "prorated_credits" + ITEM_LEVEL_DISCOUNT = "item_level_discount" + DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" + + def __str__(self): + return self.value + + class LineItem(TypedDict): + id: NotRequired[str] + subscription_id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + unit_amount: Required[int] + quantity: NotRequired[int] + amount: NotRequired[int] + pricing_model: NotRequired[enums.PricingModel] + is_taxed: Required[bool] + tax_amount: NotRequired[int] + tax_rate: NotRequired[float] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + item_level_discount_amount: NotRequired[int] + usage_percentage: NotRequired[str] + reference_line_item_id: NotRequired[str] + description: Required[str] + entity_description: NotRequired[str] + entity_type: Required["QuoteLineGroup.LineItemEntityType"] + tax_exempt_reason: NotRequired[enums.TaxExemptReason] + entity_id: NotRequired[str] + customer_id: NotRequired[str] + + class Discount(TypedDict): + amount: Required[int] + description: NotRequired[str] + entity_type: Required["QuoteLineGroup.DiscountEntityType"] + entity_id: NotRequired[str] + coupon_set_code: NotRequired[str] + + class LineItemDiscount(TypedDict): + line_item_id: Required[str] + discount_type: Required["QuoteLineGroup.LineItemDiscountDiscountType"] + coupon_id: NotRequired[str] + 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] + tax_rate: Required[float] + date_to: NotRequired[int] + date_from: NotRequired[int] + prorated_taxable_amount: NotRequired[float] + is_partial_tax_applied: NotRequired[bool] + is_non_compliance_tax: NotRequired[bool] + taxable_amount: Required[int] + tax_amount: Required[int] + tax_juris_type: NotRequired[enums.TaxJurisType] + tax_juris_name: NotRequired[str] + tax_juris_code: NotRequired[str] + tax_amount_in_local_currency: NotRequired[int] + local_currency_code: NotRequired[str] pass diff --git a/chargebee/models/quote_line_group/types.py b/chargebee/models/quote_line_group/types.py deleted file mode 100644 index 7b268d9..0000000 --- a/chargebee/models/quote_line_group/types.py +++ /dev/null @@ -1,119 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class ChargeEvent(Enum): - IMMEDIATE = "immediate" - SUBSCRIPTION_CREATION = "subscription_creation" - TRIAL_START = "trial_start" - SUBSCRIPTION_CHANGE = "subscription_change" - SUBSCRIPTION_RENEWAL = "subscription_renewal" - SUBSCRIPTION_CANCEL = "subscription_cancel" - - def __str__(self): - return self.value - - -class LineItemEntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class DiscountEntityType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItemDiscountDiscountType(Enum): - ITEM_LEVEL_COUPON = "item_level_coupon" - DOCUMENT_LEVEL_COUPON = "document_level_coupon" - PROMOTIONAL_CREDITS = "promotional_credits" - PRORATED_CREDITS = "prorated_credits" - ITEM_LEVEL_DISCOUNT = "item_level_discount" - DOCUMENT_LEVEL_DISCOUNT = "document_level_discount" - - def __str__(self): - return self.value - - -class LineItem(TypedDict): - id: NotRequired[str] - subscription_id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - unit_amount: Required[int] - quantity: NotRequired[int] - amount: NotRequired[int] - pricing_model: NotRequired[enums.PricingModel] - is_taxed: Required[bool] - tax_amount: NotRequired[int] - tax_rate: NotRequired[float] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - item_level_discount_amount: NotRequired[int] - usage_percentage: NotRequired[str] - reference_line_item_id: NotRequired[str] - description: Required[str] - entity_description: NotRequired[str] - entity_type: Required[LineItemEntityType] - tax_exempt_reason: NotRequired[enums.TaxExemptReason] - entity_id: NotRequired[str] - customer_id: NotRequired[str] - - -class Discount(TypedDict): - amount: Required[int] - description: NotRequired[str] - entity_type: Required[DiscountEntityType] - entity_id: NotRequired[str] - coupon_set_code: NotRequired[str] - - -class LineItemDiscount(TypedDict): - line_item_id: Required[str] - discount_type: Required[LineItemDiscountDiscountType] - coupon_id: NotRequired[str] - 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] - tax_rate: Required[float] - date_to: NotRequired[int] - date_from: NotRequired[int] - prorated_taxable_amount: NotRequired[float] - is_partial_tax_applied: NotRequired[bool] - is_non_compliance_tax: NotRequired[bool] - taxable_amount: Required[int] - tax_amount: Required[int] - tax_juris_type: NotRequired[enums.TaxJurisType] - tax_juris_name: NotRequired[str] - tax_juris_code: NotRequired[str] - tax_amount_in_local_currency: NotRequired[int] - local_currency_code: NotRequired[str] diff --git a/chargebee/models/quoted_charge/__init__.py b/chargebee/models/quoted_charge/__init__.py index 6356128..b653113 100644 --- a/chargebee/models/quoted_charge/__init__.py +++ b/chargebee/models/quoted_charge/__init__.py @@ -1,3 +1,2 @@ from .operations import QuotedCharge from .responses import QuotedChargeResponse -from .types import Charge, Addon, InvoiceItem, ItemTier, Coupon diff --git a/chargebee/models/quoted_charge/operations.py b/chargebee/models/quoted_charge/operations.py index ebb602c..7e7ec95 100644 --- a/chargebee/models/quoted_charge/operations.py +++ b/chargebee/models/quoted_charge/operations.py @@ -1,9 +1,48 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from chargebee.models import enums class QuotedCharge: + class Charge(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + service_period_in_days: NotRequired[int] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + + class InvoiceItem(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + class Coupon(TypedDict): + coupon_id: Required[str] + + class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] + service_period: NotRequired[int] + pass diff --git a/chargebee/models/quoted_charge/types.py b/chargebee/models/quoted_charge/types.py deleted file mode 100644 index f85eb39..0000000 --- a/chargebee/models/quoted_charge/types.py +++ /dev/null @@ -1,46 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums - - -class Charge(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - service_period_in_days: NotRequired[int] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - - -class InvoiceItem(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period_days: NotRequired[int] - - -class ItemTier(TypedDict): - item_price_id: Required[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - index: Required[int] - - -class Coupon(TypedDict): - coupon_id: Required[str] - - -class Addon(TypedDict): - id: Required[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - proration_type: NotRequired[enums.ProrationType] - service_period: NotRequired[int] diff --git a/chargebee/models/quoted_subscription/__init__.py b/chargebee/models/quoted_subscription/__init__.py index 301f7ec..046340a 100644 --- a/chargebee/models/quoted_subscription/__init__.py +++ b/chargebee/models/quoted_subscription/__init__.py @@ -1,12 +1,2 @@ from .operations import QuotedSubscription from .responses import QuotedSubscriptionResponse -from .types import ( - Addon, - EventBasedAddon, - Coupon, - SubscriptionItem, - ItemTier, - QuotedContractTerm, - ChangeOption, - BillingPeriodUnit, -) diff --git a/chargebee/models/quoted_subscription/operations.py b/chargebee/models/quoted_subscription/operations.py index 108aeea..6e7b284 100644 --- a/chargebee/models/quoted_subscription/operations.py +++ b/chargebee/models/quoted_subscription/operations.py @@ -1,9 +1,103 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class QuotedSubscription: + class ChangeOption(Enum): + END_OF_TERM = "end_of_term" + SPECIFIC_DATE = "specific_date" + IMMEDIATELY = "immediately" + + def __str__(self): + return self.value + + class BillingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class QuotedContractTermActionAtTermEnd(Enum): + RENEW = "renew" + EVERGREEN = "evergreen" + CANCEL = "cancel" + RENEW_ONCE = "renew_once" + + def __str__(self): + return self.value + + class Coupon(TypedDict): + coupon_id: Required[str] + + class SubscriptionItem(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + metered_quantity: NotRequired[str] + last_calculated_at: NotRequired[int] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + billing_period: NotRequired[int] + billing_period_unit: NotRequired["QuotedSubscription.BillingPeriodUnit"] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + 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] + proration_type: NotRequired[enums.ProrationType] + + class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + class QuotedContractTerm(TypedDict): + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required[ + "QuotedSubscription.QuotedContractTermActionAtTermEnd" + ] + total_contract_value: Required[int] + cancellation_cutoff_period: NotRequired[int] + + class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + unit_price: Required[int] + service_period_in_days: NotRequired[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + amount: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] pass diff --git a/chargebee/models/quoted_subscription/types.py b/chargebee/models/quoted_subscription/types.py deleted file mode 100644 index b90d64d..0000000 --- a/chargebee/models/quoted_subscription/types.py +++ /dev/null @@ -1,104 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class ChangeOption(Enum): - END_OF_TERM = "end_of_term" - SPECIFIC_DATE = "specific_date" - IMMEDIATELY = "immediately" - - def __str__(self): - return self.value - - -class BillingPeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class QuotedContractTermActionAtTermEnd(Enum): - RENEW = "renew" - EVERGREEN = "evergreen" - CANCEL = "cancel" - RENEW_ONCE = "renew_once" - - def __str__(self): - return self.value - - -class Coupon(TypedDict): - coupon_id: Required[str] - - -class SubscriptionItem(TypedDict): - item_price_id: Required[str] - item_type: Required[enums.ItemType] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - metered_quantity: NotRequired[str] - last_calculated_at: NotRequired[int] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - billing_period: NotRequired[int] - billing_period_unit: NotRequired[BillingPeriodUnit] - free_quantity: NotRequired[int] - free_quantity_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - 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] - proration_type: NotRequired[enums.ProrationType] - - -class ItemTier(TypedDict): - item_price_id: Required[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - index: Required[int] - - -class QuotedContractTerm(TypedDict): - contract_start: Required[int] - contract_end: Required[int] - billing_cycle: Required[int] - action_at_term_end: Required[QuotedContractTermActionAtTermEnd] - total_contract_value: Required[int] - cancellation_cutoff_period: NotRequired[int] - - -class EventBasedAddon(TypedDict): - id: Required[str] - quantity: Required[int] - unit_price: Required[int] - service_period_in_days: NotRequired[int] - on_event: Required[enums.OnEvent] - charge_once: Required[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class Addon(TypedDict): - id: Required[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - amount: NotRequired[int] - trial_end: NotRequired[int] - remaining_billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - proration_type: NotRequired[enums.ProrationType] diff --git a/chargebee/models/ramp/__init__.py b/chargebee/models/ramp/__init__.py index 6776aab..5808a8a 100644 --- a/chargebee/models/ramp/__init__.py +++ b/chargebee/models/ramp/__init__.py @@ -1,11 +1,2 @@ from .operations import Ramp from .responses import RampResponse -from .types import ( - ItemsToAdd, - ItemsToUpdate, - CouponsToAdd, - DiscountsToAdd, - ItemTier, - StatusTransitionReason, - Status, -) diff --git a/chargebee/models/ramp/operations.py b/chargebee/models/ramp/operations.py index 2571a9f..7b9a842 100644 --- a/chargebee/models/ramp/operations.py +++ b/chargebee/models/ramp/operations.py @@ -1,11 +1,171 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class Ramp: + class Status(Enum): + SCHEDULED = "scheduled" + SUCCEEDED = "succeeded" + FAILED = "failed" + DRAFT = "draft" + + def __str__(self): + return self.value + + class DiscountsToAddType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + class ItemsToAdd(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + metered_quantity: NotRequired[str] + + class ItemsToUpdate(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + metered_quantity: NotRequired[str] + + class CouponsToAdd(TypedDict): + coupon_id: Required[str] + apply_till: NotRequired[int] + + class DiscountsToAdd(TypedDict): + id: Required[str] + invoice_name: NotRequired[str] + type: Required["Ramp.DiscountsToAddType"] + percentage: NotRequired[float] + amount: NotRequired[int] + duration_type: Required[enums.DurationType] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: Required[bool] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + created_at: Required[int] + + class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + class StatusTransitionReason(TypedDict): + code: NotRequired[str] + message: NotRequired[str] + + class CreateForSubscriptionItemsToAddParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + class CreateForSubscriptionItemsToUpdateParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + class CreateForSubscriptionItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateForSubscriptionCouponsToAddParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class CreateForSubscriptionDiscountsToAddParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class UpdateItemsToAddParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + class UpdateItemsToUpdateParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + service_period_days: NotRequired[int] + + class UpdateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateCouponsToAddParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class UpdateDiscountsToAddParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] class CreateForSubscriptionParams(TypedDict): effective_from: Required[int] @@ -13,11 +173,15 @@ class CreateForSubscriptionParams(TypedDict): coupons_to_remove: NotRequired[List[str]] discounts_to_remove: NotRequired[List[str]] items_to_remove: NotRequired[List[str]] - items_to_add: Required[List[CreateForSubscriptionItemsToAddParams]] - items_to_update: Required[List[CreateForSubscriptionItemsToUpdateParams]] - item_tiers: NotRequired[List[CreateForSubscriptionItemTierParams]] - coupons_to_add: NotRequired[List[CreateForSubscriptionCouponsToAddParams]] - discounts_to_add: Required[List[CreateForSubscriptionDiscountsToAddParams]] + items_to_add: Required[List["Ramp.CreateForSubscriptionItemsToAddParams"]] + items_to_update: Required[List["Ramp.CreateForSubscriptionItemsToUpdateParams"]] + item_tiers: NotRequired[List["Ramp.CreateForSubscriptionItemTierParams"]] + coupons_to_add: NotRequired[ + List["Ramp.CreateForSubscriptionCouponsToAddParams"] + ] + discounts_to_add: Required[ + List["Ramp.CreateForSubscriptionDiscountsToAddParams"] + ] class UpdateParams(TypedDict): effective_from: Required[int] @@ -25,11 +189,11 @@ class UpdateParams(TypedDict): coupons_to_remove: NotRequired[List[str]] discounts_to_remove: NotRequired[List[str]] items_to_remove: NotRequired[List[str]] - items_to_add: Required[List[UpdateItemsToAddParams]] - items_to_update: Required[List[UpdateItemsToUpdateParams]] - item_tiers: NotRequired[List[UpdateItemTierParams]] - coupons_to_add: NotRequired[List[UpdateCouponsToAddParams]] - discounts_to_add: Required[List[UpdateDiscountsToAddParams]] + items_to_add: Required[List["Ramp.UpdateItemsToAddParams"]] + items_to_update: Required[List["Ramp.UpdateItemsToUpdateParams"]] + item_tiers: NotRequired[List["Ramp.UpdateItemTierParams"]] + coupons_to_add: NotRequired[List["Ramp.UpdateCouponsToAddParams"]] + discounts_to_add: Required[List["Ramp.UpdateDiscountsToAddParams"]] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/ramp/types.py b/chargebee/models/ramp/types.py deleted file mode 100644 index fcd2aed..0000000 --- a/chargebee/models/ramp/types.py +++ /dev/null @@ -1,181 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - SCHEDULED = "scheduled" - SUCCEEDED = "succeeded" - FAILED = "failed" - DRAFT = "draft" - - def __str__(self): - return self.value - - -class DiscountsToAddType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - -class ItemsToAdd(TypedDict): - item_price_id: Required[str] - item_type: Required[enums.ItemType] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - free_quantity: NotRequired[int] - free_quantity_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - metered_quantity: NotRequired[str] - - -class ItemsToUpdate(TypedDict): - item_price_id: Required[str] - item_type: Required[enums.ItemType] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - free_quantity: NotRequired[int] - free_quantity_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - metered_quantity: NotRequired[str] - - -class CouponsToAdd(TypedDict): - coupon_id: Required[str] - apply_till: NotRequired[int] - - -class DiscountsToAdd(TypedDict): - id: Required[str] - invoice_name: NotRequired[str] - type: Required[DiscountsToAddType] - percentage: NotRequired[float] - amount: NotRequired[int] - duration_type: Required[enums.DurationType] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: Required[bool] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - created_at: Required[int] - - -class ItemTier(TypedDict): - item_price_id: Required[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - index: Required[int] - - -class StatusTransitionReason(TypedDict): - code: NotRequired[str] - message: NotRequired[str] - - -class CreateForSubscriptionItemsToAddParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - - -class CreateForSubscriptionItemsToUpdateParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - - -class CreateForSubscriptionItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateForSubscriptionCouponsToAddParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class CreateForSubscriptionDiscountsToAddParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class UpdateItemsToAddParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - - -class UpdateItemsToUpdateParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - service_period_days: NotRequired[int] - - -class UpdateItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateCouponsToAddParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class UpdateDiscountsToAddParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] diff --git a/chargebee/models/resource_migration/__init__.py b/chargebee/models/resource_migration/__init__.py index e3bd196..07798ba 100644 --- a/chargebee/models/resource_migration/__init__.py +++ b/chargebee/models/resource_migration/__init__.py @@ -1,3 +1,2 @@ from .operations import ResourceMigration from .responses import ResourceMigrationResponse -from .types import Status diff --git a/chargebee/models/resource_migration/operations.py b/chargebee/models/resource_migration/operations.py index ec35b54..6c78bcb 100644 --- a/chargebee/models/resource_migration/operations.py +++ b/chargebee/models/resource_migration/operations.py @@ -1,11 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.models import enums class ResourceMigration: + class Status(Enum): + SCHEDULED = "scheduled" + FAILED = "failed" + SUCCEEDED = "succeeded" + + def __str__(self): + return self.value class RetrieveLatestParams(TypedDict): from_site: Required[str] diff --git a/chargebee/models/resource_migration/types.py b/chargebee/models/resource_migration/types.py deleted file mode 100644 index 30fdbc4..0000000 --- a/chargebee/models/resource_migration/types.py +++ /dev/null @@ -1,12 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - SCHEDULED = "scheduled" - FAILED = "failed" - SUCCEEDED = "succeeded" - - def __str__(self): - return self.value diff --git a/chargebee/models/site_migration_detail/__init__.py b/chargebee/models/site_migration_detail/__init__.py index 3c232c8..24b8a7f 100644 --- a/chargebee/models/site_migration_detail/__init__.py +++ b/chargebee/models/site_migration_detail/__init__.py @@ -1,3 +1,2 @@ from .operations import SiteMigrationDetail from .responses import SiteMigrationDetailResponse -from .types import Status diff --git a/chargebee/models/site_migration_detail/operations.py b/chargebee/models/site_migration_detail/operations.py index 396d793..689805a 100644 --- a/chargebee/models/site_migration_detail/operations.py +++ b/chargebee/models/site_migration_detail/operations.py @@ -1,11 +1,18 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class SiteMigrationDetail: + class Status(Enum): + MOVED_IN = "moved_in" + MOVED_OUT = "moved_out" + MOVING_OUT = "moving_out" + + def __str__(self): + return self.value class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/site_migration_detail/types.py b/chargebee/models/site_migration_detail/types.py deleted file mode 100644 index 67f6d41..0000000 --- a/chargebee/models/site_migration_detail/types.py +++ /dev/null @@ -1,12 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - MOVED_IN = "moved_in" - MOVED_OUT = "moved_out" - MOVING_OUT = "moving_out" - - def __str__(self): - return self.value diff --git a/chargebee/models/subscription/__init__.py b/chargebee/models/subscription/__init__.py index cc7f22a..f26887d 100644 --- a/chargebee/models/subscription/__init__.py +++ b/chargebee/models/subscription/__init__.py @@ -1,18 +1,2 @@ from .operations import Subscription from .responses import SubscriptionResponse -from .types import ( - SubscriptionItem, - ItemTier, - ChargedItem, - Addon, - EventBasedAddon, - ChargedEventBasedAddon, - Coupon, - ShippingAddress, - ReferralInfo, - ContractTerm, - Discount, - Status, - CancelReason, - BillingPeriodUnit, -) diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py index c93a174..b2b4cc4 100644 --- a/chargebee/models/subscription/operations.py +++ b/chargebee/models/subscription/operations.py @@ -1,17 +1,1123 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, unbilled_charge, payment_intent, invoice class Subscription: + class Status(Enum): + FUTURE = "future" + IN_TRIAL = "in_trial" + ACTIVE = "active" + NON_RENEWING = "non_renewing" + PAUSED = "paused" + CANCELLED = "cancelled" + TRANSFERRED = "transferred" + + def __str__(self): + return self.value + + class CancelReason(Enum): + NOT_PAID = "not_paid" + NO_CARD = "no_card" + FRAUD_REVIEW_FAILED = "fraud_review_failed" + NON_COMPLIANT_EU_CUSTOMER = "non_compliant_eu_customer" + TAX_CALCULATION_FAILED = "tax_calculation_failed" + CURRENCY_INCOMPATIBLE_WITH_GATEWAY = "currency_incompatible_with_gateway" + NON_COMPLIANT_CUSTOMER = "non_compliant_customer" + + def __str__(self): + return self.value + + class BillingPeriodUnit(Enum): + DAY = "day" + WEEK = "week" + MONTH = "month" + YEAR = "year" + + def __str__(self): + return self.value + + class ReferralInfoRewardStatus(Enum): + PENDING = "pending" + PAID = "paid" + INVALID = "invalid" + + def __str__(self): + return self.value + + class ContractTermStatus(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + 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 DiscountType(Enum): + FIXED_AMOUNT = "fixed_amount" + PERCENTAGE = "percentage" + + def __str__(self): + return self.value + + class SubscriptionItem(TypedDict): + item_price_id: Required[str] + item_type: Required[enums.ItemType] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + metered_quantity: NotRequired[str] + last_calculated_at: NotRequired[int] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + billing_period: NotRequired[int] + billing_period_unit: NotRequired["Subscription.BillingPeriodUnit"] + free_quantity: NotRequired[int] + free_quantity_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + 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] + proration_type: NotRequired[enums.ProrationType] + + class ItemTier(TypedDict): + item_price_id: Required[str] + starting_unit: Required[int] + ending_unit: NotRequired[int] + price: Required[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + index: Required[int] + + class ChargedItem(TypedDict): + item_price_id: Required[str] + last_charged_at: Required[int] + + class Coupon(TypedDict): + coupon_id: Required[str] + apply_till: NotRequired[int] + applied_count: Required[int] + coupon_code: NotRequired[str] + + class ShippingAddress(TypedDict): + 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] + index: Required[int] + + class ReferralInfo(TypedDict): + referral_code: NotRequired[str] + coupon_code: NotRequired[str] + referrer_id: NotRequired[str] + external_reference_id: NotRequired[str] + reward_status: NotRequired["Subscription.ReferralInfoRewardStatus"] + referral_system: NotRequired[enums.ReferralSystem] + account_id: Required[str] + campaign_id: Required[str] + external_campaign_id: NotRequired[str] + friend_offer_type: NotRequired[enums.FriendOfferType] + referrer_reward_type: NotRequired[enums.ReferrerRewardType] + notify_referral_system: NotRequired[enums.NotifyReferralSystem] + destination_url: NotRequired[str] + post_purchase_widget_enabled: Required[bool] + + class ContractTerm(TypedDict): + id: Required[str] + status: Required["Subscription.ContractTermStatus"] + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required["Subscription.ContractTermActionAtTermEnd"] + total_contract_value: Required[int] + total_contract_value_before_tax: Required[int] + cancellation_cutoff_period: NotRequired[int] + created_at: Required[int] + subscription_id: Required[str] + remaining_billing_cycles: NotRequired[int] + + class Discount(TypedDict): + id: Required[str] + invoice_name: NotRequired[str] + type: Required["Subscription.DiscountType"] + percentage: NotRequired[float] + amount: NotRequired[int] + currency_code: NotRequired[str] + duration_type: Required[enums.DurationType] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: Required[bool] + apply_on: Required[enums.ApplyOn] + item_price_id: NotRequired[str] + created_at: Required[int] + apply_till: NotRequired[int] + applied_count: NotRequired[int] + coupon_id: Required[str] + index: Required[int] + + class Addon(TypedDict): + id: Required[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + amount: NotRequired[int] + trial_end: NotRequired[int] + remaining_billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + proration_type: NotRequired[enums.ProrationType] + + class ChargedEventBasedAddon(TypedDict): + id: Required[str] + last_charged_at: Required[int] + + class EventBasedAddon(TypedDict): + id: Required[str] + quantity: Required[int] + unit_price: Required[int] + service_period_in_days: NotRequired[int] + on_event: Required[enums.OnEvent] + charge_once: Required[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class CreateCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + net_term_days: NotRequired[int] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + auto_collection: NotRequired[enums.AutoCollection] + offline_payment_method: NotRequired[enums.OfflinePaymentMethod] + allow_direct_debit: NotRequired[bool] + consolidated_invoicing: NotRequired[bool] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + entity_identifier_standard: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + registered_for_gst: NotRequired[bool] + business_customer_without_vat_number: NotRequired[bool] + exemption_details: NotRequired[List[Dict[Any, Any]]] + customer_type: NotRequired[enums.CustomerType] + + class CreateEntityIdentifierParams(TypedDict): + id: NotRequired[str] + scheme: NotRequired[str] + value: NotRequired[str] + standard: NotRequired[str] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class CreateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CreateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBankAccountParams(TypedDict): + gateway_account_id: NotRequired[str] + iban: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + email: NotRequired[str] + phone: NotRequired[str] + bank_name: NotRequired[str] + account_number: NotRequired[str] + routing_number: NotRequired[str] + bank_code: NotRequired[str] + account_type: NotRequired[enums.AccountType] + account_holder_type: NotRequired[enums.AccountHolderType] + echeck_type: NotRequired[enums.EcheckType] + issuing_country: NotRequired[str] + swedish_identity_number: NotRequired[str] + billing_address: NotRequired[Dict[Any, Any]] + + class CreatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class CreateForCustomerAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + + class CreateForCustomerEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + charge_on: NotRequired[enums.ChargeOn] + + class CreateForCustomerShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateForCustomerStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateForCustomerPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateForCustomerContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class CreateForCustomerCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class CreateWithItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + charge_on_option: NotRequired[enums.ChargeOnOption] + + class CreateWithItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class CreateWithItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateWithItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class CreateWithItemsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class CreateWithItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class CreateWithItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + contract_start: NotRequired[int] + cancellation_cutoff_period: NotRequired[int] + + class CreateWithItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class UpdateAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + billing_cycles: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + trial_end: NotRequired[int] + proration_type: NotRequired[enums.ProrationType] + + class UpdateEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + charge_on: NotRequired[enums.ChargeOn] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + + class UpdateCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdatePaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class UpdateCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + entity_identifier_standard: NotRequired[str] + business_customer_without_vat_number: NotRequired[bool] + registered_for_gst: NotRequired[bool] + + class UpdateContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class UpdateCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class UpdateForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + charge_on_option: NotRequired[enums.ChargeOnOption] + item_type: NotRequired[enums.ItemType] + proration_type: NotRequired[enums.ProrationType] + + class UpdateForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + operation_type: Required[enums.OperationType] + id: NotRequired[str] + + class UpdateForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class UpdateForItemsCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + ip_address: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateForItemsPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + tmp_token: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateForItemsPaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class UpdateForItemsBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class UpdateForItemsStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class UpdateForItemsCustomerParams(TypedDict): + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + entity_identifier_scheme: NotRequired[str] + is_einvoice_enabled: NotRequired[bool] + einvoicing_method: NotRequired[enums.EinvoicingMethod] + entity_identifier_standard: NotRequired[str] + business_customer_without_vat_number: NotRequired[bool] + registered_for_gst: NotRequired[bool] + + class UpdateForItemsContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + contract_start: NotRequired[int] + + class UpdateForItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class ReactivateContractTermParams(TypedDict): + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class ReactivateStatementDescriptorParams(TypedDict): + descriptor: NotRequired[str] + + class ReactivatePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class ChargeFutureRenewalsSpecificDatesScheduleParams(TypedDict): + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + class ChargeFutureRenewalsFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + class EditAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): + id: NotRequired[str] + terms_to_charge: NotRequired[int] + date: NotRequired[int] + + class EditAdvanceInvoiceScheduleFixedIntervalScheduleParams(TypedDict): + number_of_occurrences: NotRequired[int] + days_before_renewal: NotRequired[int] + end_schedule_on: NotRequired[enums.EndScheduleOn] + end_date: NotRequired[int] + + class RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): + id: NotRequired[str] + + class ImportSubscriptionCustomerParams(TypedDict): + id: NotRequired[str] + email: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + company: NotRequired[str] + phone: NotRequired[str] + locale: NotRequired[str] + taxability: NotRequired[enums.Taxability] + entity_code: NotRequired[enums.EntityCode] + exempt_number: NotRequired[str] + net_term_days: NotRequired[int] + taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] + customer_type: NotRequired[enums.CustomerType] + auto_collection: NotRequired[enums.AutoCollection] + allow_direct_debit: NotRequired[bool] + vat_number: NotRequired[str] + vat_number_prefix: NotRequired[str] + + class ImportSubscriptionAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + class ImportSubscriptionEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + class ImportSubscriptionChargedEventBasedAddonParams(TypedDict): + id: NotRequired[str] + last_charged_at: NotRequired[int] + + class ImportSubscriptionContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class ImportSubscriptionCardParams(TypedDict): + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + tmp_token: NotRequired[str] + first_name: NotRequired[str] + last_name: NotRequired[str] + number: NotRequired[str] + expiry_month: NotRequired[int] + expiry_year: NotRequired[int] + cvv: NotRequired[str] + billing_addr1: NotRequired[str] + billing_addr2: NotRequired[str] + billing_city: NotRequired[str] + billing_state_code: NotRequired[str] + billing_state: NotRequired[str] + billing_zip: NotRequired[str] + billing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class ImportSubscriptionPaymentMethodParams(TypedDict): + type: NotRequired[enums.Type] + gateway: NotRequired[enums.Gateway] + gateway_account_id: NotRequired[str] + reference_id: NotRequired[str] + issuing_country: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] + + class ImportSubscriptionBillingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportSubscriptionShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportSubscriptionTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + class ImportSubscriptionCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class ImportForCustomerAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + + class ImportForCustomerEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + service_period_in_days: NotRequired[int] + on_event: NotRequired[enums.OnEvent] + charge_once: NotRequired[bool] + + class ImportForCustomerChargedEventBasedAddonParams(TypedDict): + id: NotRequired[str] + last_charged_at: NotRequired[int] + + class ImportForCustomerContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class ImportForCustomerTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + class ImportForCustomerShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportForCustomerCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class ImportContractTermContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + contract_end: NotRequired[int] + status: NotRequired["Subscription.ContractTermStatus"] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + total_contract_value: NotRequired[int] + total_contract_value_before_tax: NotRequired[int] + billing_cycle: NotRequired[int] + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class ImportUnbilledChargesUnbilledChargeParams(TypedDict): + id: NotRequired[str] + date_from: Required[int] + date_to: Required[int] + entity_type: Required["unbilled_charge.UnbilledCharge.EntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + unit_amount: NotRequired[int] + quantity: NotRequired[int] + amount: NotRequired[int] + unit_amount_in_decimal: NotRequired[str] + quantity_in_decimal: NotRequired[str] + amount_in_decimal: NotRequired[str] + discount_amount: NotRequired[int] + use_for_proration: NotRequired[bool] + is_advance_charge: NotRequired[bool] + + class ImportUnbilledChargesDiscountParams(TypedDict): + unbilled_charge_id: NotRequired[str] + entity_type: NotRequired["invoice.Invoice.DiscountEntityType"] + entity_id: NotRequired[str] + description: NotRequired[str] + amount: Required[int] + + class ImportUnbilledChargesTierParams(TypedDict): + unbilled_charge_id: Required[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + quantity_used: NotRequired[int] + unit_amount: NotRequired[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] + + class ImportForItemsSubscriptionItemParams(TypedDict): + item_price_id: Required[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + billing_cycles: NotRequired[int] + trial_end: NotRequired[int] + service_period_days: NotRequired[int] + charge_on_event: NotRequired[enums.ChargeOnEvent] + charge_once: NotRequired[bool] + item_type: NotRequired[enums.ItemType] + + class ImportForItemsDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + + class ImportForItemsChargedItemParams(TypedDict): + item_price_id: NotRequired[str] + last_charged_at: NotRequired[int] + + class ImportForItemsItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class ImportForItemsContractTermParams(TypedDict): + id: NotRequired[str] + created_at: NotRequired[int] + contract_start: NotRequired[int] + billing_cycle: NotRequired[int] + total_amount_raised: NotRequired[int] + total_amount_raised_before_tax: NotRequired[int] + action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] + cancellation_cutoff_period: NotRequired[int] + + class ImportForItemsTransactionParams(TypedDict): + amount: NotRequired[int] + payment_method: NotRequired[enums.PaymentMethod] + reference_number: NotRequired[str] + date: NotRequired[int] + + class ImportForItemsShippingAddressParams(TypedDict): + 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] + zip: NotRequired[str] + country: NotRequired[str] + validation_status: NotRequired[enums.ValidationStatus] + + class ImportForItemsCouponParams(TypedDict): + coupon_id: NotRequired[str] + apply_till: NotRequired[int] + + class CancelEventBasedAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + service_period_in_days: NotRequired[int] + + class CancelForItemsSubscriptionItemParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + service_period_days: NotRequired[int] + + class ResumePaymentIntentParams(TypedDict): + id: NotRequired[str] + gateway_account_id: NotRequired[str] + gw_token: NotRequired[str] + payment_method_type: NotRequired[ + "payment_intent.PaymentIntent.PaymentMethodType" + ] + reference_id: NotRequired[str] + gw_payment_method_id: NotRequired[str] + additional_information: NotRequired[Dict[Any, Any]] class CreateParams(TypedDict): id: NotRequired[str] - customer: NotRequired[CreateCustomerParams] - entity_identifiers: NotRequired[List[CreateEntityIdentifierParams]] - tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + customer: NotRequired["Subscription.CreateCustomerParams"] + entity_identifiers: NotRequired[ + List["Subscription.CreateEntityIdentifierParams"] + ] + tax_providers_fields: NotRequired[ + List["Subscription.CreateTaxProvidersFieldParams"] + ] plan_id: Required[str] plan_quantity: NotRequired[int] plan_quantity_in_decimal: NotRequired[str] @@ -20,8 +1126,10 @@ class CreateParams(TypedDict): setup_fee: NotRequired[int] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - addons: NotRequired[List[CreateAddonParams]] - event_based_addons: NotRequired[List[CreateEventBasedAddonParams]] + addons: NotRequired[List["Subscription.CreateAddonParams"]] + event_based_addons: NotRequired[ + List["Subscription.CreateEventBasedAddonParams"] + ] mandatory_addons_to_remove: NotRequired[List[str]] start_date: NotRequired[int] coupon: NotRequired[str] @@ -31,14 +1139,16 @@ class CreateParams(TypedDict): offline_payment_method: NotRequired[enums.OfflinePaymentMethod] po_number: NotRequired[str] coupon_ids: NotRequired[List[str]] - card: NotRequired[CreateCardParams] - bank_account: NotRequired[CreateBankAccountParams] + card: NotRequired["Subscription.CreateCardParams"] + bank_account: NotRequired["Subscription.CreateBankAccountParams"] token_id: NotRequired[str] - payment_method: NotRequired[CreatePaymentMethodParams] - payment_intent: NotRequired[CreatePaymentIntentParams] - billing_address: NotRequired[CreateBillingAddressParams] - shipping_address: NotRequired[CreateShippingAddressParams] - statement_descriptor: NotRequired[CreateStatementDescriptorParams] + payment_method: NotRequired["Subscription.CreatePaymentMethodParams"] + payment_intent: NotRequired["Subscription.CreatePaymentIntentParams"] + billing_address: NotRequired["Subscription.CreateBillingAddressParams"] + shipping_address: NotRequired["Subscription.CreateShippingAddressParams"] + statement_descriptor: NotRequired[ + "Subscription.CreateStatementDescriptorParams" + ] affiliate_token: NotRequired[str] created_from_ip: NotRequired[str] invoice_notes: NotRequired[str] @@ -47,12 +1157,12 @@ class CreateParams(TypedDict): invoice_immediately: NotRequired[bool] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] - contract_term: NotRequired[CreateContractTermParams] + contract_term: NotRequired["Subscription.CreateContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] trial_end_action: NotRequired[enums.TrialEndAction] client_profile_id: NotRequired[str] payment_initiator: NotRequired[enums.PaymentInitiator] - coupons: NotRequired[List[CreateCouponParams]] + coupons: NotRequired[List["Subscription.CreateCouponParams"]] class CreateForCustomerParams(TypedDict): id: NotRequired[str] @@ -64,8 +1174,10 @@ class CreateForCustomerParams(TypedDict): setup_fee: NotRequired[int] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - addons: NotRequired[List[CreateForCustomerAddonParams]] - event_based_addons: NotRequired[List[CreateForCustomerEventBasedAddonParams]] + addons: NotRequired[List["Subscription.CreateForCustomerAddonParams"]] + event_based_addons: NotRequired[ + List["Subscription.CreateForCustomerEventBasedAddonParams"] + ] mandatory_addons_to_remove: NotRequired[List[str]] start_date: NotRequired[int] coupon: NotRequired[str] @@ -77,32 +1189,38 @@ class CreateForCustomerParams(TypedDict): coupon_ids: NotRequired[List[str]] payment_source_id: NotRequired[str] override_relationship: NotRequired[bool] - shipping_address: NotRequired[CreateForCustomerShippingAddressParams] - statement_descriptor: NotRequired[CreateForCustomerStatementDescriptorParams] + shipping_address: NotRequired[ + "Subscription.CreateForCustomerShippingAddressParams" + ] + statement_descriptor: NotRequired[ + "Subscription.CreateForCustomerStatementDescriptorParams" + ] invoice_notes: NotRequired[str] invoice_date: NotRequired[int] meta_data: NotRequired[Dict[Any, Any]] invoice_immediately: NotRequired[bool] replace_primary_payment_source: NotRequired[bool] - payment_intent: NotRequired[CreateForCustomerPaymentIntentParams] + payment_intent: NotRequired["Subscription.CreateForCustomerPaymentIntentParams"] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] - contract_term: NotRequired[CreateForCustomerContractTermParams] + contract_term: NotRequired["Subscription.CreateForCustomerContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] trial_end_action: NotRequired[enums.TrialEndAction] payment_initiator: NotRequired[enums.PaymentInitiator] - coupons: NotRequired[List[CreateForCustomerCouponParams]] + coupons: NotRequired[List["Subscription.CreateForCustomerCouponParams"]] class CreateWithItemsParams(TypedDict): id: NotRequired[str] business_entity_id: NotRequired[str] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - subscription_items: Required[List[CreateWithItemsSubscriptionItemParams]] + subscription_items: Required[ + List["Subscription.CreateWithItemsSubscriptionItemParams"] + ] setup_fee: NotRequired[int] - discounts: Required[List[CreateWithItemsDiscountParams]] + discounts: Required[List["Subscription.CreateWithItemsDiscountParams"]] mandatory_items_to_remove: NotRequired[List[str]] - item_tiers: NotRequired[List[CreateWithItemsItemTierParams]] + item_tiers: NotRequired[List["Subscription.CreateWithItemsItemTierParams"]] net_term_days: NotRequired[int] start_date: NotRequired[int] coupon: NotRequired[str] @@ -113,24 +1231,28 @@ class CreateWithItemsParams(TypedDict): coupon_ids: NotRequired[List[str]] payment_source_id: NotRequired[str] override_relationship: NotRequired[bool] - shipping_address: NotRequired[CreateWithItemsShippingAddressParams] - statement_descriptor: NotRequired[CreateWithItemsStatementDescriptorParams] + shipping_address: NotRequired[ + "Subscription.CreateWithItemsShippingAddressParams" + ] + statement_descriptor: NotRequired[ + "Subscription.CreateWithItemsStatementDescriptorParams" + ] invoice_notes: NotRequired[str] invoice_date: NotRequired[int] meta_data: NotRequired[Dict[Any, Any]] invoice_immediately: NotRequired[bool] replace_primary_payment_source: NotRequired[bool] - payment_intent: NotRequired[CreateWithItemsPaymentIntentParams] + payment_intent: NotRequired["Subscription.CreateWithItemsPaymentIntentParams"] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] - contract_term: NotRequired[CreateWithItemsContractTermParams] + contract_term: NotRequired["Subscription.CreateWithItemsContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] create_pending_invoices: NotRequired[bool] auto_close_invoices: NotRequired[bool] first_invoice_pending: NotRequired[bool] trial_end_action: NotRequired[enums.TrialEndAction] payment_initiator: NotRequired[enums.PaymentInitiator] - coupons: NotRequired[List[CreateWithItemsCouponParams]] + coupons: NotRequired[List["Subscription.CreateWithItemsCouponParams"]] class ListParams(TypedDict): limit: NotRequired[int] @@ -181,8 +1303,10 @@ class UpdateParams(TypedDict): plan_quantity: NotRequired[int] plan_unit_price: NotRequired[int] setup_fee: NotRequired[int] - addons: NotRequired[List[UpdateAddonParams]] - event_based_addons: NotRequired[List[UpdateEventBasedAddonParams]] + addons: NotRequired[List["Subscription.UpdateAddonParams"]] + event_based_addons: NotRequired[ + List["Subscription.UpdateEventBasedAddonParams"] + ] replace_addon_list: NotRequired[bool] mandatory_addons_to_remove: NotRequired[List[str]] plan_quantity_in_decimal: NotRequired[str] @@ -204,34 +1328,38 @@ class UpdateParams(TypedDict): end_of_term: NotRequired[bool] force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] - card: NotRequired[UpdateCardParams] + card: NotRequired["Subscription.UpdateCardParams"] token_id: NotRequired[str] - payment_method: NotRequired[UpdatePaymentMethodParams] - payment_intent: NotRequired[UpdatePaymentIntentParams] - billing_address: NotRequired[UpdateBillingAddressParams] - shipping_address: NotRequired[UpdateShippingAddressParams] - statement_descriptor: NotRequired[UpdateStatementDescriptorParams] - customer: NotRequired[UpdateCustomerParams] + payment_method: NotRequired["Subscription.UpdatePaymentMethodParams"] + payment_intent: NotRequired["Subscription.UpdatePaymentIntentParams"] + billing_address: NotRequired["Subscription.UpdateBillingAddressParams"] + shipping_address: NotRequired["Subscription.UpdateShippingAddressParams"] + statement_descriptor: NotRequired[ + "Subscription.UpdateStatementDescriptorParams" + ] + customer: NotRequired["Subscription.UpdateCustomerParams"] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] invoice_immediately: NotRequired[bool] override_relationship: NotRequired[bool] changes_scheduled_at: NotRequired[int] change_option: NotRequired[enums.ChangeOption] - contract_term: NotRequired[UpdateContractTermParams] + contract_term: NotRequired["Subscription.UpdateContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] trial_end_action: NotRequired[enums.TrialEndAction] - coupons: NotRequired[List[UpdateCouponParams]] + coupons: NotRequired[List["Subscription.UpdateCouponParams"]] class UpdateForItemsParams(TypedDict): - subscription_items: Required[List[UpdateForItemsSubscriptionItemParams]] + subscription_items: Required[ + List["Subscription.UpdateForItemsSubscriptionItemParams"] + ] mandatory_items_to_remove: NotRequired[List[str]] replace_items_list: NotRequired[bool] setup_fee: NotRequired[int] - discounts: Required[List[UpdateForItemsDiscountParams]] - item_tiers: NotRequired[List[UpdateForItemsItemTierParams]] + discounts: Required[List["Subscription.UpdateForItemsDiscountParams"]] + item_tiers: NotRequired[List["Subscription.UpdateForItemsItemTierParams"]] net_term_days: NotRequired[int] invoice_date: NotRequired[int] start_date: NotRequired[int] @@ -250,21 +1378,25 @@ class UpdateForItemsParams(TypedDict): end_of_term: NotRequired[bool] force_term_reset: NotRequired[bool] reactivate: NotRequired[bool] - card: NotRequired[UpdateForItemsCardParams] + card: NotRequired["Subscription.UpdateForItemsCardParams"] token_id: NotRequired[str] - payment_method: NotRequired[UpdateForItemsPaymentMethodParams] - payment_intent: NotRequired[UpdateForItemsPaymentIntentParams] - billing_address: NotRequired[UpdateForItemsBillingAddressParams] - shipping_address: NotRequired[UpdateForItemsShippingAddressParams] - statement_descriptor: NotRequired[UpdateForItemsStatementDescriptorParams] - customer: NotRequired[UpdateForItemsCustomerParams] + payment_method: NotRequired["Subscription.UpdateForItemsPaymentMethodParams"] + payment_intent: NotRequired["Subscription.UpdateForItemsPaymentIntentParams"] + billing_address: NotRequired["Subscription.UpdateForItemsBillingAddressParams"] + shipping_address: NotRequired[ + "Subscription.UpdateForItemsShippingAddressParams" + ] + statement_descriptor: NotRequired[ + "Subscription.UpdateForItemsStatementDescriptorParams" + ] + customer: NotRequired["Subscription.UpdateForItemsCustomerParams"] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] invoice_immediately: NotRequired[bool] override_relationship: NotRequired[bool] changes_scheduled_at: NotRequired[int] change_option: NotRequired[enums.ChangeOption] - contract_term: NotRequired[UpdateForItemsContractTermParams] + contract_term: NotRequired["Subscription.UpdateForItemsContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] free_period: NotRequired[int] free_period_unit: NotRequired[enums.FreePeriodUnit] @@ -272,7 +1404,7 @@ class UpdateForItemsParams(TypedDict): auto_close_invoices: NotRequired[bool] trial_end_action: NotRequired[enums.TrialEndAction] payment_initiator: NotRequired[enums.PaymentInitiator] - coupons: NotRequired[List[UpdateForItemsCouponParams]] + coupons: NotRequired[List["Subscription.UpdateForItemsCouponParams"]] invoice_usages: NotRequired[bool] class ChangeTermEndParams(TypedDict): @@ -289,11 +1421,13 @@ class ReactivateParams(TypedDict): billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] terms_to_charge: NotRequired[int] invoice_date: NotRequired[int] - contract_term: NotRequired[ReactivateContractTermParams] + contract_term: NotRequired["Subscription.ReactivateContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] payment_initiator: NotRequired[enums.PaymentInitiator] - statement_descriptor: NotRequired[ReactivateStatementDescriptorParams] - payment_intent: NotRequired[ReactivatePaymentIntentParams] + statement_descriptor: NotRequired[ + "Subscription.ReactivateStatementDescriptorParams" + ] + payment_intent: NotRequired["Subscription.ReactivatePaymentIntentParams"] class AddChargeAtTermEndParams(TypedDict): amount: NotRequired[int] @@ -317,10 +1451,10 @@ class ChargeAddonAtTermEndParams(TypedDict): class ChargeFutureRenewalsParams(TypedDict): terms_to_charge: NotRequired[int] specific_dates_schedule: NotRequired[ - List[ChargeFutureRenewalsSpecificDatesScheduleParams] + List["Subscription.ChargeFutureRenewalsSpecificDatesScheduleParams"] ] fixed_interval_schedule: NotRequired[ - ChargeFutureRenewalsFixedIntervalScheduleParams + "Subscription.ChargeFutureRenewalsFixedIntervalScheduleParams" ] invoice_immediately: NotRequired[bool] schedule_type: NotRequired[enums.ScheduleType] @@ -329,15 +1463,15 @@ class EditAdvanceInvoiceScheduleParams(TypedDict): terms_to_charge: NotRequired[int] schedule_type: NotRequired[enums.ScheduleType] specific_dates_schedule: NotRequired[ - List[EditAdvanceInvoiceScheduleSpecificDatesScheduleParams] + List["Subscription.EditAdvanceInvoiceScheduleSpecificDatesScheduleParams"] ] fixed_interval_schedule: NotRequired[ - EditAdvanceInvoiceScheduleFixedIntervalScheduleParams + "Subscription.EditAdvanceInvoiceScheduleFixedIntervalScheduleParams" ] class RemoveAdvanceInvoiceScheduleParams(TypedDict): specific_dates_schedule: NotRequired[ - List[RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams] + List["Subscription.RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams"] ] class RegenerateInvoiceParams(TypedDict): @@ -348,7 +1482,7 @@ class RegenerateInvoiceParams(TypedDict): class ImportSubscriptionParams(TypedDict): id: NotRequired[str] - customer: NotRequired[ImportSubscriptionCustomerParams] + customer: NotRequired["Subscription.ImportSubscriptionCustomerParams"] client_profile_id: NotRequired[str] plan_id: Required[str] plan_quantity: NotRequired[int] @@ -358,18 +1492,20 @@ class ImportSubscriptionParams(TypedDict): setup_fee: NotRequired[int] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - addons: NotRequired[List[ImportSubscriptionAddonParams]] - event_based_addons: NotRequired[List[ImportSubscriptionEventBasedAddonParams]] + addons: NotRequired[List["Subscription.ImportSubscriptionAddonParams"]] + event_based_addons: NotRequired[ + List["Subscription.ImportSubscriptionEventBasedAddonParams"] + ] charged_event_based_addons: NotRequired[ - List[ImportSubscriptionChargedEventBasedAddonParams] + List["Subscription.ImportSubscriptionChargedEventBasedAddonParams"] ] start_date: NotRequired[int] auto_collection: NotRequired[enums.AutoCollection] po_number: NotRequired[str] coupon_ids: NotRequired[List[str]] - contract_term: NotRequired[ImportSubscriptionContractTermParams] + contract_term: NotRequired["Subscription.ImportSubscriptionContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] - status: Required[Status] + status: Required["Subscription.Status"] current_term_end: NotRequired[int] current_term_start: NotRequired[int] trial_start: NotRequired[int] @@ -379,15 +1515,21 @@ class ImportSubscriptionParams(TypedDict): pause_date: NotRequired[int] resume_date: NotRequired[int] create_current_term_invoice: NotRequired[bool] - card: NotRequired[ImportSubscriptionCardParams] - payment_method: NotRequired[ImportSubscriptionPaymentMethodParams] - billing_address: NotRequired[ImportSubscriptionBillingAddressParams] - shipping_address: NotRequired[ImportSubscriptionShippingAddressParams] + card: NotRequired["Subscription.ImportSubscriptionCardParams"] + payment_method: NotRequired[ + "Subscription.ImportSubscriptionPaymentMethodParams" + ] + billing_address: NotRequired[ + "Subscription.ImportSubscriptionBillingAddressParams" + ] + shipping_address: NotRequired[ + "Subscription.ImportSubscriptionShippingAddressParams" + ] affiliate_token: NotRequired[str] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] - transaction: NotRequired[ImportSubscriptionTransactionParams] - coupons: NotRequired[List[ImportSubscriptionCouponParams]] + transaction: NotRequired["Subscription.ImportSubscriptionTransactionParams"] + coupons: NotRequired[List["Subscription.ImportSubscriptionCouponParams"]] class ImportForCustomerParams(TypedDict): id: NotRequired[str] @@ -399,17 +1541,19 @@ class ImportForCustomerParams(TypedDict): setup_fee: NotRequired[int] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - addons: NotRequired[List[ImportForCustomerAddonParams]] - event_based_addons: NotRequired[List[ImportForCustomerEventBasedAddonParams]] + addons: NotRequired[List["Subscription.ImportForCustomerAddonParams"]] + event_based_addons: NotRequired[ + List["Subscription.ImportForCustomerEventBasedAddonParams"] + ] charged_event_based_addons: NotRequired[ - List[ImportForCustomerChargedEventBasedAddonParams] + List["Subscription.ImportForCustomerChargedEventBasedAddonParams"] ] start_date: NotRequired[int] auto_collection: NotRequired[enums.AutoCollection] po_number: NotRequired[str] coupon_ids: NotRequired[List[str]] payment_source_id: NotRequired[str] - status: Required[Status] + status: Required["Subscription.Status"] current_term_end: NotRequired[int] current_term_start: NotRequired[int] trial_start: NotRequired[int] @@ -418,40 +1562,46 @@ class ImportForCustomerParams(TypedDict): activated_at: NotRequired[int] pause_date: NotRequired[int] resume_date: NotRequired[int] - contract_term: NotRequired[ImportForCustomerContractTermParams] + contract_term: NotRequired["Subscription.ImportForCustomerContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] create_current_term_invoice: NotRequired[bool] - transaction: NotRequired[ImportForCustomerTransactionParams] - shipping_address: NotRequired[ImportForCustomerShippingAddressParams] + transaction: NotRequired["Subscription.ImportForCustomerTransactionParams"] + shipping_address: NotRequired[ + "Subscription.ImportForCustomerShippingAddressParams" + ] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] - coupons: NotRequired[List[ImportForCustomerCouponParams]] + coupons: NotRequired[List["Subscription.ImportForCustomerCouponParams"]] class ImportContractTermParams(TypedDict): - contract_term: NotRequired[ImportContractTermContractTermParams] + contract_term: NotRequired["Subscription.ImportContractTermContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] class ImportUnbilledChargesParams(TypedDict): - unbilled_charges: Required[List[ImportUnbilledChargesUnbilledChargeParams]] - discounts: Required[List[ImportUnbilledChargesDiscountParams]] - tiers: Required[List[ImportUnbilledChargesTierParams]] + unbilled_charges: Required[ + List["Subscription.ImportUnbilledChargesUnbilledChargeParams"] + ] + discounts: Required[List["Subscription.ImportUnbilledChargesDiscountParams"]] + tiers: Required[List["Subscription.ImportUnbilledChargesTierParams"]] class ImportForItemsParams(TypedDict): id: NotRequired[str] trial_end: NotRequired[int] billing_cycles: NotRequired[int] - subscription_items: Required[List[ImportForItemsSubscriptionItemParams]] + subscription_items: Required[ + List["Subscription.ImportForItemsSubscriptionItemParams"] + ] setup_fee: NotRequired[int] - discounts: Required[List[ImportForItemsDiscountParams]] - charged_items: NotRequired[List[ImportForItemsChargedItemParams]] - item_tiers: NotRequired[List[ImportForItemsItemTierParams]] + discounts: Required[List["Subscription.ImportForItemsDiscountParams"]] + charged_items: NotRequired[List["Subscription.ImportForItemsChargedItemParams"]] + item_tiers: NotRequired[List["Subscription.ImportForItemsItemTierParams"]] net_term_days: NotRequired[int] start_date: NotRequired[int] auto_collection: NotRequired[enums.AutoCollection] po_number: NotRequired[str] coupon_ids: NotRequired[List[str]] payment_source_id: NotRequired[str] - status: Required[Status] + status: Required["Subscription.Status"] current_term_end: NotRequired[int] current_term_start: NotRequired[int] trial_start: NotRequired[int] @@ -460,17 +1610,19 @@ class ImportForItemsParams(TypedDict): activated_at: NotRequired[int] pause_date: NotRequired[int] resume_date: NotRequired[int] - contract_term: NotRequired[ImportForItemsContractTermParams] + contract_term: NotRequired["Subscription.ImportForItemsContractTermParams"] contract_term_billing_cycle_on_renewal: NotRequired[int] create_current_term_invoice: NotRequired[bool] - transaction: NotRequired[ImportForItemsTransactionParams] - shipping_address: NotRequired[ImportForItemsShippingAddressParams] + transaction: NotRequired["Subscription.ImportForItemsTransactionParams"] + shipping_address: NotRequired[ + "Subscription.ImportForItemsShippingAddressParams" + ] invoice_notes: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] cancel_reason_code: NotRequired[str] create_pending_invoices: NotRequired[bool] auto_close_invoices: NotRequired[bool] - coupons: NotRequired[List[ImportForItemsCouponParams]] + coupons: NotRequired[List["Subscription.ImportForItemsCouponParams"]] class OverrideBillingProfileParams(TypedDict): payment_source_id: NotRequired[str] @@ -496,7 +1648,9 @@ class CancelParams(TypedDict): refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] invoice_date: NotRequired[int] - event_based_addons: NotRequired[List[CancelEventBasedAddonParams]] + event_based_addons: NotRequired[ + List["Subscription.CancelEventBasedAddonParams"] + ] cancel_reason_code: NotRequired[str] class CancelForItemsParams(TypedDict): @@ -511,7 +1665,9 @@ class CancelForItemsParams(TypedDict): refundable_credits_handling: NotRequired[enums.RefundableCreditsHandling] contract_term_cancel_option: NotRequired[enums.ContractTermCancelOption] invoice_date: NotRequired[int] - subscription_items: NotRequired[List[CancelForItemsSubscriptionItemParams]] + subscription_items: NotRequired[ + List["Subscription.CancelForItemsSubscriptionItemParams"] + ] cancel_reason_code: NotRequired[str] class ResumeParams(TypedDict): @@ -520,7 +1676,7 @@ class ResumeParams(TypedDict): charges_handling: NotRequired[enums.ChargesHandling] unpaid_invoices_handling: NotRequired[enums.UnpaidInvoicesHandling] payment_initiator: NotRequired[enums.PaymentInitiator] - payment_intent: NotRequired[ResumePaymentIntentParams] + payment_intent: NotRequired["Subscription.ResumePaymentIntentParams"] class MoveParams(TypedDict): to_customer_id: Required[str] diff --git a/chargebee/models/subscription/types.py b/chargebee/models/subscription/types.py deleted file mode 100644 index 00dd528..0000000 --- a/chargebee/models/subscription/types.py +++ /dev/null @@ -1,1202 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, unbilled_charge, payment_intent, invoice - - -class Status(Enum): - FUTURE = "future" - IN_TRIAL = "in_trial" - ACTIVE = "active" - NON_RENEWING = "non_renewing" - PAUSED = "paused" - CANCELLED = "cancelled" - TRANSFERRED = "transferred" - - def __str__(self): - return self.value - - -class CancelReason(Enum): - NOT_PAID = "not_paid" - NO_CARD = "no_card" - FRAUD_REVIEW_FAILED = "fraud_review_failed" - NON_COMPLIANT_EU_CUSTOMER = "non_compliant_eu_customer" - TAX_CALCULATION_FAILED = "tax_calculation_failed" - CURRENCY_INCOMPATIBLE_WITH_GATEWAY = "currency_incompatible_with_gateway" - NON_COMPLIANT_CUSTOMER = "non_compliant_customer" - - def __str__(self): - return self.value - - -class BillingPeriodUnit(Enum): - DAY = "day" - WEEK = "week" - MONTH = "month" - YEAR = "year" - - def __str__(self): - return self.value - - -class ReferralInfoRewardStatus(Enum): - PENDING = "pending" - PAID = "paid" - INVALID = "invalid" - - def __str__(self): - return self.value - - -class ContractTermStatus(Enum): - ACTIVE = "active" - COMPLETED = "completed" - CANCELLED = "cancelled" - TERMINATED = "terminated" - - 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 DiscountType(Enum): - FIXED_AMOUNT = "fixed_amount" - PERCENTAGE = "percentage" - - def __str__(self): - return self.value - - -class SubscriptionItem(TypedDict): - item_price_id: Required[str] - item_type: Required[enums.ItemType] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - metered_quantity: NotRequired[str] - last_calculated_at: NotRequired[int] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - billing_period: NotRequired[int] - billing_period_unit: NotRequired[BillingPeriodUnit] - free_quantity: NotRequired[int] - free_quantity_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - 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] - proration_type: NotRequired[enums.ProrationType] - - -class ItemTier(TypedDict): - item_price_id: Required[str] - starting_unit: Required[int] - ending_unit: NotRequired[int] - price: Required[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - index: Required[int] - - -class ChargedItem(TypedDict): - item_price_id: Required[str] - last_charged_at: Required[int] - - -class Coupon(TypedDict): - coupon_id: Required[str] - apply_till: NotRequired[int] - applied_count: Required[int] - coupon_code: NotRequired[str] - - -class ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class ReferralInfo(TypedDict): - referral_code: NotRequired[str] - coupon_code: NotRequired[str] - referrer_id: NotRequired[str] - external_reference_id: NotRequired[str] - reward_status: NotRequired[ReferralInfoRewardStatus] - referral_system: NotRequired[enums.ReferralSystem] - account_id: Required[str] - campaign_id: Required[str] - external_campaign_id: NotRequired[str] - friend_offer_type: NotRequired[enums.FriendOfferType] - referrer_reward_type: NotRequired[enums.ReferrerRewardType] - notify_referral_system: NotRequired[enums.NotifyReferralSystem] - destination_url: NotRequired[str] - post_purchase_widget_enabled: Required[bool] - - -class ContractTerm(TypedDict): - id: Required[str] - status: Required[ContractTermStatus] - contract_start: Required[int] - contract_end: Required[int] - billing_cycle: Required[int] - action_at_term_end: Required[ContractTermActionAtTermEnd] - total_contract_value: Required[int] - total_contract_value_before_tax: Required[int] - cancellation_cutoff_period: NotRequired[int] - created_at: Required[int] - subscription_id: Required[str] - remaining_billing_cycles: NotRequired[int] - - -class Discount(TypedDict): - id: Required[str] - invoice_name: NotRequired[str] - type: Required[DiscountType] - percentage: NotRequired[float] - amount: NotRequired[int] - currency_code: NotRequired[str] - duration_type: Required[enums.DurationType] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: Required[bool] - apply_on: Required[enums.ApplyOn] - item_price_id: NotRequired[str] - created_at: Required[int] - apply_till: NotRequired[int] - applied_count: NotRequired[int] - coupon_id: Required[str] - index: Required[int] - - -class Addon(TypedDict): - id: Required[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - amount: NotRequired[int] - trial_end: NotRequired[int] - remaining_billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - proration_type: NotRequired[enums.ProrationType] - - -class ChargedEventBasedAddon(TypedDict): - id: Required[str] - last_charged_at: Required[int] - - -class EventBasedAddon(TypedDict): - id: Required[str] - quantity: Required[int] - unit_price: Required[int] - service_period_in_days: NotRequired[int] - on_event: Required[enums.OnEvent] - charge_once: Required[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class CreateCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - net_term_days: NotRequired[int] - taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] - auto_collection: NotRequired[enums.AutoCollection] - offline_payment_method: NotRequired[enums.OfflinePaymentMethod] - allow_direct_debit: NotRequired[bool] - consolidated_invoicing: NotRequired[bool] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - entity_identifier_scheme: NotRequired[str] - entity_identifier_standard: NotRequired[str] - is_einvoice_enabled: NotRequired[bool] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - registered_for_gst: NotRequired[bool] - business_customer_without_vat_number: NotRequired[bool] - exemption_details: NotRequired[List[Dict[Any, Any]]] - customer_type: NotRequired[enums.CustomerType] - - -class CreateEntityIdentifierParams(TypedDict): - id: NotRequired[str] - scheme: NotRequired[str] - value: NotRequired[str] - standard: NotRequired[str] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class CreateEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CreateCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBankAccountParams(TypedDict): - gateway_account_id: NotRequired[str] - iban: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - email: NotRequired[str] - phone: NotRequired[str] - bank_name: NotRequired[str] - account_number: NotRequired[str] - routing_number: NotRequired[str] - bank_code: NotRequired[str] - account_type: NotRequired[enums.AccountType] - account_holder_type: NotRequired[enums.AccountHolderType] - echeck_type: NotRequired[enums.EcheckType] - issuing_country: NotRequired[str] - swedish_identity_number: NotRequired[str] - billing_address: NotRequired[Dict[Any, Any]] - - -class CreatePaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class CreateCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class CreateForCustomerAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - - -class CreateForCustomerEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - charge_on: NotRequired[enums.ChargeOn] - - -class CreateForCustomerShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateForCustomerStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateForCustomerPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateForCustomerContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class CreateForCustomerCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class CreateWithItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - charge_on_option: NotRequired[enums.ChargeOnOption] - - -class CreateWithItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class CreateWithItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateWithItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class CreateWithItemsStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class CreateWithItemsPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class CreateWithItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - contract_start: NotRequired[int] - cancellation_cutoff_period: NotRequired[int] - - -class CreateWithItemsCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class UpdateAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - billing_cycles: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - trial_end: NotRequired[int] - proration_type: NotRequired[enums.ProrationType] - - -class UpdateEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - charge_on: NotRequired[enums.ChargeOn] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - - -class UpdateCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdatePaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class UpdateCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - entity_identifier_scheme: NotRequired[str] - is_einvoice_enabled: NotRequired[bool] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - entity_identifier_standard: NotRequired[str] - business_customer_without_vat_number: NotRequired[bool] - registered_for_gst: NotRequired[bool] - - -class UpdateContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class UpdateCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class UpdateForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - charge_on_option: NotRequired[enums.ChargeOnOption] - item_type: NotRequired[enums.ItemType] - proration_type: NotRequired[enums.ProrationType] - - -class UpdateForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - operation_type: Required[enums.OperationType] - id: NotRequired[str] - - -class UpdateForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class UpdateForItemsCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - ip_address: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateForItemsPaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - tmp_token: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateForItemsPaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class UpdateForItemsBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class UpdateForItemsStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class UpdateForItemsCustomerParams(TypedDict): - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - entity_identifier_scheme: NotRequired[str] - is_einvoice_enabled: NotRequired[bool] - einvoicing_method: NotRequired[enums.EinvoicingMethod] - entity_identifier_standard: NotRequired[str] - business_customer_without_vat_number: NotRequired[bool] - registered_for_gst: NotRequired[bool] - - -class UpdateForItemsContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - contract_start: NotRequired[int] - - -class UpdateForItemsCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class ReactivateContractTermParams(TypedDict): - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class ReactivateStatementDescriptorParams(TypedDict): - descriptor: NotRequired[str] - - -class ReactivatePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class ChargeFutureRenewalsSpecificDatesScheduleParams(TypedDict): - terms_to_charge: NotRequired[int] - date: NotRequired[int] - - -class ChargeFutureRenewalsFixedIntervalScheduleParams(TypedDict): - number_of_occurrences: NotRequired[int] - days_before_renewal: NotRequired[int] - end_schedule_on: NotRequired[enums.EndScheduleOn] - end_date: NotRequired[int] - - -class EditAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): - id: NotRequired[str] - terms_to_charge: NotRequired[int] - date: NotRequired[int] - - -class EditAdvanceInvoiceScheduleFixedIntervalScheduleParams(TypedDict): - number_of_occurrences: NotRequired[int] - days_before_renewal: NotRequired[int] - end_schedule_on: NotRequired[enums.EndScheduleOn] - end_date: NotRequired[int] - - -class RemoveAdvanceInvoiceScheduleSpecificDatesScheduleParams(TypedDict): - id: NotRequired[str] - - -class ImportSubscriptionCustomerParams(TypedDict): - id: NotRequired[str] - email: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - company: NotRequired[str] - phone: NotRequired[str] - locale: NotRequired[str] - taxability: NotRequired[enums.Taxability] - entity_code: NotRequired[enums.EntityCode] - exempt_number: NotRequired[str] - net_term_days: NotRequired[int] - taxjar_exemption_category: NotRequired[enums.TaxjarExemptionCategory] - customer_type: NotRequired[enums.CustomerType] - auto_collection: NotRequired[enums.AutoCollection] - allow_direct_debit: NotRequired[bool] - vat_number: NotRequired[str] - vat_number_prefix: NotRequired[str] - - -class ImportSubscriptionAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - - -class ImportSubscriptionEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - - -class ImportSubscriptionChargedEventBasedAddonParams(TypedDict): - id: NotRequired[str] - last_charged_at: NotRequired[int] - - -class ImportSubscriptionContractTermParams(TypedDict): - id: NotRequired[str] - created_at: NotRequired[int] - contract_start: NotRequired[int] - billing_cycle: NotRequired[int] - total_amount_raised: NotRequired[int] - total_amount_raised_before_tax: NotRequired[int] - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class ImportSubscriptionCardParams(TypedDict): - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - tmp_token: NotRequired[str] - first_name: NotRequired[str] - last_name: NotRequired[str] - number: NotRequired[str] - expiry_month: NotRequired[int] - expiry_year: NotRequired[int] - cvv: NotRequired[str] - billing_addr1: NotRequired[str] - billing_addr2: NotRequired[str] - billing_city: NotRequired[str] - billing_state_code: NotRequired[str] - billing_state: NotRequired[str] - billing_zip: NotRequired[str] - billing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class ImportSubscriptionPaymentMethodParams(TypedDict): - type: NotRequired[enums.Type] - gateway: NotRequired[enums.Gateway] - gateway_account_id: NotRequired[str] - reference_id: NotRequired[str] - issuing_country: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] - - -class ImportSubscriptionBillingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportSubscriptionShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportSubscriptionTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: NotRequired[enums.PaymentMethod] - reference_number: NotRequired[str] - date: NotRequired[int] - - -class ImportSubscriptionCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class ImportForCustomerAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - - -class ImportForCustomerEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - service_period_in_days: NotRequired[int] - on_event: NotRequired[enums.OnEvent] - charge_once: NotRequired[bool] - - -class ImportForCustomerChargedEventBasedAddonParams(TypedDict): - id: NotRequired[str] - last_charged_at: NotRequired[int] - - -class ImportForCustomerContractTermParams(TypedDict): - id: NotRequired[str] - created_at: NotRequired[int] - contract_start: NotRequired[int] - billing_cycle: NotRequired[int] - total_amount_raised: NotRequired[int] - total_amount_raised_before_tax: NotRequired[int] - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class ImportForCustomerTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: NotRequired[enums.PaymentMethod] - reference_number: NotRequired[str] - date: NotRequired[int] - - -class ImportForCustomerShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportForCustomerCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class ImportContractTermContractTermParams(TypedDict): - id: NotRequired[str] - created_at: NotRequired[int] - contract_start: NotRequired[int] - contract_end: NotRequired[int] - status: NotRequired[ContractTermStatus] - total_amount_raised: NotRequired[int] - total_amount_raised_before_tax: NotRequired[int] - total_contract_value: NotRequired[int] - total_contract_value_before_tax: NotRequired[int] - billing_cycle: NotRequired[int] - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class ImportUnbilledChargesUnbilledChargeParams(TypedDict): - id: NotRequired[str] - date_from: Required[int] - date_to: Required[int] - entity_type: Required["unbilled_charge.EntityType"] - entity_id: NotRequired[str] - description: NotRequired[str] - unit_amount: NotRequired[int] - quantity: NotRequired[int] - amount: NotRequired[int] - unit_amount_in_decimal: NotRequired[str] - quantity_in_decimal: NotRequired[str] - amount_in_decimal: NotRequired[str] - discount_amount: NotRequired[int] - use_for_proration: NotRequired[bool] - is_advance_charge: NotRequired[bool] - - -class ImportUnbilledChargesDiscountParams(TypedDict): - unbilled_charge_id: NotRequired[str] - entity_type: NotRequired["invoice.DiscountEntityType"] - entity_id: NotRequired[str] - description: NotRequired[str] - amount: Required[int] - - -class ImportUnbilledChargesTierParams(TypedDict): - unbilled_charge_id: Required[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - quantity_used: NotRequired[int] - unit_amount: NotRequired[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] - - -class ImportForItemsSubscriptionItemParams(TypedDict): - item_price_id: Required[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - billing_cycles: NotRequired[int] - trial_end: NotRequired[int] - service_period_days: NotRequired[int] - charge_on_event: NotRequired[enums.ChargeOnEvent] - charge_once: NotRequired[bool] - item_type: NotRequired[enums.ItemType] - - -class ImportForItemsDiscountParams(TypedDict): - apply_on: Required[enums.ApplyOn] - duration_type: Required[enums.DurationType] - percentage: NotRequired[float] - amount: NotRequired[int] - period: NotRequired[int] - period_unit: NotRequired[enums.PeriodUnit] - included_in_mrr: NotRequired[bool] - item_price_id: NotRequired[str] - - -class ImportForItemsChargedItemParams(TypedDict): - item_price_id: NotRequired[str] - last_charged_at: NotRequired[int] - - -class ImportForItemsItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class ImportForItemsContractTermParams(TypedDict): - id: NotRequired[str] - created_at: NotRequired[int] - contract_start: NotRequired[int] - billing_cycle: NotRequired[int] - total_amount_raised: NotRequired[int] - total_amount_raised_before_tax: NotRequired[int] - action_at_term_end: NotRequired[ContractTermActionAtTermEnd] - cancellation_cutoff_period: NotRequired[int] - - -class ImportForItemsTransactionParams(TypedDict): - amount: NotRequired[int] - payment_method: NotRequired[enums.PaymentMethod] - reference_number: NotRequired[str] - date: NotRequired[int] - - -class ImportForItemsShippingAddressParams(TypedDict): - 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] - zip: NotRequired[str] - country: NotRequired[str] - validation_status: NotRequired[enums.ValidationStatus] - - -class ImportForItemsCouponParams(TypedDict): - coupon_id: NotRequired[str] - apply_till: NotRequired[int] - - -class CancelEventBasedAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - service_period_in_days: NotRequired[int] - - -class CancelForItemsSubscriptionItemParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - service_period_days: NotRequired[int] - - -class ResumePaymentIntentParams(TypedDict): - id: NotRequired[str] - gateway_account_id: NotRequired[str] - gw_token: NotRequired[str] - payment_method_type: NotRequired["payment_intent.PaymentMethodType"] - reference_id: NotRequired[str] - gw_payment_method_id: NotRequired[str] - additional_information: NotRequired[Dict[Any, Any]] diff --git a/chargebee/models/subscription_entitlement/__init__.py b/chargebee/models/subscription_entitlement/__init__.py index 31ce737..e49a899 100644 --- a/chargebee/models/subscription_entitlement/__init__.py +++ b/chargebee/models/subscription_entitlement/__init__.py @@ -1,3 +1,2 @@ from .operations import SubscriptionEntitlement from .responses import SubscriptionEntitlementResponse -from .types import Component, ScheduleStatus diff --git a/chargebee/models/subscription_entitlement/operations.py b/chargebee/models/subscription_entitlement/operations.py index e6cb466..843a2df 100644 --- a/chargebee/models/subscription_entitlement/operations.py +++ b/chargebee/models/subscription_entitlement/operations.py @@ -1,10 +1,28 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import entitlement_override class SubscriptionEntitlement: + class ScheduleStatus(Enum): + ACTIVATED = "activated" + SCHEDULED = "scheduled" + FAILED = "failed" + + def __str__(self): + return self.value + + class Component(TypedDict): + entitlement_overrides: NotRequired[ + entitlement_override.EntitlementOverrideResponse + ] + + class SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams( + TypedDict + ): + feature_id: Required[str] class SubscriptionEntitlementsForSubscriptionParams(TypedDict): limit: NotRequired[int] @@ -16,7 +34,9 @@ class SubscriptionEntitlementsForSubscriptionParams(TypedDict): class SetSubscriptionEntitlementAvailabilityParams(TypedDict): is_enabled: Required[bool] subscription_entitlements: Required[ - List[SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams] + List[ + "SubscriptionEntitlement.SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams" + ] ] @staticmethod diff --git a/chargebee/models/subscription_entitlement/types.py b/chargebee/models/subscription_entitlement/types.py deleted file mode 100644 index c83eb89..0000000 --- a/chargebee/models/subscription_entitlement/types.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import entitlement_override - - -class ScheduleStatus(Enum): - ACTIVATED = "activated" - SCHEDULED = "scheduled" - FAILED = "failed" - - def __str__(self): - return self.value - - -class Component(TypedDict): - entitlement_overrides: NotRequired[entitlement_override.EntitlementOverrideResponse] - - -class SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementParams(TypedDict): - feature_id: Required[str] diff --git a/chargebee/models/subscription_estimate/__init__.py b/chargebee/models/subscription_estimate/__init__.py index 563fde4..5f00a36 100644 --- a/chargebee/models/subscription_estimate/__init__.py +++ b/chargebee/models/subscription_estimate/__init__.py @@ -1,3 +1,2 @@ from .operations import SubscriptionEstimate from .responses import SubscriptionEstimateResponse -from .types import ShippingAddress, ContractTerm, Status diff --git a/chargebee/models/subscription_estimate/operations.py b/chargebee/models/subscription_estimate/operations.py index 1aadf2b..79be116 100644 --- a/chargebee/models/subscription_estimate/operations.py +++ b/chargebee/models/subscription_estimate/operations.py @@ -1,9 +1,70 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum +from chargebee.models import enums class SubscriptionEstimate: + class Status(Enum): + FUTURE = "future" + IN_TRIAL = "in_trial" + ACTIVE = "active" + NON_RENEWING = "non_renewing" + PAUSED = "paused" + CANCELLED = "cancelled" + TRANSFERRED = "transferred" + + def __str__(self): + return self.value + + class ContractTermStatus(Enum): + ACTIVE = "active" + COMPLETED = "completed" + CANCELLED = "cancelled" + TERMINATED = "terminated" + + 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 ShippingAddress(TypedDict): + 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] + index: Required[int] + + class ContractTerm(TypedDict): + id: Required[str] + status: Required["SubscriptionEstimate.ContractTermStatus"] + contract_start: Required[int] + contract_end: Required[int] + billing_cycle: Required[int] + action_at_term_end: Required["SubscriptionEstimate.ContractTermActionAtTermEnd"] + total_contract_value: Required[int] + total_contract_value_before_tax: Required[int] + cancellation_cutoff_period: NotRequired[int] + created_at: Required[int] + subscription_id: Required[str] + remaining_billing_cycles: NotRequired[int] pass diff --git a/chargebee/models/subscription_estimate/types.py b/chargebee/models/subscription_estimate/types.py deleted file mode 100644 index a2ef74e..0000000 --- a/chargebee/models/subscription_estimate/types.py +++ /dev/null @@ -1,69 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - FUTURE = "future" - IN_TRIAL = "in_trial" - ACTIVE = "active" - NON_RENEWING = "non_renewing" - PAUSED = "paused" - CANCELLED = "cancelled" - TRANSFERRED = "transferred" - - def __str__(self): - return self.value - - -class ContractTermStatus(Enum): - ACTIVE = "active" - COMPLETED = "completed" - CANCELLED = "cancelled" - TERMINATED = "terminated" - - 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 ShippingAddress(TypedDict): - 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] - index: Required[int] - - -class ContractTerm(TypedDict): - id: Required[str] - status: Required[ContractTermStatus] - contract_start: Required[int] - contract_end: Required[int] - billing_cycle: Required[int] - action_at_term_end: Required[ContractTermActionAtTermEnd] - total_contract_value: Required[int] - total_contract_value_before_tax: Required[int] - cancellation_cutoff_period: NotRequired[int] - created_at: Required[int] - subscription_id: Required[str] - remaining_billing_cycles: NotRequired[int] diff --git a/chargebee/models/tax_withheld/__init__.py b/chargebee/models/tax_withheld/__init__.py index 15920f9..ac6874c 100644 --- a/chargebee/models/tax_withheld/__init__.py +++ b/chargebee/models/tax_withheld/__init__.py @@ -1,3 +1,2 @@ from .operations import TaxWithheld from .responses import TaxWithheldResponse -from .types import Type, PaymentMethod diff --git a/chargebee/models/tax_withheld/operations.py b/chargebee/models/tax_withheld/operations.py index 5f47200..50ad7c5 100644 --- a/chargebee/models/tax_withheld/operations.py +++ b/chargebee/models/tax_withheld/operations.py @@ -1,9 +1,25 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class TaxWithheld: + class Type(Enum): + PAYMENT = "payment" + REFUND = "refund" + + def __str__(self): + return self.value + + class PaymentMethod(Enum): + CASH = "cash" + CHECK = "check" + CHARGEBACK = "chargeback" + BANK_TRANSFER = "bank_transfer" + OTHER = "other" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/tax_withheld/types.py b/chargebee/models/tax_withheld/types.py deleted file mode 100644 index 08b56c0..0000000 --- a/chargebee/models/tax_withheld/types.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class Type(Enum): - PAYMENT = "payment" - REFUND = "refund" - - def __str__(self): - return self.value - - -class PaymentMethod(Enum): - CASH = "cash" - CHECK = "check" - CHARGEBACK = "chargeback" - BANK_TRANSFER = "bank_transfer" - OTHER = "other" - - def __str__(self): - return self.value diff --git a/chargebee/models/third_party_payment_method/operations.py b/chargebee/models/third_party_payment_method/operations.py index 04939e6..76ac501 100644 --- a/chargebee/models/third_party_payment_method/operations.py +++ b/chargebee/models/third_party_payment_method/operations.py @@ -1,7 +1,6 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast class ThirdPartyPaymentMethod: diff --git a/chargebee/models/third_party_payment_method/types.py b/chargebee/models/third_party_payment_method/types.py deleted file mode 100644 index 55d7118..0000000 --- a/chargebee/models/third_party_payment_method/types.py +++ /dev/null @@ -1,2 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums diff --git a/chargebee/models/time_machine/__init__.py b/chargebee/models/time_machine/__init__.py index 2b3e42d..38611e1 100644 --- a/chargebee/models/time_machine/__init__.py +++ b/chargebee/models/time_machine/__init__.py @@ -1,3 +1,2 @@ from .operations import TimeMachine from .responses import TimeMachineResponse -from .types import TimeTravelStatus diff --git a/chargebee/models/time_machine/operations.py b/chargebee/models/time_machine/operations.py index 79d016b..98fad63 100644 --- a/chargebee/models/time_machine/operations.py +++ b/chargebee/models/time_machine/operations.py @@ -1,12 +1,51 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum import json from chargebee import OperationFailedError class TimeMachine: + class TimeTravelStatus(Enum): + NOT_ENABLED = "not_enabled" + IN_PROGRESS = "in_progress" + SUCCEEDED = "succeeded" + FAILED = "failed" + + def __str__(self): + return self.value + + def wait_for_time_travel_completion( + time_machine: TimeMachineResponse, env=None + ) -> RetrieveResponse: + import time + + count = 0 + sleep_time_millis = ( + 3000 if env == None else env.time_travel_sleep_millis + ) / 1000.0 + + while time_machine.time_travel_status == "in_progress": + if count > 30: + raise RuntimeError("Time travel is taking too much time") + count += 1 + time.sleep(sleep_time_millis) + response = TimeMachine.retrieve(time_machine.name, env) + time_machine = response.time_machine + + if time_machine.time_travel_status == "failed": + err = json.loads(time_machine.error_json) + raise OperationFailedError(err["http_code"], err) + + if time_machine.time_travel_status in ("not_enabled", "_unknown"): + raise RuntimeError( + "Time travel is in wrong state '" + + time_machine.time_travel_status + + "'" + ) + + return response class StartAfreshParams(TypedDict): genesis_time: NotRequired[int] diff --git a/chargebee/models/time_machine/types.py b/chargebee/models/time_machine/types.py deleted file mode 100644 index 7a3e6a1..0000000 --- a/chargebee/models/time_machine/types.py +++ /dev/null @@ -1,12 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum - - -class TimeTravelStatus(Enum): - NOT_ENABLED = "not_enabled" - IN_PROGRESS = "in_progress" - SUCCEEDED = "succeeded" - FAILED = "failed" - - def __str__(self): - return self.value diff --git a/chargebee/models/token/__init__.py b/chargebee/models/token/__init__.py index 2764ec1..16529f7 100644 --- a/chargebee/models/token/__init__.py +++ b/chargebee/models/token/__init__.py @@ -1,3 +1,2 @@ from .operations import Token from .responses import TokenResponse -from .types import Status, Vault diff --git a/chargebee/models/token/operations.py b/chargebee/models/token/operations.py index 4c19d1f..4f680b7 100644 --- a/chargebee/models/token/operations.py +++ b/chargebee/models/token/operations.py @@ -1,9 +1,23 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum class Token: + class Status(Enum): + NEW = "new" + EXPIRED = "expired" + CONSUMED = "consumed" + + def __str__(self): + return self.value + + class Vault(Enum): + SPREEDLY = "spreedly" + GATEWAY = "gateway" + + def __str__(self): + return self.value pass diff --git a/chargebee/models/token/types.py b/chargebee/models/token/types.py deleted file mode 100644 index de70b7a..0000000 --- a/chargebee/models/token/types.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Status(Enum): - NEW = "new" - EXPIRED = "expired" - CONSUMED = "consumed" - - def __str__(self): - return self.value - - -class Vault(Enum): - SPREEDLY = "spreedly" - GATEWAY = "gateway" - - def __str__(self): - return self.value diff --git a/chargebee/models/transaction/__init__.py b/chargebee/models/transaction/__init__.py index e53a9bd..c96f272 100644 --- a/chargebee/models/transaction/__init__.py +++ b/chargebee/models/transaction/__init__.py @@ -1,14 +1,2 @@ from .operations import Transaction from .responses import TransactionResponse -from .types import ( - LinkedInvoice, - LinkedCreditNote, - LinkedRefund, - LinkedPayment, - GatewayErrorDetail, - Type, - Status, - FraudFlag, - InitiatorType, - AuthorizationReason, -) diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py index 6150d8c..8423249 100644 --- a/chargebee/models/transaction/operations.py +++ b/chargebee/models/transaction/operations.py @@ -1,12 +1,110 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums, credit_note, invoice, transaction class Transaction: + class Type(Enum): + AUTHORIZATION = "authorization" + PAYMENT = "payment" + REFUND = "refund" + PAYMENT_REVERSAL = "payment_reversal" + + def __str__(self): + return self.value + + class Status(Enum): + IN_PROGRESS = "in_progress" + SUCCESS = "success" + VOIDED = "voided" + FAILURE = "failure" + TIMEOUT = "timeout" + NEEDS_ATTENTION = "needs_attention" + + def __str__(self): + return self.value + + class FraudFlag(Enum): + SAFE = "safe" + SUSPICIOUS = "suspicious" + FRAUDULENT = "fraudulent" + + def __str__(self): + return self.value + + class InitiatorType(Enum): + CUSTOMER = "customer" + MERCHANT = "merchant" + + def __str__(self): + return self.value + + class AuthorizationReason(Enum): + BLOCKING_FUNDS = "blocking_funds" + VERIFICATION = "verification" + + def __str__(self): + return self.value + + class LinkedPaymentStatus(Enum): + IN_PROGRESS = "in_progress" + SUCCESS = "success" + VOIDED = "voided" + FAILURE = "failure" + TIMEOUT = "timeout" + NEEDS_ATTENTION = "needs_attention" + + def __str__(self): + return self.value + + class LinkedInvoice(TypedDict): + invoice_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + invoice_date: NotRequired[int] + invoice_total: NotRequired[int] + invoice_status: Required["invoice.Invoice.Status"] + + class LinkedCreditNote(TypedDict): + cn_id: Required[str] + applied_amount: Required[int] + applied_at: Required[int] + cn_reason_code: NotRequired["credit_note.CreditNote.ReasonCode"] + cn_create_reason_code: NotRequired[str] + cn_date: NotRequired[int] + cn_total: NotRequired[int] + cn_status: Required["credit_note.CreditNote.Status"] + cn_reference_invoice_id: Required[str] + + class LinkedRefund(TypedDict): + txn_id: Required[str] + txn_status: Required["transaction.Transaction.Status"] + txn_date: Required[int] + txn_amount: Required[int] + + class LinkedPayment(TypedDict): + id: Required[str] + status: NotRequired["Transaction.LinkedPaymentStatus"] + amount: NotRequired[int] + date: NotRequired[int] + + class GatewayErrorDetail(TypedDict): + request_id: NotRequired[str] + error_category: NotRequired[str] + error_code: NotRequired[str] + error_message: NotRequired[str] + decline_code: NotRequired[str] + decline_message: NotRequired[str] + network_error_code: NotRequired[str] + network_error_message: NotRequired[str] + error_field: NotRequired[str] + recommendation_code: NotRequired[str] + recommendation_message: NotRequired[str] + processor_error_code: NotRequired[str] + processor_error_message: NotRequired[str] class CreateAuthorizationParams(TypedDict): customer_id: Required[str] @@ -25,7 +123,7 @@ class RecordRefundParams(TypedDict): class ReconcileParams(TypedDict): id_at_gateway: NotRequired[str] customer_id: NotRequired[str] - status: NotRequired[Status] + status: NotRequired["Transaction.Status"] class RefundParams(TypedDict): amount: NotRequired[int] diff --git a/chargebee/models/transaction/types.py b/chargebee/models/transaction/types.py deleted file mode 100644 index a623663..0000000 --- a/chargebee/models/transaction/types.py +++ /dev/null @@ -1,113 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums, credit_note, invoice, transaction - - -class Type(Enum): - AUTHORIZATION = "authorization" - PAYMENT = "payment" - REFUND = "refund" - PAYMENT_REVERSAL = "payment_reversal" - - def __str__(self): - return self.value - - -class Status(Enum): - IN_PROGRESS = "in_progress" - SUCCESS = "success" - VOIDED = "voided" - FAILURE = "failure" - TIMEOUT = "timeout" - NEEDS_ATTENTION = "needs_attention" - - def __str__(self): - return self.value - - -class FraudFlag(Enum): - SAFE = "safe" - SUSPICIOUS = "suspicious" - FRAUDULENT = "fraudulent" - - def __str__(self): - return self.value - - -class InitiatorType(Enum): - CUSTOMER = "customer" - MERCHANT = "merchant" - - def __str__(self): - return self.value - - -class AuthorizationReason(Enum): - BLOCKING_FUNDS = "blocking_funds" - VERIFICATION = "verification" - - def __str__(self): - return self.value - - -class LinkedPaymentStatus(Enum): - IN_PROGRESS = "in_progress" - SUCCESS = "success" - VOIDED = "voided" - FAILURE = "failure" - TIMEOUT = "timeout" - NEEDS_ATTENTION = "needs_attention" - - def __str__(self): - return self.value - - -class LinkedInvoice(TypedDict): - invoice_id: Required[str] - applied_amount: Required[int] - applied_at: Required[int] - invoice_date: NotRequired[int] - invoice_total: NotRequired[int] - invoice_status: Required["invoice.Status"] - - -class LinkedCreditNote(TypedDict): - cn_id: Required[str] - applied_amount: Required[int] - applied_at: Required[int] - cn_reason_code: NotRequired["credit_note.ReasonCode"] - cn_create_reason_code: NotRequired[str] - cn_date: NotRequired[int] - cn_total: NotRequired[int] - cn_status: Required["credit_note.Status"] - cn_reference_invoice_id: Required[str] - - -class LinkedRefund(TypedDict): - txn_id: Required[str] - txn_status: Required["transaction.Status"] - txn_date: Required[int] - txn_amount: Required[int] - - -class LinkedPayment(TypedDict): - id: Required[str] - status: NotRequired[LinkedPaymentStatus] - amount: NotRequired[int] - date: NotRequired[int] - - -class GatewayErrorDetail(TypedDict): - request_id: NotRequired[str] - error_category: NotRequired[str] - error_code: NotRequired[str] - error_message: NotRequired[str] - decline_code: NotRequired[str] - decline_message: NotRequired[str] - network_error_code: NotRequired[str] - network_error_message: NotRequired[str] - error_field: NotRequired[str] - recommendation_code: NotRequired[str] - recommendation_message: NotRequired[str] - processor_error_code: NotRequired[str] - processor_error_message: NotRequired[str] diff --git a/chargebee/models/unbilled_charge/__init__.py b/chargebee/models/unbilled_charge/__init__.py index 8b1df01..9ab2bcb 100644 --- a/chargebee/models/unbilled_charge/__init__.py +++ b/chargebee/models/unbilled_charge/__init__.py @@ -1,3 +1,2 @@ from .operations import UnbilledCharge from .responses import UnbilledChargeResponse -from .types import Tier, EntityType diff --git a/chargebee/models/unbilled_charge/operations.py b/chargebee/models/unbilled_charge/operations.py index 0fe1b56..4eb2886 100644 --- a/chargebee/models/unbilled_charge/operations.py +++ b/chargebee/models/unbilled_charge/operations.py @@ -1,28 +1,119 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters +from chargebee.models import enums class UnbilledCharge: + class EntityType(Enum): + ADHOC = "adhoc" + PLAN_ITEM_PRICE = "plan_item_price" + ADDON_ITEM_PRICE = "addon_item_price" + CHARGE_ITEM_PRICE = "charge_item_price" + PLAN_SETUP = "plan_setup" + PLAN = "plan" + ADDON = "addon" + + def __str__(self): + return self.value + + class Tier(TypedDict): + 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] + + class CreateUnbilledChargeAddonParams(TypedDict): + id: NotRequired[str] + quantity: NotRequired[int] + unit_price: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateUnbilledChargeChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateUnbilledChargeTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] + + class CreateItemPriceParams(TypedDict): + item_price_id: NotRequired[str] + quantity: NotRequired[int] + quantity_in_decimal: NotRequired[str] + unit_price: NotRequired[int] + unit_price_in_decimal: NotRequired[str] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateItemTierParams(TypedDict): + item_price_id: NotRequired[str] + starting_unit: NotRequired[int] + ending_unit: NotRequired[int] + price: NotRequired[int] + starting_unit_in_decimal: NotRequired[str] + ending_unit_in_decimal: NotRequired[str] + price_in_decimal: NotRequired[str] + + class CreateChargeParams(TypedDict): + amount: NotRequired[int] + amount_in_decimal: NotRequired[str] + description: NotRequired[str] + taxable: NotRequired[bool] + tax_profile_id: NotRequired[str] + avalara_tax_code: NotRequired[str] + hsn_code: NotRequired[str] + taxjar_product_code: NotRequired[str] + avalara_sale_type: NotRequired[enums.AvalaraSaleType] + avalara_transaction_type: NotRequired[int] + avalara_service_type: NotRequired[int] + date_from: NotRequired[int] + date_to: NotRequired[int] + + class CreateTaxProvidersFieldParams(TypedDict): + provider_name: NotRequired[str] + field_id: NotRequired[str] + field_value: NotRequired[str] class CreateUnbilledChargeParams(TypedDict): subscription_id: Required[str] currency_code: NotRequired[str] - addons: NotRequired[List[CreateUnbilledChargeAddonParams]] - charges: NotRequired[List[CreateUnbilledChargeChargeParams]] + addons: NotRequired[List["UnbilledCharge.CreateUnbilledChargeAddonParams"]] + charges: NotRequired[List["UnbilledCharge.CreateUnbilledChargeChargeParams"]] tax_providers_fields: NotRequired[ - List[CreateUnbilledChargeTaxProvidersFieldParams] + List["UnbilledCharge.CreateUnbilledChargeTaxProvidersFieldParams"] ] class CreateParams(TypedDict): subscription_id: Required[str] currency_code: NotRequired[str] - item_prices: NotRequired[List[CreateItemPriceParams]] - item_tiers: NotRequired[List[CreateItemTierParams]] - charges: NotRequired[List[CreateChargeParams]] - tax_providers_fields: NotRequired[List[CreateTaxProvidersFieldParams]] + item_prices: NotRequired[List["UnbilledCharge.CreateItemPriceParams"]] + item_tiers: NotRequired[List["UnbilledCharge.CreateItemTierParams"]] + charges: NotRequired[List["UnbilledCharge.CreateChargeParams"]] + tax_providers_fields: NotRequired[ + List["UnbilledCharge.CreateTaxProvidersFieldParams"] + ] class InvoiceUnbilledChargesParams(TypedDict): subscription_id: NotRequired[str] diff --git a/chargebee/models/unbilled_charge/types.py b/chargebee/models/unbilled_charge/types.py deleted file mode 100644 index f84ff5d..0000000 --- a/chargebee/models/unbilled_charge/types.py +++ /dev/null @@ -1,101 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class EntityType(Enum): - ADHOC = "adhoc" - PLAN_ITEM_PRICE = "plan_item_price" - ADDON_ITEM_PRICE = "addon_item_price" - CHARGE_ITEM_PRICE = "charge_item_price" - PLAN_SETUP = "plan_setup" - PLAN = "plan" - ADDON = "addon" - - def __str__(self): - return self.value - - -class Tier(TypedDict): - 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] - - -class CreateUnbilledChargeAddonParams(TypedDict): - id: NotRequired[str] - quantity: NotRequired[int] - unit_price: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateUnbilledChargeChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateUnbilledChargeTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] - - -class CreateItemPriceParams(TypedDict): - item_price_id: NotRequired[str] - quantity: NotRequired[int] - quantity_in_decimal: NotRequired[str] - unit_price: NotRequired[int] - unit_price_in_decimal: NotRequired[str] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateItemTierParams(TypedDict): - item_price_id: NotRequired[str] - starting_unit: NotRequired[int] - ending_unit: NotRequired[int] - price: NotRequired[int] - starting_unit_in_decimal: NotRequired[str] - ending_unit_in_decimal: NotRequired[str] - price_in_decimal: NotRequired[str] - - -class CreateChargeParams(TypedDict): - amount: NotRequired[int] - amount_in_decimal: NotRequired[str] - description: NotRequired[str] - taxable: NotRequired[bool] - tax_profile_id: NotRequired[str] - avalara_tax_code: NotRequired[str] - hsn_code: NotRequired[str] - taxjar_product_code: NotRequired[str] - avalara_sale_type: NotRequired[enums.AvalaraSaleType] - avalara_transaction_type: NotRequired[int] - avalara_service_type: NotRequired[int] - date_from: NotRequired[int] - date_to: NotRequired[int] - - -class CreateTaxProvidersFieldParams(TypedDict): - provider_name: NotRequired[str] - field_id: NotRequired[str] - field_value: NotRequired[str] diff --git a/chargebee/models/usage/operations.py b/chargebee/models/usage/operations.py index 9195505..2d7c6f8 100644 --- a/chargebee/models/usage/operations.py +++ b/chargebee/models/usage/operations.py @@ -1,13 +1,15 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any -from chargebee.models import enums +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.filters import Filters +from chargebee.models import enums class Usage: + class PdfInvoiceParams(TypedDict): + id: Required[str] + class CreateParams(TypedDict): id: NotRequired[str] item_price_id: Required[str] @@ -35,7 +37,7 @@ class ListParams(TypedDict): sort_by: NotRequired[Filters.SortFilter] class PdfParams(TypedDict): - invoice: Required[PdfInvoiceParams] + invoice: Required["Usage.PdfInvoiceParams"] disposition_type: NotRequired[enums.DispositionType] @staticmethod diff --git a/chargebee/models/usage/types.py b/chargebee/models/usage/types.py deleted file mode 100644 index b5f193e..0000000 --- a/chargebee/models/usage/types.py +++ /dev/null @@ -1,6 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from chargebee.models import enums - - -class PdfInvoiceParams(TypedDict): - id: Required[str] diff --git a/chargebee/models/virtual_bank_account/__init__.py b/chargebee/models/virtual_bank_account/__init__.py index 7c4f8c9..ad5ef59 100644 --- a/chargebee/models/virtual_bank_account/__init__.py +++ b/chargebee/models/virtual_bank_account/__init__.py @@ -1,3 +1,2 @@ from .operations import VirtualBankAccount from .responses import VirtualBankAccountResponse -from .types import Scheme diff --git a/chargebee/models/virtual_bank_account/operations.py b/chargebee/models/virtual_bank_account/operations.py index 866e73a..06ab9ad 100644 --- a/chargebee/models/virtual_bank_account/operations.py +++ b/chargebee/models/virtual_bank_account/operations.py @@ -1,21 +1,32 @@ -from .types import * from .responses import * from chargebee import request -from typing import cast, Any +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum from chargebee.filters import Filters class VirtualBankAccount: + class Scheme(Enum): + ACH_CREDIT = "ach_credit" + SEPA_CREDIT = "sepa_credit" + US_AUTOMATED_BANK_TRANSFER = "us_automated_bank_transfer" + GB_AUTOMATED_BANK_TRANSFER = "gb_automated_bank_transfer" + EU_AUTOMATED_BANK_TRANSFER = "eu_automated_bank_transfer" + JP_AUTOMATED_BANK_TRANSFER = "jp_automated_bank_transfer" + MX_AUTOMATED_BANK_TRANSFER = "mx_automated_bank_transfer" + + def __str__(self): + return self.value class CreateUsingPermanentTokenParams(TypedDict): customer_id: Required[str] reference_id: Required[str] - scheme: NotRequired[Scheme] + scheme: NotRequired["VirtualBankAccount.Scheme"] class CreateParams(TypedDict): customer_id: Required[str] email: NotRequired[str] - scheme: NotRequired[Scheme] + scheme: NotRequired["VirtualBankAccount.Scheme"] class ListParams(TypedDict): limit: NotRequired[int] diff --git a/chargebee/models/virtual_bank_account/types.py b/chargebee/models/virtual_bank_account/types.py deleted file mode 100644 index 761ccca..0000000 --- a/chargebee/models/virtual_bank_account/types.py +++ /dev/null @@ -1,16 +0,0 @@ -from typing import TypedDict, Required, NotRequired, Dict, List, Any -from enum import Enum -from chargebee.models import enums - - -class Scheme(Enum): - ACH_CREDIT = "ach_credit" - SEPA_CREDIT = "sepa_credit" - US_AUTOMATED_BANK_TRANSFER = "us_automated_bank_transfer" - GB_AUTOMATED_BANK_TRANSFER = "gb_automated_bank_transfer" - EU_AUTOMATED_BANK_TRANSFER = "eu_automated_bank_transfer" - JP_AUTOMATED_BANK_TRANSFER = "jp_automated_bank_transfer" - MX_AUTOMATED_BANK_TRANSFER = "mx_automated_bank_transfer" - - def __str__(self): - return self.value diff --git a/chargebee/responses.py b/chargebee/responses.py index f2690bc..56e388a 100644 --- a/chargebee/responses.py +++ b/chargebee/responses.py @@ -1,3 +1,4 @@ +import importlib from dataclasses import fields from typing import Type, TypeVar @@ -8,6 +9,13 @@ def _is_primitive(field_type): return field_type in (int, str, float, bool) +def get_class_from_string(class_path: str): + module_name, class_name = class_path.rsplit(".", 1) + module_path = "chargebee.models." + module_name + ".responses" + module = importlib.import_module(module_path) + return getattr(module, class_name) + + class Response(object): IDEMPOTENCY_REPLAYED_HEADER = "chargebee-idempotency-replayed" @@ -43,6 +51,10 @@ def parse_response(self) -> T: if _is_primitive(inner_field_type): data[inner_field_name] = response[inner_field_name] else: + if type(inner_field_type) == str: + inner_field_type = get_class_from_string( + inner_field_type + ) data[inner_field_name] = inner_field_type.construct( response[inner_field_name] ) @@ -51,6 +63,8 @@ def parse_response(self) -> T: elif _is_primitive(field_type): init_data[field_name] = self._response[field_name] else: + if type(field_type) == str: + field_type = get_class_from_string(field_type) init_data[field_name] = field_type.construct( self._response[field_name] ) @@ -75,6 +89,10 @@ def parse_list_response(self) -> T: if _is_primitive(inner_field_type): data[inner_field_name] = response[inner_field_name] else: + if type(inner_field_type) == str: + inner_field_type = get_class_from_string( + inner_field_type + ) data[inner_field_name] = inner_field_type.construct( response[inner_field_name] ) diff --git a/chargebee/util.py b/chargebee/util.py index 4dc96b8..7fbef55 100644 --- a/chargebee/util.py +++ b/chargebee/util.py @@ -1,5 +1,6 @@ from chargebee import compat from collections import OrderedDict +from enum import Enum def serialize(value, prefix=None, idx=None): @@ -8,7 +9,12 @@ def serialize(value, prefix=None, idx=None): if isinstance(value, dict): for k, v in list(value.items()): - if k in ("meta_data", "metaData", "checkout_info") and isinstance(v, dict): + if k in ( + "meta_data", + "metaData", + "metadata", + "checkout_info", + ) and isinstance(v, dict): serialized.update({k: v}) elif k in ( "exemption_details", @@ -17,9 +23,21 @@ def serialize(value, prefix=None, idx=None): "currencies", ) and isinstance(v, list): serialized.update({k: v}) + elif k in ("in", "not_in", "between") and isinstance(v, list): + v = [str(i) for i in v] + key = "".join( + [ + prefix or "", + "[%s]" % k if prefix is not None else k, + "[%s]" % idx if idx is not None else "", + ] + ) + serialized.update({key: str(v)}) elif isinstance(v, (dict, list, tuple)): serialized.update(serialize(v, k)) else: + if isinstance(v, Enum): + v = str(v) key = "".join( [ prefix or "", From 7e19c551ebe3ab9ff5ea9e9e926773f9df28059d Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 3 Oct 2024 18:32:02 +0530 Subject: [PATCH 09/19] Added description in setup.py --- setup.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index d16819e..2cc44dc 100644 --- a/setup.py +++ b/setup.py @@ -4,23 +4,28 @@ import sys import os -sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'chargebee')) -if sys.version_info < (3,11): - sys.exit('Sorry, Python < 3.11 is not supported') +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "chargebee")) +if sys.version_info < (3, 11): + sys.exit("Sorry, Python < 3.11 is not supported") import version -requires = ['requests'] +with open("README.md", "r") as file: + description = file.read() + +requires = ["requests"] setup( - name='chargebee', + name="chargebee", version=version.VERSION, - author='Chargebee', - author_email='dx@chargebee.com', - url='https://apidocs.chargebee.com/docs/api?lang=python', - description='Python wrapper for the Chargebee Subscription Billing API', + author="Chargebee", + author_email="dx@chargebee.com", + url="https://apidocs.chargebee.com/docs/api?lang=python", + description="Python wrapper for the Chargebee Subscription Billing API", packages=find_packages(exclude=["tests"]), - package_data={'chargebee': ['ssl/*.crt']}, - python_requires='>=3.11', + package_data={"chargebee": ["ssl/*.crt"]}, + python_requires=">=3.11", install_requires=requires, - test_suite='tests', + test_suite="tests", + long_description=description, + long_description_content_type="text/markdown", ) From b9c3335c40a2ec21a06fcb9a968b4ab32e6a9d52 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 3 Oct 2024 18:40:28 +0530 Subject: [PATCH 10/19] model resource updates --- chargebee/models/__init__.py | 11 ++-- chargebee/models/enums.py | 16 ++--- chargebee/models/installment/__init__.py | 2 - chargebee/models/installment/operations.py | 43 -------------- chargebee/models/installment/responses.py | 34 ----------- .../models/installment_config/__init__.py | 2 - .../models/installment_detail/__init__.py | 2 - chargebee/models/invoice/operations.py | 25 +++++--- chargebee/models/invoice/responses.py | 9 ++- chargebee/models/item/operations.py | 58 +++++++++++++++++++ chargebee/models/item/responses.py | 15 +++++ chargebee/models/item_price/operations.py | 6 -- chargebee/models/item_price/responses.py | 1 - chargebee/models/payment_schedule/__init__.py | 2 + .../operations.py | 18 +++--- .../responses.py | 18 +++--- .../payment_schedule_scheme/__init__.py | 2 + .../operations.py | 20 +++---- .../responses.py | 15 +++-- chargebee/models/purchase/operations.py | 10 ++-- chargebee/responses.py | 2 +- chargebee/util.py | 5 +- 22 files changed, 152 insertions(+), 164 deletions(-) delete mode 100644 chargebee/models/installment/__init__.py delete mode 100644 chargebee/models/installment/operations.py delete mode 100644 chargebee/models/installment/responses.py delete mode 100644 chargebee/models/installment_config/__init__.py delete mode 100644 chargebee/models/installment_detail/__init__.py create mode 100644 chargebee/models/payment_schedule/__init__.py rename chargebee/models/{installment_detail => payment_schedule}/operations.py (56%) rename chargebee/models/{installment_detail => payment_schedule}/responses.py (61%) create mode 100644 chargebee/models/payment_schedule_scheme/__init__.py rename chargebee/models/{installment_config => payment_schedule_scheme}/operations.py (67%) rename chargebee/models/{installment_config => payment_schedule_scheme}/responses.py (64%) diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 22c7554..7144484 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -73,7 +73,6 @@ UnbilledChargesHandling, UnbilledChargesOption, UnpaidInvoicesHandling, - UsageAccumulationResetFrequency, ValidationStatus, VoucherType, ChargeOn, @@ -151,12 +150,6 @@ from chargebee.models.in_app_subscription.operations import InAppSubscription -from chargebee.models.installment.operations import Installment - -from chargebee.models.installment_config.operations import InstallmentConfig - -from chargebee.models.installment_detail.operations import InstallmentDetail - from chargebee.models.invoice.operations import Invoice from chargebee.models.invoice_estimate.operations import InvoiceEstimate @@ -177,6 +170,10 @@ from chargebee.models.payment_reference_number.operations import PaymentReferenceNumber +from chargebee.models.payment_schedule.operations import PaymentSchedule + +from chargebee.models.payment_schedule_scheme.operations import PaymentScheduleScheme + from chargebee.models.payment_source.operations import PaymentSource from chargebee.models.payment_voucher.operations import PaymentVoucher diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 392a132..360fe17 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -415,10 +415,10 @@ class EventType(Enum): CREDIT_NOTE_CREATED_WITH_BACKDATING = "credit_note_created_with_backdating" CREDIT_NOTE_UPDATED = "credit_note_updated" CREDIT_NOTE_DELETED = "credit_note_deleted" - INVOICE_INSTALLMENTS_CREATED = "invoice_installments_created" - INVOICE_INSTALLMENT_UPDATED = "invoice_installment_updated" - INSTALLMENT_CONFIG_CREATED = "installment_config_created" - INSTALLMENT_CONFIG_DELETED = "installment_config_deleted" + PAYMENT_SCHEDULES_CREATED = "payment_schedules_created" + PAYMENT_SCHEDULES_UPDATED = "payment_schedules_updated" + PAYMENT_SCHEDULE_SCHEME_CREATED = "payment_schedule_scheme_created" + PAYMENT_SCHEDULE_SCHEME_DELETED = "payment_schedule_scheme_deleted" SUBSCRIPTION_RENEWAL_REMINDER = "subscription_renewal_reminder" ADD_USAGES_REMINDER = "add_usages_reminder" TRANSACTION_CREATED = "transaction_created" @@ -1049,14 +1049,6 @@ def __str__(self): return self.value -class UsageAccumulationResetFrequency(Enum): - NEVER = "never" - SUBSCRIPTION_BILLING_FREQUENCY = "subscription_billing_frequency" - - def __str__(self): - return self.value - - class ValidationStatus(Enum): NOT_VALIDATED = "not_validated" VALID = "valid" diff --git a/chargebee/models/installment/__init__.py b/chargebee/models/installment/__init__.py deleted file mode 100644 index 62d4203..0000000 --- a/chargebee/models/installment/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .operations import Installment -from .responses import InstallmentResponse diff --git a/chargebee/models/installment/operations.py b/chargebee/models/installment/operations.py deleted file mode 100644 index 5421973..0000000 --- a/chargebee/models/installment/operations.py +++ /dev/null @@ -1,43 +0,0 @@ -from .responses import * -from chargebee import request -from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast -from enum import Enum -from chargebee.filters import Filters - - -class Installment: - class Status(Enum): - POSTED = "posted" - PAYMENT_DUE = "payment_due" - PAID = "paid" - - def __str__(self): - return self.value - - class ListParams(TypedDict): - limit: NotRequired[int] - offset: NotRequired[str] - sort_by: NotRequired[Filters.SortFilter] - invoice_id: Required[Filters.StringFilter] - - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: - return request.send( - "get", - request.uri_path("installments", id), - None, - env, - headers, - RetrieveResponse, - ) - - @staticmethod - def list(params: ListParams, env=None, headers=None) -> ListResponse: - return request.send_list_request( - "get", - request.uri_path("installments"), - cast(Dict[Any, Any], params), - env, - headers, - ListResponse, - ) diff --git a/chargebee/models/installment/responses.py b/chargebee/models/installment/responses.py deleted file mode 100644 index 379abff..0000000 --- a/chargebee/models/installment/responses.py +++ /dev/null @@ -1,34 +0,0 @@ -from dataclasses import dataclass -from chargebee.model import Model -from typing import Dict, List, Any - - -@dataclass -class InstallmentResponse(Model): - raw_data: Dict[Any, Any] = None - id: str = None - invoice_id: str = None - date: int = None - amount: int = None - status: str = None - created_at: int = None - resource_version: int = None - updated_at: int = None - - -@dataclass -class RetrieveResponse: - installment: InstallmentResponse - response_headers: Dict[Any, Any] = None - - -@dataclass -class ListInstallmentResponse: - installment: InstallmentResponse - - -@dataclass -class ListResponse: - list: List[ListInstallmentResponse] - next_offset: str = None - response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/installment_config/__init__.py b/chargebee/models/installment_config/__init__.py deleted file mode 100644 index 8da266c..0000000 --- a/chargebee/models/installment_config/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .operations import InstallmentConfig -from .responses import InstallmentConfigResponse diff --git a/chargebee/models/installment_detail/__init__.py b/chargebee/models/installment_detail/__init__.py deleted file mode 100644 index 45d1fea..0000000 --- a/chargebee/models/installment_detail/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .operations import InstallmentDetail -from .responses import InstallmentDetailResponse diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index eebe46b..99b439c 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -1106,8 +1106,8 @@ class UpdateDetailsParams(TypedDict): po_number: NotRequired[str] comment: NotRequired[str] - class InstallmentsParams(TypedDict): - config_id: Required[str] + class ApplyPaymentScheduleSchemeParams(TypedDict): + scheme_id: Required[str] amount: NotRequired[int] @staticmethod @@ -1537,16 +1537,27 @@ def update_details( ) @staticmethod - def installments( - id, params: InstallmentsParams, env=None, headers=None - ) -> InstallmentsResponse: + def apply_payment_schedule_scheme( + id, params: ApplyPaymentScheduleSchemeParams, env=None, headers=None + ) -> ApplyPaymentScheduleSchemeResponse: return request.send( "post", - request.uri_path("invoices", id, "installments"), + request.uri_path("invoices", id, "apply_payment_schedule_scheme"), cast(Dict[Any, Any], params), env, headers, - InstallmentsResponse, + ApplyPaymentScheduleSchemeResponse, + ) + + @staticmethod + def payment_schedules(id, env=None, headers=None) -> PaymentSchedulesResponse: + return request.send( + "get", + request.uri_path("invoices", id, "payment_schedules"), + None, + env, + headers, + PaymentSchedulesResponse, ) @staticmethod diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index 25b1cdd..55c2da2 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -8,6 +8,7 @@ transaction, credit_note, transaction, + payment_schedule, payment_reference_number, download, ) @@ -542,11 +543,17 @@ class UpdateDetailsResponse: @dataclass -class InstallmentsResponse: +class ApplyPaymentScheduleSchemeResponse: invoice: InvoiceResponse response_headers: Dict[Any, Any] = None +@dataclass +class PaymentSchedulesResponse: + payment_schedules: List["payment_schedule.PaymentScheduleResponse"] + response_headers: Dict[Any, Any] = None + + @dataclass class ResendEinvoiceResponse: invoice: InvoiceResponse diff --git a/chargebee/models/item/operations.py b/chargebee/models/item/operations.py index b8204ee..a4f5488 100644 --- a/chargebee/models/item/operations.py +++ b/chargebee/models/item/operations.py @@ -3,6 +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 enums class Item: @@ -37,9 +38,55 @@ class UsageCalculation(Enum): def __str__(self): return self.value + class BundleConfigurationType(Enum): + FIXED = "fixed" + + def __str__(self): + return self.value + class ApplicableItem(TypedDict): id: NotRequired[str] + class BundleItem(TypedDict): + item_id: Required[str] + item_type: NotRequired[enums.ItemType] + quantity: NotRequired[int] + price_allocation: NotRequired[float] + + class BundleConfiguration(TypedDict): + type: NotRequired["Item.BundleConfigurationType"] + + class CreateBundleConfigurationParams(TypedDict): + type: NotRequired["Item.BundleConfigurationType"] + + class CreateBundleItemsToAddParams(TypedDict): + item_id: NotRequired[str] + item_type: NotRequired[enums.ItemType] + quantity: NotRequired[int] + price_allocation: NotRequired[float] + + class UpdateBundleConfigurationParams(TypedDict): + type: NotRequired["Item.BundleConfigurationType"] + + class UpdateBundleItemsToAddParams(TypedDict): + item_id: NotRequired[str] + item_type: NotRequired[enums.ItemType] + quantity: NotRequired[int] + price_allocation: NotRequired[float] + + class UpdateBundleItemsToUpdateParams(TypedDict): + item_id: NotRequired[str] + item_type: NotRequired[enums.ItemType] + quantity: NotRequired[int] + price_allocation: NotRequired[float] + + class UpdateBundleItemsToRemoveParams(TypedDict): + item_id: NotRequired[str] + item_type: NotRequired[enums.ItemType] + + class ListBundleConfigurationParams(TypedDict): + type: NotRequired[Filters.EnumFilter] + class CreateParams(TypedDict): id: Required[str] name: Required[str] @@ -54,12 +101,14 @@ class CreateParams(TypedDict): enabled_for_checkout: NotRequired[bool] item_applicability: NotRequired["Item.ItemApplicability"] applicable_items: NotRequired[List[str]] + bundle_configuration: NotRequired["Item.CreateBundleConfigurationParams"] unit: NotRequired[str] gift_claim_redirect_url: NotRequired[str] included_in_mrr: NotRequired[bool] metered: NotRequired[bool] usage_calculation: NotRequired["Item.UsageCalculation"] metadata: NotRequired[Dict[Any, Any]] + bundle_items_to_add: NotRequired[List["Item.CreateBundleItemsToAddParams"]] class UpdateParams(TypedDict): name: NotRequired[str] @@ -73,15 +122,24 @@ class UpdateParams(TypedDict): item_applicability: NotRequired["Item.ItemApplicability"] clear_applicable_items: NotRequired[bool] applicable_items: NotRequired[List[str]] + bundle_configuration: NotRequired["Item.UpdateBundleConfigurationParams"] unit: NotRequired[str] gift_claim_redirect_url: NotRequired[str] metadata: NotRequired[Dict[Any, Any]] included_in_mrr: NotRequired[bool] status: NotRequired["Item.Status"] + bundle_items_to_add: NotRequired[List["Item.UpdateBundleItemsToAddParams"]] + bundle_items_to_update: NotRequired[ + List["Item.UpdateBundleItemsToUpdateParams"] + ] + bundle_items_to_remove: NotRequired[ + List["Item.UpdateBundleItemsToRemoveParams"] + ] class ListParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] + bundle_configuration: NotRequired["Item.ListBundleConfigurationParams"] id: NotRequired[Filters.StringFilter] item_family_id: NotRequired[Filters.StringFilter] type: NotRequired[Filters.EnumFilter] diff --git a/chargebee/models/item/responses.py b/chargebee/models/item/responses.py index ed89624..d6d5d99 100644 --- a/chargebee/models/item/responses.py +++ b/chargebee/models/item/responses.py @@ -8,6 +8,19 @@ class ApplicableItemResponse(Model): id: str = None +@dataclass +class BundleItemResponse(Model): + item_id: str = None + item_type: str = None + quantity: int = None + price_allocation: float = None + + +@dataclass +class BundleConfigurationResponse(Model): + type: str = None + + @dataclass class ItemResponse(Model): raw_data: Dict[Any, Any] = None @@ -34,6 +47,8 @@ class ItemResponse(Model): archived_at: int = None channel: str = None applicable_items: List[ApplicableItemResponse] = None + bundle_items: List[BundleItemResponse] = None + bundle_configuration: BundleConfigurationResponse = None metadata: Dict[Any, Any] = None diff --git a/chargebee/models/item_price/operations.py b/chargebee/models/item_price/operations.py index ad42939..6ca3c04 100644 --- a/chargebee/models/item_price/operations.py +++ b/chargebee/models/item_price/operations.py @@ -162,9 +162,6 @@ class CreateParams(TypedDict): metadata: NotRequired[Dict[Any, Any]] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] - usage_accumulation_reset_frequency: NotRequired[ - enums.UsageAccumulationResetFrequency - ] pricing_model: NotRequired[enums.PricingModel] tiers: NotRequired[List["ItemPrice.CreateTierParams"]] price: NotRequired[int] @@ -188,9 +185,6 @@ class UpdateParams(TypedDict): price_variant_id: NotRequired[str] status: NotRequired["ItemPrice.Status"] external_name: NotRequired[str] - usage_accumulation_reset_frequency: NotRequired[ - enums.UsageAccumulationResetFrequency - ] currency_code: NotRequired[str] invoice_notes: NotRequired[str] is_taxable: NotRequired[bool] diff --git a/chargebee/models/item_price/responses.py b/chargebee/models/item_price/responses.py index 15091d9..22fe45c 100644 --- a/chargebee/models/item_price/responses.py +++ b/chargebee/models/item_price/responses.py @@ -72,7 +72,6 @@ class ItemPriceResponse(Model): resource_version: int = None updated_at: int = None created_at: int = None - usage_accumulation_reset_frequency: str = None archived_at: int = None invoice_notes: str = None tiers: List[TierResponse] = None diff --git a/chargebee/models/payment_schedule/__init__.py b/chargebee/models/payment_schedule/__init__.py new file mode 100644 index 0000000..ce111c9 --- /dev/null +++ b/chargebee/models/payment_schedule/__init__.py @@ -0,0 +1,2 @@ +from .operations import PaymentSchedule +from .responses import PaymentScheduleResponse diff --git a/chargebee/models/installment_detail/operations.py b/chargebee/models/payment_schedule/operations.py similarity index 56% rename from chargebee/models/installment_detail/operations.py rename to chargebee/models/payment_schedule/operations.py index 52b5164..184ae5a 100644 --- a/chargebee/models/installment_detail/operations.py +++ b/chargebee/models/payment_schedule/operations.py @@ -4,8 +4,14 @@ from enum import Enum -class InstallmentDetail: - class InstallmentStatus(Enum): +class PaymentSchedule: + class EntityType(Enum): + INVOICE = "invoice" + + def __str__(self): + return self.value + + class ScheduleEntryStatus(Enum): POSTED = "posted" PAYMENT_DUE = "payment_due" PAID = "paid" @@ -13,14 +19,10 @@ class InstallmentStatus(Enum): def __str__(self): return self.value - class Installment(TypedDict): + class ScheduleEntry(TypedDict): id: Required[str] - invoice_id: Required[str] date: Required[int] amount: Required[int] - status: Required["InstallmentDetail.InstallmentStatus"] - created_at: Required[int] - resource_version: NotRequired[int] - updated_at: NotRequired[int] + status: Required["PaymentSchedule.ScheduleEntryStatus"] pass diff --git a/chargebee/models/installment_detail/responses.py b/chargebee/models/payment_schedule/responses.py similarity index 61% rename from chargebee/models/installment_detail/responses.py rename to chargebee/models/payment_schedule/responses.py index 1920a3a..ee989a3 100644 --- a/chargebee/models/installment_detail/responses.py +++ b/chargebee/models/payment_schedule/responses.py @@ -4,21 +4,23 @@ @dataclass -class InstallmentResponse(Model): +class ScheduleEntryResponse(Model): id: str = None - invoice_id: str = None date: int = None amount: int = None status: str = None - created_at: int = None - resource_version: int = None - updated_at: int = None @dataclass -class InstallmentDetailResponse(Model): +class PaymentScheduleResponse(Model): raw_data: Dict[Any, Any] = None id: str = None - invoice_id: str = None + scheme_id: str = None + entity_type: str = None + entity_id: str = None amount: int = None - installments: List[InstallmentResponse] = None + created_at: int = None + resource_version: int = None + updated_at: int = None + currency_code: str = None + schedule_entries: List[ScheduleEntryResponse] = None diff --git a/chargebee/models/payment_schedule_scheme/__init__.py b/chargebee/models/payment_schedule_scheme/__init__.py new file mode 100644 index 0000000..3361c80 --- /dev/null +++ b/chargebee/models/payment_schedule_scheme/__init__.py @@ -0,0 +1,2 @@ +from .operations import PaymentScheduleScheme +from .responses import PaymentScheduleSchemeResponse diff --git a/chargebee/models/installment_config/operations.py b/chargebee/models/payment_schedule_scheme/operations.py similarity index 67% rename from chargebee/models/installment_config/operations.py rename to chargebee/models/payment_schedule_scheme/operations.py index cb15c35..50ad04c 100644 --- a/chargebee/models/installment_config/operations.py +++ b/chargebee/models/payment_schedule_scheme/operations.py @@ -4,7 +4,7 @@ from enum import Enum -class InstallmentConfig: +class PaymentScheduleScheme: class PeriodUnit(Enum): DAY = "day" WEEK = "week" @@ -13,27 +13,21 @@ class PeriodUnit(Enum): def __str__(self): return self.value - class Installment(TypedDict): - period: NotRequired[int] - amount_percentage: NotRequired[float] - - class CreateInstallmentParams(TypedDict): + class PreferredSchedule(TypedDict): period: NotRequired[int] amount_percentage: NotRequired[float] class CreateParams(TypedDict): - number_of_installments: Required[int] - period_unit: Required["InstallmentConfig.PeriodUnit"] + number_of_schedules: Required[int] + period_unit: Required["PaymentScheduleScheme.PeriodUnit"] period: NotRequired[int] - preferred_day: NotRequired[int] description: NotRequired[str] - installments: NotRequired[List["InstallmentConfig.CreateInstallmentParams"]] @staticmethod def create(params: CreateParams, env=None, headers=None) -> CreateResponse: return request.send( "post", - request.uri_path("installment_configs"), + request.uri_path("payment_schedule_schemes"), cast(Dict[Any, Any], params), env, headers, @@ -44,7 +38,7 @@ def create(params: CreateParams, env=None, headers=None) -> CreateResponse: def retrieve(id, env=None, headers=None) -> RetrieveResponse: return request.send( "get", - request.uri_path("installment_configs", id), + request.uri_path("payment_schedule_schemes", id), None, env, headers, @@ -55,7 +49,7 @@ def retrieve(id, env=None, headers=None) -> RetrieveResponse: def delete(id, env=None, headers=None) -> DeleteResponse: return request.send( "post", - request.uri_path("installment_configs", id, "delete"), + request.uri_path("payment_schedule_schemes", id, "delete"), None, env, headers, diff --git a/chargebee/models/installment_config/responses.py b/chargebee/models/payment_schedule_scheme/responses.py similarity index 64% rename from chargebee/models/installment_config/responses.py rename to chargebee/models/payment_schedule_scheme/responses.py index bdfdfbe..70614f6 100644 --- a/chargebee/models/installment_config/responses.py +++ b/chargebee/models/payment_schedule_scheme/responses.py @@ -4,39 +4,38 @@ @dataclass -class InstallmentResponse(Model): +class PreferredScheduleResponse(Model): period: int = None amount_percentage: float = None @dataclass -class InstallmentConfigResponse(Model): +class PaymentScheduleSchemeResponse(Model): raw_data: Dict[Any, Any] = None id: str = None description: str = None - number_of_installments: int = None + number_of_schedules: int = None period_unit: str = None period: int = None - preferred_day: int = None created_at: int = None resource_version: int = None updated_at: int = None - installments: List[InstallmentResponse] = None + preferred_schedules: List[PreferredScheduleResponse] = None @dataclass class CreateResponse: - installment_config: InstallmentConfigResponse + payment_schedule_scheme: PaymentScheduleSchemeResponse response_headers: Dict[Any, Any] = None @dataclass class RetrieveResponse: - installment_config: InstallmentConfigResponse + payment_schedule_scheme: PaymentScheduleSchemeResponse response_headers: Dict[Any, Any] = None @dataclass class DeleteResponse: - installment_config: InstallmentConfigResponse + payment_schedule_scheme: PaymentScheduleSchemeResponse response_headers: Dict[Any, Any] = None diff --git a/chargebee/models/purchase/operations.py b/chargebee/models/purchase/operations.py index b514ff9..78fe99a 100644 --- a/chargebee/models/purchase/operations.py +++ b/chargebee/models/purchase/operations.py @@ -63,13 +63,13 @@ class CreateInvoiceInfoParams(TypedDict): po_number: NotRequired[str] notes: NotRequired[str] + class CreatePaymentScheduleParams(TypedDict): + scheme_id: NotRequired[str] + amount: NotRequired[int] + class CreateStatementDescriptorParams(TypedDict): descriptor: NotRequired[str] - class CreateInstallmentInfoParams(TypedDict): - config_id: NotRequired[str] - amount: NotRequired[int] - class EstimatePurchaseItemParams(TypedDict): index: Required[int] item_price_id: Required[str] @@ -150,8 +150,8 @@ class CreateParams(TypedDict): subscription_info: Required[List["Purchase.CreateSubscriptionInfoParams"]] contract_terms: Required[List["Purchase.CreateContractTermParams"]] invoice_info: NotRequired["Purchase.CreateInvoiceInfoParams"] + payment_schedule: NotRequired["Purchase.CreatePaymentScheduleParams"] statement_descriptor: NotRequired["Purchase.CreateStatementDescriptorParams"] - installment_info: NotRequired["Purchase.CreateInstallmentInfoParams"] customer_id: Required[str] payment_source_id: NotRequired[str] diff --git a/chargebee/responses.py b/chargebee/responses.py index 56e388a..77826b3 100644 --- a/chargebee/responses.py +++ b/chargebee/responses.py @@ -29,7 +29,7 @@ def __init__(self, response_type: Type[T], response, response_header=None): self.is_idempotency_replayed() def is_idempotency_replayed(self): - self._response_header[self.IDEMPOTENCY_REPLAYED_HEADER] = bool( + self._response_header["is_idempotency_replayed"] = bool( self._response_header.get(self.IDEMPOTENCY_REPLAYED_HEADER, False) ) diff --git a/chargebee/util.py b/chargebee/util.py index 7fbef55..a7dcf0a 100644 --- a/chargebee/util.py +++ b/chargebee/util.py @@ -67,7 +67,4 @@ def get_val(val): elif isinstance(val, bool): return str(val).lower() else: - if compat.py_major_v < 3 and isinstance(val, unicode): - return val.encode("utf-8") - else: - return val + return val From b28e94896168fa7c7d498d43978c9990f3f84e68 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 3 Oct 2024 18:40:47 +0530 Subject: [PATCH 11/19] Updated readme with code samples --- README.md | 165 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 141 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 9f61b50..b16db9b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -# Chargebee Python Client Library - API V2 - +# Chargebee Python Client Library v3 (Beta) This is the Python Library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com). @@ -8,11 +7,16 @@ This is the Python Library for integrating with Chargebee. Sign up for a Chargeb Python 3.11 or higher. ## Installation +Install the latest beta version of the library with pip: -Install the latest version 3.x.x of the library with the following command: +```sh +pip install chargebee --pre +``` +If you preferred to install it from source, just checkout the latest version for 3.x.x by ```git checkout [latest 3.x.x release tag]``` and install with the following command: - - $ python setup.py install +```sh +python setup.py install +``` ## Documentation @@ -20,53 +24,166 @@ See our [Python API Reference](https://apidocs.chargebee.com/docs/api?lang=pytho ## Usage -### To create a new subscription: +The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer [here](https://www.chargebee.com/docs/2.0/api_keys.html) for more details. +```python +import chargebee +chargebee.configure("api_key", "site") +``` + +### Configuring Timeouts + +```python +import chargebee +chargebee.update_read_timeout_secs(3000) +chargebee.update_connect_timeout_secs(5000) +``` + +### Creating a new customer: ```python import chargebee -from chargebee import Subscription -chargebee.configure(api_key, site) -response = chargebee.Subscription.create(Subscription.CreateParams( - plan_id= "basic" - )) -print(response.subscription) + +response = chargebee.Customer.create( + chargebee.Customer.CreateParams( + first_name="John", + last_name="Doe", + email="john@test.com", + locale="fr-CA", + billing_address=chargebee.Customer.BillingAddress( + first_name="John", + last_name=" Doe", + line1="PO Box 9999", + city="Walnut", + state="California", + zip="91789", + country="US", + ), + ) +) +customer = response.customer +card = response.card +``` + +### Using filters with the List API + +For pagination, `offset` is the parameter that is being used. The value used for this parameter must be the value returned in `next_offset` parameter from the previous API call. + +```python +import chargebee +from chargebee import Filters + +response = chargebee.Customer.list( + chargebee.Customer.ListParams( + first_name=Filters.StringFilter(IS="John") + ) +) +offset = response.next_offset +print(offset) ``` -### Create an idempotent request: +### Using enums + +There are two variants of enums in chargebee, +- Global enums - These are defined globally and can be accessed across resources. +- Resource specific enums - These are defined within a resource and can be accessed using the resource class name. + +```python +# Global Enum +import chargebee + +response = chargebee.Customer.create( + chargebee.Customer.CreateParams( + first_name="John", + auto_collection=chargebee.AutoCollection.ON, # global enum + ) +) +print(response.customer.cf_host_url) +``` +```python +# Resource Specific Enum +import chargebee + +response = chargebee.Customer.change_billing_date( + chargebee.Customer.ChangeBillingDateParams( + first_name="John", + billing_day_of_week=chargebee.Customer.BillingDayOfWeek.MONDAY, # resource specific enum + ) +) +print(response.customer.cf_host_url) +``` + +### Using custom fields + +```python +import chargebee + +response = chargebee.Customer.create( + chargebee.Customer.CreateParams( + first_name="John", + cf_host_url="https://john.com", # `cf_host_url` is a custom field in Customer object + ) +) +print(response.customer.cf_host_url) +``` + +### Creating an idempotent request: [Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests. ```python import chargebee -from chargebee.models import customer -from chargebee import Customer -chargebee.configure(api_key, site) -response = Customer.create(Customer.CreateParams( + +response = chargebee.Customer.create( + chargebee.Customer.CreateParams( first_name="John", last_name="Doe", email="john@test.com", locale="fr-CA", - billing_address=customer.BillingAddress( + billing_address=chargebee.Customer.BillingAddress( first_name="John", last_name=" Doe", line1="PO Box 9999", city="Walnut", state="California", zip="91789", - country="US" - ) + country="US", + ), ), - None, - {"chargebee-idempotency-key": "<>"} # Replace <> with a unique string - ) + None, + { + "chargebee-idempotency-key": "<>" + }, # Replace <> with a unique string +) customer = response.customer card = response.card responseHeaders = response.response_headers # Retrieves response headers print(responseHeaders) -idempotencyReplayedValue = response.response_headers["chargebee-idempotency-key"] # Retrieves Idempotency replayed header value +idempotencyReplayedValue = response.response_headers["is_idempotency_replayed"] # Retrieves Idempotency replayed header value print(idempotencyReplayedValue) ``` +### Waiting for Process Completion + +The response from the previous API call must be passed as an argument for `wait_for_export_completion()` or `wait_for_time_travel_completion()` + +```python +# Wait For Export Completion +import chargebee +from chargebee import Filters +response = chargebee.Export.customers( + chargebee.Export.CustomersParams( + customer=chargebee.Export.CustomersCustomerParams( + first_name=Filters.StringFilter(IS="198OeJUMpANxQlhO") + ) + ) +) +print(chargebee.Export.wait_for_export_completion(response.export)) +``` + +## Feedback + +If you find any bugs or have any feedback, open an issue in this repository or email it to dx@chargebee.com + ## License See the [LICENSE](./LICENSE) file. From 9550d7ab92fe21a602065c062abb0dfbdcb5dac5 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 3 Oct 2024 18:41:49 +0530 Subject: [PATCH 12/19] Added changelog for beta release --- .gitignore | 1 + CHANGELOG.md | 2965 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2966 insertions(+) create mode 100644 CHANGELOG.md diff --git a/.gitignore b/.gitignore index 1dc644a..880c5a3 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pip-log.txt .mr.developer.cfg .idea +venv diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..614b6ca --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2965 @@ +### v3.0.0b1 (2024-10-03) +* * * + +- **Minimum Python Version**: Python 3.11 or higher is now required. +- **Type Hinting**: Introduced to improve IDE suggestions. +- **Data Type Support**: Added support for `int`, `float`, `bool`, and `enum` data types. +- **Enums**: Global and resource-specific enums have been introduced. +- **Filter Params**: Filter parameters have been introduced. +- **Response Classes**: Each API endpoint now has a specific response class defining the return type, replacing the previous generic response object access. +- **List Responses**: List-type responses are now accessible via the `list` entry to align with the API contract. +- **Idempotency Headers**: `is_idempotency_replayed` is now a JSON entry inside `response_headers` instead of a method (`is_idempotency_replayed()`). +- **Wait For Process Completion**: Response from previous API calls must be passed as arguments for `wait_for_export_completion()` and `wait_for_time_travel_completion()`. + + +### v2.44.1 (2024-10-03) +* * * + +#### Bug Fixes: +* metadata field not working bug fixed. +* meta_data field not working bug fixed. + +### v2.44.0 (2024-09-19) +* * * + +#### New Resource: +* PaymentScheduleScheme has been added. +* PaymentSchedule has been added. + +### New Endpoints: +* Invoice#ApplyPaymentScheduleScheme has been added. +* Invoice#PaymentSchedules has been added. + +### New Attributes +* bundle_items[] has been added to Items. +* bundle_configuration has been added to Items. + +#### New Input parameters: +* bundle_configuration has been added to Items#CreateParams, Items#UpdateParams & Items#ListParams. +* bundle_items_to_add[] has been added to Items#CreateParams & Items#UpdateParams. +* bundle_items_to_update[] has been added to Items#UpdateParams. +* bundle_items_to_remove[] has been added to Items#UpdateParams. +* payment_schedule has been added to Purchase#CreateParams. + +### New Enum Values: +* payment_schedules_created has been added to EventTypeEnum. +* payment_schedules_updated has been added to EventTypeEnum. +* payment_schedule_scheme_created has been added to EventTypeEnum. +* payment_schedule_scheme_deleted has been added to EventTypeEnum. + +### Removed Resource: +* Installment has been removed. +* InstallmentConfig has been removed. +* InstallmentDetail has been removed. + +### Removed Endpoints: +* Invoice#Installments has been removed. + +### Removed Input parameters: +* installment_info has been removed from Purchase#CreateParams. + +### Removed Enum Values: +* invoice_installments_created has been removed from EventTypeEnum. +* invoice_installment_updated has been removed from EventTypeEnum. +* installment_config_created has been removed from EventTypeEnum. +* installment_config_deleted has been removed from EventTypeEnum. + +### v2.43.0 (2024-08-29) +* * * + +#### New Resource: +* CustomerEntitlement has been added. + +#### New Endpoints: +* Ramp#UpdateRequest has been added to Ramp resource. +* Transaction#ReconcileRequest has been added to Transaction resource. + +### New Attributes: +* arr has been added to Subscription. + +### New Enum Values: +* customer_entitlements_updated has been added to EntityTypeEnum. +* subscription_moved_in has been added in EventType enum. +* subscription_moved_out has been added in EventType enum. +* subscription_movement_failed has been added in EventType enum. + +### v2.42.0 (2024-08-14) +* * * + +#### New Attributes: +* feature_type has been added in SubscriptionEntitlement. +* business_entity_id has been made optional in Quote. +* business_entity_id has been made optional in CreditNote. + +#### New Input parameters: +* invoice_usages has been added in Subscription#UpdateForItemsRequest. +* invoice_usages has been added in Estimate#UpdateSubscriptionForItemsRequest. + +### v2.41.0 (2024-07-31) +* * * + +#### New Resource: +* Metadata has been added. + +#### New Attributes: +* variant_group has been added in PriceVariant resource. +* effective_from & schedule_status have been added in EntitlementOverride resource. +* effective_from & schedule_status have been added in SubscriptionEntitlement resource. +* status_transition_reason has been added in Ramp subresource. +* billing_period & billing_period_unit have been added in SubscriptionItem subresource. + +#### New Input parameters: +* variant_group has been added to PriceVariant#CreateRequest, PriceVariant#UpdateRequest. +* include_scheduled_overrides has been added to SubscriptionEntitlement#SubscriptionEntitlementsForSubscriptionRequest. +* entitlement_overrides[effective_from] has been added to SubscriptionEntitlement#SubscriptionEntitlementsForSubscriptionRequest. +* entitlement_overrides[effective_from] has been added to EntitlementOverride#AddEntitlementOverrideForSubscriptionRequest. +* include_scheduled_overrides has been added to EntitlementOverride#ListEntitlementOverrideForSubscriptionRequest. +* updated_at has been added to Usage#ListRequest. + +#### New Enum values: +* SUBSCRIPTION_ITEMS_RENEWED has been added in EventType enum. +* SUBSCRIPTION_RAMP_DRAFTED has been added in EventType enum. +* SUBSCRIPTION_RAMP_UPDATED has been added in EventType enum. + +### v2.40.0 (2024-07-03) +* * * + +#### New resources: +* Currency has been added. +* PricingPageSession Transfer has been added. + +#### New Enum +* cancel_option Enum has been added. + +#### New Enum values: +* ONLINE_BANKING_POLAND has been added in PaymentMethod enum. +* ONLINE_BANKING_POLAND has been added in PaymentMethodType enum. +* ONLINE_BANKING_POLAND has been added in Type enum. +* DRAFT has been added in Ramp enum. + +#### New Input parameters: +* cancel_option has been added to Estimate#CancelSubscriptionRequest, Estimate#CancelSubscriptionForItemsRequest. +* cancel_option has been added to Subscription#CancelForItemsRequest, Subscription#CancelRequest. +* statement_descriptor[descriptor] has been added to Purchase#ChargeRequest. + +#### New Attributes: +* tax_origin has been added to Invoice. +* tax_origin has been added to CreditNote. + + +### v2.39.1 (2024-05-29) +* * * +* Python HostedPage Content - bugfix + +### v2.39.0 (2024-05-28) +* * * + +#### New resources: +* BusinessEntity has been added. +* BusinessEntity Transfer has been added. + + +#### New Enum values: +* NUVEI has been added in Gateway enum. + + +#### New Attributes: +* site_details_at_creation has been added to CreditNote. +* site_details_at_creation has been added to Invoice. + + +#### New Input parameters: +* tax_providers_fields[provider_name] has been added to Addon#CreateRequest, Addon#UpdateRequest. +* tax_providers_fields[field_id] has been added to Addon#CreateRequest, Addon#UpdateRequest. +* tax_providers_fields[field_value] has been added to Addon#CreateRequest, #UpdateRequest. + +* tax_providers_fields[provider_name] has been added to Customer#CreateRequest, Customer#UpdateRequest, Customer#MoveRequest. +* tax_providers_fields[field_id] has been added to Customer#CreateRequest, Customer#UpdateRequest, Customer#MoveRequest. +* tax_providers_fields[field_value] has been added to Customer#CreateRequest, Customer#UpdateRequest, Customer#MoveRequest.. + +* tax_providers_fields[provider_name] has been added to Estimate#CreateSubscriptionRequest, Estimate#CreateSubItemEstimateRequest, Estimate#CreateInvoiceRequest, CreateInvoiceForItemsRequest. +* tax_providers_fields[field_id] has been added to Estimate#CreateSubscriptionRequest, Estimate#CreateSubItemEstimateRequest, Estimate#CreateInvoiceRequest, CreateInvoiceForItemsRequest. +* tax_providers_fields[field_value] has been added to Estimate#CreateSubscriptionRequest, Estimate#CreateSubItemEstimateRequest, Estimate#CreateInvoiceRequest, CreateInvoiceForItemsRequest. + +* tax_providers_fields[provider_name] has been added to Invoice#CreateRequest, Invoice#CreateForChargeItemsAndChargesRequest, Invoice#ChargeRequest. +* tax_providers_fields[field_id] has been added to Invoice#CreateRequest, Invoice#CreateForChargeItemsAndChargesRequest, Invoice#ChargeRequest. +* tax_providers_fields[field_value] has been added to Invoice#CreateRequest, Invoice#CreateForChargeItemsAndChargesRequest, Invoice#ChargeRequest. + +* tax_providers_fields[provider_name] has been added to ItemPrice#CreateRequest, ItemPrice#UpdateRequest. +* tax_providers_fields[field_id] has been added to ItemPrice#CreateRequest, ItemPrice#UpdateRequest. +* tax_providers_fields[field_value] has been added to ItemPrice#CreateRequest, ItemPrice#UpdateRequest. + +* tax_providers_fields[provider_name] has been added to Plan#CreateRequest, Plan#UpdateRequest. +* tax_providers_fields[field_id] has been added to Plan#CreateRequest, Plan#UpdateRequest. +* tax_providers_fields[field_value] has been added to Plan#CreateRequest, Plan#UpdateRequest. + +* tax_providers_fields[provider_name] has been added to Quote#EditOneTimeQuoteRequest, Quote#CreateForOnetimeChargesRequest, Quote#CreateForChargeItemsAndChargesRequest, Quote#EditForChargeItemsAndChargesRequest. +* tax_providers_fields[field_id] has been added to Quote#EditOneTimeQuoteRequest, Quote#CreateForOnetimeChargesRequest, Quote#CreateForChargeItemsAndChargesRequest, Quote#EditForChargeItemsAndChargesRequest. +* tax_providers_fields[field_value] has been added to Quote#EditOneTimeQuoteRequest, Quote#CreateForOnetimeChargesRequest, Quote#CreateForChargeItemsAndChargesRequest, Quote#EditForChargeItemsAndChargesRequest. + +* tax_providers_fields[provider_name] has been added to UnbilledCharge#CreateUnbilledChargeRequest, UnbilledCharge#CreateRequest. +* tax_providers_fields[field_id] has been added to UnbilledCharge#CreateUnbilledChargeRequest, UnbilledCharge#CreateRequest. +* tax_providers_fields[field_value] has been added to UnbilledCharge#CreateUnbilledChargeRequest, UnbilledCharge#CreateRequest. + +* line_items[entity_type] has been added to CreditNote#CreateRequest. +* line_items[entity_id] has been added to CreditNote#CreateRequest. + + +### v2.38.1 (2024-05-02) +* * * + +#### Removed resources: +* Session has been removed. + +### v2.38.0 (2024-04-30) +* * * + +#### New resources: +* PriceVariant has been added. +* Ramp has been added. +* InstallmentDetail has been added. +* Session has been added. +* Ramp has been added. + +#### New Enum values: +* INVOICE_INSTALLMENTS_CREATED has been added in EventType enum. +* INVOICE_INSTALLMENT_UPDATED has been added in EventType enum. +* INSTALLMENT_CONFIG_CREATED has been added in EventType enum. +* INSTALLMENT_CONFIG_DELETED has been added in EventType enum. +* RAMP_CREATED has been added in EventType enum. +* RAMP_DELETED has been added in EventType enum. +* RAMP_APPLIED has been added in EventType enum. + +#### New Attributes: +* tax_providers_fields has been added to Addon resource. +* tax_providers_fields has been added to Customer resource. +* tax_providers_fields has been added to ItemPrice resource. +* tax_providers_fields has been added to Plan resource. +* resource_version has been added to Installment resource. +* resource_version has been added to InstallmentConfig resource. +* KlarnaPayNow has been added to PaymentSource resource. +* business_entity_id has been added to UnbilledCharge resource. + +#### New Endpoints: +* Exports#PriceVariantsRequest has been added to Exports resource. + +#### New Input parameters: +* changes_scheduled_at, change_option has been added to Estimate#UpdateSubscriptionRequest. +* changes_scheduled_at, change_option has been added to Estimate#UpdateSubscriptionForItemsRequest. +* contract_term[contract_start] has been added to Estimate#CreateSubItemEstimateRequest. +* contract_term[contract_start] has been added to Estimate#CreateSubItemForCustomerEstimateRequest. +* contract_term[contract_start] has been added to Subscription#CreateWithItemsRequest. +* contract_term[contract_start] has been added to Subscription#UpdateForItemsRequest. +* price_variant_id has been added to ItemPrice#CreateRequest. +* price_variant_id has been added to ItemPrice#UpdateRequest. +* price_variant_id has been added to ItemPrice#ListRequest. + +#### Removed attributes: +* additional_info has been removed from Invoice#StatmentDescriptor resource. + +#### Removed Input parameters: +* additional_info has been removed from Subscription#CreateRequest. +* additional_info has been removed from Subscription#CreateForCustomerRequest. +* additional_info has been removed from Subscription#CreateWithItemsRequest. +* additional_info has been removed from Subscription#UpdateRequest. +* additional_info has been removed from Subscription#UpdateForItemsRequest. +* additional_info has been removed from Subscription#ReactivateRequest. + +### v2.37.1 (2024-04-03) +* * * + +#### New Input parameters: +* to_customer_id has been added to subscription#MoveRequest. +* copy_payment_source has been added to subscription#MoveRequest. + +#### New endpoints: +* Subscription#MoveRequest has been added to the Subscription resource. + +#### Fixes: +* Support for Json format in JSONObject and JSONArray type request parameters + +### v2.37.0 (2024-03-20) +* * * + +#### New resources: +* Attribute has been added. +* ImpactedItemPrice has been added. +* InstallmentConfig has been added. +* Installment has been added. + +#### Removed attributes: +* product_id has been removed from ItemPrice resource. + +#### New Enum values: +* klarna_pay_now has been added to TypeEnum in Customer resource. +* klarna_pay_now has been added to PaymentMethodEnum. +* klarna_pay_now has been added to PaymentMethodTypeEnum enum. +* klarna_pay_now has been added to TypeEnum. +* price_variant has been added to EntityTypeEnum. +* price_variant_created has been added in EventType enum. +* price_variant_updated has been added in EventType enum. +* price_variant_deleted has been added in EventType enum. + +#### Removed Enum values: +* product and variant have been removed from EntityTypeEnum. + +#### New Input parameters: +* config_id has been added to Invoice#InstallmentsRequest. +* amount has been added to Invoice#InstallmentsRequest. +* payment_source_id has been added to Purchase#CreateRequest. +* installment_info[config_id] has been added to Purchase#CreateRequest. +* installment_info[amount] has been added to Purchase#CreateRequest. +* subscription_info[contract_term_billing_cycle_on_renewal] has been added to Purchase#CreateRequest. +* contract_terms[index] has been added to Purchase#CreateRequest. +* contract_terms[action_at_term_end] has been added to Purchase#CreateRequest. +* contract_terms[cancellation_cutoff_period] has been added to Purchase#CreateRequest. +* subscription_info[contract_term_billing_cycle_on_renewal] has been added to Purchase#EstimateRequest. +* contract_terms[index] has been added to Purchase#EstimateRequest. +* contract_terms[action_at_term_end] has been added to Purchase#EstimateRequest. +* contract_terms[cancellation_cutoff_period] has been added to Purchase#EstimateRequest. + +#### Deprecated input parameters: +* product_created, product_updated, product_deleted, variant_created, variant_updated, variant_deleted has been deprecated in EventTypeEnum. + +### v2.36.1 (2024-03-06) +* * * +* NonSubscription has been added. + + +### v2.36.0 (2024-02-29) +* * * + +#### New attributes: +* usage_percentage has been added to QuoteLineGroup resource. +* usage_percentage has been added to Quote resource. +* usage_percentage has been added to CreditNoteEstimate resource. +* usage_percentage has been added to CreditNote resource. +* usage_percentage has been added to InvoiceEstimate resource. +* usage_percentage has been added to Invoice resource. +* error_detail of type GatewayErrorDetail has been added to PaymentIntent#PaymentAttempt subResource. +* origin_user has been added to Event resource. +* proration_type has been added to QuotedSubscription#SubscriptionItem and Subscription#SubscriptionItem subResources +* network_error_message, recommendation_message, processor_error_code, processor_error_message has been added to Transaction#GatewayErrorDetail subResource. + +#### New Enum values: +* TAX_NOT_CONFIGURED_EXTERNAL_PROVIDER has been added to TaxExemptReasonEnum. + +#### New Input parameters: +* billing_address has been added to Estimate#CreateSubItemForCustomerEstimateRequest. +* transactions[amount] has been added to Invoice#ApplyPaymentsRequest. + +### v2.35.0 (2024-01-31) +* * * + +#### New Enum values: +* item_price_entitlements_updated has been added to EventTypeEnum. +* item_price_entitlements_removed has been added to EventTypeEnum. + +#### New Input parameters: +* layout has been added to HostedPage#AcceptQuoteRequest in HostedPage resource. + +### v2.34.0 (2024-01-04) +* * * + +#### New resources: +* Entitlements has been added. + +#### New attributes: +* date_to, date_from, prorated_taxable_amount has been added to quote_line_group. +* date_to, date_from, prorated_taxable_amount has been added to quote. +* date_to, date_from, prorated_taxable_amount has been added to credit_note_estimate. +* date_to, date_from, prorated_taxable_amount has been added to credit_note. +* date_to, date_from, prorated_taxable_amount has been added to invoice_estimate. +* date_to, date_from, prorated_taxable_amount has been added to order. +* date_to, date_from, prorated_taxable_amount has been added to invoice. +* active_id has been added to customers. +* active_id has been added to subscriptions. +* reference_id has been made optional for payment_sources/create_using_permanent_token +* custom_payment_method_id has been added to transactions. +* custom_payment_method_name has been added to transactions. +* error_detail has been added to transactions. + + +#### New Enum values: +* CMR_FALABELLA, TARJETA_NARANJA, NATIVA, CENCOSUD, CABAL, ARGENCARD, ELO, HIPERCARD, CARNET, RUPAY, MAESTRO has been added to Card#CardTypeEnum +* Transferred has been added to Subscription#StatusEnum. +* Transferred has been added to SubscriptionEstimate#StatusEnum. +* AutomatedBankTransfer has been added to PaymentMethodEnum. +* UsAutomatedBankTransfer, GbAutomatedBankTransfer, EuAutomatedBankTransfer, JpAutomatedBankTransfer, MxAutomatedBankTransfer has been added to VirtualBankAccount#SchemeEnum. +* CustomerBusinessEntityChanged, SubscriptionBusinessEntityChanged has been added to EventTypeEnum. +* Dlocal has been added to GatewayEnum. +* UsAutomatedBankTransfer, UkAutomatedBankTransfer, EuAutomatedBankTransfer, JpAutomatedBankTransfer, MxAutomatedBankTransfer, Custom has been added to OfflinePaymentMethodEnum. +* AutomatedBankTransfer has been added to PaymentMethodEnum. +* AutomatedBankTransfer has been added to PaymentMethodTypeEnum. + +#### New Input parameters: +* custom_payment_method_name has been added to Transactions#RecordRefundRequest. +* proration_type has been added to Subscription#UpdateForItemsRequest. +* proration_type has been added to ItemPrice. +* payment_initiator has been added to Invoice. +* payment_method_token, customer_profile_token, network_transaction_id, mandate_id, skip_retrieval, card, billing_address has been added to PaymentSource#CreateUsingPermanentTokenRequest. +* subscription_items[proration_type] has been added to Estimate#UpdateSubscriptionForItemsRequest. +* transaction[custom_payment_method_id] has been added to Customer#RecordExcessPaymentRequest. +* transaction[custom_payment_method_id] has been added to CreditNote#RecordRefundRequest. + +* * * + +### v2.33.0 (2023-11-30) +* * * + +#### New Enum values: +* swiss_reference has been added to PaymentReferenceNumber#TypeEnum. + +#### New Input parameters: +* subscription[po_number] has been added to Quote#EditCreateSubForCustomerQuoteRequest in Quote resource. +* subscription[po_number] has been added to Quote#EditCreateSubCustomerQuoteForItemsRequest in Quote resource. + +* * * + +### v2.32.0 (2023-10-31) +* * * + +#### New attributes: +* statement_descriptor has been added to invoice resource. +* source has been added to the Hosted_Pages resource. + +#### New Enum values: +* pay_com has been added to Gateway. +* pay_to, faster_payments, sepa_instant_transfer has been added to Customer#TypeEnum. +* pay_to, faster_payments, sepa_instant_transfer has been added to PaymentMethodEnum. +* pay_to, faster_payments, sepa_instant_transfer has been added to PaymentMethodTypeEnum. +* pay_to, faster_payments, sepa_instant_transfer has been added to TypeEnum. +* pay_to, faster_payments, sepa_instant_transfer, amazon_payments has been added to PaymentIntent#PaymentMethodTypeEnum. + +#### New Input parameters: +* source has been added to HostedPage#CheckoutOneTimeForItemsRequest. +* source has been added to HostedPage#CheckoutNewForItemsRequest. +* source has been added to HostedPage#CheckoutExistingForItemsRequest. +* statement_descriptor_descriptor has been added to Invoice#CreateRequest. +* statement_descriptor_descriptor has been added to Invoice#CreateForChargeItemsAndChargesRequest. +* statement_descriptor_descriptor has been added to Invoice#UpdateDetailsRequest. +* statement_descriptor_additional_info has been added to Invoice#CreateRequest. +* statement_descriptor_additional_info has been added to Invoice#CreateForChargeItemsAndChargesRequest. +* statement_descriptor_additional_info has been added to Invoice#UpdateDetailsRequest. +* statement_descriptor_descriptor has been added to Subscription#CreateRequest. +* statement_descriptor_descriptor has been added to Subscription#CreateForCustomerRequest. +* statement_descriptor_descriptor has been added to Subscription#CreateWithItemsRequest. +* statement_descriptor_descriptor has been added to Subscription#UpdateRequest. +* statement_descriptor_descriptor has been added to Subscription#UpdateForItemsRequest. +* statement_descriptor_descriptor has been added to Subscription#ReactivateRequest. +* statement_descriptor_additional_info has been added to Subscription#CreateRequest. +* statement_descriptor_additional_info has been added to Subscription#CreateForCustomerRequest. +* statement_descriptor_additional_info has been added to Subscription#CreateWithItemsRequest. +* statement_descriptor_additional_info has been added to Subscription#UpdateRequest. +* statement_descriptor_additional_info has been added to Subscription#UpdateForItemsRequest. +* statement_descriptor_additional_info has been added to Subscription#ReactivateRequest. + +#### Updates to old parameters: +* duration_type, discount_type in coupons has been made optional. +* proration_type in addons is now supported. +* csv_tax_rule has been removed. +* Tax1JurisTypeEnum has been removed. +* Tax2JurisTypeEnum has been removed. +* Tax3JurisTypeEnum has been removed. +* Tax4JurisTypeEnum has been removed. + +### v2.31.0 (2023-09-26) +* * * + +#### New attributes: +* venmo has been added to the PaymentSource resource. +* proration_type has been added to the QuotedCharge, QuotedSubscription and Subscription resource. + +#### New Enum values: +* ebanx has been added to Gateway. +* venmo has been added to Customer#TypeEnum. +* venmo has been added to PaymentMethodEnum. +* venmo has been added to PaymentMethodTypeEnum. +* venmo has been added to TypeEnum. +* venmo has been added to PaymentIntent#PaymentMethodTypeEnum. + +#### New Input parameters: +* einvoicing_method has been added to HostedPage#CheckoutOneTimeForItemsRequest. +* einvoicing_method has been added to HostedPage#CheckoutNewForItemsRequest. +* additional_information has been added to PaymentSource#CardAdditionalInformation. + +### v2.30.0 (2023-09-05) +* * * + +#### New Resource: +* CsvTaxRule has been added. + +#### New attributes: +* direct_debit_scheme has been added to the PaymentSource#PaymentSourceBankAccount resource. + +#### New Enum : +* DirectDebitSchemeEnum has been added. +* Tax1JurisTypeEnum has been added. +* Tax2JurisTypeEnum has been added. +* Tax3JurisTypeEnum has been added. +* Tax4JurisTypeEnum has been added. + +#### New Input parameters: +* avalara_tax_code, hsn_code, taxjar_product_code has been added to Invoice#AddChargeRequest. + + +### v2.29.0 (2023-07-31) +* * * + +#### New Attributes: +* tax_category has been added to the CreditNote, Quote and Invoice resource. +* proration_type has been added in Addon resource. + +#### New Enum values: +* tax has been added to EntityType enum in Invoice resource. +* payment_source_locally_deleted has been added to EventType. + +#### New Input parameters: + +* CouponId and CouponApplyTill has been added to Subscritpion#CreateRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#CreateForCustomerRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#CreateWithItemsRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#UpdateRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#UpdateForItemsRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#ImportSubscriptionRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#ImportForCustomerRequest in Subscritpion resource. +* CouponId and CouponApplyTill has been added to Subscritpion#ImportForItemsRequest in Subscritpion resource. +* cancel_reason_code has been added to Subscritpion#ImportForItemsRequest in Subscritpion resource. +* proration_type has been added in addon#createRequest and addon#UpdateRequest in Addon resource. +* addons[proration_type] has been added in Estimate#UpdateSubscriptionRequest in Estimate resource. +* addons[proration_type] has been added in Subscription#UpdateRequest in Subscritpion resource. + +#### New Enum Class: +* ProrationType enum has been added to addon resource. +* ProrationType enum has been added. + +### v2.28.0 (2023-06-30) +* * * + +#### New endpoints: +* ViewVoucher#ViewVoucherRequest has been added to the HostedPage resource. +* InvoiceListPaymentReferenceNumbers#InvoiceListPaymentReferenceNumbersRequest has been added to the Invoice resource. + +#### New Resource: +* PaymentReferenceNumber has been added. + +#### New attributes: +* local_currency_exchange_rate has been added to the CreditNote and Invoice resource. + +#### New Enum values: +* view_voucher has been added to Type enum in HostedPage resource. +* paused has been added in StoreStatus enum in InAppSubscription resource. +* metrics_global and windcave has been added in Gateway enum. + + +#### New Input parameters: +* payment_initiator has been added to Customers#CollectPaymentRequest. +* payment_initiator has been added to Invoice#CreateRequest. +* payment_initiator has been added to Invoice#ChargeRequest. +* payment_initiator has been added to Invoice#ChargeAddonRequest. +* payment_initiator has been added to Invoice#CollectPaymentRequest. +* payment_initiator has been added to Subscription#CreateRequest. +* payment_initiator has been added to Invoice#CreateForChargeItemRequest. +* payment_initiator has been added to Subscription#CreateForCustomerRequest. +* payment_initiator has been added to Subscription#CreateWithItemsRequest. +* payment_initiator has been added to Subscription#UpdateForItemsRequest. +* payment_initiator has been added to Subscription#ReactivateRequest. +* payment_initiator has been added to Subscription#ResumeRequest. +* payment_reference_numbers[id] has been added to Invoice#ImportInvoiceRequest. +* payment_reference_numbers[type] has been added to Invoice#ImportInvoiceRequest. +* payment_reference_numbers[number] has been added to Invoice#ImportInvoiceRequest. + + +### v2.27.0 (2023-05-31) +* * * + +#### New endpoints: +* PaymentSource#CreateVoucherPaymentSource has been added to the PaymentSource resource. +* EventsRequest#HostedPage has been added to the PaymentSource resource. + +#### New Resource: +* PaymentVoucher has been added. + +#### New attributes: +* boleto and billing_address has been added to the PaymentSource resource. +* product_id has been added to the ItemPrice resource. + +#### New Enum Class: +* EventNameEnum has been added. +* PaymentVoucherTypeEnum has been added. +* VoucherTypeEnum has been added. + +#### New Enum values: +* product and variant has been added to EntityType enum. +* product_created, product_updated, product_deleted, variant_created, variant_updated and variant_deleted enums have been added in EventType enum. +* voucher_created, voucher_expired and voucher_create_failed have been added in EventType enum. +* boleto has been added in PaymentMethod and OfflinePaymentMethod and PaymentMethodTypeEnum#PaymentIntent. + + +### v2.26.0 (2023-05-16) +* * * + +#### New Feature: +* Added utility to pass **Idempotency key** along with request headers to allow a safe retry of POST requests. +* Added is_idempotency_replayed() utility to differentiate between original and replayed requests. +* Added get_response_headers() utility to fetch the response headers. + + +### v2.25.0 (2023-04-28) +* * * + +#### Fixes: +* SubscriptionId attribute has been maid as required in InAppSubscription resource. + +#### New Attributes: +* TotalContractValueBeforeTax has been added to the ContractTerm resource. +* TotalContractValueBeforeTax#SubscriptionContractTerm has been added to the Subscription resource. +* TotalContractValueBeforeTax#SubscriptionEstimateContractTerm has been addded to the SubscriptionEstimate resource. +* CouponConstraints has been added to the Coupon resource. + +#### New Resource: +* NonSubscription have been added. + +#### Added Input Parameters: +* contract_term[total_amount_raised_before_tax]#ImportSubscriptionRequest, contract_term[total_amount_raised_before_tax]#ImportForItemsRequest, contract_term[total_amount_raised_before_tax]#ImportContractTermRequest and contract_term[total_amount_raised_before_tax]#ImportForCustomerRequest parameter has been added to Subscription resource. +* contract_term[total_contract_value_before_tax]#ImportContractTermRequest parameter has been added to Subscription resource. +* coupon_constraints[entity_type]#CreateForItemsRequestParams, coupon_constraints[type]#CreateForItemsRequestParams and coupon_constraints[value]#CreateForItemsRequestParams parameter has been added to the Coupon resource. +* coupon_constraints[entity_type]#UpdateForItemsRequestParams, coupon_constraints[type]#UpdateForItemsRequestParams and coupon_constraints[value]#UpdateForItemsRequestParams parameter has been added to the Coupon resource. +* export_type#CustomersRequest and export_type#SubscriptionsRequest parameter has been added to the Export resource. + +#### New Enum Class: +* ExportType has been added. + +#### New Enum values: +* pending_authorization has been added to StatusEnum#PaymentIntentPaymentAttempt to the PaymentIntent resource. + + +### v2.24.0 (2023-03-24) +* * * + +#### Fixes: +* Fixed list_discounts subscriptions API error. + +#### New Attributes: +* Einvoice#reference_number has been added to the credit_note resource. +* Einvoice#reference_number has been added to the invoice resource. +* einvoicing_method has been added to the customer resource. +* store_status and invoice_id have been addded to the in_app_subscriptions resource. + +#### Added Input Parameters: +* UpdateForItemsRequestParams#discount_quantity and UpdateRequestParams#discount_quantity parameter has been added to the coupon resource. +* UpdateBillingInfoRequestParams#einvoicing_method and CreateRequestParams#einvoicing_method parameter has been added to the customer resource. +* CreateCustomerParams#einvoicing_method , UpdateCustomerParams#einvoicing_metho and UpdateForItemsCustomerParams#einvoicing_method parameter has been added to the Subscription resource. +* CreateSubscriptionInfoParams#meta_data parameter has been added to the purchase resource. + +#### New Endpoints: +* credit_note#send_einvoice has been added to the CreditNote resource. +* invoice#send_einvoice has been added to the Invoice resource. +* in_app_subscriptions#import_subscription and in_app_subscriptions#retrieve_store_subs requests have been added to the in_app_subscriptions resource. + +#### New Enum Class: +* EinvoicingMethod has been added. +* StoreStatus has been added in in_app_subscriptions resource. + + +### v2.23.0 (2023-02-17) + +#### New Attributes: +* resource_version and updated_at parameter has been added to the tax_withheld resource. + +#### Added input parameters: +* ListRequestParams#updated_at parameter has been added to attached_item resource. +* AttachedItemsAttachedItemParams#updated_at parameter has been added to export resource. +* CheckoutGiftRequestParams#coupon_ids parameter has been added to hosted_page resource. +* ProcessReceiptCustomerParams#email, ProcessReceiptCustomerParams#first_name and ProcessReceiptCustomerParams#last_name parameters has been added to in_app_subscription resource. + +#### New endpoints: +* invoice#record_tax_withheld and invoice#remove_tax_withheld has been added to the invoice resource. +* credit_note#remove_tax_withheld_refund has been added to the credit_note resource. + +#### New Enum values: +* custom has been added to payment_method Enum. +* ecentric has been added to gateway Enum. + +#### Removed input parameters: +* EstimateRequestParams#EstimateInvoiceInfoParams parameter has been removed from purchase resource. + +#### Deprecated input parameters: +* CheckoutGiftRequest#coupon parameter have been deprecated in hosted_page resource. + +### v2.22.0 (2023-01-13) +* * * + +#### New Attributes: +* shipping_address and billing_address parameter has been added to the CreditNote. +* is_advance_charge has been added to the UnbilledCharge. + +#### Added input parameters: +* CreateSubForCustomerQuoteRequest#subscription[po_number] and CreateSubItemsForCustomerQuoteRequest#subscription[po_number] parameter has been added to Quote resource. +* ImportUnbilledChargesRequest#unbilled_charges[is_advance_charge] parameter has been added to Subscription resource. +* ImportInvoiceRequest#has_advance_charges parameter has been added to Invoice resource. + +#### New endpoints: +* Invoice#DeleteLineItemsRequest has been added to the Invoice resource. + +#### New Enum values: +* SUBSCRIPTION_TRIAL_EXTENDED has been added to EventTypeEnum. +* ZERO_VALUE_ITEM has been added to TaxExemptReasonEnum. +* BANK_OF_AMERICA has been added to GatewayEnum. + + +### v2.21.0 (2022-11-10) +* * * + +#### New endpoints: +* credit_notes#import_credit_note has been added to the credit_notes resource. +* subscriptions#import_unbilled_charges has been added to the subscriptions resource. + +#### New attributes: +* shipped_at parameter has been added to the orders#list_orders API. + +#### Added input parameters: +* voided_at and void_reason_code have been added to the invoices#import_invoice API. + +#### New attributes: +* business_entity_id has been added to the orders resource. + +#### New Enum values: +* registered has been added to the status enum in credit_note_einvoice and invoice_einvoice subresources. +* type enum has been added to the subscription_discount subresource. +* subscription_entitlements_created has been added to the event_type enum. + + +### v2.20.0 (2022-09-20) + +#### New Resource: +* discount has been added. + +#### New Enum values: +* apply_on, duration_type and operation_type enums have been added. + +### v2.19.0 (2022-09-20) +* * * + +#### New endpoints: +* subscriptions#list_discounts has been added to the subscriptions resource. + +#### New attributes: +* billing_month has been added to the customer resource. + +#### Added input parameters: +* billing_month has been added to the customers#change_billing_date API. +* line_items[subscription_id] has been added to the invoices#import_invoice API. +* layout has been added to hosted_pages#checkout_onetime_for_items, hosted_pages#checkout_new_for_items and hosted_pages#checkout_existing_for_items APIs. +* discounts[apply_on], discounts[percentage], discounts[amount] and discounts[item_price_id] have been added to estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#update_subscription_for_items, hosted_pages#checkout_onetime_for_items, hosted_pages#checkout_new_for_items, hosted_pages#checkout_existing_for_items, invoices#create_for_charge_items_and_charges, quotes#create_subscription_for_items, quotes#edit_create_subscription_quote_for_items, quotes#update_subscription_quote_for_items, quotes#edit_update_subscription_quote_for_items, quotes#create_for_charge_items_and_charges, quotes#edit_for_charge_items_and_charges, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items and subscriptions#import_subscription_for_items APIs. +* discounts[duration_type], discounts[period], discounts[period_unit] and discounts[included_in_mrr] have been added to estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#update_subscription_for_items, hosted_pages#checkout_new_for_items, hosted_pages#checkout_existing_for_items, quotes#create_subscription_for_items, quotes#edit_create_subscription_quote_for_items, quotes#update_subscription_quote_for_items, quotes#edit_update_subscription_quote_for_items, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items and subscriptions#import_subscription_for_items APIs. +* discounts[operation_type] and discounts[id] have been added to estimates#update_subscription_for_items, quotes#update_subscription_quote_for_items, hosted_pages#checkout_existing_for_items, quotes#edit_update_subscription_quote_for_items, subscriptions#update_subscription_for_items and subscriptions#import_subscription_for_items APIs. + +#### New Enum values: +* global_payments has been added to gateway enum. +* layout enum has been added. + +### v2.18.0 (2022-08-22) +* * * + +#### New endpoints: +* Purchase#Retrieve has been added to the Purchase resource. + +#### New attributes: +* ResourceVersion has been added to the Token resource. +* UpdatedAt has been added to the Token and UnbilledCharge resources. +* ReferenceLineItemId has been added to the CreditNote#LineItem, CreditNoteEstimate#LineItem, Quote#LineItem, QuoteLineGroup#LineItem, InvoiceEstimate#LineItem and Invoice#LineItem subResources. +* Index has been added to the Order#ShippingAddress, Invoice#ShippingAddress, Quote#ShippingAddress, QuotedCharge#ItemTier, QuotedSubscription#ItemTier, Subscription#ItemTier, Subscription#ShippingAddress and SubscriptionEstimate#ShippingAddress subResources. +* VoidWithCreditNote has been added to the Invoice#VoidInvoiceRequest subresources. +* PaymentMethodDetails has been added to the Transaction resource. + +#### New Resource: +* InAppSubscription have been added. + +#### Removed input parameters: +* BusinessEntityId has been removed from Purchase#CreateRequest and Purchase#EstimateRequest. + + +### v2.17.0 (2022-07-08) +* * * + +### Fixes: +* Fixed Status Enum related issues +* Fixed EmbeddedResource related issues + +#### New endpoints: +* hostedpage#PreCancel has been added to the hostedpage resource. + +#### New attributes: +* business_entity_id have been added to the CreditNote, Customer,HostedPage, Invoice, PaymentIntent, Quote, Subscription and Transaction resources. +* coupon_set_code have been added to the CreditNote, CreditNoteEstimate, Invoice, InvoiceEstimate, Quote and QuoteLineGroup resources. +* List of SubscriptionEstimate have been added to Estimate resource. + +#### New Resource: +* ImpactedSubscription, ImpactedItem, Purchase have been added. + +#### New Enum values: +* direct_debit has been added to payment_method_type enum. +* bancontact, not_applicable added to payment_source_card_brand enum. +* business_entity added to entity_type Enum +* business_entity_created, business_entity_updated, business_entity_deleted, purchase_created added to event_type Enum +* chargebee_payments added to gateway Enum + + +### v2.16.0 (2022-05-23) +* * * + +#### New endpoints: +* invoice#sync_usages and invoice#resend_einvoice have been added to the invoice resource. +* credit_notes#resend_einvoice has been added to the credit_notes resource. +* features#list_features, features#create_a_feature, features#update_a_feature, features#retrieve_a_feature, features#delete_a_feature, features#activate_a_feature, features#archive_a_feature and features#reactivate_a_feature have been added to the features resource. +* subscription_entitlements#subscription_entitlements_for_subscription and subscription_entitlements#set_subscription_entitlement_availability have been added to the subscription_entitlements resource. +* item_entitlements#item_entitlements_for_an_item, item_entitlements#item_entitlements_for_a_feature, item_entitlements#add_an_item_entitlements and item_entitlements#upsert_or_remove_an_item_entitlements_for_item have been added to the item_entitlements resource. +* entitlement_overrides#add_entitlement_override_for_a_subscription and entitlement_overrides#list_entitlement_override_for_a_subscription have been added to the entitlement_overrides resource. + +#### New Resource: +* features, subscription_entitlements, item_entitlements and entitlement_overrides have been added. + +#### New filter parameters: +* einvoice[status] filter parameter has been added in credit_notes#list_credit_notes api. + +#### New Enum values: +* paypal_express_checkout has been added to payment_method_type enum. +* feature_created, feature_updated, feature_deleted, feature_activated, feature_reactivated, feature_archived, item_entitlements_updated, entitlement_overrides_updated, entitlement_overrides_removed, item_entitlements_removed and entitlement_overrides_auto_removed have been added to the event_type enum. +* action enum has been added. + +### v2.15.0 (2022-04-25) +* * * + +#### New endpoints: +* UnbilledCharge#CreateUnbilledCharge has been added to UnbilledCharge resource. Applicable only for PC1.0. + +#### New attributes: +* channel have been added to the Addon, AttachedItem, CreditNote, Customer, Invoice, ItemFamily, ItemPrice, Plan and Subscription resources. +* external_name and channel have been added to the Item resource. + +#### New input parameters: +* external_name have been added to Item#CreateRequest and Item#UpdateRequest. +* channel have been added to Addon#AddonListRequest. +* channel have been added to CreditNote#CreditNoteListRequest. +* channel have been added to Customer#CustomerListRequest. +* invoice[channel], subscription[channel] and customer[channel] have been added to Export#RevenueRecognitionRequest and Export#DeferredRevenueRequest. +* plan[channel] have been added to Export#PlansRequest. +* addon[channel] have been added to Export#AddonsRequest. +* customer[channel] have been added to Export#CustomersRequest. +* subscription[channel] have been added to Export#SubscriptionsRequest. +* invoice[channel] have been added to Export#InvoicesRequest. +* credit_note[channel] have been added to Export#CreditNotesRequest. +* item[channel] have been added to Export#ItemsRequest. +* item_price[channel] have been added to Export#ItemPricesRequest. +* channel have been added to Invoice#InvoiceListRequest. +* channel have been added to Item#ItemListRequest. +* channel have been added to ItemPrice#ItemPriceListRequest. +* channel have been added to Plan#PlanListRequest. +* channel have been added to Subscription#SubscriptionListRequest. + +### Existing input parameter changes: +* item_family_id in Item#CreateRequest has been made as required field. + +### Removed enum values: +* coupon_expired has been removed from EventTypeEnum. + +### v2.14.1 (2022-03-31) +* * * + +### Fixes: +* Fixed serialization issue. + + +### v2.14.0 (2022-03-14) +* * * + +#### New Input parameters: +* net_term_days has been added to subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#import_subscription_for_items endpoints. + + +### v2.13.0 (2022-03-08) +* * * + +### Fixes: +* Fixed serialization issue for nested array attributes + +#### New attributes: +* upi, mandates and their subresources have been added to the payment_source resource. + +#### New Input parameters: +* bank_account[phone] have been added to customers#create_bank_account +* payment_intent[payment_method_type] have been added to customers#create_payment_intent, customers#collect_payment_intent +* payment_intent[payment_method_type] have been added to estimate#gift_subscription and estimate#gift_subscription_for_items. +* payment_intent[payment_method_type] have been added to gift#create_payment_intent and gift#create_gift_for_items_payment_intent. +* customer[is_einvoice_enabled], customer[entity_identifier_scheme], customer[entity_identifier_standard], entity_identifiers[id], entity_identifiers[scheme], entity_identifiers[value], entity_identifiers[operation], entity_identifiers[standard] have been added to hosted_page#checkout_onetime_for_items, hosted_page#checkout_new_for_items and hosted_page#checkout_existing_for_items. +* bank_account[phone] have been added to invoice#create_bank_account, invoice#create_bank_account_for_chargeitems_and_charges +* payment_intent[payment_method_type] have been added to invoice#create_payment_intent, invoice#create_payment_intent_for_chargeitems_and_charges +* bank_account[phone] have been added to payment_source#create_bank_account +* payment_intent[payment_method_type] have been added to payment_source#create_using_payment_intent +* subscription_id have been added to payment_source#list_payment_source +* bank_account[phone] have been added to subscription#create_bank_account +* payment_intent[payment_method_type] have been added to subscription#create_payment_intent, subscription#create_payment_intent_for_customer, subscription#create_payment_intent_with_items, subscription#update_payment_intent, subscription#update_payment_intent_for_items, subscription#reactivate_payment_intent, subscription#resume_payment_intent +* activated_at have been added to subscription#import_subscription, subscription#import_subscription_for_customer, subscription#import_subscription_for_items + +#### New Enum values: +* upi, netbanking_emandates enum has been added in customer_payment_method_type subresource of customer resource +* current enum has been added in account_type. +* quickbooks, razorpay enum has been added in gateway. +* upi, netbanking_emandates enum has been added in payment_method,payment_method_type, type +* upi, netbanking_emandates, apple_pay enum has been added in payment_method_type subresource of payment_intent resource +* current enum has been added in bank_account_type subresource of payment_source. + +#### Deprecated attributes: +* coupon attribute have been added and deprecated in hosted_page resource. + +#### Deprecated enums: +* NetdPaymentDueReminder have been deprecated in event_type. + + +### v2.12.0 (2022-01-21) +* * * + +#### New endpoints: +* credit_notes#download_einvoice has been added to the credit_notes resource. +* invoice#download_einvoice has been added to the invoice resource. + +#### New attributes: +* is_einvoice_enabled, entity_identifier_scheme, entity_identifier_standard and entity_identifiers[] have been added to the customer resource. +* einvoice has been added to the invoice resource. +* einvoice has been added to the credit_notes resource. +* mime_type has been added to the download resource. + +#### New Input parameters: +* entity_identifier_scheme, entity_identifier_standard, is_einvoice_enabled, entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to customers#create_a_customer, customers#update_billing_info_for_a_customer apis. +* customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled], entity_identifiers[id][0..N], entity_identifiers[scheme][0..N], entity_identifiers[value][0..N], entity_identifiers[standard][0..N] have been added to the subscriptions#create_a_subscription api. +* customer[entity_identifier_scheme], customer[entity_identifier_standard], customer[is_einvoice_enabled] have been added to subscriptions#update_a_subscription and subscriptions#update_subscription_for_items apis. + +#### New Enum values: +* operation enum has been added. +* status enum has been added in credit_notes_einvoice subresource of credit_notes resource. + +#### Deprecated attributes: +* user, type, payment_method and exchange_rate have been deprecated from TaxWithHeld resource. + +#### Deprecated enums: +* type and payment_method have been deprecated in TaxWithHeld resource. + +#### Updated parameters: +* hierarchy_operation_type has been made mandatory in customers#get_hierarchy api. + +#### Removed Filter parameters: +* create_pending_invoices has been removed from subscriptions#list_subscriptions api. + + +### v2.11.1 (2022-01-05) +* * * + +### Fixes: +* Improved error message for Invalid JSON response. + +### v2.11.0 (2021-12-08) +* * * + +### Fixes: +* Exposed function chargebee#update_connect_timeout_secs and chargebee#update_read_timeout_secs to set custom connect and read timeout. +* Updated default request connect and read timeout to 30s and 80s respectively. + +#### New endpoints: +* payment_sources#update_bank_account have been added in payment_sources resource. +* item_price#item_price_find_applicable_items and item_price#item_price_find_applicable_item_prices have been added in item_price resource. + +#### New Attributes: +* hsn_code have been added to the resource addon, item_price and plan. +* first_name, last_name and email have been added to the resource payment_sources. + +#### New Resource: +* TaxWithheld has been added.Applicable only for API V2. + +#### New Input parameters: +* hsn_code have been added to addons#create_an_addon, addons#update_an_addon, plan#create_an_plan and plan#update_an_plan apis. +* bank_account[first_name],bank_account[last_name] and bank_account[email] have been added to payment_sources#update_bank_account api. +* charges[hsn_code] have been added in estimate#Create_Invoice, estimate#Create_Invoice_For_Items, hosted_pages#Checkout_One_Time, hosted_pages#Checkout_One_Time_For_Items, invoice#create_an_invoice, invoice#Create_For_Charge_Items_And_Charges and unbilledCharge#create_an_unbilledCharge apis. +* tax_detail[hsn_code] have been added in item_price#create_an_itemPrice and item_price#update_an_itemPrice apis. +* include_deleted have been added in plan#plan_list and addon#addon_list apis.Applicable only for Product Catalog V1. + +#### New Enum values: +* subscription_activated_with_backdating, tax_withheld_recorded, tax_withheld_deleted and tax_withheld_refunded has been added to event_type enum. + +### v2.10.0 (2021-10-14) +* * * +#### Fixes: +* Fixed UnicodeEncodeError for python version 2.7 and less. +* Fixed order of lists when serialized in a request. + +#### New Attributes: +* entity_id has been added in order_line_item_discounts resource. + +#### New Input parameters: +* line_items[tax5_name], line_items[tax5_amount], line_items[tax6_name], line_items[tax6_amount], line_items[tax7_name], line_items[tax7_amount], line_items[tax8_name], line_items[tax8_amount], line_items[tax9_name], line_items[tax9_amount], line_items[tax10_name], line_items[tax10_amount] have been added in import_invoice api. +* replace_primary_payment_source has been added in create_subscription_for_customer and create_subscription_for_items apis. + +#### New Enum values: +* coupon_expired has been added to event_type enum. +* mollie has been added to gateway enum. +* item_level_discount and document_level_discount has been added to discount_type. + +### v2.9.0 (2021-08-16) +* * * +#### New Attributes: +* generated_at has been added in credit_note and invoice resources. +* change_option have been added in quoted_subscription resource. +* changes_scheduled_at has been added in subscription and quoted_subscription resources. +* iin and last4 have been added in transaction resource. + +#### New Resource: +* quoted_charge has been added. + +#### New Input parameters: +* invoice_date has been added in estimates##create_subscription_estimate, estimates#estimate_for_creating_a_customer_and_subscription, estimates#estimate_for_creating_a_subscription, estimates#create_subscription_for_a_customer_estimate, estimates#update_subscription_estimate, estimates#estimate_for_updating_a_subscription, estimates#cancel_subscription_estimate, estimates#cancel_subscription_for_items_estimate, estimates#create_invoice_for_items_estimate, estimates#create_invoice_estimate, hosted_pages#checkout_existing_subscription, hosted_pages#create_checkout_to_update_a_subscription, invoices#create_an_invoice, invoices#create_invoice_for_items_and_one-time_charges, subscriptions#create_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#update_a_subscription, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#reactivate_a_subscription, subscriptions#cancel_subscription_for_items and subscriptions#cancel_a_subscription endpoints. +* coupon_ids has been added to invoices#create_invoice_for_a_one-time_charge, invoice#create_invoice_for_a_non-recurring_addon, quotes#create_quote_for_one-time_charges, quotes#edit_quote_for_one-time_charges, quotes#create_a_quote_for_charge_and_charge_items, quotes#edit_quote_for_charge_items_and_charges endpoints. +* change_option and changes_scheduled_at have been added in quotes#create_quote_for_updating_a_subscription, quotes#edit_quote_for_updating_a_subscription, quotes#create_a_quote_for_update_subscription_items, quotes#edit_update_subscription_quote_for_items, subscriptions#update_a_subscription and subscriptions#create_subscription_for_items endpoints. +* invoice_date, create_pending_invoices and first_invoice_pending have been added in quotes#convert_a_quote endpoint. +* subscription[auto_close_invoices] has been added in quotes#convert_a_quote endpoint. + +#### New Enum values: +* subscription_cancel has been added to charge_event enum in quote_line_groups resource. +* subscription_created_with_backdating, subscription_changed_with_backdating, subscription_canceled_with_backdating, subscription_reactivated_with_backdating, invoice_generated_with_backdating and credit_note_created_with_backdating have been added to event_type enum +* change_option enum has been added. + +#### Deprecated parameters: +* coupon has been deprecated in invoices#create_invoice_for_a_one-time_charge and invoices#create_invoice_for_a_non-recurring_addon endpoints. + +### v2.8.4 (2021-07-22) +* * * +#### Fixes: +* Migrated to the python-requests http lib. +* Added missing import for Usage. +* Added None check if params is None for list request. +* Replaced equals operator with is in compat.py file. + +#### New endpoints: +* hosted_pages#checkout_one_time_for_items and hosted_pages#checkout_gift_for_items have been added in hosted_pages resource. +* orders#resend_an_order has been added in orders resource. +* quotes#edit_create_subscription_quote_for_items, quotes#edit_update_subscription_quote_for_items and quotes#edit_quote_for_charge_items_and_charges have been added in quotes resource. Applicable only for Product Catalog V2. + +#### New attributes: +* accounting_category3 and accounting_category4 have been added to addon, item_price and plan resources. +* quantity_in_decimal has been added to attached_item resource. +* period and period_unit have been added to coupon resource. +* entity_id has been added to line_item_discounts object of credit_note, credit_note_estimate, invoice, invoice_estimate, quote and quote_line_group resources. +* vat_number_prefix has been added to credit_note, customer, invoice and quote resources. +* price_in_decimal has been added to differential_price and item_price resources. +* exchange_rate and new_sales_amount have been added to invoice resource. +* archived_at has been added to item and item_price resources. +* trial_end_action has been added to item_price, plan, subscription and subscription_estimate resources. +* resent_orders, tracking_url, resent_status, is_resent, original_order_id and resend_reasons have been added to order resource. +* line_item_tiers have been added to quote resource. +* plan_quantity_in_decimal and plan_unit_price_in_decimal have been added to quoted_subscription and subscription resources. Applicable only for Product Catalog V1. +* contract_term_billing_cycle_on_renewal and quoted_contract_term have been added to quoted_subscription resource. +* quantity_in_decimal, metered_quantity, last_calculated_at, unit_price_in_decimal, amount_in_decimal and free_quantity_in_decimal have been added to subscription_items object of quoted_subscription and subscription resources. +* starting_unit_in_decimal, ending_unit_in_decimal and price_in_decimal have been added to item_tiers object in quoted_subscription resources. +* cancel_schedule_created_at has been added to subscription resource. +* exchange_rate and merchant_reference_id have been added to transaction resource. + +#### New parameters: +* accounting_category3 and accounting_category4 have been added in addons#create_an_addon, addons#update_an_addon, plans#create_a_plan and plans#update_a_plan endpoints. +* quantity_in_decimal has been added in attached_items#create_an_attached_item, attached_items#update_an_attached_item and gifts#create_a_gift_subscription_for_items endpoints. +* period and period_unit have been added in coupons#create_a_coupon, coupons#update_a_coupon, coupons#create_a_coupon_for_items and coupons#update_a_coupon_for_items endpoints. +* vat_number_prefix has been added in customers#create_a_customer, customers#update_billing_info_for_a_customer, estimates#create_subscription, estimates#create_subscription_estimate, estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#update_subscription_for_items, estimates#update_subscription, hosted_pages#checkout_new_subscription, hosted_pages#checkout_one-time_payments, hosted_pages#create_checkout_for_a_new_subscription hosted_pages#checkout_existing_subscription, hosted_pages#create_checkout_to_update_a_subscription, invoices#import_invoice, invoices#update_invoice_details, subscriptions#create_a_subscription, subscriptions#update_a_subscription, subscriptions#update_subscription_for_items and subscriptions#import_a_subscription endpoints. +* payment_method[additional_information] has been added in customers#create_a_customer, customers#update_payment_method_for_a_customer, customers#collect_payment_for_customer, invoices#create_an_invoice, invoices#create_invoice_for_items_and_one-time_charges, subscriptions#create_a_subscription, subscriptions#update_a_subscription, subscriptions#update_subscription_for_items and subscriptions#import_a_subscription endpoints. +* card[additional_information] has been added in customers#create_a_customer, customers#collect_payment_for_customer, invoices#create_an_invoice, invoices#create_invoice_for_items_and_one-time_charges, payment_sources#create_a_card_payment_source, subscriptions#create_a_subscription, subscriptions#update_a_subscription, subscriptions#update_subscription_for_items and subscriptions#import_a_subscription endpoints. +* bank_account[billing_address] has been added in customers#create_a_customer, invoices#create_an_invoice, invoices#create_invoice_for_items_and_one-time_charges, payment_sources#create_a_bank_account_payment_source and subscriptions#create_a_subscription endpoints. +* price_in_decimal has been added in differential_prices#create_a_differential_price and differential_prices#update_a_differential_price endpoints. +* tiers[starting_unit_in_decimal][0..N], tiers[ending_unit_in_decimal][0..N] and tiers[price_in_decimal][0..N] have been added in differential_prices#create_a_differential_price, differential_prices#update_a_differential_price, item_prices#create_an_item_price and item_prices#update_an_item_price endpoints. +* remove_general_note and notes_to_remove been added in estimates#create_invoice_estimate, estimates#create_invoice_for_items_estimate and invoices#create_invoice_for_items_and_one-time_charges endpoints. +* trial_end_action has been added in estimates#create_subscription, estimates#create_subscription_estimate, estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#update_subscription_for_items, estimates#update_subscription, plans#create_a_plan, plans#update_a_plan, item_prices#create_an_item_price, item_prices#update_an_item_price, subscriptions#create_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#create_subscription_for_items, subscriptions#update_a_subscription and subscriptions#update_subscription_for_items endpoints. +* subscription_items[unit_price_in_decimal][0..N], item_tiers[starting_unit][0..N], item_tiers[ending_unit][0..N] and item_tiers[price_in_decimal][0..N] have been added in estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#update_subscription_for_items, estimates#update_subscription, estimates#cancel_subscription_for_items_estimate, hosted_pages#create_checkout_for_a_new_subscription, hosted_pages#create_checkout_to_update_a_subscription, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items and subscriptions#import_subscription_for_items endpoints. +* subscription_items[quantity_in_decimal][0..N] has been added in estimates#create_subscription_for_items, estimates#create_subscription_for_items_estimate, estimates#cancel_subscription_for_items_estimate, estimates#update_subscription_for_items, estimates#update_subscription, estimates#gift_subscription_for_items, estimates#cancel_subscription_for_items_estimate, gifts#create_a_gift_subscription_for_items, hosted_pages#create_checkout_for_a_new_subscription, hosted_pages#create_checkout_to_update_a_subscription, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#import_subscription_for_items and subscriptions#cancel_subscription_for_items endpoints. +* notes_to_remove[entity_type][0..N] and notes_to_remove[entity_id][0..N] have been added in estimates#create_invoice, estimates#create_invoice_for_items and invoices#create_invoice_for_items_and_one-time_charges endpoints. +* item_prices[quantity_in_decimal][0..N] and item_prices[unit_price_in_decimal][0..N] have been added in estimates#create_invoice_for_items, invoices#create_invoice_for_items_and_one-time_charges and unbilled_charges#create_unbilled_charges_for_a_subscription endpoints. +* item_tiers[starting_unit_in_decimal][0..N], item_tiers[ending_unit_in_decimal][0..N] and item_tiers[price_in_decimal][0..N] have been added in estimates#create_invoice_for_items, invoices#create_invoice_for_items_and_one-time_charges and unbilled_charges#create_unbilled_charges_for_a_subscription endpoints. +* payment_intent[additional_information] has been added in customers#create_a_customer, customers#collect_payment_for_customer, gifts#create_a_gift_subscription_for_items, gifts#create_a_gif and payment_sources#create_using_payment_intent endpoints. +* invoice_note has been added in hosted_pages#checkout_one-time_payments endpoint. +* allow_offline_payment_methods has been added in hosted_pages#create_checkout_for_a_new_subscription and hosted_pages#create_checkout_to_update_a_subscription endpoints. +* free_quantity_in_decimal, price_in_decimal and trial_end_action have been added in item_prices#create_an_item_price and item_prices#update_an_item_price endpoints. +* tracking_url has been added in orders#create_an_order, orders#update_an_order and orders#import_an_order endpoints. +* additional_information has been added in payment_sources#create_using_gateway_temporary_token and payment_sources#create_using_permanent_token endpoints. + +#### New enum values: +* bancontact has been added to card_type enum. +* card and latam_local_card have been added to powered_by enum. +* item_level_discount and document_level_discount have been added to entity_type enum of credit_note_discount, credit_note_estimate_discount, invoice_discount, line_item_discount and invoice_estimate_discount resources. +* item_level_discount and document_level_discount have been added to discount_type enum. +* add_usages_reminder and order_resent have been added to event_type enum. +* ingenico_direct and exact have been added to gateway enum. +* max_usage has been added to usage_calculation enum. +* trial_end_action enum has been added. +* order_resent has been added to cancellation_reason enum. +* resent_status enum has been added. +* custom_discount has been added in discount_type enum of order_line_item_discount. + +#### New filter parameters: +* resent_status, is_resent and original_order_id filter parameters have been added in exports#orders and orders#list_orders enpoints. +* updated_at filter parameter has been added in exports#item_families and item_families#list_item_families endpoints. + +#### New sort parameters: +* name, id and updated_at sort parameters are added to items#list_items and item_prices#list_item_prices endpoints. +* created_at and updated_at sort parameters are added to payment_sources#list_payment_sources endpoint. +* usage_date sort parameter has been added to usages#list_usages endpoint. + +#### Deprecated parameters: +* duration_month parameter has been deprecated in coupon resource. + +### v2.8.3 (2021-05-05) +* Added item modules for Product Catalog 2.0 + +### v2.8.2 (2021-01-19) +* * * +##### New resources: +* Usages is added. Applicable only for Product Catalog V2 + +##### New end points: +* hosted_pages#checkout_one-time_payments has been added in hosted_pages resource + +##### New attributes: +* auto_close_invoices has been added to customers, subscriptions resources +* metered, usage_calculation have been added to items resources +* create_pending_invoices, auto_close_invoices have been added to subscriptions resources + +##### New parameters: +* auto_close_invoices has been added to the endpoint: customers#create_a_customer, customers#list_customers, customers#update_a_customer +* invoice_allocations[invoice_id] has been added to the endpoint: customers#collect_payment_for_customer +* coupon_ids has been added to the endpoint: estimates#create_invoice_for_items_estimate. Applicable only for Product Catalog V2 +* subscription[auto_close_invoices] has been added to the endpoint: exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_subscriptions +* customer[auto_close_invoices] has been added to the endpoint: exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_customers +* item[metered], item[usage_calculation] have been added to the endpoint: exports#export_items. Applicable only for Product Catalog V2 +* subscription_id has been added to the endpoint: invoices#add_one-time_charge_to_a_pending_invoice, invoices#add_non-recurring_addon_to_a_pending_invoice +* subscription_id has been added to the endpoint: invoices#add_a_charge-item_to_a_pending_invoice. Applicable only for Product Catalog V2 +* metered, usage_calculation have been added to the endpoint: items#create_an_item, items#list_item. Applicable only for Product Catalog V2 +* create_pending_invoices, auto_close_invoices, first_invoice_pending have been added to the endpoint: subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items,subscriptions#import_subscription_for_items. Applicable only for Product Catalog V2 +* create_pending_invoices, auto_close_invoices have been added to the endpoint: subscriptions#list_subscriptions + +### v2.8.0 (2020-12-15) +* * * +##### New end points: +* estimate_for_creating_a_customer_and_subscription, cancel_subscription_for_items_estimate, gift_subscription_estimate_for_items have been added in estimate resource. Applicable only for Product Catalog V2 +* regenerate_invoice_estimate has been added in estimate resource +* create_a_gift_subscription_for_items has been added in gift resource. Applicable only for Product Catalog V2 +* regenerate_invoice has been added in subscription resource + +##### New attributes: +* show_description_in_invoices, show_description_in_quotes have been added to the resource item_prices +* tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to the resource differential_prices +* show_description_in_invoices, show_description_in_quotes have been added to the resource item_prices. Applicable only for Product Catalog V2 + +##### New parameters: +* payment_intent[additional_info] has been added to the endpoints customers#create_a_customer, invoices#create_an_invoice, payment_sources#create_using_payment_intent, subscriptions#create_a_subscription, subscriptions#update_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#reactivate_a_subscription, subscriptions#resume_a_subscription +* payment_intent[additional_info] has been added to the endpoints gifts#create_a_gift_subscription_for_items, invoices#create_invoice_for_items_and_one-time_charges, subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items. Applicable only for Product Catalog V2 +* contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] has been added to the endpoint estimates#estimate_for_creating_a_subscription. Applicable only for Product Catalog V2 +* cancel_at, contract_term_cancel_option, cancel_reason_code have been added to the endpoint estimates#cancel_subscription_for_items_estimate +* event_based_addons has been added to the endpoint estimates#cancel_subscription_for_items_estimate +* redirect_url has been added to the endpoint hosted_pages#accept_a_quote +* token_id, retain_payment_source, card, bank_account, payment_method added have been added to the endpoint invoices#create_an_invoice +* token_id, retain_payment_source, card, bank_account, payment_method added have been added to the endpoint invoices#create_invoice_for_items_and_one-time_charges. Applicable only for Product Catalog V2 +* show_description_in_invoices, show_description_in_quotes have been added to the endpoints item_prices#create_an_item_price, item_prices#update_an_item_price. Applicable only for Product Catalog V2 + +### v2.7.9 (2020-11-26) +* * * +##### New resources: +item_family, item, item_price, attached_item and differential_price are added. Applicable only for Product Catalog V2 + +##### New end points: +* coupons#create_a_coupon_for_items and coupons#update_a_coupon_for_items have been added in coupon resource. Applicable only for Product Catalog V2 +* estimates#estimate_for_creating_a_subscription, estimates#estimate_for_updating_a_subscription and estimates#create_invoice_for_items_estimate have been added in estimate resource. Applicable only for Product Catalog V2 +* estimates#advance_invoice_estimate has been added in estimate resource +* exports#export_item_families, exports#export_items, exports#export_item_prices, exports#export_attached_items and exports#export_differential_price have been added in export api. Applicable only for Product Catalog V2 +* checkout_new_for_items and checkout_existing_for_items have been added in hosted_pages api. Applicable only for Product Catalog V2 +* invoices#create_invoice_for_items_and_one-time_charges, invoices#create_invoice_for_a_charge-item and invoices#add_a_charge-item_to_a_pending_invoice have been added in invoice resource. Applicable only for Product Catalog V2 +* quotes#create_a_quote_for_a_new_subscription_items, quotes#create_a_quote_for_update_subscription_items and quotes#create_a_quote_for_charge_and_charge_items have been added in quote resource. Applicable only for Product Catalog V2 +* subscriptions#create_subscription_for_items, subscriptions#update_subscription_for_items, subscriptions#import_subscription_for_items and subscriptions#cancel_subscription_for_items have been added in subscription resource. Applicable only for Product Catalog V2 +* subscriptions#edit_advance_invoice_schedule, subscriptions#retrieve_advance_invoice and subscriptions#remove_an_advance_invoice_schedules have been added in subscription resource +* unbilled_charges#create_an_invoice_for_unbilled_charges has been added to unbilled_charge resource + +##### New attributes: +* item_constraints and item_constraint_criteria have been added in coupon resource. Applicable only for Product Catalog V2 +* success_url and failure_url have been added in payment_intent resource +* subscription_items and item_tiers have been added in quoted_subscription resource. Applicable only for Product Catalog V2 +* has_scheduled_advance_invoices has been added in subscription resource +* subscription_items, item_tiers and charged_items have been added in subscription resource. Applicable only for Product Catalog V2 + +##### New parameters: +* item_id and item_price_id have been added to the end point: subscriptions#list_subscriptions, exports#export_revenue_recognition_reports, exports#export_deferred_revenue_reports, exports#export_subscriptions. Applicable only for Product Catalog V2 +* invoice_immediately, schedule_type and fixed_interval_schedule have been added to the end point: subscriptions#charge_future_renewals +* success_url and failure_url have been added to the end points: payment_intents#create_a_payment_intent, payment_intents#update_a_payment_intent + +##### New Enum values: +* PLAN_ITEM_PRICE, ADDON_ITEM_PRICE, CHARGE_ITEM_PRICE are added to Entitytype Enum +* ITEM_FAMILY_CREATED, ITEM_FAMILY_UPDATED, ITEM_FAMILY_DELETED, ITEM_CREATED, ITEM_UPDATED, ITEM_DELETED, ITEM_PRICE_CREATED, ITEM_PRICE_UPDATED, ITEM_PRICE_DELETED, ATTACHED_ITEM_CREATED, ATTACHED_ITEM_UPDATED, ATTACHED_ITEM_DELETED, DIFFERENTIAL_PRICE_CREATED, DIFFERENTIAL_PRICE_UPDATED, DIFFERENTIAL_PRICE_DELETED are added to EventType Enum + +### v2.7.8 (2020-11-16) +* * * +* New attributes price_in_decimal, tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to the resource addon +* New input parameters price_in_decimal, tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to addons#create_an_addon, addons#update_an_addon apis. +* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal, line_item_tiers[starting_unit_in_decimal], line_item_tiers[ending_unit_in_decimal], line_item_tiers[quantity_used_in_decimal], line_item_tiers[unit_amount_in_decimal] have been added to the resources credit_note, credit_note_estimate, invoice, invoice_estimate +* New input parameters line_items[unit_amount_in_decimal], line_items[quantity_in_decimal] have been added to credit_notes#create_credit_note api. +* New input parameters subscription[plan_unit_price_in_decimal], subscription[plan_quantity_in_decimal], addons[quantity_in_decimal], addons[unit_price_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to estimates#create_subscription_estimate, estimates#create_subscription_for_a_customer_estimate, estimates#update_subscription_estimate, hosted_pages#checkout_new_subscription, hosted_pages#checkout_existing_subscription, quotes#create_a_quote_for_a_new_subscription, quotes#edit_create_subscription_quote, quotes#create_a_quote_for_update_subscription, quotes#edit_update_subscription_quote, apis +* New input parameters subscription[plan_quantity_in_decimal], addons[quantity_in_decimal] have been added to estimates#gift_subscription_estimate, gifts#create_a_gift, hosted_pages#checkout_gift_subscription apis +* New input parameters addons[quantity_in_decimal], addons[unit_price_in_decimal], charges[amount_in_decimal] have been added to estimates#create_invoice_estimate, invoices#create_an_invoice, quotes#create_a_quote_for_one-time_charges, quotes#edit_one-time_quote apis +* New input parameter amount_in_decimal has been added to invoices#create_invoice_for_a_one-time_charge api +* Input parameter amount has been made optional to invoices#create_invoice_for_a_one-time_charge api +* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to invoices#create_invoice_for_a_non-recurring_addon +* New input parameters line_items[unit_amount_in_decimal], line_items[quantity_in_decimal], line_items[amount_in_decimal], line_item_tiers[starting_unit_in_decimal], line_item_tiers[ending_unit_in_decimal], line_item_tiers[quantity_used_in_decimal], line_item_tiers[unit_amount_in_decimal] have been added to invoices#import_invoice api +* Input parameters line_item_tiers[starting_unit], line_item_tiers[ending_unit], line_item_tiers[quantity_used], line_item_tiers[unit_amount] have beed made optional in invoices#import_invoice api +* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to invoices#add_non-recurring_addon_to_a_pending_invoice api +* New input parameter invoice_date has been added to invoices#close_a_pending_invoice api +* New attributes tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal], attached_addons[quantity_in_decimal], event_based_addons[quantity_in_decimal], free_quantity_in_decimal, price_in_decimal have been added to the resource plan +* New input parameters tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal], attached_addons[quantity_in_decimal], event_based_addons[quantity_in_decimal], free_quantity_in_decimal, price_in_decimal have been added to plans#create_a_plan, plans#update_a_plan apis +* New attribute amount_in_decimal has been added to the resource promotional_credit +* New input parameter amount_in_decimal has been added to promotional_credits#add_promotional_credits, promotional_credits#deduct_promotional_credits, promotional_credits#set_promotional_credits apis +* Input parameter amount has been made optional in promotional_credits#add_promotional_credits, promotional_credits#deduct_promotional_credits, promotional_credits#set_promotional_credits apis +* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the resource quote +* New attributes addons[quantity_in_decimal], addons[unit_price_in_decimal], addons[amount_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to the sub resource quoted_subscription +* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the sub resource quoted_line_group +* New attributes addons[quantity_in_decimal], addons[unit_price_in_decimal], addons[amount_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal], plan_free_quantity_in_decimal, plan_quantity_in_decimal, plan_unit_price_in_decimal, plan_amount_in_decimal have been added to the resource subscription +* New input parameters plan_unit_price_in_decimal, plan_quantity_in_decimal, addons[quantity_in_decimal], addons[unit_price_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to subscriptions#create_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#update_a_subscription, subscriptions#import_a_subscription, subscriptions#import_subscription_for_customer apis +* New input parameter amount_in_decimal has been added to subscriptions#add_charge_at_term_end apis +* Input parameter amount has been made optional in subscriptions#add_charge_at_term_end apis +* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to subscriptions#charge_addon_at_term_end api +* New attributes tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[quantity_used_in_decimal], tiers[unit_amount_in_decimal], unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the resource unbilled_charge +* New endpoint transactions#refund_a_payment has been added to the resource transaction +### v2.7.7 (2020-10-19) +* * * +* New optional attribute quoted_subscriptions has been added to the resource quote +* New optional attributes resource_version and updated_at are added to the resource payment_intent +### v2.7.6 (2020-09-29) +* * * + +* New attribute included_in_mrr has been added in addon and coupon resource +* New attribute offline_payment_method has been added in subscription and customer resource +* New input parameter included_in_mrr has been added in create_an_addon, update_an_addon, create_a_coupon and update_a_coupon apis. +* New input parameter offline_payment_method has been added in create_a_customer, list_customers, update_a_customer, create_a_subscription, create_subscription_for_customer and list_subscriptions apis +* New input parameter auto_collection has been added in update_a_subscription +* New input parameter subscription[offline_payment_method] has been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, update_subscription_estimate, export_revenue_recognition_reports, export_deferred_revenue_reports, export_subscriptions, checkout_new_subscription and checkout_existing_subscription apis +* New input parameter subscription[auto_collection] has been added in checkout_existing_subscription and update_subscription_estimate apis +* New input parameter customer[offline_payment_method] has been added in export_revenue_recognition_reports, export_deferred_revenue_reports, export_customers and create_a_subscription + +### v2.7.5 (2020-09-09) +* * * + +* New input parameter currency_code is added in list_addons, list_coupons, list_plans, export_plans, export_addons, export_coupons apis +* New attributes powered_by has been added in card resource +* New input parameters subscription[free_period], subscription[free_period_unit] have been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, update_subscription_estimate apis +* Input parameter invoice[customer_id] is made optional in create_invoice_estimate api +* Input parameter customer_id is made optional in create_an_invoice +* Attribute created_at in dunning_attempts is made optional in the invoice resource +* New attributes free_period and free_period_unit have been added in the Subscription resource +* New enum type free_period_unit has been added with the values: + DAY, + WEEK, + MONTH, + YEAR +* New enum type powered_by has been added in card resource with the values: + IDEAL, + SOFORT, + BANCONTACT, + GIROPAY, + NOT_APPLICABLE +* New endpoint import_contract_term has been added to the subscription resource +* Attributes status, amount and date inside the linked_payment are made optional in the transaction resource +* New endpoint delete has been added to the virtual_bank_account resource +* New values GIROPAY and DOTPAY have been added to the payment_method_types enum +* New values PAYMENT_SOURCE_EXPIRING and PAYMENT_SOURCE_EXPIRED have been added to the event_type enums +* New value PAYPAL has been added to the gateway enum + +### v2.7.4 (2020-07-15) +* * * + +* New attributes show_description_in_invoices, show_description_in_quotes have been added in Addon, Plan resource +* New input parameters show_description_in_invoices, show_description_in_quotes have been added for create_an_addon, update_an_addon, create_a_plan, update_a_plan apis +* New attribute create_reason_code has been added in Credit notes resource +* Attribute reason_code is made optional in the Credit notes resource +* New filter parameter create_reason_code is added in list_credit_notes api +* New input parameter refund_reason_code has been added in Credit notes' Refund, Record a refund apis +* Sub-resources parent_account_access and child_account_access have been added in Customer resource +* New attribute use_default_hierarchy_settings has been added in Customer resource +* New endpoint update_hierarchy_settings has been added in Customer resource +* New input parameters use_default_hierarchy_settings, parent_account_access, child_account_access have been added in link_a_customer api +* New input parameter invoice_notes, coupon_ids, invoice[subscription_id], charges[taxable], charges[tax_profile_id], charges[avalara_tax_code], charges[taxjar_product_code] has been added to create_invoice_estimate api +* New input param cancel_reason_code has been added to export_revenue_recognition_reports, export_deferred_revenue_reports, export_subscriptions, export_credit_notes apis +* New input param coupon_ids has been added to checkout_new_subscription, checkout_existing_subscription apis +* Input param subscription_coupon has been deprecated in checkout_new_subscription, checkout_existing_subscription apis +* New attribute void_reason_code has been added to the Invoice resource +* Attribute cn_reason_code has been made optional in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources +* New attribute cn_create_reason_code has been added in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources +* New input parameter subscription_id, invoice_note, remove_general_note, coupon_ids, charges[taxable], charges[tax_profile_id], charges[avalara_tax_code], charges[taxjar_product_code] have been added to create_an_invoice api +* Input parameter coupon is deprecated from create_an_invoice api +* New filter parameter void_reason_code has been added to list_invoices api +* New input parameter invoice_note, remove_general_note, notes_to_remove[entity_type], notes_to_remove[entity_id] have been added to close_a_pending_invoice api +* New input parameter void_reason_code has been added to void_an_invoice api +* New input parameter credit_note[create_reason_code] has been added to refund_an_invoice, record_refund_for_an_invoice api +* New endpoints import_an_order and delete_an_imported_order have been added to Order resource +* New filter parameter exclude_deleted_credit_notes has been added to list_orders api +* New attribute payment_method_type has been added to payment_intent resource and active_payment_attempt sub-resource +* New input parameter payment_method_type has been added to create_a_payment_intent, update_a_payment_intent api +* New attributes version, contract_term_start, contract_term_end, contract_term_termination_fee have been added to Quotes resource +* New endpoints edit_create_subscription_quote, edit_update_subscription_quote, edit_one_time_quote, extend_expiry_date have beed added to Quotes resource +* New input parameters contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] have been added to create_a_quote_for_a_new_subscription, create_a_quote_for_update_subscription apis +* New attribute version has been added to quote_line_group sub-resource +* New attribute cancel_reason_code has been added to Subscriptions resource +* New filter parameter cancel_reason_code has been added to list_subscriptions, cancel_a_subscription apis +* New input parameter contract_term_billing_cycle_on_renewal has been added to import_a_subscription, import_subscription_for_customer apis +* New input parameter event_based_addon has been added to cancel_a_subscription api +* New filter parameter is_voided has been added to list_unbilled_charges api +* New event_types MRR_UPDATED, ORDER_DELETED have been added +* New values SOFORT, BANCONTACT have been added to the payment_method_types enum +* New attributes entity_type_description has been added to the line_items sub-resource + +### v2.7.3 (2020-04-03) +* * * + +* A subresource contract_term has been added in Subscription resource +* New endpoint refund_a_credit_note has been added in Credit notes resource +* New endpoint list_quote_line_groups has been added in Quotes resource +* New endpoint list_contract_terms_for_a_subscription has been added in Subscriptions resource +* New input parameter contract_term_billing_cycle_on_renewal, contract_term[action_at_term_end], contract_term[cancellation_cutoff_period] has been added in create_a_subscription, create_subscription_for_customer, update_a_subscription and reactivate_a_subscription apis +* New input parameter contract_term_cancel_option has been added in cancel_a_subscription api +* New input parameter contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] has been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, checkout_new_subscription, checkout_existing_subscription apis +* New input parameter business_customer_without_vat_number has been added in create_a_customer and update_billing_info_for_a_customer apis +* New input parameter addons[service_period] replaces the parameter addons[date_from] and addons[date_to] in create_a_quote_for_one-time_charges api +* New input parameter charges[service_period] replaces the parameter charges[date_from] and charges[date_to] in create_a_quote_for_one-time_charges api +* New input parameter consolidated_view has been added in retrieve_quote_as_pdf api +* New input parameter customer[business_customer_without_vat_number] has been added in create_a_subscription, update_a_subscription apis +* New value CHECKOUT_COM has been added in gateway enum +* New value CONTRACT_TERMINATION has been added to eventBasedAddons onEvent enum +* New values IDEAL, GOOGLE_PAY has been added to payment types enum +* New event types CONTRACT_TERM_CREATED, CONTRACT_TERM_RENEWED, CONTRACT_TERM_TERMINATED, CONTRACT_TERM_COMPLETED, CONTRACT_TERM_CANCELLED have been added + +### v2.7.2(2020-02-06) +* * * + +* New attribute total_payable and charge_on_aaceptance has been added in Quote.java +* New input parameter cancel_at has been added in cancel_a_subscription api + +### v2.7.1(2020-01-08) +* * * + +* New attribute taxjar_product_code has been added in Addon and Plan resource. +* New input parameter taxjar_product_code has been added in create_an_addon, update_an_addon, create_a_plan and update_a_plan api +* New input parameter taxjar_exemption_category has been added in create_a_customer, update_a_customer , create_a_subscription and import_a_subscription api +* New input parameter no_expiry has been added in gift_subscription_estimate and create_a_gift api +* New attribute no_expiry has been added in Gift resource +* New endpoint update_gift has been added in Gift resource +* New value BUSINESS_CHECKING has been added in AccountType enum +* New value CCD has been added in EcheckType enum +* New event type GIFT_UPDATED has been added +* New enum taxjar_exemption_category has been added + +### v2.7.0 (2019-09-13) +* * * + +* New endpoints gift_subscription_estimate and create_invoice_estimate have been added in estimate resource. +* New input parameter reference_id in payment_intent has been added in create_a_gift, create_an_invoice, create_using_payment_intent, create_a_subscription, create_subscription_for_customer, update_a_subscription, reactivate_a_subscription, resume_a_subscription, create_a_customer and collect_payment_for_customer api. +* New endpoint record_refund_for_a_payment has been added in transaction resource. + +### v2.6.9 (2019-08-27) +* * * + +* New attribute client_profile_id has been added in customer resource. +* New input parameter client_profile_id has been added in create_a_customer, update_a_customer, create_subscription_estimate, create_a_subscription and import_a_subscription api. +* New input parameter payment_intent has been added in create_a_gift, create_an_invoice, reactivate_a_subscription and resume_a_subscription api. +* New input parameter replace_primary_payment_source has been added in create_an_invoice api. +* New attribute currency_code has been added in payment_intent resource. + +### v2.6.8 (2019-08-14) +* * * + +* New resource payment_intent has been added. +* New input parameter 'id' in payment_intent sub-param has been added in create_a_customer, collect_payment_for_customer, create_using_payment_intent, create_a_subscription, create_subscription_for_customer and update_a_subscription . +* New event_types PAYMENT_INTENT_CREATED and PAYMENT_INTENT_UPDATED have been added. + +### v2.6.7 (2019-08-07) +* * * + +* New attributes tax_amount_in_local_currency and local_currency_code have been added in line_item_tax sub-resource of credit_note, credit_note_estimate, invoice, invoice_estimate, order and quote resources. +* New attributes sub_total_in_local_currency, total_in_local_currency and local_currency_code have been added in credit_note and invoice resources. +* New input parameter gw_payment_method_id has been added in create_a_customer, collect_payment_for_customer, create_using_payment_intent, create_a_subscription, create_subscription_for_customer and update_a_subscription api. +* New attributes name, invoice_id and notes have been added in quote resource. +* New input parameters name, notes and expires_at have been added in create_a_quote_for_a_new_subscription, create_a_quote_for_update_subscription and create_a_quote_for_one-time_charges api. +* New input parameters id, auto_collection and po_number have been added in convert_a_quote api. + +### v2.6.6 (2019-07-22) +* * * + +* The attribute ref_tx_id has been added in card resource. +* The attribute custmer_id has been added in credit_note_estimate and invoice_estimate resource. +* The input parameters payment_intent with gateway_account_id and gw_token have been added in create a customer, collect payment for customer, create subscription and create subscription for customer API. +* New enum dunning_type has been added. +* New value vantiv has been added in the gateway enum. +* New value sepa_credit has been added in payment method enum. +* The attribute dunning_attempts has been added in invoice resource. +* New enpoint create_using_payment_intent has been added in payment_source resouce. +* The input parameter reference_transaction has been added in update card payment source API. +* New endpoint list quote has been added in qoutes resource. +* The attributes initiator_type and three_d_secure have been added in transaction resource. +* New attribute scheme has been added in virtual_bank_account resource. +* New input parameter scheme has been added in create a virtual bank account using permanent token and create a virtual bank account API. + +### v2.6.5 (2019-07-08) +* * * + +* The resources hierarchy and token are added. +* Value ‘day’ is added in period_unit and shipping_frequency_period_unit . +* The parameters fractional_correction, comment, date_from and date_to are added in Create credit note API. +* The attribute customer_id is added to line_item sub resource of Credit note, Credit note estimate, Invoice, Invoice estimate and Quote. +* Endpoints Link a customer, Delink a customer, Get hierarchy, CreateUsingToken are added. +* The attributes business_customer_without_vat_number and relationship are added to customer resource. +* The filter parameters parent_id, payment_owner_id, invoice_owner_id are added in List customers, Export revenue recognition reports, Export Deferred Revenue Reports and Export customers APIs. +* The parameter token_id is added in Collect payment API. +* Event types hierarchy_created, hierarchy_deleted, token_created, token_consumed and token_expired are added. +* The parameter service_period_in_days is added in Create subscription estimate, Create subscription for customer estimate, Update subscription estimate, Checkout new, Checkout existing, Create subscription for customer quote, Update subscription quote, Create subscription, Create subscription for customer, Update subscription, Import subscription and Import subscription for customer. +* The filter parameter payment_owner is added in Export revenue recognition reports,Export Deferred Revenue Reports, Export Invoice and List Invoice APIs. +* The attribute payment_owner is added to invoice. +* The attributes date_from and date_to are added to Create an invoice, create a invoice for add-on and create a invoice for charge,Create a quote for one-time charges, Add charge at term end and Add add-on at term end. +* The parameter comment is added to Stop dunning, Apply payments, Apply credits, Add charge, Add add-on charge, Update details and Close Invoice APIs. +* The parameter ‘claim_credits’ is added to delete invoice API. +* The attribute override_relationship is added to subscription resource. +* The parameter token_id is added to Create subscription API. +* The parameter override_relationship is added to Create subscription for customer and Update subscription APIs. +* The attribute service_period_in_days is added to event add ons sub resource. + +### v2.6.4 (2019-04-11) +* * * + +* The attributes avalara_sale_type, avalara_transaction_type and avalara_service_type are added in Addon and plan resource. +* The input parameters avalara_sale_type, avalara_transaction_type , avalara_service_type are added in create addon , update addon ,create plan , update plan, create invoice , create invoice for charge, add_charge , add_charge_at_term_end and create_for_onetime_charges api endpoints. +* The attributes is_partial_tax_applied, is_non_compliance_tax and taxable_amount are added in line_item_taxes of credit_note ,credit_note_estimate , invoice, invoice_estimate , quote and order resources. +* The attributes exemption_details and customer_type are added in customer resource . +* The input parameters exemption_details and customer_type are added in create customer, update customer , create subscription estimate, create subscription and import subscription api endpoints. +* The enum values federal and unincorporated are added in tax_juris_type. +* The enum value export is added in tax_override_reason . +* The input parameter cancelled_at is added in cancel order api endpoint. +* New endpoint delete_local is added in payment_source and virtual_bank_account resources. + +### v2.6.3 (2019-03-07) +* * * + +* The attributes created_at, resource_version and updated_at are added in card, payment_source and virtual_bank_account resources. +* The input filter parameter sort_by with updated_at attribute is added in list customer and list subscription api endpoints. +* New endpoint export orders is added in export resource. +* New endpoint accept quote is added in hosted_pages resource. +* The input filter parameters updated_at and created_at are added in list payment_source api endpoint and list virtual_bank_accounts endpoint . +* New endpoint delete an offline transaction is added in transaction resource. + +### v2.6.2 (2019-01-10) +* * * + +* New event type 'quote_deleted' has been added +* New gateway type 'cybersource' has been added. +* New filter parameters 'subscription_id' and 'order_type' have been added in List Order API. +* New endpoints Create subscription for customer quote, Update subscription quote and Delete have been added to Quote resource. + +### v2.6.2 (2019-01-10) +* * * + +* New event type 'quote_deleted' has been added +* New gateway type 'cybersource' has been added. +* New filter parameters 'subscription_id' and 'order_type' have been added in List Order API. +* New endpoints Create subscription for customer quote, Update subscription quote and Delete have been added to Quote resource. + +### v2.6.1 (2018-11-09) +* * * + +* New resource 'Quote' with endpoints 'Retrieve a quote', 'Create a quote for one-time charges', 'Convert a quote', 'Update quote status', 'Retrieve quote as PDF' has been added. See : https://apidocs.chargebee.com/docs/api/quotes +* Entity type 'quote' has been added. +* Event types 'quote_created' and 'quote_updated' have been added. + + +### v2.6.0 (2018-11-02) +* * * + +* New resource 'Gift' with endpoints 'Create a gift', 'Retrieve a gift', 'Claim a gift', 'Cancel a gift' and 'List gifts' has been added. +* New event types gift_scheduled, gift_unclaimed, gift_claimed, gift_expired and gift_cancelled have been added. +* New endpoints 'Checkout gift' and 'Claim gift' have been added to Hosted page resource. +* Input param 'redirect_url' has been added in 'Manage payment sources' and 'Collect now' APIs. +* Hosted page types 'checkout_gift' and 'claim_gift' have been added. +* The attributes 'term_finalized' and 'is_gifted' have been added in Invoice attributes. +* The attributes 'is_gifted', 'gift_note' and 'gift_id' have been added in Orders attributes. +* The attribute 'sku' has been added in Gift attributes. +* The input parameter 'sku' has been added in Update orders API. +* The order status 'cancelled' has been added. +* The attributes 'giftable' and 'claim_url' have been added in Plan resource. +* The input parameters 'giftable' and 'claim_url' have been added in Create a plan API. +* List filter parameter 'giftable' has been added in List Plans API. +* The attribute 'gift_id' has been added to Subscription resource. + +### v2.5.9 (2018-10-26) +* * * + +* The attributes authorization_reason, reference_authorization_id, amount_capturable and linked_payments have been added in Transaction resource. +* The input parameter transaction amount_capturable has been added in export transaction API. +* The input parameters authorization_transaction_id and auto_collection have been added in create invoice API. +* The input parameter authorization_transaction_id has been added in Collect payment for invoice API. +* Type authorization_reason with values blocking_funds and verification has been added in Transaction resource. +* New endpoints "Create an authorization payment " and "Void an authorization transaction" have been in added in Transaction API. +* The input filter parameter amount_capturable has been added in list transactions API. +* The Event types authorization_succeeded, authorization_voided, order_ready_to_process, order_ready_to_ship have been added. + +### v2.5.8 (2018-10-17) +* * * + +* The attributes pricing_model and tiers has been added in Addon , Plan and UnbilledCharge resources. +* The attribute price is made optional in Plan and Addon resource. +* The input parameters pricing_model, tier_starting_unit, tier_ending_unit and tier_price have been added in Create addon , Update addon , Create Plan and Update Plan APIs. +* The attributes line_item_tiers would be added in creditNote , Invoice , InvoiceEstimate and CreditNoteEstimate resources. +* The attribute pricing_model have been added to line_tem sub-resource of CreditNote , Invoice , InvoiceEstimate and CreditNoteEstimate resources. +* The input parameter line_item_amount has been added in Create credit note API. +* The input parameters line_item_unit_amount and line_item_quantity have been changed to optional parameters in Create Credit Note API. +* The input parameter line_item_id, line_item_tier_line_item_id, line_item_tier_starting_unit, line_item_tier_ending_unit, line_item_tier_quantity_used, line_item_tier_unit_amount have been added in Import invoice API. +* The attribute amount has been added to Addon subResource attributes of Subscription API. +* The attribute plan_amount has been added to Subscription API. +* The type pricing_model with values flat_fee, per_unit, tiered, volume and stairstep have been added. +* The values tiered, volume and stairstep have been added the attribute type of Addon resource. +* The values tiered, volume and stairstep have been added to the attribute charge_model of Plan resource. +* The input parameter type has been deprecated in Create Addon and Update Addon APIs. +* The input parameter charge_model has been deprecated in Create Plan and Update Plan APIs. +* The filter parameter type has been deprecated in List Addon API. +* The filter parameter charge_model has been deprecated in List Plan API. +* The filter parameter pricing_model has been added to List Plan and List Addon APIs. + +### v2.5.7 (2018-10-03) +* * * + +* The attributes `is_shippable`, `shipping_frequency_period` and`shipping_frequency_period_unit` has been added in Plan and Addon resource. +* The input parameters `is_shippable`, `shipping_frequency_period` and`shipping_frequency_period_unit` has been added in Create plan , Update plan , Create addonand Update addon APIs. +* The attributes `vat_number_validated_time`, `vat_number_status` and `is_location_valid`has been added in Customer resource. +* The event types `order_created`, `order_updated`, `order_cancelled`, `order_delivered`and `order_returned` has been added. +* New order status `queued`, `awaiting_shipment`, `on_hold`, `delivered`, `shipped`,`partially_delivered` and `returned` has been added. +* New endpoints Export plans , Export addons , Export coupons , Export customers , Export subscriptions , Export invoices , Export creditnotes and Export transactions has been added to Exportst API. +* The input parameter `subscription_affiliate_token` has been added to Checkout New Hosted Pages API. +* The attributes `document_number` and `order_type` has been added to Invoice resource. +* The attributes `document_number`, `customer_id`, `subscription_id`,`cancellation_reason`, `payment_status`, `order_type`, `price_type`, `order_date`,`shipping_date`, `shipment_carrier`, `invoice_round_off_amount`, `tax`, `amount_paid`,`amount_adjusted`, `refundable_credits_issued`, `refundable_credits`,`rounding_adjustement`, `paid_on`, `shipping_cut_off_date`, `delivered_at`,`shipped_at`, `resource_verison`, `updated_at`, `cancelled_at`, `order_line_items`,`shipping_address`, `billing_address`, `discount`, `sub_total`, `total`,`line_item_taxes`, `line_item_discounts`, `linked_credit_notes`, `deleted` and`currency_code` has been added in Order resource. +* The input parameters `shipping_date`, `order_date`, `cancelled_at`,`cancellation_reason`, `shipped_at`, `delivered_at`, `shipment_carrier`,`shipping_address`, `order_line_item` has been added in Update order API. +* The filters `include_deleted`, `shipping_date`, `order_date`, `paid_on` and `updated_at` has been added in List Orders API. +* New endpoints Assign order number , Cancel an order , Create a refundable credit note and Reopen a cancelled order has been added to Orders API. + +### v2.5.6 (2018-09-12) +* * * + +* The attributes addon_applicability, applicable_addons, attached_addons and event_based_addons has been added to Plan resource. +* The input parameters addon_applicability, applicable_addons, attached_addons and event_based_addons has been added in Create and Update plan APIs. +* The attributes event_based_addons and charged_event_based_addons has been added to Subscription resource. +* The input parameters mandatory_addons_to_remove, event_based_addons and charged_event_based_addons has been added in Create subscription, Create subscription for customer, Update subscription, Create subscription estimate, create subscription for customer estimate, update subscription estimate, checkout new subscription and checkout existing subscription APIs. + +### v2.5.5 (2018-08-17) +* * * + +* New endpoint 'Clear Personal Data of a customer' has been added to Customer resource. +* New endpoint 'Merge customers' has been added to Customer resource. +* New endpoint 'Extend subscription' has been added to Hosted page resource. +* The input parameter 'charges_handling' has been added to Resume a subscription and Resume a subscription estimate APIs. +* The input parameters 'pause_date' and 'resume_date' has been added to Import subscription and Import subscription for customer APIs. +* New tax_exempt_reason 'high_value_physical_goods' has been be added. + +### v2.5.4 (2018-06-21) +* * * + +* New attribute round_off_amount is added in Credit Note Estimate, Invoice Estimate Object +* Sort List Invoice API results based on invoice updated_at attribute. +* Create Customer and Create Subscription additionally take bank account details as input parameter. +* New API end point in Hosted Page resource to retrieve direct debit agreement payment PDF +* New Enum AccountHolderType, AccountType, Echeck Type has been added in Payment Source +* New attribute echeck, account_holder_type, last4 has been added +* New API end points create bank account payment source and verify bank account payment source has been added + + +### v2.5.3 (2018-05-23) +* * * + +* New Resource [Export](https://apidocs.chargebee.com/docs/api/exports) has been added +* New payment gateway bluesnap has been added + +### v2.5.2 (2018-05-14) +* * * + +New endpoint 'List contacts for a customer' has been added to Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#list_of_contacts_for_a_customer + +### v2.5.1 (2018-05-03) +* * * + +New endpoint 'Update a coupon' has been added. +See : https://apidocs.chargebee.com/docs/api/coupons#update_a_coupon + +### v2.5.0 (2018-04-27) +* * * + +New resource 'Virtual Bank Account' has been added. +See : https://apidocs.chargebee.com/docs/api/virtual_bank_accounts + +New event types virtual_bank_account_added, virtual_bank_account_updated and virtual_bank_account_deleted has been added. +See : https://apidocs.chargebee.com/docs/api/events#event_types + +The payment method ach_credit has been added. +See : https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + + +### v2.4.9 (2018-03-29) +* * * + +New status 'Pause' has been added to subscription. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_status + +The attribues 'pause_date' and 'resume_date' have been added to subscription and estimate resources. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The input params 'create_current_term_invoice', transaction amount, payment method, reference number and date have been added to Import a subscription and Import subscription for customer APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#import_a_subscription + +The attribute 'expected_payment_date' has been added to Invoice attributes. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The reason code 'subscription_pause' has been added to Credit note attributes. +See : https://apidocs.chargebee.com/docs/api/credit_notes#credit_note_reason_code + +New event types subscription_paused, subscription_pause_scheduled, subscription_scheduled_pause_removed, subscription_resumed, subscription_resumption_scheduled and subscription_scheduled_resumption_removed have been added. +See : https://apidocs.chargebee.com/docs/api/events#event_types + +New endpoints 'Pause a subscription', 'Resume a subscription', 'Remove scheduled pause' and 'Remove scheduled resumption' have been added to Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions + +New endpoints 'Pause subscription estimate' and 'Resume subscription estimate' have been added to Estimate resource. +See : https://apidocs.chargebee.com/docs/api/estimates + +### v2.4.8 (2018-03-20) +* * * + +New attribute 'deleted' has been added to Payment source resource. +See : https://apidocs.chargebee.com/docs/api/payment_sources#payment_source_attributes + +### v2.4.7 (2018-03-08) +* * * + +The input parameter disposition_type has been added to 'Retrieve Invoice as PDF' and 'Retrieve Credit Note as PDF' APIs. +See : https://apidocs.chargebee.com/docs/api/invoices#retrieve_invoice_as_pdf + +### v2.4.6 (2018-03-02) +* * * + +The attribute 'balance_currency_code' has been deprecated and attribute 'currency_code' has been added to Balances sub-resource in Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attribute done_by has been added to Promotional credits resource. +See : https://apidocs.chargebee.com/docs/api/promotional_credits + +New payment method wechat_pay has been added. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The endpoint Manage Payment Sources has been undeprecated in Hosted pages resource. +See : https://apidocs.chargebee.com/docs/api/hosted_pages + +### v2.4.5 (2018-02-01) +* * * + +The attribute 'round_off_amount' have been added in Invoice an Credit note resources. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The attribute 'settled_at' has been added to transaction resource. +See : https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + +'Collect now' API in Hosted pages resource has been undeprecated. +See : https://apidocs.chargebee.com/docs/api/hosted_pages#collect_now + +### v2.4.4 (2018-01-12) +* New endpoint "Update invoice details" has been added to Invoice resource. + +### v2.4.3 (2017-11-27) +* * * + +** API changes **: +* The new resource [Promotional Credits](http://apidocs.chargebee.com/docs/api/promotional_credits) has been added + +* The new sub resource [balances](https://apidocs.chargebee.com/docs/api/customers#customer_balances) has been added + +* The API end point add_promotional_credits, deduct_promotional_credits and set_promotional_credits has been deprecated in customer resource + +** Events added**: +* New Event Type promotional_credits_added and promotional_credits_deducted has been added + +### v2.4.2 (2017-11-13) +* * * + +** API changes**: +* The new resource [Coupon Set](https://apidocs.chargebee.com/docs/api/coupon_sets) has been added + +* The API end point create a coupon code for a coupon has been deprecated in coupon code resource + +* The attribute [coupon_set_id](https://apidocs.chargebee.com/docs/api/coupon_codes#coupon_code_coupon_set_id) has been added to Coupon Code resource + +* The deprecation has been removed for [Collect payment for customer](https://apidocs.chargebee.com/docs/api/customers#collect_payment_for_customer) in customer resource + +* New end point Manage payment source and Collect now has been added as deprecated API to hosted page. Please mail us at support@chargebee.com to enable + +** Attributes added**: +* New attribute [remaining_billing_cycles](https://apidocs.chargebee.com/docs/api/subscriptions#subscription_addons_remaining_billing_cycles) has been added in addons under subscription resource. + + +** Events added**: +* New event type coupon_set_created, coupon_set_updated, coupon_set_deleted, coupon_codes_added, coupon_codes_updated, coupon_codes_deleted + + +### v2.4.1 (2017-09-22) +* * * + +** APIs added**: + +New endpoint 'Collect payment for a customer' has been added as a restricted and deprecated API. + +** APIs updated**: + +The attribute 'amount_to_collect' would be added to Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +### v2.4.0 (2017-09-15) +* * * + +** APIs updated**: + +The attribute payment_source_id would be added to the transaction resource. +See : https://apidocs.chargebee.com/docs/api/transactions#transaction_payment_source_id + +The filter parameter payment_source_id would be added in List transactions API. +See : https://apidocs.chargebee.com/docs/api/transactions#list_transactions + +The gateway types amazon_payments and paypal_express_checkout would be added. +See : https://apidocs.chargebee.com/docs/api/customers#customer_payment_method_gateway + +### v2.3.9 (2017-09-14) +* * * + +** APIs updated**: + +The attribute registered_for_gst has been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The parameter registered_for_gst has been added in Create a customer , Update billing info for a customer , Create subscription estimate , Update subscription estimate , Create a subscription and Update a subscription APIs. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +### v2.3.8 (2017-09-06) +* * * + +** APIs added**: + +The new endpoint Record refund for a credit note has been added to Credit note resource. +See : https://apidocs.chargebee.com/docs/api/credit_notes#record_refund_for_a_credit_note + +** APIs updated**: + +The parameter tmp_token has been deprecated in card subresource in Create a customer , Create a subscription , Update a subscription and Import subscription APIs. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +The parameter tmp_token has been added to payment method subresource in Create a subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription + +The type apple_pay has been added to payment method types. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer_payment_method_type + +### v2.3.7 (2017-08-31) +* * * + +** APIs added**: + +The parameters credit_option_for_current_term_charges, unbilled_charges_option,refundable_credits_handling and account_receivables_handling would be added inCancel subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#cancel_a_subscription + +A new endpoint Cancel subscription estimate would be added to the Estimate resource. +See : https://apidocs.chargebee.com/docs/api/estimates#cancel_subscription_estimate + +The attribute deleted would be added to the Unbilled charge resource. +See : https://apidocs.chargebee.com/docs/api/unbilled_charges#unbilled_charge_attributes + +The parameter include_deleted would be added in List Unbilled Charges API. +See : https://apidocs.chargebee.com/docs/api/unbilled_charges#list_unbilled_charges + + +### v2.3.6 (2017-08-28) +* * * + +** APIs added**: + +The endpoints Void a credit note and Delete a credit note would be added to the Credit notes resource. +See : https://apidocs.chargebee.com/docs/api/credit_notes + +The endpoints Apply payments for an invoice, Apply credits for an invoice, Remove payment from an invoice and Remove credit note from an invoice would be added to the Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices + +### v2.3.5 (2017-08-16) +* * * + +** APIs added**: + +A new endpoint 'Update a card payment source' would be added to the Payment source resource. +See : https://apidocs.chargebee.com/docs/api/payment_sources#update_a_card_payment_source + +### v2.3.4 (2017-08-03) +* * * + +** APIs updated**: + +The attribute trial_end has been added to Subscriptions Addon subresource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_addons_trial_end + +The parameter trial_end would be added to Addon subresource in Create a subscription,Create subcription for customer, Update a subcription, Create subscription estimate, Create subscription for customer estimate and Update subscription estimate APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription_addons_trial_end + +### v2.3.3 (2017-07-26) +* * * + +** APIs added**: + +The new resource 'Time Machine' has been added. + +### v2.3.2 (2017-07-21) +* * * + +** APIs added**: + +The new endpoint 'Change Billing Date' has been added to Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#change_billing_date + +The new endpoints 'Upcoming invoices estimate' and 'Subscription change term end estimate' have been added to Estimate API. +See : https://apidocs.chargebee.com/docs/api/estimates#upcoming_invoices_estimate + +** APIs updated**: + +The attributes 'billing_date', 'billing_date_mode', 'billing_day_of_week', 'billing_day_of_week_mode', 'unbilled_charges' have been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The event types 'unbilled_charges_created', 'unbilled_charges_voided', 'unbilled_charges_deleted' and 'unbilled_charges_invoiced' have been added. +See : https://apidocs.chargebee.com/docs/api/events#event_types + +The parameter 'billing_alignment_mode' has been added to Create a subscription, Create a subscription for customer, Update a customer, Reactivate a subscription, Create subscription estimate, Create subscription for customer estimate, Update a subscription estimate, Checkout new subscription and Checkout existing subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription + +The parameters 'line_item_date_from' and 'line_item_date_to' have been added to Add Charge API. +See : https://apidocs.chargebee.com/docs/api/invoices#add_charge_item_to_pending_invoice + +The parameters 'prorate' and 'invoice_immediately' have been added Change term end API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#change_term_end + +### v2.3.1 (2017-07-06) +* * * + +** APIs updated**: + +The parameter "status" has been added to the Create a plan, Create an addon and Create a coupon APIs. +See : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +The attribute "issuing_country" has been added to the Card and Payment source resource. +See : https://apidocs.chargebee.com/docs/api/payment_sources#payment_source_attributes + +The reason code "fraudulent" has been added to the Credit note resource. +See : https://apidocs.chargebee.com/docs/api/credit_notes#credit_note_reason_code + +The attribute "bank_name" is made optional in Bank Account subresource. +See : https://apidocs.chargebee.com/docs/api/payment_sources#payment_source_bank_account_bank_name + +The parameter "redirect_url" has been made optional in Create a portal session API. +See : https://apidocs.chargebee.com/docs/api/portal_sessions#create_a_portal_session + +The attributes "fraud_flag" and "fraud_reason" have been added to the Transaction resource. +See : https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + + +### v2.3.0 (2017-06-01) +* * * + +The endpoint Invoice Now Estimate has been added to the Unbilled Charge resource. +See : https://apidocs.chargebee.com/docs/api/customers#assign_payment_role + +** APIs updated**: + +The filter param "phone" has been added to the List Customer API. +See : https://apidocs.chargebee.com/docs/api/customers#list_customers + +The subresource "invoice_estimates" has been added to the Estimate resource. +See : https://apidocs.chargebee.com/docs/api/estimates#invoice_estimate_attributes + +### v2.2.9 (2017-05-04) +* * * + +** APIs added**: +The new resources Payment Source has been added. +See: https://apidocs.chargebee.com/docs/api/payment_sources + +The new resources Unbilled Charge has been added. +See : https://apidocs.chargebee.com/docs/api/unbilled_charges + +The endpoint Assign payment role has been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#assign_payment_role + +The endpoint Override Billing Profile has been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#override_billing_profile + + +** APIs updated**: +The attribute payment_source_id has been added to the Card resource. +See : https://apidocs.chargebee.com/docs/api/cards#card_attributes + +The attribute subscription_id has been added to the lineitems subresource in Invoice , Credit Note , Invoice estimate , Next invoice estimate and Credit Note estimate . +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The attributes consolidated_invoicing, primary_payment_source_id, backup_payment_source_id and the subresource list referral_urls have been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attributes payment_source_id and auto_collection have been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The subresource unbilled_charge_estimates has been added to the Estimate resource. +See : https://apidocs.chargebee.com/docs/api/estimates#unbilled_charge_estimate_attributes + +The param consolidated_invoicing has been added to Create a customer and Update a customer APIs. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +The input params auto_collection, invoice_immediately and consolidated_invoicing have been added to Create subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription + +The input params auto_collection, payment_source_id and invoice_immediately have been added to Create subscription for customer API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_subscription_for_customer + +The input params credit_type and reference have been added to Add promotional credits for a customer , Deduct promotional credits for a customer and Set promotional credits for a customer APIs. +See : https://apidocs.chargebee.com/docs/api/customers#add_promotional_credits_to_a_customer + +The input param invoice_immediately has been added to the Update a subscription , Reactivate subscription , Create subscription estimate , Create subscription for customer estimate and Update subscription estimate APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#update_a_subscription + +The input param auto_collection has been added to the Subscription subresource and consolidated_invoicing have been added to the Customer subresource in Checkout new subscription API. +See : https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_new_subscription + +The input param payment_source_id has been added to Import a subscription , Create an invoice , Create invoice for charge , Create invoice for addon and Collect payment for an invoice APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#import_a_subscription + +The event types payment_source_added, payment_source_updated and payment_source_deleted have been added. +See : https://apidocs.chargebee.com/docs/api/events#event_types + +### v2.2.8 (2017-04-19) +* * * + +** APIs added**: +The endpoints 'List' and 'Acknowledge' APIs have been added to the Hosted page resource. +See : https://apidocs.chargebee.com/docs/api/hosted_pages + +** APIs updated**: +A new subresource 'line_item_discounts' has been added to the Invoice, Credit note, Invoice estimates and Credit note estimates resources. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The Card statuses 'pending_verification' and 'invalid' have been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The Payment Method types 'generic', 'alipay' and 'unionpay' have been added to the Payment Method type in the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The state 'failed' and the attribute 'failure_reason' have been deprecated in the Hosted Page resource. + +The attribues 'updated_at', 'resource_version' and 'checkout_info' have been added. +See : https://apidocs.chargebee.com/docs/api/hosted_pages#hosted_page_attributes + +A new gateway 'adyen' has been added. +See : https://apidocs.chargebee.com/docs/api/cards#card_attributes + +### v2.2.7 (2017-03-16) +* * * + +** APIs updated**: +The input parameter 'id' have been removed in Update a Plan and Update an addon resources. +See: https://apidocs.chargebee.com/docs/api/plans#update_a_plan + +The input parameter 'terms_to_charge' have been added in Create a subscription,Create subscription for a customer, Create subscription estimate, create subscription for customer estimate, Reactivate a subscription and Checkout new hosted pages APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_subscription_for_customer + +The filter input parameter 'next_billing_at' have been added in List Subscriptions API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#list_subscriptions + +The input parameter 'force_term_reset' have been added to Checkout existing hosted pages API. +See : https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_existing_subscription + +A new attribute 'has_advance_charges' have been added to the Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + + +### v2.2.6 (2017-02-24) +* * * + +** APIs added**: +New resources 'Site Migration Details' and 'Resource Migrations' have been added. +See : https://apidocs.chargebee.com/docs/api/site_migration_details + +A new endpoint 'Move a customer' has been added. +See : https://apidocs.chargebee.com/docs/api/customers#move_a_customer + +** APIs updated**: +The attributes 'id' and 'for_site_merging' have been added to Copy an addon, Copy a coupon and Copy a plan API. +See : https://apidocs.chargebee.com/docs/api/plans#copy_a_plan + +The event types 'customer_moved_out' and 'customer_moved_in' have been added. +See : https://apidocs.chargebee.com/docs/api/events#event_types + +The input parameters 'ignore_scheduled_cancellation' and 'ignore_scheduled_changes' have been added to the Subscription renewal estimate API. +See : https://apidocs.chargebee.com/docs/api/estimates#subscription_renewal_estimate + + +### v2.2.5 (2017-01-30) +* * * + +** APIs updated**: +A new reason code 'Subscription cancellation' has been added to the Credit note resource. +See : https://apidocs.chargebee.com/docs/api/credit_notes#credit_note_attributes + +A attribute 'has_advance_charges' has been added to the Invoice resource and the input filter parameter 'has_advance_charges' has been added to List Invoice API. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +A new attribute 'next_billing_at' has been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The input parameters 'terms_to_charge', 'reactivate', 'reactivate_from' have been added to Update a Subscription, Update a subscription estimate and Checkout existing hosted page APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#update_a_subscription + +The input parameter 'reactivate_from' has been added to Reactivate a subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#reactivate_a_subscription + +** APIs added**: +A new endpoint 'Charge Future Renewals' has been added to the Subscription API. +https://apidocs.chargebee.com/docs/api/subscriptions#charge_future_renewals + +### v2.2.4 (2017-01-27) +* * * + +** APIs updated**: +A new attribute 'gateway_account_id' has been added to Card resource. A input param 'gateway' has been deprecated and a new input param 'gateway_account_id' has been added from Update card for customer, Switch gateway and Copy card APIs. +See: https://apidocs.chargebee.com/docs/api/cards + + A input param 'gateway' has been deprecated and a new input param 'gateway_account_id' has been added to Card and Payment method sub resource in Create customer, Create subscription, Update Subscription and Import subscription API. + See: https://apidocs.chargebee.com/docs/api/customers + +A input param 'fraud_flag' has been added to Update customer API. +See: https://apidocs.chargebee.com/docs/api/customers#update_a_customer + +A input param 'gateway' has been deprecated and a new input param 'gateway_account_id' has been added to Payment method sub resource in Update card for a customer API. +See: https://apidocs.chargebee.com/docs/api/cards#update_card_for_a_customer + +A input param 'gateway' has been deprecated and a new input param 'gateway_account_id' has been added to the Card resource in Checkout new, Checkout existing and Update card and Update Payment method APIs. +See: https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_new_subscription + +A new input params 'billing_address' and 'shipping_address' has been added to Checkout new hosted page API. +See: https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_new_subscription + +** APIs added**: +A new endpoint Create subscription for a customer estimate has been added to the Estimate resource. +See: https://apidocs.chargebee.com/docs/api/estimates#create_subscription_for_a_customer_estimate + +### v2.2.3 (2017-01-12) +* * * + +** APIs added**: +A new endpoint, Unarchive a plan has been added to the Plan resource. +See: https://apidocs.chargebee.com/docs/api/plans#unarchive_a_plan + +A new endpoint, Unarchive an addon has been added to the Addon resource. +See : https://apidocs.chargebee.com/docs/api/addons#unarchive_an_addon + +A new endpoint, Unarchive a coupon has been added to the Coupon resource. +See : https://apidocs.chargebee.com/docs/api/coupons#unarchive_a_coupon + + +### v2.2.2 (2016-12-30) +* * * + +** APIs updated**: + +The attributes 'plan_unit_price', 'setup_fee', 'billing_period', 'billing_period_unit' and 'plan_free_quantity' has been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The input parameters 'plan_unit_price', 'setup_fee' and Addon 'unit_price' has been added to Create a subscription, Create subscription for customer, Update a subscription, Create a subscription estimate, Update a subscription estimate, Checkout a new subscription and Checkout existing subscription, Import a subscription and Import subscription for customer APIs. +See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription + +An input parameter Addon 'unit_price' has been added to Charge addon at term end, Create an Invoice, Create invoice for addon and Add addon item to pending invoice APIs. +See : https://apidocs.chargebee.com/docs/api/invoices#create_an_invoice + +An attribute 'tax_exempt_reason' has been added to line items sub resource in Invoice, Credit Note and Estimate resources. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +### v2.2.1 (2016-12-09) +* * * + +** APIs updated**: +A new attribute, 'locale' has been added to the Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +A new parameter, 'locale' has been to Create a customer, Update a customer, Checkout new hosted page, Create a subscription and Import a subscription APIs. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +The attributes 'mrr', 'exchange_rate' and 'base_currency_code' have been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +A new filter parameter 'cancelled_at' has been added to List Subscription API. +See : https://apidocs.chargebee.com/docs/api/subscriptions#list_subscriptions + +The attribute 'voided_at' has been added to the Invoice and the Credit Note resource and 'voided_at' filter has been added to List invoices and List credit notes APIs. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The attributes 'sku', 'accounting_code', 'accounting_category1' and 'accounting_category2' have been added to the Plan and the Addon resource. +See : https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +The input parameters 'sku', 'accounting_code', 'accounting_category1' and 'accounting_category2' have been added to Create a plan, Update a plan, Create an addon and Update an addon APIs. +See : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +The input parameters 'transaction_id_at_gateway', 'transaction_status', 'transaction_error_code' and 'transaction_error_text' have been added to Record payment for an invoice API. +See : https://apidocs.chargebee.com/docs/api/invoices#record_an_invoice_payment + +### v2.2.0 (2016-11-24) +* * * + +** APIs updated**: +A new attribute, 'funding_type' has been added to Card resource. +See : https://apidocs.chargebee.com/docs/api/cards#card_attributes + +** APIs added**: +A new endpoint, List coupon codes API has been added to Coupon Code resource. +See : https://apidocs.chargebee.com/docs/api/coupon_codes#list_coupon_codes + +A new endpoint, Copy a plan API has been added to Plan resource. +See : https://apidocs.chargebee.com/docs/api/plans#copy_a_plan + +A new endpoint, Copy an addon API has been added to Addon resource. +See : https://apidocs.chargebee.com/docs/api/addons#copy_an_addon + +A new endpoint, Copy a coupon API has been added to Coupon resource. +See : https://apidocs.chargebee.com/docs/api/coupons#copy_a_coupon + +A new endpoint, Import a subscription API has been added to Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#import_a_subscription + +A new endpoint, Import Subscription for customer API has been added to Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#import_subscription_for_customer + +A new endpoint, Import invoice API has been added to Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices#import_invoice + + + +### v2.1.9 (2016-11-18) +* * * + +** APIs updated**: +A new attribute, 'tax_profile_id' has been added to Addon and Plan resource. +See : https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +The new input parameter 'tax_profile_id' has been added in Create and Update Addon and Plan APIs. +See : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +The new cancel reason type 'non_compliant_customer' has been added to the Subscription resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + + +### v2.1.8 (2016-11-09) +* * * + +** APIs updated**: +The attributes "updated_at" and "resource_version" is added to Plan, Addon and Coupon resource. +See : https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +Following [Event types](https://apidocs.chargebee.com/docs/api/events#event_types) are added +* *plan_created* +* *plan_updated* +* *plan_deleted* +* *addon_created* +* *addon_updated* +* *addon_deleted* +* *coupon_created* +* *coupon_updated* +* *coupon_deleted* +* *netd_payment_due_reminder* + +The new Invoice status "posted" is added. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The attribute "net_term_days" is added to Customer resource and new input parameter "net_term_days" is added to Create Customer and Update Customer API. See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The input parameter "net_term_days" is added to Create a Subscription API. See : https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription + +The attributes "net_term_days" and "due_date" is added to the Invoice resource. See : https://apidocs.chargebee.com/docs/api/invoices + + +### v2.1.7 (2016-10-27) +* * * + +** APIs updated**: + +The attribute "preferred_currency_code" is added to Customer and a new input parameter "preferred_currency_code" is added Create Customer and Update Customer API. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +### v2.1.6 (2016-09-30) +* * * + +** APIs updated**: +The new attributes "updated_at", "resource_version" and "deleted" is returned as part of Customer, Subscription, Invoice, Credit Note and Transaction resources. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The new parameter "include_deleted" is added to Customer, Subscription, Invoice, Credit Note and Transaction List API. +See : https://apidocs.chargebee.com/docs/api/customers#list_customers + +The new parameter "date" is added to Create Credit Note API. +See : https://apidocs.chargebee.com/docs/api/credit_notes#create_credit_note + +### v2.1.5 (2016-09-03) +* * * +** APIs added**: +A new endpoint to create Credit Note is added. See : https://apidocs.chargebee.com/docs/api/credit_notes#create_credit_note + +A new endpoint to write off Invoice is added. See : https://apidocs.chargebee.com/docs/api/invoices#write_off_an_invoice + +** APIs updated**: +The attribute "forward_url" is given as input for Create a Portal Session API. +See : https://apidocs.chargebee.com/docs/api/portal_sessions#create_a_portal_session + +### v2.1.4 (2016-08-25) +* * * + +** APIs updated**: +The attribute "validation_status" is added to address. +See : https://apidocs.chargebee.com/docs/api/addresses#address_attributes + +The attribute "validation_status" is added to Customer billing address and the attribute "fraud_flag" is now returned Customer in case of any fraudulent transactions. The API's Create Customer, Update Billing Info for a Customer now take in "validation_status" for address objects. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attribute "validation_status" is added to Subscription shipping address. The API's Create Subscription, Create Subscription for Customer, Update Subscription now take in "validation_status" for address objects. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The attribute "validation_status" is returned as part of Invoice billing and shipping address. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The sub resource "shipping_address" is now returned as part of Subscription Estimate in Estimate APIs. +See : https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +The attribute "created_from_ip", "card_ip_address" is deprecated from Customer and Subscription resource. +See: https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attribute "tmp_token" is added to Payment Method subresource that can be used in Create and Update Payment Method for a Customer API for direct_debit type through Stripe gateway. +See : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +The status "pending_verification" added to Payment Method status. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + + +### v2.1.3 (2016-08-02) +* * * +** APIs added**: +A new endpoint to retrieve Credit Note as PDF. See : https://apidocs.chargebee.com/docs/api/credit_notes#retrieve_credit_note_as_pdf + +** APIs updated**: +The attribute "invoice notes" is added to subscription in Hosted Pages Checkout New and Checkout Existing API's. +See : https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_new_subscription + +The filter parameter "paid_at" is added to list invoices and "paid_on_after" is deprecated. See : https://apidocs.chargebee.com/docs/api/invoices#list_invoices + +The filter parameter "occurred_at", "webhook_status", "event_type" is added to list events and parameter "start_time", "end_time", "webhook_status", "event_type" is deprecated. See : https://apidocs.chargebee.com/docs/api/events#list_events + +### v2.1.2 (2016-07-18) +* * * +** APIs added**: +A new endpoint to remove coupons associated with the subscription is added. See : https://apidocs.chargebee.com/docs/api/subscriptions#remove_coupons +A new endpoint to record excess payments for a customer is added. See : https://apidocs.chargebee.com/docs/api/customers#record_an_excess_payment_for_a_customer + +### v2.1.1 (2016-07-06) +* * * +** APIs added**: +A new endpoint to delete a coupon added. See : https://apidocs.chargebee.com/docs/api/coupons#delete_a_coupon + +### v2.1.0 (2016-07-04) +* * * +** APIs updated**: +The attribute "currency_code" is added as part of Plans, Addons, Coupons, Subscription, Transaction and Estimate resource. +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +The API's Set promotional credits for a customer, Add promotional credits to a customer and Deduct promotional credits for a customer takes in "currency_code" as input. +See : https://apidocs.chargebee.com/docs/api/customers#set_promotional_credits_for_a_customer + +### v2.0.9 (2016-06-27) +* * * + +** APIs updated**: +New resource "third_party_payment_method" is returned on performing copy card for a customer API. +See : https://apidocs.chargebee.com/docs/api/cards#copy_card + +### v2.0.8 (2016-06-16) +* * * + +** APIs updated**: +New subresource "next_invoice_estimate" is returned as part of Estimate resource. +See : https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +### v2.0.7 (2016-05-25) +* * * + +Fixed indentation issue in request file. + +### v2.0.6 (2016-05-24) +* * * + +** APIs updated**: + +New attribute "currency_code" is returned as part of Credit Note resource. +See: https://apidocs.chargebee.com/docs/api/credit_notes#credit_note_attributes + +The new Gateway type "wepay" for card resource is added. See subscription attributes +See : https://apidocs.chargebee.com/docs/api/cards#card_attributes + +### v2.0.5 (2016-05-20) +* * * + +Fixed indentation issue in request file. + +### v2.0.4 (2016-05-20) +* * * + +#### Filtering Resources using List API + +Chargebee supports bulk fetching of resources via 'List' API methods. (List invoices, List subscriptions etc..). In the List methods, filtering of resources can be performed using filter parameters. Also in the List methods, the sort_by parameter is provided for sorting the result in the desired order. +See : https://apidocs.chargebee.com/docs/api#pagination_and_filtering + +** APIs deprecated**: + +The Following API's are deprecated since these operations can be achieved through List API's +* List Subscriptions for a Customer +* List Invoices for a Customer +* List Invoices for a Subscription +* List Credit Note for a Customer +* List Credit Note for a Subscription +* List Transactions for a Customer +* List Transations for a Subscription + +** APIs added**: + +Support to copy card to gateway for a customer. New api endpoint to copy card for a customer is added to Card resources. +See: https://apidocs.chargebee.com/docs/api/cards#copy_card + +** APIs updated**: + +New attribute "id" is returned as part of Line Items subresource of Invoice and Credit Note resource. +See: https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +New attribute "name" is returned as part of Taxes subresource of Invoice and Credit Note resource. +See: https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + + +A new sub-resource "line_item_taxes" is returned as part of the Invoice and Credit Note resource attributes. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + + + +### v2.0.3 (2016-05-02) +* * * +** APIs added**: + +Support to archive a coupon code. See archive Coupon code API here: https://apidocs.chargebee.com/docs/api/coupon_codes#archive_a_coupon_code + +** APIs updated**: + +The attribute for "status" is returned as part of Coupon Code resource. See : https://apidocs.chargebee.com/docs/api/coupon_codes#coupon_code_attributes + +### v2.0.2 (2016-04-29) +* * * + +** APIs updated** + +Support to specify Avalara "tax_code" attribute in Plan and Addon resource. Now, create and update plan, create & update addon accept "tax_code" parameter. See create plan API here : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +Support to specify the exemption category or exempt number for a customer by adding "entity_code" or "exempt_number" in customer resource. You can pass "entity_code" and "exempt_number" in create, update customer, create subscription and create subscription estimate APIs. See create customer API here : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +The attribute "entity_code" or "exempt_number" is returned as part of Customer resource for Avalara. +See: https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attribute "tax_code" is returned as part of Plan & Addon resources for Avalara. +See : https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +Support for address parameters in estimate APIs that is used to calculate tax. Now, create & update subscription estimate APIs accept line1, line2, line3 and city. See : https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +The new Cancel reason type "tax_calculation_failed" for subscription resource is added. See subscription attributes +See : https://apidocs.chargebee.com/docs/api/subscriptions#subscription_attributes + +** APIs deprecated**: + +The attribute "taxability" for customer has been deprecated in the Update Subscription Estimate API. + +### v2.0.1 (2016-04-16) +* * * + +#### Issue Fixed + +KeyError for "credit_note_estimates" under Estimate resource is fixed. Now, retrieveing Estimate from Result object does not throw exception. + +### v2.0.0 (2016-04-11) +* * * + +#### Attributes and Operations Removed/Renamed in V2 +Chargebee [API V2](https://apidocs.chargebee.com/docs/api#versions) is now live! All our future developments will happen in V2. + +V2 has been released to accommodate certain backwards-incompatible changes. Refer our [API V2 Upgradation guide](https://apidocs.chargebee.com/docs/api/v1#api-v2-upgradation-guide) for the complete listing of the attributes and operations that have been removed/renamed in API V2. + +#### Incremental Changes in V2 + +* *api_version* attribute is added to [Event](https://apidocs.chargebee.com/docs/api/events) resource. More details [here](#v1176-2016-04-06). +* Credit Notes resource is introduced. More details here: https://apidocs.chargebee.com/docs/api/credit_notes +* Operations [Update Subscription](https://apidocs.chargebee.com/docs/api/subscriptions#update_a_subscription) and [Update Subscription Estimate](https://apidocs.chargebee.com/docs/api/estimates#update_subscription_estimate) additionally returns list of Credit Notes now (if applicable). +* Operations [Refund an Invoice](https://apidocs.chargebee.com/docs/api/invoices#refund_an_invoice) and [Record Refund for an Invoice](https://apidocs.chargebee.com/docs/api/invoices#record_refund_for_an_invoice) additionally returns a Credit Note if the operation succeeds. Besides, following *input params* are added to these operations - *credit_note[reason_code]* and *customer_notes*. +* Following attributes are added to [invoice](https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes) resource + * *write_off_amount* + * *applied_credits[]* - the Refundable Credits applied to this invoice. + * *adjustment_credit_notes[]* - The Adjustment Credit Notes created for this invoice. + * *issued_credit_notes[]* - The Refundable Credit Notes created against this invoice. +* For 'Refund' type [transaction](https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes), *linked_credit_notes[]* will be returned. +* Following [Event types](https://apidocs.chargebee.com/docs/api/events#event_types) are added + * *credit_note_created* + * *credit_note_updated* + * *credit_note_deleted* +* Following attributes are added to [line_items[]](https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes) sub-resource: + * *discount_amount* - the total discount amount (both item-level and document-level discounts) of this line. + * *item_level_discount_amount* - only the item-level-discount amount component. +* Further [discounts[].entity_type](https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes) will have two types for coupon - *item_level_coupon* and *document_level_coupon*. +* Input Param *use_existing_balances* is added to the operations - [Update Subscription Estimate](https://apidocs.chargebee.com/docs/api/estimates#update_subscription_estimate) and [Subscription Renewal Estimate](https://apidocs.chargebee.com/docs/api/estimates#subscription_renewal_estimate) +* The API's *checkout_onetime_addons* and *checkout_onetime_charge* in Hosted Page resource are removed in V2. + + +### v1.6.3 (2016-04-06) +* * * + +*api_version* attribute is added to the Event resource. + +Chargebee supports multiple [API versions](https://apidocs.chargebee.com/docs/api#versions) now. The *api_version* attribute indicates the API version based on which the event content is structured. More details here: +https://apidocs.chargebee.com/docs/api/events + +### v1.6.2 (2016-03-22) +* * * + +** APIs updated**: + +Support to specify additional information as "meta_data" in json format for Customer, Subscription, Plan, Addon & Coupon resources. +Now, create & update customer, subscription, create subscription for customer, create & update plan, addon and create coupon APIs accept the "meta_data"" parameter in json format. See create customer API here : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +New attribute for "meta_data" is returned as part of Customer, Subscription, Plan, Addon and Coupon resources. See customer attributes here: https://apidocs.chargebee.com/docs/api/customers#customer_attributes + + +** APIs added**: + +Support to change card gateway for a customer. New api endpoint to switch gateway for a customer is added to Card resources. See: https://apidocs.chargebee.com/docs/api/cards#switch_gateway + + +** Issue Fixed**: + +Wrong keys in json response is now fixed for 'linked_transactions', 'linked_orders' & 'notes' in Invoice resource and for 'linked_invoices' & 'linked_refunds' in Transaction resource. See: invoice attributes here: https://apidocs.chargebee.com/docs/api/invoices + +### v1.6.1 (2016-03-16) +* * * + +** Dependency issue fixed**: + +Namespace collision for 'http' with Python dependency setuptools is fixed. See pull request: https://github.com/chargebee/chargebee-python/pull/9 + +### v1.6.0 (2016-03-10) +* * * + +** APIs updated**: + +Support to keep the card in gateway while deleting customer. Delete a customer API accepts "delete_payment_method" parameter. See: https://apidocs.chargebee.com/docs/api/customers#delete_a_customer + +### v1.5.9 (2016-02-25) +* * * + +** APIs added**: + +Support to delete a subscription. See: https://www.chargebee.com/docs/subscriptions.html#deleting-a-subscription +New api endpoint to delete 'Subscription' is added to Subscription resources. See delete subscription API here: +https://apidocs.chargebee.com/docs/api/subscriptions#delete_a_subscription + +Support to delete a customer. See: https://www.chargebee.com/docs/customers.html#deleting-a-customer +New api endpoint to delete 'Customer' is added to Customer resources. See delete customer API here: +https://apidocs.chargebee.com/docs/api/customers#delete_a_customer + + +** APIs updated**: + +Now, events "subscription_deleted" & "customer_deleted" can be fetched via API. See : https://apidocs.chargebee.com/docs/api/events#event_types. + +### v1.5.8 (2016-02-08) +* * * + +** APIs added**: + +Support to add additional contact for a customer. See: https://www.chargebee.com/docs/customers.html#add-contact +New api endpoints to add, update and delete 'Contact' are added to Customer resource. See add contact API here: https://apidocs.chargebee.com/docs/api/customers#add_contacts_to_a_customer + +** APIs updated**: + +New attribute 'contacts' with list of contacts is returned as part of Customer resource. See: https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +Support for partial payment. Collect payment for an invoice API now accepts 'amount' paramater. See: https://apidocs.chargebee.com/docs/api/invoices#collect_payment_for_an_invoice + +New attribute 'refundable_credits' is returned as part of Customer resource. + +New attributes 'amount_paid', 'amount_adjusted' & 'credits_applied' are returned as part of Invoice resource. See: https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +New attributes 'credits_applied' & 'amount_due' are returned as part of Estimate resource. See: https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +New entity type 'credit_note' is added as part of 'entity_type' attribute of Comment resource. +See: https://apidocs.chargebee.com/docs/api/comments#comment_attributes + +### v1.5.7(2015-12-15) +* * * + +** APIs updated**: + +Wrong API invocation issue if empty/null value passed instead of resource id, is fixed. + +### v1.5.6 (2015-11-24) +* * * + +** APIs updated**: + +Support to specify accessbility in customer portal for a plan & addon. Create & update methods of Plan & Addon APIs accept "enabled_in_portal" parameter. See create plan API here : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +New attribute "enabled_in_portal" is returned as part of Plan/Addon resource. +See plan attributes here: https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +### v1.5.5 (2015-11-09) +* * * + +** APIs updated**: + +Support for excess payments. See : https://www.chargebee.com/docs/customers.html#excess-payments + +New attribute "excess_payments" is returned as part of Customer resource. +See: https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +New attribute "applied_at" is returned as part of Linked Transaction subresource of Invoice resource. +See: https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +New transaction type "PAYMENT_REVERSAL" is returned as part of Transaction resource. +See: https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + +New attributes "amount_unused", "reference_transaction_id", "reversal_transaction_id" & "linked_refunds" subresource are returned as part of Transaction resource. + +New attribute "applied_at" is returmed as part of Linked Invoice subresource of Transaction resource. +See: https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + +### v1.5.4 (2015-10-26) +* * * + +** APIs updated**: + +Support to specify if a customer can pay via direct debit. Now, create & update customer, create subscription APIs accept the "allow_direct_debit" parameter for Customer resource. See create customer API here : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +New attribute "allow_direct_debit" is returned as part of Customer resource. +See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +New "price_type" attribute is returned as part of Estimate & Invoice Resource. +See : https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +Support for address parameters in estimate APIs that is used to calculate tax. Now, create & update subscription estimate APIs accept billing state code, billing zip, shipping country, shipping state code & shipping zip. +See : https://apidocs.chargebee.com/docs/api/estimates#create_subscription_estimate + +### v1.5.3 (2015-09-18) +* * * + +** APIs updated**: + +Support to specify customer's tax liability. Now, create & update customer, create & update subscription, create & update subscription estimate, checkout new hosted page APIs accept the "taxability" parameter for Customer resource. See create customer API here : https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +Support to specify taxability for a plan & addon. Create & update methods of Plan & Addon APIs accept "taxable" parameter. See create plan API here : https://apidocs.chargebee.com/docs/api/plans#create_a_plan + +The attribute "taxablility" is returned as part of Customer resource. +https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +The attribute "taxable" is returned as part of Plan resource. +See : https://apidocs.chargebee.com/docs/api/plans#plan_attributes + +The attribute "taxable" is returned as part of Addon resource. +See : https://apidocs.chargebee.com/docs/api/addons#addon_attributes + + +The attribute "is_taxed" returned as part of "line_items" subresource of Estimate & Invoice resorces. +See attribute of line_items in Estimate here : +https://apidocs.chargebee.com/docs/api/estimates#estimate_attributes + +### v1.5.2 (2015-09-07) +* * * + +** APIs updated**: + +The attribute for "user" is returned as part of Event resource. +See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +Support for multiple webhooks. The attribute "webhooks" contains list of Webhook subresource is returned as part of Event API. +See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +** APIs deprecated**: + +Attributes "webhook_status" & "webhook_failure_reason" of event resource has been deprecated. + +### v1.5.1 (2015-08-25) +* * * + +** APIs updated**: + +The attribute for "first_invoice" & "currency_code" is returned as part of Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +The attribute for "currency_code" is returned as part of Transaction resource. +See : https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes + +A new source type "bulk_operation" is returned as part of "source" attribute of event resource. +See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +### v1.5.0 (2015-07-20) +* * * + +** APIs added**: + +New api endpoint to Stop Dunning for "Payment Due" invoices is added. See : https://apidocs.chargebee.com/docs/api/invoices#stop_dunning_for_invoice + +** APIs updated**: + +The attribute for "dunning_status" is returned as part of Invoice resource. +See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +### v1.4.9 (2015-07-09) +* * * + +** APIs added**: + +New api endpoint to Record Offline Refund for an invoice is added. See : https://apidocs.chargebee.com/docs/api/invoices#record_refund_for_an_invoice + +** APIs updated**: + +Support to update payment method stored in gateway vault. Now, update payment method for a customer, create customer, create & update subscription method APIs accept the "gateway" parameter for Payment Method resource along with reference_id. See "Card Payments" section here : https://apidocs.chargebee.com/docs/api/customers#update_payment_method_for_a_customer + +The attribute for "gateway" name is returned as part of Payment Method sub-resource for a customer resource. See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +A new source type "migration" is returned as part of "source" attribute of event resource. See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +A new discount type "account_credits" is added as part of "type" attribute of discounts sub-resource for estimate resource. + +** APIs deprecated**: + +Attributes "description" & "void_description" of transaction resource has been deprecated. + +### v1.4.8 (2015-06-18) +* * * + +** APIs added**: + +New api endpoint to Void an invoice is added. See : https://apidocs.chargebee.com/docs/api/invoices#void_an_invoice + +** APIs updated**: + +A new invoice status "voided" is returned as part of "status" attribute in invoice resource. See : https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +** APIs deprecated**: + +Update card for hosted page method API has been deprecated. Use "Update payment method" API to update card details. Read more about upadate payment method : https://apidocs.chargebee.com/docs/api/hosted_pages#update_payment_method + +### v1.4.7 (2015-06-12) +* * * + +** APIs added**: + +New api endpoints to Add, Deduct & Set the account credit for a customer is added. See the APIs below - https://apidocs.chargebee.com/docs/api/customers#add_account_credits_to_a_customer +https://apidocs.chargebee.com/docs/api/customers#deduct_account_credits_for_a_customer +https://apidocs.chargebee.com/docs/api/customers#set_account_credits_for_a_customer + +** APIs updated**: + +Now, event "invoice_updated" can be fetched via API. See : https://apidocs.chargebee.com/docs/api/events#event_types. + +A new webkook status "skipped" is returned as part of "webhook_status" attribute of event resource. See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +The resource attribute for "account_credits" is returned as part of Customer resource. See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes + +A new discount type "account_credits" is returned as part of "discounts" sub-resource of Invoice resource. See : https://apidocs.chargebee.com/docs/api/events#event_attributes + +** APIs deprecated**: + +Support for "offer_quantity" in "discount_type" attribute deprecated for Create method of Coupon API. + +Support for "specified_items_total" & "each_unit_of_specified_items" in "apply_on" attribute deprecated for Create method of Coupon API. + +The attribute "discount_quantity" deprecated for Create method of Coupon API. + +### v1.4.6 (2015-05-02) +* * * + +** APIs added**: + +A new api endpoint for "Update payment method for a customer" is added. This allows you to support PayPal Express Checkout via our API. See https://apidocs.chargebee.com/docs/api/customers#update_payment_method_for_a_customer. + +A new api endpoint for "Collect payment for an invoice" is added. This allows you to manually collect the payment(if a payment method is present for the customer) for an invoice in "payment_due" or "not_paid" state. See https://apidocs.chargebee.com/docs/api/invoices#collect_payment_for_an_invoice. + +** APIs updated**: + +Support for PayPal Express Checkout while calling "Create a subscription", "Update a subscription" and "Create a customer" APIs. These APIs now accept details about the payment method(payment_method) that is being associated with the customer. + + +### v1.4.5 (2015-04-14) +* * * + +** APIs updated**: + +Support for Purchase Order(po) number. Create & update subscription, create an invoice, create invoice for charge/addon method APIs now accept "po_number" for the subscription/invoice resource. Read more about purchase order : https://www.chargebee.com/docs/po-number.html + +The resource attribute for "po_number" is returned as part of Subscription and Invoice resources. + +Create and Update methods of plan, addon, coupon, customer and subscripiton APIs now accept "invoice_notes" that is added to the invoice raised for a customer. Read more about invoice notes : https://www.chargebee.com/docs/invoice_notes.html + +A new sub-resource "notes" is returned as part of the Invoice resource attributes. +See https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes + +A new attribute "amount_due" is returned as part of Invoice resource. + +Checkout new, checkout existing, update payment method method APIs now accept "redirect_url" & "cancel_url" to which your customer should be redirected. +See https://apidocs.chargebee.com/docs/api/hosted_pages#checkout_new_subscription + +Now, event "subscription_renewal_reminder" can be fetched via API. +See https://apidocs.chargebee.com/docs/api/events#event_types. + +### v1.4.4 (2015-03-30) +* * * + +** APIs added**: + +A new API "Delete an Invoice" added to delete un-paid invoices. This feature was supported through admin console earlier, now it is available via API too. +See https://apidocs.chargebee.com/docs/api/invoices#delete_an_invoice. + +** APIs updated**: + +Create subscription/customer, update subscription/payment method APIs now accepts the IP Address of customer for card resource. + +Now, event "invoice_deleted" can be fetched via API. +See https://apidocs.chargebee.com/docs/api/events#event_types. + +### v1.4.3 (2015-02-27) +* * * + +** APIs added**: + +A new API "Create an Invoice" added to create one-off invoices with multiple 'Non Recurring' addon & ad-hoc charges for a customer. See https://apidocs.chargebee.com/docs/api/invoices#create_an_invoice. + +A new API called Activate a portal session method(Portal session) added to support building your authentication for your website on top of ChargeBee. See https://apidocs.chargebee.com/docs/api/portal_sessions#activate_a_portal_session. Read about "Using ChargeBee authentication to allow access to your website" at https://apidocs.chargebee.com/docs/api/portal_sessions. + +** APIs updated**: + +Shipping and Billing Address are returned as part of Invoice resource attributes. This returns the shipping & billing address that was present at the time of invoice generation. + +Linked Customers as part of Portal session resource attributes. + +### v1.4.2 (2015-02-18) +* * * + +** APIs added**: +A new API called Remove scheduled cancellation method(Subscription) added to remove the pending cancellation scheduled at end of the subscription term. + +** APIs deprecated**: +Reactivate a subscription(Subscription) API is deprecated for subscriptions in Non-Renewing state as an alternate API(see above) is added. + +** APIs updated**: +Create subscription/customer, update subscription/customer/payment method/billing info API now accepts the State Code for billing, shipping, subscription and card addresses. + +### v1.4.1 (2015-01-07) +* * * + +Support for PayPal & Amazon payment added. + +** APIs added**: +A new API called Update payment method(HostedPage) added to support allowing customers to update their payment method with PayPal and Amazon payments. + +** APIs deprecated**: +Update card(HostedPage) API is deprecated as an alternate API is added. + +** APIs updated**: +Create a customer API now accepts the end user IP. + +### v1.4.0 (2014-12-02) +* * * + +**APIs added**: +A new resource called Order is introduced. This can be used for integrating ChargeBee with any shipping/order management application (like ShipStation). Orders are not automatically generated or updated by ChargeBee currently. They have to be created/updated either via api or merchant web console (a.k.a admin console). An order can be created against an invoice irrespective of the status of the invoice and an invoice can have multiple orders associated with it. +See https://apidocs.chargebee.com/docs/api/orders?lang=python for details. + +**API Updates**: +Ability to filter Invoices with paid_on_after parameter. See https://apidocs.chargebee.com/docs/api/invoices?lang=python#list_invoices. + +### v1.3.9 (2014-11-24) +* * * + +* Support for Amazon Payments +* Details about customer's payment method is now available as sub resource of Customer. + +### v1.3.8 (2014-11-24) +* * * + +** No Changes ** + +### v1.3.7 (2014-10-12) +* * * + +**APIs Updated**: +* Set auto colection to on/off via "Update a customer" API. See https://apidocs.chargebee.com/docs/api/customers#update_a_customer. + +### v1.3.6 (2014-10-12) +* * * + +** No Changes ** + +### v1.3.5 (2014-09-16) +* * * + +**Error Model**: + +New simpler model for error handling has been implemented. Please see below api document for more details + +https://apidocs.chargebee.com/docs/api?lang=python#error_handling + +The following attributes in APIError have been deprecated. +* error_code (Use api_error_code instead). +* http_code (Use http_status_code instead). +* http_body + +The changes are backward compatible. Ensure that your error handling code is tested after you upgrade to this version. + +**APIs Updated**: + +Shipping Address support added to *create subscription for a customer* api call. + +### v1.3.4 (2014-08-28) +* * * +* Customer id can be passed to the checkout new subscription operation. + +* Added support for affiliate integration to accept affiliate token and the ip address from where the subscription was created. See https://apidocs.chargebee.com/docs/api/subscriptions#create_a_subscription. + +### v1.3.3 (2014-08-21) +* * * +Fixing encoding issue for url path. + +### v1.3.2 (2014-08-13) +* * * +Added properties: +* Property has_scheduled_changes added to the Subscription resource to indicate whether there are any pending change scheduled for this Subscription + +APIs added: +* Retrieve a subscription with scheduled changes applied. See https://apidocs.chargebee.com/docs/api/subscriptions#retrieve_with_scheduled_changes. +* Remove schedule changes for a subscription. See https://apidocs.chargebee.com/docs/api/subscriptions#remove_scheduled_changes. + +APIs updated: +* Ability to pass description for Plans & Addons while Creating & Updating. + +APIs Removed: +* Refund a Transaction - In ChargeBee, the 'refunds' are tracked against the invoice for which they are issued. A payment transaction can be associated with only one invoice now. So Transaction.refund() API is indeed a shortcut for Transaction.associatedInvoice().refund(). + +### v1.3.1 (2014-07-29) +* * * +APIs added: +* Add a one time charged to the subscription which will be added to the invoice generated at the end of the current term. See https://apidocs.chargebee.com/docs/api/subscriptions#add_charge_at_term_end. +* Add a "non-recurring addon" charge to a subscription which will be added to the invoice generated at the end of the current term. See https://apidocs.chargebee.com/docs/api/subscriptions#charge_addon_at_term_end. +*Return an estimate of the amount that will be charged when the subscription renews. See https://apidocs.chargebee.com/docs/api/estimates#subscription_renewal_estimate + +APIs updated: +* Now plans supports charge model to specify how the subscription plan charges should be calculated. See https://apidocs.chargebee.com/docs/api/plans#plan_attributes +* Include delayed charges while calculating the Estimate. + +### v1.3.0 (2014-06-19) +* * * +APIs added: +* Retrieve invoices for a customer. See https://apidocs.chargebee.com/docs/api/invoices?lang=python#list_invoices_for_a_customer. +* Retrieve transactions for a customer. See https://apidocs.chargebee.com/docs/api/transactions?lang=python#list_transactions_for_a_customer. + +APIs updated: +* Now, a customer(without subscription) can be charged(Create invoice for Charge) for one time charges. See https://apidocs.chargebee.com/docs/api/invoices?lang=python#create_invoice_for_charge. +* Now, a customer(without subscription) can be charged for one time addons(Create invoice for Addon). See https://apidocs.chargebee.com/docs/api/invoices?lang=python#create_invoice_for_addon. + +### v1.2.9 (2014-05-28) +* * * +New API to support Single Sign-on (SSO) to access the customer portal, if you already have your own authentication for your website. See https://apidocs.chargebee.com/docs/api/portal_sessions?lang=python. + +### v1.2.8 (2014-05-23) +* * * +* New API to create customer without subscription. See https://apidocs.chargebee.com/docs/api/customers#create_a_customer + +* New API to fetch invoices for a customer. This helps you fetch the invoices created due to multiple subscriptions present for any customer. See https://apidocs.chargebee.com/docs/api/invoices#list_invoices_for_a_customer + +* Customer id reference is added to the invoice attributes. + +### v1.2.7 (2014-05-13) +* * * +Issue fix: Missing import Download in result.py. + +### v1.2.6 (2014-04-22) +* * * +Support for returning shipping address as part of create/update subscription API. + +### v1.2.5 (2014-03-26) +* * * +* Now the [Transaction attributes](https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes "Transaction attributes") contains the details about the linked invoices. + +* Now the [Invoice attributes](https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes "Invoice attributes") contains the details about the linked transactions. + +### v1.2.4 (2014-03-18) +* * * +Support for deleting the plans & addons. See our API documentation on [Delete a plan](https://apidocs.chargebee.com/docs/api/plans#delete_a_plan "Delete a plan") & [Delete an addon](https://apidocs.chargebee.com/docs/api/addons#delete_an_addon "Delete an addon"). + +### v1.2.3 (2014-03-10) +* * * +* Support for creating coupons on the fly via API + +* Support for updating the plans & addons. + +* Now our hosted pages can be shown as popup checkout using our javascript API. + +### v1.2.2 (2014-02-19) +* * * +* More attributes added for the address resource. + +* Support for passing shipping address for create subscription & update subscription API. + +### v1.2.1 (2014-02-12) +* * * +* New resource Download added to expose the URLs from which you can download resources like invoice PDFs. + +* Update card hosted page now support pass_thru_parameter like the checkout pages. + +* Support for downloading invoice as PDF. + +* Transaction resource now exposes the void description for transactions that are voided. + +### v1.2.0 (2014-02-02) +* * * +Support for refund invoice and transaction. + +### v1.1.9 (2014-01-26) +* * * +Support for creating plans & addons on the fly via API. + +### v1.1.8 (2014-01-16) +* * * +* Adding object that represent comments resource. Now comments can be added to the entities - Subscription, Invoice, Transaction, Plan, Addon & Coupon. + +* API to fetch multiple subscriptions of a customer. + +### v1.0.2 (2014-11-30) +* * * +Adding MANIFEST.in to include ca-certs + +### v1.0.1 (2012-11-30) +* * * +Improved readme + +### v1.0.0 (2012-11-14) +* * * +Initial version From 5cff61e91c26a7d7ca0ae1fb424227f0c2190547 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Thu, 3 Oct 2024 20:24:11 +0530 Subject: [PATCH 13/19] Releasing v3.0.0b1. Please check the changelog for the updates. --- CHANGELOG.md | 2 +- README.md | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 614b6ca..d24ff0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ * * * - **Minimum Python Version**: Python 3.11 or higher is now required. -- **Type Hinting**: Introduced to improve IDE suggestions. +- **Type Hinting**: Introduced to enhance IDE autocompletion and provide more accurate suggestions during development. - **Data Type Support**: Added support for `int`, `float`, `bool`, and `enum` data types. - **Enums**: Global and resource-specific enums have been introduced. - **Filter Params**: Filter parameters have been introduced. diff --git a/README.md b/README.md index b16db9b..cbce467 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Chargebee Python Client Library v3 (Beta) -This is the Python Library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com). +The Chargebee Python library streamlines integration with the Chargebee API in Python applications. It offers built-in type annotations and enhanced IDE autocompletion for API resources and responses, which improves the developer experience. To get started, please sign up for a Chargebee account [here](https://www.chargebee.com). ## Requirements -Python 3.11 or higher. +- Python 3.11+ ## Installation Install the latest beta version of the library with pip: @@ -12,7 +12,7 @@ Install the latest beta version of the library with pip: ```sh pip install chargebee --pre ``` -If you preferred to install it from source, just checkout the latest version for 3.x.x by ```git checkout [latest 3.x.x release tag]``` and install with the following command: +Install from source with: ```sh python setup.py install @@ -25,6 +25,8 @@ See our [Python API Reference](https://apidocs.chargebee.com/docs/api?lang=pytho ## Usage The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer [here](https://www.chargebee.com/docs/2.0/api_keys.html) for more details. + +### Configuring chargebee ```python import chargebee chargebee.configure("api_key", "site") @@ -38,9 +40,10 @@ chargebee.update_read_timeout_secs(3000) chargebee.update_connect_timeout_secs(5000) ``` -### Creating a new customer: +### Making API Request: ```python +# Create a Customer import chargebee response = chargebee.Customer.create( @@ -64,7 +67,7 @@ customer = response.customer card = response.card ``` -### Using filters with the List API +### List API Request With Filter For pagination, `offset` is the parameter that is being used. The value used for this parameter must be the value returned in `next_offset` parameter from the previous API call. @@ -173,7 +176,7 @@ from chargebee import Filters response = chargebee.Export.customers( chargebee.Export.CustomersParams( customer=chargebee.Export.CustomersCustomerParams( - first_name=Filters.StringFilter(IS="198OeJUMpANxQlhO") + first_name=Filters.StringFilter(IS="John") ) ) ) From 1d311a07ddd1173cb979d7ba7777b2169103c2fa Mon Sep 17 00:00:00 2001 From: cb-nithins <126080858+cb-nithins@users.noreply.github.com> Date: Thu, 17 Oct 2024 20:21:41 +0530 Subject: [PATCH 14/19] Releasing v3.0.0b2. Please check the changelog for the updates. (#64) * Releasing v3.0.0b2. Please check the changelog for the updates. --- CHANGELOG.md | 28 ++- README.md | 74 ++++--- chargebee/__init__.py | 21 +- chargebee/api_error.py | 1 + chargebee/environment.py | 23 +- chargebee/http_request.py | 12 +- chargebee/main.py | 128 ++++++++++- chargebee/models/__init__.py | 5 + chargebee/models/addon/operations.py | 46 ++-- chargebee/models/addon/responses.py | 25 ++- chargebee/models/address/operations.py | 15 +- chargebee/models/address/responses.py | 7 +- .../advance_invoice_schedule/operations.py | 6 +- chargebee/models/attached_item/operations.py | 33 ++- chargebee/models/attached_item/responses.py | 17 +- chargebee/models/attribute/operations.py | 5 +- .../models/business_entity/operations.py | 16 +- chargebee/models/business_entity/responses.py | 7 +- .../business_entity_transfer/operations.py | 6 +- chargebee/models/card/operations.py | 38 ++-- chargebee/models/card/responses.py | 19 +- chargebee/models/comment/operations.py | 26 +-- chargebee/models/comment/responses.py | 13 +- chargebee/models/contact/operations.py | 5 +- chargebee/models/contract_term/operations.py | 6 +- chargebee/models/coupon/operations.py | 59 +++-- chargebee/models/coupon/responses.py | 33 +-- chargebee/models/coupon_code/operations.py | 26 +-- chargebee/models/coupon_code/responses.py | 13 +- chargebee/models/coupon_set/operations.py | 42 ++-- chargebee/models/coupon_set/responses.py | 25 ++- chargebee/models/credit_note/operations.py | 80 +++---- chargebee/models/credit_note/responses.py | 49 +++-- .../models/credit_note_estimate/operations.py | 6 +- chargebee/models/currency/operations.py | 36 ++- chargebee/models/currency/responses.py | 21 +- chargebee/models/customer/operations.py | 137 +++++------- chargebee/models/customer/responses.py | 93 ++++---- .../models/customer_entitlement/operations.py | 10 +- .../models/customer_entitlement/responses.py | 2 +- .../models/differential_price/operations.py | 33 ++- .../models/differential_price/responses.py | 17 +- chargebee/models/discount/operations.py | 6 +- chargebee/models/download/operations.py | 5 +- chargebee/models/entitlement/operations.py | 16 +- chargebee/models/entitlement/responses.py | 7 +- .../models/entitlement_override/operations.py | 16 +- .../models/entitlement_override/responses.py | 7 +- chargebee/models/enums.py | 14 +- chargebee/models/estimate/operations.py | 126 ++++++----- chargebee/models/estimate/responses.py | 81 ++++--- chargebee/models/event/operations.py | 28 ++- chargebee/models/event/responses.py | 4 +- chargebee/models/export/operations.py | 116 +++++----- chargebee/models/export/responses.py | 71 +++--- chargebee/models/feature/operations.py | 48 ++-- chargebee/models/feature/responses.py | 29 +-- .../models/gateway_error_detail/operations.py | 5 +- chargebee/models/gift/operations.py | 46 ++-- chargebee/models/gift/responses.py | 25 ++- chargebee/models/hierarchy/operations.py | 5 +- chargebee/models/hosted_page/operations.py | 124 +++++------ chargebee/models/hosted_page/responses.py | 85 +++---- chargebee/models/impacted_item/operations.py | 5 +- .../models/impacted_item_price/operations.py | 5 +- .../impacted_subscription/operations.py | 5 +- .../models/in_app_subscription/operations.py | 26 +-- .../models/in_app_subscription/responses.py | 17 +- chargebee/models/invoice/operations.py | 200 +++++++---------- chargebee/models/invoice/responses.py | 139 ++++++------ .../models/invoice_estimate/operations.py | 6 +- chargebee/models/item/operations.py | 38 ++-- chargebee/models/item/responses.py | 17 +- .../models/item_entitlement/operations.py | 26 +-- .../models/item_entitlement/responses.py | 13 +- chargebee/models/item_family/operations.py | 33 ++- chargebee/models/item_family/responses.py | 17 +- chargebee/models/item_price/operations.py | 47 ++-- chargebee/models/item_price/responses.py | 22 +- chargebee/models/metadata/operations.py | 5 +- chargebee/models/order/operations.py | 77 +++---- chargebee/models/order/responses.py | 43 ++-- chargebee/models/payment_intent/operations.py | 23 +- chargebee/models/payment_intent/responses.py | 11 +- .../payment_reference_number/operations.py | 6 +- .../models/payment_schedule/operations.py | 6 +- .../payment_schedule_estimate/__init__.py | 2 + .../payment_schedule_estimate/operations.py | 32 +++ .../payment_schedule_estimate/responses.py | 23 ++ .../payment_schedule_scheme/operations.py | 21 +- .../payment_schedule_scheme/responses.py | 12 +- chargebee/models/payment_source/operations.py | 90 ++++---- chargebee/models/payment_source/responses.py | 61 ++--- .../models/payment_voucher/operations.py | 26 +-- chargebee/models/payment_voucher/responses.py | 11 +- chargebee/models/plan/operations.py | 46 ++-- chargebee/models/plan/responses.py | 25 ++- chargebee/models/portal_session/operations.py | 28 ++- chargebee/models/portal_session/responses.py | 15 +- chargebee/models/price_variant/operations.py | 31 ++- chargebee/models/price_variant/responses.py | 17 +- .../models/pricing_page_session/operations.py | 43 +++- .../models/pricing_page_session/responses.py | 9 +- .../models/promotional_credit/operations.py | 31 ++- .../models/promotional_credit/responses.py | 17 +- chargebee/models/purchase/operations.py | 15 +- chargebee/models/purchase/responses.py | 9 +- chargebee/models/quote/operations.py | 114 +++++----- chargebee/models/quote/responses.py | 75 +++---- .../models/quote_line_group/operations.py | 6 +- chargebee/models/quoted_charge/operations.py | 5 +- .../models/quoted_subscription/operations.py | 9 +- .../models/quoted_subscription/responses.py | 1 + chargebee/models/ramp/operations.py | 36 +-- chargebee/models/ramp/responses.py | 17 +- .../models/resource_migration/operations.py | 11 +- .../models/resource_migration/responses.py | 2 +- .../site_migration_detail/operations.py | 11 +- .../models/site_migration_detail/responses.py | 2 +- chargebee/models/subscription/operations.py | 208 ++++++++---------- chargebee/models/subscription/responses.py | 136 ++++++------ .../subscription_entitlement/operations.py | 16 +- .../subscription_entitlement/responses.py | 7 +- .../subscription_estimate/operations.py | 6 +- chargebee/models/tax_withheld/operations.py | 6 +- .../third_party_payment_method/operations.py | 5 +- chargebee/models/time_machine/operations.py | 32 +-- chargebee/models/time_machine/responses.py | 11 +- chargebee/models/token/operations.py | 6 +- chargebee/models/transaction/operations.py | 63 +++--- chargebee/models/transaction/responses.py | 35 +-- .../models/unbilled_charge/operations.py | 36 ++- chargebee/models/unbilled_charge/responses.py | 23 +- chargebee/models/usage/operations.py | 32 ++- chargebee/models/usage/responses.py | 17 +- .../models/virtual_bank_account/operations.py | 36 ++- .../models/virtual_bank_account/responses.py | 21 +- chargebee/request.py | 16 +- chargebee/response.py | 6 + chargebee/responses.py | 12 +- chargebee/version.py | 2 +- 141 files changed, 2347 insertions(+), 2153 deletions(-) create mode 100644 chargebee/models/payment_schedule_estimate/__init__.py create mode 100644 chargebee/models/payment_schedule_estimate/operations.py create mode 100644 chargebee/models/payment_schedule_estimate/responses.py create mode 100644 chargebee/response.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d24ff0f..5071df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +### v3.0.0b2 (2024-10-17) +* * * + +- **Chargebee Client**: Support for multiple clients has been introduced. +- **Response Headers**: `response_headers` has been renamed to `headers` inside the response object. +- **Idempotency Headers**: `is_idempotency_replayed` is now a direct attribute of the response object, no longer part of `response_headers`. + +#### New Resource: +* PaymentScheduleEstimate has been added. + +#### New Attributes: +* payment_schedule_estimates has been added to Estimate. +* usage_accumulation_reset_frequency has been added to ItemPrice. +* name has been added to PaymentScheduleScheme. +* usage_accumulation_reset_frequency has been added to QuotedSubscription#SubscriptionItem. +* usage_accumulation_reset_frequency has been added to Subscription#SubscriptionItem. + +#### New Endpoints: +* Estimate#PaymentSchedule has been added. + +#### New Input Params: +* usage_accumulation_reset_frequency has been added to ItemPrice#CreateParams. +* usage_accumulation_reset_frequency has been added to ItemPrice#UpdateParams. +* discounts has been added to PricingPageSession#CreateForNewSubscriptionParams. +* discounts has been added to PricingPageSession#CreateForExistingSubscriptionParams. +* invoice_immediately has been added to Quote#ConvertParams. + ### v3.0.0b1 (2024-10-03) * * * @@ -11,7 +38,6 @@ - **Idempotency Headers**: `is_idempotency_replayed` is now a JSON entry inside `response_headers` instead of a method (`is_idempotency_replayed()`). - **Wait For Process Completion**: Response from previous API calls must be passed as arguments for `wait_for_export_completion()` and `wait_for_time_travel_completion()`. - ### v2.44.1 (2024-10-03) * * * diff --git a/README.md b/README.md index cbce467..de5eda2 100644 --- a/README.md +++ b/README.md @@ -26,33 +26,42 @@ See our [Python API Reference](https://apidocs.chargebee.com/docs/api?lang=pytho The package needs to be configured with your site's API key, which is available under Configure Chargebee Section. Refer [here](https://www.chargebee.com/docs/2.0/api_keys.html) for more details. -### Configuring chargebee +### Configuring chargebee client ```python -import chargebee -chargebee.configure("api_key", "site") +from chargebee import Chargebee +cb_client = Chargebee(api_key="", site="") ``` ### Configuring Timeouts ```python -import chargebee -chargebee.update_read_timeout_secs(3000) -chargebee.update_connect_timeout_secs(5000) +from chargebee import Chargebee +cb_client = Chargebee(api_key="api_key", site="site") +cb_client.update_read_timeout_secs(3000) +cb_client.update_connect_timeout_secs(5000) +``` + +### Configuring Retry Delays + +```python +from chargebee import Chargebee +cb_client = Chargebee(api_key="api_key", site="site") +cb_client.update_export_retry_delay_ms(3000) +cb_client.update_time_travel_retry_delay_ms(5000) ``` ### Making API Request: ```python # Create a Customer -import chargebee -response = chargebee.Customer.create( - chargebee.Customer.CreateParams( +response = cb_client.Customer.create( + cb_client.Customer.CreateParams( first_name="John", last_name="Doe", email="john@test.com", locale="fr-CA", - billing_address=chargebee.Customer.BillingAddress( + billing_address=cb_client.Customer.BillingAddress( first_name="John", last_name=" Doe", line1="PO Box 9999", @@ -72,11 +81,10 @@ card = response.card For pagination, `offset` is the parameter that is being used. The value used for this parameter must be the value returned in `next_offset` parameter from the previous API call. ```python -import chargebee from chargebee import Filters -response = chargebee.Customer.list( - chargebee.Customer.ListParams( +response = cb_client.Customer.list( + cb_client.Customer.ListParams( first_name=Filters.StringFilter(IS="John") ) ) @@ -94,8 +102,8 @@ There are two variants of enums in chargebee, # Global Enum import chargebee -response = chargebee.Customer.create( - chargebee.Customer.CreateParams( +response = cb_client.Customer.create( + cb_client.Customer.CreateParams( first_name="John", auto_collection=chargebee.AutoCollection.ON, # global enum ) @@ -104,12 +112,11 @@ print(response.customer.cf_host_url) ``` ```python # Resource Specific Enum -import chargebee -response = chargebee.Customer.change_billing_date( - chargebee.Customer.ChangeBillingDateParams( +response = cb_client.Customer.change_billing_date( + cb_client.Customer.ChangeBillingDateParams( first_name="John", - billing_day_of_week=chargebee.Customer.BillingDayOfWeek.MONDAY, # resource specific enum + billing_day_of_week=cb_client.Customer.BillingDayOfWeek.MONDAY, # resource specific enum ) ) print(response.customer.cf_host_url) @@ -118,10 +125,8 @@ print(response.customer.cf_host_url) ### Using custom fields ```python -import chargebee - -response = chargebee.Customer.create( - chargebee.Customer.CreateParams( +response = cb_client.Customer.create( + cb_client.Customer.CreateParams( first_name="John", cf_host_url="https://john.com", # `cf_host_url` is a custom field in Customer object ) @@ -134,15 +139,13 @@ print(response.customer.cf_host_url) [Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests. ```python -import chargebee - -response = chargebee.Customer.create( - chargebee.Customer.CreateParams( +response = cb_client.Customer.create( + cb_client.Customer.CreateParams( first_name="John", last_name="Doe", email="john@test.com", locale="fr-CA", - billing_address=chargebee.Customer.BillingAddress( + billing_address=cb_client.Customer.BillingAddress( first_name="John", last_name=" Doe", line1="PO Box 9999", @@ -159,9 +162,9 @@ response = chargebee.Customer.create( ) customer = response.customer card = response.card -responseHeaders = response.response_headers # Retrieves response headers +responseHeaders = response.headers # Retrieves response headers print(responseHeaders) -idempotencyReplayedValue = response.response_headers["is_idempotency_replayed"] # Retrieves Idempotency replayed header value +idempotencyReplayedValue = response.is_idempotency_replayed # Retrieves Idempotency replayed header value print(idempotencyReplayedValue) ``` @@ -171,16 +174,17 @@ The response from the previous API call must be passed as an argument for `wait_ ```python # Wait For Export Completion -import chargebee + from chargebee import Filters -response = chargebee.Export.customers( - chargebee.Export.CustomersParams( - customer=chargebee.Export.CustomersCustomerParams( + +response = cb_client.Export.customers( + cb_client.Export.CustomersParams( + customer=cb_client.Export.CustomersCustomerParams( first_name=Filters.StringFilter(IS="John") ) ) ) -print(chargebee.Export.wait_for_export_completion(response.export)) +print(cb_client.Export.wait_for_export_completion(response.export)) ``` ## Feedback diff --git a/chargebee/__init__.py b/chargebee/__init__.py index 60bf529..ea285ad 100644 --- a/chargebee/__init__.py +++ b/chargebee/__init__.py @@ -4,23 +4,6 @@ InvalidRequestError, OperationFailedError, ) -from chargebee.models import * from chargebee.filters import Filters -from chargebee.main import ChargeBee - - -def configure(api_key, site): - ChargeBee.configure( - { - "api_key": api_key, - "site": site, - } - ) - - -def update_connect_timeout_secs(connect_timeout): - ChargeBee.update_connect_timeout_secs(connect_timeout) - - -def update_read_timeout_secs(read_timeout): - ChargeBee.update_read_timeout_secs(read_timeout) +from chargebee.main import Chargebee +from chargebee.models import * diff --git a/chargebee/api_error.py b/chargebee/api_error.py index be61c7e..4be2126 100644 --- a/chargebee/api_error.py +++ b/chargebee/api_error.py @@ -9,6 +9,7 @@ def __init__(self, http_code, json_obj): self.param = json_obj.get("param") self.error_code = json_obj["error_code"] + self.error_cause = json_obj.get('error_cause', None) self.http_code = http_code self.http_body = None diff --git a/chargebee/environment.py b/chargebee/environment.py index 2786a94..0515912 100644 --- a/chargebee/environment.py +++ b/chargebee/environment.py @@ -1,26 +1,21 @@ class Environment(object): - - chargebee_domain = None + chargebee_domain = "chargebee.com" protocol = "https" API_VERSION = "v2" connect_timeout = 30 read_timeout = 80 + export_retry_delay_ms = 10000 + time_travel_retry_delay_ms = 3000 def __init__(self, options): self.api_key = options["api_key"] self.site = options["site"] - - if self.chargebee_domain is None: - self.api_endpoint = "https://%s.chargebee.com/api/%s" % ( - self.site, - self.API_VERSION, - ) - else: - self.api_endpoint = "http://%s.%s/api/%s" % ( - self.site, - self.chargebee_domain, - self.API_VERSION, - ) + self.api_endpoint = "%s://%s.%s/api/%s" % ( + self.protocol, + self.site, + self.chargebee_domain, + self.API_VERSION, + ) def api_url(self, url): return self.api_endpoint + url diff --git a/chargebee/http_request.py b/chargebee/http_request.py index 747c1d7..a05ffcd 100644 --- a/chargebee/http_request.py +++ b/chargebee/http_request.py @@ -1,6 +1,7 @@ import base64 import logging import platform + import requests from chargebee import ( @@ -8,11 +9,10 @@ PaymentError, InvalidRequestError, OperationFailedError, - compat, ) -from chargebee.main import ChargeBee -from chargebee.main import Environment from chargebee import compat +from chargebee.main import Chargebee +from chargebee.main import Environment from chargebee.version import VERSION _logger = logging.getLogger(__name__) @@ -40,7 +40,7 @@ def request(method, url, env, params=None, headers=None): headers.update( { - "User-Agent": "ChargeBee-Python-Client v%s" % VERSION, + "User-Agent": "Chargebee-Python-Client v%s" % VERSION, "Accept": "application/json", "Authorization": _basic_auth_str(env.api_key), "Lang-Version": str(compat.py_major_v) + "." + str(compat.py_minor_v), @@ -58,10 +58,10 @@ def request(method, url, env, params=None, headers=None): uri = meta.netloc + meta.path + "?" + meta.query - if ChargeBee.verify_ca_certs: + if Chargebee.verify_ca_certs: request_args.update( { - "verify": ChargeBee.ca_cert_path, + "verify": Chargebee.ca_cert_path, "url": "https://" + uri, } ) diff --git a/chargebee/main.py b/chargebee/main.py index b9986e1..3c4dca3 100644 --- a/chargebee/main.py +++ b/chargebee/main.py @@ -1,23 +1,127 @@ import os.path +from dataclasses import dataclass +import chargebee from chargebee.environment import Environment -class ChargeBee(object): +@dataclass +class Chargebee: - default_env = None + env: Environment = None - verify_ca_certs = True + verify_ca_certs: bool = True ca_cert_path = os.path.join(os.path.dirname(__file__), "ssl", "ca-certs.crt") - @classmethod - def configure(cls, options): - cls.default_env = Environment(options) + def __init__( + self, + api_key: str, + site: str, + chargebee_domain: str = None, + protocol: str = None, + connection_time_out: int = None, + read_time_out: int = None, + ): + self.env = Environment({"api_key": api_key, "site": site}) + if chargebee_domain is not None: + self.update_chargebee_domain(chargebee_domain) + if protocol is not None: + self.update_protocol(protocol) + if connection_time_out is not None: + self.update_connect_timeout_secs(connection_time_out) + if read_time_out is not None: + self.update_read_timeout_secs(read_time_out) - @classmethod - def update_connect_timeout_secs(cls, connect_timeout): - cls.default_env.connect_timeout = connect_timeout + self.Addon = chargebee.Addon(self.env) + self.Address = chargebee.Address(self.env) + self.AdvanceInvoiceSchedule = chargebee.AdvanceInvoiceSchedule(self.env) + self.AttachedItem = chargebee.AttachedItem(self.env) + self.Attribute = chargebee.Attribute(self.env) + self.BusinessEntity = chargebee.BusinessEntity(self.env) + self.BusinessEntityTransfer = chargebee.BusinessEntityTransfer(self.env) + self.Card = chargebee.Card(self.env) + self.Comment = chargebee.Comment(self.env) + self.Contact = chargebee.Contact(self.env) + self.ContractTerm = chargebee.ContractTerm(self.env) + self.Coupon = chargebee.Coupon(self.env) + self.CouponCode = chargebee.CouponCode(self.env) + self.CouponSet = chargebee.CouponSet(self.env) + self.CreditNote = chargebee.CreditNote(self.env) + self.CreditNoteEstimate = chargebee.CreditNoteEstimate(self.env) + self.Currency = chargebee.Currency(self.env) + self.Customer = chargebee.Customer(self.env) + self.CustomerEntitlement = chargebee.CustomerEntitlement(self.env) + self.DifferentialPrice = chargebee.DifferentialPrice(self.env) + self.Discount = chargebee.Discount(self.env) + self.Download = chargebee.Download(self.env) + self.Entitlement = chargebee.Entitlement(self.env) + self.EntitlementOverride = chargebee.EntitlementOverride(self.env) + self.Estimate = chargebee.Estimate(self.env) + self.Event = chargebee.Event(self.env) + self.Export = chargebee.Export(self.env) + self.Feature = chargebee.Feature(self.env) + self.GatewayErrorDetail = chargebee.GatewayErrorDetail(self.env) + self.Gift = chargebee.Gift(self.env) + self.Hierarchy = chargebee.Hierarchy(self.env) + self.HostedPage = chargebee.HostedPage(self.env) + self.ImpactedItem = chargebee.ImpactedItem(self.env) + self.ImpactedItemPrice = chargebee.ImpactedItemPrice(self.env) + self.ImpactedSubscription = chargebee.ImpactedSubscription(self.env) + self.InAppSubscription = chargebee.InAppSubscription(self.env) + self.Invoice = chargebee.Invoice(self.env) + self.InvoiceEstimate = chargebee.InvoiceEstimate(self.env) + self.Item = chargebee.Item(self.env) + self.ItemEntitlement = chargebee.ItemEntitlement(self.env) + self.ItemFamily = chargebee.ItemFamily(self.env) + self.ItemPrice = chargebee.ItemPrice(self.env) + self.Metadata = chargebee.Metadata(self.env) + self.Order = chargebee.Order(self.env) + self.PaymentIntent = chargebee.PaymentIntent(self.env) + self.PaymentReferenceNumber = chargebee.PaymentReferenceNumber(self.env) + self.PaymentSchedule = chargebee.PaymentSchedule(self.env) + self.PaymentScheduleEstimate = chargebee.PaymentScheduleEstimate(self.env) + self.PaymentScheduleScheme = chargebee.PaymentScheduleScheme(self.env) + self.PaymentSource = chargebee.PaymentSource(self.env) + self.PaymentVoucher = chargebee.PaymentVoucher(self.env) + self.Plan = chargebee.Plan(self.env) + self.PortalSession = chargebee.PortalSession(self.env) + self.PriceVariant = chargebee.PriceVariant(self.env) + self.PricingPageSession = chargebee.PricingPageSession(self.env) + self.PromotionalCredit = chargebee.PromotionalCredit(self.env) + self.Purchase = chargebee.Purchase(self.env) + self.Quote = chargebee.Quote(self.env) + self.QuoteLineGroup = chargebee.QuoteLineGroup(self.env) + self.QuotedCharge = chargebee.QuotedCharge(self.env) + self.QuotedSubscription = chargebee.QuotedSubscription(self.env) + self.Ramp = chargebee.Ramp(self.env) + self.ResourceMigration = chargebee.ResourceMigration(self.env) + self.SiteMigrationDetail = chargebee.SiteMigrationDetail(self.env) + self.Subscription = chargebee.Subscription(self.env) + self.SubscriptionEntitlement = chargebee.SubscriptionEntitlement(self.env) + self.SubscriptionEstimate = chargebee.SubscriptionEstimate(self.env) + self.TaxWithheld = chargebee.TaxWithheld(self.env) + self.ThirdPartyPaymentMethod = chargebee.ThirdPartyPaymentMethod(self.env) + self.TimeMachine = chargebee.TimeMachine(self.env) + self.Token = chargebee.Token(self.env) + self.Transaction = chargebee.Transaction(self.env) + self.UnbilledCharge = chargebee.UnbilledCharge(self.env) + self.Usage = chargebee.Usage(self.env) + self.VirtualBankAccount = chargebee.VirtualBankAccount(self.env) - @classmethod - def update_read_timeout_secs(cls, read_timeout): - cls.default_env.read_timeout = read_timeout + def update_connect_timeout_secs(self, connect_timeout): + self.env.connect_timeout = connect_timeout + + def update_read_timeout_secs(self, read_timeout): + self.env.read_timeout = read_timeout + + def update_chargebee_domain(self, domain): + self.env.chargebee_domain = domain + + def update_protocol(self, protocol): + self.env.protocol = protocol + + def update_export_retry_delay_ms(self, export_retry_delay_ms): + self.env.export_retry_delay_ms = export_retry_delay_ms + + def update_time_travel_retry_delay_ms(self, time_travel_retry_delay_ms): + self.env.time_travel_retry_delay_ms = time_travel_retry_delay_ms diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index 7144484..b3368b3 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -73,6 +73,7 @@ UnbilledChargesHandling, UnbilledChargesOption, UnpaidInvoicesHandling, + UsageAccumulationResetFrequency, ValidationStatus, VoucherType, ChargeOn, @@ -172,6 +173,10 @@ from chargebee.models.payment_schedule.operations import PaymentSchedule +from chargebee.models.payment_schedule_estimate.operations import ( + PaymentScheduleEstimate, +) + from chargebee.models.payment_schedule_scheme.operations import PaymentScheduleScheme from chargebee.models.payment_source.operations import PaymentSource diff --git a/chargebee/models/addon/operations.py b/chargebee/models/addon/operations.py index 2a61f4b..c7a61ba 100644 --- a/chargebee/models/addon/operations.py +++ b/chargebee/models/addon/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Addon: + + env: environment.Environment + class Type(Enum): ON_OFF = "on_off" QUANTITY = "quantity" @@ -203,74 +207,72 @@ class CopyParams(TypedDict): id: NotRequired[str] for_site_merging: NotRequired[bool] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("addons"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("addons", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("addons"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("addons", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("addons", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("addons", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + def copy(self, params: CopyParams, headers=None) -> CopyResponse: return request.send( "post", request.uri_path("addons", "copy"), + self.env, cast(Dict[Any, Any], params), - env, headers, CopyResponse, ) - @staticmethod - def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + def unarchive(self, id, headers=None) -> UnarchiveResponse: return request.send( "post", request.uri_path("addons", id, "unarchive"), + self.env, None, - env, headers, UnarchiveResponse, ) diff --git a/chargebee/models/addon/responses.py b/chargebee/models/addon/responses.py index e991447..dabc881 100644 --- a/chargebee/models/addon/responses.py +++ b/chargebee/models/addon/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -70,15 +71,15 @@ class AddonResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -90,28 +91,28 @@ class ListAddonResponse: class ListResponse: list: List[ListAddonResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CopyResponse: +class CopyResponse(Response): addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UnarchiveResponse: +class UnarchiveResponse(Response): addon: AddonResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/address/operations.py b/chargebee/models/address/operations.py index 9fe83ff..1c58d09 100644 --- a/chargebee/models/address/operations.py +++ b/chargebee/models/address/operations.py @@ -1,11 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.models import enums +@dataclass class Address: + env: environment.Environment + class RetrieveParams(TypedDict): subscription_id: Required[str] label: Required[str] @@ -28,24 +31,22 @@ class UpdateParams(TypedDict): country: NotRequired[str] validation_status: NotRequired[enums.ValidationStatus] - @staticmethod - def retrieve(params: RetrieveParams, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, params: RetrieveParams, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("addresses"), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveResponse, ) - @staticmethod - def update(params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("addresses"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) diff --git a/chargebee/models/address/responses.py b/chargebee/models/address/responses.py index f157219..e980954 100644 --- a/chargebee/models/address/responses.py +++ b/chargebee/models/address/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -27,10 +28,10 @@ class AddressResponse(Model): @dataclass class RetrieveResponse: address: AddressResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): address: AddressResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/advance_invoice_schedule/operations.py b/chargebee/models/advance_invoice_schedule/operations.py index 83b0515..bf060be 100644 --- a/chargebee/models/advance_invoice_schedule/operations.py +++ b/chargebee/models/advance_invoice_schedule/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 AdvanceInvoiceSchedule: + + env: environment.Environment + class ScheduleType(Enum): FIXED_INTERVALS = "fixed_intervals" SPECIFIC_DATES = "specific_dates" diff --git a/chargebee/models/attached_item/operations.py b/chargebee/models/attached_item/operations.py index 49940ba..42e52a4 100644 --- a/chargebee/models/attached_item/operations.py +++ b/chargebee/models/attached_item/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class AttachedItem: + + env: environment.Environment + class Type(Enum): RECOMMENDED = "recommended" MANDATORY = "mandatory" @@ -57,59 +61,52 @@ class ListParams(TypedDict): charge_on_event: NotRequired[Filters.EnumFilter] updated_at: NotRequired[Filters.TimestampFilter] - @staticmethod - def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, id, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("items", id, "attached_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("attached_items", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def retrieve( - id, params: RetrieveParams, env=None, headers=None - ) -> RetrieveResponse: + def retrieve(self, id, params: RetrieveParams, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("attached_items", id), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveResponse, ) - @staticmethod - def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + def delete(self, id, params: DeleteParams, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("attached_items", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod - def list(id, params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, id, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("items", id, "attached_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) diff --git a/chargebee/models/attached_item/responses.py b/chargebee/models/attached_item/responses.py index b88b3db..2ed0222 100644 --- a/chargebee/models/attached_item/responses.py +++ b/chargebee/models/attached_item/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -23,27 +24,27 @@ class AttachedItemResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): attached_item: AttachedItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): attached_item: AttachedItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: attached_item: AttachedItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): attached_item: AttachedItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -55,4 +56,4 @@ class ListAttachedItemResponse: class ListResponse: list: List[ListAttachedItemResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/attribute/operations.py b/chargebee/models/attribute/operations.py index 2d47f75..4895d55 100644 --- a/chargebee/models/attribute/operations.py +++ b/chargebee/models/attribute/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class Attribute: + env: environment.Environment + pass diff --git a/chargebee/models/business_entity/operations.py b/chargebee/models/business_entity/operations.py index bac971d..45b4bd6 100644 --- a/chargebee/models/business_entity/operations.py +++ b/chargebee/models/business_entity/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class BusinessEntity: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" INACTIVE = "inactive" @@ -29,28 +33,26 @@ class GetTransfersParams(TypedDict): created_at: NotRequired[Filters.TimestampFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod def create_transfers( - params: CreateTransfersParams, env=None, headers=None + self, params: CreateTransfersParams, headers=None ) -> CreateTransfersResponse: return request.send( "post", request.uri_path("business_entities", "transfers"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateTransfersResponse, ) - @staticmethod def get_transfers( - params: GetTransfersParams = None, env=None, headers=None + self, params: GetTransfersParams = None, headers=None ) -> GetTransfersResponse: return request.send( "get", request.uri_path("business_entities", "transfers"), + self.env, cast(Dict[Any, Any], params), - env, headers, GetTransfersResponse, ) diff --git a/chargebee/models/business_entity/responses.py b/chargebee/models/business_entity/responses.py index e6f0547..bbfd8c0 100644 --- a/chargebee/models/business_entity/responses.py +++ b/chargebee/models/business_entity/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import business_entity_transfer @@ -17,9 +18,9 @@ class BusinessEntityResponse(Model): @dataclass -class CreateTransfersResponse: +class CreateTransfersResponse(Response): business_entity_transfer: "business_entity_transfer.BusinessEntityTransferResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -31,4 +32,4 @@ class GetTransfersBusinessEntityResponse: class GetTransfersResponse: list: List[GetTransfersBusinessEntityResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/business_entity_transfer/operations.py b/chargebee/models/business_entity_transfer/operations.py index 1f8aaba..e0eb6a9 100644 --- a/chargebee/models/business_entity_transfer/operations.py +++ b/chargebee/models/business_entity_transfer/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class BusinessEntityTransfer: + + env: environment.Environment + class ResourceType(Enum): CUSTOMER = "customer" SUBSCRIPTION = "subscription" diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py index ba7b236..56d0621 100644 --- a/chargebee/models/card/operations.py +++ b/chargebee/models/card/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 Card: + + env: environment.Environment + class Status(Enum): VALID = "valid" EXPIRING = "expiring" @@ -33,6 +37,8 @@ class CardType(Enum): CARNET = "carnet" RUPAY = "rupay" MAESTRO = "maestro" + DANKORT = "dankort" + CARTES_BANCAIRES = "cartes_bancaires" OTHER = "other" NOT_APPLICABLE = "not_applicable" @@ -91,60 +97,60 @@ class SwitchGatewayForCustomerParams(TypedDict): class CopyCardForCustomerParams(TypedDict): gateway_account_id: Required[str] - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("cards", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("cards", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod def update_card_for_customer( - id, params: UpdateCardForCustomerParams, env=None, headers=None + self, id, params: UpdateCardForCustomerParams, headers=None ) -> UpdateCardForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "credit_card"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateCardForCustomerResponse, ) - @staticmethod def switch_gateway_for_customer( - id, params: SwitchGatewayForCustomerParams, env=None, headers=None + self, id, params: SwitchGatewayForCustomerParams, headers=None ) -> SwitchGatewayForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "switch_gateway"), + self.env, cast(Dict[Any, Any], params), - env, headers, SwitchGatewayForCustomerResponse, ) - @staticmethod def copy_card_for_customer( - id, params: CopyCardForCustomerParams, env=None, headers=None + self, id, params: CopyCardForCustomerParams, headers=None ) -> CopyCardForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "copy_card"), + self.env, cast(Dict[Any, Any], params), - env, headers, CopyCardForCustomerResponse, ) - @staticmethod def delete_card_for_customer( - id, env=None, headers=None + self, id, headers=None ) -> DeleteCardForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "delete_card"), + self.env, None, - env, headers, DeleteCardForCustomerResponse, ) diff --git a/chargebee/models/card/responses.py b/chargebee/models/card/responses.py index cef478e..349824c 100644 --- a/chargebee/models/card/responses.py +++ b/chargebee/models/card/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import third_party_payment_method, customer @@ -40,32 +41,32 @@ class CardResponse(Model): @dataclass class RetrieveResponse: card: CardResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateCardForCustomerResponse: +class UpdateCardForCustomerResponse(Response): customer: "customer.CustomerResponse" card: CardResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SwitchGatewayForCustomerResponse: +class SwitchGatewayForCustomerResponse(Response): customer: "customer.CustomerResponse" card: CardResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CopyCardForCustomerResponse: +class CopyCardForCustomerResponse(Response): third_party_payment_method: ( "third_party_payment_method.ThirdPartyPaymentMethodResponse" ) - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteCardForCustomerResponse: +class DeleteCardForCustomerResponse(Response): customer: "customer.CustomerResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/comment/operations.py b/chargebee/models/comment/operations.py index 0ef974f..67b917f 100644 --- a/chargebee/models/comment/operations.py +++ b/chargebee/models/comment/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Comment: + + env: environment.Environment + class Type(Enum): USER = "user" SYSTEM = "system" @@ -28,46 +32,42 @@ class ListParams(TypedDict): created_at: NotRequired[Filters.TimestampFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("comments"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("comments", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("comments"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("comments", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) diff --git a/chargebee/models/comment/responses.py b/chargebee/models/comment/responses.py index a487160..1b7c397 100644 --- a/chargebee/models/comment/responses.py +++ b/chargebee/models/comment/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -16,15 +17,15 @@ class CommentResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): comment: CommentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: comment: CommentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -36,10 +37,10 @@ class ListCommentResponse: class ListResponse: list: List[ListCommentResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): comment: CommentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/contact/operations.py b/chargebee/models/contact/operations.py index 994d7a8..9418aee 100644 --- a/chargebee/models/contact/operations.py +++ b/chargebee/models/contact/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class Contact: + env: environment.Environment + pass diff --git a/chargebee/models/contract_term/operations.py b/chargebee/models/contract_term/operations.py index 5cfed9d..17cb968 100644 --- a/chargebee/models/contract_term/operations.py +++ b/chargebee/models/contract_term/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class ContractTerm: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" COMPLETED = "completed" diff --git a/chargebee/models/coupon/operations.py b/chargebee/models/coupon/operations.py index 21eeac3..464bdf5 100644 --- a/chargebee/models/coupon/operations.py +++ b/chargebee/models/coupon/operations.py @@ -1,15 +1,20 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Coupon: + + env: environment.Environment + class DiscountType(Enum): FIXED_AMOUNT = "fixed_amount" PERCENTAGE = "percentage" + OFFER_QUANTITY = "offer_quantity" def __str__(self): return self.value @@ -273,102 +278,96 @@ class CopyParams(TypedDict): id: NotRequired[str] for_site_merging: NotRequired[bool] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("coupons"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def create_for_items( - params: CreateForItemsParams, env=None, headers=None + self, params: CreateForItemsParams, headers=None ) -> CreateForItemsResponse: return request.send( "post", request.uri_path("coupons", "create_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForItemsResponse, ) - @staticmethod def update_for_items( - id, params: UpdateForItemsParams, env=None, headers=None + self, id, params: UpdateForItemsParams, headers=None ) -> UpdateForItemsResponse: return request.send( "post", request.uri_path("coupons", id, "update_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateForItemsResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("coupons"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("coupons", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("coupons", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("coupons", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("coupons", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + def copy(self, params: CopyParams, headers=None) -> CopyResponse: return request.send( "post", request.uri_path("coupons", "copy"), + self.env, cast(Dict[Any, Any], params), - env, headers, CopyResponse, ) - @staticmethod - def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + def unarchive(self, id, headers=None) -> UnarchiveResponse: return request.send( "post", request.uri_path("coupons", id, "unarchive"), + self.env, None, - env, headers, UnarchiveResponse, ) diff --git a/chargebee/models/coupon/responses.py b/chargebee/models/coupon/responses.py index 17a01b5..7848fea 100644 --- a/chargebee/models/coupon/responses.py +++ b/chargebee/models/coupon/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -63,21 +64,21 @@ class CouponResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForItemsResponse: +class CreateForItemsResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateForItemsResponse: +class UpdateForItemsResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -89,34 +90,34 @@ class ListCouponResponse: class ListResponse: list: List[ListCouponResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CopyResponse: +class CopyResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UnarchiveResponse: +class UnarchiveResponse(Response): coupon: CouponResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/coupon_code/operations.py b/chargebee/models/coupon_code/operations.py index 414260e..22d204b 100644 --- a/chargebee/models/coupon_code/operations.py +++ b/chargebee/models/coupon_code/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class CouponCode: + + env: environment.Environment + class Status(Enum): NOT_REDEEMED = "not_redeemed" REDEEMED = "redeemed" @@ -27,46 +31,42 @@ class ListParams(TypedDict): coupon_set_name: NotRequired[Filters.StringFilter] status: NotRequired[Filters.EnumFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("coupon_codes"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("coupon_codes", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("coupon_codes"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def archive(id, env=None, headers=None) -> ArchiveResponse: + def archive(self, id, headers=None) -> ArchiveResponse: return request.send( "post", request.uri_path("coupon_codes", id, "archive"), + self.env, None, - env, headers, ArchiveResponse, ) diff --git a/chargebee/models/coupon_code/responses.py b/chargebee/models/coupon_code/responses.py index 9970493..a7936e4 100644 --- a/chargebee/models/coupon_code/responses.py +++ b/chargebee/models/coupon_code/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -14,15 +15,15 @@ class CouponCodeResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): coupon_code: CouponCodeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: coupon_code: CouponCodeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -34,10 +35,10 @@ class ListCouponCodeResponse: class ListResponse: list: List[ListCouponCodeResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ArchiveResponse: +class ArchiveResponse(Response): coupon_code: CouponCodeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/coupon_set/operations.py b/chargebee/models/coupon_set/operations.py index 44a896c..dbfb6c2 100644 --- a/chargebee/models/coupon_set/operations.py +++ b/chargebee/models/coupon_set/operations.py @@ -1,11 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.filters import Filters +@dataclass class CouponSet: + env: environment.Environment + class CreateParams(TypedDict): coupon_id: Required[str] name: Required[str] @@ -29,85 +32,76 @@ class UpdateParams(TypedDict): name: NotRequired[str] meta_data: NotRequired[Dict[Any, Any]] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("coupon_sets"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def add_coupon_codes( - id, params: AddCouponCodesParams = None, env=None, headers=None + self, id, params: AddCouponCodesParams = None, headers=None ) -> AddCouponCodesResponse: return request.send( "post", request.uri_path("coupon_sets", id, "add_coupon_codes"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddCouponCodesResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("coupon_sets"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("coupon_sets", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("coupon_sets", id, "update"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("coupon_sets", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod def delete_unused_coupon_codes( - id, env=None, headers=None + self, id, headers=None ) -> DeleteUnusedCouponCodesResponse: return request.send( "post", request.uri_path("coupon_sets", id, "delete_unused_coupon_codes"), + self.env, None, - env, headers, DeleteUnusedCouponCodesResponse, ) diff --git a/chargebee/models/coupon_set/responses.py b/chargebee/models/coupon_set/responses.py index 6f8fa72..6f42360 100644 --- a/chargebee/models/coupon_set/responses.py +++ b/chargebee/models/coupon_set/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -16,15 +17,15 @@ class CouponSetResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddCouponCodesResponse: +class AddCouponCodesResponse(Response): coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -36,28 +37,28 @@ class ListCouponSetResponse: class ListResponse: list: List[ListCouponSetResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteUnusedCouponCodesResponse: +class DeleteUnusedCouponCodesResponse(Response): coupon_set: CouponSetResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index 940b70e..94b205b 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, invoice, transaction +@dataclass class CreditNote: + + env: environment.Environment + class Type(Enum): ADJUSTMENT = "adjustment" REFUNDABLE = "refundable" @@ -411,170 +415,152 @@ class ImportCreditNoteParams(TypedDict): allocations: Required[List["CreditNote.ImportCreditNoteAllocationParams"]] linked_refunds: Required[List["CreditNote.ImportCreditNoteLinkedRefundParams"]] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("credit_notes"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("credit_notes", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + def pdf(self, id, params: PdfParams = None, headers=None) -> PdfResponse: return request.send( "post", request.uri_path("credit_notes", id, "pdf"), + self.env, cast(Dict[Any, Any], params), - env, headers, PdfResponse, ) - @staticmethod - def download_einvoice(id, env=None, headers=None) -> DownloadEinvoiceResponse: + def download_einvoice(self, id, headers=None) -> DownloadEinvoiceResponse: return request.send( "get", request.uri_path("credit_notes", id, "download_einvoice"), + self.env, None, - env, headers, DownloadEinvoiceResponse, ) - @staticmethod - def refund( - id, params: RefundParams = None, env=None, headers=None - ) -> RefundResponse: + def refund(self, id, params: RefundParams = None, headers=None) -> RefundResponse: return request.send( "post", request.uri_path("credit_notes", id, "refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RefundResponse, ) - @staticmethod def record_refund( - id, params: RecordRefundParams, env=None, headers=None + self, id, params: RecordRefundParams, headers=None ) -> RecordRefundResponse: return request.send( "post", request.uri_path("credit_notes", id, "record_refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordRefundResponse, ) - @staticmethod def void_credit_note( - id, params: VoidCreditNoteParams = None, env=None, headers=None + self, id, params: VoidCreditNoteParams = None, headers=None ) -> VoidCreditNoteResponse: return request.send( "post", request.uri_path("credit_notes", id, "void"), + self.env, cast(Dict[Any, Any], params), - env, headers, VoidCreditNoteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("credit_notes"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def credit_notes_for_customer( - id, params: CreditNotesForCustomerParams = None, env=None, headers=None + self, id, params: CreditNotesForCustomerParams = None, headers=None ) -> CreditNotesForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "credit_notes"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreditNotesForCustomerResponse, ) - @staticmethod - def delete( - id, params: DeleteParams = None, env=None, headers=None - ) -> DeleteResponse: + def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("credit_notes", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod def remove_tax_withheld_refund( - id, params: RemoveTaxWithheldRefundParams, env=None, headers=None + self, id, params: RemoveTaxWithheldRefundParams, headers=None ) -> RemoveTaxWithheldRefundResponse: return request.send( "post", request.uri_path("credit_notes", id, "remove_tax_withheld_refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveTaxWithheldRefundResponse, ) - @staticmethod - def resend_einvoice(id, env=None, headers=None) -> ResendEinvoiceResponse: + def resend_einvoice(self, id, headers=None) -> ResendEinvoiceResponse: return request.send( "post", request.uri_path("credit_notes", id, "resend_einvoice"), + self.env, None, - env, headers, ResendEinvoiceResponse, ) - @staticmethod - def send_einvoice(id, env=None, headers=None) -> SendEinvoiceResponse: + def send_einvoice(self, id, headers=None) -> SendEinvoiceResponse: return request.send( "post", request.uri_path("credit_notes", id, "send_einvoice"), + self.env, None, - env, headers, SendEinvoiceResponse, ) - @staticmethod def import_credit_note( - params: ImportCreditNoteParams, env=None, headers=None + self, params: ImportCreditNoteParams, headers=None ) -> ImportCreditNoteResponse: return request.send( "post", request.uri_path("credit_notes", "import_credit_note"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportCreditNoteResponse, ) diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py index 2110672..bc8e487 100644 --- a/chargebee/models/credit_note/responses.py +++ b/chargebee/models/credit_note/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import invoice, transaction, transaction, invoice, download @@ -218,48 +219,48 @@ class CreditNoteResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): credit_note: CreditNoteResponse invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PdfResponse: +class PdfResponse(Response): download: "download.DownloadResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class DownloadEinvoiceResponse: downloads: List["download.DownloadResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RefundResponse: +class RefundResponse(Response): credit_note: CreditNoteResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordRefundResponse: +class RecordRefundResponse(Response): credit_note: CreditNoteResponse transaction: "transaction.TransactionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class VoidCreditNoteResponse: +class VoidCreditNoteResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -271,7 +272,7 @@ class ListCreditNoteResponse: class ListResponse: list: List[ListCreditNoteResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -283,34 +284,34 @@ class CreditNotesForCustomerCreditNoteResponse: class CreditNotesForCustomerResponse: list: List[CreditNotesForCustomerCreditNoteResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveTaxWithheldRefundResponse: +class RemoveTaxWithheldRefundResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ResendEinvoiceResponse: +class ResendEinvoiceResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SendEinvoiceResponse: +class SendEinvoiceResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportCreditNoteResponse: +class ImportCreditNoteResponse(Response): credit_note: CreditNoteResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/credit_note_estimate/operations.py b/chargebee/models/credit_note_estimate/operations.py index a250180..156bfe3 100644 --- a/chargebee/models/credit_note_estimate/operations.py +++ b/chargebee/models/credit_note_estimate/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 CreditNoteEstimate: + + env: environment.Environment + class Type(Enum): ADJUSTMENT = "adjustment" REFUNDABLE = "refundable" diff --git a/chargebee/models/currency/operations.py b/chargebee/models/currency/operations.py index 0534b2f..828137a 100644 --- a/chargebee/models/currency/operations.py +++ b/chargebee/models/currency/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class Currency: + + env: environment.Environment + class ForexType(Enum): MANUAL = "manual" AUTO = "auto" @@ -25,70 +29,64 @@ class AddScheduleParams(TypedDict): manual_exchange_rate: Required[str] schedule_at: Required[int] - @staticmethod - def list(env=None, headers=None) -> ListResponse: + def list(self, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("currencies", "list"), + self.env, None, - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("currencies", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("currencies"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("currencies", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod def add_schedule( - id, params: AddScheduleParams, env=None, headers=None + self, id, params: AddScheduleParams, headers=None ) -> AddScheduleResponse: return request.send( "post", request.uri_path("currencies", id, "add_schedule"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddScheduleResponse, ) - @staticmethod - def remove_schedule(id, env=None, headers=None) -> RemoveScheduleResponse: + def remove_schedule(self, id, headers=None) -> RemoveScheduleResponse: return request.send( "post", request.uri_path("currencies", id, "remove_schedule"), + self.env, None, - env, headers, RemoveScheduleResponse, ) diff --git a/chargebee/models/currency/responses.py b/chargebee/models/currency/responses.py index ad53df2..624af04 100644 --- a/chargebee/models/currency/responses.py +++ b/chargebee/models/currency/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -17,36 +18,36 @@ class CurrencyResponse(Model): @dataclass class ListResponse: currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateResponse: +class CreateResponse(Response): currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddScheduleResponse: +class AddScheduleResponse(Response): scheduled_at: int currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveScheduleResponse: +class RemoveScheduleResponse(Response): scheduled_at: int currency: CurrencyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py index 587ddf5..ee3ccdf 100644 --- a/chargebee/models/customer/operations.py +++ b/chargebee/models/customer/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, payment_intent +@dataclass class Customer: + + env: environment.Environment + class VatNumberStatus(Enum): VALID = "valid" INVALID = "invalid" @@ -659,313 +663,282 @@ class UpdateHierarchySettingsParams(TypedDict): "Customer.UpdateHierarchySettingsChildAccountAccessParams" ] - @staticmethod - def create(params: CreateParams = None, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams = None, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("customers"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("customers"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("customers", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("customers", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod def update_payment_method( - id, params: UpdatePaymentMethodParams, env=None, headers=None + self, id, params: UpdatePaymentMethodParams, headers=None ) -> UpdatePaymentMethodResponse: return request.send( "post", request.uri_path("customers", id, "update_payment_method"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdatePaymentMethodResponse, ) - @staticmethod def update_billing_info( - id, params: UpdateBillingInfoParams = None, env=None, headers=None + self, id, params: UpdateBillingInfoParams = None, headers=None ) -> UpdateBillingInfoResponse: return request.send( "post", request.uri_path("customers", id, "update_billing_info"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateBillingInfoResponse, ) - @staticmethod def contacts_for_customer( - id, params: ContactsForCustomerParams = None, env=None, headers=None + self, id, params: ContactsForCustomerParams = None, headers=None ) -> ContactsForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "contacts"), + self.env, cast(Dict[Any, Any], params), - env, headers, ContactsForCustomerResponse, ) - @staticmethod def assign_payment_role( - id, params: AssignPaymentRoleParams, env=None, headers=None + self, id, params: AssignPaymentRoleParams, headers=None ) -> AssignPaymentRoleResponse: return request.send( "post", request.uri_path("customers", id, "assign_payment_role"), + self.env, cast(Dict[Any, Any], params), - env, headers, AssignPaymentRoleResponse, ) - @staticmethod def add_contact( - id, params: AddContactParams, env=None, headers=None + self, id, params: AddContactParams, headers=None ) -> AddContactResponse: return request.send( "post", request.uri_path("customers", id, "add_contact"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddContactResponse, ) - @staticmethod def update_contact( - id, params: UpdateContactParams, env=None, headers=None + self, id, params: UpdateContactParams, headers=None ) -> UpdateContactResponse: return request.send( "post", request.uri_path("customers", id, "update_contact"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateContactResponse, ) - @staticmethod def delete_contact( - id, params: DeleteContactParams, env=None, headers=None + self, id, params: DeleteContactParams, headers=None ) -> DeleteContactResponse: return request.send( "post", request.uri_path("customers", id, "delete_contact"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteContactResponse, ) - @staticmethod def add_promotional_credits( - id, params: AddPromotionalCreditsParams, env=None, headers=None + self, id, params: AddPromotionalCreditsParams, headers=None ) -> AddPromotionalCreditsResponse: return request.send( "post", request.uri_path("customers", id, "add_promotional_credits"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddPromotionalCreditsResponse, ) - @staticmethod def deduct_promotional_credits( - id, params: DeductPromotionalCreditsParams, env=None, headers=None + self, id, params: DeductPromotionalCreditsParams, headers=None ) -> DeductPromotionalCreditsResponse: return request.send( "post", request.uri_path("customers", id, "deduct_promotional_credits"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeductPromotionalCreditsResponse, ) - @staticmethod def set_promotional_credits( - id, params: SetPromotionalCreditsParams, env=None, headers=None + self, id, params: SetPromotionalCreditsParams, headers=None ) -> SetPromotionalCreditsResponse: return request.send( "post", request.uri_path("customers", id, "set_promotional_credits"), + self.env, cast(Dict[Any, Any], params), - env, headers, SetPromotionalCreditsResponse, ) - @staticmethod def record_excess_payment( - id, params: RecordExcessPaymentParams, env=None, headers=None + self, id, params: RecordExcessPaymentParams, headers=None ) -> RecordExcessPaymentResponse: return request.send( "post", request.uri_path("customers", id, "record_excess_payment"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordExcessPaymentResponse, ) - @staticmethod def collect_payment( - id, params: CollectPaymentParams, env=None, headers=None + self, id, params: CollectPaymentParams, headers=None ) -> CollectPaymentResponse: return request.send( "post", request.uri_path("customers", id, "collect_payment"), + self.env, cast(Dict[Any, Any], params), - env, headers, CollectPaymentResponse, ) - @staticmethod - def delete( - id, params: DeleteParams = None, env=None, headers=None - ) -> DeleteResponse: + def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("customers", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod - def move(params: MoveParams, env=None, headers=None) -> MoveResponse: + def move(self, params: MoveParams, headers=None) -> MoveResponse: return request.send( "post", request.uri_path("customers", "move"), + self.env, cast(Dict[Any, Any], params), - env, headers, MoveResponse, ) - @staticmethod def change_billing_date( - id, params: ChangeBillingDateParams = None, env=None, headers=None + self, id, params: ChangeBillingDateParams = None, headers=None ) -> ChangeBillingDateResponse: return request.send( "post", request.uri_path("customers", id, "change_billing_date"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChangeBillingDateResponse, ) - @staticmethod - def merge(params: MergeParams, env=None, headers=None) -> MergeResponse: + def merge(self, params: MergeParams, headers=None) -> MergeResponse: return request.send( "post", request.uri_path("customers", "merge"), + self.env, cast(Dict[Any, Any], params), - env, headers, MergeResponse, ) - @staticmethod - def clear_personal_data(id, env=None, headers=None) -> ClearPersonalDataResponse: + def clear_personal_data(self, id, headers=None) -> ClearPersonalDataResponse: return request.send( "post", request.uri_path("customers", id, "clear_personal_data"), + self.env, None, - env, headers, ClearPersonalDataResponse, ) - @staticmethod def relationships( - id, params: RelationshipsParams = None, env=None, headers=None + self, id, params: RelationshipsParams = None, headers=None ) -> RelationshipsResponse: return request.send( "post", request.uri_path("customers", id, "relationships"), + self.env, cast(Dict[Any, Any], params), - env, headers, RelationshipsResponse, ) - @staticmethod - def delete_relationship(id, env=None, headers=None) -> DeleteRelationshipResponse: + def delete_relationship(self, id, headers=None) -> DeleteRelationshipResponse: return request.send( "post", request.uri_path("customers", id, "delete_relationship"), + self.env, None, - env, headers, DeleteRelationshipResponse, ) - @staticmethod - def hierarchy( - id, params: HierarchyParams, env=None, headers=None - ) -> HierarchyResponse: + def hierarchy(self, id, params: HierarchyParams, headers=None) -> HierarchyResponse: return request.send( "get", request.uri_path("customers", id, "hierarchy"), + self.env, cast(Dict[Any, Any], params), - env, headers, HierarchyResponse, ) - @staticmethod def update_hierarchy_settings( - id, params: UpdateHierarchySettingsParams = None, env=None, headers=None + self, id, params: UpdateHierarchySettingsParams = None, headers=None ) -> UpdateHierarchySettingsResponse: return request.send( "post", request.uri_path("customers", id, "update_hierarchy_settings"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateHierarchySettingsResponse, ) diff --git a/chargebee/models/customer/responses.py b/chargebee/models/customer/responses.py index 9cebd94..b5b51af 100644 --- a/chargebee/models/customer/responses.py +++ b/chargebee/models/customer/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( payment_intent, card, @@ -186,10 +187,10 @@ class CustomerResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -202,35 +203,35 @@ class ListCustomerResponse: class ListResponse: list: List[ListCustomerResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdatePaymentMethodResponse: +class UpdatePaymentMethodResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateBillingInfoResponse: +class UpdateBillingInfoResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -242,119 +243,119 @@ class ContactsForCustomerCustomerResponse: class ContactsForCustomerResponse: list: List[ContactsForCustomerCustomerResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AssignPaymentRoleResponse: +class AssignPaymentRoleResponse(Response): customer: CustomerResponse payment_source: "payment_source.PaymentSourceResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddContactResponse: +class AddContactResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateContactResponse: +class UpdateContactResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteContactResponse: +class DeleteContactResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddPromotionalCreditsResponse: +class AddPromotionalCreditsResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeductPromotionalCreditsResponse: +class DeductPromotionalCreditsResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SetPromotionalCreditsResponse: +class SetPromotionalCreditsResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordExcessPaymentResponse: +class RecordExcessPaymentResponse(Response): customer: CustomerResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CollectPaymentResponse: +class CollectPaymentResponse(Response): customer: CustomerResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): customer: CustomerResponse card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class MoveResponse: +class MoveResponse(Response): resource_migration: "resource_migration.ResourceMigrationResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChangeBillingDateResponse: +class ChangeBillingDateResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class MergeResponse: +class MergeResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ClearPersonalDataResponse: +class ClearPersonalDataResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RelationshipsResponse: +class RelationshipsResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteRelationshipResponse: +class DeleteRelationshipResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class HierarchyResponse: hierarchies: List["hierarchy.HierarchyResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateHierarchySettingsResponse: +class UpdateHierarchySettingsResponse(Response): customer: CustomerResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/customer_entitlement/operations.py b/chargebee/models/customer_entitlement/operations.py index f4f89a0..a9b9a01 100644 --- a/chargebee/models/customer_entitlement/operations.py +++ b/chargebee/models/customer_entitlement/operations.py @@ -1,23 +1,25 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class CustomerEntitlement: + env: environment.Environment + class EntitlementsForCustomerParams(TypedDict): limit: NotRequired[int] offset: NotRequired[str] - @staticmethod def entitlements_for_customer( - id, params: EntitlementsForCustomerParams = None, env=None, headers=None + self, id, params: EntitlementsForCustomerParams = None, headers=None ) -> EntitlementsForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "customer_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, EntitlementsForCustomerResponse, ) diff --git a/chargebee/models/customer_entitlement/responses.py b/chargebee/models/customer_entitlement/responses.py index 974ba9a..7eb3619 100644 --- a/chargebee/models/customer_entitlement/responses.py +++ b/chargebee/models/customer_entitlement/responses.py @@ -23,4 +23,4 @@ class EntitlementsForCustomerCustomerEntitlementResponse: class EntitlementsForCustomerResponse: list: List[EntitlementsForCustomerCustomerEntitlementResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/differential_price/operations.py b/chargebee/models/differential_price/operations.py index acde21d..e02b56a 100644 --- a/chargebee/models/differential_price/operations.py +++ b/chargebee/models/differential_price/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class DifferentialPrice: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" DELETED = "deleted" @@ -86,59 +90,52 @@ class ListParams(TypedDict): id: NotRequired[Filters.StringFilter] parent_item_id: NotRequired[Filters.StringFilter] - @staticmethod - def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, id, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("item_prices", id, "differential_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve( - id, params: RetrieveParams, env=None, headers=None - ) -> RetrieveResponse: + def retrieve(self, id, params: RetrieveParams, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("differential_prices", id), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("differential_prices", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + def delete(self, id, params: DeleteParams, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("differential_prices", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("differential_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) diff --git a/chargebee/models/differential_price/responses.py b/chargebee/models/differential_price/responses.py index a53a2a7..84d9335 100644 --- a/chargebee/models/differential_price/responses.py +++ b/chargebee/models/differential_price/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -38,27 +39,27 @@ class DifferentialPriceResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): differential_price: DifferentialPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: differential_price: DifferentialPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): differential_price: DifferentialPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): differential_price: DifferentialPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -70,4 +71,4 @@ class ListDifferentialPriceResponse: class ListResponse: list: List[ListDifferentialPriceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/discount/operations.py b/chargebee/models/discount/operations.py index 787e8f2..f663515 100644 --- a/chargebee/models/discount/operations.py +++ b/chargebee/models/discount/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class Discount: + + env: environment.Environment + class Type(Enum): FIXED_AMOUNT = "fixed_amount" PERCENTAGE = "percentage" diff --git a/chargebee/models/download/operations.py b/chargebee/models/download/operations.py index a893bdf..f0ecbf0 100644 --- a/chargebee/models/download/operations.py +++ b/chargebee/models/download/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class Download: + env: environment.Environment + pass diff --git a/chargebee/models/entitlement/operations.py b/chargebee/models/entitlement/operations.py index 62689f2..b72ceca 100644 --- a/chargebee/models/entitlement/operations.py +++ b/chargebee/models/entitlement/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Entitlement: + + env: environment.Environment + class EntityType(Enum): PLAN = "plan" ADDON = "addon" @@ -36,24 +40,22 @@ class CreateParams(TypedDict): action: Required[enums.Action] entitlements: Required[List["Entitlement.CreateEntitlementParams"]] - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) diff --git a/chargebee/models/entitlement/responses.py b/chargebee/models/entitlement/responses.py index 964b6a2..46f42ff 100644 --- a/chargebee/models/entitlement/responses.py +++ b/chargebee/models/entitlement/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -24,10 +25,10 @@ class ListEntitlementResponse: class ListResponse: list: List[ListEntitlementResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateResponse: +class CreateResponse(Response): entitlement: EntitlementResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/entitlement_override/operations.py b/chargebee/models/entitlement_override/operations.py index 6b7a9ec..c4be8ab 100644 --- a/chargebee/models/entitlement_override/operations.py +++ b/chargebee/models/entitlement_override/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 EntitlementOverride: + + env: environment.Environment + class ScheduleStatus(Enum): ACTIVATED = "activated" SCHEDULED = "scheduled" @@ -35,31 +39,29 @@ class ListEntitlementOverrideForSubscriptionParams(TypedDict): include_drafts: NotRequired[bool] include_scheduled_overrides: NotRequired[bool] - @staticmethod def add_entitlement_override_for_subscription( - id, params: AddEntitlementOverrideForSubscriptionParams, env=None, headers=None + self, id, params: AddEntitlementOverrideForSubscriptionParams, headers=None ) -> AddEntitlementOverrideForSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "entitlement_overrides"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddEntitlementOverrideForSubscriptionResponse, ) - @staticmethod def list_entitlement_override_for_subscription( + self, id, params: ListEntitlementOverrideForSubscriptionParams = None, - env=None, headers=None, ) -> ListEntitlementOverrideForSubscriptionResponse: return request.send( "get", request.uri_path("subscriptions", id, "entitlement_overrides"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListEntitlementOverrideForSubscriptionResponse, ) diff --git a/chargebee/models/entitlement_override/responses.py b/chargebee/models/entitlement_override/responses.py index e27ec6e..f80c81b 100644 --- a/chargebee/models/entitlement_override/responses.py +++ b/chargebee/models/entitlement_override/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -19,9 +20,9 @@ class EntitlementOverrideResponse(Model): @dataclass -class AddEntitlementOverrideForSubscriptionResponse: +class AddEntitlementOverrideForSubscriptionResponse(Response): entitlement_override: EntitlementOverrideResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -33,4 +34,4 @@ class ListEntitlementOverrideForSubscriptionEntitlementOverrideResponse: class ListEntitlementOverrideForSubscriptionResponse: list: List[ListEntitlementOverrideForSubscriptionEntitlementOverrideResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 360fe17..6bb6bad 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -520,9 +520,9 @@ class EventType(Enum): VOUCHER_CREATE_FAILED = "voucher_create_failed" ITEM_PRICE_ENTITLEMENTS_UPDATED = "item_price_entitlements_updated" ITEM_PRICE_ENTITLEMENTS_REMOVED = "item_price_entitlements_removed" - RAMP_CREATED = "ramp_created" - RAMP_DELETED = "ramp_deleted" - RAMP_APPLIED = "ramp_applied" + SUBSCRIPTION_RAMP_CREATED = "subscription_ramp_created" + SUBSCRIPTION_RAMP_DELETED = "subscription_ramp_deleted" + SUBSCRIPTION_RAMP_APPLIED = "subscription_ramp_applied" SUBSCRIPTION_RAMP_DRAFTED = "subscription_ramp_drafted" SUBSCRIPTION_RAMP_UPDATED = "subscription_ramp_updated" PRICE_VARIANT_CREATED = "price_variant_created" @@ -1049,6 +1049,14 @@ def __str__(self): return self.value +class UsageAccumulationResetFrequency(Enum): + NEVER = "never" + SUBSCRIPTION_BILLING_FREQUENCY = "subscription_billing_frequency" + + def __str__(self): + return self.value + + class ValidationStatus(Enum): NOT_VALIDATED = "not_validated" VALID = "valid" diff --git a/chargebee/models/estimate/operations.py b/chargebee/models/estimate/operations.py index bcc4c73..27a2165 100644 --- a/chargebee/models/estimate/operations.py +++ b/chargebee/models/estimate/operations.py @@ -1,5 +1,5 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.models import ( @@ -8,12 +8,23 @@ contract_term, subscription_estimate, invoice_estimate, + payment_schedule_estimate, credit_note_estimate, unbilled_charge, ) +@dataclass class Estimate: + + env: environment.Environment + + class PaymentScheduleEstimateEntityType(Enum): + INVOICE = "invoice" + + def __str__(self): + return self.value + class UnbilledChargeEntityType(Enum): ADHOC = "adhoc" PLAN_ITEM_PRICE = "plan_item_price" @@ -1014,251 +1025,250 @@ class CreateInvoiceForItemsParams(TypedDict): ] invoice_date: NotRequired[int] - @staticmethod + class PaymentSchedulesParams(TypedDict): + scheme_id: Required[str] + amount: NotRequired[int] + invoice_id: NotRequired[str] + payment_schedule_start_date: NotRequired[int] + def create_subscription( - params: CreateSubscriptionParams, env=None, headers=None + self, params: CreateSubscriptionParams, headers=None ) -> CreateSubscriptionResponse: return request.send( "post", request.uri_path("estimates", "create_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubscriptionResponse, ) - @staticmethod def create_sub_item_estimate( - params: CreateSubItemEstimateParams, env=None, headers=None + self, params: CreateSubItemEstimateParams, headers=None ) -> CreateSubItemEstimateResponse: return request.send( "post", request.uri_path("estimates", "create_subscription_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubItemEstimateResponse, ) - @staticmethod def create_sub_for_customer_estimate( - id, params: CreateSubForCustomerEstimateParams, env=None, headers=None + self, id, params: CreateSubForCustomerEstimateParams, headers=None ) -> CreateSubForCustomerEstimateResponse: return request.send( "get", request.uri_path("customers", id, "create_subscription_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubForCustomerEstimateResponse, ) - @staticmethod def create_sub_item_for_customer_estimate( - id, params: CreateSubItemForCustomerEstimateParams, env=None, headers=None + self, id, params: CreateSubItemForCustomerEstimateParams, headers=None ) -> CreateSubItemForCustomerEstimateResponse: return request.send( "post", request.uri_path("customers", id, "create_subscription_for_items_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubItemForCustomerEstimateResponse, ) - @staticmethod def update_subscription( - params: UpdateSubscriptionParams, env=None, headers=None + self, params: UpdateSubscriptionParams, headers=None ) -> UpdateSubscriptionResponse: return request.send( "post", request.uri_path("estimates", "update_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateSubscriptionResponse, ) - @staticmethod def update_subscription_for_items( - params: UpdateSubscriptionForItemsParams, env=None, headers=None + self, params: UpdateSubscriptionForItemsParams, headers=None ) -> UpdateSubscriptionForItemsResponse: return request.send( "post", request.uri_path("estimates", "update_subscription_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateSubscriptionForItemsResponse, ) - @staticmethod def renewal_estimate( - id, params: RenewalEstimateParams = None, env=None, headers=None + self, id, params: RenewalEstimateParams = None, headers=None ) -> RenewalEstimateResponse: return request.send( "get", request.uri_path("subscriptions", id, "renewal_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, RenewalEstimateResponse, ) - @staticmethod def advance_invoice_estimate( - id, params: AdvanceInvoiceEstimateParams = None, env=None, headers=None + self, id, params: AdvanceInvoiceEstimateParams = None, headers=None ) -> AdvanceInvoiceEstimateResponse: return request.send( "post", request.uri_path("subscriptions", id, "advance_invoice_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, AdvanceInvoiceEstimateResponse, ) - @staticmethod def regenerate_invoice_estimate( - id, params: RegenerateInvoiceEstimateParams = None, env=None, headers=None + self, id, params: RegenerateInvoiceEstimateParams = None, headers=None ) -> RegenerateInvoiceEstimateResponse: return request.send( "post", request.uri_path("subscriptions", id, "regenerate_invoice_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, RegenerateInvoiceEstimateResponse, ) - @staticmethod def upcoming_invoices_estimate( - id, env=None, headers=None + self, id, headers=None ) -> UpcomingInvoicesEstimateResponse: return request.send( "get", request.uri_path("customers", id, "upcoming_invoices_estimate"), + self.env, None, - env, headers, UpcomingInvoicesEstimateResponse, ) - @staticmethod def change_term_end( - id, params: ChangeTermEndParams, env=None, headers=None + self, id, params: ChangeTermEndParams, headers=None ) -> ChangeTermEndResponse: return request.send( "post", request.uri_path("subscriptions", id, "change_term_end_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChangeTermEndResponse, ) - @staticmethod def cancel_subscription( - id, params: CancelSubscriptionParams = None, env=None, headers=None + self, id, params: CancelSubscriptionParams = None, headers=None ) -> CancelSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "cancel_subscription_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, CancelSubscriptionResponse, ) - @staticmethod def cancel_subscription_for_items( - id, params: CancelSubscriptionForItemsParams = None, env=None, headers=None + self, id, params: CancelSubscriptionForItemsParams = None, headers=None ) -> CancelSubscriptionForItemsResponse: return request.send( "post", request.uri_path( "subscriptions", id, "cancel_subscription_for_items_estimate" ), + self.env, cast(Dict[Any, Any], params), - env, headers, CancelSubscriptionForItemsResponse, ) - @staticmethod def pause_subscription( - id, params: PauseSubscriptionParams = None, env=None, headers=None + self, id, params: PauseSubscriptionParams = None, headers=None ) -> PauseSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "pause_subscription_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, PauseSubscriptionResponse, ) - @staticmethod def resume_subscription( - id, params: ResumeSubscriptionParams = None, env=None, headers=None + self, id, params: ResumeSubscriptionParams = None, headers=None ) -> ResumeSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "resume_subscription_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, ResumeSubscriptionResponse, ) - @staticmethod def gift_subscription( - params: GiftSubscriptionParams, env=None, headers=None + self, params: GiftSubscriptionParams, headers=None ) -> GiftSubscriptionResponse: return request.send( "post", request.uri_path("estimates", "gift_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, GiftSubscriptionResponse, ) - @staticmethod def gift_subscription_for_items( - params: GiftSubscriptionForItemsParams, env=None, headers=None + self, params: GiftSubscriptionForItemsParams, headers=None ) -> GiftSubscriptionForItemsResponse: return request.send( "post", request.uri_path("estimates", "gift_subscription_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, GiftSubscriptionForItemsResponse, ) - @staticmethod def create_invoice( - params: CreateInvoiceParams = None, env=None, headers=None + self, params: CreateInvoiceParams = None, headers=None ) -> CreateInvoiceResponse: return request.send( "post", request.uri_path("estimates", "create_invoice"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateInvoiceResponse, ) - @staticmethod def create_invoice_for_items( - params: CreateInvoiceForItemsParams, env=None, headers=None + self, params: CreateInvoiceForItemsParams, headers=None ) -> CreateInvoiceForItemsResponse: return request.send( "post", request.uri_path("estimates", "create_invoice_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateInvoiceForItemsResponse, ) + + def payment_schedules( + self, params: PaymentSchedulesParams, headers=None + ) -> PaymentSchedulesResponse: + return request.send( + "post", + request.uri_path("estimates", "payment_schedules"), + self.env, + cast(Dict[Any, Any], params), + headers, + PaymentSchedulesResponse, + ) diff --git a/chargebee/models/estimate/responses.py b/chargebee/models/estimate/responses.py index 2448583..4b76445 100644 --- a/chargebee/models/estimate/responses.py +++ b/chargebee/models/estimate/responses.py @@ -1,11 +1,13 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( payment_intent, contract_term, subscription_estimate, invoice_estimate, + payment_schedule_estimate, credit_note_estimate, unbilled_charge, ) @@ -21,6 +23,9 @@ class EstimateResponse(Model): ] = None invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None invoice_estimates: List["invoice_estimate.InvoiceEstimatesResponse"] = None + payment_schedule_estimates: List[ + "payment_schedule_estimate.PaymentScheduleEstimateResponse" + ] = None next_invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None credit_note_estimates: List["credit_note_estimate.CreditNoteEstimateResponse"] = ( None @@ -29,114 +34,120 @@ class EstimateResponse(Model): @dataclass -class CreateSubscriptionResponse: +class CreateSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateSubItemEstimateResponse: +class CreateSubItemEstimateResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class CreateSubForCustomerEstimateResponse: estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateSubItemForCustomerEstimateResponse: +class CreateSubItemForCustomerEstimateResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateSubscriptionResponse: +class UpdateSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateSubscriptionForItemsResponse: +class UpdateSubscriptionForItemsResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RenewalEstimateResponse: estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AdvanceInvoiceEstimateResponse: +class AdvanceInvoiceEstimateResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RegenerateInvoiceEstimateResponse: +class RegenerateInvoiceEstimateResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class UpcomingInvoicesEstimateResponse: estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None + + +@dataclass +class ChangeTermEndResponse(Response): + estimate: EstimateResponse + headers: Dict[str, str] = None @dataclass -class ChangeTermEndResponse: +class CancelSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelSubscriptionResponse: +class CancelSubscriptionForItemsResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelSubscriptionForItemsResponse: +class PauseSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PauseSubscriptionResponse: +class ResumeSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ResumeSubscriptionResponse: +class GiftSubscriptionResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class GiftSubscriptionResponse: +class GiftSubscriptionForItemsResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class GiftSubscriptionForItemsResponse: +class CreateInvoiceResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateInvoiceResponse: +class CreateInvoiceForItemsResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateInvoiceForItemsResponse: +class PaymentSchedulesResponse(Response): estimate: EstimateResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/event/operations.py b/chargebee/models/event/operations.py index f4480f9..4b9f478 100644 --- a/chargebee/models/event/operations.py +++ b/chargebee/models/event/operations.py @@ -1,5 +1,5 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum import json @@ -7,7 +7,11 @@ from chargebee.filters import Filters +@dataclass class Event: + + env: environment.Environment + class WebhookStatus(Enum): NOT_CONFIGURED = "not_configured" SCHEDULED = "scheduled" @@ -36,8 +40,7 @@ class Webhook(TypedDict): id: Required[str] webhook_status: Required["Event.WebhookWebhookStatus"] - @staticmethod - def deserialize(json_data) -> EventResponse: + def deserialize(self, json_data) -> EventResponse: try: webhook_data = json.loads(json_data) except (TypeError, ValueError) as ex: @@ -46,8 +49,8 @@ def deserialize(json_data) -> EventResponse: ) api_version = webhook_data.get("api_version", None) - env_version = Environment.API_VERSION - if api_version != None and api_version.upper() != env_version.upper(): + env_version = self.env.API_VERSION + if api_version is not None and api_version.upper() != env_version.upper(): raise Exception( "API version [" + api_version.upper() @@ -70,19 +73,22 @@ class ListParams(TypedDict): occurred_at: NotRequired[Filters.TimestampFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("events"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("events", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("events", id), + self.env, + None, + headers, + RetrieveResponse, ) diff --git a/chargebee/models/event/responses.py b/chargebee/models/event/responses.py index 5a6696c..1047ba5 100644 --- a/chargebee/models/event/responses.py +++ b/chargebee/models/event/responses.py @@ -34,10 +34,10 @@ class ListEventResponse: class ListResponse: list: List[ListEventResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: event: EventResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/export/operations.py b/chargebee/models/export/operations.py index fc6ff17..b59cedf 100644 --- a/chargebee/models/export/operations.py +++ b/chargebee/models/export/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Export: + + env: environment.Environment + class MimeType(Enum): PDF = "pdf" ZIP = "zip" @@ -333,19 +337,22 @@ class PriceVariantsPriceVariantParams(TypedDict): created_at: NotRequired[Filters.TimestampFilter] def wait_for_export_completion( - export: ExportResponse, env=None, headers=None + self, export: ExportResponse, headers=None ) -> RetrieveResponse: import time + response: RetrieveResponse = None count = 0 - sleep_time_millis = (10000 if env == None else env.export_sleep_millis) / 1000.0 + retry_delay_ms = ( + 10000 if self.env is None else self.env.export_retry_delay_ms + ) / 1000.0 while export.status == "in_process": if count > 50: raise RuntimeError("Export is taking too long") count += 1 - time.sleep(sleep_time_millis) - response = Export.retrieve(export.id, env, headers) + time.sleep(retry_delay_ms) + response = self.retrieve(export.id, headers) export = response.export return response @@ -449,221 +456,204 @@ class DifferentialPricesParams(TypedDict): class PriceVariantsParams(TypedDict): price_variant: NotRequired["Export.PriceVariantsPriceVariantParams"] - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("exports", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("exports", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod def revenue_recognition( - params: RevenueRecognitionParams, env=None, headers=None + self, params: RevenueRecognitionParams, headers=None ) -> RevenueRecognitionResponse: return request.send( "post", request.uri_path("exports", "revenue_recognition"), + self.env, cast(Dict[Any, Any], params), - env, headers, RevenueRecognitionResponse, ) - @staticmethod def deferred_revenue( - params: DeferredRevenueParams, env=None, headers=None + self, params: DeferredRevenueParams, headers=None ) -> DeferredRevenueResponse: return request.send( "post", request.uri_path("exports", "deferred_revenue"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeferredRevenueResponse, ) - @staticmethod - def plans(params: PlansParams = None, env=None, headers=None) -> PlansResponse: + def plans(self, params: PlansParams = None, headers=None) -> PlansResponse: return request.send( "post", request.uri_path("exports", "plans"), + self.env, cast(Dict[Any, Any], params), - env, headers, PlansResponse, ) - @staticmethod - def addons(params: AddonsParams = None, env=None, headers=None) -> AddonsResponse: + def addons(self, params: AddonsParams = None, headers=None) -> AddonsResponse: return request.send( "post", request.uri_path("exports", "addons"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddonsResponse, ) - @staticmethod - def coupons( - params: CouponsParams = None, env=None, headers=None - ) -> CouponsResponse: + def coupons(self, params: CouponsParams = None, headers=None) -> CouponsResponse: return request.send( "post", request.uri_path("exports", "coupons"), + self.env, cast(Dict[Any, Any], params), - env, headers, CouponsResponse, ) - @staticmethod def customers( - params: CustomersParams = None, env=None, headers=None + self, params: CustomersParams = None, headers=None ) -> CustomersResponse: return request.send( "post", request.uri_path("exports", "customers"), + self.env, cast(Dict[Any, Any], params), - env, headers, CustomersResponse, ) - @staticmethod def subscriptions( - params: SubscriptionsParams = None, env=None, headers=None + self, params: SubscriptionsParams = None, headers=None ) -> SubscriptionsResponse: return request.send( "post", request.uri_path("exports", "subscriptions"), + self.env, cast(Dict[Any, Any], params), - env, headers, SubscriptionsResponse, ) - @staticmethod - def invoices( - params: InvoicesParams = None, env=None, headers=None - ) -> InvoicesResponse: + def invoices(self, params: InvoicesParams = None, headers=None) -> InvoicesResponse: return request.send( "post", request.uri_path("exports", "invoices"), + self.env, cast(Dict[Any, Any], params), - env, headers, InvoicesResponse, ) - @staticmethod def credit_notes( - params: CreditNotesParams = None, env=None, headers=None + self, params: CreditNotesParams = None, headers=None ) -> CreditNotesResponse: return request.send( "post", request.uri_path("exports", "credit_notes"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreditNotesResponse, ) - @staticmethod def transactions( - params: TransactionsParams = None, env=None, headers=None + self, params: TransactionsParams = None, headers=None ) -> TransactionsResponse: return request.send( "post", request.uri_path("exports", "transactions"), + self.env, cast(Dict[Any, Any], params), - env, headers, TransactionsResponse, ) - @staticmethod - def orders(params: OrdersParams = None, env=None, headers=None) -> OrdersResponse: + def orders(self, params: OrdersParams = None, headers=None) -> OrdersResponse: return request.send( "post", request.uri_path("exports", "orders"), + self.env, cast(Dict[Any, Any], params), - env, headers, OrdersResponse, ) - @staticmethod def item_families( - params: ItemFamiliesParams = None, env=None, headers=None + self, params: ItemFamiliesParams = None, headers=None ) -> ItemFamiliesResponse: return request.send( "post", request.uri_path("exports", "item_families"), + self.env, cast(Dict[Any, Any], params), - env, headers, ItemFamiliesResponse, ) - @staticmethod - def items(params: ItemsParams = None, env=None, headers=None) -> ItemsResponse: + def items(self, params: ItemsParams = None, headers=None) -> ItemsResponse: return request.send( "post", request.uri_path("exports", "items"), + self.env, cast(Dict[Any, Any], params), - env, headers, ItemsResponse, ) - @staticmethod def item_prices( - params: ItemPricesParams = None, env=None, headers=None + self, params: ItemPricesParams = None, headers=None ) -> ItemPricesResponse: return request.send( "post", request.uri_path("exports", "item_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, ItemPricesResponse, ) - @staticmethod def attached_items( - params: AttachedItemsParams = None, env=None, headers=None + self, params: AttachedItemsParams = None, headers=None ) -> AttachedItemsResponse: return request.send( "post", request.uri_path("exports", "attached_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, AttachedItemsResponse, ) - @staticmethod def differential_prices( - params: DifferentialPricesParams = None, env=None, headers=None + self, params: DifferentialPricesParams = None, headers=None ) -> DifferentialPricesResponse: return request.send( "post", request.uri_path("exports", "differential_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, DifferentialPricesResponse, ) - @staticmethod def price_variants( - params: PriceVariantsParams = None, env=None, headers=None + self, params: PriceVariantsParams = None, headers=None ) -> PriceVariantsResponse: return request.send( "post", request.uri_path("exports", "price_variants"), + self.env, cast(Dict[Any, Any], params), - env, headers, PriceVariantsResponse, ) diff --git a/chargebee/models/export/responses.py b/chargebee/models/export/responses.py index e3038f2..72ec576 100644 --- a/chargebee/models/export/responses.py +++ b/chargebee/models/export/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -24,106 +25,106 @@ class ExportResponse(Model): @dataclass class RetrieveResponse: export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RevenueRecognitionResponse: +class RevenueRecognitionResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeferredRevenueResponse: +class DeferredRevenueResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PlansResponse: +class PlansResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddonsResponse: +class AddonsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CouponsResponse: +class CouponsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CustomersResponse: +class CustomersResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SubscriptionsResponse: +class SubscriptionsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class InvoicesResponse: +class InvoicesResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreditNotesResponse: +class CreditNotesResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class TransactionsResponse: +class TransactionsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class OrdersResponse: +class OrdersResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ItemFamiliesResponse: +class ItemFamiliesResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ItemsResponse: +class ItemsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ItemPricesResponse: +class ItemPricesResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AttachedItemsResponse: +class AttachedItemsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DifferentialPricesResponse: +class DifferentialPricesResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PriceVariantsResponse: +class PriceVariantsResponse(Response): export: ExportResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/feature/operations.py b/chargebee/models/feature/operations.py index d76fc94..484d2af 100644 --- a/chargebee/models/feature/operations.py +++ b/chargebee/models/feature/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class Feature: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" ARCHIVED = "archived" @@ -63,92 +67,82 @@ class UpdateParams(TypedDict): unit: NotRequired[str] levels: NotRequired[List["Feature.UpdateLevelParams"]] - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("features"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("features"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("features", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("features", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("features", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def activate(id, env=None, headers=None) -> ActivateResponse: + def activate(self, id, headers=None) -> ActivateResponse: return request.send( "post", request.uri_path("features", id, "activate_command"), + self.env, None, - env, headers, ActivateResponse, ) - @staticmethod - def archive(id, env=None, headers=None) -> ArchiveResponse: + def archive(self, id, headers=None) -> ArchiveResponse: return request.send( "post", request.uri_path("features", id, "archive_command"), + self.env, None, - env, headers, ArchiveResponse, ) - @staticmethod - def reactivate(id, env=None, headers=None) -> ReactivateResponse: + def reactivate(self, id, headers=None) -> ReactivateResponse: return request.send( "post", request.uri_path("features", id, "reactivate_command"), + self.env, None, - env, headers, ReactivateResponse, ) diff --git a/chargebee/models/feature/responses.py b/chargebee/models/feature/responses.py index 4c8cd86..522c74c 100644 --- a/chargebee/models/feature/responses.py +++ b/chargebee/models/feature/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -35,46 +36,46 @@ class ListFeatureResponse: class ListResponse: list: List[ListFeatureResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateResponse: +class CreateResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ActivateResponse: +class ActivateResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ArchiveResponse: +class ArchiveResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ReactivateResponse: +class ReactivateResponse(Response): feature: FeatureResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/gateway_error_detail/operations.py b/chargebee/models/gateway_error_detail/operations.py index 7e61c88..19370ac 100644 --- a/chargebee/models/gateway_error_detail/operations.py +++ b/chargebee/models/gateway_error_detail/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class GatewayErrorDetail: + env: environment.Environment + pass diff --git a/chargebee/models/gift/operations.py b/chargebee/models/gift/operations.py index 77f8f32..c0371c4 100644 --- a/chargebee/models/gift/operations.py +++ b/chargebee/models/gift/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, payment_intent +@dataclass class Gift: + + env: environment.Environment + class Status(Enum): SCHEDULED = "scheduled" UNCLAIMED = "unclaimed" @@ -172,78 +176,76 @@ class UpdateGiftParams(TypedDict): scheduled_at: Required[int] comment: NotRequired[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("gifts"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def create_for_items( - params: CreateForItemsParams, env=None, headers=None + self, params: CreateForItemsParams, headers=None ) -> CreateForItemsResponse: return request.send( "post", request.uri_path("gifts", "create_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForItemsResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("gifts", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("gifts", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("gifts"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def claim(id, env=None, headers=None) -> ClaimResponse: + def claim(self, id, headers=None) -> ClaimResponse: return request.send( "post", request.uri_path("gifts", id, "claim"), + self.env, None, - env, headers, ClaimResponse, ) - @staticmethod - def cancel(id, env=None, headers=None) -> CancelResponse: + def cancel(self, id, headers=None) -> CancelResponse: return request.send( "post", request.uri_path("gifts", id, "cancel"), + self.env, None, - env, headers, CancelResponse, ) - @staticmethod def update_gift( - id, params: UpdateGiftParams, env=None, headers=None + self, id, params: UpdateGiftParams, headers=None ) -> UpdateGiftResponse: return request.send( "post", request.uri_path("gifts", id, "update_gift"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateGiftResponse, ) diff --git a/chargebee/models/gift/responses.py b/chargebee/models/gift/responses.py index 4167fa3..13b55dd 100644 --- a/chargebee/models/gift/responses.py +++ b/chargebee/models/gift/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import payment_intent, subscription, invoice @@ -44,26 +45,26 @@ class GiftResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): gift: GiftResponse subscription: "subscription.SubscriptionResponse" invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForItemsResponse: +class CreateForItemsResponse(Response): gift: GiftResponse subscription: "subscription.SubscriptionResponse" invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: gift: GiftResponse subscription: "subscription.SubscriptionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -76,25 +77,25 @@ class ListGiftResponse: class ListResponse: list: List[ListGiftResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ClaimResponse: +class ClaimResponse(Response): gift: GiftResponse subscription: "subscription.SubscriptionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelResponse: +class CancelResponse(Response): gift: GiftResponse subscription: "subscription.SubscriptionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateGiftResponse: +class UpdateGiftResponse(Response): gift: GiftResponse subscription: "subscription.SubscriptionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/hierarchy/operations.py b/chargebee/models/hierarchy/operations.py index 0682ffa..84f2904 100644 --- a/chargebee/models/hierarchy/operations.py +++ b/chargebee/models/hierarchy/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class Hierarchy: + env: environment.Environment + pass diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index 2ea4959..3506234 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, contract_term +@dataclass class HostedPage: + + env: environment.Environment + class Type(Enum): CHECKOUT_NEW = "checkout_new" CHECKOUT_EXISTING = "checkout_existing" @@ -853,280 +857,250 @@ class ViewVoucherParams(TypedDict): payment_voucher: Required["HostedPage.ViewVoucherPaymentVoucherParams"] customer: NotRequired["HostedPage.ViewVoucherCustomerParams"] - @staticmethod def checkout_new( - params: CheckoutNewParams, env=None, headers=None + self, params: CheckoutNewParams, headers=None ) -> CheckoutNewResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_new"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutNewResponse, ) - @staticmethod def checkout_one_time( - params: CheckoutOneTimeParams = None, env=None, headers=None + self, params: CheckoutOneTimeParams = None, headers=None ) -> CheckoutOneTimeResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_one_time"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutOneTimeResponse, ) - @staticmethod def checkout_one_time_for_items( - params: CheckoutOneTimeForItemsParams, env=None, headers=None + self, params: CheckoutOneTimeForItemsParams, headers=None ) -> CheckoutOneTimeForItemsResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_one_time_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutOneTimeForItemsResponse, ) - @staticmethod def checkout_new_for_items( - params: CheckoutNewForItemsParams, env=None, headers=None + self, params: CheckoutNewForItemsParams, headers=None ) -> CheckoutNewForItemsResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_new_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutNewForItemsResponse, ) - @staticmethod def checkout_existing( - params: CheckoutExistingParams, env=None, headers=None + self, params: CheckoutExistingParams, headers=None ) -> CheckoutExistingResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_existing"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutExistingResponse, ) - @staticmethod def checkout_existing_for_items( - params: CheckoutExistingForItemsParams, env=None, headers=None + self, params: CheckoutExistingForItemsParams, headers=None ) -> CheckoutExistingForItemsResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_existing_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutExistingForItemsResponse, ) - @staticmethod - def update_card( - params: UpdateCardParams, env=None, headers=None - ) -> UpdateCardResponse: + def update_card(self, params: UpdateCardParams, headers=None) -> UpdateCardResponse: return request.send( "post", request.uri_path("hosted_pages", "update_card"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateCardResponse, ) - @staticmethod def update_payment_method( - params: UpdatePaymentMethodParams, env=None, headers=None + self, params: UpdatePaymentMethodParams, headers=None ) -> UpdatePaymentMethodResponse: return request.send( "post", request.uri_path("hosted_pages", "update_payment_method"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdatePaymentMethodResponse, ) - @staticmethod def manage_payment_sources( - params: ManagePaymentSourcesParams, env=None, headers=None + self, params: ManagePaymentSourcesParams, headers=None ) -> ManagePaymentSourcesResponse: return request.send( "post", request.uri_path("hosted_pages", "manage_payment_sources"), + self.env, cast(Dict[Any, Any], params), - env, headers, ManagePaymentSourcesResponse, ) - @staticmethod - def collect_now( - params: CollectNowParams, env=None, headers=None - ) -> CollectNowResponse: + def collect_now(self, params: CollectNowParams, headers=None) -> CollectNowResponse: return request.send( "post", request.uri_path("hosted_pages", "collect_now"), + self.env, cast(Dict[Any, Any], params), - env, headers, CollectNowResponse, ) - @staticmethod def accept_quote( - params: AcceptQuoteParams, env=None, headers=None + self, params: AcceptQuoteParams, headers=None ) -> AcceptQuoteResponse: return request.send( "post", request.uri_path("hosted_pages", "accept_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, AcceptQuoteResponse, ) - @staticmethod def extend_subscription( - params: ExtendSubscriptionParams, env=None, headers=None + self, params: ExtendSubscriptionParams, headers=None ) -> ExtendSubscriptionResponse: return request.send( "post", request.uri_path("hosted_pages", "extend_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, ExtendSubscriptionResponse, ) - @staticmethod def checkout_gift( - params: CheckoutGiftParams, env=None, headers=None + self, params: CheckoutGiftParams, headers=None ) -> CheckoutGiftResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_gift"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutGiftResponse, ) - @staticmethod def checkout_gift_for_items( - params: CheckoutGiftForItemsParams = None, env=None, headers=None + self, params: CheckoutGiftForItemsParams = None, headers=None ) -> CheckoutGiftForItemsResponse: return request.send( "post", request.uri_path("hosted_pages", "checkout_gift_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CheckoutGiftForItemsResponse, ) - @staticmethod - def claim_gift( - params: ClaimGiftParams, env=None, headers=None - ) -> ClaimGiftResponse: + def claim_gift(self, params: ClaimGiftParams, headers=None) -> ClaimGiftResponse: return request.send( "post", request.uri_path("hosted_pages", "claim_gift"), + self.env, cast(Dict[Any, Any], params), - env, headers, ClaimGiftResponse, ) - @staticmethod def retrieve_agreement_pdf( - params: RetrieveAgreementPdfParams, env=None, headers=None + self, params: RetrieveAgreementPdfParams, headers=None ) -> RetrieveAgreementPdfResponse: return request.send( "post", request.uri_path("hosted_pages", "retrieve_agreement_pdf"), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveAgreementPdfResponse, ) - @staticmethod - def acknowledge(id, env=None, headers=None) -> AcknowledgeResponse: + def acknowledge(self, id, headers=None) -> AcknowledgeResponse: return request.send( "post", request.uri_path("hosted_pages", id, "acknowledge"), + self.env, None, - env, headers, AcknowledgeResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("hosted_pages", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("hosted_pages"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def pre_cancel( - params: PreCancelParams, env=None, headers=None - ) -> PreCancelResponse: + def pre_cancel(self, params: PreCancelParams, headers=None) -> PreCancelResponse: return request.send( "post", request.uri_path("hosted_pages", "pre_cancel"), + self.env, cast(Dict[Any, Any], params), - env, headers, PreCancelResponse, ) - @staticmethod - def events(params: EventsParams, env=None, headers=None) -> EventsResponse: + def events(self, params: EventsParams, headers=None) -> EventsResponse: return request.send( "post", request.uri_path("hosted_pages", "events"), + self.env, cast(Dict[Any, Any], params), - env, headers, EventsResponse, ) - @staticmethod def view_voucher( - params: ViewVoucherParams, env=None, headers=None + self, params: ViewVoucherParams, headers=None ) -> ViewVoucherResponse: return request.send( "post", request.uri_path("hosted_pages", "view_voucher"), + self.env, cast(Dict[Any, Any], params), - env, headers, ViewVoucherResponse, ) diff --git a/chargebee/models/hosted_page/responses.py b/chargebee/models/hosted_page/responses.py index b631a56..ed11799 100644 --- a/chargebee/models/hosted_page/responses.py +++ b/chargebee/models/hosted_page/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import contract_term @@ -24,111 +25,111 @@ class HostedPageResponse(Model): @dataclass -class CheckoutNewResponse: +class CheckoutNewResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutOneTimeResponse: +class CheckoutOneTimeResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutOneTimeForItemsResponse: +class CheckoutOneTimeForItemsResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutNewForItemsResponse: +class CheckoutNewForItemsResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutExistingResponse: +class CheckoutExistingResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutExistingForItemsResponse: +class CheckoutExistingForItemsResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateCardResponse: +class UpdateCardResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdatePaymentMethodResponse: +class UpdatePaymentMethodResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ManagePaymentSourcesResponse: +class ManagePaymentSourcesResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CollectNowResponse: +class CollectNowResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AcceptQuoteResponse: +class AcceptQuoteResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ExtendSubscriptionResponse: +class ExtendSubscriptionResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutGiftResponse: +class CheckoutGiftResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CheckoutGiftForItemsResponse: +class CheckoutGiftForItemsResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ClaimGiftResponse: +class ClaimGiftResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RetrieveAgreementPdfResponse: +class RetrieveAgreementPdfResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AcknowledgeResponse: +class AcknowledgeResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -140,22 +141,22 @@ class ListHostedPageResponse: class ListResponse: list: List[ListHostedPageResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PreCancelResponse: +class PreCancelResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EventsResponse: +class EventsResponse(Response): success: bool - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ViewVoucherResponse: +class ViewVoucherResponse(Response): hosted_page: HostedPageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/impacted_item/operations.py b/chargebee/models/impacted_item/operations.py index 7c4afb7..5dc7978 100644 --- a/chargebee/models/impacted_item/operations.py +++ b/chargebee/models/impacted_item/operations.py @@ -1,10 +1,13 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class ImpactedItem: + env: environment.Environment + class Download(TypedDict): download_url: Required[str] valid_till: Required[int] diff --git a/chargebee/models/impacted_item_price/operations.py b/chargebee/models/impacted_item_price/operations.py index 0752d07..a8029ae 100644 --- a/chargebee/models/impacted_item_price/operations.py +++ b/chargebee/models/impacted_item_price/operations.py @@ -1,10 +1,13 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class ImpactedItemPrice: + env: environment.Environment + class Download(TypedDict): download_url: Required[str] valid_till: Required[int] diff --git a/chargebee/models/impacted_subscription/operations.py b/chargebee/models/impacted_subscription/operations.py index 6851388..b671361 100644 --- a/chargebee/models/impacted_subscription/operations.py +++ b/chargebee/models/impacted_subscription/operations.py @@ -1,10 +1,13 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class ImpactedSubscription: + env: environment.Environment + class Download(TypedDict): download_url: Required[str] valid_till: Required[int] diff --git a/chargebee/models/in_app_subscription/operations.py b/chargebee/models/in_app_subscription/operations.py index a82b42f..5992a6b 100644 --- a/chargebee/models/in_app_subscription/operations.py +++ b/chargebee/models/in_app_subscription/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class InAppSubscription: + + env: environment.Environment + class StoreStatus(Enum): IN_TRIAL = "in_trial" ACTIVE = "active" @@ -67,54 +71,50 @@ class ImportSubscriptionParams(TypedDict): class RetrieveStoreSubsParams(TypedDict): receipt: Required[str] - @staticmethod def process_receipt( - id, params: ProcessReceiptParams, env=None, headers=None + self, id, params: ProcessReceiptParams, headers=None ) -> ProcessReceiptResponse: return request.send( "post", request.uri_path("in_app_subscriptions", id, "process_purchase_command"), + self.env, cast(Dict[Any, Any], params), - env, headers, ProcessReceiptResponse, ) - @staticmethod def import_receipt( - id, params: ImportReceiptParams, env=None, headers=None + self, id, params: ImportReceiptParams, headers=None ) -> ImportReceiptResponse: return request.send( "post", request.uri_path("in_app_subscriptions", id, "import_receipt"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportReceiptResponse, ) - @staticmethod def import_subscription( - id, params: ImportSubscriptionParams, env=None, headers=None + self, id, params: ImportSubscriptionParams, headers=None ) -> ImportSubscriptionResponse: return request.send( "post", request.uri_path("in_app_subscriptions", id, "import_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportSubscriptionResponse, ) - @staticmethod def retrieve_store_subs( - id, params: RetrieveStoreSubsParams, env=None, headers=None + self, id, params: RetrieveStoreSubsParams, headers=None ) -> RetrieveStoreSubsResponse: return request.send( "post", request.uri_path("in_app_subscriptions", id, "retrieve"), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveStoreSubsResponse, ) diff --git a/chargebee/models/in_app_subscription/responses.py b/chargebee/models/in_app_subscription/responses.py index 65c276f..461b5a4 100644 --- a/chargebee/models/in_app_subscription/responses.py +++ b/chargebee/models/in_app_subscription/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -15,24 +16,24 @@ class InAppSubscriptionResponse(Model): @dataclass -class ProcessReceiptResponse: +class ProcessReceiptResponse(Response): in_app_subscription: InAppSubscriptionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportReceiptResponse: +class ImportReceiptResponse(Response): in_app_subscriptions: List[InAppSubscriptionResponse] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportSubscriptionResponse: +class ImportSubscriptionResponse(Response): in_app_subscription: InAppSubscriptionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RetrieveStoreSubsResponse: +class RetrieveStoreSubsResponse(Response): in_app_subscriptions: List[InAppSubscriptionResponse] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index 99b439c..30379b6 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -1,5 +1,5 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters @@ -12,7 +12,11 @@ ) +@dataclass class Invoice: + + env: environment.Environment + class Status(Enum): PAID = "paid" POSTED = "posted" @@ -1110,474 +1114,432 @@ class ApplyPaymentScheduleSchemeParams(TypedDict): scheme_id: Required[str] amount: NotRequired[int] - @staticmethod - def create(params: CreateParams = None, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams = None, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("invoices"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def create_for_charge_items_and_charges( - params: CreateForChargeItemsAndChargesParams, env=None, headers=None + self, params: CreateForChargeItemsAndChargesParams, headers=None ) -> CreateForChargeItemsAndChargesResponse: return request.send( "post", request.uri_path("invoices", "create_for_charge_items_and_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForChargeItemsAndChargesResponse, ) - @staticmethod - def charge(params: ChargeParams, env=None, headers=None) -> ChargeResponse: + def charge(self, params: ChargeParams, headers=None) -> ChargeResponse: return request.send( "post", request.uri_path("invoices", "charge"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChargeResponse, ) - @staticmethod def charge_addon( - params: ChargeAddonParams, env=None, headers=None + self, params: ChargeAddonParams, headers=None ) -> ChargeAddonResponse: return request.send( "post", request.uri_path("invoices", "charge_addon"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChargeAddonResponse, ) - @staticmethod def create_for_charge_item( - params: CreateForChargeItemParams, env=None, headers=None + self, params: CreateForChargeItemParams, headers=None ) -> CreateForChargeItemResponse: return request.send( "post", request.uri_path("invoices", "create_for_charge_item"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForChargeItemResponse, ) - @staticmethod def stop_dunning( - id, params: StopDunningParams = None, env=None, headers=None + self, id, params: StopDunningParams = None, headers=None ) -> StopDunningResponse: return request.send( "post", request.uri_path("invoices", id, "stop_dunning"), + self.env, cast(Dict[Any, Any], params), - env, headers, StopDunningResponse, ) - @staticmethod def import_invoice( - params: ImportInvoiceParams, env=None, headers=None + self, params: ImportInvoiceParams, headers=None ) -> ImportInvoiceResponse: return request.send( "post", request.uri_path("invoices", "import_invoice"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportInvoiceResponse, ) - @staticmethod def apply_payments( - id, params: ApplyPaymentsParams = None, env=None, headers=None + self, id, params: ApplyPaymentsParams = None, headers=None ) -> ApplyPaymentsResponse: return request.send( "post", request.uri_path("invoices", id, "apply_payments"), + self.env, cast(Dict[Any, Any], params), - env, headers, ApplyPaymentsResponse, ) - @staticmethod - def sync_usages(id, env=None, headers=None) -> SyncUsagesResponse: + def sync_usages(self, id, headers=None) -> SyncUsagesResponse: return request.send( "post", request.uri_path("invoices", id, "sync_usages"), + self.env, None, - env, headers, SyncUsagesResponse, ) - @staticmethod def delete_line_items( - id, params: DeleteLineItemsParams = None, env=None, headers=None + self, id, params: DeleteLineItemsParams = None, headers=None ) -> DeleteLineItemsResponse: return request.send( "post", request.uri_path("invoices", id, "delete_line_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteLineItemsResponse, ) - @staticmethod def apply_credits( - id, params: ApplyCreditsParams = None, env=None, headers=None + self, id, params: ApplyCreditsParams = None, headers=None ) -> ApplyCreditsResponse: return request.send( "post", request.uri_path("invoices", id, "apply_credits"), + self.env, cast(Dict[Any, Any], params), - env, headers, ApplyCreditsResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("invoices"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def invoices_for_customer( - id, params: InvoicesForCustomerParams = None, env=None, headers=None + self, id, params: InvoicesForCustomerParams = None, headers=None ) -> InvoicesForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "invoices"), + self.env, cast(Dict[Any, Any], params), - env, headers, InvoicesForCustomerResponse, ) - @staticmethod def invoices_for_subscription( - id, params: InvoicesForSubscriptionParams = None, env=None, headers=None + self, id, params: InvoicesForSubscriptionParams = None, headers=None ) -> InvoicesForSubscriptionResponse: return request.send( "get", request.uri_path("subscriptions", id, "invoices"), + self.env, cast(Dict[Any, Any], params), - env, headers, InvoicesForSubscriptionResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("invoices", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + def pdf(self, id, params: PdfParams = None, headers=None) -> PdfResponse: return request.send( "post", request.uri_path("invoices", id, "pdf"), + self.env, cast(Dict[Any, Any], params), - env, headers, PdfResponse, ) - @staticmethod - def download_einvoice(id, env=None, headers=None) -> DownloadEinvoiceResponse: + def download_einvoice(self, id, headers=None) -> DownloadEinvoiceResponse: return request.send( "get", request.uri_path("invoices", id, "download_einvoice"), + self.env, None, - env, headers, DownloadEinvoiceResponse, ) - @staticmethod def list_payment_reference_numbers( - params: ListPaymentReferenceNumbersParams = None, env=None, headers=None + self, params: ListPaymentReferenceNumbersParams = None, headers=None ) -> ListPaymentReferenceNumbersResponse: return request.send( "get", request.uri_path("invoices", "payment_reference_numbers"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListPaymentReferenceNumbersResponse, ) - @staticmethod def add_charge( - id, params: AddChargeParams, env=None, headers=None + self, id, params: AddChargeParams, headers=None ) -> AddChargeResponse: return request.send( "post", request.uri_path("invoices", id, "add_charge"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddChargeResponse, ) - @staticmethod def add_addon_charge( - id, params: AddAddonChargeParams, env=None, headers=None + self, id, params: AddAddonChargeParams, headers=None ) -> AddAddonChargeResponse: return request.send( "post", request.uri_path("invoices", id, "add_addon_charge"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddAddonChargeResponse, ) - @staticmethod def add_charge_item( - id, params: AddChargeItemParams, env=None, headers=None + self, id, params: AddChargeItemParams, headers=None ) -> AddChargeItemResponse: return request.send( "post", request.uri_path("invoices", id, "add_charge_item"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddChargeItemResponse, ) - @staticmethod - def close(id, params: CloseParams = None, env=None, headers=None) -> CloseResponse: + def close(self, id, params: CloseParams = None, headers=None) -> CloseResponse: return request.send( "post", request.uri_path("invoices", id, "close"), + self.env, cast(Dict[Any, Any], params), - env, headers, CloseResponse, ) - @staticmethod def collect_payment( - id, params: CollectPaymentParams = None, env=None, headers=None + self, id, params: CollectPaymentParams = None, headers=None ) -> CollectPaymentResponse: return request.send( "post", request.uri_path("invoices", id, "collect_payment"), + self.env, cast(Dict[Any, Any], params), - env, headers, CollectPaymentResponse, ) - @staticmethod def record_payment( - id, params: RecordPaymentParams, env=None, headers=None + self, id, params: RecordPaymentParams, headers=None ) -> RecordPaymentResponse: return request.send( "post", request.uri_path("invoices", id, "record_payment"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordPaymentResponse, ) - @staticmethod def record_tax_withheld( - id, params: RecordTaxWithheldParams, env=None, headers=None + self, id, params: RecordTaxWithheldParams, headers=None ) -> RecordTaxWithheldResponse: return request.send( "post", request.uri_path("invoices", id, "record_tax_withheld"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordTaxWithheldResponse, ) - @staticmethod def remove_tax_withheld( - id, params: RemoveTaxWithheldParams, env=None, headers=None + self, id, params: RemoveTaxWithheldParams, headers=None ) -> RemoveTaxWithheldResponse: return request.send( "post", request.uri_path("invoices", id, "remove_tax_withheld"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveTaxWithheldResponse, ) - @staticmethod - def refund( - id, params: RefundParams = None, env=None, headers=None - ) -> RefundResponse: + def refund(self, id, params: RefundParams = None, headers=None) -> RefundResponse: return request.send( "post", request.uri_path("invoices", id, "refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RefundResponse, ) - @staticmethod def record_refund( - id, params: RecordRefundParams, env=None, headers=None + self, id, params: RecordRefundParams, headers=None ) -> RecordRefundResponse: return request.send( "post", request.uri_path("invoices", id, "record_refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordRefundResponse, ) - @staticmethod def remove_payment( - id, params: RemovePaymentParams, env=None, headers=None + self, id, params: RemovePaymentParams, headers=None ) -> RemovePaymentResponse: return request.send( "post", request.uri_path("invoices", id, "remove_payment"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemovePaymentResponse, ) - @staticmethod def remove_credit_note( - id, params: RemoveCreditNoteParams, env=None, headers=None + self, id, params: RemoveCreditNoteParams, headers=None ) -> RemoveCreditNoteResponse: return request.send( "post", request.uri_path("invoices", id, "remove_credit_note"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveCreditNoteResponse, ) - @staticmethod def void_invoice( - id, params: VoidInvoiceParams = None, env=None, headers=None + self, id, params: VoidInvoiceParams = None, headers=None ) -> VoidInvoiceResponse: return request.send( "post", request.uri_path("invoices", id, "void"), + self.env, cast(Dict[Any, Any], params), - env, headers, VoidInvoiceResponse, ) - @staticmethod def write_off( - id, params: WriteOffParams = None, env=None, headers=None + self, id, params: WriteOffParams = None, headers=None ) -> WriteOffResponse: return request.send( "post", request.uri_path("invoices", id, "write_off"), + self.env, cast(Dict[Any, Any], params), - env, headers, WriteOffResponse, ) - @staticmethod - def delete( - id, params: DeleteParams = None, env=None, headers=None - ) -> DeleteResponse: + def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("invoices", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod def update_details( - id, params: UpdateDetailsParams = None, env=None, headers=None + self, id, params: UpdateDetailsParams = None, headers=None ) -> UpdateDetailsResponse: return request.send( "post", request.uri_path("invoices", id, "update_details"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateDetailsResponse, ) - @staticmethod def apply_payment_schedule_scheme( - id, params: ApplyPaymentScheduleSchemeParams, env=None, headers=None + self, id, params: ApplyPaymentScheduleSchemeParams, headers=None ) -> ApplyPaymentScheduleSchemeResponse: return request.send( "post", request.uri_path("invoices", id, "apply_payment_schedule_scheme"), + self.env, cast(Dict[Any, Any], params), - env, headers, ApplyPaymentScheduleSchemeResponse, ) - @staticmethod - def payment_schedules(id, env=None, headers=None) -> PaymentSchedulesResponse: + def payment_schedules(self, id, headers=None) -> PaymentSchedulesResponse: return request.send( "get", request.uri_path("invoices", id, "payment_schedules"), + self.env, None, - env, headers, PaymentSchedulesResponse, ) - @staticmethod - def resend_einvoice(id, env=None, headers=None) -> ResendEinvoiceResponse: + def resend_einvoice(self, id, headers=None) -> ResendEinvoiceResponse: return request.send( "post", request.uri_path("invoices", id, "resend_einvoice"), + self.env, None, - env, headers, ResendEinvoiceResponse, ) - @staticmethod - def send_einvoice(id, env=None, headers=None) -> SendEinvoiceResponse: + def send_einvoice(self, id, headers=None) -> SendEinvoiceResponse: return request.send( "post", request.uri_path("invoices", id, "send_einvoice"), + self.env, None, - env, headers, SendEinvoiceResponse, ) diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index 55c2da2..a39ada5 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( credit_note, payment_reference_number, @@ -304,70 +305,70 @@ class InvoiceResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForChargeItemsAndChargesResponse: +class CreateForChargeItemsAndChargesResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChargeResponse: +class ChargeResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChargeAddonResponse: +class ChargeAddonResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForChargeItemResponse: +class CreateForChargeItemResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class StopDunningResponse: +class StopDunningResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportInvoiceResponse: +class ImportInvoiceResponse(Response): invoice: InvoiceResponse credit_note: "credit_note.CreditNoteResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ApplyPaymentsResponse: +class ApplyPaymentsResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SyncUsagesResponse: +class SyncUsagesResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteLineItemsResponse: +class DeleteLineItemsResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ApplyCreditsResponse: +class ApplyCreditsResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -379,7 +380,7 @@ class ListInvoiceResponse: class ListResponse: list: List[ListInvoiceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -391,7 +392,7 @@ class InvoicesForCustomerInvoiceResponse: class InvoicesForCustomerResponse: list: List[InvoicesForCustomerInvoiceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -403,25 +404,25 @@ class InvoicesForSubscriptionInvoiceResponse: class InvoicesForSubscriptionResponse: list: List[InvoicesForSubscriptionInvoiceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PdfResponse: +class PdfResponse(Response): download: "download.DownloadResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class DownloadEinvoiceResponse: downloads: List["download.DownloadResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -433,134 +434,134 @@ class ListPaymentReferenceNumbersInvoiceResponse: class ListPaymentReferenceNumbersResponse: list: List[ListPaymentReferenceNumbersInvoiceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddChargeResponse: +class AddChargeResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddAddonChargeResponse: +class AddAddonChargeResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddChargeItemResponse: +class AddChargeItemResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CloseResponse: +class CloseResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CollectPaymentResponse: +class CollectPaymentResponse(Response): invoice: InvoiceResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordPaymentResponse: +class RecordPaymentResponse(Response): invoice: InvoiceResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordTaxWithheldResponse: +class RecordTaxWithheldResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveTaxWithheldResponse: +class RemoveTaxWithheldResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RefundResponse: +class RefundResponse(Response): invoice: InvoiceResponse transaction: "transaction.TransactionResponse" credit_note: "credit_note.CreditNoteResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordRefundResponse: +class RecordRefundResponse(Response): invoice: InvoiceResponse transaction: "transaction.TransactionResponse" = None credit_note: "credit_note.CreditNoteResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemovePaymentResponse: +class RemovePaymentResponse(Response): invoice: InvoiceResponse transaction: "transaction.TransactionResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveCreditNoteResponse: +class RemoveCreditNoteResponse(Response): invoice: InvoiceResponse credit_note: "credit_note.CreditNoteResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class VoidInvoiceResponse: +class VoidInvoiceResponse(Response): invoice: InvoiceResponse credit_note: "credit_note.CreditNoteResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class WriteOffResponse: +class WriteOffResponse(Response): invoice: InvoiceResponse credit_note: "credit_note.CreditNoteResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateDetailsResponse: +class UpdateDetailsResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ApplyPaymentScheduleSchemeResponse: +class ApplyPaymentScheduleSchemeResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class PaymentSchedulesResponse: payment_schedules: List["payment_schedule.PaymentScheduleResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ResendEinvoiceResponse: +class ResendEinvoiceResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SendEinvoiceResponse: +class SendEinvoiceResponse(Response): invoice: InvoiceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/invoice_estimate/operations.py b/chargebee/models/invoice_estimate/operations.py index f90d4c2..f68adc2 100644 --- a/chargebee/models/invoice_estimate/operations.py +++ b/chargebee/models/invoice_estimate/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 InvoiceEstimate: + + env: environment.Environment + class LineItemEntityType(Enum): ADHOC = "adhoc" PLAN_ITEM_PRICE = "plan_item_price" diff --git a/chargebee/models/item/operations.py b/chargebee/models/item/operations.py index a4f5488..41ba5cf 100644 --- a/chargebee/models/item/operations.py +++ b/chargebee/models/item/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Item: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" ARCHIVED = "archived" @@ -155,54 +159,52 @@ class ListParams(TypedDict): channel: NotRequired[Filters.EnumFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("items", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("items", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("items", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("items"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("items", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) diff --git a/chargebee/models/item/responses.py b/chargebee/models/item/responses.py index d6d5d99..3bfdc9d 100644 --- a/chargebee/models/item/responses.py +++ b/chargebee/models/item/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -53,21 +54,21 @@ class ItemResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): item: ItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: item: ItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): item: ItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -79,10 +80,10 @@ class ListItemResponse: class ListResponse: list: List[ListItemResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): item: ItemResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/item_entitlement/operations.py b/chargebee/models/item_entitlement/operations.py index 34f0c0d..60d100c 100644 --- a/chargebee/models/item_entitlement/operations.py +++ b/chargebee/models/item_entitlement/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 ItemEntitlement: + + env: environment.Environment + class ItemType(Enum): PLAN = "plan" ADDON = "addon" @@ -50,54 +54,50 @@ class UpsertOrRemoveItemEntitlementsForItemParams(TypedDict): ] ] - @staticmethod def item_entitlements_for_item( - id, params: ItemEntitlementsForItemParams = None, env=None, headers=None + self, id, params: ItemEntitlementsForItemParams = None, headers=None ) -> ItemEntitlementsForItemResponse: return request.send( "get", request.uri_path("items", id, "item_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, ItemEntitlementsForItemResponse, ) - @staticmethod def item_entitlements_for_feature( - id, params: ItemEntitlementsForFeatureParams = None, env=None, headers=None + self, id, params: ItemEntitlementsForFeatureParams = None, headers=None ) -> ItemEntitlementsForFeatureResponse: return request.send( "get", request.uri_path("features", id, "item_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, ItemEntitlementsForFeatureResponse, ) - @staticmethod def add_item_entitlements( - id, params: AddItemEntitlementsParams, env=None, headers=None + self, id, params: AddItemEntitlementsParams, headers=None ) -> AddItemEntitlementsResponse: return request.send( "post", request.uri_path("features", id, "item_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddItemEntitlementsResponse, ) - @staticmethod def upsert_or_remove_item_entitlements_for_item( - id, params: UpsertOrRemoveItemEntitlementsForItemParams, env=None, headers=None + self, id, params: UpsertOrRemoveItemEntitlementsForItemParams, headers=None ) -> UpsertOrRemoveItemEntitlementsForItemResponse: return request.send( "post", request.uri_path("items", id, "item_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpsertOrRemoveItemEntitlementsForItemResponse, ) diff --git a/chargebee/models/item_entitlement/responses.py b/chargebee/models/item_entitlement/responses.py index c9631f1..e0603d6 100644 --- a/chargebee/models/item_entitlement/responses.py +++ b/chargebee/models/item_entitlement/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -24,7 +25,7 @@ class ItemEntitlementsForItemItemEntitlementResponse: class ItemEntitlementsForItemResponse: list: List[ItemEntitlementsForItemItemEntitlementResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -36,16 +37,16 @@ class ItemEntitlementsForFeatureItemEntitlementResponse: class ItemEntitlementsForFeatureResponse: list: List[ItemEntitlementsForFeatureItemEntitlementResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddItemEntitlementsResponse: +class AddItemEntitlementsResponse(Response): item_entitlement: ItemEntitlementResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpsertOrRemoveItemEntitlementsForItemResponse: +class UpsertOrRemoveItemEntitlementsForItemResponse(Response): item_entitlement: ItemEntitlementResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/item_family/operations.py b/chargebee/models/item_family/operations.py index fc680f2..d369565 100644 --- a/chargebee/models/item_family/operations.py +++ b/chargebee/models/item_family/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class ItemFamily: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" DELETED = "deleted" @@ -29,59 +33,52 @@ class UpdateParams(TypedDict): name: NotRequired[str] description: NotRequired[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("item_families"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("item_families", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("item_families"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("item_families", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("item_families", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) diff --git a/chargebee/models/item_family/responses.py b/chargebee/models/item_family/responses.py index 5420b77..af9fdd7 100644 --- a/chargebee/models/item_family/responses.py +++ b/chargebee/models/item_family/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -16,15 +17,15 @@ class ItemFamilyResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): item_family: ItemFamilyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: item_family: ItemFamilyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -36,16 +37,16 @@ class ListItemFamilyResponse: class ListResponse: list: List[ListItemFamilyResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): item_family: ItemFamilyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): item_family: ItemFamilyResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/item_price/operations.py b/chargebee/models/item_price/operations.py index 6ca3c04..2c6b3e0 100644 --- a/chargebee/models/item_price/operations.py +++ b/chargebee/models/item_price/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class ItemPrice: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" ARCHIVED = "archived" @@ -162,6 +166,9 @@ class CreateParams(TypedDict): metadata: NotRequired[Dict[Any, Any]] show_description_in_invoices: NotRequired[bool] show_description_in_quotes: NotRequired[bool] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] pricing_model: NotRequired[enums.PricingModel] tiers: NotRequired[List["ItemPrice.CreateTierParams"]] price: NotRequired[int] @@ -185,6 +192,9 @@ class UpdateParams(TypedDict): price_variant_id: NotRequired[str] status: NotRequired["ItemPrice.Status"] external_name: NotRequired[str] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] currency_code: NotRequired[str] invoice_notes: NotRequired[str] is_taxable: NotRequired[bool] @@ -240,83 +250,76 @@ class FindApplicableItemPricesParams(TypedDict): item_id: NotRequired[str] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("item_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("item_prices", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("item_prices", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("item_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("item_prices", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod def find_applicable_items( - id, params: FindApplicableItemsParams = None, env=None, headers=None + self, id, params: FindApplicableItemsParams = None, headers=None ) -> FindApplicableItemsResponse: return request.send( "get", request.uri_path("item_prices", id, "applicable_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, FindApplicableItemsResponse, ) - @staticmethod def find_applicable_item_prices( - id, params: FindApplicableItemPricesParams = None, env=None, headers=None + self, id, params: FindApplicableItemPricesParams = None, headers=None ) -> FindApplicableItemPricesResponse: return request.send( "get", request.uri_path("item_prices", id, "applicable_item_prices"), + self.env, cast(Dict[Any, Any], params), - env, headers, FindApplicableItemPricesResponse, ) diff --git a/chargebee/models/item_price/responses.py b/chargebee/models/item_price/responses.py index 22fe45c..c36abdd 100644 --- a/chargebee/models/item_price/responses.py +++ b/chargebee/models/item_price/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import item @@ -72,6 +73,7 @@ class ItemPriceResponse(Model): resource_version: int = None updated_at: int = None created_at: int = None + usage_accumulation_reset_frequency: str = None archived_at: int = None invoice_notes: str = None tiers: List[TierResponse] = None @@ -88,21 +90,21 @@ class ItemPriceResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): item_price: ItemPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: item_price: ItemPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): item_price: ItemPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -114,13 +116,13 @@ class ListItemPriceResponse: class ListResponse: list: List[ListItemPriceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): item_price: ItemPriceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -132,7 +134,7 @@ class FindApplicableItemsItemPriceResponse: class FindApplicableItemsResponse: list: List[FindApplicableItemsItemPriceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -144,4 +146,4 @@ class FindApplicableItemPricesItemPriceResponse: class FindApplicableItemPricesResponse: list: List[FindApplicableItemPricesItemPriceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/metadata/operations.py b/chargebee/models/metadata/operations.py index 5665d19..1762be9 100644 --- a/chargebee/models/metadata/operations.py +++ b/chargebee/models/metadata/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class Metadata: + env: environment.Environment + pass diff --git a/chargebee/models/order/operations.py b/chargebee/models/order/operations.py index 0187a8f..1824f48 100644 --- a/chargebee/models/order/operations.py +++ b/chargebee/models/order/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, credit_note +@dataclass class Order: + + env: environment.Environment + class Status(Enum): NEW = "new" PROCESSING = "processing" @@ -373,141 +377,128 @@ class ResendParams(TypedDict): resend_reason: NotRequired[str] order_line_items: NotRequired[List["Order.ResendOrderLineItemParams"]] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("orders"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("orders", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod def import_order( - params: ImportOrderParams, env=None, headers=None + self, params: ImportOrderParams, headers=None ) -> ImportOrderResponse: return request.send( "post", request.uri_path("orders", "import_order"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportOrderResponse, ) - @staticmethod - def assign_order_number(id, env=None, headers=None) -> AssignOrderNumberResponse: + def assign_order_number(self, id, headers=None) -> AssignOrderNumberResponse: return request.send( "post", request.uri_path("orders", id, "assign_order_number"), + self.env, None, - env, headers, AssignOrderNumberResponse, ) - @staticmethod - def cancel(id, params: CancelParams, env=None, headers=None) -> CancelResponse: + def cancel(self, id, params: CancelParams, headers=None) -> CancelResponse: return request.send( "post", request.uri_path("orders", id, "cancel"), + self.env, cast(Dict[Any, Any], params), - env, headers, CancelResponse, ) - @staticmethod def create_refundable_credit_note( - id, params: CreateRefundableCreditNoteParams, env=None, headers=None + self, id, params: CreateRefundableCreditNoteParams, headers=None ) -> CreateRefundableCreditNoteResponse: return request.send( "post", request.uri_path("orders", id, "create_refundable_credit_note"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateRefundableCreditNoteResponse, ) - @staticmethod - def reopen( - id, params: ReopenParams = None, env=None, headers=None - ) -> ReopenResponse: + def reopen(self, id, params: ReopenParams = None, headers=None) -> ReopenResponse: return request.send( "post", request.uri_path("orders", id, "reopen"), + self.env, cast(Dict[Any, Any], params), - env, headers, ReopenResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("orders", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("orders", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("orders", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("orders"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def orders_for_invoice( - id, params: OrdersForInvoiceParams = None, env=None, headers=None + self, id, params: OrdersForInvoiceParams = None, headers=None ) -> OrdersForInvoiceResponse: return request.send( "get", request.uri_path("invoices", id, "orders"), + self.env, cast(Dict[Any, Any], params), - env, headers, OrdersForInvoiceResponse, ) - @staticmethod - def resend( - id, params: ResendParams = None, env=None, headers=None - ) -> ResendResponse: + def resend(self, id, params: ResendParams = None, headers=None) -> ResendResponse: return request.send( "post", request.uri_path("orders", id, "resend"), + self.env, cast(Dict[Any, Any], params), - env, headers, ResendResponse, ) diff --git a/chargebee/models/order/responses.py b/chargebee/models/order/responses.py index fdd6451..3741447 100644 --- a/chargebee/models/order/responses.py +++ b/chargebee/models/order/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import credit_note @@ -172,57 +173,57 @@ class OrderResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportOrderResponse: +class ImportOrderResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AssignOrderNumberResponse: +class AssignOrderNumberResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelResponse: +class CancelResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateRefundableCreditNoteResponse: +class CreateRefundableCreditNoteResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ReopenResponse: +class ReopenResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -234,7 +235,7 @@ class ListOrderResponse: class ListResponse: list: List[ListOrderResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -246,10 +247,10 @@ class OrdersForInvoiceOrderResponse: class OrdersForInvoiceResponse: list: List[OrdersForInvoiceOrderResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ResendResponse: +class ResendResponse(Response): order: OrderResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/payment_intent/operations.py b/chargebee/models/payment_intent/operations.py index b275688..03552fe 100644 --- a/chargebee/models/payment_intent/operations.py +++ b/chargebee/models/payment_intent/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.models import gateway_error_detail +@dataclass class PaymentIntent: + + env: environment.Environment + class Status(Enum): INITED = "inited" IN_PROGRESS = "in_progress" @@ -83,37 +87,32 @@ class UpdateParams(TypedDict): success_url: NotRequired[str] failure_url: NotRequired[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("payment_intents"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("payment_intents", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("payment_intents", id), + self.env, None, - env, headers, RetrieveResponse, ) diff --git a/chargebee/models/payment_intent/responses.py b/chargebee/models/payment_intent/responses.py index f3ddb35..2877448 100644 --- a/chargebee/models/payment_intent/responses.py +++ b/chargebee/models/payment_intent/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import gateway_error_detail @@ -41,18 +42,18 @@ class PaymentIntentResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): payment_intent: PaymentIntentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): payment_intent: PaymentIntentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: payment_intent: PaymentIntentResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/payment_reference_number/operations.py b/chargebee/models/payment_reference_number/operations.py index 6459a29..57370be 100644 --- a/chargebee/models/payment_reference_number/operations.py +++ b/chargebee/models/payment_reference_number/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class PaymentReferenceNumber: + + env: environment.Environment + class Type(Enum): KID = "kid" OCR = "ocr" diff --git a/chargebee/models/payment_schedule/operations.py b/chargebee/models/payment_schedule/operations.py index 184ae5a..24a37e8 100644 --- a/chargebee/models/payment_schedule/operations.py +++ b/chargebee/models/payment_schedule/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class PaymentSchedule: + + env: environment.Environment + class EntityType(Enum): INVOICE = "invoice" diff --git a/chargebee/models/payment_schedule_estimate/__init__.py b/chargebee/models/payment_schedule_estimate/__init__.py new file mode 100644 index 0000000..6608f44 --- /dev/null +++ b/chargebee/models/payment_schedule_estimate/__init__.py @@ -0,0 +1,2 @@ +from .operations import PaymentScheduleEstimate +from .responses import PaymentScheduleEstimateResponse diff --git a/chargebee/models/payment_schedule_estimate/operations.py b/chargebee/models/payment_schedule_estimate/operations.py new file mode 100644 index 0000000..ea86597 --- /dev/null +++ b/chargebee/models/payment_schedule_estimate/operations.py @@ -0,0 +1,32 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class PaymentScheduleEstimate: + + env: environment.Environment + + class EntityType(Enum): + INVOICE = "invoice" + + def __str__(self): + return self.value + + class ScheduleEntryStatus(Enum): + POSTED = "posted" + PAYMENT_DUE = "payment_due" + PAID = "paid" + + def __str__(self): + return self.value + + class ScheduleEntry(TypedDict): + id: Required[str] + date: Required[int] + amount: Required[int] + status: Required["PaymentScheduleEstimate.ScheduleEntryStatus"] + + pass diff --git a/chargebee/models/payment_schedule_estimate/responses.py b/chargebee/models/payment_schedule_estimate/responses.py new file mode 100644 index 0000000..fd661c6 --- /dev/null +++ b/chargebee/models/payment_schedule_estimate/responses.py @@ -0,0 +1,23 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ScheduleEntryResponse(Model): + id: str = None + date: int = None + amount: int = None + status: str = None + + +@dataclass +class PaymentScheduleEstimateResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + scheme_id: str = None + entity_type: str = None + entity_id: str = None + amount: int = None + currency_code: str = None + schedule_entries: List[ScheduleEntryResponse] = None diff --git a/chargebee/models/payment_schedule_scheme/operations.py b/chargebee/models/payment_schedule_scheme/operations.py index 50ad04c..fa6aad2 100644 --- a/chargebee/models/payment_schedule_scheme/operations.py +++ b/chargebee/models/payment_schedule_scheme/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class PaymentScheduleScheme: + + env: environment.Environment + class PeriodUnit(Enum): DAY = "day" WEEK = "week" @@ -23,35 +27,32 @@ class CreateParams(TypedDict): period: NotRequired[int] description: NotRequired[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("payment_schedule_schemes"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("payment_schedule_schemes", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("payment_schedule_schemes", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) diff --git a/chargebee/models/payment_schedule_scheme/responses.py b/chargebee/models/payment_schedule_scheme/responses.py index 70614f6..87becdd 100644 --- a/chargebee/models/payment_schedule_scheme/responses.py +++ b/chargebee/models/payment_schedule_scheme/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -13,6 +14,7 @@ class PreferredScheduleResponse(Model): class PaymentScheduleSchemeResponse(Model): raw_data: Dict[Any, Any] = None id: str = None + name: str = None description: str = None number_of_schedules: int = None period_unit: str = None @@ -24,18 +26,18 @@ class PaymentScheduleSchemeResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): payment_schedule_scheme: PaymentScheduleSchemeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: payment_schedule_scheme: PaymentScheduleSchemeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): payment_schedule_scheme: PaymentScheduleSchemeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/payment_source/operations.py b/chargebee/models/payment_source/operations.py index 23cb200..ed2a265 100644 --- a/chargebee/models/payment_source/operations.py +++ b/chargebee/models/payment_source/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, payment_intent +@dataclass class PaymentSource: + + env: environment.Environment + class Status(Enum): VALID = "valid" EXPIRING = "expiring" @@ -37,6 +41,8 @@ class CardBrand(Enum): CARNET = "carnet" RUPAY = "rupay" MAESTRO = "maestro" + DANKORT = "dankort" + CARTES_BANCAIRES = "cartes_bancaires" NOT_APPLICABLE = "not_applicable" def __str__(self): @@ -305,202 +311,184 @@ class SwitchGatewayAccountParams(TypedDict): class ExportPaymentSourceParams(TypedDict): gateway_account_id: Required[str] - @staticmethod def create_using_temp_token( - params: CreateUsingTempTokenParams, env=None, headers=None + self, params: CreateUsingTempTokenParams, headers=None ) -> CreateUsingTempTokenResponse: return request.send( "post", request.uri_path("payment_sources", "create_using_temp_token"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUsingTempTokenResponse, ) - @staticmethod def create_using_permanent_token( - params: CreateUsingPermanentTokenParams, env=None, headers=None + self, params: CreateUsingPermanentTokenParams, headers=None ) -> CreateUsingPermanentTokenResponse: return request.send( "post", request.uri_path("payment_sources", "create_using_permanent_token"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUsingPermanentTokenResponse, ) - @staticmethod def create_using_token( - params: CreateUsingTokenParams, env=None, headers=None + self, params: CreateUsingTokenParams, headers=None ) -> CreateUsingTokenResponse: return request.send( "post", request.uri_path("payment_sources", "create_using_token"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUsingTokenResponse, ) - @staticmethod def create_using_payment_intent( - params: CreateUsingPaymentIntentParams, env=None, headers=None + self, params: CreateUsingPaymentIntentParams, headers=None ) -> CreateUsingPaymentIntentResponse: return request.send( "post", request.uri_path("payment_sources", "create_using_payment_intent"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUsingPaymentIntentResponse, ) - @staticmethod def create_voucher_payment_source( - params: CreateVoucherPaymentSourceParams, env=None, headers=None + self, params: CreateVoucherPaymentSourceParams, headers=None ) -> CreateVoucherPaymentSourceResponse: return request.send( "post", request.uri_path("payment_sources", "create_voucher_payment_source"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateVoucherPaymentSourceResponse, ) - @staticmethod - def create_card( - params: CreateCardParams, env=None, headers=None - ) -> CreateCardResponse: + def create_card(self, params: CreateCardParams, headers=None) -> CreateCardResponse: return request.send( "post", request.uri_path("payment_sources", "create_card"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateCardResponse, ) - @staticmethod def create_bank_account( - params: CreateBankAccountParams, env=None, headers=None + self, params: CreateBankAccountParams, headers=None ) -> CreateBankAccountResponse: return request.send( "post", request.uri_path("payment_sources", "create_bank_account"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateBankAccountResponse, ) - @staticmethod def update_card( - id, params: UpdateCardParams = None, env=None, headers=None + self, id, params: UpdateCardParams = None, headers=None ) -> UpdateCardResponse: return request.send( "post", request.uri_path("payment_sources", id, "update_card"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateCardResponse, ) - @staticmethod def update_bank_account( - id, params: UpdateBankAccountParams = None, env=None, headers=None + self, id, params: UpdateBankAccountParams = None, headers=None ) -> UpdateBankAccountResponse: return request.send( "post", request.uri_path("payment_sources", id, "update_bank_account"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateBankAccountResponse, ) - @staticmethod def verify_bank_account( - id, params: VerifyBankAccountParams, env=None, headers=None + self, id, params: VerifyBankAccountParams, headers=None ) -> VerifyBankAccountResponse: return request.send( "post", request.uri_path("payment_sources", id, "verify_bank_account"), + self.env, cast(Dict[Any, Any], params), - env, headers, VerifyBankAccountResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("payment_sources", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("payment_sources"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def switch_gateway_account( - id, params: SwitchGatewayAccountParams, env=None, headers=None + self, id, params: SwitchGatewayAccountParams, headers=None ) -> SwitchGatewayAccountResponse: return request.send( "post", request.uri_path("payment_sources", id, "switch_gateway_account"), + self.env, cast(Dict[Any, Any], params), - env, headers, SwitchGatewayAccountResponse, ) - @staticmethod def export_payment_source( - id, params: ExportPaymentSourceParams, env=None, headers=None + self, id, params: ExportPaymentSourceParams, headers=None ) -> ExportPaymentSourceResponse: return request.send( "post", request.uri_path("payment_sources", id, "export_payment_source"), + self.env, cast(Dict[Any, Any], params), - env, headers, ExportPaymentSourceResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("payment_sources", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def delete_local(id, env=None, headers=None) -> DeleteLocalResponse: + def delete_local(self, id, headers=None) -> DeleteLocalResponse: return request.send( "post", request.uri_path("payment_sources", id, "delete_local"), + self.env, None, - env, headers, DeleteLocalResponse, ) diff --git a/chargebee/models/payment_source/responses.py b/chargebee/models/payment_source/responses.py index 002ac8d..313c1f9 100644 --- a/chargebee/models/payment_source/responses.py +++ b/chargebee/models/payment_source/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( payment_intent, customer, @@ -134,78 +135,78 @@ class PaymentSourceResponse(Model): @dataclass -class CreateUsingTempTokenResponse: +class CreateUsingTempTokenResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateUsingPermanentTokenResponse: +class CreateUsingPermanentTokenResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateUsingTokenResponse: +class CreateUsingTokenResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateUsingPaymentIntentResponse: +class CreateUsingPaymentIntentResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateVoucherPaymentSourceResponse: +class CreateVoucherPaymentSourceResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateCardResponse: +class CreateCardResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateBankAccountResponse: +class CreateBankAccountResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateCardResponse: +class UpdateCardResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateBankAccountResponse: +class UpdateBankAccountResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class VerifyBankAccountResponse: +class VerifyBankAccountResponse(Response): payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -217,33 +218,33 @@ class ListPaymentSourceResponse: class ListResponse: list: List[ListPaymentSourceResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SwitchGatewayAccountResponse: +class SwitchGatewayAccountResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ExportPaymentSourceResponse: +class ExportPaymentSourceResponse(Response): third_party_payment_method: ( "third_party_payment_method.ThirdPartyPaymentMethodResponse" ) - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteLocalResponse: +class DeleteLocalResponse(Response): customer: "customer.CustomerResponse" payment_source: PaymentSourceResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/payment_voucher/operations.py b/chargebee/models/payment_voucher/operations.py index 511aa72..4fdbcc5 100644 --- a/chargebee/models/payment_voucher/operations.py +++ b/chargebee/models/payment_voucher/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class PaymentVoucher: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" CONSUMED = "consumed" @@ -49,50 +53,46 @@ class PaymentVouchersForCustomerParams(TypedDict): status: NotRequired[Filters.EnumFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("payment_vouchers"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("payment_vouchers", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod def payment_vouchers_for_invoice( - id, params: PaymentVouchersForInvoiceParams = None, env=None, headers=None + self, id, params: PaymentVouchersForInvoiceParams = None, headers=None ) -> PaymentVouchersForInvoiceResponse: return request.send( "get", request.uri_path("invoices", id, "payment_vouchers"), + self.env, cast(Dict[Any, Any], params), - env, headers, PaymentVouchersForInvoiceResponse, ) - @staticmethod def payment_vouchers_for_customer( - id, params: PaymentVouchersForCustomerParams = None, env=None, headers=None + self, id, params: PaymentVouchersForCustomerParams = None, headers=None ) -> PaymentVouchersForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "payment_vouchers"), + self.env, cast(Dict[Any, Any], params), - env, headers, PaymentVouchersForCustomerResponse, ) diff --git a/chargebee/models/payment_voucher/responses.py b/chargebee/models/payment_voucher/responses.py index 2ce6712..884c796 100644 --- a/chargebee/models/payment_voucher/responses.py +++ b/chargebee/models/payment_voucher/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -36,15 +37,15 @@ class PaymentVoucherResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): payment_voucher: PaymentVoucherResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: payment_voucher: PaymentVoucherResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -56,7 +57,7 @@ class PaymentVouchersForInvoicePaymentVoucherResponse: class PaymentVouchersForInvoiceResponse: list: List[PaymentVouchersForInvoicePaymentVoucherResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -68,4 +69,4 @@ class PaymentVouchersForCustomerPaymentVoucherResponse: class PaymentVouchersForCustomerResponse: list: List[PaymentVouchersForCustomerPaymentVoucherResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/plan/operations.py b/chargebee/models/plan/operations.py index a71b9f7..f979e2a 100644 --- a/chargebee/models/plan/operations.py +++ b/chargebee/models/plan/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Plan: + + env: environment.Environment + class PeriodUnit(Enum): DAY = "day" WEEK = "week" @@ -292,74 +296,72 @@ class CopyParams(TypedDict): id: NotRequired[str] for_site_merging: NotRequired[bool] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("plans"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("plans", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("plans"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("plans", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("plans", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("plans", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def copy(params: CopyParams, env=None, headers=None) -> CopyResponse: + def copy(self, params: CopyParams, headers=None) -> CopyResponse: return request.send( "post", request.uri_path("plans", "copy"), + self.env, cast(Dict[Any, Any], params), - env, headers, CopyResponse, ) - @staticmethod - def unarchive(id, env=None, headers=None) -> UnarchiveResponse: + def unarchive(self, id, headers=None) -> UnarchiveResponse: return request.send( "post", request.uri_path("plans", id, "unarchive"), + self.env, None, - env, headers, UnarchiveResponse, ) diff --git a/chargebee/models/plan/responses.py b/chargebee/models/plan/responses.py index 9ccb45f..8c939b2 100644 --- a/chargebee/models/plan/responses.py +++ b/chargebee/models/plan/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -105,15 +106,15 @@ class PlanResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -125,28 +126,28 @@ class ListPlanResponse: class ListResponse: list: List[ListPlanResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CopyResponse: +class CopyResponse(Response): plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UnarchiveResponse: +class UnarchiveResponse(Response): plan: PlanResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/portal_session/operations.py b/chargebee/models/portal_session/operations.py index 26b330b..9f11f52 100644 --- a/chargebee/models/portal_session/operations.py +++ b/chargebee/models/portal_session/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class PortalSession: + + env: environment.Environment + class Status(Enum): CREATED = "created" LOGGED_IN = "logged_in" @@ -33,48 +37,42 @@ class CreateParams(TypedDict): class ActivateParams(TypedDict): token: Required[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("portal_sessions"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("portal_sessions", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def logout(id, env=None, headers=None) -> LogoutResponse: + def logout(self, id, headers=None) -> LogoutResponse: return request.send( "post", request.uri_path("portal_sessions", id, "logout"), + self.env, None, - env, headers, LogoutResponse, ) - @staticmethod - def activate( - id, params: ActivateParams, env=None, headers=None - ) -> ActivateResponse: + def activate(self, id, params: ActivateParams, headers=None) -> ActivateResponse: return request.send( "post", request.uri_path("portal_sessions", id, "activate"), + self.env, cast(Dict[Any, Any], params), - env, headers, ActivateResponse, ) diff --git a/chargebee/models/portal_session/responses.py b/chargebee/models/portal_session/responses.py index 640a8b6..ed6791d 100644 --- a/chargebee/models/portal_session/responses.py +++ b/chargebee/models/portal_session/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -31,24 +32,24 @@ class PortalSessionResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): portal_session: PortalSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: portal_session: PortalSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class LogoutResponse: +class LogoutResponse(Response): portal_session: PortalSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ActivateResponse: +class ActivateResponse(Response): portal_session: PortalSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/price_variant/operations.py b/chargebee/models/price_variant/operations.py index ea9ff85..f1f27ae 100644 --- a/chargebee/models/price_variant/operations.py +++ b/chargebee/models/price_variant/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class PriceVariant: + + env: environment.Environment + class Status(Enum): ACTIVE = "active" ARCHIVED = "archived" @@ -52,57 +56,52 @@ class ListParams(TypedDict): created_at: NotRequired[Filters.TimestampFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("price_variants"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("price_variants", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("price_variants", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("price_variants", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("price_variants"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) diff --git a/chargebee/models/price_variant/responses.py b/chargebee/models/price_variant/responses.py index 944093e..903102a 100644 --- a/chargebee/models/price_variant/responses.py +++ b/chargebee/models/price_variant/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -26,27 +27,27 @@ class PriceVariantResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): price_variant: PriceVariantResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: price_variant: PriceVariantResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): price_variant: PriceVariantResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): price_variant: PriceVariantResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -58,4 +59,4 @@ class ListPriceVariantResponse: class ListResponse: list: List[ListPriceVariantResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/pricing_page_session/operations.py b/chargebee/models/pricing_page_session/operations.py index 5e3685c..2c6d52c 100644 --- a/chargebee/models/pricing_page_session/operations.py +++ b/chargebee/models/pricing_page_session/operations.py @@ -1,11 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.models import enums +@dataclass class PricingPageSession: + env: environment.Environment + class CreateForNewSubscriptionPricingPageParams(TypedDict): id: Required[str] @@ -21,6 +24,17 @@ class CreateForNewSubscriptionCustomerParams(TypedDict): phone: NotRequired[str] locale: NotRequired[str] + class CreateForNewSubscriptionDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + label: NotRequired[str] + class CreateForNewSubscriptionBillingAddressParams(TypedDict): first_name: NotRequired[str] last_name: NotRequired[str] @@ -59,6 +73,17 @@ class CreateForExistingSubscriptionPricingPageParams(TypedDict): class CreateForExistingSubscriptionSubscriptionParams(TypedDict): id: Required[str] + class CreateForExistingSubscriptionDiscountParams(TypedDict): + apply_on: Required[enums.ApplyOn] + duration_type: Required[enums.DurationType] + percentage: NotRequired[float] + amount: NotRequired[int] + period: NotRequired[int] + period_unit: NotRequired[enums.PeriodUnit] + included_in_mrr: NotRequired[bool] + item_price_id: NotRequired[str] + label: NotRequired[str] + class CreateForNewSubscriptionParams(TypedDict): redirect_url: NotRequired[str] pricing_page: Required[ @@ -71,6 +96,9 @@ class CreateForNewSubscriptionParams(TypedDict): customer: NotRequired[ "PricingPageSession.CreateForNewSubscriptionCustomerParams" ] + discounts: Required[ + List["PricingPageSession.CreateForNewSubscriptionDiscountParams"] + ] billing_address: NotRequired[ "PricingPageSession.CreateForNewSubscriptionBillingAddressParams" ] @@ -86,31 +114,32 @@ class CreateForExistingSubscriptionParams(TypedDict): subscription: Required[ "PricingPageSession.CreateForExistingSubscriptionSubscriptionParams" ] + discounts: Required[ + List["PricingPageSession.CreateForExistingSubscriptionDiscountParams"] + ] - @staticmethod def create_for_new_subscription( - params: CreateForNewSubscriptionParams, env=None, headers=None + self, params: CreateForNewSubscriptionParams, headers=None ) -> CreateForNewSubscriptionResponse: return request.send( "post", request.uri_path("pricing_page_sessions", "create_for_new_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForNewSubscriptionResponse, ) - @staticmethod def create_for_existing_subscription( - params: CreateForExistingSubscriptionParams, env=None, headers=None + self, params: CreateForExistingSubscriptionParams, headers=None ) -> CreateForExistingSubscriptionResponse: return request.send( "post", request.uri_path( "pricing_page_sessions", "create_for_existing_subscription" ), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForExistingSubscriptionResponse, ) diff --git a/chargebee/models/pricing_page_session/responses.py b/chargebee/models/pricing_page_session/responses.py index 762697e..df41bda 100644 --- a/chargebee/models/pricing_page_session/responses.py +++ b/chargebee/models/pricing_page_session/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -13,12 +14,12 @@ class PricingPageSessionResponse(Model): @dataclass -class CreateForNewSubscriptionResponse: +class CreateForNewSubscriptionResponse(Response): pricing_page_session: PricingPageSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForExistingSubscriptionResponse: +class CreateForExistingSubscriptionResponse(Response): pricing_page_session: PricingPageSessionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/promotional_credit/operations.py b/chargebee/models/promotional_credit/operations.py index 4ea157a..3d178d4 100644 --- a/chargebee/models/promotional_credit/operations.py +++ b/chargebee/models/promotional_credit/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class PromotionalCredit: + + env: environment.Environment + class Type(Enum): INCREMENT = "increment" DECREMENT = "decrement" @@ -49,57 +53,52 @@ class ListParams(TypedDict): type: NotRequired[Filters.EnumFilter] customer_id: NotRequired[Filters.StringFilter] - @staticmethod - def add(params: AddParams, env=None, headers=None) -> AddResponse: + def add(self, params: AddParams, headers=None) -> AddResponse: return request.send( "post", request.uri_path("promotional_credits", "add"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddResponse, ) - @staticmethod - def deduct(params: DeductParams, env=None, headers=None) -> DeductResponse: + def deduct(self, params: DeductParams, headers=None) -> DeductResponse: return request.send( "post", request.uri_path("promotional_credits", "deduct"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeductResponse, ) - @staticmethod - def set(params: SetParams, env=None, headers=None) -> SetResponse: + def set(self, params: SetParams, headers=None) -> SetResponse: return request.send( "post", request.uri_path("promotional_credits", "set"), + self.env, cast(Dict[Any, Any], params), - env, headers, SetResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("promotional_credits"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("promotional_credits", id), + self.env, None, - env, headers, RetrieveResponse, ) diff --git a/chargebee/models/promotional_credit/responses.py b/chargebee/models/promotional_credit/responses.py index cad8791..91303fd 100644 --- a/chargebee/models/promotional_credit/responses.py +++ b/chargebee/models/promotional_credit/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import customer @@ -22,24 +23,24 @@ class PromotionalCreditResponse(Model): @dataclass -class AddResponse: +class AddResponse(Response): customer: "customer.CustomerResponse" promotional_credit: PromotionalCreditResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeductResponse: +class DeductResponse(Response): customer: "customer.CustomerResponse" promotional_credit: PromotionalCreditResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SetResponse: +class SetResponse(Response): customer: "customer.CustomerResponse" promotional_credit: PromotionalCreditResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -51,10 +52,10 @@ class ListPromotionalCreditResponse: class ListResponse: list: List[ListPromotionalCreditResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: promotional_credit: PromotionalCreditResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/purchase/operations.py b/chargebee/models/purchase/operations.py index 78fe99a..90f4ae1 100644 --- a/chargebee/models/purchase/operations.py +++ b/chargebee/models/purchase/operations.py @@ -1,11 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.models import enums, contract_term +@dataclass class Purchase: + env: environment.Environment + class CreatePurchaseItemParams(TypedDict): index: Required[int] item_price_id: Required[str] @@ -167,24 +170,22 @@ class EstimateParams(TypedDict): client_profile_id: NotRequired[str] customer_id: NotRequired[str] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("purchases"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def estimate(params: EstimateParams, env=None, headers=None) -> EstimateResponse: + def estimate(self, params: EstimateParams, headers=None) -> EstimateResponse: return request.send( "post", request.uri_path("purchases", "estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, EstimateResponse, ) diff --git a/chargebee/models/purchase/responses.py b/chargebee/models/purchase/responses.py index feba67d..7a21e9f 100644 --- a/chargebee/models/purchase/responses.py +++ b/chargebee/models/purchase/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import contract_term, estimate @@ -16,12 +17,12 @@ class PurchaseResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): purchase: PurchaseResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EstimateResponse: +class EstimateResponse(Response): estimate: "estimate.EstimateResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index 971bc0d..9e4cf87 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, contract_term +@dataclass class Quote: + + env: environment.Environment + class Status(Enum): OPEN = "open" ACCEPTED = "accepted" @@ -1230,6 +1234,7 @@ class QuoteLineGroupsForQuoteParams(TypedDict): class ConvertParams(TypedDict): subscription: NotRequired["Quote.ConvertSubscriptionParams"] invoice_date: NotRequired[int] + invoice_immediately: NotRequired[bool] create_pending_invoices: NotRequired[bool] first_invoice_pending: NotRequired[bool] @@ -1247,251 +1252,234 @@ class PdfParams(TypedDict): consolidated_view: NotRequired[bool] disposition_type: NotRequired[enums.DispositionType] - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("quotes", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("quotes", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod def create_sub_for_customer_quote( - id, params: CreateSubForCustomerQuoteParams, env=None, headers=None + self, id, params: CreateSubForCustomerQuoteParams, headers=None ) -> CreateSubForCustomerQuoteResponse: return request.send( "post", request.uri_path("customers", id, "create_subscription_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubForCustomerQuoteResponse, ) - @staticmethod def edit_create_sub_for_customer_quote( - id, params: EditCreateSubForCustomerQuoteParams, env=None, headers=None + self, id, params: EditCreateSubForCustomerQuoteParams, headers=None ) -> EditCreateSubForCustomerQuoteResponse: return request.send( "post", request.uri_path("quotes", id, "edit_create_subscription_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditCreateSubForCustomerQuoteResponse, ) - @staticmethod def update_subscription_quote( - params: UpdateSubscriptionQuoteParams, env=None, headers=None + self, params: UpdateSubscriptionQuoteParams, headers=None ) -> UpdateSubscriptionQuoteResponse: return request.send( "post", request.uri_path("quotes", "update_subscription_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateSubscriptionQuoteResponse, ) - @staticmethod def edit_update_subscription_quote( - id, params: EditUpdateSubscriptionQuoteParams = None, env=None, headers=None + self, id, params: EditUpdateSubscriptionQuoteParams = None, headers=None ) -> EditUpdateSubscriptionQuoteResponse: return request.send( "post", request.uri_path("quotes", id, "edit_update_subscription_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditUpdateSubscriptionQuoteResponse, ) - @staticmethod def create_for_onetime_charges( - params: CreateForOnetimeChargesParams, env=None, headers=None + self, params: CreateForOnetimeChargesParams, headers=None ) -> CreateForOnetimeChargesResponse: return request.send( "post", request.uri_path("quotes", "create_for_onetime_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForOnetimeChargesResponse, ) - @staticmethod def edit_one_time_quote( - id, params: EditOneTimeQuoteParams = None, env=None, headers=None + self, id, params: EditOneTimeQuoteParams = None, headers=None ) -> EditOneTimeQuoteResponse: return request.send( "post", request.uri_path("quotes", id, "edit_one_time_quote"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditOneTimeQuoteResponse, ) - @staticmethod def create_sub_items_for_customer_quote( - id, params: CreateSubItemsForCustomerQuoteParams, env=None, headers=None + self, id, params: CreateSubItemsForCustomerQuoteParams, headers=None ) -> CreateSubItemsForCustomerQuoteResponse: return request.send( "post", request.uri_path("customers", id, "create_subscription_quote_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateSubItemsForCustomerQuoteResponse, ) - @staticmethod def edit_create_sub_customer_quote_for_items( - id, params: EditCreateSubCustomerQuoteForItemsParams, env=None, headers=None + self, id, params: EditCreateSubCustomerQuoteForItemsParams, headers=None ) -> EditCreateSubCustomerQuoteForItemsResponse: return request.send( "post", request.uri_path("quotes", id, "edit_create_subscription_quote_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditCreateSubCustomerQuoteForItemsResponse, ) - @staticmethod def update_subscription_quote_for_items( - params: UpdateSubscriptionQuoteForItemsParams, env=None, headers=None + self, params: UpdateSubscriptionQuoteForItemsParams, headers=None ) -> UpdateSubscriptionQuoteForItemsResponse: return request.send( "post", request.uri_path("quotes", "update_subscription_quote_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateSubscriptionQuoteForItemsResponse, ) - @staticmethod def edit_update_subscription_quote_for_items( - id, params: EditUpdateSubscriptionQuoteForItemsParams, env=None, headers=None + self, id, params: EditUpdateSubscriptionQuoteForItemsParams, headers=None ) -> EditUpdateSubscriptionQuoteForItemsResponse: return request.send( "post", request.uri_path("quotes", id, "edit_update_subscription_quote_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditUpdateSubscriptionQuoteForItemsResponse, ) - @staticmethod def create_for_charge_items_and_charges( - params: CreateForChargeItemsAndChargesParams, env=None, headers=None + self, params: CreateForChargeItemsAndChargesParams, headers=None ) -> CreateForChargeItemsAndChargesResponse: return request.send( "post", request.uri_path("quotes", "create_for_charge_items_and_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForChargeItemsAndChargesResponse, ) - @staticmethod def edit_for_charge_items_and_charges( - id, params: EditForChargeItemsAndChargesParams, env=None, headers=None + self, id, params: EditForChargeItemsAndChargesParams, headers=None ) -> EditForChargeItemsAndChargesResponse: return request.send( "post", request.uri_path("quotes", id, "edit_for_charge_items_and_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditForChargeItemsAndChargesResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("quotes"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def quote_line_groups_for_quote( - id, params: QuoteLineGroupsForQuoteParams = None, env=None, headers=None + self, id, params: QuoteLineGroupsForQuoteParams = None, headers=None ) -> QuoteLineGroupsForQuoteResponse: return request.send( "get", request.uri_path("quotes", id, "quote_line_groups"), + self.env, cast(Dict[Any, Any], params), - env, headers, QuoteLineGroupsForQuoteResponse, ) - @staticmethod def convert( - id, params: ConvertParams = None, env=None, headers=None + self, id, params: ConvertParams = None, headers=None ) -> ConvertResponse: return request.send( "post", request.uri_path("quotes", id, "convert"), + self.env, cast(Dict[Any, Any], params), - env, headers, ConvertResponse, ) - @staticmethod def update_status( - id, params: UpdateStatusParams, env=None, headers=None + self, id, params: UpdateStatusParams, headers=None ) -> UpdateStatusResponse: return request.send( "post", request.uri_path("quotes", id, "update_status"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateStatusResponse, ) - @staticmethod def extend_expiry_date( - id, params: ExtendExpiryDateParams, env=None, headers=None + self, id, params: ExtendExpiryDateParams, headers=None ) -> ExtendExpiryDateResponse: return request.send( "post", request.uri_path("quotes", id, "extend_expiry_date"), + self.env, cast(Dict[Any, Any], params), - env, headers, ExtendExpiryDateResponse, ) - @staticmethod - def delete( - id, params: DeleteParams = None, env=None, headers=None - ) -> DeleteResponse: + def delete(self, id, params: DeleteParams = None, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("quotes", id, "delete"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod - def pdf(id, params: PdfParams = None, env=None, headers=None) -> PdfResponse: + def pdf(self, id, params: PdfParams = None, headers=None) -> PdfResponse: return request.send( "post", request.uri_path("quotes", id, "pdf"), + self.env, cast(Dict[Any, Any], params), - env, headers, PdfResponse, ) diff --git a/chargebee/models/quote/responses.py b/chargebee/models/quote/responses.py index b538f0a..962da81 100644 --- a/chargebee/models/quote/responses.py +++ b/chargebee/models/quote/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( contract_term, quoted_subscription, @@ -185,91 +186,91 @@ class RetrieveResponse: quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateSubForCustomerQuoteResponse: +class CreateSubForCustomerQuoteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditCreateSubForCustomerQuoteResponse: +class EditCreateSubForCustomerQuoteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateSubscriptionQuoteResponse: +class UpdateSubscriptionQuoteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditUpdateSubscriptionQuoteResponse: +class EditUpdateSubscriptionQuoteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForOnetimeChargesResponse: +class CreateForOnetimeChargesResponse(Response): quote: QuoteResponse quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditOneTimeQuoteResponse: +class EditOneTimeQuoteResponse(Response): quote: QuoteResponse quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateSubItemsForCustomerQuoteResponse: +class CreateSubItemsForCustomerQuoteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditCreateSubCustomerQuoteForItemsResponse: +class EditCreateSubCustomerQuoteForItemsResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateSubscriptionQuoteForItemsResponse: +class UpdateSubscriptionQuoteForItemsResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditUpdateSubscriptionQuoteForItemsResponse: +class EditUpdateSubscriptionQuoteForItemsResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForChargeItemsAndChargesResponse: +class CreateForChargeItemsAndChargesResponse(Response): quote: QuoteResponse quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditForChargeItemsAndChargesResponse: +class EditForChargeItemsAndChargesResponse(Response): quote: QuoteResponse quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -282,7 +283,7 @@ class ListQuoteResponse: class ListResponse: list: List[ListQuoteResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -294,11 +295,11 @@ class QuoteLineGroupsForQuoteQuoteResponse: class QuoteLineGroupsForQuoteResponse: list: List[QuoteLineGroupsForQuoteQuoteResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ConvertResponse: +class ConvertResponse(Response): quote: QuoteResponse customer: "customer.CustomerResponse" quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None @@ -307,34 +308,34 @@ class ConvertResponse: invoice: "invoice.InvoiceResponse" = None credit_note: "credit_note.CreditNoteResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateStatusResponse: +class UpdateStatusResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ExtendExpiryDateResponse: +class ExtendExpiryDateResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): quote: QuoteResponse quoted_subscription: "quoted_subscription.QuotedSubscriptionResponse" = None quoted_charge: "quoted_charge.QuotedChargeResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PdfResponse: +class PdfResponse(Response): download: "download.DownloadResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/quote_line_group/operations.py b/chargebee/models/quote_line_group/operations.py index 8fcdb97..f35236f 100644 --- a/chargebee/models/quote_line_group/operations.py +++ b/chargebee/models/quote_line_group/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 QuoteLineGroup: + + env: environment.Environment + class ChargeEvent(Enum): IMMEDIATE = "immediate" SUBSCRIPTION_CREATION = "subscription_creation" diff --git a/chargebee/models/quoted_charge/operations.py b/chargebee/models/quoted_charge/operations.py index 7e7ec95..99cf8d6 100644 --- a/chargebee/models/quoted_charge/operations.py +++ b/chargebee/models/quoted_charge/operations.py @@ -1,11 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.models import enums +@dataclass class QuotedCharge: + env: environment.Environment + class Charge(TypedDict): amount: NotRequired[int] amount_in_decimal: NotRequired[str] diff --git a/chargebee/models/quoted_subscription/operations.py b/chargebee/models/quoted_subscription/operations.py index 6e7b284..87c2839 100644 --- a/chargebee/models/quoted_subscription/operations.py +++ b/chargebee/models/quoted_subscription/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 QuotedSubscription: + + env: environment.Environment + class ChangeOption(Enum): END_OF_TERM = "end_of_term" SPECIFIC_DATE = "specific_date" @@ -57,6 +61,9 @@ class SubscriptionItem(TypedDict): charge_once: NotRequired[bool] charge_on_option: NotRequired[enums.ChargeOnOption] proration_type: NotRequired[enums.ProrationType] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] class ItemTier(TypedDict): item_price_id: Required[str] diff --git a/chargebee/models/quoted_subscription/responses.py b/chargebee/models/quoted_subscription/responses.py index 145623f..b35bac9 100644 --- a/chargebee/models/quoted_subscription/responses.py +++ b/chargebee/models/quoted_subscription/responses.py @@ -31,6 +31,7 @@ class SubscriptionItemResponse(Model): charge_once: bool = None charge_on_option: str = None proration_type: str = None + usage_accumulation_reset_frequency: str = None @dataclass diff --git a/chargebee/models/ramp/operations.py b/chargebee/models/ramp/operations.py index 7b9a842..c82aa51 100644 --- a/chargebee/models/ramp/operations.py +++ b/chargebee/models/ramp/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class Ramp: + + env: environment.Environment + class Status(Enum): SCHEDULED = "scheduled" SUCCEEDED = "succeeded" @@ -205,54 +209,54 @@ class ListParams(TypedDict): updated_at: NotRequired[Filters.TimestampFilter] sort_by: NotRequired[Filters.SortFilter] - @staticmethod def create_for_subscription( - id, params: CreateForSubscriptionParams, env=None, headers=None + self, id, params: CreateForSubscriptionParams, headers=None ) -> CreateForSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "create_ramp"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForSubscriptionResponse, ) - @staticmethod - def update(id, params: UpdateParams, env=None, headers=None) -> UpdateResponse: + def update(self, id, params: UpdateParams, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("ramps", id, "update"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( - "get", request.uri_path("ramps", id), None, env, headers, RetrieveResponse + "get", + request.uri_path("ramps", id), + self.env, + None, + headers, + RetrieveResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("ramps", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("ramps"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) diff --git a/chargebee/models/ramp/responses.py b/chargebee/models/ramp/responses.py index fb6faec..09b04a9 100644 --- a/chargebee/models/ramp/responses.py +++ b/chargebee/models/ramp/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -101,27 +102,27 @@ class RampResponse(Model): @dataclass -class CreateForSubscriptionResponse: +class CreateForSubscriptionResponse(Response): ramp: RampResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): ramp: RampResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: ramp: RampResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): ramp: RampResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -133,4 +134,4 @@ class ListRampResponse: class ListResponse: list: List[ListRampResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/resource_migration/operations.py b/chargebee/models/resource_migration/operations.py index 6c78bcb..0476c8e 100644 --- a/chargebee/models/resource_migration/operations.py +++ b/chargebee/models/resource_migration/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 ResourceMigration: + + env: environment.Environment + class Status(Enum): SCHEDULED = "scheduled" FAILED = "failed" @@ -19,15 +23,14 @@ class RetrieveLatestParams(TypedDict): entity_type: Required[enums.EntityType] entity_id: Required[str] - @staticmethod def retrieve_latest( - params: RetrieveLatestParams, env=None, headers=None + self, params: RetrieveLatestParams, headers=None ) -> RetrieveLatestResponse: return request.send( "get", request.uri_path("resource_migrations", "retrieve_latest"), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveLatestResponse, ) diff --git a/chargebee/models/resource_migration/responses.py b/chargebee/models/resource_migration/responses.py index 7c74a50..5901149 100644 --- a/chargebee/models/resource_migration/responses.py +++ b/chargebee/models/resource_migration/responses.py @@ -18,4 +18,4 @@ class ResourceMigrationResponse(Model): @dataclass class RetrieveLatestResponse: resource_migration: ResourceMigrationResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/site_migration_detail/operations.py b/chargebee/models/site_migration_detail/operations.py index 689805a..e10f300 100644 --- a/chargebee/models/site_migration_detail/operations.py +++ b/chargebee/models/site_migration_detail/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class SiteMigrationDetail: + + env: environment.Environment + class Status(Enum): MOVED_IN = "moved_in" MOVED_OUT = "moved_out" @@ -23,13 +27,12 @@ class ListParams(TypedDict): entity_type: NotRequired[Filters.EnumFilter] status: NotRequired[Filters.EnumFilter] - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("site_migration_details"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) diff --git a/chargebee/models/site_migration_detail/responses.py b/chargebee/models/site_migration_detail/responses.py index 2ea461e..e736c0d 100644 --- a/chargebee/models/site_migration_detail/responses.py +++ b/chargebee/models/site_migration_detail/responses.py @@ -23,4 +23,4 @@ class ListSiteMigrationDetailResponse: class ListResponse: list: List[ListSiteMigrationDetailResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py index b2b4cc4..49bb15e 100644 --- a/chargebee/models/subscription/operations.py +++ b/chargebee/models/subscription/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, unbilled_charge, payment_intent, invoice +@dataclass class Subscription: + + env: environment.Environment + class Status(Enum): FUTURE = "future" IN_TRIAL = "in_trial" @@ -95,6 +99,9 @@ class SubscriptionItem(TypedDict): charge_once: NotRequired[bool] charge_on_option: NotRequired[enums.ChargeOnOption] proration_type: NotRequired[enums.ProrationType] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] class ItemTier(TypedDict): item_price_id: Required[str] @@ -440,6 +447,9 @@ class CreateWithItemsSubscriptionItemParams(TypedDict): charge_once: NotRequired[bool] item_type: NotRequired[enums.ItemType] charge_on_option: NotRequired[enums.ChargeOnOption] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] class CreateWithItemsDiscountParams(TypedDict): apply_on: Required[enums.ApplyOn] @@ -627,6 +637,9 @@ class UpdateForItemsSubscriptionItemParams(TypedDict): charge_on_option: NotRequired[enums.ChargeOnOption] item_type: NotRequired[enums.ItemType] proration_type: NotRequired[enums.ProrationType] + usage_accumulation_reset_frequency: NotRequired[ + enums.UsageAccumulationResetFrequency + ] class UpdateForItemsDiscountParams(TypedDict): apply_on: Required[enums.ApplyOn] @@ -1682,471 +1695,426 @@ class MoveParams(TypedDict): to_customer_id: Required[str] copy_payment_source: NotRequired[bool] - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("subscriptions"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def create_for_customer( - id, params: CreateForCustomerParams, env=None, headers=None + self, id, params: CreateForCustomerParams, headers=None ) -> CreateForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "subscriptions"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateForCustomerResponse, ) - @staticmethod def create_with_items( - id, params: CreateWithItemsParams, env=None, headers=None + self, id, params: CreateWithItemsParams, headers=None ) -> CreateWithItemsResponse: return request.send( "post", request.uri_path("customers", id, "subscription_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateWithItemsResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("subscriptions"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def subscriptions_for_customer( - id, params: SubscriptionsForCustomerParams = None, env=None, headers=None + self, id, params: SubscriptionsForCustomerParams = None, headers=None ) -> SubscriptionsForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "subscriptions"), + self.env, cast(Dict[Any, Any], params), - env, headers, SubscriptionsForCustomerResponse, ) - @staticmethod def contract_terms_for_subscription( - id, params: ContractTermsForSubscriptionParams = None, env=None, headers=None + self, id, params: ContractTermsForSubscriptionParams = None, headers=None ) -> ContractTermsForSubscriptionResponse: return request.send( "get", request.uri_path("subscriptions", id, "contract_terms"), + self.env, cast(Dict[Any, Any], params), - env, headers, ContractTermsForSubscriptionResponse, ) - @staticmethod def list_discounts( - id, params: ListDiscountsParams = None, env=None, headers=None + self, id, params: ListDiscountsParams = None, headers=None ) -> ListDiscountsResponse: return request.send( "get", request.uri_path("subscriptions", id, "discounts"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListDiscountsResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("subscriptions", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod def retrieve_with_scheduled_changes( - id, env=None, headers=None + self, id, headers=None ) -> RetrieveWithScheduledChangesResponse: return request.send( "get", request.uri_path("subscriptions", id, "retrieve_with_scheduled_changes"), + self.env, None, - env, headers, RetrieveWithScheduledChangesResponse, ) - @staticmethod def remove_scheduled_changes( - id, env=None, headers=None + self, id, headers=None ) -> RemoveScheduledChangesResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_scheduled_changes"), + self.env, None, - env, headers, RemoveScheduledChangesResponse, ) - @staticmethod def remove_scheduled_cancellation( - id, params: RemoveScheduledCancellationParams = None, env=None, headers=None + self, id, params: RemoveScheduledCancellationParams = None, headers=None ) -> RemoveScheduledCancellationResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_scheduled_cancellation"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveScheduledCancellationResponse, ) - @staticmethod def remove_coupons( - id, params: RemoveCouponsParams = None, env=None, headers=None + self, id, params: RemoveCouponsParams = None, headers=None ) -> RemoveCouponsResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_coupons"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveCouponsResponse, ) - @staticmethod - def update( - id, params: UpdateParams = None, env=None, headers=None - ) -> UpdateResponse: + def update(self, id, params: UpdateParams = None, headers=None) -> UpdateResponse: return request.send( "post", request.uri_path("subscriptions", id), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateResponse, ) - @staticmethod def update_for_items( - id, params: UpdateForItemsParams, env=None, headers=None + self, id, params: UpdateForItemsParams, headers=None ) -> UpdateForItemsResponse: return request.send( "post", request.uri_path("subscriptions", id, "update_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, UpdateForItemsResponse, ) - @staticmethod def change_term_end( - id, params: ChangeTermEndParams, env=None, headers=None + self, id, params: ChangeTermEndParams, headers=None ) -> ChangeTermEndResponse: return request.send( "post", request.uri_path("subscriptions", id, "change_term_end"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChangeTermEndResponse, ) - @staticmethod def reactivate( - id, params: ReactivateParams = None, env=None, headers=None + self, id, params: ReactivateParams = None, headers=None ) -> ReactivateResponse: return request.send( "post", request.uri_path("subscriptions", id, "reactivate"), + self.env, cast(Dict[Any, Any], params), - env, headers, ReactivateResponse, ) - @staticmethod def add_charge_at_term_end( - id, params: AddChargeAtTermEndParams, env=None, headers=None + self, id, params: AddChargeAtTermEndParams, headers=None ) -> AddChargeAtTermEndResponse: return request.send( "post", request.uri_path("subscriptions", id, "add_charge_at_term_end"), + self.env, cast(Dict[Any, Any], params), - env, headers, AddChargeAtTermEndResponse, ) - @staticmethod def charge_addon_at_term_end( - id, params: ChargeAddonAtTermEndParams, env=None, headers=None + self, id, params: ChargeAddonAtTermEndParams, headers=None ) -> ChargeAddonAtTermEndResponse: return request.send( "post", request.uri_path("subscriptions", id, "charge_addon_at_term_end"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChargeAddonAtTermEndResponse, ) - @staticmethod def charge_future_renewals( - id, params: ChargeFutureRenewalsParams = None, env=None, headers=None + self, id, params: ChargeFutureRenewalsParams = None, headers=None ) -> ChargeFutureRenewalsResponse: return request.send( "post", request.uri_path("subscriptions", id, "charge_future_renewals"), + self.env, cast(Dict[Any, Any], params), - env, headers, ChargeFutureRenewalsResponse, ) - @staticmethod def edit_advance_invoice_schedule( - id, params: EditAdvanceInvoiceScheduleParams = None, env=None, headers=None + self, id, params: EditAdvanceInvoiceScheduleParams = None, headers=None ) -> EditAdvanceInvoiceScheduleResponse: return request.send( "post", request.uri_path("subscriptions", id, "edit_advance_invoice_schedule"), + self.env, cast(Dict[Any, Any], params), - env, headers, EditAdvanceInvoiceScheduleResponse, ) - @staticmethod def retrieve_advance_invoice_schedule( - id, env=None, headers=None + self, id, headers=None ) -> RetrieveAdvanceInvoiceScheduleResponse: return request.send( "get", request.uri_path("subscriptions", id, "retrieve_advance_invoice_schedule"), + self.env, None, - env, headers, RetrieveAdvanceInvoiceScheduleResponse, ) - @staticmethod def remove_advance_invoice_schedule( - id, params: RemoveAdvanceInvoiceScheduleParams = None, env=None, headers=None + self, id, params: RemoveAdvanceInvoiceScheduleParams = None, headers=None ) -> RemoveAdvanceInvoiceScheduleResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_advance_invoice_schedule"), + self.env, cast(Dict[Any, Any], params), - env, headers, RemoveAdvanceInvoiceScheduleResponse, ) - @staticmethod def regenerate_invoice( - id, params: RegenerateInvoiceParams = None, env=None, headers=None + self, id, params: RegenerateInvoiceParams = None, headers=None ) -> RegenerateInvoiceResponse: return request.send( "post", request.uri_path("subscriptions", id, "regenerate_invoice"), + self.env, cast(Dict[Any, Any], params), - env, headers, RegenerateInvoiceResponse, ) - @staticmethod def import_subscription( - params: ImportSubscriptionParams, env=None, headers=None + self, params: ImportSubscriptionParams, headers=None ) -> ImportSubscriptionResponse: return request.send( "post", request.uri_path("subscriptions", "import_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportSubscriptionResponse, ) - @staticmethod def import_for_customer( - id, params: ImportForCustomerParams, env=None, headers=None + self, id, params: ImportForCustomerParams, headers=None ) -> ImportForCustomerResponse: return request.send( "post", request.uri_path("customers", id, "import_subscription"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportForCustomerResponse, ) - @staticmethod def import_contract_term( - id, params: ImportContractTermParams = None, env=None, headers=None + self, id, params: ImportContractTermParams = None, headers=None ) -> ImportContractTermResponse: return request.send( "post", request.uri_path("subscriptions", id, "import_contract_term"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportContractTermResponse, ) - @staticmethod def import_unbilled_charges( - id, params: ImportUnbilledChargesParams, env=None, headers=None + self, id, params: ImportUnbilledChargesParams, headers=None ) -> ImportUnbilledChargesResponse: return request.send( "post", request.uri_path("subscriptions", id, "import_unbilled_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportUnbilledChargesResponse, ) - @staticmethod def import_for_items( - id, params: ImportForItemsParams, env=None, headers=None + self, id, params: ImportForItemsParams, headers=None ) -> ImportForItemsResponse: return request.send( "post", request.uri_path("customers", id, "import_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, ImportForItemsResponse, ) - @staticmethod def override_billing_profile( - id, params: OverrideBillingProfileParams = None, env=None, headers=None + self, id, params: OverrideBillingProfileParams = None, headers=None ) -> OverrideBillingProfileResponse: return request.send( "post", request.uri_path("subscriptions", id, "override_billing_profile"), + self.env, cast(Dict[Any, Any], params), - env, headers, OverrideBillingProfileResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("subscriptions", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def pause(id, params: PauseParams = None, env=None, headers=None) -> PauseResponse: + def pause(self, id, params: PauseParams = None, headers=None) -> PauseResponse: return request.send( "post", request.uri_path("subscriptions", id, "pause"), + self.env, cast(Dict[Any, Any], params), - env, headers, PauseResponse, ) - @staticmethod - def cancel( - id, params: CancelParams = None, env=None, headers=None - ) -> CancelResponse: + def cancel(self, id, params: CancelParams = None, headers=None) -> CancelResponse: return request.send( "post", request.uri_path("subscriptions", id, "cancel"), + self.env, cast(Dict[Any, Any], params), - env, headers, CancelResponse, ) - @staticmethod def cancel_for_items( - id, params: CancelForItemsParams = None, env=None, headers=None + self, id, params: CancelForItemsParams = None, headers=None ) -> CancelForItemsResponse: return request.send( "post", request.uri_path("subscriptions", id, "cancel_for_items"), + self.env, cast(Dict[Any, Any], params), - env, headers, CancelForItemsResponse, ) - @staticmethod - def resume( - id, params: ResumeParams = None, env=None, headers=None - ) -> ResumeResponse: + def resume(self, id, params: ResumeParams = None, headers=None) -> ResumeResponse: return request.send( "post", request.uri_path("subscriptions", id, "resume"), + self.env, cast(Dict[Any, Any], params), - env, headers, ResumeResponse, ) - @staticmethod - def remove_scheduled_pause( - id, env=None, headers=None - ) -> RemoveScheduledPauseResponse: + def remove_scheduled_pause(self, id, headers=None) -> RemoveScheduledPauseResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_scheduled_pause"), + self.env, None, - env, headers, RemoveScheduledPauseResponse, ) - @staticmethod def remove_scheduled_resumption( - id, env=None, headers=None + self, id, headers=None ) -> RemoveScheduledResumptionResponse: return request.send( "post", request.uri_path("subscriptions", id, "remove_scheduled_resumption"), + self.env, None, - env, headers, RemoveScheduledResumptionResponse, ) - @staticmethod - def move(id, params: MoveParams, env=None, headers=None) -> MoveResponse: + def move(self, id, params: MoveParams, headers=None) -> MoveResponse: return request.send( "post", request.uri_path("subscriptions", id, "move"), + self.env, cast(Dict[Any, Any], params), - env, headers, MoveResponse, ) diff --git a/chargebee/models/subscription/responses.py b/chargebee/models/subscription/responses.py index a1f77a6..b9b1c89 100644 --- a/chargebee/models/subscription/responses.py +++ b/chargebee/models/subscription/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import ( unbilled_charge, payment_intent, @@ -41,6 +42,7 @@ class SubscriptionItemResponse(Model): charge_once: bool = None charge_on_option: str = None proration_type: str = None + usage_accumulation_reset_frequency: str = None @dataclass @@ -259,33 +261,33 @@ class SubscriptionResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateForCustomerResponse: +class CreateForCustomerResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateWithItemsResponse: +class CreateWithItemsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -299,7 +301,7 @@ class ListSubscriptionResponse: class ListResponse: list: List[ListSubscriptionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -311,7 +313,7 @@ class SubscriptionsForCustomerSubscriptionResponse: class SubscriptionsForCustomerResponse: list: List[SubscriptionsForCustomerSubscriptionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -323,7 +325,7 @@ class ContractTermsForSubscriptionSubscriptionResponse: class ContractTermsForSubscriptionResponse: list: List[ContractTermsForSubscriptionSubscriptionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -335,7 +337,7 @@ class ListDiscountsSubscriptionResponse: class ListDiscountsResponse: list: List[ListDiscountsSubscriptionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -343,7 +345,7 @@ class RetrieveResponse: subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -351,91 +353,91 @@ class RetrieveWithScheduledChangesResponse: subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveScheduledChangesResponse: +class RemoveScheduledChangesResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveScheduledCancellationResponse: +class RemoveScheduledCancellationResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveCouponsResponse: +class RemoveCouponsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateResponse: +class UpdateResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class UpdateForItemsResponse: +class UpdateForItemsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChangeTermEndResponse: +class ChangeTermEndResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ReactivateResponse: +class ReactivateResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class AddChargeAtTermEndResponse: +class AddChargeAtTermEndResponse(Response): estimate: "estimate.EstimateResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChargeAddonAtTermEndResponse: +class ChargeAddonAtTermEndResponse(Response): estimate: "estimate.EstimateResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ChargeFutureRenewalsResponse: +class ChargeFutureRenewalsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None @@ -443,15 +445,15 @@ class ChargeFutureRenewalsResponse: advance_invoice_schedules: List[ "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" ] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class EditAdvanceInvoiceScheduleResponse: +class EditAdvanceInvoiceScheduleResponse(Response): advance_invoice_schedules: List[ "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" ] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -459,139 +461,139 @@ class RetrieveAdvanceInvoiceScheduleResponse: advance_invoice_schedules: List[ "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" ] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveAdvanceInvoiceScheduleResponse: +class RemoveAdvanceInvoiceScheduleResponse(Response): subscription: SubscriptionResponse advance_invoice_schedules: List[ "advance_invoice_schedule.AdvanceInvoiceScheduleResponse" ] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RegenerateInvoiceResponse: +class RegenerateInvoiceResponse(Response): invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportSubscriptionResponse: +class ImportSubscriptionResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportForCustomerResponse: +class ImportForCustomerResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportContractTermResponse: +class ImportContractTermResponse(Response): contract_term: "contract_term.ContractTermResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportUnbilledChargesResponse: +class ImportUnbilledChargesResponse(Response): unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ImportForItemsResponse: +class ImportForItemsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class OverrideBillingProfileResponse: +class OverrideBillingProfileResponse(Response): subscription: SubscriptionResponse payment_source: "payment_source.PaymentSourceResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PauseResponse: +class PauseResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelResponse: +class CancelResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CancelForItemsResponse: +class CancelForItemsResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None credit_notes: List["credit_note.CreditNoteResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ResumeResponse: +class ResumeResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None invoice: "invoice.InvoiceResponse" = None unbilled_charges: List["unbilled_charge.UnbilledChargeResponse"] = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveScheduledPauseResponse: +class RemoveScheduledPauseResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RemoveScheduledResumptionResponse: +class RemoveScheduledResumptionResponse(Response): subscription: SubscriptionResponse customer: "customer.CustomerResponse" card: "card.CardResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class MoveResponse: +class MoveResponse(Response): subscription: SubscriptionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/subscription_entitlement/operations.py b/chargebee/models/subscription_entitlement/operations.py index 843a2df..ce3f723 100644 --- a/chargebee/models/subscription_entitlement/operations.py +++ b/chargebee/models/subscription_entitlement/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.models import entitlement_override +@dataclass class SubscriptionEntitlement: + + env: environment.Environment + class ScheduleStatus(Enum): ACTIVATED = "activated" SCHEDULED = "scheduled" @@ -39,33 +43,31 @@ class SetSubscriptionEntitlementAvailabilityParams(TypedDict): ] ] - @staticmethod def subscription_entitlements_for_subscription( + self, id, params: SubscriptionEntitlementsForSubscriptionParams = None, - env=None, headers=None, ) -> SubscriptionEntitlementsForSubscriptionResponse: return request.send( "get", request.uri_path("subscriptions", id, "subscription_entitlements"), + self.env, cast(Dict[Any, Any], params), - env, headers, SubscriptionEntitlementsForSubscriptionResponse, ) - @staticmethod def set_subscription_entitlement_availability( - id, params: SetSubscriptionEntitlementAvailabilityParams, env=None, headers=None + self, id, params: SetSubscriptionEntitlementAvailabilityParams, headers=None ) -> SetSubscriptionEntitlementAvailabilityResponse: return request.send( "post", request.uri_path( "subscriptions", id, "subscription_entitlements/set_availability" ), + self.env, cast(Dict[Any, Any], params), - env, headers, SetSubscriptionEntitlementAvailabilityResponse, ) diff --git a/chargebee/models/subscription_entitlement/responses.py b/chargebee/models/subscription_entitlement/responses.py index a36f7b8..1b41bd5 100644 --- a/chargebee/models/subscription_entitlement/responses.py +++ b/chargebee/models/subscription_entitlement/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import entitlement_override @@ -36,10 +37,10 @@ class SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementResponse: class SubscriptionEntitlementsForSubscriptionResponse: list: List[SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class SetSubscriptionEntitlementAvailabilityResponse: +class SetSubscriptionEntitlementAvailabilityResponse(Response): subscription_entitlement: SubscriptionEntitlementResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/subscription_estimate/operations.py b/chargebee/models/subscription_estimate/operations.py index 79be116..3b041a9 100644 --- a/chargebee/models/subscription_estimate/operations.py +++ b/chargebee/models/subscription_estimate/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +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 SubscriptionEstimate: + + env: environment.Environment + class Status(Enum): FUTURE = "future" IN_TRIAL = "in_trial" diff --git a/chargebee/models/tax_withheld/operations.py b/chargebee/models/tax_withheld/operations.py index 50ad7c5..c015415 100644 --- a/chargebee/models/tax_withheld/operations.py +++ b/chargebee/models/tax_withheld/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class TaxWithheld: + + env: environment.Environment + class Type(Enum): PAYMENT = "payment" REFUND = "refund" diff --git a/chargebee/models/third_party_payment_method/operations.py b/chargebee/models/third_party_payment_method/operations.py index 76ac501..cae87f6 100644 --- a/chargebee/models/third_party_payment_method/operations.py +++ b/chargebee/models/third_party_payment_method/operations.py @@ -1,8 +1,11 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +@dataclass class ThirdPartyPaymentMethod: + env: environment.Environment + pass diff --git a/chargebee/models/time_machine/operations.py b/chargebee/models/time_machine/operations.py index 98fad63..3ff85a2 100644 --- a/chargebee/models/time_machine/operations.py +++ b/chargebee/models/time_machine/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum import json from chargebee import OperationFailedError +@dataclass class TimeMachine: + + env: environment.Environment + class TimeTravelStatus(Enum): NOT_ENABLED = "not_enabled" IN_PROGRESS = "in_progress" @@ -17,21 +21,22 @@ def __str__(self): return self.value def wait_for_time_travel_completion( - time_machine: TimeMachineResponse, env=None + self, time_machine: TimeMachineResponse ) -> RetrieveResponse: import time + response: RetrieveResponse = None count = 0 - sleep_time_millis = ( - 3000 if env == None else env.time_travel_sleep_millis + retry_delay_ms = ( + 3000 if self.env is None else self.env.time_travel_retry_delay_ms ) / 1000.0 while time_machine.time_travel_status == "in_progress": if count > 30: raise RuntimeError("Time travel is taking too much time") count += 1 - time.sleep(sleep_time_millis) - response = TimeMachine.retrieve(time_machine.name, env) + time.sleep(retry_delay_ms) + response = self.retrieve(time_machine.name) time_machine = response.time_machine if time_machine.time_travel_status == "failed": @@ -53,39 +58,36 @@ class StartAfreshParams(TypedDict): class TravelForwardParams(TypedDict): destination_time: NotRequired[int] - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("time_machines", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod def start_afresh( - id, params: StartAfreshParams = None, env=None, headers=None + self, id, params: StartAfreshParams = None, headers=None ) -> StartAfreshResponse: return request.send( "post", request.uri_path("time_machines", id, "start_afresh"), + self.env, cast(Dict[Any, Any], params), - env, headers, StartAfreshResponse, ) - @staticmethod def travel_forward( - id, params: TravelForwardParams = None, env=None, headers=None + self, id, params: TravelForwardParams = None, headers=None ) -> TravelForwardResponse: return request.send( "post", request.uri_path("time_machines", id, "travel_forward"), + self.env, cast(Dict[Any, Any], params), - env, headers, TravelForwardResponse, ) diff --git a/chargebee/models/time_machine/responses.py b/chargebee/models/time_machine/responses.py index 1f2eea1..b4c8d81 100644 --- a/chargebee/models/time_machine/responses.py +++ b/chargebee/models/time_machine/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response @dataclass @@ -18,16 +19,16 @@ class TimeMachineResponse(Model): @dataclass class RetrieveResponse: time_machine: TimeMachineResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class StartAfreshResponse: +class StartAfreshResponse(Response): time_machine: TimeMachineResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class TravelForwardResponse: +class TravelForwardResponse(Response): time_machine: TimeMachineResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/token/operations.py b/chargebee/models/token/operations.py index 4f680b7..b1e3681 100644 --- a/chargebee/models/token/operations.py +++ b/chargebee/models/token/operations.py @@ -1,10 +1,14 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum +@dataclass class Token: + + env: environment.Environment + class Status(Enum): NEW = "new" EXPIRED = "expired" diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py index 8423249..a384deb 100644 --- a/chargebee/models/transaction/operations.py +++ b/chargebee/models/transaction/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums, credit_note, invoice, transaction +@dataclass class Transaction: + + env: environment.Environment + class Type(Enum): AUTHORIZATION = "authorization" PAYMENT = "payment" @@ -165,139 +169,126 @@ class PaymentsForInvoiceParams(TypedDict): class DeleteOfflineTransactionParams(TypedDict): comment: NotRequired[str] - @staticmethod def create_authorization( - params: CreateAuthorizationParams, env=None, headers=None + self, params: CreateAuthorizationParams, headers=None ) -> CreateAuthorizationResponse: return request.send( "post", request.uri_path("transactions", "create_authorization"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateAuthorizationResponse, ) - @staticmethod - def void_transaction(id, env=None, headers=None) -> VoidTransactionResponse: + def void_transaction(self, id, headers=None) -> VoidTransactionResponse: return request.send( "post", request.uri_path("transactions", id, "void"), + self.env, None, - env, headers, VoidTransactionResponse, ) - @staticmethod def record_refund( - id, params: RecordRefundParams, env=None, headers=None + self, id, params: RecordRefundParams, headers=None ) -> RecordRefundResponse: return request.send( "post", request.uri_path("transactions", id, "record_refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RecordRefundResponse, ) - @staticmethod def reconcile( - id, params: ReconcileParams = None, env=None, headers=None + self, id, params: ReconcileParams = None, headers=None ) -> ReconcileResponse: return request.send( "post", request.uri_path("transactions", id, "reconcile"), + self.env, cast(Dict[Any, Any], params), - env, headers, ReconcileResponse, ) - @staticmethod - def refund( - id, params: RefundParams = None, env=None, headers=None - ) -> RefundResponse: + def refund(self, id, params: RefundParams = None, headers=None) -> RefundResponse: return request.send( "post", request.uri_path("transactions", id, "refund"), + self.env, cast(Dict[Any, Any], params), - env, headers, RefundResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("transactions"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def transactions_for_customer( - id, params: TransactionsForCustomerParams = None, env=None, headers=None + self, id, params: TransactionsForCustomerParams = None, headers=None ) -> TransactionsForCustomerResponse: return request.send( "get", request.uri_path("customers", id, "transactions"), + self.env, cast(Dict[Any, Any], params), - env, headers, TransactionsForCustomerResponse, ) - @staticmethod def transactions_for_subscription( - id, params: TransactionsForSubscriptionParams = None, env=None, headers=None + self, id, params: TransactionsForSubscriptionParams = None, headers=None ) -> TransactionsForSubscriptionResponse: return request.send( "get", request.uri_path("subscriptions", id, "transactions"), + self.env, cast(Dict[Any, Any], params), - env, headers, TransactionsForSubscriptionResponse, ) - @staticmethod def payments_for_invoice( - id, params: PaymentsForInvoiceParams = None, env=None, headers=None + self, id, params: PaymentsForInvoiceParams = None, headers=None ) -> PaymentsForInvoiceResponse: return request.send( "get", request.uri_path("invoices", id, "payments"), + self.env, cast(Dict[Any, Any], params), - env, headers, PaymentsForInvoiceResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("transactions", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod def delete_offline_transaction( - id, params: DeleteOfflineTransactionParams = None, env=None, headers=None + self, id, params: DeleteOfflineTransactionParams = None, headers=None ) -> DeleteOfflineTransactionResponse: return request.send( "post", request.uri_path("transactions", id, "delete_offline_transaction"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteOfflineTransactionResponse, ) diff --git a/chargebee/models/transaction/responses.py b/chargebee/models/transaction/responses.py index 7cf27cb..a04e1c1 100644 --- a/chargebee/models/transaction/responses.py +++ b/chargebee/models/transaction/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import credit_note, invoice, transaction @@ -112,33 +113,33 @@ class TransactionResponse(Model): @dataclass -class CreateAuthorizationResponse: +class CreateAuthorizationResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class VoidTransactionResponse: +class VoidTransactionResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RecordRefundResponse: +class RecordRefundResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class ReconcileResponse: +class ReconcileResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class RefundResponse: +class RefundResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -150,7 +151,7 @@ class ListTransactionResponse: class ListResponse: list: List[ListTransactionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -162,7 +163,7 @@ class TransactionsForCustomerTransactionResponse: class TransactionsForCustomerResponse: list: List[TransactionsForCustomerTransactionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -174,7 +175,7 @@ class TransactionsForSubscriptionTransactionResponse: class TransactionsForSubscriptionResponse: list: List[TransactionsForSubscriptionTransactionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -186,16 +187,16 @@ class PaymentsForInvoiceTransactionResponse: class PaymentsForInvoiceResponse: list: List[PaymentsForInvoiceTransactionResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteOfflineTransactionResponse: +class DeleteOfflineTransactionResponse(Response): transaction: TransactionResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/unbilled_charge/operations.py b/chargebee/models/unbilled_charge/operations.py index 4eb2886..1dabd58 100644 --- a/chargebee/models/unbilled_charge/operations.py +++ b/chargebee/models/unbilled_charge/operations.py @@ -1,12 +1,16 @@ from .responses import * -from chargebee import request +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 enums +@dataclass class UnbilledCharge: + + env: environment.Environment + class EntityType(Enum): ADHOC = "adhoc" PLAN_ITEM_PRICE = "plan_item_price" @@ -131,74 +135,68 @@ class InvoiceNowEstimateParams(TypedDict): subscription_id: NotRequired[str] customer_id: NotRequired[str] - @staticmethod def create_unbilled_charge( - params: CreateUnbilledChargeParams, env=None, headers=None + self, params: CreateUnbilledChargeParams, headers=None ) -> CreateUnbilledChargeResponse: return request.send( "post", request.uri_path("unbilled_charges", "create"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUnbilledChargeResponse, ) - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("unbilled_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod def invoice_unbilled_charges( - params: InvoiceUnbilledChargesParams = None, env=None, headers=None + self, params: InvoiceUnbilledChargesParams = None, headers=None ) -> InvoiceUnbilledChargesResponse: return request.send( "post", request.uri_path("unbilled_charges", "invoice_unbilled_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, InvoiceUnbilledChargesResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("unbilled_charges", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("unbilled_charges"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod def invoice_now_estimate( - params: InvoiceNowEstimateParams = None, env=None, headers=None + self, params: InvoiceNowEstimateParams = None, headers=None ) -> InvoiceNowEstimateResponse: return request.send( "post", request.uri_path("unbilled_charges", "invoice_now_estimate"), + self.env, cast(Dict[Any, Any], params), - env, headers, InvoiceNowEstimateResponse, ) diff --git a/chargebee/models/unbilled_charge/responses.py b/chargebee/models/unbilled_charge/responses.py index cc1693c..0083698 100644 --- a/chargebee/models/unbilled_charge/responses.py +++ b/chargebee/models/unbilled_charge/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import estimate, invoice @@ -46,27 +47,27 @@ class UnbilledChargeResponse(Model): @dataclass -class CreateUnbilledChargeResponse: +class CreateUnbilledChargeResponse(Response): unbilled_charges: List[UnbilledChargeResponse] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateResponse: +class CreateResponse(Response): unbilled_charges: List[UnbilledChargeResponse] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class InvoiceUnbilledChargesResponse: +class InvoiceUnbilledChargesResponse(Response): invoices: List["invoice.InvoiceResponse"] - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): unbilled_charge: UnbilledChargeResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -78,10 +79,10 @@ class ListUnbilledChargeResponse: class ListResponse: list: List[ListUnbilledChargeResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class InvoiceNowEstimateResponse: +class InvoiceNowEstimateResponse(Response): estimate: "estimate.EstimateResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/usage/operations.py b/chargebee/models/usage/operations.py index 2d7c6f8..5d9b3f5 100644 --- a/chargebee/models/usage/operations.py +++ b/chargebee/models/usage/operations.py @@ -1,12 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from chargebee.filters import Filters from chargebee.models import enums +@dataclass class Usage: + env: environment.Environment + class PdfInvoiceParams(TypedDict): id: Required[str] @@ -40,59 +43,52 @@ class PdfParams(TypedDict): invoice: Required["Usage.PdfInvoiceParams"] disposition_type: NotRequired[enums.DispositionType] - @staticmethod - def create(id, params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, id, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("subscriptions", id, "usages"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve( - id, params: RetrieveParams, env=None, headers=None - ) -> RetrieveResponse: + def retrieve(self, id, params: RetrieveParams, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("subscriptions", id, "usages"), + self.env, cast(Dict[Any, Any], params), - env, headers, RetrieveResponse, ) - @staticmethod - def delete(id, params: DeleteParams, env=None, headers=None) -> DeleteResponse: + def delete(self, id, params: DeleteParams, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("subscriptions", id, "delete_usage"), + self.env, cast(Dict[Any, Any], params), - env, headers, DeleteResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("usages"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def pdf(params: PdfParams, env=None, headers=None) -> PdfResponse: + def pdf(self, params: PdfParams, headers=None) -> PdfResponse: return request.send( "post", request.uri_path("usages", "pdf"), + self.env, cast(Dict[Any, Any], params), - env, headers, PdfResponse, ) diff --git a/chargebee/models/usage/responses.py b/chargebee/models/usage/responses.py index c8822ea..ae6d246 100644 --- a/chargebee/models/usage/responses.py +++ b/chargebee/models/usage/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import download @@ -22,21 +23,21 @@ class UsageResponse(Model): @dataclass -class CreateResponse: +class CreateResponse(Response): usage: UsageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: usage: UsageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): usage: UsageResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -48,10 +49,10 @@ class ListUsageResponse: class ListResponse: list: List[ListUsageResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class PdfResponse: +class PdfResponse(Response): download: "download.DownloadResponse" - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/models/virtual_bank_account/operations.py b/chargebee/models/virtual_bank_account/operations.py index 06ab9ad..208beb8 100644 --- a/chargebee/models/virtual_bank_account/operations.py +++ b/chargebee/models/virtual_bank_account/operations.py @@ -1,11 +1,15 @@ from .responses import * -from chargebee import request +from chargebee import request, environment from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast from enum import Enum from chargebee.filters import Filters +@dataclass class VirtualBankAccount: + + env: environment.Environment + class Scheme(Enum): ACH_CREDIT = "ach_credit" SEPA_CREDIT = "sepa_credit" @@ -35,70 +39,64 @@ class ListParams(TypedDict): updated_at: NotRequired[Filters.TimestampFilter] created_at: NotRequired[Filters.TimestampFilter] - @staticmethod def create_using_permanent_token( - params: CreateUsingPermanentTokenParams, env=None, headers=None + self, params: CreateUsingPermanentTokenParams, headers=None ) -> CreateUsingPermanentTokenResponse: return request.send( "post", request.uri_path("virtual_bank_accounts", "create_using_permanent_token"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateUsingPermanentTokenResponse, ) - @staticmethod - def create(params: CreateParams, env=None, headers=None) -> CreateResponse: + def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( "post", request.uri_path("virtual_bank_accounts"), + self.env, cast(Dict[Any, Any], params), - env, headers, CreateResponse, ) - @staticmethod - def retrieve(id, env=None, headers=None) -> RetrieveResponse: + def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( "get", request.uri_path("virtual_bank_accounts", id), + self.env, None, - env, headers, RetrieveResponse, ) - @staticmethod - def list(params: ListParams = None, env=None, headers=None) -> ListResponse: + def list(self, params: ListParams = None, headers=None) -> ListResponse: return request.send_list_request( "get", request.uri_path("virtual_bank_accounts"), + self.env, cast(Dict[Any, Any], params), - env, headers, ListResponse, ) - @staticmethod - def delete(id, env=None, headers=None) -> DeleteResponse: + def delete(self, id, headers=None) -> DeleteResponse: return request.send( "post", request.uri_path("virtual_bank_accounts", id, "delete"), + self.env, None, - env, headers, DeleteResponse, ) - @staticmethod - def delete_local(id, env=None, headers=None) -> DeleteLocalResponse: + def delete_local(self, id, headers=None) -> DeleteLocalResponse: return request.send( "post", request.uri_path("virtual_bank_accounts", id, "delete_local"), + self.env, None, - env, headers, DeleteLocalResponse, ) diff --git a/chargebee/models/virtual_bank_account/responses.py b/chargebee/models/virtual_bank_account/responses.py index ebef004..7074e52 100644 --- a/chargebee/models/virtual_bank_account/responses.py +++ b/chargebee/models/virtual_bank_account/responses.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from chargebee.model import Model from typing import Dict, List, Any +from chargebee.response import Response from chargebee.models import customer, transaction @@ -25,23 +26,23 @@ class VirtualBankAccountResponse(Model): @dataclass -class CreateUsingPermanentTokenResponse: +class CreateUsingPermanentTokenResponse(Response): virtual_bank_account: VirtualBankAccountResponse customer: "customer.CustomerResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class CreateResponse: +class CreateResponse(Response): virtual_bank_account: VirtualBankAccountResponse customer: "customer.CustomerResponse" = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass class RetrieveResponse: virtual_bank_account: VirtualBankAccountResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass @@ -53,16 +54,16 @@ class ListVirtualBankAccountResponse: class ListResponse: list: List[ListVirtualBankAccountResponse] next_offset: str = None - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteResponse: +class DeleteResponse(Response): virtual_bank_account: VirtualBankAccountResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None @dataclass -class DeleteLocalResponse: +class DeleteLocalResponse(Response): virtual_bank_account: VirtualBankAccountResponse - response_headers: Dict[Any, Any] = None + headers: Dict[str, str] = None diff --git a/chargebee/request.py b/chargebee/request.py index 32b86cb..7fad85c 100644 --- a/chargebee/request.py +++ b/chargebee/request.py @@ -1,8 +1,8 @@ +import json import urllib -from chargebee import util, http_request -from chargebee.main import ChargeBee + from chargebee import compat -import json +from chargebee import util, http_request def lowercase_keys(data): @@ -14,9 +14,7 @@ def lowercase_keys(data): return data -def send_list_request( - method, url, params=None, env=None, headers=None, response_type=None -): +def send_list_request(method, url, env, params=None, headers=None, response_type=None): serialized = {} if params is None: @@ -26,17 +24,15 @@ def send_list_request( if isinstance(v, list): v = json.dumps(v) serialized.update({k: v}) - return send(method, url, serialized, env, headers, response_type) + return send(method, url, env, serialized, headers, response_type) -def send(method, url, params=None, env=None, headers=None, response_type=None): +def send(method, url, env, params=None, headers=None, response_type=None): params = lowercase_keys(params) if params is None: params = {} - env = env or ChargeBee.default_env - ser_params = util.serialize(params) response, response_headers = http_request.request( diff --git a/chargebee/response.py b/chargebee/response.py new file mode 100644 index 0000000..487331b --- /dev/null +++ b/chargebee/response.py @@ -0,0 +1,6 @@ +from dataclasses import dataclass + + +@dataclass +class Response: + is_idempotency_replayed: bool diff --git a/chargebee/responses.py b/chargebee/responses.py index 77826b3..6c0387c 100644 --- a/chargebee/responses.py +++ b/chargebee/responses.py @@ -26,10 +26,9 @@ def __init__(self, response_type: Type[T], response, response_header=None): self._next_offset = response.get("next_offset", None) self._response_header = response_header self._response_type = response_type - self.is_idempotency_replayed() - def is_idempotency_replayed(self): - self._response_header["is_idempotency_replayed"] = bool( + def is_idempotency_replayed(self) -> bool: + return bool( self._response_header.get(self.IDEMPOTENCY_REPLAYED_HEADER, False) ) @@ -38,7 +37,8 @@ def parse_response(self) -> T: for field in fields(self._response_type): field_name = field.name field_type = field.type - + if field_name == "is_idempotency_replayed": + init_data["is_idempotency_replayed"] = self.is_idempotency_replayed() if field_name in self._response: if hasattr(field_type, "__origin__") and field_type.__origin__ == list: list_data = [] @@ -69,7 +69,7 @@ def parse_response(self) -> T: self._response[field_name] ) - init_data["response_headers"] = self._response_header + init_data["headers"] = self._response_header return self._response_type(**init_data) def parse_list_response(self) -> T: @@ -100,6 +100,6 @@ def parse_list_response(self) -> T: result[field_name] = list_data result["next_offset"] = self._next_offset - result["response_headers"] = self._response_header + result["headers"] = self._response_header return self._response_type(**result) diff --git a/chargebee/version.py b/chargebee/version.py index 284c7b5..ff31d4c 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = "3.0.0b1" +VERSION = "3.0.0b2" From 912fca7f35c972a94bd1aa6ce54451c279f3f4f4 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Mon, 13 Jan 2025 16:43:36 +0530 Subject: [PATCH 15/19] Releasing v3.0.0b3. Please check the changelog for the updates. --- CHANGELOG.md | 106 +++++++++++++++++ chargebee/api_error.py | 17 +-- chargebee/http_request.py | 12 +- chargebee/main.py | 7 ++ chargebee/models/__init__.py | 13 +++ chargebee/models/attached_item/operations.py | 1 + chargebee/models/attached_item/responses.py | 1 + chargebee/models/card/operations.py | 1 + chargebee/models/configuration/__init__.py | 2 + chargebee/models/configuration/operations.py | 19 +++ chargebee/models/configuration/responses.py | 16 +++ chargebee/models/coupon/operations.py | 5 + chargebee/models/coupon/responses.py | 1 + chargebee/models/credit_note/operations.py | 8 ++ chargebee/models/credit_note/responses.py | 1 + .../models/credit_note_estimate/operations.py | 8 ++ .../models/credit_note_estimate/responses.py | 1 + chargebee/models/customer/operations.py | 4 +- chargebee/models/customer/responses.py | 1 + .../models/differential_price/operations.py | 1 + .../models/differential_price/responses.py | 1 + chargebee/models/enums.py | 47 ++++++++ chargebee/models/event/operations.py | 2 + chargebee/models/export/operations.py | 8 ++ .../models/gateway_error_detail/responses.py | 1 + chargebee/models/hosted_page/operations.py | 3 + chargebee/models/invoice/operations.py | 11 ++ chargebee/models/invoice/responses.py | 2 + .../models/invoice_estimate/operations.py | 8 ++ .../models/invoice_estimate/responses.py | 1 + chargebee/models/item/operations.py | 3 + chargebee/models/item/responses.py | 1 + chargebee/models/item_family/operations.py | 3 + chargebee/models/item_family/responses.py | 1 + chargebee/models/item_price/operations.py | 3 + chargebee/models/item_price/responses.py | 1 + .../omnichannel_subscription/__init__.py | 2 + .../omnichannel_subscription/operations.py | 110 ++++++++++++++++++ .../omnichannel_subscription/responses.py | 68 +++++++++++ .../omnichannel_subscription_item/__init__.py | 2 + .../operations.py | 39 +++++++ .../responses.py | 19 +++ .../omnichannel_transaction/__init__.py | 2 + .../omnichannel_transaction/operations.py | 19 +++ .../omnichannel_transaction/responses.py | 18 +++ .../payment_schedule_scheme/operations.py | 9 +- chargebee/models/payment_source/operations.py | 3 +- chargebee/models/payment_source/responses.py | 1 + chargebee/models/price_variant/operations.py | 3 + chargebee/models/price_variant/responses.py | 1 + chargebee/models/quote/operations.py | 8 ++ chargebee/models/quote/responses.py | 2 + .../models/quote_line_group/operations.py | 8 ++ .../models/quote_line_group/responses.py | 1 + .../models/quoted_subscription/operations.py | 3 + .../models/quoted_subscription/responses.py | 3 + .../models/recorded_purchase/__init__.py | 2 + .../models/recorded_purchase/operations.py | 62 ++++++++++ .../models/recorded_purchase/responses.py | 43 +++++++ chargebee/models/subscription/operations.py | 27 ++++- chargebee/models/subscription/responses.py | 12 +- chargebee/models/transaction/operations.py | 5 +- chargebee/models/transaction/responses.py | 1 + chargebee/responses.py | 4 +- chargebee/version.py | 2 +- 65 files changed, 776 insertions(+), 24 deletions(-) create mode 100644 chargebee/models/configuration/__init__.py create mode 100644 chargebee/models/configuration/operations.py create mode 100644 chargebee/models/configuration/responses.py create mode 100644 chargebee/models/omnichannel_subscription/__init__.py create mode 100644 chargebee/models/omnichannel_subscription/operations.py create mode 100644 chargebee/models/omnichannel_subscription/responses.py create mode 100644 chargebee/models/omnichannel_subscription_item/__init__.py create mode 100644 chargebee/models/omnichannel_subscription_item/operations.py create mode 100644 chargebee/models/omnichannel_subscription_item/responses.py create mode 100644 chargebee/models/omnichannel_transaction/__init__.py create mode 100644 chargebee/models/omnichannel_transaction/operations.py create mode 100644 chargebee/models/omnichannel_transaction/responses.py create mode 100644 chargebee/models/recorded_purchase/__init__.py create mode 100644 chargebee/models/recorded_purchase/operations.py create mode 100644 chargebee/models/recorded_purchase/responses.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 5071df6..2dec984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,109 @@ +### v3.0.0b3 (2025-01-13) +* * * + +#### New Resource: +* Configuration has been added. +* OmnichannelSubscriptionItem has been added. +* OmnichannelTransaction has been added. +* OmnichannelSubscription has been added. +* RecordedPurchase has been added. + +#### New Attribute: +* discount_type has been added to CreditNote#Discount. +* discount_type has been added to CreditNoteEstimate#Discount. +* discount_type has been added to Invoice#Discount. +* discount_type has been added to InvoiceEstimate#Discount. +* discount_type has been added to QuoteLineGroup#Discount. +* initial_purchase_transaction has been added to OmnichannelSubscription. +* error_cause_id has been added to GatewayErrorDetail. +* error_cause_id has been added to Transaction#GatewayErrorDetail. +* error_cause_id has been added to APIError. +* deleted has been added to Quote. +* current_term_start has been added to QuotedSubscripiton#SubscriptionItem. +* current_term_end has been added to QuotedSubscripiton#SubscriptionItem. +* next_billing_at has been added to QuotedSubscripiton#SubscriptionItem. +* current_term_start has been added to Subscription#SubscriptionItem. +* current_term_end has been added to Subscription#SubscriptionItem. +* next_billing_at has been added to Subscription#SubscriptionItem. +* billing_override has been added to Subscription. +* grace_period_expires_at has been added to OmnichannelSubscriptionItem. +* resource_version has been added to OmnichannelSubscription. +* resource_version has been added to OmnichannelTransaction. +* resource_version has been added to RecordedPurchase. +* business_entity_id has been added to AttachedItem. +* business_entity_id has been added to DifferentialPrice. +* business_entity_id has been added to Items. +* business_entity_id has been added to ItemFamily. +* business_entity_id has been added to ItemPrice. +* business_entity_id has been added to PriceVariant. +* valid_from has been added to coupon. + +#### New Input Params: +* billing_override has been added to Subscription#CreateWithItemsInputParam. +* billing_override has been added to Subscription#UpdateForItemsInputParam. +* limit has been added to OmnichannelSubscription#ListRequest. +* offset has been added to OmnichannelSubscription#ListRequest. +* customer_id has been added to OmnichannelSubscription#ListRequest. +* replace_coupon_list has been added to HostedPage#CheckoutExistingRequest. +* replace_coupon_list has been added to HostedPage#CheckoutExistingForItemsRequest. +* subscription[po_number] has been added to HostedPage#CheckoutNewForItemsRequest. +* business_entity_id has been added to AttachedItem#CreateRequest. +* preferred_scheme has been added to Card#UpdateCardForCustomerRequest. +* valid_from has been added to Coupon#CreateForItem & Coupon#UpdateForItemsRequest. +* preferred_scheme has been added to Customer#CreateRequest & Customer#CollectPaymentRequest. +* business_entity_id has been added to DifferentialPrice#CreateRequest. +* preferred_scheme has been added to Invoice#CreateRequest & Invoice#CreateForChargeItemsAndChargesRequest. +* business_entity_id has been added to Items#CreateRequest. +* business_entity_id & include_site_level_resources have been added to Items#ListItemParams. +* business_entity_id has been added to ItemFamily#CreateRequest. +* business_entity_id & include_site_level_resources have been added to ItemFamily#ListItemFamilyParams. +* business_entity_id has been added to ItemPrice#CreateRequest. +* business_entity_id & include_site_level_resources have been added to ItemPrice#ListItemPriceParams. +* business_entity_id & include_site_level_resources have been added to PriceVariant#ListItemFamilyParams. +* business_entity_id has been added to PriceVariant#CreateRequest. +* business_entity_id & include_site_level_resources have been added to PriceVariant#ListPriceVariantParams. +* preferred_scheme has been added to Subscription#CreateRequest, Subscription#UpdateRequest. +* preferred_scheme Subscription#UpdateForItemsRequest, & Subscription#ImportSubscriptionRequest. +* business_entity_id & include_site_level_resources have been added to Export#ItemFamiliesRequest & Export#ItemsRequest. +* business_entity_id & include_site_level_resources have been added to Export#ItemPricesRequest Export#PriceVariantsRequest +* name & flexible_schedules[period] have been added to PaymentScheduleScheme#CreateRequest. + +#### New Enum Values: +* OMNICHANNEL_SUBSCRIPTION_IMPORTED has been added to EventTypeEnum. +* DISABLED has been added to Event#WebhookStatus. +* OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_STARTED has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_EXPIRED has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_STARTED has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_EXPIRED has been added to EventTypeEnum. +* IGNORED has been added to RecordedPurchase#StatusEnum. +* IN_DUNNING & IN_GRACE_PERIOD have been added to OmnichannelSubscriptionItem#StatusEnum. +* FUTURE has been added to Coupon#StatusEnum. +* EXISTING_CUSTOMER & NEW_CUSTOMER have been added to Coupon#TypeEnum. +* LATE_FAILURE has added to Transation#LinkedPaymentEnum & Transation#StatusEnum. +* OMNICHANNEL_SUBSCRIPTION, has been added to EntityTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM, has been added to EntityTypeEnum. +* OMNICHANNEL_TRANSACTION, has been added to EntityTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_RENEWED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_CREATED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADE_SCHEDULED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_DOWNGRADE_REMOVED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_EXPIRED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLATION_SCHEDULED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CANCELLATION_REMOVED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_RESUBSCRIBED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_UPGRADED, has been added to EventTypeEnum. +* OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLED, has been added to EventTypeEnum. + +#### Removed Subresource: +* OmnichannelSubscriptionItem subresource has been removed from OmnichannelSubscription and is now a standalone resource. + +#### Deprecated Attribute: +* metadata has been deprecated from subscription. + +#### Bug Fixes: +* Fixed issue preventing access to response headers during exceptions. + ### v3.0.0b2 (2024-10-17) * * * diff --git a/chargebee/api_error.py b/chargebee/api_error.py index 4be2126..2551fb5 100644 --- a/chargebee/api_error.py +++ b/chargebee/api_error.py @@ -1,6 +1,6 @@ class APIError(Exception): - def __init__(self, http_code, json_obj): + def __init__(self, http_code, json_obj, headers=None): Exception.__init__(self, json_obj.get("message")) self.json_obj = json_obj self.http_status_code = http_code @@ -8,22 +8,23 @@ def __init__(self, http_code, json_obj): self.api_error_code = json_obj.get("api_error_code") self.param = json_obj.get("param") + self.http_headers = headers self.error_code = json_obj["error_code"] - self.error_cause = json_obj.get('error_cause', None) + self.error_cause = json_obj.get("error_cause", None) self.http_code = http_code self.http_body = None class PaymentError(APIError): - def __init__(self, http_code, json_obj): - APIError.__init__(self, http_code, json_obj) + def __init__(self, http_code, json_obj, headers=None): + APIError.__init__(self, http_code, json_obj, headers) class InvalidRequestError(APIError): - def __init__(self, http_code, json_obj): - APIError.__init__(self, http_code, json_obj) + def __init__(self, http_code, json_obj, headers=None): + APIError.__init__(self, http_code, json_obj, headers) class OperationFailedError(APIError): - def __init__(self, http_code, json_obj): - APIError.__init__(self, http_code, json_obj) + def __init__(self, http_code, json_obj, headers=None): + APIError.__init__(self, http_code, json_obj, headers) diff --git a/chargebee/http_request.py b/chargebee/http_request.py index a05ffcd..766089d 100644 --- a/chargebee/http_request.py +++ b/chargebee/http_request.py @@ -131,12 +131,12 @@ def process_response(url, response, http_code, response_headers): ) if http_code < 200 or http_code > 299: - handle_api_resp_error(url, http_code, resp_json) + handle_api_resp_error(url, http_code, resp_json, response_headers) return resp_json, response_headers -def handle_api_resp_error(url, http_code, resp_json): +def handle_api_resp_error(url, http_code, resp_json, response_headers=None): if "api_error_code" not in resp_json: raise Exception( "The api_error_code is not present. Probably not a chargebee error. \n URL is " @@ -146,10 +146,10 @@ def handle_api_resp_error(url, http_code, resp_json): ) if "payment" == resp_json.get("type"): - raise PaymentError(http_code, resp_json) + raise PaymentError(http_code, resp_json, response_headers) elif "operation_failed" == resp_json.get("type"): - raise OperationFailedError(http_code, resp_json) + raise OperationFailedError(http_code, resp_json, response_headers) elif "invalid_request" == resp_json.get("type"): - raise InvalidRequestError(http_code, resp_json) + raise InvalidRequestError(http_code, resp_json, response_headers) else: - raise APIError(http_code, resp_json) + raise APIError(http_code, resp_json, response_headers) diff --git a/chargebee/main.py b/chargebee/main.py index 3c4dca3..42a066d 100644 --- a/chargebee/main.py +++ b/chargebee/main.py @@ -41,6 +41,7 @@ def __init__( self.BusinessEntityTransfer = chargebee.BusinessEntityTransfer(self.env) self.Card = chargebee.Card(self.env) self.Comment = chargebee.Comment(self.env) + self.Configuration = chargebee.Configuration(self.env) self.Contact = chargebee.Contact(self.env) self.ContractTerm = chargebee.ContractTerm(self.env) self.Coupon = chargebee.Coupon(self.env) @@ -75,6 +76,11 @@ def __init__( self.ItemFamily = chargebee.ItemFamily(self.env) self.ItemPrice = chargebee.ItemPrice(self.env) self.Metadata = chargebee.Metadata(self.env) + self.OmnichannelSubscription = chargebee.OmnichannelSubscription(self.env) + self.OmnichannelSubscriptionItem = chargebee.OmnichannelSubscriptionItem( + self.env + ) + self.OmnichannelTransaction = chargebee.OmnichannelTransaction(self.env) self.Order = chargebee.Order(self.env) self.PaymentIntent = chargebee.PaymentIntent(self.env) self.PaymentReferenceNumber = chargebee.PaymentReferenceNumber(self.env) @@ -94,6 +100,7 @@ def __init__( self.QuotedCharge = chargebee.QuotedCharge(self.env) self.QuotedSubscription = chargebee.QuotedSubscription(self.env) self.Ramp = chargebee.Ramp(self.env) + self.RecordedPurchase = chargebee.RecordedPurchase(self.env) self.ResourceMigration = chargebee.ResourceMigration(self.env) self.SiteMigrationDetail = chargebee.SiteMigrationDetail(self.env) self.Subscription = chargebee.Subscription(self.env) diff --git a/chargebee/models/__init__.py b/chargebee/models/__init__.py index b3368b3..7e48126 100644 --- a/chargebee/models/__init__.py +++ b/chargebee/models/__init__.py @@ -54,6 +54,7 @@ PeriodUnit, PriceType, PricingModel, + ProductCatalogVersion, ProrationType, ReferralSystem, ReferrerRewardType, @@ -97,6 +98,8 @@ from chargebee.models.comment.operations import Comment +from chargebee.models.configuration.operations import Configuration + from chargebee.models.contact.operations import Contact from chargebee.models.contract_term.operations import ContractTerm @@ -165,6 +168,14 @@ from chargebee.models.metadata.operations import Metadata +from chargebee.models.omnichannel_subscription.operations import OmnichannelSubscription + +from chargebee.models.omnichannel_subscription_item.operations import ( + OmnichannelSubscriptionItem, +) + +from chargebee.models.omnichannel_transaction.operations import OmnichannelTransaction + from chargebee.models.order.operations import Order from chargebee.models.payment_intent.operations import PaymentIntent @@ -205,6 +216,8 @@ from chargebee.models.ramp.operations import Ramp +from chargebee.models.recorded_purchase.operations import RecordedPurchase + from chargebee.models.resource_migration.operations import ResourceMigration from chargebee.models.site_migration_detail.operations import SiteMigrationDetail diff --git a/chargebee/models/attached_item/operations.py b/chargebee/models/attached_item/operations.py index 42e52a4..7504847 100644 --- a/chargebee/models/attached_item/operations.py +++ b/chargebee/models/attached_item/operations.py @@ -35,6 +35,7 @@ class CreateParams(TypedDict): quantity_in_decimal: NotRequired[str] charge_on_event: NotRequired[enums.ChargeOnEvent] charge_once: NotRequired[bool] + business_entity_id: NotRequired[str] class UpdateParams(TypedDict): parent_item_id: Required[str] diff --git a/chargebee/models/attached_item/responses.py b/chargebee/models/attached_item/responses.py index 2ed0222..cd0cc1d 100644 --- a/chargebee/models/attached_item/responses.py +++ b/chargebee/models/attached_item/responses.py @@ -21,6 +21,7 @@ class AttachedItemResponse(Model): resource_version: int = None updated_at: int = None channel: str = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py index 56d0621..06315a2 100644 --- a/chargebee/models/card/operations.py +++ b/chargebee/models/card/operations.py @@ -80,6 +80,7 @@ class UpdateCardForCustomerParams(TypedDict): expiry_month: Required[int] expiry_year: Required[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] diff --git a/chargebee/models/configuration/__init__.py b/chargebee/models/configuration/__init__.py new file mode 100644 index 0000000..1f8d81e --- /dev/null +++ b/chargebee/models/configuration/__init__.py @@ -0,0 +1,2 @@ +from .operations import Configuration +from .responses import ConfigurationResponse diff --git a/chargebee/models/configuration/operations.py b/chargebee/models/configuration/operations.py new file mode 100644 index 0000000..fa83b0c --- /dev/null +++ b/chargebee/models/configuration/operations.py @@ -0,0 +1,19 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast + + +@dataclass +class Configuration: + + env: environment.Environment + + def list(self, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("configurations"), + self.env, + None, + headers, + ListResponse, + ) diff --git a/chargebee/models/configuration/responses.py b/chargebee/models/configuration/responses.py new file mode 100644 index 0000000..3c0c331 --- /dev/null +++ b/chargebee/models/configuration/responses.py @@ -0,0 +1,16 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class ConfigurationResponse(Model): + raw_data: Dict[Any, Any] = None + domain: str = None + product_catalog_version: str = None + + +@dataclass +class ListResponse: + configurations: List[ConfigurationResponse] + headers: Dict[str, str] = None diff --git a/chargebee/models/coupon/operations.py b/chargebee/models/coupon/operations.py index 464bdf5..fd3c05a 100644 --- a/chargebee/models/coupon/operations.py +++ b/chargebee/models/coupon/operations.py @@ -32,6 +32,7 @@ class Status(Enum): EXPIRED = "expired" ARCHIVED = "archived" DELETED = "deleted" + FUTURE = "future" def __str__(self): return self.value @@ -104,6 +105,8 @@ def __str__(self): class CouponConstraintType(Enum): MAX_REDEMPTIONS = "max_redemptions" UNIQUE_BY = "unique_by" + EXISTING_CUSTOMER = "existing_customer" + NEW_CUSTOMER = "new_customer" def __str__(self): return self.value @@ -193,6 +196,7 @@ class CreateForItemsParams(TypedDict): apply_on: Required["Coupon.ApplyOn"] duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] + valid_from: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] invoice_notes: NotRequired[str] @@ -220,6 +224,7 @@ class UpdateForItemsParams(TypedDict): apply_on: NotRequired["Coupon.ApplyOn"] duration_type: NotRequired["Coupon.DurationType"] duration_month: NotRequired[int] + valid_from: NotRequired[int] valid_till: NotRequired[int] max_redemptions: NotRequired[int] invoice_notes: NotRequired[str] diff --git a/chargebee/models/coupon/responses.py b/chargebee/models/coupon/responses.py index 7848fea..fc4f899 100644 --- a/chargebee/models/coupon/responses.py +++ b/chargebee/models/coupon/responses.py @@ -39,6 +39,7 @@ class CouponResponse(Model): currency_code: str = None duration_type: str = None duration_month: int = None + valid_from: int = None valid_till: int = None max_redemptions: int = None status: str = None diff --git a/chargebee/models/credit_note/operations.py b/chargebee/models/credit_note/operations.py index 94b205b..36affef 100644 --- a/chargebee/models/credit_note/operations.py +++ b/chargebee/models/credit_note/operations.py @@ -78,6 +78,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -125,6 +132,7 @@ 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] diff --git a/chargebee/models/credit_note/responses.py b/chargebee/models/credit_note/responses.py index bc8e487..afe6692 100644 --- a/chargebee/models/credit_note/responses.py +++ b/chargebee/models/credit_note/responses.py @@ -46,6 +46,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None diff --git a/chargebee/models/credit_note_estimate/operations.py b/chargebee/models/credit_note_estimate/operations.py index 156bfe3..c1d6e0c 100644 --- a/chargebee/models/credit_note_estimate/operations.py +++ b/chargebee/models/credit_note_estimate/operations.py @@ -40,6 +40,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -81,6 +88,7 @@ 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] diff --git a/chargebee/models/credit_note_estimate/responses.py b/chargebee/models/credit_note_estimate/responses.py index 1785373..0f68c8d 100644 --- a/chargebee/models/credit_note_estimate/responses.py +++ b/chargebee/models/credit_note_estimate/responses.py @@ -36,6 +36,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None diff --git a/chargebee/models/customer/operations.py b/chargebee/models/customer/operations.py index ee3ccdf..d296508 100644 --- a/chargebee/models/customer/operations.py +++ b/chargebee/models/customer/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 enums, payment_intent +from chargebee.models import enums, payment_intent, card @dataclass @@ -200,6 +200,7 @@ class CreateCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -375,6 +376,7 @@ class CollectPaymentCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] diff --git a/chargebee/models/customer/responses.py b/chargebee/models/customer/responses.py index b5b51af..234ddc1 100644 --- a/chargebee/models/customer/responses.py +++ b/chargebee/models/customer/responses.py @@ -5,6 +5,7 @@ from chargebee.models import ( payment_intent, card, + card, payment_source, resource_migration, hierarchy, diff --git a/chargebee/models/differential_price/operations.py b/chargebee/models/differential_price/operations.py index e02b56a..6fb85f4 100644 --- a/chargebee/models/differential_price/operations.py +++ b/chargebee/models/differential_price/operations.py @@ -68,6 +68,7 @@ class CreateParams(TypedDict): price_in_decimal: NotRequired[str] parent_periods: Required[List["DifferentialPrice.CreateParentPeriodParams"]] tiers: NotRequired[List["DifferentialPrice.CreateTierParams"]] + business_entity_id: NotRequired[str] class RetrieveParams(TypedDict): item_price_id: Required[str] diff --git a/chargebee/models/differential_price/responses.py b/chargebee/models/differential_price/responses.py index 84d9335..49bfcd1 100644 --- a/chargebee/models/differential_price/responses.py +++ b/chargebee/models/differential_price/responses.py @@ -36,6 +36,7 @@ class DifferentialPriceResponse(Model): tiers: List[TierResponse] = None currency_code: str = None parent_periods: List[ParentPeriodResponse] = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/enums.py b/chargebee/models/enums.py index 6bb6bad..43a1d53 100644 --- a/chargebee/models/enums.py +++ b/chargebee/models/enums.py @@ -332,6 +332,9 @@ class EntityType(Enum): ITEM_ENTITLEMENT = "item_entitlement" BUSINESS_ENTITY = "business_entity" PRICE_VARIANT = "price_variant" + OMNICHANNEL_SUBSCRIPTION = "omnichannel_subscription" + OMNICHANNEL_SUBSCRIPTION_ITEM = "omnichannel_subscription_item" + OMNICHANNEL_TRANSACTION = "omnichannel_transaction" def __str__(self): return self.value @@ -532,6 +535,42 @@ class EventType(Enum): SUBSCRIPTION_MOVED_IN = "subscription_moved_in" SUBSCRIPTION_MOVED_OUT = "subscription_moved_out" SUBSCRIPTION_MOVEMENT_FAILED = "subscription_movement_failed" + OMNICHANNEL_SUBSCRIPTION_CREATED = "omnichannel_subscription_created" + OMNICHANNEL_SUBSCRIPTION_ITEM_RENEWED = "omnichannel_subscription_item_renewed" + OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADE_SCHEDULED = ( + "omnichannel_subscription_item_downgrade_scheduled" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_DOWNGRADE_REMOVED = ( + "omnichannel_subscription_item_scheduled_downgrade_removed" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_DOWNGRADED = ( + "omnichannel_subscription_item_downgraded" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_EXPIRED = "omnichannel_subscription_item_expired" + OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLATION_SCHEDULED = ( + "omnichannel_subscription_item_cancellation_scheduled" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_SCHEDULED_CANCELLATION_REMOVED = ( + "omnichannel_subscription_item_scheduled_cancellation_removed" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_RESUBSCRIBED = ( + "omnichannel_subscription_item_resubscribed" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_UPGRADED = "omnichannel_subscription_item_upgraded" + OMNICHANNEL_SUBSCRIPTION_ITEM_CANCELLED = "omnichannel_subscription_item_cancelled" + OMNICHANNEL_SUBSCRIPTION_IMPORTED = "omnichannel_subscription_imported" + OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_STARTED = ( + "omnichannel_subscription_item_grace_period_started" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_GRACE_PERIOD_EXPIRED = ( + "omnichannel_subscription_item_grace_period_expired" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_STARTED = ( + "omnichannel_subscription_item_dunning_started" + ) + OMNICHANNEL_SUBSCRIPTION_ITEM_DUNNING_EXPIRED = ( + "omnichannel_subscription_item_dunning_expired" + ) PLAN_CREATED = "plan_created" PLAN_UPDATED = "plan_updated" PLAN_DELETED = "plan_deleted" @@ -840,6 +879,14 @@ def __str__(self): return self.value +class ProductCatalogVersion(Enum): + V1 = "v1" + V2 = "v2" + + def __str__(self): + return self.value + + class ProrationType(Enum): FULL_TERM = "full_term" PARTIAL_TERM = "partial_term" diff --git a/chargebee/models/event/operations.py b/chargebee/models/event/operations.py index 4b9f478..bd2478f 100644 --- a/chargebee/models/event/operations.py +++ b/chargebee/models/event/operations.py @@ -20,6 +20,7 @@ class WebhookStatus(Enum): FAILED = "failed" SKIPPED = "skipped" NOT_APPLICABLE = "not_applicable" + DISABLED = "disabled" def __str__(self): return self.value @@ -32,6 +33,7 @@ class WebhookWebhookStatus(Enum): FAILED = "failed" SKIPPED = "skipped" NOT_APPLICABLE = "not_applicable" + DISABLED = "disabled" def __str__(self): return self.value diff --git a/chargebee/models/export/operations.py b/chargebee/models/export/operations.py index b59cedf..4d79f25 100644 --- a/chargebee/models/export/operations.py +++ b/chargebee/models/export/operations.py @@ -433,15 +433,21 @@ class OrdersParams(TypedDict): class ItemFamiliesParams(TypedDict): item_family: NotRequired["Export.ItemFamiliesItemFamilyParams"] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] class ItemsParams(TypedDict): item: NotRequired["Export.ItemsItemParams"] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] class ItemPricesParams(TypedDict): item_price: NotRequired["Export.ItemPricesItemPriceParams"] item_family_id: NotRequired[Filters.StringFilter] item_type: NotRequired[Filters.EnumFilter] currency_code: NotRequired[Filters.StringFilter] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] class AttachedItemsParams(TypedDict): attached_item: NotRequired["Export.AttachedItemsAttachedItemParams"] @@ -455,6 +461,8 @@ class DifferentialPricesParams(TypedDict): class PriceVariantsParams(TypedDict): price_variant: NotRequired["Export.PriceVariantsPriceVariantParams"] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] def retrieve(self, id, headers=None) -> RetrieveResponse: return request.send( diff --git a/chargebee/models/gateway_error_detail/responses.py b/chargebee/models/gateway_error_detail/responses.py index d7e8dae..beae84c 100644 --- a/chargebee/models/gateway_error_detail/responses.py +++ b/chargebee/models/gateway_error_detail/responses.py @@ -19,3 +19,4 @@ class GatewayErrorDetailResponse(Model): recommendation_message: str = None processor_error_code: str = None processor_error_message: str = None + error_cause_id: str = None diff --git a/chargebee/models/hosted_page/operations.py b/chargebee/models/hosted_page/operations.py index 3506234..a54642e 100644 --- a/chargebee/models/hosted_page/operations.py +++ b/chargebee/models/hosted_page/operations.py @@ -319,6 +319,7 @@ class CheckoutNewForItemsSubscriptionParams(TypedDict): coupon: NotRequired[str] auto_collection: NotRequired[enums.AutoCollection] invoice_notes: NotRequired[str] + po_number: NotRequired[str] contract_term_billing_cycle_on_renewal: NotRequired[int] class CheckoutNewForItemsCustomerParams(TypedDict): @@ -724,6 +725,7 @@ class CheckoutExistingParams(TypedDict): reactivate_from: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] reactivate: NotRequired[bool] force_term_reset: NotRequired[bool] customer: NotRequired["HostedPage.CheckoutExistingCustomerParams"] @@ -754,6 +756,7 @@ class CheckoutExistingForItemsParams(TypedDict): reactivate_from: NotRequired[int] billing_alignment_mode: NotRequired[enums.BillingAlignmentMode] coupon_ids: NotRequired[List[str]] + replace_coupon_list: NotRequired[bool] reactivate: NotRequired[bool] force_term_reset: NotRequired[bool] change_option: NotRequired[enums.ChangeOption] diff --git a/chargebee/models/invoice/operations.py b/chargebee/models/invoice/operations.py index 30379b6..e67f4f4 100644 --- a/chargebee/models/invoice/operations.py +++ b/chargebee/models/invoice/operations.py @@ -9,6 +9,7 @@ payment_reference_number, payment_intent, transaction, + card, ) @@ -60,6 +61,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -150,6 +158,7 @@ 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] @@ -362,6 +371,7 @@ class CreateCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -488,6 +498,7 @@ class CreateForChargeItemsAndChargesCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] diff --git a/chargebee/models/invoice/responses.py b/chargebee/models/invoice/responses.py index a39ada5..4cd66c1 100644 --- a/chargebee/models/invoice/responses.py +++ b/chargebee/models/invoice/responses.py @@ -7,6 +7,7 @@ payment_reference_number, payment_intent, transaction, + card, credit_note, transaction, payment_schedule, @@ -48,6 +49,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None diff --git a/chargebee/models/invoice_estimate/operations.py b/chargebee/models/invoice_estimate/operations.py index f68adc2..41152b8 100644 --- a/chargebee/models/invoice_estimate/operations.py +++ b/chargebee/models/invoice_estimate/operations.py @@ -33,6 +33,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -74,6 +81,7 @@ 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] diff --git a/chargebee/models/invoice_estimate/responses.py b/chargebee/models/invoice_estimate/responses.py index cd1986d..773793e 100644 --- a/chargebee/models/invoice_estimate/responses.py +++ b/chargebee/models/invoice_estimate/responses.py @@ -36,6 +36,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None diff --git a/chargebee/models/item/operations.py b/chargebee/models/item/operations.py index 41ba5cf..3108e6d 100644 --- a/chargebee/models/item/operations.py +++ b/chargebee/models/item/operations.py @@ -112,6 +112,7 @@ class CreateParams(TypedDict): metered: NotRequired[bool] usage_calculation: NotRequired["Item.UsageCalculation"] metadata: NotRequired[Dict[Any, Any]] + business_entity_id: NotRequired[str] bundle_items_to_add: NotRequired[List["Item.CreateBundleItemsToAddParams"]] class UpdateParams(TypedDict): @@ -157,6 +158,8 @@ class ListParams(TypedDict): metered: NotRequired[Filters.BooleanFilter] usage_calculation: NotRequired[Filters.EnumFilter] channel: NotRequired[Filters.EnumFilter] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] sort_by: NotRequired[Filters.SortFilter] def create(self, params: CreateParams, headers=None) -> CreateResponse: diff --git a/chargebee/models/item/responses.py b/chargebee/models/item/responses.py index 3bfdc9d..9cb680a 100644 --- a/chargebee/models/item/responses.py +++ b/chargebee/models/item/responses.py @@ -51,6 +51,7 @@ class ItemResponse(Model): bundle_items: List[BundleItemResponse] = None bundle_configuration: BundleConfigurationResponse = None metadata: Dict[Any, Any] = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/item_family/operations.py b/chargebee/models/item_family/operations.py index d369565..fd08def 100644 --- a/chargebee/models/item_family/operations.py +++ b/chargebee/models/item_family/operations.py @@ -21,6 +21,7 @@ class CreateParams(TypedDict): id: Required[str] name: Required[str] description: NotRequired[str] + business_entity_id: NotRequired[str] class ListParams(TypedDict): limit: NotRequired[int] @@ -28,6 +29,8 @@ class ListParams(TypedDict): id: NotRequired[Filters.StringFilter] name: NotRequired[Filters.StringFilter] updated_at: NotRequired[Filters.TimestampFilter] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] class UpdateParams(TypedDict): name: NotRequired[str] diff --git a/chargebee/models/item_family/responses.py b/chargebee/models/item_family/responses.py index af9fdd7..7e916db 100644 --- a/chargebee/models/item_family/responses.py +++ b/chargebee/models/item_family/responses.py @@ -14,6 +14,7 @@ class ItemFamilyResponse(Model): resource_version: int = None updated_at: int = None channel: str = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/item_price/operations.py b/chargebee/models/item_price/operations.py index 2c6b3e0..e8116d7 100644 --- a/chargebee/models/item_price/operations.py +++ b/chargebee/models/item_price/operations.py @@ -169,6 +169,7 @@ class CreateParams(TypedDict): usage_accumulation_reset_frequency: NotRequired[ enums.UsageAccumulationResetFrequency ] + business_entity_id: NotRequired[str] pricing_model: NotRequired[enums.PricingModel] tiers: NotRequired[List["ItemPrice.CreateTierParams"]] price: NotRequired[int] @@ -234,6 +235,8 @@ class ListParams(TypedDict): trial_period_unit: NotRequired[Filters.EnumFilter] status: NotRequired[Filters.EnumFilter] updated_at: NotRequired[Filters.TimestampFilter] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] period_unit: NotRequired[Filters.EnumFilter] period: NotRequired[Filters.NumberFilter] channel: NotRequired[Filters.EnumFilter] diff --git a/chargebee/models/item_price/responses.py b/chargebee/models/item_price/responses.py index c36abdd..0807d23 100644 --- a/chargebee/models/item_price/responses.py +++ b/chargebee/models/item_price/responses.py @@ -87,6 +87,7 @@ class ItemPriceResponse(Model): parent_item_id: str = None show_description_in_invoices: bool = None show_description_in_quotes: bool = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/omnichannel_subscription/__init__.py b/chargebee/models/omnichannel_subscription/__init__.py new file mode 100644 index 0000000..9ca8539 --- /dev/null +++ b/chargebee/models/omnichannel_subscription/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelSubscription +from .responses import OmnichannelSubscriptionResponse diff --git a/chargebee/models/omnichannel_subscription/operations.py b/chargebee/models/omnichannel_subscription/operations.py new file mode 100644 index 0000000..1e7907e --- /dev/null +++ b/chargebee/models/omnichannel_subscription/operations.py @@ -0,0 +1,110 @@ +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_subscription_item + + +@dataclass +class OmnichannelSubscription: + + env: environment.Environment + + class Source(Enum): + APPLE_APP_STORE = "apple_app_store" + + def __str__(self): + return self.value + + class OmnichannelSubscriptionItemStatus(Enum): + ACTIVE = "active" + EXPIRED = "expired" + CANCELLED = "cancelled" + IN_DUNNING = "in_dunning" + IN_GRACE_PERIOD = "in_grace_period" + + def __str__(self): + return self.value + + class OmnichannelSubscriptionItemExpirationReason(Enum): + BILLING_ERROR = "billing_error" + PRODUCT_NOT_AVAILABLE = "product_not_available" + OTHER = "other" + + def __str__(self): + return self.value + + class OmnichannelSubscriptionItemCancellationReason(Enum): + CUSTOMER_CANCELLED = "customer_cancelled" + CUSTOMER_DID_NOT_CONSENT_TO_PRICE_INCREASE = ( + "customer_did_not_consent_to_price_increase" + ) + + 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: Required[str] + price_units: Required[int] + price_nanos: Required[int] + type: Required["OmnichannelSubscription.OmnichannelTransactionType"] + transacted_at: Required[int] + created_at: Required[int] + resource_version: NotRequired[int] + + class ListParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + customer_id: NotRequired[Filters.StringFilter] + + class OmnichannelTransactionsForOmnichannelSubscriptionParams(TypedDict): + limit: NotRequired[int] + offset: NotRequired[str] + + def retrieve(self, id, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("omnichannel_subscriptions", id), + self.env, + None, + headers, + RetrieveResponse, + ) + + def list(self, params: ListParams = None, headers=None) -> ListResponse: + return request.send_list_request( + "get", + request.uri_path("omnichannel_subscriptions"), + self.env, + cast(Dict[Any, Any], params), + headers, + ListResponse, + ) + + def omnichannel_transactions_for_omnichannel_subscription( + self, + id, + params: OmnichannelTransactionsForOmnichannelSubscriptionParams = None, + headers=None, + ) -> OmnichannelTransactionsForOmnichannelSubscriptionResponse: + return request.send( + "get", + request.uri_path( + "omnichannel_subscriptions", id, "omnichannel_transactions" + ), + self.env, + cast(Dict[Any, Any], params), + headers, + OmnichannelTransactionsForOmnichannelSubscriptionResponse, + ) diff --git a/chargebee/models/omnichannel_subscription/responses.py b/chargebee/models/omnichannel_subscription/responses.py new file mode 100644 index 0000000..8da278b --- /dev/null +++ b/chargebee/models/omnichannel_subscription/responses.py @@ -0,0 +1,68 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.models import omnichannel_subscription_item, omnichannel_transaction + + +@dataclass +class OmnichannelTransactionResponse(Model): + 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 OmnichannelSubscriptionResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + id_at_source: str = None + app_id: str = None + source: str = None + customer_id: str = None + created_at: int = None + resource_version: int = None + omnichannel_subscription_items: List[ + "omnichannel_subscription_item.OmnichannelSubscriptionItemResponse" + ] = None + initial_purchase_transaction: ( + "omnichannel_transaction.OmnichannelTransactionsResponse" + ) = None + + +@dataclass +class RetrieveResponse: + omnichannel_subscription: OmnichannelSubscriptionResponse + headers: Dict[str, str] = None + + +@dataclass +class ListOmnichannelSubscriptionResponse: + omnichannel_subscription: OmnichannelSubscriptionResponse + + +@dataclass +class ListResponse: + list: List[ListOmnichannelSubscriptionResponse] + next_offset: str = None + headers: Dict[str, str] = None + + +@dataclass +class OmnichannelTransactionsForOmnichannelSubscriptionOmnichannelSubscriptionResponse: + omnichannel_transaction: "omnichannel_transaction.OmnichannelTransactionResponse" + + +@dataclass +class OmnichannelTransactionsForOmnichannelSubscriptionResponse: + list: List[ + OmnichannelTransactionsForOmnichannelSubscriptionOmnichannelSubscriptionResponse + ] + next_offset: str = None + headers: Dict[str, str] = None diff --git a/chargebee/models/omnichannel_subscription_item/__init__.py b/chargebee/models/omnichannel_subscription_item/__init__.py new file mode 100644 index 0000000..ef2f5c7 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelSubscriptionItem +from .responses import OmnichannelSubscriptionItemResponse diff --git a/chargebee/models/omnichannel_subscription_item/operations.py b/chargebee/models/omnichannel_subscription_item/operations.py new file mode 100644 index 0000000..1648882 --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item/operations.py @@ -0,0 +1,39 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class OmnichannelSubscriptionItem: + + env: environment.Environment + + class Status(Enum): + ACTIVE = "active" + EXPIRED = "expired" + CANCELLED = "cancelled" + IN_DUNNING = "in_dunning" + IN_GRACE_PERIOD = "in_grace_period" + + def __str__(self): + return self.value + + class ExpirationReason(Enum): + BILLING_ERROR = "billing_error" + PRODUCT_NOT_AVAILABLE = "product_not_available" + OTHER = "other" + + def __str__(self): + return self.value + + class CancellationReason(Enum): + CUSTOMER_CANCELLED = "customer_cancelled" + CUSTOMER_DID_NOT_CONSENT_TO_PRICE_INCREASE = ( + "customer_did_not_consent_to_price_increase" + ) + + def __str__(self): + return self.value + + pass diff --git a/chargebee/models/omnichannel_subscription_item/responses.py b/chargebee/models/omnichannel_subscription_item/responses.py new file mode 100644 index 0000000..bbd3fac --- /dev/null +++ b/chargebee/models/omnichannel_subscription_item/responses.py @@ -0,0 +1,19 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@dataclass +class OmnichannelSubscriptionItemResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + item_id_at_source: str = None + status: str = None + current_term_start: int = None + current_term_end: int = None + expired_at: int = None + expiration_reason: str = None + cancelled_at: int = None + cancellation_reason: str = None + grace_period_expires_at: int = None + resource_version: int = None diff --git a/chargebee/models/omnichannel_transaction/__init__.py b/chargebee/models/omnichannel_transaction/__init__.py new file mode 100644 index 0000000..ddc1a90 --- /dev/null +++ b/chargebee/models/omnichannel_transaction/__init__.py @@ -0,0 +1,2 @@ +from .operations import OmnichannelTransaction +from .responses import OmnichannelTransactionResponse diff --git a/chargebee/models/omnichannel_transaction/operations.py b/chargebee/models/omnichannel_transaction/operations.py new file mode 100644 index 0000000..0eb6657 --- /dev/null +++ b/chargebee/models/omnichannel_transaction/operations.py @@ -0,0 +1,19 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class OmnichannelTransaction: + + env: environment.Environment + + class Type(Enum): + PURCHASE = "purchase" + RENEWAL = "renewal" + + def __str__(self): + return self.value + + pass diff --git a/chargebee/models/omnichannel_transaction/responses.py b/chargebee/models/omnichannel_transaction/responses.py new file mode 100644 index 0000000..8b5149e --- /dev/null +++ b/chargebee/models/omnichannel_transaction/responses.py @@ -0,0 +1,18 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any + + +@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 diff --git a/chargebee/models/payment_schedule_scheme/operations.py b/chargebee/models/payment_schedule_scheme/operations.py index fa6aad2..1cce062 100644 --- a/chargebee/models/payment_schedule_scheme/operations.py +++ b/chargebee/models/payment_schedule_scheme/operations.py @@ -21,11 +21,18 @@ class PreferredSchedule(TypedDict): period: NotRequired[int] amount_percentage: NotRequired[float] + class CreateFlexibleScheduleParams(TypedDict): + period: NotRequired[int] + amount_percentage: NotRequired[float] + class CreateParams(TypedDict): number_of_schedules: Required[int] period_unit: Required["PaymentScheduleScheme.PeriodUnit"] period: NotRequired[int] - description: NotRequired[str] + name: Required[str] + flexible_schedules: NotRequired[ + List["PaymentScheduleScheme.CreateFlexibleScheduleParams"] + ] def create(self, params: CreateParams, headers=None) -> CreateResponse: return request.send( diff --git a/chargebee/models/payment_source/operations.py b/chargebee/models/payment_source/operations.py index ed2a265..51c57d8 100644 --- a/chargebee/models/payment_source/operations.py +++ b/chargebee/models/payment_source/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 enums, payment_intent +from chargebee.models import enums, payment_intent, card @dataclass @@ -180,6 +180,7 @@ class CreateCardCardParams(TypedDict): expiry_month: Required[int] expiry_year: Required[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] diff --git a/chargebee/models/payment_source/responses.py b/chargebee/models/payment_source/responses.py index 313c1f9..2c0895a 100644 --- a/chargebee/models/payment_source/responses.py +++ b/chargebee/models/payment_source/responses.py @@ -4,6 +4,7 @@ from chargebee.response import Response from chargebee.models import ( payment_intent, + card, customer, third_party_payment_method, download, diff --git a/chargebee/models/price_variant/operations.py b/chargebee/models/price_variant/operations.py index f1f27ae..b445c43 100644 --- a/chargebee/models/price_variant/operations.py +++ b/chargebee/models/price_variant/operations.py @@ -36,6 +36,7 @@ class CreateParams(TypedDict): external_name: NotRequired[str] description: NotRequired[str] variant_group: NotRequired[str] + business_entity_id: NotRequired[str] attributes: Required[List["PriceVariant.CreateAttributeParams"]] class UpdateParams(TypedDict): @@ -54,6 +55,8 @@ class ListParams(TypedDict): status: NotRequired[Filters.EnumFilter] updated_at: NotRequired[Filters.TimestampFilter] created_at: NotRequired[Filters.TimestampFilter] + business_entity_id: NotRequired[Filters.StringFilter] + include_site_level_resources: NotRequired[Filters.BooleanFilter] sort_by: NotRequired[Filters.SortFilter] def create(self, params: CreateParams, headers=None) -> CreateResponse: diff --git a/chargebee/models/price_variant/responses.py b/chargebee/models/price_variant/responses.py index 903102a..7a19da2 100644 --- a/chargebee/models/price_variant/responses.py +++ b/chargebee/models/price_variant/responses.py @@ -24,6 +24,7 @@ class PriceVariantResponse(Model): updated_at: int = None archived_at: int = None attributes: List[AttributeResponse] = None + business_entity_id: str = None @dataclass diff --git a/chargebee/models/quote/operations.py b/chargebee/models/quote/operations.py index 9e4cf87..8f359dc 100644 --- a/chargebee/models/quote/operations.py +++ b/chargebee/models/quote/operations.py @@ -52,6 +52,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -93,6 +100,7 @@ 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] diff --git a/chargebee/models/quote/responses.py b/chargebee/models/quote/responses.py index 962da81..74ef35b 100644 --- a/chargebee/models/quote/responses.py +++ b/chargebee/models/quote/responses.py @@ -49,6 +49,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None @@ -179,6 +180,7 @@ class QuoteResponse(Model): contract_term_end: int = None contract_term_termination_fee: int = None business_entity_id: str = None + deleted: bool = None @dataclass diff --git a/chargebee/models/quote_line_group/operations.py b/chargebee/models/quote_line_group/operations.py index f35236f..56ea5ff 100644 --- a/chargebee/models/quote_line_group/operations.py +++ b/chargebee/models/quote_line_group/operations.py @@ -44,6 +44,13 @@ 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): ITEM_LEVEL_COUPON = "item_level_coupon" DOCUMENT_LEVEL_COUPON = "document_level_coupon" @@ -85,6 +92,7 @@ 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] diff --git a/chargebee/models/quote_line_group/responses.py b/chargebee/models/quote_line_group/responses.py index 550812b..844bceb 100644 --- a/chargebee/models/quote_line_group/responses.py +++ b/chargebee/models/quote_line_group/responses.py @@ -36,6 +36,7 @@ class DiscountResponse(Model): amount: int = None description: str = None entity_type: str = None + discount_type: str = None entity_id: str = None coupon_set_code: str = None diff --git a/chargebee/models/quoted_subscription/operations.py b/chargebee/models/quoted_subscription/operations.py index 87c2839..fda45c3 100644 --- a/chargebee/models/quoted_subscription/operations.py +++ b/chargebee/models/quoted_subscription/operations.py @@ -49,6 +49,9 @@ class SubscriptionItem(TypedDict): unit_price: NotRequired[int] unit_price_in_decimal: NotRequired[str] amount: NotRequired[int] + current_term_start: NotRequired[int] + current_term_end: NotRequired[int] + next_billing_at: NotRequired[int] amount_in_decimal: NotRequired[str] billing_period: NotRequired[int] billing_period_unit: NotRequired["QuotedSubscription.BillingPeriodUnit"] diff --git a/chargebee/models/quoted_subscription/responses.py b/chargebee/models/quoted_subscription/responses.py index b35bac9..ab5e564 100644 --- a/chargebee/models/quoted_subscription/responses.py +++ b/chargebee/models/quoted_subscription/responses.py @@ -19,6 +19,9 @@ class SubscriptionItemResponse(Model): unit_price: int = None unit_price_in_decimal: str = None amount: int = None + current_term_start: int = None + current_term_end: int = None + next_billing_at: int = None amount_in_decimal: str = None billing_period: int = None billing_period_unit: str = None diff --git a/chargebee/models/recorded_purchase/__init__.py b/chargebee/models/recorded_purchase/__init__.py new file mode 100644 index 0000000..cf30fc8 --- /dev/null +++ b/chargebee/models/recorded_purchase/__init__.py @@ -0,0 +1,2 @@ +from .operations import RecordedPurchase +from .responses import RecordedPurchaseResponse diff --git a/chargebee/models/recorded_purchase/operations.py b/chargebee/models/recorded_purchase/operations.py new file mode 100644 index 0000000..baa53ea --- /dev/null +++ b/chargebee/models/recorded_purchase/operations.py @@ -0,0 +1,62 @@ +from .responses import * +from chargebee import request, environment +from typing import TypedDict, Required, NotRequired, Dict, List, Any, cast +from enum import Enum + + +@dataclass +class RecordedPurchase: + + env: environment.Environment + + class Source(Enum): + APPLE_APP_STORE = "apple_app_store" + + def __str__(self): + return self.value + + class Status(Enum): + IN_PROCESS = "in_process" + COMPLETED = "completed" + FAILED = "failed" + IGNORED = "ignored" + + def __str__(self): + return self.value + + class LinkedOmnichannelSubscription(TypedDict): + omnichannel_subscription_id: NotRequired[str] + + class ErrorDetail(TypedDict): + error_message: NotRequired[str] + + class CreateCustomerParams(TypedDict): + id: Required[str] + + class CreateAppleAppStoreParams(TypedDict): + transaction_id: NotRequired[str] + + class CreateParams(TypedDict): + app_id: Required[str] + customer: Required["RecordedPurchase.CreateCustomerParams"] + apple_app_store: NotRequired["RecordedPurchase.CreateAppleAppStoreParams"] + + def create(self, params: CreateParams, headers=None) -> CreateResponse: + return request.send( + "post", + request.uri_path("recorded_purchases"), + self.env, + cast(Dict[Any, Any], params), + headers, + CreateResponse, + ) + + def retrieve(self, id, headers=None) -> RetrieveResponse: + return request.send( + "get", + request.uri_path("recorded_purchases", id), + self.env, + None, + headers, + RetrieveResponse, + ) diff --git a/chargebee/models/recorded_purchase/responses.py b/chargebee/models/recorded_purchase/responses.py new file mode 100644 index 0000000..49cde3e --- /dev/null +++ b/chargebee/models/recorded_purchase/responses.py @@ -0,0 +1,43 @@ +from dataclasses import dataclass +from chargebee.model import Model +from typing import Dict, List, Any +from chargebee.response import Response +from chargebee.models import customer + + +@dataclass +class LinkedOmnichannelSubscriptionResponse(Model): + omnichannel_subscription_id: str = None + + +@dataclass +class ErrorDetailResponse(Model): + error_message: str = None + + +@dataclass +class RecordedPurchaseResponse(Model): + raw_data: Dict[Any, Any] = None + id: str = None + customer_id: str = None + app_id: str = None + source: str = None + status: str = None + omnichannel_transaction_id: str = None + created_at: int = None + resource_version: int = None + linked_omnichannel_subscriptions: List[LinkedOmnichannelSubscriptionResponse] = None + error_detail: ErrorDetailResponse = None + + +@dataclass +class CreateResponse(Response): + recorded_purchase: RecordedPurchaseResponse + customer: "customer.CustomerResponse" + headers: Dict[str, str] = None + + +@dataclass +class RetrieveResponse: + recorded_purchase: RecordedPurchaseResponse + headers: Dict[str, str] = None diff --git a/chargebee/models/subscription/operations.py b/chargebee/models/subscription/operations.py index 49bb15e..8a635ec 100644 --- a/chargebee/models/subscription/operations.py +++ b/chargebee/models/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 enums, unbilled_charge, payment_intent, invoice +from chargebee.models import enums, unbilled_charge, payment_intent, invoice, card @dataclass @@ -87,6 +87,9 @@ class SubscriptionItem(TypedDict): unit_price: NotRequired[int] unit_price_in_decimal: NotRequired[str] amount: NotRequired[int] + current_term_start: NotRequired[int] + current_term_end: NotRequired[int] + next_billing_at: NotRequired[int] amount_in_decimal: NotRequired[str] billing_period: NotRequired[int] billing_period_unit: NotRequired["Subscription.BillingPeriodUnit"] @@ -156,6 +159,10 @@ class ReferralInfo(TypedDict): destination_url: NotRequired[str] post_purchase_widget_enabled: Required[bool] + class BillingOverride(TypedDict): + max_excess_payment_usage: NotRequired[int] + max_refundable_credits_usage: NotRequired[int] + class ContractTerm(TypedDict): id: Required[str] status: Required["Subscription.ContractTermStatus"] @@ -284,6 +291,7 @@ class CreateCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -509,6 +517,10 @@ class CreateWithItemsCouponParams(TypedDict): coupon_id: NotRequired[str] apply_till: NotRequired[int] + class CreateWithItemsBillingOverrideParams(TypedDict): + max_excess_payment_usage: NotRequired[int] + max_refundable_credits_usage: NotRequired[int] + class UpdateAddonParams(TypedDict): id: NotRequired[str] quantity: NotRequired[int] @@ -540,6 +552,7 @@ class UpdateCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -672,6 +685,7 @@ class UpdateForItemsCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -756,6 +770,10 @@ class UpdateForItemsCouponParams(TypedDict): coupon_id: NotRequired[str] apply_till: NotRequired[int] + class UpdateForItemsBillingOverrideParams(TypedDict): + max_excess_payment_usage: NotRequired[int] + max_refundable_credits_usage: NotRequired[int] + class ReactivateContractTermParams(TypedDict): action_at_term_end: NotRequired["Subscription.ContractTermActionAtTermEnd"] cancellation_cutoff_period: NotRequired[int] @@ -859,6 +877,7 @@ class ImportSubscriptionCardParams(TypedDict): expiry_month: NotRequired[int] expiry_year: NotRequired[int] cvv: NotRequired[str] + preferred_scheme: NotRequired["card.Card.PreferredScheme"] billing_addr1: NotRequired[str] billing_addr2: NotRequired[str] billing_city: NotRequired[str] @@ -1266,6 +1285,9 @@ class CreateWithItemsParams(TypedDict): trial_end_action: NotRequired[enums.TrialEndAction] payment_initiator: NotRequired[enums.PaymentInitiator] coupons: NotRequired[List["Subscription.CreateWithItemsCouponParams"]] + billing_override: NotRequired[ + "Subscription.CreateWithItemsBillingOverrideParams" + ] class ListParams(TypedDict): limit: NotRequired[int] @@ -1419,6 +1441,9 @@ class UpdateForItemsParams(TypedDict): payment_initiator: NotRequired[enums.PaymentInitiator] coupons: NotRequired[List["Subscription.UpdateForItemsCouponParams"]] invoice_usages: NotRequired[bool] + billing_override: NotRequired[ + "Subscription.UpdateForItemsBillingOverrideParams" + ] class ChangeTermEndParams(TypedDict): term_ends_at: Required[int] diff --git a/chargebee/models/subscription/responses.py b/chargebee/models/subscription/responses.py index b9b1c89..4a25619 100644 --- a/chargebee/models/subscription/responses.py +++ b/chargebee/models/subscription/responses.py @@ -6,6 +6,7 @@ unbilled_charge, payment_intent, invoice, + card, advance_invoice_schedule, customer, card, @@ -30,6 +31,9 @@ class SubscriptionItemResponse(Model): unit_price: int = None unit_price_in_decimal: str = None amount: int = None + current_term_start: int = None + current_term_end: int = None + next_billing_at: int = None amount_in_decimal: str = None billing_period: int = None billing_period_unit: str = None @@ -108,6 +112,12 @@ class ReferralInfoResponse(Model): post_purchase_widget_enabled: bool = None +@dataclass +class BillingOverrideResponse(Model): + max_excess_payment_usage: int = None + max_refundable_credits_usage: int = None + + @dataclass class ContractTermResponse(Model): id: str = None @@ -245,9 +255,9 @@ class SubscriptionResponse(Model): coupons: List[CouponResponse] = None shipping_address: ShippingAddressResponse = None referral_info: ReferralInfoResponse = None + billing_override: BillingOverrideResponse = None invoice_notes: str = None meta_data: Dict[Any, Any] = None - metadata: Dict[Any, Any] = None deleted: bool = None changes_scheduled_at: int = None contract_term: ContractTermResponse = None diff --git a/chargebee/models/transaction/operations.py b/chargebee/models/transaction/operations.py index a384deb..6e337f0 100644 --- a/chargebee/models/transaction/operations.py +++ b/chargebee/models/transaction/operations.py @@ -27,6 +27,7 @@ class Status(Enum): FAILURE = "failure" TIMEOUT = "timeout" NEEDS_ATTENTION = "needs_attention" + LATE_FAILURE = "late_failure" def __str__(self): return self.value @@ -60,6 +61,7 @@ class LinkedPaymentStatus(Enum): FAILURE = "failure" TIMEOUT = "timeout" NEEDS_ATTENTION = "needs_attention" + LATE_FAILURE = "late_failure" def __str__(self): return self.value @@ -81,7 +83,7 @@ class LinkedCreditNote(TypedDict): cn_date: NotRequired[int] cn_total: NotRequired[int] cn_status: Required["credit_note.CreditNote.Status"] - cn_reference_invoice_id: Required[str] + cn_reference_invoice_id: NotRequired[str] class LinkedRefund(TypedDict): txn_id: Required[str] @@ -109,6 +111,7 @@ class GatewayErrorDetail(TypedDict): recommendation_message: NotRequired[str] processor_error_code: NotRequired[str] processor_error_message: NotRequired[str] + error_cause_id: NotRequired[str] class CreateAuthorizationParams(TypedDict): customer_id: Required[str] diff --git a/chargebee/models/transaction/responses.py b/chargebee/models/transaction/responses.py index a04e1c1..fa864d9 100644 --- a/chargebee/models/transaction/responses.py +++ b/chargebee/models/transaction/responses.py @@ -59,6 +59,7 @@ class GatewayErrorDetailResponse(Model): recommendation_message: str = None processor_error_code: str = None processor_error_message: str = None + error_cause_id: str = None @dataclass diff --git a/chargebee/responses.py b/chargebee/responses.py index 6c0387c..35df24e 100644 --- a/chargebee/responses.py +++ b/chargebee/responses.py @@ -28,9 +28,7 @@ def __init__(self, response_type: Type[T], response, response_header=None): self._response_type = response_type def is_idempotency_replayed(self) -> bool: - return bool( - self._response_header.get(self.IDEMPOTENCY_REPLAYED_HEADER, False) - ) + return bool(self._response_header.get(self.IDEMPOTENCY_REPLAYED_HEADER, False)) def parse_response(self) -> T: init_data = {} diff --git a/chargebee/version.py b/chargebee/version.py index ff31d4c..90d19b8 100644 --- a/chargebee/version.py +++ b/chargebee/version.py @@ -1 +1 @@ -VERSION = "3.0.0b2" +VERSION = "3.0.0b3" From d12c4f5cfb6ec18b563dbc3c115b4776e6b9b351 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Mon, 13 Jan 2025 17:30:18 +0530 Subject: [PATCH 16/19] add error_cause_id in api_error --- CHANGELOG.md | 4 ++-- chargebee/api_error.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dec984..640b49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,8 +98,8 @@ #### Removed Subresource: * OmnichannelSubscriptionItem subresource has been removed from OmnichannelSubscription and is now a standalone resource. -#### Deprecated Attribute: -* metadata has been deprecated from subscription. +#### Removed Attribute: +* metadata has been removed from subscription. #### Bug Fixes: * Fixed issue preventing access to response headers during exceptions. diff --git a/chargebee/api_error.py b/chargebee/api_error.py index 2551fb5..1e47c71 100644 --- a/chargebee/api_error.py +++ b/chargebee/api_error.py @@ -8,6 +8,7 @@ def __init__(self, http_code, json_obj, headers=None): self.api_error_code = json_obj.get("api_error_code") self.param = json_obj.get("param") + self.error_cause_id = json_obj.get('error_cause_id', None) self.http_headers = headers self.error_code = json_obj["error_code"] self.error_cause = json_obj.get("error_cause", None) From b677fce7370fc69401b36cf1ff1c288cc044c25b Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Wed, 15 Jan 2025 18:42:41 +0530 Subject: [PATCH 17/19] Added PreferredScheme Enum in Cards resource --- chargebee/api_error.py | 3 +-- chargebee/models/card/operations.py | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/chargebee/api_error.py b/chargebee/api_error.py index 1e47c71..88ea802 100644 --- a/chargebee/api_error.py +++ b/chargebee/api_error.py @@ -8,10 +8,9 @@ def __init__(self, http_code, json_obj, headers=None): self.api_error_code = json_obj.get("api_error_code") self.param = json_obj.get("param") - self.error_cause_id = json_obj.get('error_cause_id', None) + self.error_cause_id = json_obj.get("error_cause_id", None) self.http_headers = headers self.error_code = json_obj["error_code"] - self.error_cause = json_obj.get("error_cause", None) self.http_code = http_code self.http_body = None diff --git a/chargebee/models/card/operations.py b/chargebee/models/card/operations.py index 06315a2..e5887fb 100644 --- a/chargebee/models/card/operations.py +++ b/chargebee/models/card/operations.py @@ -10,6 +10,14 @@ class Card: env: environment.Environment + class PreferredScheme(Enum): + CARTES_BANCAIRES = "cartes_bancaires" + MASTERCARD = "mastercard" + VISA = "visa" + + def __str__(self): + return self.value + class Status(Enum): VALID = "valid" EXPIRING = "expiring" From c744455a0fb52fb5e4b1113b3acd0167a1647601 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Wed, 15 Jan 2025 18:56:35 +0530 Subject: [PATCH 18/19] updated release date --- CHANGELOG.md | 2 +- LICENSE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 640b49b..2792422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### v3.0.0b3 (2025-01-13) +### v3.0.0b3 (2025-01-15) * * * #### New Resource: diff --git a/LICENSE b/LICENSE index f22d7e3..c3f3edf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2011-2024 ChargeBee, Inc. +Copyright (c) 2011-2025 ChargeBee, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation From de84c68521f2e41661964db5667b132b0eedb0b8 Mon Sep 17 00:00:00 2001 From: cb-nithins Date: Wed, 15 Jan 2025 19:28:42 +0530 Subject: [PATCH 19/19] fixed response types --- chargebee/models/estimate/responses.py | 10 +++++----- chargebee/models/omnichannel_subscription/responses.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chargebee/models/estimate/responses.py b/chargebee/models/estimate/responses.py index 4b76445..a54f4a1 100644 --- a/chargebee/models/estimate/responses.py +++ b/chargebee/models/estimate/responses.py @@ -17,16 +17,16 @@ class EstimateResponse(Model): raw_data: Dict[Any, Any] = None created_at: int = None - subscription_estimate: "subscription_estimate.SubscriptionEstimatesResponse" = None + subscription_estimate: "subscription_estimate.SubscriptionEstimateResponse" = None subscription_estimates: List[ - "subscription_estimate.SubscriptionEstimatesResponse" + "subscription_estimate.SubscriptionEstimateResponse" ] = None - invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None - invoice_estimates: List["invoice_estimate.InvoiceEstimatesResponse"] = None + invoice_estimate: "invoice_estimate.InvoiceEstimateResponse" = None + invoice_estimates: List["invoice_estimate.InvoiceEstimateResponse"] = None payment_schedule_estimates: List[ "payment_schedule_estimate.PaymentScheduleEstimateResponse" ] = None - next_invoice_estimate: "invoice_estimate.InvoiceEstimatesResponse" = None + next_invoice_estimate: "invoice_estimate.InvoiceEstimateResponse" = None credit_note_estimates: List["credit_note_estimate.CreditNoteEstimateResponse"] = ( None ) diff --git a/chargebee/models/omnichannel_subscription/responses.py b/chargebee/models/omnichannel_subscription/responses.py index 8da278b..075fcde 100644 --- a/chargebee/models/omnichannel_subscription/responses.py +++ b/chargebee/models/omnichannel_subscription/responses.py @@ -32,7 +32,7 @@ class OmnichannelSubscriptionResponse(Model): "omnichannel_subscription_item.OmnichannelSubscriptionItemResponse" ] = None initial_purchase_transaction: ( - "omnichannel_transaction.OmnichannelTransactionsResponse" + "omnichannel_transaction.OmnichannelTransactionResponse" ) = None