diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bbb17dea..e547f5f80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,49 @@ # Changelog +## 15.1.0 - 2026-04-23 +This release changes the pinned API version to 2026-04-22.dahlia. + +* [#1793](https://github.com/stripe/stripe-python/pull/1793) Update generated code + * Add support for `balance_report` and `payout_reconciliation_report` on `AccountSession.Component` and `AccountSessionCreateParamsComponent` + * Add support for `app_distribution` and `sunbit_payments` on `Account.Capability`, `AccountCreateParamsCapability`, and `AccountModifyParamsCapability` + * ⚠️ Add support for new values `fee_credit_funding`, `inbound_transfer_reversal`, and `inbound_transfer` on enum `BalanceTransaction.type` + * Add support for `sunbit` on `Charge.PaymentMethodDetail`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodDatum`, and `SetupIntentModifyParamsPaymentMethodDatum` + * ⚠️ Add support for new values `phantom_cash` and `usdt` on enums `Charge.PaymentMethodDetail.Crypto.token_currency`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.token_currency`, and `PaymentRecord.PaymentMethodDetail.Crypto.token_currency` + * Add support for `location` and `reader` on `Charge.PaymentMethodDetail.Klarna`, `PaymentAttemptRecord.PaymentMethodDetail.Klarna`, and `PaymentRecord.PaymentMethodDetail.Klarna` + * Add support for `mandate` on `Charge.PaymentMethodDetail.Pix`, `PaymentAttemptRecord.PaymentMethodDetail.Pix`, and `PaymentRecord.PaymentMethodDetail.Pix` + * Add support for `managed_payments` on `Checkout.Session`, `PaymentIntent`, `PaymentLinkCreateParams`, `PaymentLink`, `SetupIntent`, `Subscription`, and `checkout.SessionCreateParams` + * Add support for new value `sunbit` on enums `PaymentIntentConfirmParams.excluded_payment_method_types`, `PaymentIntentCreateParams.excluded_payment_method_types`, `PaymentIntentModifyParams.excluded_payment_method_types`, `SetupIntentCreateParams.excluded_payment_method_types`, `SetupIntentModifyParams.excluded_payment_method_types`, and `checkout.SessionCreateParams.excluded_payment_method_types` + * Add support for `mandate_options` on `Checkout.Session.PaymentMethodOption.Pix`, `PaymentIntent.PaymentMethodOption.Pix`, `PaymentIntentConfirmParamsPaymentMethodOptionPix`, `PaymentIntentCreateParamsPaymentMethodOptionPix`, `PaymentIntentModifyParamsPaymentMethodOptionPix`, and `checkout.SessionCreateParamsPaymentMethodOptionPix` + * Change type of `PaymentIntentConfirmParamsPaymentMethodOptionPix.setup_future_usage`, `PaymentIntentCreateParamsPaymentMethodOptionPix.setup_future_usage`, `PaymentIntentModifyParamsPaymentMethodOptionPix.setup_future_usage`, and `checkout.SessionCreateParamsPaymentMethodOptionPix.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')` + * Add support for new value `sunbit` on enum `checkout.SessionCreateParams.payment_method_types` + * ⚠️ Add support for new values `fo_vat`, `gi_tin`, `it_cf`, and `py_ruc` on enums `Checkout.Session.CustomerDetail.TaxId.type`, `Invoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetail.TaxId.type`, `Tax.Transaction.CustomerDetail.TaxId.type`, and `TaxId.type` + * ⚠️ Change type of `Checkout.Session.PaymentMethodOption.Pix.setup_future_usage` and `PaymentIntent.PaymentMethodOption.Pix.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')` + * Add support for new value `sunbit` on enums `ConfirmationTokenCreateParamsPaymentMethodDatum.type`, `PaymentIntentConfirmParamsPaymentMethodDatum.type`, `PaymentIntentCreateParamsPaymentMethodDatum.type`, `PaymentIntentModifyParamsPaymentMethodDatum.type`, `SetupIntentConfirmParamsPaymentMethodDatum.type`, `SetupIntentCreateParamsPaymentMethodDatum.type`, and `SetupIntentModifyParamsPaymentMethodDatum.type` + * ⚠️ Add support for new value `sunbit` on enums `ConfirmationToken.PaymentMethodPreview.type` and `PaymentMethod.type` + * Add support for new values `fo_vat`, `gi_tin`, `it_cf`, and `py_ruc` on enums `CustomerCreateParamsTaxIdDatum.type`, `CustomerCreateTaxIdParams.type`, `InvoiceCreatePreviewParamsCustomerDetailTaxId.type`, `TaxIdCreateParams.type`, and `tax.CalculationCreateParamsCustomerDetailTaxId.type` + * Add support for new value `sunbit` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type` + * Add support for `pix` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Mandate.PaymentMethodDetail`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.PaymentMethodOption`, `SetupIntentConfirmParamsPaymentMethodOption`, `SetupIntentCreateParamsPaymentMethodOption`, `SetupIntentModifyParamsPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption` + * Add support for `upi` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption` + * Add support for new values `pix` and `upi` on enums `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * ⚠️ Add support for new values `pix` and `upi` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types` + * Add support for `card_presence` on `Issuing.Authorization` + * Add support for `allowed_card_presences` and `blocked_card_presences` on `Issuing.Card.SpendingControl`, `Issuing.Cardholder.SpendingControl`, `issuing.CardCreateParamsSpendingControl`, `issuing.CardModifyParamsSpendingControl`, `issuing.CardholderCreateParamsSpendingControl`, and `issuing.CardholderModifyParamsSpendingControl` + * ⚠️ Add support for new value `fulfillment_error` on enum `Issuing.Card.cancellation_reason` + * ⚠️ Add support for new value `fulfillment_error` on enum `Issuing.Card.replacement_reason` + * Add support for `amount` and `currency` on `Mandate.MultiUse` + * Add support for `amount_to_confirm` on `PaymentIntentConfirmParams` + * ⚠️ Add support for new value `sunbit` on enums `PaymentIntent.excluded_payment_method_types` and `SetupIntent.excluded_payment_method_types` + * Add support for `klarna_display_qr_code` on `PaymentIntent.NextAction` + * Add support for new value `sunbit` on enums `PaymentLinkCreateParams.payment_method_types` and `PaymentLinkModifyParams.payment_method_types` + * ⚠️ Add support for new value `sunbit` on enum `PaymentLink.payment_method_types` + * ⚠️ Add support for new values `low`, `not_assessed`, and `unknown` on enum `Radar.PaymentEvaluation.Signal.FraudulentPayment.risk_level` + * Add support for new value `account` on enum `radar.ValueListCreateParams.item_type` + * ⚠️ Add support for new value `account` on enum `Radar.ValueList.item_type` + * Add support for `moto` on `SetupAttempt.PaymentMethodDetail.Card` + * Add support for `pix_display_qr_code` on `SetupIntent.NextAction` + * Add support for new value `2026-04-22.dahlia` on enum `WebhookEndpointCreateParams.api_version` + * Add support for error codes `action_blocked` and `approval_required` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError` + ## 15.1.0a4 - 2026-04-15 * [#1794](https://github.com/stripe/stripe-python/pull/1794) Update generated code for private-preview * Add support for `latest_version` on `V2.Billing.LicenseFee`, `V2.Billing.PricingPlan`, and `V2.Billing.RateCard` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 170b0bdc5..57b376a31 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -a527d1f955ea1eab1b7ccdb63001a69d1786fc37 \ No newline at end of file +505d252427d8aaae5b38486880ba3550b08958ec \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ccd8e578d..97a293208 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2240 \ No newline at end of file +v2253 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 9d53450a1..c36f3224d 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -344,6 +344,7 @@ def add_beta_version( ControlledByDashboardError as ControlledByDashboardError, FeatureNotEnabledError as FeatureNotEnabledError, FinancialAccountNotOpenError as FinancialAccountNotOpenError, + FxQuoteExpiredError as FxQuoteExpiredError, IdempotencyError as IdempotencyError, InsufficientFundsError as InsufficientFundsError, InvalidPaymentMethodError as InvalidPaymentMethodError, @@ -817,6 +818,7 @@ def add_beta_version( "ControlledByDashboardError": ("stripe._error", False), "FeatureNotEnabledError": ("stripe._error", False), "FinancialAccountNotOpenError": ("stripe._error", False), + "FxQuoteExpiredError": ("stripe._error", False), "IdempotencyError": ("stripe._error", False), "InsufficientFundsError": ("stripe._error", False), "InvalidPaymentMethodError": ("stripe._error", False), diff --git a/stripe/_account_session.py b/stripe/_account_session.py index b1c28ab70..a724aa283 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -104,7 +104,14 @@ class Features(StripeObject): class Bills(StripeObject): class Features(StripeObject): - pass + bill_management: bool + """ + Whether to enable the bill management feature that grants access to bill creation and payment. + """ + send_money: bool + """ + Whether to enable the send money feature that grants access to bill creation and payment. + """ enabled: bool """ diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index ae057a867..4ec9cc1a8 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -402,6 +402,8 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.FeatureNotEnabledError(**error_args) elif type == "financial_account_not_open": return error.FinancialAccountNotOpenError(**error_args) + elif type == "fx_quote_expired": + return error.FxQuoteExpiredError(**error_args) elif type == "insufficient_funds": return error.InsufficientFundsError(**error_args) elif type == "invalid_payment_method": diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 60353fd5b..1afe7b7af 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-04-08.preview" + CURRENT = "2026-04-22.preview" diff --git a/stripe/_charge.py b/stripe/_charge.py index 68b41a790..5ed001ce3 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1287,6 +1287,40 @@ class Fpx(StripeObject): Unique transaction id generated by FPX for every request from the merchant """ + class GiftCard(StripeObject): + class Balance(StripeObject): + amount: int + """ + The balance amount in the smallest currency unit. + """ + currency: str + """ + The currency of the balance. + """ + + balance: Balance + brand: Literal["fiserv_valuelink", "givex", "svs"] + """ + The brand of the gift card. + """ + exp_month: Optional[int] + """ + The expiration month of the gift card. + """ + exp_year: Optional[int] + """ + The expiration year of the gift card. + """ + first6: str + """ + The first six digits of the gift card number. + """ + transaction_id: str + """ + The transaction ID from the gift card processor. + """ + _inner_class_types = {"balance": Balance} + class Giropay(StripeObject): bank_code: Optional[str] """ @@ -2247,6 +2281,7 @@ class Zip(StripeObject): customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] + gift_card: Optional[GiftCard] giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] @@ -2319,6 +2354,7 @@ class Zip(StripeObject): "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, + "gift_card": GiftCard, "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index bb470e9a5..2de4b5f18 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: from stripe._charge import Charge from stripe._customer import Customer + from stripe._payment_method import PaymentMethod from stripe._setup_attempt import SetupAttempt from stripe.params._confirmation_token_create_params import ( ConfirmationTokenCreateParams, @@ -1368,6 +1369,10 @@ class GeneratedFrom(StripeObject): """ The ID of the Charge that generated this PaymentMethod, if any. """ + payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the PaymentMethod that generated this PaymentMethod, if any. + """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. diff --git a/stripe/_error.py b/stripe/_error.py index cc7ea6204..a4b4df88c 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -238,6 +238,10 @@ class FinancialAccountNotOpenError(StripeError): pass +class FxQuoteExpiredError(StripeError): + pass + + class InsufficientFundsError(StripeError): pass diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 3d6e45817..67b91e4b7 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -1136,6 +1136,7 @@ class Filters(StripeObject): "konbini", "kr_card", "link", + "momo", "multibanco", "naver_pay", "nz_bank_account", diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 4c8ecf04a..681186aee 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -544,6 +544,10 @@ "stripe.v2.billing._service_action", "ServiceAction", ), + "v2.commerce.product_catalog_import": ( + "stripe.v2.commerce._product_catalog_import", + "ProductCatalogImport", + ), "v2.core.account": ("stripe.v2.core._account", "Account"), "v2.core.account_evaluation": ( "stripe.v2.core._account_evaluation", @@ -559,6 +563,10 @@ "AccountPersonToken", ), "v2.core.account_token": ("stripe.v2.core._account_token", "AccountToken"), + "v2.core.approval_request": ( + "stripe.v2.core._approval_request", + "ApprovalRequest", + ), "v2.core.batch_job": ("stripe.v2.core._batch_job", "BatchJob"), "v2.core.claimable_sandbox": ( "stripe.v2.core._claimable_sandbox", @@ -581,12 +589,15 @@ "stripe.v2.core.vault._us_bank_account", "UsBankAccount", ), - "v2.core.workflow": ("stripe.v2.core._workflow", "Workflow"), - "v2.core.workflow_run": ("stripe.v2.core._workflow_run", "WorkflowRun"), "v2.data.reporting.query_run": ( "stripe.v2.data.reporting._query_run", "QueryRun", ), + "v2.extend.workflow": ("stripe.v2.extend._workflow", "Workflow"), + "v2.extend.workflow_run": ( + "stripe.v2.extend._workflow_run", + "WorkflowRun", + ), "financial_address_credit_simulation": ( "stripe.v2._financial_address_credit_simulation", "FinancialAddressCreditSimulation", @@ -595,6 +606,7 @@ "stripe.v2._financial_address_generated_microdeposits", "FinancialAddressGeneratedMicrodeposits", ), + "v2.iam.activity_log": ("stripe.v2.iam._activity_log", "ActivityLog"), "v2.iam.api_key": ("stripe.v2.iam._api_key", "ApiKey"), "v2.money_management.adjustment": ( "stripe.v2.money_management._adjustment", @@ -660,6 +672,14 @@ "stripe.v2.money_management._transaction_entry", "TransactionEntry", ), + "v2.network.business_profile": ( + "stripe.v2.network._business_profile", + "BusinessProfile", + ), + "v2.orchestrated_commerce.agreement": ( + "stripe.v2.orchestrated_commerce._agreement", + "Agreement", + ), "v2.payments.off_session_payment": ( "stripe.v2.payments._off_session_payment", "OffSessionPayment", diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 32a82d8a7..418e1f127 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -1040,6 +1040,40 @@ class Fpx(StripeObject): Unique transaction id generated by FPX for every request from the merchant """ + class GiftCard(StripeObject): + class Balance(StripeObject): + amount: int + """ + The balance amount in the smallest currency unit. + """ + currency: str + """ + The currency of the balance. + """ + + balance: Balance + brand: Literal["fiserv_valuelink", "givex", "svs"] + """ + The brand of the gift card. + """ + exp_month: Optional[int] + """ + The expiration month of the gift card. + """ + exp_year: Optional[int] + """ + The expiration year of the gift card. + """ + first6: str + """ + The first six digits of the gift card number. + """ + transaction_id: str + """ + The transaction ID from the gift card processor. + """ + _inner_class_types = {"balance": Balance} + class Giropay(StripeObject): bank_code: Optional[str] """ @@ -2008,6 +2042,7 @@ class Zip(StripeObject): customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] + gift_card: Optional[GiftCard] giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] @@ -2086,6 +2121,7 @@ class Zip(StripeObject): "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, + "gift_card": GiftCard, "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index bc128bf7d..55def602a 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -35,6 +35,7 @@ PaymentIntentAmountDetailsLineItem, ) from stripe._payment_method import PaymentMethod + from stripe._profile import Profile from stripe._review import Review from stripe._setup_intent import SetupIntent from stripe._source import Source @@ -111,6 +112,16 @@ class PaymentIntent( OBJECT_NAME: ClassVar[Literal["payment_intent"]] = "payment_intent" + class AgentDetails(StripeObject): + name: str + """ + The name of the agent that initiated the payment. + """ + network_business_profile: ExpandableField["Profile"] + """ + The Stripe profile associated with the agent that initiated the payment. + """ + class AllocatedFunds(StripeObject): enabled: Optional[bool] """ @@ -4763,6 +4774,10 @@ class TransferData(StripeObject): The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success. """ + agent_details: Optional[AgentDetails] + """ + Details about the agent that initiated the creation of this PaymentIntent. + """ allocated_funds: Optional[AllocatedFunds] """ Allocated Funds configuration for this PaymentIntent. @@ -5014,10 +5029,6 @@ class TransferData(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ - shared_payment_granted_token: Optional[str] - """ - ID of the shared payment token granted to be used in this PaymentIntent - """ shipping: Optional[Shipping] """ Shipping information for this PaymentIntent. @@ -7100,6 +7111,7 @@ def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { + "agent_details": AgentDetails, "allocated_funds": AllocatedFunds, "amount_details": AmountDetails, "async_workflows": AsyncWorkflows, diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 75ed2bda9..fea2847a6 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1356,6 +1356,10 @@ class GeneratedFrom(StripeObject): """ The ID of the Charge that generated this PaymentMethod, if any. """ + payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the PaymentMethod that generated this PaymentMethod, if any. + """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. @@ -1605,10 +1609,6 @@ class Zip(StripeObject): samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] - shared_payment_granted_token: Optional[str] - """ - ID of the shared payment granted token used in the creation of this PaymentMethod. - """ shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index fdd6dcd6f..ce5dfd2d2 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -1034,6 +1034,40 @@ class Fpx(StripeObject): Unique transaction id generated by FPX for every request from the merchant """ + class GiftCard(StripeObject): + class Balance(StripeObject): + amount: int + """ + The balance amount in the smallest currency unit. + """ + currency: str + """ + The currency of the balance. + """ + + balance: Balance + brand: Literal["fiserv_valuelink", "givex", "svs"] + """ + The brand of the gift card. + """ + exp_month: Optional[int] + """ + The expiration month of the gift card. + """ + exp_year: Optional[int] + """ + The expiration year of the gift card. + """ + first6: str + """ + The first six digits of the gift card number. + """ + transaction_id: str + """ + The transaction ID from the gift card processor. + """ + _inner_class_types = {"balance": Balance} + class Giropay(StripeObject): bank_code: Optional[str] """ @@ -2002,6 +2036,7 @@ class Zip(StripeObject): customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] + gift_card: Optional[GiftCard] giropay: Optional[Giropay] gopay: Optional[Gopay] grabpay: Optional[Grabpay] @@ -2080,6 +2115,7 @@ class Zip(StripeObject): "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, + "gift_card": GiftCard, "giropay": Giropay, "gopay": Gopay, "grabpay": Grabpay, diff --git a/stripe/_product.py b/stripe/_product.py index 2a2cdef31..25a5c0a12 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -67,6 +67,36 @@ class Product( OBJECT_NAME: ClassVar[Literal["product"]] = "product" + class Identifiers(StripeObject): + ean: Optional[str] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: Optional[str] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: Optional[str] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: Optional[str] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: Optional[str] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: Optional[str] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: Optional[str] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + class MarketingFeature(StripeObject): name: Optional[str] """ @@ -115,6 +145,7 @@ class PackageDimensions(StripeObject): """ Unique identifier for the object. """ + identifiers: Optional[Identifiers] images: List[str] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -587,6 +618,7 @@ async def create_feature_async( ) _inner_class_types = { + "identifiers": Identifiers, "marketing_features": MarketingFeature, "package_dimensions": PackageDimensions, } diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 424e463d2..aeb3f8055 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -1092,6 +1092,7 @@ class Filters(StripeObject): "konbini", "kr_card", "link", + "momo", "multibanco", "naver_pay", "nz_bank_account", diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 2740438f1..f25264460 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -682,6 +682,7 @@ class Filters(StripeObject): "konbini", "kr_card", "link", + "momo", "multibanco", "naver_pay", "nz_bank_account", diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index 0b3202418..03b31d71c 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -6,10 +6,16 @@ if TYPE_CHECKING: from stripe.v2._billing_service import BillingService + from stripe.v2._commerce_service import CommerceService from stripe.v2._core_service import CoreService from stripe.v2._datum_service import DatumService + from stripe.v2._extend_service import ExtendService from stripe.v2._iam_service import IamService from stripe.v2._money_management_service import MoneyManagementService + from stripe.v2._network_service import NetworkService + from stripe.v2._orchestrated_commerce_service import ( + OrchestratedCommerceService, + ) from stripe.v2._payment_service import PaymentService from stripe.v2._reporting_service import ReportingService from stripe.v2._tax_service import TaxService @@ -17,13 +23,20 @@ _subservices = { "billing": ["stripe.v2._billing_service", "BillingService"], + "commerce": ["stripe.v2._commerce_service", "CommerceService"], "core": ["stripe.v2._core_service", "CoreService"], "data": ["stripe.v2._datum_service", "DatumService"], + "extend": ["stripe.v2._extend_service", "ExtendService"], "iam": ["stripe.v2._iam_service", "IamService"], "money_management": [ "stripe.v2._money_management_service", "MoneyManagementService", ], + "network": ["stripe.v2._network_service", "NetworkService"], + "orchestrated_commerce": [ + "stripe.v2._orchestrated_commerce_service", + "OrchestratedCommerceService", + ], "payments": ["stripe.v2._payment_service", "PaymentService"], "reporting": ["stripe.v2._reporting_service", "ReportingService"], "tax": ["stripe.v2._tax_service", "TaxService"], @@ -33,10 +46,14 @@ class V2Services(StripeService): billing: "BillingService" + commerce: "CommerceService" core: "CoreService" data: "DatumService" + extend: "ExtendService" iam: "IamService" money_management: "MoneyManagementService" + network: "NetworkService" + orchestrated_commerce: "OrchestratedCommerceService" payments: "PaymentService" reporting: "ReportingService" tax: "TaxService" diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 88d2e9a57..f0c9780d6 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -20,6 +20,7 @@ from stripe._line_item import LineItem from stripe._payment_intent import PaymentIntent from stripe._payment_link import PaymentLink + from stripe._payment_record import PaymentRecord from stripe._promotion_code import PromotionCode from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate @@ -2860,6 +2861,11 @@ class Link(StripeObject): """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. """ + custom_payment_method_types: Optional[List[str]] + """ + A list of the types of [custom payment methods](https://docs.stripe.com/payments/payment-methods/custom-payment-methods) (e.g. cpmt_123) this Checkout + Session is allowed to accept. + """ custom_text: CustomText customer: Optional[ExpandableField["Customer"]] """ @@ -3025,6 +3031,10 @@ class Link(StripeObject): A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. """ + payment_record: Optional[ExpandableField["PaymentRecord"]] + """ + The [Payment Record](https://docs.stripe.com/api/payment-record) for this Checkout Session. + """ payment_status: Literal["no_payment_required", "paid", "unpaid"] """ The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. diff --git a/stripe/delegated_checkout/_requested_session.py b/stripe/delegated_checkout/_requested_session.py index 0485cf372..270eea120 100644 --- a/stripe/delegated_checkout/_requested_session.py +++ b/stripe/delegated_checkout/_requested_session.py @@ -101,6 +101,34 @@ class Source(StripeObject): """ _inner_class_types = {"source": Source} + class BuyerConsents(StripeObject): + class Marketing(StripeObject): + class Option(StripeObject): + channel: Literal["email", "sms"] + """ + The marketing channel type. + """ + description: str + """ + The description of the marketing consent option. + """ + privacy_policy_url: str + """ + The privacy policy URL for this marketing channel. + """ + + options: Optional[List[Option]] + """ + The available marketing consent options. + """ + _inner_class_types = {"options": Option} + + marketing: Optional[Marketing] + """ + The marketing consent options. + """ + _inner_class_types = {"marketing": Marketing} + class FulfillmentDetails(StripeObject): class Address(StripeObject): city: Optional[str] @@ -203,7 +231,7 @@ class ShippingOption(StripeObject): """ The shipping option. """ - type: str + type: Literal["digital", "shipping"] """ The type of the fulfillment option. """ @@ -230,7 +258,7 @@ class Shipping(StripeObject): """ The shipping option. """ - type: str + type: Literal["digital", "shipping"] """ The type of the selected fulfillment option. """ @@ -261,7 +289,7 @@ class Shipping(StripeObject): """ The shipping option. """ - type: str + type: Literal["digital", "shipping"] """ The type of the selected fulfillment option. """ @@ -627,6 +655,10 @@ class ApplicableFee(StripeObject): """ The total amount of the requested session. """ + buyer_consents: Optional[BuyerConsents] + """ + The buyer consent options for this requested session, including marketing preferences. + """ created_at: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -1032,6 +1064,7 @@ async def retrieve_async( _inner_class_types = { "affiliate_attributions": AffiliateAttribution, + "buyer_consents": BuyerConsents, "fulfillment_details": FulfillmentDetails, "line_item_details": LineItemDetail, "order_details": OrderDetails, diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index de699c4e1..fe4190e8e 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -13,10 +13,54 @@ from stripe.events._event_classes import ( ALL_EVENT_NOTIFICATIONS as ALL_EVENT_NOTIFICATIONS, ) + from stripe.events._v1_account_application_authorized_event import ( + V1AccountApplicationAuthorizedEvent as V1AccountApplicationAuthorizedEvent, + V1AccountApplicationAuthorizedEventNotification as V1AccountApplicationAuthorizedEventNotification, + ) + from stripe.events._v1_account_application_deauthorized_event import ( + V1AccountApplicationDeauthorizedEvent as V1AccountApplicationDeauthorizedEvent, + V1AccountApplicationDeauthorizedEventNotification as V1AccountApplicationDeauthorizedEventNotification, + ) + from stripe.events._v1_account_external_account_created_event import ( + V1AccountExternalAccountCreatedEvent as V1AccountExternalAccountCreatedEvent, + V1AccountExternalAccountCreatedEventNotification as V1AccountExternalAccountCreatedEventNotification, + ) + from stripe.events._v1_account_external_account_deleted_event import ( + V1AccountExternalAccountDeletedEvent as V1AccountExternalAccountDeletedEvent, + V1AccountExternalAccountDeletedEventNotification as V1AccountExternalAccountDeletedEventNotification, + ) + from stripe.events._v1_account_external_account_updated_event import ( + V1AccountExternalAccountUpdatedEvent as V1AccountExternalAccountUpdatedEvent, + V1AccountExternalAccountUpdatedEventNotification as V1AccountExternalAccountUpdatedEventNotification, + ) from stripe.events._v1_account_signals_including_delinquency_created_event import ( V1AccountSignalsIncludingDelinquencyCreatedEvent as V1AccountSignalsIncludingDelinquencyCreatedEvent, V1AccountSignalsIncludingDelinquencyCreatedEventNotification as V1AccountSignalsIncludingDelinquencyCreatedEventNotification, ) + from stripe.events._v1_account_updated_event import ( + V1AccountUpdatedEvent as V1AccountUpdatedEvent, + V1AccountUpdatedEventNotification as V1AccountUpdatedEventNotification, + ) + from stripe.events._v1_application_fee_created_event import ( + V1ApplicationFeeCreatedEvent as V1ApplicationFeeCreatedEvent, + V1ApplicationFeeCreatedEventNotification as V1ApplicationFeeCreatedEventNotification, + ) + from stripe.events._v1_application_fee_refund_updated_event import ( + V1ApplicationFeeRefundUpdatedEvent as V1ApplicationFeeRefundUpdatedEvent, + V1ApplicationFeeRefundUpdatedEventNotification as V1ApplicationFeeRefundUpdatedEventNotification, + ) + from stripe.events._v1_application_fee_refunded_event import ( + V1ApplicationFeeRefundedEvent as V1ApplicationFeeRefundedEvent, + V1ApplicationFeeRefundedEventNotification as V1ApplicationFeeRefundedEventNotification, + ) + from stripe.events._v1_balance_available_event import ( + V1BalanceAvailableEvent as V1BalanceAvailableEvent, + V1BalanceAvailableEventNotification as V1BalanceAvailableEventNotification, + ) + from stripe.events._v1_billing_alert_triggered_event import ( + V1BillingAlertTriggeredEvent as V1BillingAlertTriggeredEvent, + V1BillingAlertTriggeredEventNotification as V1BillingAlertTriggeredEventNotification, + ) from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEvent as V1BillingMeterErrorReportTriggeredEvent, V1BillingMeterErrorReportTriggeredEventNotification as V1BillingMeterErrorReportTriggeredEventNotification, @@ -25,6 +69,758 @@ V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, V1BillingMeterNoMeterFoundEventNotification as V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v1_billing_portal_configuration_created_event import ( + V1BillingPortalConfigurationCreatedEvent as V1BillingPortalConfigurationCreatedEvent, + V1BillingPortalConfigurationCreatedEventNotification as V1BillingPortalConfigurationCreatedEventNotification, + ) + from stripe.events._v1_billing_portal_configuration_updated_event import ( + V1BillingPortalConfigurationUpdatedEvent as V1BillingPortalConfigurationUpdatedEvent, + V1BillingPortalConfigurationUpdatedEventNotification as V1BillingPortalConfigurationUpdatedEventNotification, + ) + from stripe.events._v1_billing_portal_session_created_event import ( + V1BillingPortalSessionCreatedEvent as V1BillingPortalSessionCreatedEvent, + V1BillingPortalSessionCreatedEventNotification as V1BillingPortalSessionCreatedEventNotification, + ) + from stripe.events._v1_capability_updated_event import ( + V1CapabilityUpdatedEvent as V1CapabilityUpdatedEvent, + V1CapabilityUpdatedEventNotification as V1CapabilityUpdatedEventNotification, + ) + from stripe.events._v1_cash_balance_funds_available_event import ( + V1CashBalanceFundsAvailableEvent as V1CashBalanceFundsAvailableEvent, + V1CashBalanceFundsAvailableEventNotification as V1CashBalanceFundsAvailableEventNotification, + ) + from stripe.events._v1_charge_captured_event import ( + V1ChargeCapturedEvent as V1ChargeCapturedEvent, + V1ChargeCapturedEventNotification as V1ChargeCapturedEventNotification, + ) + from stripe.events._v1_charge_dispute_closed_event import ( + V1ChargeDisputeClosedEvent as V1ChargeDisputeClosedEvent, + V1ChargeDisputeClosedEventNotification as V1ChargeDisputeClosedEventNotification, + ) + from stripe.events._v1_charge_dispute_created_event import ( + V1ChargeDisputeCreatedEvent as V1ChargeDisputeCreatedEvent, + V1ChargeDisputeCreatedEventNotification as V1ChargeDisputeCreatedEventNotification, + ) + from stripe.events._v1_charge_dispute_funds_reinstated_event import ( + V1ChargeDisputeFundsReinstatedEvent as V1ChargeDisputeFundsReinstatedEvent, + V1ChargeDisputeFundsReinstatedEventNotification as V1ChargeDisputeFundsReinstatedEventNotification, + ) + from stripe.events._v1_charge_dispute_funds_withdrawn_event import ( + V1ChargeDisputeFundsWithdrawnEvent as V1ChargeDisputeFundsWithdrawnEvent, + V1ChargeDisputeFundsWithdrawnEventNotification as V1ChargeDisputeFundsWithdrawnEventNotification, + ) + from stripe.events._v1_charge_dispute_updated_event import ( + V1ChargeDisputeUpdatedEvent as V1ChargeDisputeUpdatedEvent, + V1ChargeDisputeUpdatedEventNotification as V1ChargeDisputeUpdatedEventNotification, + ) + from stripe.events._v1_charge_expired_event import ( + V1ChargeExpiredEvent as V1ChargeExpiredEvent, + V1ChargeExpiredEventNotification as V1ChargeExpiredEventNotification, + ) + from stripe.events._v1_charge_failed_event import ( + V1ChargeFailedEvent as V1ChargeFailedEvent, + V1ChargeFailedEventNotification as V1ChargeFailedEventNotification, + ) + from stripe.events._v1_charge_pending_event import ( + V1ChargePendingEvent as V1ChargePendingEvent, + V1ChargePendingEventNotification as V1ChargePendingEventNotification, + ) + from stripe.events._v1_charge_refund_updated_event import ( + V1ChargeRefundUpdatedEvent as V1ChargeRefundUpdatedEvent, + V1ChargeRefundUpdatedEventNotification as V1ChargeRefundUpdatedEventNotification, + ) + from stripe.events._v1_charge_refunded_event import ( + V1ChargeRefundedEvent as V1ChargeRefundedEvent, + V1ChargeRefundedEventNotification as V1ChargeRefundedEventNotification, + ) + from stripe.events._v1_charge_succeeded_event import ( + V1ChargeSucceededEvent as V1ChargeSucceededEvent, + V1ChargeSucceededEventNotification as V1ChargeSucceededEventNotification, + ) + from stripe.events._v1_charge_updated_event import ( + V1ChargeUpdatedEvent as V1ChargeUpdatedEvent, + V1ChargeUpdatedEventNotification as V1ChargeUpdatedEventNotification, + ) + from stripe.events._v1_checkout_session_async_payment_failed_event import ( + V1CheckoutSessionAsyncPaymentFailedEvent as V1CheckoutSessionAsyncPaymentFailedEvent, + V1CheckoutSessionAsyncPaymentFailedEventNotification as V1CheckoutSessionAsyncPaymentFailedEventNotification, + ) + from stripe.events._v1_checkout_session_async_payment_succeeded_event import ( + V1CheckoutSessionAsyncPaymentSucceededEvent as V1CheckoutSessionAsyncPaymentSucceededEvent, + V1CheckoutSessionAsyncPaymentSucceededEventNotification as V1CheckoutSessionAsyncPaymentSucceededEventNotification, + ) + from stripe.events._v1_checkout_session_completed_event import ( + V1CheckoutSessionCompletedEvent as V1CheckoutSessionCompletedEvent, + V1CheckoutSessionCompletedEventNotification as V1CheckoutSessionCompletedEventNotification, + ) + from stripe.events._v1_checkout_session_expired_event import ( + V1CheckoutSessionExpiredEvent as V1CheckoutSessionExpiredEvent, + V1CheckoutSessionExpiredEventNotification as V1CheckoutSessionExpiredEventNotification, + ) + from stripe.events._v1_climate_order_canceled_event import ( + V1ClimateOrderCanceledEvent as V1ClimateOrderCanceledEvent, + V1ClimateOrderCanceledEventNotification as V1ClimateOrderCanceledEventNotification, + ) + from stripe.events._v1_climate_order_created_event import ( + V1ClimateOrderCreatedEvent as V1ClimateOrderCreatedEvent, + V1ClimateOrderCreatedEventNotification as V1ClimateOrderCreatedEventNotification, + ) + from stripe.events._v1_climate_order_delayed_event import ( + V1ClimateOrderDelayedEvent as V1ClimateOrderDelayedEvent, + V1ClimateOrderDelayedEventNotification as V1ClimateOrderDelayedEventNotification, + ) + from stripe.events._v1_climate_order_delivered_event import ( + V1ClimateOrderDeliveredEvent as V1ClimateOrderDeliveredEvent, + V1ClimateOrderDeliveredEventNotification as V1ClimateOrderDeliveredEventNotification, + ) + from stripe.events._v1_climate_order_product_substituted_event import ( + V1ClimateOrderProductSubstitutedEvent as V1ClimateOrderProductSubstitutedEvent, + V1ClimateOrderProductSubstitutedEventNotification as V1ClimateOrderProductSubstitutedEventNotification, + ) + from stripe.events._v1_climate_product_created_event import ( + V1ClimateProductCreatedEvent as V1ClimateProductCreatedEvent, + V1ClimateProductCreatedEventNotification as V1ClimateProductCreatedEventNotification, + ) + from stripe.events._v1_climate_product_pricing_updated_event import ( + V1ClimateProductPricingUpdatedEvent as V1ClimateProductPricingUpdatedEvent, + V1ClimateProductPricingUpdatedEventNotification as V1ClimateProductPricingUpdatedEventNotification, + ) + from stripe.events._v1_coupon_created_event import ( + V1CouponCreatedEvent as V1CouponCreatedEvent, + V1CouponCreatedEventNotification as V1CouponCreatedEventNotification, + ) + from stripe.events._v1_coupon_deleted_event import ( + V1CouponDeletedEvent as V1CouponDeletedEvent, + V1CouponDeletedEventNotification as V1CouponDeletedEventNotification, + ) + from stripe.events._v1_coupon_updated_event import ( + V1CouponUpdatedEvent as V1CouponUpdatedEvent, + V1CouponUpdatedEventNotification as V1CouponUpdatedEventNotification, + ) + from stripe.events._v1_credit_note_created_event import ( + V1CreditNoteCreatedEvent as V1CreditNoteCreatedEvent, + V1CreditNoteCreatedEventNotification as V1CreditNoteCreatedEventNotification, + ) + from stripe.events._v1_credit_note_updated_event import ( + V1CreditNoteUpdatedEvent as V1CreditNoteUpdatedEvent, + V1CreditNoteUpdatedEventNotification as V1CreditNoteUpdatedEventNotification, + ) + from stripe.events._v1_credit_note_voided_event import ( + V1CreditNoteVoidedEvent as V1CreditNoteVoidedEvent, + V1CreditNoteVoidedEventNotification as V1CreditNoteVoidedEventNotification, + ) + from stripe.events._v1_customer_cash_balance_transaction_created_event import ( + V1CustomerCashBalanceTransactionCreatedEvent as V1CustomerCashBalanceTransactionCreatedEvent, + V1CustomerCashBalanceTransactionCreatedEventNotification as V1CustomerCashBalanceTransactionCreatedEventNotification, + ) + from stripe.events._v1_customer_created_event import ( + V1CustomerCreatedEvent as V1CustomerCreatedEvent, + V1CustomerCreatedEventNotification as V1CustomerCreatedEventNotification, + ) + from stripe.events._v1_customer_deleted_event import ( + V1CustomerDeletedEvent as V1CustomerDeletedEvent, + V1CustomerDeletedEventNotification as V1CustomerDeletedEventNotification, + ) + from stripe.events._v1_customer_subscription_created_event import ( + V1CustomerSubscriptionCreatedEvent as V1CustomerSubscriptionCreatedEvent, + V1CustomerSubscriptionCreatedEventNotification as V1CustomerSubscriptionCreatedEventNotification, + ) + from stripe.events._v1_customer_subscription_deleted_event import ( + V1CustomerSubscriptionDeletedEvent as V1CustomerSubscriptionDeletedEvent, + V1CustomerSubscriptionDeletedEventNotification as V1CustomerSubscriptionDeletedEventNotification, + ) + from stripe.events._v1_customer_subscription_paused_event import ( + V1CustomerSubscriptionPausedEvent as V1CustomerSubscriptionPausedEvent, + V1CustomerSubscriptionPausedEventNotification as V1CustomerSubscriptionPausedEventNotification, + ) + from stripe.events._v1_customer_subscription_pending_update_applied_event import ( + V1CustomerSubscriptionPendingUpdateAppliedEvent as V1CustomerSubscriptionPendingUpdateAppliedEvent, + V1CustomerSubscriptionPendingUpdateAppliedEventNotification as V1CustomerSubscriptionPendingUpdateAppliedEventNotification, + ) + from stripe.events._v1_customer_subscription_pending_update_expired_event import ( + V1CustomerSubscriptionPendingUpdateExpiredEvent as V1CustomerSubscriptionPendingUpdateExpiredEvent, + V1CustomerSubscriptionPendingUpdateExpiredEventNotification as V1CustomerSubscriptionPendingUpdateExpiredEventNotification, + ) + from stripe.events._v1_customer_subscription_resumed_event import ( + V1CustomerSubscriptionResumedEvent as V1CustomerSubscriptionResumedEvent, + V1CustomerSubscriptionResumedEventNotification as V1CustomerSubscriptionResumedEventNotification, + ) + from stripe.events._v1_customer_subscription_trial_will_end_event import ( + V1CustomerSubscriptionTrialWillEndEvent as V1CustomerSubscriptionTrialWillEndEvent, + V1CustomerSubscriptionTrialWillEndEventNotification as V1CustomerSubscriptionTrialWillEndEventNotification, + ) + from stripe.events._v1_customer_subscription_updated_event import ( + V1CustomerSubscriptionUpdatedEvent as V1CustomerSubscriptionUpdatedEvent, + V1CustomerSubscriptionUpdatedEventNotification as V1CustomerSubscriptionUpdatedEventNotification, + ) + from stripe.events._v1_customer_tax_id_created_event import ( + V1CustomerTaxIdCreatedEvent as V1CustomerTaxIdCreatedEvent, + V1CustomerTaxIdCreatedEventNotification as V1CustomerTaxIdCreatedEventNotification, + ) + from stripe.events._v1_customer_tax_id_deleted_event import ( + V1CustomerTaxIdDeletedEvent as V1CustomerTaxIdDeletedEvent, + V1CustomerTaxIdDeletedEventNotification as V1CustomerTaxIdDeletedEventNotification, + ) + from stripe.events._v1_customer_tax_id_updated_event import ( + V1CustomerTaxIdUpdatedEvent as V1CustomerTaxIdUpdatedEvent, + V1CustomerTaxIdUpdatedEventNotification as V1CustomerTaxIdUpdatedEventNotification, + ) + from stripe.events._v1_customer_updated_event import ( + V1CustomerUpdatedEvent as V1CustomerUpdatedEvent, + V1CustomerUpdatedEventNotification as V1CustomerUpdatedEventNotification, + ) + from stripe.events._v1_entitlements_active_entitlement_summary_updated_event import ( + V1EntitlementsActiveEntitlementSummaryUpdatedEvent as V1EntitlementsActiveEntitlementSummaryUpdatedEvent, + V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification as V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification, + ) + from stripe.events._v1_file_created_event import ( + V1FileCreatedEvent as V1FileCreatedEvent, + V1FileCreatedEventNotification as V1FileCreatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_created_event import ( + V1FinancialConnectionsAccountCreatedEvent as V1FinancialConnectionsAccountCreatedEvent, + V1FinancialConnectionsAccountCreatedEventNotification as V1FinancialConnectionsAccountCreatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_deactivated_event import ( + V1FinancialConnectionsAccountDeactivatedEvent as V1FinancialConnectionsAccountDeactivatedEvent, + V1FinancialConnectionsAccountDeactivatedEventNotification as V1FinancialConnectionsAccountDeactivatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_disconnected_event import ( + V1FinancialConnectionsAccountDisconnectedEvent as V1FinancialConnectionsAccountDisconnectedEvent, + V1FinancialConnectionsAccountDisconnectedEventNotification as V1FinancialConnectionsAccountDisconnectedEventNotification, + ) + from stripe.events._v1_financial_connections_account_reactivated_event import ( + V1FinancialConnectionsAccountReactivatedEvent as V1FinancialConnectionsAccountReactivatedEvent, + V1FinancialConnectionsAccountReactivatedEventNotification as V1FinancialConnectionsAccountReactivatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_balance_event import ( + V1FinancialConnectionsAccountRefreshedBalanceEvent as V1FinancialConnectionsAccountRefreshedBalanceEvent, + V1FinancialConnectionsAccountRefreshedBalanceEventNotification as V1FinancialConnectionsAccountRefreshedBalanceEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_ownership_event import ( + V1FinancialConnectionsAccountRefreshedOwnershipEvent as V1FinancialConnectionsAccountRefreshedOwnershipEvent, + V1FinancialConnectionsAccountRefreshedOwnershipEventNotification as V1FinancialConnectionsAccountRefreshedOwnershipEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_transactions_event import ( + V1FinancialConnectionsAccountRefreshedTransactionsEvent as V1FinancialConnectionsAccountRefreshedTransactionsEvent, + V1FinancialConnectionsAccountRefreshedTransactionsEventNotification as V1FinancialConnectionsAccountRefreshedTransactionsEventNotification, + ) + from stripe.events._v1_identity_verification_session_canceled_event import ( + V1IdentityVerificationSessionCanceledEvent as V1IdentityVerificationSessionCanceledEvent, + V1IdentityVerificationSessionCanceledEventNotification as V1IdentityVerificationSessionCanceledEventNotification, + ) + from stripe.events._v1_identity_verification_session_created_event import ( + V1IdentityVerificationSessionCreatedEvent as V1IdentityVerificationSessionCreatedEvent, + V1IdentityVerificationSessionCreatedEventNotification as V1IdentityVerificationSessionCreatedEventNotification, + ) + from stripe.events._v1_identity_verification_session_processing_event import ( + V1IdentityVerificationSessionProcessingEvent as V1IdentityVerificationSessionProcessingEvent, + V1IdentityVerificationSessionProcessingEventNotification as V1IdentityVerificationSessionProcessingEventNotification, + ) + from stripe.events._v1_identity_verification_session_redacted_event import ( + V1IdentityVerificationSessionRedactedEvent as V1IdentityVerificationSessionRedactedEvent, + V1IdentityVerificationSessionRedactedEventNotification as V1IdentityVerificationSessionRedactedEventNotification, + ) + from stripe.events._v1_identity_verification_session_requires_input_event import ( + V1IdentityVerificationSessionRequiresInputEvent as V1IdentityVerificationSessionRequiresInputEvent, + V1IdentityVerificationSessionRequiresInputEventNotification as V1IdentityVerificationSessionRequiresInputEventNotification, + ) + from stripe.events._v1_identity_verification_session_verified_event import ( + V1IdentityVerificationSessionVerifiedEvent as V1IdentityVerificationSessionVerifiedEvent, + V1IdentityVerificationSessionVerifiedEventNotification as V1IdentityVerificationSessionVerifiedEventNotification, + ) + from stripe.events._v1_invoice_created_event import ( + V1InvoiceCreatedEvent as V1InvoiceCreatedEvent, + V1InvoiceCreatedEventNotification as V1InvoiceCreatedEventNotification, + ) + from stripe.events._v1_invoice_deleted_event import ( + V1InvoiceDeletedEvent as V1InvoiceDeletedEvent, + V1InvoiceDeletedEventNotification as V1InvoiceDeletedEventNotification, + ) + from stripe.events._v1_invoice_finalization_failed_event import ( + V1InvoiceFinalizationFailedEvent as V1InvoiceFinalizationFailedEvent, + V1InvoiceFinalizationFailedEventNotification as V1InvoiceFinalizationFailedEventNotification, + ) + from stripe.events._v1_invoice_finalized_event import ( + V1InvoiceFinalizedEvent as V1InvoiceFinalizedEvent, + V1InvoiceFinalizedEventNotification as V1InvoiceFinalizedEventNotification, + ) + from stripe.events._v1_invoice_marked_uncollectible_event import ( + V1InvoiceMarkedUncollectibleEvent as V1InvoiceMarkedUncollectibleEvent, + V1InvoiceMarkedUncollectibleEventNotification as V1InvoiceMarkedUncollectibleEventNotification, + ) + from stripe.events._v1_invoice_overdue_event import ( + V1InvoiceOverdueEvent as V1InvoiceOverdueEvent, + V1InvoiceOverdueEventNotification as V1InvoiceOverdueEventNotification, + ) + from stripe.events._v1_invoice_overpaid_event import ( + V1InvoiceOverpaidEvent as V1InvoiceOverpaidEvent, + V1InvoiceOverpaidEventNotification as V1InvoiceOverpaidEventNotification, + ) + from stripe.events._v1_invoice_paid_event import ( + V1InvoicePaidEvent as V1InvoicePaidEvent, + V1InvoicePaidEventNotification as V1InvoicePaidEventNotification, + ) + from stripe.events._v1_invoice_payment_action_required_event import ( + V1InvoicePaymentActionRequiredEvent as V1InvoicePaymentActionRequiredEvent, + V1InvoicePaymentActionRequiredEventNotification as V1InvoicePaymentActionRequiredEventNotification, + ) + from stripe.events._v1_invoice_payment_failed_event import ( + V1InvoicePaymentFailedEvent as V1InvoicePaymentFailedEvent, + V1InvoicePaymentFailedEventNotification as V1InvoicePaymentFailedEventNotification, + ) + from stripe.events._v1_invoice_payment_paid_event import ( + V1InvoicePaymentPaidEvent as V1InvoicePaymentPaidEvent, + V1InvoicePaymentPaidEventNotification as V1InvoicePaymentPaidEventNotification, + ) + from stripe.events._v1_invoice_payment_succeeded_event import ( + V1InvoicePaymentSucceededEvent as V1InvoicePaymentSucceededEvent, + V1InvoicePaymentSucceededEventNotification as V1InvoicePaymentSucceededEventNotification, + ) + from stripe.events._v1_invoice_sent_event import ( + V1InvoiceSentEvent as V1InvoiceSentEvent, + V1InvoiceSentEventNotification as V1InvoiceSentEventNotification, + ) + from stripe.events._v1_invoice_upcoming_event import ( + V1InvoiceUpcomingEvent as V1InvoiceUpcomingEvent, + V1InvoiceUpcomingEventNotification as V1InvoiceUpcomingEventNotification, + ) + from stripe.events._v1_invoice_updated_event import ( + V1InvoiceUpdatedEvent as V1InvoiceUpdatedEvent, + V1InvoiceUpdatedEventNotification as V1InvoiceUpdatedEventNotification, + ) + from stripe.events._v1_invoice_voided_event import ( + V1InvoiceVoidedEvent as V1InvoiceVoidedEvent, + V1InvoiceVoidedEventNotification as V1InvoiceVoidedEventNotification, + ) + from stripe.events._v1_invoice_will_be_due_event import ( + V1InvoiceWillBeDueEvent as V1InvoiceWillBeDueEvent, + V1InvoiceWillBeDueEventNotification as V1InvoiceWillBeDueEventNotification, + ) + from stripe.events._v1_invoiceitem_created_event import ( + V1InvoiceitemCreatedEvent as V1InvoiceitemCreatedEvent, + V1InvoiceitemCreatedEventNotification as V1InvoiceitemCreatedEventNotification, + ) + from stripe.events._v1_invoiceitem_deleted_event import ( + V1InvoiceitemDeletedEvent as V1InvoiceitemDeletedEvent, + V1InvoiceitemDeletedEventNotification as V1InvoiceitemDeletedEventNotification, + ) + from stripe.events._v1_issuing_authorization_created_event import ( + V1IssuingAuthorizationCreatedEvent as V1IssuingAuthorizationCreatedEvent, + V1IssuingAuthorizationCreatedEventNotification as V1IssuingAuthorizationCreatedEventNotification, + ) + from stripe.events._v1_issuing_authorization_request_event import ( + V1IssuingAuthorizationRequestEvent as V1IssuingAuthorizationRequestEvent, + V1IssuingAuthorizationRequestEventNotification as V1IssuingAuthorizationRequestEventNotification, + ) + from stripe.events._v1_issuing_authorization_updated_event import ( + V1IssuingAuthorizationUpdatedEvent as V1IssuingAuthorizationUpdatedEvent, + V1IssuingAuthorizationUpdatedEventNotification as V1IssuingAuthorizationUpdatedEventNotification, + ) + from stripe.events._v1_issuing_card_created_event import ( + V1IssuingCardCreatedEvent as V1IssuingCardCreatedEvent, + V1IssuingCardCreatedEventNotification as V1IssuingCardCreatedEventNotification, + ) + from stripe.events._v1_issuing_card_updated_event import ( + V1IssuingCardUpdatedEvent as V1IssuingCardUpdatedEvent, + V1IssuingCardUpdatedEventNotification as V1IssuingCardUpdatedEventNotification, + ) + from stripe.events._v1_issuing_cardholder_created_event import ( + V1IssuingCardholderCreatedEvent as V1IssuingCardholderCreatedEvent, + V1IssuingCardholderCreatedEventNotification as V1IssuingCardholderCreatedEventNotification, + ) + from stripe.events._v1_issuing_cardholder_updated_event import ( + V1IssuingCardholderUpdatedEvent as V1IssuingCardholderUpdatedEvent, + V1IssuingCardholderUpdatedEventNotification as V1IssuingCardholderUpdatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_closed_event import ( + V1IssuingDisputeClosedEvent as V1IssuingDisputeClosedEvent, + V1IssuingDisputeClosedEventNotification as V1IssuingDisputeClosedEventNotification, + ) + from stripe.events._v1_issuing_dispute_created_event import ( + V1IssuingDisputeCreatedEvent as V1IssuingDisputeCreatedEvent, + V1IssuingDisputeCreatedEventNotification as V1IssuingDisputeCreatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_funds_reinstated_event import ( + V1IssuingDisputeFundsReinstatedEvent as V1IssuingDisputeFundsReinstatedEvent, + V1IssuingDisputeFundsReinstatedEventNotification as V1IssuingDisputeFundsReinstatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_funds_rescinded_event import ( + V1IssuingDisputeFundsRescindedEvent as V1IssuingDisputeFundsRescindedEvent, + V1IssuingDisputeFundsRescindedEventNotification as V1IssuingDisputeFundsRescindedEventNotification, + ) + from stripe.events._v1_issuing_dispute_submitted_event import ( + V1IssuingDisputeSubmittedEvent as V1IssuingDisputeSubmittedEvent, + V1IssuingDisputeSubmittedEventNotification as V1IssuingDisputeSubmittedEventNotification, + ) + from stripe.events._v1_issuing_dispute_updated_event import ( + V1IssuingDisputeUpdatedEvent as V1IssuingDisputeUpdatedEvent, + V1IssuingDisputeUpdatedEventNotification as V1IssuingDisputeUpdatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_activated_event import ( + V1IssuingPersonalizationDesignActivatedEvent as V1IssuingPersonalizationDesignActivatedEvent, + V1IssuingPersonalizationDesignActivatedEventNotification as V1IssuingPersonalizationDesignActivatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_deactivated_event import ( + V1IssuingPersonalizationDesignDeactivatedEvent as V1IssuingPersonalizationDesignDeactivatedEvent, + V1IssuingPersonalizationDesignDeactivatedEventNotification as V1IssuingPersonalizationDesignDeactivatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_rejected_event import ( + V1IssuingPersonalizationDesignRejectedEvent as V1IssuingPersonalizationDesignRejectedEvent, + V1IssuingPersonalizationDesignRejectedEventNotification as V1IssuingPersonalizationDesignRejectedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_updated_event import ( + V1IssuingPersonalizationDesignUpdatedEvent as V1IssuingPersonalizationDesignUpdatedEvent, + V1IssuingPersonalizationDesignUpdatedEventNotification as V1IssuingPersonalizationDesignUpdatedEventNotification, + ) + from stripe.events._v1_issuing_token_created_event import ( + V1IssuingTokenCreatedEvent as V1IssuingTokenCreatedEvent, + V1IssuingTokenCreatedEventNotification as V1IssuingTokenCreatedEventNotification, + ) + from stripe.events._v1_issuing_token_updated_event import ( + V1IssuingTokenUpdatedEvent as V1IssuingTokenUpdatedEvent, + V1IssuingTokenUpdatedEventNotification as V1IssuingTokenUpdatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_created_event import ( + V1IssuingTransactionCreatedEvent as V1IssuingTransactionCreatedEvent, + V1IssuingTransactionCreatedEventNotification as V1IssuingTransactionCreatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event import ( + V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent as V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent, + V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification as V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_updated_event import ( + V1IssuingTransactionUpdatedEvent as V1IssuingTransactionUpdatedEvent, + V1IssuingTransactionUpdatedEventNotification as V1IssuingTransactionUpdatedEventNotification, + ) + from stripe.events._v1_mandate_updated_event import ( + V1MandateUpdatedEvent as V1MandateUpdatedEvent, + V1MandateUpdatedEventNotification as V1MandateUpdatedEventNotification, + ) + from stripe.events._v1_payment_intent_amount_capturable_updated_event import ( + V1PaymentIntentAmountCapturableUpdatedEvent as V1PaymentIntentAmountCapturableUpdatedEvent, + V1PaymentIntentAmountCapturableUpdatedEventNotification as V1PaymentIntentAmountCapturableUpdatedEventNotification, + ) + from stripe.events._v1_payment_intent_canceled_event import ( + V1PaymentIntentCanceledEvent as V1PaymentIntentCanceledEvent, + V1PaymentIntentCanceledEventNotification as V1PaymentIntentCanceledEventNotification, + ) + from stripe.events._v1_payment_intent_created_event import ( + V1PaymentIntentCreatedEvent as V1PaymentIntentCreatedEvent, + V1PaymentIntentCreatedEventNotification as V1PaymentIntentCreatedEventNotification, + ) + from stripe.events._v1_payment_intent_partially_funded_event import ( + V1PaymentIntentPartiallyFundedEvent as V1PaymentIntentPartiallyFundedEvent, + V1PaymentIntentPartiallyFundedEventNotification as V1PaymentIntentPartiallyFundedEventNotification, + ) + from stripe.events._v1_payment_intent_payment_failed_event import ( + V1PaymentIntentPaymentFailedEvent as V1PaymentIntentPaymentFailedEvent, + V1PaymentIntentPaymentFailedEventNotification as V1PaymentIntentPaymentFailedEventNotification, + ) + from stripe.events._v1_payment_intent_processing_event import ( + V1PaymentIntentProcessingEvent as V1PaymentIntentProcessingEvent, + V1PaymentIntentProcessingEventNotification as V1PaymentIntentProcessingEventNotification, + ) + from stripe.events._v1_payment_intent_requires_action_event import ( + V1PaymentIntentRequiresActionEvent as V1PaymentIntentRequiresActionEvent, + V1PaymentIntentRequiresActionEventNotification as V1PaymentIntentRequiresActionEventNotification, + ) + from stripe.events._v1_payment_intent_succeeded_event import ( + V1PaymentIntentSucceededEvent as V1PaymentIntentSucceededEvent, + V1PaymentIntentSucceededEventNotification as V1PaymentIntentSucceededEventNotification, + ) + from stripe.events._v1_payment_link_created_event import ( + V1PaymentLinkCreatedEvent as V1PaymentLinkCreatedEvent, + V1PaymentLinkCreatedEventNotification as V1PaymentLinkCreatedEventNotification, + ) + from stripe.events._v1_payment_link_updated_event import ( + V1PaymentLinkUpdatedEvent as V1PaymentLinkUpdatedEvent, + V1PaymentLinkUpdatedEventNotification as V1PaymentLinkUpdatedEventNotification, + ) + from stripe.events._v1_payment_method_attached_event import ( + V1PaymentMethodAttachedEvent as V1PaymentMethodAttachedEvent, + V1PaymentMethodAttachedEventNotification as V1PaymentMethodAttachedEventNotification, + ) + from stripe.events._v1_payment_method_automatically_updated_event import ( + V1PaymentMethodAutomaticallyUpdatedEvent as V1PaymentMethodAutomaticallyUpdatedEvent, + V1PaymentMethodAutomaticallyUpdatedEventNotification as V1PaymentMethodAutomaticallyUpdatedEventNotification, + ) + from stripe.events._v1_payment_method_detached_event import ( + V1PaymentMethodDetachedEvent as V1PaymentMethodDetachedEvent, + V1PaymentMethodDetachedEventNotification as V1PaymentMethodDetachedEventNotification, + ) + from stripe.events._v1_payment_method_updated_event import ( + V1PaymentMethodUpdatedEvent as V1PaymentMethodUpdatedEvent, + V1PaymentMethodUpdatedEventNotification as V1PaymentMethodUpdatedEventNotification, + ) + from stripe.events._v1_payout_canceled_event import ( + V1PayoutCanceledEvent as V1PayoutCanceledEvent, + V1PayoutCanceledEventNotification as V1PayoutCanceledEventNotification, + ) + from stripe.events._v1_payout_created_event import ( + V1PayoutCreatedEvent as V1PayoutCreatedEvent, + V1PayoutCreatedEventNotification as V1PayoutCreatedEventNotification, + ) + from stripe.events._v1_payout_failed_event import ( + V1PayoutFailedEvent as V1PayoutFailedEvent, + V1PayoutFailedEventNotification as V1PayoutFailedEventNotification, + ) + from stripe.events._v1_payout_paid_event import ( + V1PayoutPaidEvent as V1PayoutPaidEvent, + V1PayoutPaidEventNotification as V1PayoutPaidEventNotification, + ) + from stripe.events._v1_payout_reconciliation_completed_event import ( + V1PayoutReconciliationCompletedEvent as V1PayoutReconciliationCompletedEvent, + V1PayoutReconciliationCompletedEventNotification as V1PayoutReconciliationCompletedEventNotification, + ) + from stripe.events._v1_payout_updated_event import ( + V1PayoutUpdatedEvent as V1PayoutUpdatedEvent, + V1PayoutUpdatedEventNotification as V1PayoutUpdatedEventNotification, + ) + from stripe.events._v1_person_created_event import ( + V1PersonCreatedEvent as V1PersonCreatedEvent, + V1PersonCreatedEventNotification as V1PersonCreatedEventNotification, + ) + from stripe.events._v1_person_deleted_event import ( + V1PersonDeletedEvent as V1PersonDeletedEvent, + V1PersonDeletedEventNotification as V1PersonDeletedEventNotification, + ) + from stripe.events._v1_person_updated_event import ( + V1PersonUpdatedEvent as V1PersonUpdatedEvent, + V1PersonUpdatedEventNotification as V1PersonUpdatedEventNotification, + ) + from stripe.events._v1_plan_created_event import ( + V1PlanCreatedEvent as V1PlanCreatedEvent, + V1PlanCreatedEventNotification as V1PlanCreatedEventNotification, + ) + from stripe.events._v1_plan_deleted_event import ( + V1PlanDeletedEvent as V1PlanDeletedEvent, + V1PlanDeletedEventNotification as V1PlanDeletedEventNotification, + ) + from stripe.events._v1_plan_updated_event import ( + V1PlanUpdatedEvent as V1PlanUpdatedEvent, + V1PlanUpdatedEventNotification as V1PlanUpdatedEventNotification, + ) + from stripe.events._v1_price_created_event import ( + V1PriceCreatedEvent as V1PriceCreatedEvent, + V1PriceCreatedEventNotification as V1PriceCreatedEventNotification, + ) + from stripe.events._v1_price_deleted_event import ( + V1PriceDeletedEvent as V1PriceDeletedEvent, + V1PriceDeletedEventNotification as V1PriceDeletedEventNotification, + ) + from stripe.events._v1_price_updated_event import ( + V1PriceUpdatedEvent as V1PriceUpdatedEvent, + V1PriceUpdatedEventNotification as V1PriceUpdatedEventNotification, + ) + from stripe.events._v1_product_created_event import ( + V1ProductCreatedEvent as V1ProductCreatedEvent, + V1ProductCreatedEventNotification as V1ProductCreatedEventNotification, + ) + from stripe.events._v1_product_deleted_event import ( + V1ProductDeletedEvent as V1ProductDeletedEvent, + V1ProductDeletedEventNotification as V1ProductDeletedEventNotification, + ) + from stripe.events._v1_product_updated_event import ( + V1ProductUpdatedEvent as V1ProductUpdatedEvent, + V1ProductUpdatedEventNotification as V1ProductUpdatedEventNotification, + ) + from stripe.events._v1_promotion_code_created_event import ( + V1PromotionCodeCreatedEvent as V1PromotionCodeCreatedEvent, + V1PromotionCodeCreatedEventNotification as V1PromotionCodeCreatedEventNotification, + ) + from stripe.events._v1_promotion_code_updated_event import ( + V1PromotionCodeUpdatedEvent as V1PromotionCodeUpdatedEvent, + V1PromotionCodeUpdatedEventNotification as V1PromotionCodeUpdatedEventNotification, + ) + from stripe.events._v1_quote_accepted_event import ( + V1QuoteAcceptedEvent as V1QuoteAcceptedEvent, + V1QuoteAcceptedEventNotification as V1QuoteAcceptedEventNotification, + ) + from stripe.events._v1_quote_canceled_event import ( + V1QuoteCanceledEvent as V1QuoteCanceledEvent, + V1QuoteCanceledEventNotification as V1QuoteCanceledEventNotification, + ) + from stripe.events._v1_quote_created_event import ( + V1QuoteCreatedEvent as V1QuoteCreatedEvent, + V1QuoteCreatedEventNotification as V1QuoteCreatedEventNotification, + ) + from stripe.events._v1_quote_finalized_event import ( + V1QuoteFinalizedEvent as V1QuoteFinalizedEvent, + V1QuoteFinalizedEventNotification as V1QuoteFinalizedEventNotification, + ) + from stripe.events._v1_radar_early_fraud_warning_created_event import ( + V1RadarEarlyFraudWarningCreatedEvent as V1RadarEarlyFraudWarningCreatedEvent, + V1RadarEarlyFraudWarningCreatedEventNotification as V1RadarEarlyFraudWarningCreatedEventNotification, + ) + from stripe.events._v1_radar_early_fraud_warning_updated_event import ( + V1RadarEarlyFraudWarningUpdatedEvent as V1RadarEarlyFraudWarningUpdatedEvent, + V1RadarEarlyFraudWarningUpdatedEventNotification as V1RadarEarlyFraudWarningUpdatedEventNotification, + ) + from stripe.events._v1_refund_created_event import ( + V1RefundCreatedEvent as V1RefundCreatedEvent, + V1RefundCreatedEventNotification as V1RefundCreatedEventNotification, + ) + from stripe.events._v1_refund_failed_event import ( + V1RefundFailedEvent as V1RefundFailedEvent, + V1RefundFailedEventNotification as V1RefundFailedEventNotification, + ) + from stripe.events._v1_refund_updated_event import ( + V1RefundUpdatedEvent as V1RefundUpdatedEvent, + V1RefundUpdatedEventNotification as V1RefundUpdatedEventNotification, + ) + from stripe.events._v1_review_closed_event import ( + V1ReviewClosedEvent as V1ReviewClosedEvent, + V1ReviewClosedEventNotification as V1ReviewClosedEventNotification, + ) + from stripe.events._v1_review_opened_event import ( + V1ReviewOpenedEvent as V1ReviewOpenedEvent, + V1ReviewOpenedEventNotification as V1ReviewOpenedEventNotification, + ) + from stripe.events._v1_setup_intent_canceled_event import ( + V1SetupIntentCanceledEvent as V1SetupIntentCanceledEvent, + V1SetupIntentCanceledEventNotification as V1SetupIntentCanceledEventNotification, + ) + from stripe.events._v1_setup_intent_created_event import ( + V1SetupIntentCreatedEvent as V1SetupIntentCreatedEvent, + V1SetupIntentCreatedEventNotification as V1SetupIntentCreatedEventNotification, + ) + from stripe.events._v1_setup_intent_requires_action_event import ( + V1SetupIntentRequiresActionEvent as V1SetupIntentRequiresActionEvent, + V1SetupIntentRequiresActionEventNotification as V1SetupIntentRequiresActionEventNotification, + ) + from stripe.events._v1_setup_intent_setup_failed_event import ( + V1SetupIntentSetupFailedEvent as V1SetupIntentSetupFailedEvent, + V1SetupIntentSetupFailedEventNotification as V1SetupIntentSetupFailedEventNotification, + ) + from stripe.events._v1_setup_intent_succeeded_event import ( + V1SetupIntentSucceededEvent as V1SetupIntentSucceededEvent, + V1SetupIntentSucceededEventNotification as V1SetupIntentSucceededEventNotification, + ) + from stripe.events._v1_sigma_scheduled_query_run_created_event import ( + V1SigmaScheduledQueryRunCreatedEvent as V1SigmaScheduledQueryRunCreatedEvent, + V1SigmaScheduledQueryRunCreatedEventNotification as V1SigmaScheduledQueryRunCreatedEventNotification, + ) + from stripe.events._v1_source_canceled_event import ( + V1SourceCanceledEvent as V1SourceCanceledEvent, + V1SourceCanceledEventNotification as V1SourceCanceledEventNotification, + ) + from stripe.events._v1_source_chargeable_event import ( + V1SourceChargeableEvent as V1SourceChargeableEvent, + V1SourceChargeableEventNotification as V1SourceChargeableEventNotification, + ) + from stripe.events._v1_source_failed_event import ( + V1SourceFailedEvent as V1SourceFailedEvent, + V1SourceFailedEventNotification as V1SourceFailedEventNotification, + ) + from stripe.events._v1_source_refund_attributes_required_event import ( + V1SourceRefundAttributesRequiredEvent as V1SourceRefundAttributesRequiredEvent, + V1SourceRefundAttributesRequiredEventNotification as V1SourceRefundAttributesRequiredEventNotification, + ) + from stripe.events._v1_subscription_schedule_aborted_event import ( + V1SubscriptionScheduleAbortedEvent as V1SubscriptionScheduleAbortedEvent, + V1SubscriptionScheduleAbortedEventNotification as V1SubscriptionScheduleAbortedEventNotification, + ) + from stripe.events._v1_subscription_schedule_canceled_event import ( + V1SubscriptionScheduleCanceledEvent as V1SubscriptionScheduleCanceledEvent, + V1SubscriptionScheduleCanceledEventNotification as V1SubscriptionScheduleCanceledEventNotification, + ) + from stripe.events._v1_subscription_schedule_completed_event import ( + V1SubscriptionScheduleCompletedEvent as V1SubscriptionScheduleCompletedEvent, + V1SubscriptionScheduleCompletedEventNotification as V1SubscriptionScheduleCompletedEventNotification, + ) + from stripe.events._v1_subscription_schedule_created_event import ( + V1SubscriptionScheduleCreatedEvent as V1SubscriptionScheduleCreatedEvent, + V1SubscriptionScheduleCreatedEventNotification as V1SubscriptionScheduleCreatedEventNotification, + ) + from stripe.events._v1_subscription_schedule_expiring_event import ( + V1SubscriptionScheduleExpiringEvent as V1SubscriptionScheduleExpiringEvent, + V1SubscriptionScheduleExpiringEventNotification as V1SubscriptionScheduleExpiringEventNotification, + ) + from stripe.events._v1_subscription_schedule_released_event import ( + V1SubscriptionScheduleReleasedEvent as V1SubscriptionScheduleReleasedEvent, + V1SubscriptionScheduleReleasedEventNotification as V1SubscriptionScheduleReleasedEventNotification, + ) + from stripe.events._v1_subscription_schedule_updated_event import ( + V1SubscriptionScheduleUpdatedEvent as V1SubscriptionScheduleUpdatedEvent, + V1SubscriptionScheduleUpdatedEventNotification as V1SubscriptionScheduleUpdatedEventNotification, + ) + from stripe.events._v1_tax_rate_created_event import ( + V1TaxRateCreatedEvent as V1TaxRateCreatedEvent, + V1TaxRateCreatedEventNotification as V1TaxRateCreatedEventNotification, + ) + from stripe.events._v1_tax_rate_updated_event import ( + V1TaxRateUpdatedEvent as V1TaxRateUpdatedEvent, + V1TaxRateUpdatedEventNotification as V1TaxRateUpdatedEventNotification, + ) + from stripe.events._v1_tax_settings_updated_event import ( + V1TaxSettingsUpdatedEvent as V1TaxSettingsUpdatedEvent, + V1TaxSettingsUpdatedEventNotification as V1TaxSettingsUpdatedEventNotification, + ) + from stripe.events._v1_terminal_reader_action_failed_event import ( + V1TerminalReaderActionFailedEvent as V1TerminalReaderActionFailedEvent, + V1TerminalReaderActionFailedEventNotification as V1TerminalReaderActionFailedEventNotification, + ) + from stripe.events._v1_terminal_reader_action_succeeded_event import ( + V1TerminalReaderActionSucceededEvent as V1TerminalReaderActionSucceededEvent, + V1TerminalReaderActionSucceededEventNotification as V1TerminalReaderActionSucceededEventNotification, + ) + from stripe.events._v1_terminal_reader_action_updated_event import ( + V1TerminalReaderActionUpdatedEvent as V1TerminalReaderActionUpdatedEvent, + V1TerminalReaderActionUpdatedEventNotification as V1TerminalReaderActionUpdatedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_advancing_event import ( + V1TestHelpersTestClockAdvancingEvent as V1TestHelpersTestClockAdvancingEvent, + V1TestHelpersTestClockAdvancingEventNotification as V1TestHelpersTestClockAdvancingEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_created_event import ( + V1TestHelpersTestClockCreatedEvent as V1TestHelpersTestClockCreatedEvent, + V1TestHelpersTestClockCreatedEventNotification as V1TestHelpersTestClockCreatedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_deleted_event import ( + V1TestHelpersTestClockDeletedEvent as V1TestHelpersTestClockDeletedEvent, + V1TestHelpersTestClockDeletedEventNotification as V1TestHelpersTestClockDeletedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_internal_failure_event import ( + V1TestHelpersTestClockInternalFailureEvent as V1TestHelpersTestClockInternalFailureEvent, + V1TestHelpersTestClockInternalFailureEventNotification as V1TestHelpersTestClockInternalFailureEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_ready_event import ( + V1TestHelpersTestClockReadyEvent as V1TestHelpersTestClockReadyEvent, + V1TestHelpersTestClockReadyEventNotification as V1TestHelpersTestClockReadyEventNotification, + ) + from stripe.events._v1_topup_canceled_event import ( + V1TopupCanceledEvent as V1TopupCanceledEvent, + V1TopupCanceledEventNotification as V1TopupCanceledEventNotification, + ) + from stripe.events._v1_topup_created_event import ( + V1TopupCreatedEvent as V1TopupCreatedEvent, + V1TopupCreatedEventNotification as V1TopupCreatedEventNotification, + ) + from stripe.events._v1_topup_failed_event import ( + V1TopupFailedEvent as V1TopupFailedEvent, + V1TopupFailedEventNotification as V1TopupFailedEventNotification, + ) + from stripe.events._v1_topup_reversed_event import ( + V1TopupReversedEvent as V1TopupReversedEvent, + V1TopupReversedEventNotification as V1TopupReversedEventNotification, + ) + from stripe.events._v1_topup_succeeded_event import ( + V1TopupSucceededEvent as V1TopupSucceededEvent, + V1TopupSucceededEventNotification as V1TopupSucceededEventNotification, + ) + from stripe.events._v1_transfer_created_event import ( + V1TransferCreatedEvent as V1TransferCreatedEvent, + V1TransferCreatedEventNotification as V1TransferCreatedEventNotification, + ) + from stripe.events._v1_transfer_reversed_event import ( + V1TransferReversedEvent as V1TransferReversedEvent, + V1TransferReversedEventNotification as V1TransferReversedEventNotification, + ) + from stripe.events._v1_transfer_updated_event import ( + V1TransferUpdatedEvent as V1TransferUpdatedEvent, + V1TransferUpdatedEventNotification as V1TransferUpdatedEventNotification, + ) from stripe.events._v2_billing_cadence_billed_event import ( V2BillingCadenceBilledEvent as V2BillingCadenceBilledEvent, V2BillingCadenceBilledEventNotification as V2BillingCadenceBilledEventNotification, @@ -177,6 +973,22 @@ V2BillingRateCardVersionCreatedEvent as V2BillingRateCardVersionCreatedEvent, V2BillingRateCardVersionCreatedEventNotification as V2BillingRateCardVersionCreatedEventNotification, ) + from stripe.events._v2_commerce_product_catalog_imports_failed_event import ( + V2CommerceProductCatalogImportsFailedEvent as V2CommerceProductCatalogImportsFailedEvent, + V2CommerceProductCatalogImportsFailedEventNotification as V2CommerceProductCatalogImportsFailedEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_processing_event import ( + V2CommerceProductCatalogImportsProcessingEvent as V2CommerceProductCatalogImportsProcessingEvent, + V2CommerceProductCatalogImportsProcessingEventNotification as V2CommerceProductCatalogImportsProcessingEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_event import ( + V2CommerceProductCatalogImportsSucceededEvent as V2CommerceProductCatalogImportsSucceededEvent, + V2CommerceProductCatalogImportsSucceededEventNotification as V2CommerceProductCatalogImportsSucceededEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event import ( + V2CommerceProductCatalogImportsSucceededWithErrorsEvent as V2CommerceProductCatalogImportsSucceededWithErrorsEvent, + V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification as V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, + ) from stripe.events._v2_core_account_closed_event import ( V2CoreAccountClosedEvent as V2CoreAccountClosedEvent, V2CoreAccountClosedEventNotification as V2CoreAccountClosedEventNotification, @@ -265,6 +1077,26 @@ V2CoreAccountUpdatedEvent as V2CoreAccountUpdatedEvent, V2CoreAccountUpdatedEventNotification as V2CoreAccountUpdatedEventNotification, ) + from stripe.events._v2_core_approval_request_approved_event import ( + V2CoreApprovalRequestApprovedEvent as V2CoreApprovalRequestApprovedEvent, + V2CoreApprovalRequestApprovedEventNotification as V2CoreApprovalRequestApprovedEventNotification, + ) + from stripe.events._v2_core_approval_request_canceled_event import ( + V2CoreApprovalRequestCanceledEvent as V2CoreApprovalRequestCanceledEvent, + V2CoreApprovalRequestCanceledEventNotification as V2CoreApprovalRequestCanceledEventNotification, + ) + from stripe.events._v2_core_approval_request_failed_event import ( + V2CoreApprovalRequestFailedEvent as V2CoreApprovalRequestFailedEvent, + V2CoreApprovalRequestFailedEventNotification as V2CoreApprovalRequestFailedEventNotification, + ) + from stripe.events._v2_core_approval_request_rejected_event import ( + V2CoreApprovalRequestRejectedEvent as V2CoreApprovalRequestRejectedEvent, + V2CoreApprovalRequestRejectedEventNotification as V2CoreApprovalRequestRejectedEventNotification, + ) + from stripe.events._v2_core_approval_request_succeeded_event import ( + V2CoreApprovalRequestSucceededEvent as V2CoreApprovalRequestSucceededEvent, + V2CoreApprovalRequestSucceededEventNotification as V2CoreApprovalRequestSucceededEventNotification, + ) from stripe.events._v2_core_batch_job_batch_failed_event import ( V2CoreBatchJobBatchFailedEvent as V2CoreBatchJobBatchFailedEvent, V2CoreBatchJobBatchFailedEventNotification as V2CoreBatchJobBatchFailedEventNotification, @@ -321,9 +1153,9 @@ V2CoreClaimableSandboxExpiringEvent as V2CoreClaimableSandboxExpiringEvent, V2CoreClaimableSandboxExpiringEventNotification as V2CoreClaimableSandboxExpiringEventNotification, ) - from stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event import ( - V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent as V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent, - V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification as V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification, + from stripe.events._v2_core_claimable_sandbox_updated_event import ( + V2CoreClaimableSandboxUpdatedEvent as V2CoreClaimableSandboxUpdatedEvent, + V2CoreClaimableSandboxUpdatedEventNotification as V2CoreClaimableSandboxUpdatedEventNotification, ) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEvent as V2CoreEventDestinationPingEvent, @@ -377,6 +1209,14 @@ V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent as V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent, V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification as V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification, ) + from stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event import ( + V2CoreHealthMeterEventSummariesDelayedFiringEvent as V2CoreHealthMeterEventSummariesDelayedFiringEvent, + V2CoreHealthMeterEventSummariesDelayedFiringEventNotification as V2CoreHealthMeterEventSummariesDelayedFiringEventNotification, + ) + from stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event import ( + V2CoreHealthMeterEventSummariesDelayedResolvedEvent as V2CoreHealthMeterEventSummariesDelayedResolvedEvent, + V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification as V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification, + ) from stripe.events._v2_core_health_payment_method_error_firing_event import ( V2CoreHealthPaymentMethodErrorFiringEvent as V2CoreHealthPaymentMethodErrorFiringEvent, V2CoreHealthPaymentMethodErrorFiringEventNotification as V2CoreHealthPaymentMethodErrorFiringEventNotification, @@ -425,6 +1265,18 @@ V2DataReportingQueryRunUpdatedEvent as V2DataReportingQueryRunUpdatedEvent, V2DataReportingQueryRunUpdatedEventNotification as V2DataReportingQueryRunUpdatedEventNotification, ) + from stripe.events._v2_extend_workflow_run_failed_event import ( + V2ExtendWorkflowRunFailedEvent as V2ExtendWorkflowRunFailedEvent, + V2ExtendWorkflowRunFailedEventNotification as V2ExtendWorkflowRunFailedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_started_event import ( + V2ExtendWorkflowRunStartedEvent as V2ExtendWorkflowRunStartedEvent, + V2ExtendWorkflowRunStartedEventNotification as V2ExtendWorkflowRunStartedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_succeeded_event import ( + V2ExtendWorkflowRunSucceededEvent as V2ExtendWorkflowRunSucceededEvent, + V2ExtendWorkflowRunSucceededEventNotification as V2ExtendWorkflowRunSucceededEventNotification, + ) from stripe.events._v2_iam_api_key_created_event import ( V2IamApiKeyCreatedEvent as V2IamApiKeyCreatedEvent, V2IamApiKeyCreatedEventNotification as V2IamApiKeyCreatedEventNotification, @@ -625,6 +1477,22 @@ V2MoneyManagementTransactionUpdatedEvent as V2MoneyManagementTransactionUpdatedEvent, V2MoneyManagementTransactionUpdatedEventNotification as V2MoneyManagementTransactionUpdatedEventNotification, ) + from stripe.events._v2_orchestrated_commerce_agreement_confirmed_event import ( + V2OrchestratedCommerceAgreementConfirmedEvent as V2OrchestratedCommerceAgreementConfirmedEvent, + V2OrchestratedCommerceAgreementConfirmedEventNotification as V2OrchestratedCommerceAgreementConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_created_event import ( + V2OrchestratedCommerceAgreementCreatedEvent as V2OrchestratedCommerceAgreementCreatedEvent, + V2OrchestratedCommerceAgreementCreatedEventNotification as V2OrchestratedCommerceAgreementCreatedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event import ( + V2OrchestratedCommerceAgreementPartiallyConfirmedEvent as V2OrchestratedCommerceAgreementPartiallyConfirmedEvent, + V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification as V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_terminated_event import ( + V2OrchestratedCommerceAgreementTerminatedEvent as V2OrchestratedCommerceAgreementTerminatedEvent, + V2OrchestratedCommerceAgreementTerminatedEventNotification as V2OrchestratedCommerceAgreementTerminatedEventNotification, + ) from stripe.events._v2_payments_off_session_payment_attempt_failed_event import ( V2PaymentsOffSessionPaymentAttemptFailedEvent as V2PaymentsOffSessionPaymentAttemptFailedEvent, V2PaymentsOffSessionPaymentAttemptFailedEventNotification as V2PaymentsOffSessionPaymentAttemptFailedEventNotification, @@ -737,28 +1605,1509 @@ # name -> (import_target, is_submodule) _import_map = { "ALL_EVENT_NOTIFICATIONS": ("stripe.events._event_classes", False), + "V1AccountApplicationAuthorizedEvent": ( + "stripe.events._v1_account_application_authorized_event", + False, + ), + "V1AccountApplicationAuthorizedEventNotification": ( + "stripe.events._v1_account_application_authorized_event", + False, + ), + "V1AccountApplicationDeauthorizedEvent": ( + "stripe.events._v1_account_application_deauthorized_event", + False, + ), + "V1AccountApplicationDeauthorizedEventNotification": ( + "stripe.events._v1_account_application_deauthorized_event", + False, + ), + "V1AccountExternalAccountCreatedEvent": ( + "stripe.events._v1_account_external_account_created_event", + False, + ), + "V1AccountExternalAccountCreatedEventNotification": ( + "stripe.events._v1_account_external_account_created_event", + False, + ), + "V1AccountExternalAccountDeletedEvent": ( + "stripe.events._v1_account_external_account_deleted_event", + False, + ), + "V1AccountExternalAccountDeletedEventNotification": ( + "stripe.events._v1_account_external_account_deleted_event", + False, + ), + "V1AccountExternalAccountUpdatedEvent": ( + "stripe.events._v1_account_external_account_updated_event", + False, + ), + "V1AccountExternalAccountUpdatedEventNotification": ( + "stripe.events._v1_account_external_account_updated_event", + False, + ), "V1AccountSignalsIncludingDelinquencyCreatedEvent": ( "stripe.events._v1_account_signals_including_delinquency_created_event", False, ), - "V1AccountSignalsIncludingDelinquencyCreatedEventNotification": ( - "stripe.events._v1_account_signals_including_delinquency_created_event", + "V1AccountSignalsIncludingDelinquencyCreatedEventNotification": ( + "stripe.events._v1_account_signals_including_delinquency_created_event", + False, + ), + "V1AccountUpdatedEvent": ( + "stripe.events._v1_account_updated_event", + False, + ), + "V1AccountUpdatedEventNotification": ( + "stripe.events._v1_account_updated_event", + False, + ), + "V1ApplicationFeeCreatedEvent": ( + "stripe.events._v1_application_fee_created_event", + False, + ), + "V1ApplicationFeeCreatedEventNotification": ( + "stripe.events._v1_application_fee_created_event", + False, + ), + "V1ApplicationFeeRefundUpdatedEvent": ( + "stripe.events._v1_application_fee_refund_updated_event", + False, + ), + "V1ApplicationFeeRefundUpdatedEventNotification": ( + "stripe.events._v1_application_fee_refund_updated_event", + False, + ), + "V1ApplicationFeeRefundedEvent": ( + "stripe.events._v1_application_fee_refunded_event", + False, + ), + "V1ApplicationFeeRefundedEventNotification": ( + "stripe.events._v1_application_fee_refunded_event", + False, + ), + "V1BalanceAvailableEvent": ( + "stripe.events._v1_balance_available_event", + False, + ), + "V1BalanceAvailableEventNotification": ( + "stripe.events._v1_balance_available_event", + False, + ), + "V1BillingAlertTriggeredEvent": ( + "stripe.events._v1_billing_alert_triggered_event", + False, + ), + "V1BillingAlertTriggeredEventNotification": ( + "stripe.events._v1_billing_alert_triggered_event", + False, + ), + "V1BillingMeterErrorReportTriggeredEvent": ( + "stripe.events._v1_billing_meter_error_report_triggered_event", + False, + ), + "V1BillingMeterErrorReportTriggeredEventNotification": ( + "stripe.events._v1_billing_meter_error_report_triggered_event", + False, + ), + "V1BillingMeterNoMeterFoundEvent": ( + "stripe.events._v1_billing_meter_no_meter_found_event", + False, + ), + "V1BillingMeterNoMeterFoundEventNotification": ( + "stripe.events._v1_billing_meter_no_meter_found_event", + False, + ), + "V1BillingPortalConfigurationCreatedEvent": ( + "stripe.events._v1_billing_portal_configuration_created_event", + False, + ), + "V1BillingPortalConfigurationCreatedEventNotification": ( + "stripe.events._v1_billing_portal_configuration_created_event", + False, + ), + "V1BillingPortalConfigurationUpdatedEvent": ( + "stripe.events._v1_billing_portal_configuration_updated_event", + False, + ), + "V1BillingPortalConfigurationUpdatedEventNotification": ( + "stripe.events._v1_billing_portal_configuration_updated_event", + False, + ), + "V1BillingPortalSessionCreatedEvent": ( + "stripe.events._v1_billing_portal_session_created_event", + False, + ), + "V1BillingPortalSessionCreatedEventNotification": ( + "stripe.events._v1_billing_portal_session_created_event", + False, + ), + "V1CapabilityUpdatedEvent": ( + "stripe.events._v1_capability_updated_event", + False, + ), + "V1CapabilityUpdatedEventNotification": ( + "stripe.events._v1_capability_updated_event", + False, + ), + "V1CashBalanceFundsAvailableEvent": ( + "stripe.events._v1_cash_balance_funds_available_event", + False, + ), + "V1CashBalanceFundsAvailableEventNotification": ( + "stripe.events._v1_cash_balance_funds_available_event", + False, + ), + "V1ChargeCapturedEvent": ( + "stripe.events._v1_charge_captured_event", + False, + ), + "V1ChargeCapturedEventNotification": ( + "stripe.events._v1_charge_captured_event", + False, + ), + "V1ChargeDisputeClosedEvent": ( + "stripe.events._v1_charge_dispute_closed_event", + False, + ), + "V1ChargeDisputeClosedEventNotification": ( + "stripe.events._v1_charge_dispute_closed_event", + False, + ), + "V1ChargeDisputeCreatedEvent": ( + "stripe.events._v1_charge_dispute_created_event", + False, + ), + "V1ChargeDisputeCreatedEventNotification": ( + "stripe.events._v1_charge_dispute_created_event", + False, + ), + "V1ChargeDisputeFundsReinstatedEvent": ( + "stripe.events._v1_charge_dispute_funds_reinstated_event", + False, + ), + "V1ChargeDisputeFundsReinstatedEventNotification": ( + "stripe.events._v1_charge_dispute_funds_reinstated_event", + False, + ), + "V1ChargeDisputeFundsWithdrawnEvent": ( + "stripe.events._v1_charge_dispute_funds_withdrawn_event", + False, + ), + "V1ChargeDisputeFundsWithdrawnEventNotification": ( + "stripe.events._v1_charge_dispute_funds_withdrawn_event", + False, + ), + "V1ChargeDisputeUpdatedEvent": ( + "stripe.events._v1_charge_dispute_updated_event", + False, + ), + "V1ChargeDisputeUpdatedEventNotification": ( + "stripe.events._v1_charge_dispute_updated_event", + False, + ), + "V1ChargeExpiredEvent": ("stripe.events._v1_charge_expired_event", False), + "V1ChargeExpiredEventNotification": ( + "stripe.events._v1_charge_expired_event", + False, + ), + "V1ChargeFailedEvent": ("stripe.events._v1_charge_failed_event", False), + "V1ChargeFailedEventNotification": ( + "stripe.events._v1_charge_failed_event", + False, + ), + "V1ChargePendingEvent": ("stripe.events._v1_charge_pending_event", False), + "V1ChargePendingEventNotification": ( + "stripe.events._v1_charge_pending_event", + False, + ), + "V1ChargeRefundUpdatedEvent": ( + "stripe.events._v1_charge_refund_updated_event", + False, + ), + "V1ChargeRefundUpdatedEventNotification": ( + "stripe.events._v1_charge_refund_updated_event", + False, + ), + "V1ChargeRefundedEvent": ( + "stripe.events._v1_charge_refunded_event", + False, + ), + "V1ChargeRefundedEventNotification": ( + "stripe.events._v1_charge_refunded_event", + False, + ), + "V1ChargeSucceededEvent": ( + "stripe.events._v1_charge_succeeded_event", + False, + ), + "V1ChargeSucceededEventNotification": ( + "stripe.events._v1_charge_succeeded_event", + False, + ), + "V1ChargeUpdatedEvent": ("stripe.events._v1_charge_updated_event", False), + "V1ChargeUpdatedEventNotification": ( + "stripe.events._v1_charge_updated_event", + False, + ), + "V1CheckoutSessionAsyncPaymentFailedEvent": ( + "stripe.events._v1_checkout_session_async_payment_failed_event", + False, + ), + "V1CheckoutSessionAsyncPaymentFailedEventNotification": ( + "stripe.events._v1_checkout_session_async_payment_failed_event", + False, + ), + "V1CheckoutSessionAsyncPaymentSucceededEvent": ( + "stripe.events._v1_checkout_session_async_payment_succeeded_event", + False, + ), + "V1CheckoutSessionAsyncPaymentSucceededEventNotification": ( + "stripe.events._v1_checkout_session_async_payment_succeeded_event", + False, + ), + "V1CheckoutSessionCompletedEvent": ( + "stripe.events._v1_checkout_session_completed_event", + False, + ), + "V1CheckoutSessionCompletedEventNotification": ( + "stripe.events._v1_checkout_session_completed_event", + False, + ), + "V1CheckoutSessionExpiredEvent": ( + "stripe.events._v1_checkout_session_expired_event", + False, + ), + "V1CheckoutSessionExpiredEventNotification": ( + "stripe.events._v1_checkout_session_expired_event", + False, + ), + "V1ClimateOrderCanceledEvent": ( + "stripe.events._v1_climate_order_canceled_event", + False, + ), + "V1ClimateOrderCanceledEventNotification": ( + "stripe.events._v1_climate_order_canceled_event", + False, + ), + "V1ClimateOrderCreatedEvent": ( + "stripe.events._v1_climate_order_created_event", + False, + ), + "V1ClimateOrderCreatedEventNotification": ( + "stripe.events._v1_climate_order_created_event", + False, + ), + "V1ClimateOrderDelayedEvent": ( + "stripe.events._v1_climate_order_delayed_event", + False, + ), + "V1ClimateOrderDelayedEventNotification": ( + "stripe.events._v1_climate_order_delayed_event", + False, + ), + "V1ClimateOrderDeliveredEvent": ( + "stripe.events._v1_climate_order_delivered_event", + False, + ), + "V1ClimateOrderDeliveredEventNotification": ( + "stripe.events._v1_climate_order_delivered_event", + False, + ), + "V1ClimateOrderProductSubstitutedEvent": ( + "stripe.events._v1_climate_order_product_substituted_event", + False, + ), + "V1ClimateOrderProductSubstitutedEventNotification": ( + "stripe.events._v1_climate_order_product_substituted_event", + False, + ), + "V1ClimateProductCreatedEvent": ( + "stripe.events._v1_climate_product_created_event", + False, + ), + "V1ClimateProductCreatedEventNotification": ( + "stripe.events._v1_climate_product_created_event", + False, + ), + "V1ClimateProductPricingUpdatedEvent": ( + "stripe.events._v1_climate_product_pricing_updated_event", + False, + ), + "V1ClimateProductPricingUpdatedEventNotification": ( + "stripe.events._v1_climate_product_pricing_updated_event", + False, + ), + "V1CouponCreatedEvent": ("stripe.events._v1_coupon_created_event", False), + "V1CouponCreatedEventNotification": ( + "stripe.events._v1_coupon_created_event", + False, + ), + "V1CouponDeletedEvent": ("stripe.events._v1_coupon_deleted_event", False), + "V1CouponDeletedEventNotification": ( + "stripe.events._v1_coupon_deleted_event", + False, + ), + "V1CouponUpdatedEvent": ("stripe.events._v1_coupon_updated_event", False), + "V1CouponUpdatedEventNotification": ( + "stripe.events._v1_coupon_updated_event", + False, + ), + "V1CreditNoteCreatedEvent": ( + "stripe.events._v1_credit_note_created_event", + False, + ), + "V1CreditNoteCreatedEventNotification": ( + "stripe.events._v1_credit_note_created_event", + False, + ), + "V1CreditNoteUpdatedEvent": ( + "stripe.events._v1_credit_note_updated_event", + False, + ), + "V1CreditNoteUpdatedEventNotification": ( + "stripe.events._v1_credit_note_updated_event", + False, + ), + "V1CreditNoteVoidedEvent": ( + "stripe.events._v1_credit_note_voided_event", + False, + ), + "V1CreditNoteVoidedEventNotification": ( + "stripe.events._v1_credit_note_voided_event", + False, + ), + "V1CustomerCashBalanceTransactionCreatedEvent": ( + "stripe.events._v1_customer_cash_balance_transaction_created_event", + False, + ), + "V1CustomerCashBalanceTransactionCreatedEventNotification": ( + "stripe.events._v1_customer_cash_balance_transaction_created_event", + False, + ), + "V1CustomerCreatedEvent": ( + "stripe.events._v1_customer_created_event", + False, + ), + "V1CustomerCreatedEventNotification": ( + "stripe.events._v1_customer_created_event", + False, + ), + "V1CustomerDeletedEvent": ( + "stripe.events._v1_customer_deleted_event", + False, + ), + "V1CustomerDeletedEventNotification": ( + "stripe.events._v1_customer_deleted_event", + False, + ), + "V1CustomerSubscriptionCreatedEvent": ( + "stripe.events._v1_customer_subscription_created_event", + False, + ), + "V1CustomerSubscriptionCreatedEventNotification": ( + "stripe.events._v1_customer_subscription_created_event", + False, + ), + "V1CustomerSubscriptionDeletedEvent": ( + "stripe.events._v1_customer_subscription_deleted_event", + False, + ), + "V1CustomerSubscriptionDeletedEventNotification": ( + "stripe.events._v1_customer_subscription_deleted_event", + False, + ), + "V1CustomerSubscriptionPausedEvent": ( + "stripe.events._v1_customer_subscription_paused_event", + False, + ), + "V1CustomerSubscriptionPausedEventNotification": ( + "stripe.events._v1_customer_subscription_paused_event", + False, + ), + "V1CustomerSubscriptionPendingUpdateAppliedEvent": ( + "stripe.events._v1_customer_subscription_pending_update_applied_event", + False, + ), + "V1CustomerSubscriptionPendingUpdateAppliedEventNotification": ( + "stripe.events._v1_customer_subscription_pending_update_applied_event", + False, + ), + "V1CustomerSubscriptionPendingUpdateExpiredEvent": ( + "stripe.events._v1_customer_subscription_pending_update_expired_event", + False, + ), + "V1CustomerSubscriptionPendingUpdateExpiredEventNotification": ( + "stripe.events._v1_customer_subscription_pending_update_expired_event", + False, + ), + "V1CustomerSubscriptionResumedEvent": ( + "stripe.events._v1_customer_subscription_resumed_event", + False, + ), + "V1CustomerSubscriptionResumedEventNotification": ( + "stripe.events._v1_customer_subscription_resumed_event", + False, + ), + "V1CustomerSubscriptionTrialWillEndEvent": ( + "stripe.events._v1_customer_subscription_trial_will_end_event", + False, + ), + "V1CustomerSubscriptionTrialWillEndEventNotification": ( + "stripe.events._v1_customer_subscription_trial_will_end_event", + False, + ), + "V1CustomerSubscriptionUpdatedEvent": ( + "stripe.events._v1_customer_subscription_updated_event", + False, + ), + "V1CustomerSubscriptionUpdatedEventNotification": ( + "stripe.events._v1_customer_subscription_updated_event", + False, + ), + "V1CustomerTaxIdCreatedEvent": ( + "stripe.events._v1_customer_tax_id_created_event", + False, + ), + "V1CustomerTaxIdCreatedEventNotification": ( + "stripe.events._v1_customer_tax_id_created_event", + False, + ), + "V1CustomerTaxIdDeletedEvent": ( + "stripe.events._v1_customer_tax_id_deleted_event", + False, + ), + "V1CustomerTaxIdDeletedEventNotification": ( + "stripe.events._v1_customer_tax_id_deleted_event", + False, + ), + "V1CustomerTaxIdUpdatedEvent": ( + "stripe.events._v1_customer_tax_id_updated_event", + False, + ), + "V1CustomerTaxIdUpdatedEventNotification": ( + "stripe.events._v1_customer_tax_id_updated_event", + False, + ), + "V1CustomerUpdatedEvent": ( + "stripe.events._v1_customer_updated_event", + False, + ), + "V1CustomerUpdatedEventNotification": ( + "stripe.events._v1_customer_updated_event", + False, + ), + "V1EntitlementsActiveEntitlementSummaryUpdatedEvent": ( + "stripe.events._v1_entitlements_active_entitlement_summary_updated_event", + False, + ), + "V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification": ( + "stripe.events._v1_entitlements_active_entitlement_summary_updated_event", + False, + ), + "V1FileCreatedEvent": ("stripe.events._v1_file_created_event", False), + "V1FileCreatedEventNotification": ( + "stripe.events._v1_file_created_event", + False, + ), + "V1FinancialConnectionsAccountCreatedEvent": ( + "stripe.events._v1_financial_connections_account_created_event", + False, + ), + "V1FinancialConnectionsAccountCreatedEventNotification": ( + "stripe.events._v1_financial_connections_account_created_event", + False, + ), + "V1FinancialConnectionsAccountDeactivatedEvent": ( + "stripe.events._v1_financial_connections_account_deactivated_event", + False, + ), + "V1FinancialConnectionsAccountDeactivatedEventNotification": ( + "stripe.events._v1_financial_connections_account_deactivated_event", + False, + ), + "V1FinancialConnectionsAccountDisconnectedEvent": ( + "stripe.events._v1_financial_connections_account_disconnected_event", + False, + ), + "V1FinancialConnectionsAccountDisconnectedEventNotification": ( + "stripe.events._v1_financial_connections_account_disconnected_event", + False, + ), + "V1FinancialConnectionsAccountReactivatedEvent": ( + "stripe.events._v1_financial_connections_account_reactivated_event", + False, + ), + "V1FinancialConnectionsAccountReactivatedEventNotification": ( + "stripe.events._v1_financial_connections_account_reactivated_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedBalanceEvent": ( + "stripe.events._v1_financial_connections_account_refreshed_balance_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedBalanceEventNotification": ( + "stripe.events._v1_financial_connections_account_refreshed_balance_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedOwnershipEvent": ( + "stripe.events._v1_financial_connections_account_refreshed_ownership_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedOwnershipEventNotification": ( + "stripe.events._v1_financial_connections_account_refreshed_ownership_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedTransactionsEvent": ( + "stripe.events._v1_financial_connections_account_refreshed_transactions_event", + False, + ), + "V1FinancialConnectionsAccountRefreshedTransactionsEventNotification": ( + "stripe.events._v1_financial_connections_account_refreshed_transactions_event", + False, + ), + "V1IdentityVerificationSessionCanceledEvent": ( + "stripe.events._v1_identity_verification_session_canceled_event", + False, + ), + "V1IdentityVerificationSessionCanceledEventNotification": ( + "stripe.events._v1_identity_verification_session_canceled_event", + False, + ), + "V1IdentityVerificationSessionCreatedEvent": ( + "stripe.events._v1_identity_verification_session_created_event", + False, + ), + "V1IdentityVerificationSessionCreatedEventNotification": ( + "stripe.events._v1_identity_verification_session_created_event", + False, + ), + "V1IdentityVerificationSessionProcessingEvent": ( + "stripe.events._v1_identity_verification_session_processing_event", + False, + ), + "V1IdentityVerificationSessionProcessingEventNotification": ( + "stripe.events._v1_identity_verification_session_processing_event", + False, + ), + "V1IdentityVerificationSessionRedactedEvent": ( + "stripe.events._v1_identity_verification_session_redacted_event", + False, + ), + "V1IdentityVerificationSessionRedactedEventNotification": ( + "stripe.events._v1_identity_verification_session_redacted_event", + False, + ), + "V1IdentityVerificationSessionRequiresInputEvent": ( + "stripe.events._v1_identity_verification_session_requires_input_event", + False, + ), + "V1IdentityVerificationSessionRequiresInputEventNotification": ( + "stripe.events._v1_identity_verification_session_requires_input_event", + False, + ), + "V1IdentityVerificationSessionVerifiedEvent": ( + "stripe.events._v1_identity_verification_session_verified_event", + False, + ), + "V1IdentityVerificationSessionVerifiedEventNotification": ( + "stripe.events._v1_identity_verification_session_verified_event", + False, + ), + "V1InvoiceCreatedEvent": ( + "stripe.events._v1_invoice_created_event", + False, + ), + "V1InvoiceCreatedEventNotification": ( + "stripe.events._v1_invoice_created_event", + False, + ), + "V1InvoiceDeletedEvent": ( + "stripe.events._v1_invoice_deleted_event", + False, + ), + "V1InvoiceDeletedEventNotification": ( + "stripe.events._v1_invoice_deleted_event", + False, + ), + "V1InvoiceFinalizationFailedEvent": ( + "stripe.events._v1_invoice_finalization_failed_event", + False, + ), + "V1InvoiceFinalizationFailedEventNotification": ( + "stripe.events._v1_invoice_finalization_failed_event", + False, + ), + "V1InvoiceFinalizedEvent": ( + "stripe.events._v1_invoice_finalized_event", + False, + ), + "V1InvoiceFinalizedEventNotification": ( + "stripe.events._v1_invoice_finalized_event", + False, + ), + "V1InvoiceMarkedUncollectibleEvent": ( + "stripe.events._v1_invoice_marked_uncollectible_event", + False, + ), + "V1InvoiceMarkedUncollectibleEventNotification": ( + "stripe.events._v1_invoice_marked_uncollectible_event", + False, + ), + "V1InvoiceOverdueEvent": ( + "stripe.events._v1_invoice_overdue_event", + False, + ), + "V1InvoiceOverdueEventNotification": ( + "stripe.events._v1_invoice_overdue_event", + False, + ), + "V1InvoiceOverpaidEvent": ( + "stripe.events._v1_invoice_overpaid_event", + False, + ), + "V1InvoiceOverpaidEventNotification": ( + "stripe.events._v1_invoice_overpaid_event", + False, + ), + "V1InvoicePaidEvent": ("stripe.events._v1_invoice_paid_event", False), + "V1InvoicePaidEventNotification": ( + "stripe.events._v1_invoice_paid_event", + False, + ), + "V1InvoicePaymentActionRequiredEvent": ( + "stripe.events._v1_invoice_payment_action_required_event", + False, + ), + "V1InvoicePaymentActionRequiredEventNotification": ( + "stripe.events._v1_invoice_payment_action_required_event", + False, + ), + "V1InvoicePaymentFailedEvent": ( + "stripe.events._v1_invoice_payment_failed_event", + False, + ), + "V1InvoicePaymentFailedEventNotification": ( + "stripe.events._v1_invoice_payment_failed_event", + False, + ), + "V1InvoicePaymentPaidEvent": ( + "stripe.events._v1_invoice_payment_paid_event", + False, + ), + "V1InvoicePaymentPaidEventNotification": ( + "stripe.events._v1_invoice_payment_paid_event", + False, + ), + "V1InvoicePaymentSucceededEvent": ( + "stripe.events._v1_invoice_payment_succeeded_event", + False, + ), + "V1InvoicePaymentSucceededEventNotification": ( + "stripe.events._v1_invoice_payment_succeeded_event", + False, + ), + "V1InvoiceSentEvent": ("stripe.events._v1_invoice_sent_event", False), + "V1InvoiceSentEventNotification": ( + "stripe.events._v1_invoice_sent_event", + False, + ), + "V1InvoiceUpcomingEvent": ( + "stripe.events._v1_invoice_upcoming_event", + False, + ), + "V1InvoiceUpcomingEventNotification": ( + "stripe.events._v1_invoice_upcoming_event", + False, + ), + "V1InvoiceUpdatedEvent": ( + "stripe.events._v1_invoice_updated_event", + False, + ), + "V1InvoiceUpdatedEventNotification": ( + "stripe.events._v1_invoice_updated_event", + False, + ), + "V1InvoiceVoidedEvent": ("stripe.events._v1_invoice_voided_event", False), + "V1InvoiceVoidedEventNotification": ( + "stripe.events._v1_invoice_voided_event", + False, + ), + "V1InvoiceWillBeDueEvent": ( + "stripe.events._v1_invoice_will_be_due_event", + False, + ), + "V1InvoiceWillBeDueEventNotification": ( + "stripe.events._v1_invoice_will_be_due_event", + False, + ), + "V1InvoiceitemCreatedEvent": ( + "stripe.events._v1_invoiceitem_created_event", + False, + ), + "V1InvoiceitemCreatedEventNotification": ( + "stripe.events._v1_invoiceitem_created_event", + False, + ), + "V1InvoiceitemDeletedEvent": ( + "stripe.events._v1_invoiceitem_deleted_event", + False, + ), + "V1InvoiceitemDeletedEventNotification": ( + "stripe.events._v1_invoiceitem_deleted_event", + False, + ), + "V1IssuingAuthorizationCreatedEvent": ( + "stripe.events._v1_issuing_authorization_created_event", + False, + ), + "V1IssuingAuthorizationCreatedEventNotification": ( + "stripe.events._v1_issuing_authorization_created_event", + False, + ), + "V1IssuingAuthorizationRequestEvent": ( + "stripe.events._v1_issuing_authorization_request_event", + False, + ), + "V1IssuingAuthorizationRequestEventNotification": ( + "stripe.events._v1_issuing_authorization_request_event", + False, + ), + "V1IssuingAuthorizationUpdatedEvent": ( + "stripe.events._v1_issuing_authorization_updated_event", + False, + ), + "V1IssuingAuthorizationUpdatedEventNotification": ( + "stripe.events._v1_issuing_authorization_updated_event", + False, + ), + "V1IssuingCardCreatedEvent": ( + "stripe.events._v1_issuing_card_created_event", + False, + ), + "V1IssuingCardCreatedEventNotification": ( + "stripe.events._v1_issuing_card_created_event", + False, + ), + "V1IssuingCardUpdatedEvent": ( + "stripe.events._v1_issuing_card_updated_event", + False, + ), + "V1IssuingCardUpdatedEventNotification": ( + "stripe.events._v1_issuing_card_updated_event", + False, + ), + "V1IssuingCardholderCreatedEvent": ( + "stripe.events._v1_issuing_cardholder_created_event", + False, + ), + "V1IssuingCardholderCreatedEventNotification": ( + "stripe.events._v1_issuing_cardholder_created_event", + False, + ), + "V1IssuingCardholderUpdatedEvent": ( + "stripe.events._v1_issuing_cardholder_updated_event", + False, + ), + "V1IssuingCardholderUpdatedEventNotification": ( + "stripe.events._v1_issuing_cardholder_updated_event", + False, + ), + "V1IssuingDisputeClosedEvent": ( + "stripe.events._v1_issuing_dispute_closed_event", + False, + ), + "V1IssuingDisputeClosedEventNotification": ( + "stripe.events._v1_issuing_dispute_closed_event", + False, + ), + "V1IssuingDisputeCreatedEvent": ( + "stripe.events._v1_issuing_dispute_created_event", + False, + ), + "V1IssuingDisputeCreatedEventNotification": ( + "stripe.events._v1_issuing_dispute_created_event", + False, + ), + "V1IssuingDisputeFundsReinstatedEvent": ( + "stripe.events._v1_issuing_dispute_funds_reinstated_event", + False, + ), + "V1IssuingDisputeFundsReinstatedEventNotification": ( + "stripe.events._v1_issuing_dispute_funds_reinstated_event", + False, + ), + "V1IssuingDisputeFundsRescindedEvent": ( + "stripe.events._v1_issuing_dispute_funds_rescinded_event", + False, + ), + "V1IssuingDisputeFundsRescindedEventNotification": ( + "stripe.events._v1_issuing_dispute_funds_rescinded_event", + False, + ), + "V1IssuingDisputeSubmittedEvent": ( + "stripe.events._v1_issuing_dispute_submitted_event", + False, + ), + "V1IssuingDisputeSubmittedEventNotification": ( + "stripe.events._v1_issuing_dispute_submitted_event", + False, + ), + "V1IssuingDisputeUpdatedEvent": ( + "stripe.events._v1_issuing_dispute_updated_event", + False, + ), + "V1IssuingDisputeUpdatedEventNotification": ( + "stripe.events._v1_issuing_dispute_updated_event", + False, + ), + "V1IssuingPersonalizationDesignActivatedEvent": ( + "stripe.events._v1_issuing_personalization_design_activated_event", + False, + ), + "V1IssuingPersonalizationDesignActivatedEventNotification": ( + "stripe.events._v1_issuing_personalization_design_activated_event", + False, + ), + "V1IssuingPersonalizationDesignDeactivatedEvent": ( + "stripe.events._v1_issuing_personalization_design_deactivated_event", + False, + ), + "V1IssuingPersonalizationDesignDeactivatedEventNotification": ( + "stripe.events._v1_issuing_personalization_design_deactivated_event", + False, + ), + "V1IssuingPersonalizationDesignRejectedEvent": ( + "stripe.events._v1_issuing_personalization_design_rejected_event", + False, + ), + "V1IssuingPersonalizationDesignRejectedEventNotification": ( + "stripe.events._v1_issuing_personalization_design_rejected_event", + False, + ), + "V1IssuingPersonalizationDesignUpdatedEvent": ( + "stripe.events._v1_issuing_personalization_design_updated_event", + False, + ), + "V1IssuingPersonalizationDesignUpdatedEventNotification": ( + "stripe.events._v1_issuing_personalization_design_updated_event", + False, + ), + "V1IssuingTokenCreatedEvent": ( + "stripe.events._v1_issuing_token_created_event", + False, + ), + "V1IssuingTokenCreatedEventNotification": ( + "stripe.events._v1_issuing_token_created_event", + False, + ), + "V1IssuingTokenUpdatedEvent": ( + "stripe.events._v1_issuing_token_updated_event", + False, + ), + "V1IssuingTokenUpdatedEventNotification": ( + "stripe.events._v1_issuing_token_updated_event", + False, + ), + "V1IssuingTransactionCreatedEvent": ( + "stripe.events._v1_issuing_transaction_created_event", + False, + ), + "V1IssuingTransactionCreatedEventNotification": ( + "stripe.events._v1_issuing_transaction_created_event", + False, + ), + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent": ( + "stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event", + False, + ), + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification": ( + "stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event", + False, + ), + "V1IssuingTransactionUpdatedEvent": ( + "stripe.events._v1_issuing_transaction_updated_event", + False, + ), + "V1IssuingTransactionUpdatedEventNotification": ( + "stripe.events._v1_issuing_transaction_updated_event", + False, + ), + "V1MandateUpdatedEvent": ( + "stripe.events._v1_mandate_updated_event", + False, + ), + "V1MandateUpdatedEventNotification": ( + "stripe.events._v1_mandate_updated_event", + False, + ), + "V1PaymentIntentAmountCapturableUpdatedEvent": ( + "stripe.events._v1_payment_intent_amount_capturable_updated_event", + False, + ), + "V1PaymentIntentAmountCapturableUpdatedEventNotification": ( + "stripe.events._v1_payment_intent_amount_capturable_updated_event", + False, + ), + "V1PaymentIntentCanceledEvent": ( + "stripe.events._v1_payment_intent_canceled_event", + False, + ), + "V1PaymentIntentCanceledEventNotification": ( + "stripe.events._v1_payment_intent_canceled_event", + False, + ), + "V1PaymentIntentCreatedEvent": ( + "stripe.events._v1_payment_intent_created_event", + False, + ), + "V1PaymentIntentCreatedEventNotification": ( + "stripe.events._v1_payment_intent_created_event", + False, + ), + "V1PaymentIntentPartiallyFundedEvent": ( + "stripe.events._v1_payment_intent_partially_funded_event", + False, + ), + "V1PaymentIntentPartiallyFundedEventNotification": ( + "stripe.events._v1_payment_intent_partially_funded_event", + False, + ), + "V1PaymentIntentPaymentFailedEvent": ( + "stripe.events._v1_payment_intent_payment_failed_event", + False, + ), + "V1PaymentIntentPaymentFailedEventNotification": ( + "stripe.events._v1_payment_intent_payment_failed_event", + False, + ), + "V1PaymentIntentProcessingEvent": ( + "stripe.events._v1_payment_intent_processing_event", + False, + ), + "V1PaymentIntentProcessingEventNotification": ( + "stripe.events._v1_payment_intent_processing_event", + False, + ), + "V1PaymentIntentRequiresActionEvent": ( + "stripe.events._v1_payment_intent_requires_action_event", + False, + ), + "V1PaymentIntentRequiresActionEventNotification": ( + "stripe.events._v1_payment_intent_requires_action_event", + False, + ), + "V1PaymentIntentSucceededEvent": ( + "stripe.events._v1_payment_intent_succeeded_event", + False, + ), + "V1PaymentIntentSucceededEventNotification": ( + "stripe.events._v1_payment_intent_succeeded_event", + False, + ), + "V1PaymentLinkCreatedEvent": ( + "stripe.events._v1_payment_link_created_event", + False, + ), + "V1PaymentLinkCreatedEventNotification": ( + "stripe.events._v1_payment_link_created_event", + False, + ), + "V1PaymentLinkUpdatedEvent": ( + "stripe.events._v1_payment_link_updated_event", + False, + ), + "V1PaymentLinkUpdatedEventNotification": ( + "stripe.events._v1_payment_link_updated_event", + False, + ), + "V1PaymentMethodAttachedEvent": ( + "stripe.events._v1_payment_method_attached_event", + False, + ), + "V1PaymentMethodAttachedEventNotification": ( + "stripe.events._v1_payment_method_attached_event", + False, + ), + "V1PaymentMethodAutomaticallyUpdatedEvent": ( + "stripe.events._v1_payment_method_automatically_updated_event", + False, + ), + "V1PaymentMethodAutomaticallyUpdatedEventNotification": ( + "stripe.events._v1_payment_method_automatically_updated_event", + False, + ), + "V1PaymentMethodDetachedEvent": ( + "stripe.events._v1_payment_method_detached_event", + False, + ), + "V1PaymentMethodDetachedEventNotification": ( + "stripe.events._v1_payment_method_detached_event", + False, + ), + "V1PaymentMethodUpdatedEvent": ( + "stripe.events._v1_payment_method_updated_event", + False, + ), + "V1PaymentMethodUpdatedEventNotification": ( + "stripe.events._v1_payment_method_updated_event", + False, + ), + "V1PayoutCanceledEvent": ( + "stripe.events._v1_payout_canceled_event", + False, + ), + "V1PayoutCanceledEventNotification": ( + "stripe.events._v1_payout_canceled_event", + False, + ), + "V1PayoutCreatedEvent": ("stripe.events._v1_payout_created_event", False), + "V1PayoutCreatedEventNotification": ( + "stripe.events._v1_payout_created_event", + False, + ), + "V1PayoutFailedEvent": ("stripe.events._v1_payout_failed_event", False), + "V1PayoutFailedEventNotification": ( + "stripe.events._v1_payout_failed_event", + False, + ), + "V1PayoutPaidEvent": ("stripe.events._v1_payout_paid_event", False), + "V1PayoutPaidEventNotification": ( + "stripe.events._v1_payout_paid_event", + False, + ), + "V1PayoutReconciliationCompletedEvent": ( + "stripe.events._v1_payout_reconciliation_completed_event", + False, + ), + "V1PayoutReconciliationCompletedEventNotification": ( + "stripe.events._v1_payout_reconciliation_completed_event", + False, + ), + "V1PayoutUpdatedEvent": ("stripe.events._v1_payout_updated_event", False), + "V1PayoutUpdatedEventNotification": ( + "stripe.events._v1_payout_updated_event", + False, + ), + "V1PersonCreatedEvent": ("stripe.events._v1_person_created_event", False), + "V1PersonCreatedEventNotification": ( + "stripe.events._v1_person_created_event", + False, + ), + "V1PersonDeletedEvent": ("stripe.events._v1_person_deleted_event", False), + "V1PersonDeletedEventNotification": ( + "stripe.events._v1_person_deleted_event", + False, + ), + "V1PersonUpdatedEvent": ("stripe.events._v1_person_updated_event", False), + "V1PersonUpdatedEventNotification": ( + "stripe.events._v1_person_updated_event", + False, + ), + "V1PlanCreatedEvent": ("stripe.events._v1_plan_created_event", False), + "V1PlanCreatedEventNotification": ( + "stripe.events._v1_plan_created_event", + False, + ), + "V1PlanDeletedEvent": ("stripe.events._v1_plan_deleted_event", False), + "V1PlanDeletedEventNotification": ( + "stripe.events._v1_plan_deleted_event", + False, + ), + "V1PlanUpdatedEvent": ("stripe.events._v1_plan_updated_event", False), + "V1PlanUpdatedEventNotification": ( + "stripe.events._v1_plan_updated_event", + False, + ), + "V1PriceCreatedEvent": ("stripe.events._v1_price_created_event", False), + "V1PriceCreatedEventNotification": ( + "stripe.events._v1_price_created_event", + False, + ), + "V1PriceDeletedEvent": ("stripe.events._v1_price_deleted_event", False), + "V1PriceDeletedEventNotification": ( + "stripe.events._v1_price_deleted_event", + False, + ), + "V1PriceUpdatedEvent": ("stripe.events._v1_price_updated_event", False), + "V1PriceUpdatedEventNotification": ( + "stripe.events._v1_price_updated_event", False, ), - "V1BillingMeterErrorReportTriggeredEvent": ( - "stripe.events._v1_billing_meter_error_report_triggered_event", + "V1ProductCreatedEvent": ( + "stripe.events._v1_product_created_event", False, ), - "V1BillingMeterErrorReportTriggeredEventNotification": ( - "stripe.events._v1_billing_meter_error_report_triggered_event", + "V1ProductCreatedEventNotification": ( + "stripe.events._v1_product_created_event", False, ), - "V1BillingMeterNoMeterFoundEvent": ( - "stripe.events._v1_billing_meter_no_meter_found_event", + "V1ProductDeletedEvent": ( + "stripe.events._v1_product_deleted_event", False, ), - "V1BillingMeterNoMeterFoundEventNotification": ( - "stripe.events._v1_billing_meter_no_meter_found_event", + "V1ProductDeletedEventNotification": ( + "stripe.events._v1_product_deleted_event", + False, + ), + "V1ProductUpdatedEvent": ( + "stripe.events._v1_product_updated_event", + False, + ), + "V1ProductUpdatedEventNotification": ( + "stripe.events._v1_product_updated_event", + False, + ), + "V1PromotionCodeCreatedEvent": ( + "stripe.events._v1_promotion_code_created_event", + False, + ), + "V1PromotionCodeCreatedEventNotification": ( + "stripe.events._v1_promotion_code_created_event", + False, + ), + "V1PromotionCodeUpdatedEvent": ( + "stripe.events._v1_promotion_code_updated_event", + False, + ), + "V1PromotionCodeUpdatedEventNotification": ( + "stripe.events._v1_promotion_code_updated_event", + False, + ), + "V1QuoteAcceptedEvent": ("stripe.events._v1_quote_accepted_event", False), + "V1QuoteAcceptedEventNotification": ( + "stripe.events._v1_quote_accepted_event", + False, + ), + "V1QuoteCanceledEvent": ("stripe.events._v1_quote_canceled_event", False), + "V1QuoteCanceledEventNotification": ( + "stripe.events._v1_quote_canceled_event", + False, + ), + "V1QuoteCreatedEvent": ("stripe.events._v1_quote_created_event", False), + "V1QuoteCreatedEventNotification": ( + "stripe.events._v1_quote_created_event", + False, + ), + "V1QuoteFinalizedEvent": ( + "stripe.events._v1_quote_finalized_event", + False, + ), + "V1QuoteFinalizedEventNotification": ( + "stripe.events._v1_quote_finalized_event", + False, + ), + "V1RadarEarlyFraudWarningCreatedEvent": ( + "stripe.events._v1_radar_early_fraud_warning_created_event", + False, + ), + "V1RadarEarlyFraudWarningCreatedEventNotification": ( + "stripe.events._v1_radar_early_fraud_warning_created_event", + False, + ), + "V1RadarEarlyFraudWarningUpdatedEvent": ( + "stripe.events._v1_radar_early_fraud_warning_updated_event", + False, + ), + "V1RadarEarlyFraudWarningUpdatedEventNotification": ( + "stripe.events._v1_radar_early_fraud_warning_updated_event", + False, + ), + "V1RefundCreatedEvent": ("stripe.events._v1_refund_created_event", False), + "V1RefundCreatedEventNotification": ( + "stripe.events._v1_refund_created_event", + False, + ), + "V1RefundFailedEvent": ("stripe.events._v1_refund_failed_event", False), + "V1RefundFailedEventNotification": ( + "stripe.events._v1_refund_failed_event", + False, + ), + "V1RefundUpdatedEvent": ("stripe.events._v1_refund_updated_event", False), + "V1RefundUpdatedEventNotification": ( + "stripe.events._v1_refund_updated_event", + False, + ), + "V1ReviewClosedEvent": ("stripe.events._v1_review_closed_event", False), + "V1ReviewClosedEventNotification": ( + "stripe.events._v1_review_closed_event", + False, + ), + "V1ReviewOpenedEvent": ("stripe.events._v1_review_opened_event", False), + "V1ReviewOpenedEventNotification": ( + "stripe.events._v1_review_opened_event", + False, + ), + "V1SetupIntentCanceledEvent": ( + "stripe.events._v1_setup_intent_canceled_event", + False, + ), + "V1SetupIntentCanceledEventNotification": ( + "stripe.events._v1_setup_intent_canceled_event", + False, + ), + "V1SetupIntentCreatedEvent": ( + "stripe.events._v1_setup_intent_created_event", + False, + ), + "V1SetupIntentCreatedEventNotification": ( + "stripe.events._v1_setup_intent_created_event", + False, + ), + "V1SetupIntentRequiresActionEvent": ( + "stripe.events._v1_setup_intent_requires_action_event", + False, + ), + "V1SetupIntentRequiresActionEventNotification": ( + "stripe.events._v1_setup_intent_requires_action_event", + False, + ), + "V1SetupIntentSetupFailedEvent": ( + "stripe.events._v1_setup_intent_setup_failed_event", + False, + ), + "V1SetupIntentSetupFailedEventNotification": ( + "stripe.events._v1_setup_intent_setup_failed_event", + False, + ), + "V1SetupIntentSucceededEvent": ( + "stripe.events._v1_setup_intent_succeeded_event", + False, + ), + "V1SetupIntentSucceededEventNotification": ( + "stripe.events._v1_setup_intent_succeeded_event", + False, + ), + "V1SigmaScheduledQueryRunCreatedEvent": ( + "stripe.events._v1_sigma_scheduled_query_run_created_event", + False, + ), + "V1SigmaScheduledQueryRunCreatedEventNotification": ( + "stripe.events._v1_sigma_scheduled_query_run_created_event", + False, + ), + "V1SourceCanceledEvent": ( + "stripe.events._v1_source_canceled_event", + False, + ), + "V1SourceCanceledEventNotification": ( + "stripe.events._v1_source_canceled_event", + False, + ), + "V1SourceChargeableEvent": ( + "stripe.events._v1_source_chargeable_event", + False, + ), + "V1SourceChargeableEventNotification": ( + "stripe.events._v1_source_chargeable_event", + False, + ), + "V1SourceFailedEvent": ("stripe.events._v1_source_failed_event", False), + "V1SourceFailedEventNotification": ( + "stripe.events._v1_source_failed_event", + False, + ), + "V1SourceRefundAttributesRequiredEvent": ( + "stripe.events._v1_source_refund_attributes_required_event", + False, + ), + "V1SourceRefundAttributesRequiredEventNotification": ( + "stripe.events._v1_source_refund_attributes_required_event", + False, + ), + "V1SubscriptionScheduleAbortedEvent": ( + "stripe.events._v1_subscription_schedule_aborted_event", + False, + ), + "V1SubscriptionScheduleAbortedEventNotification": ( + "stripe.events._v1_subscription_schedule_aborted_event", + False, + ), + "V1SubscriptionScheduleCanceledEvent": ( + "stripe.events._v1_subscription_schedule_canceled_event", + False, + ), + "V1SubscriptionScheduleCanceledEventNotification": ( + "stripe.events._v1_subscription_schedule_canceled_event", + False, + ), + "V1SubscriptionScheduleCompletedEvent": ( + "stripe.events._v1_subscription_schedule_completed_event", + False, + ), + "V1SubscriptionScheduleCompletedEventNotification": ( + "stripe.events._v1_subscription_schedule_completed_event", + False, + ), + "V1SubscriptionScheduleCreatedEvent": ( + "stripe.events._v1_subscription_schedule_created_event", + False, + ), + "V1SubscriptionScheduleCreatedEventNotification": ( + "stripe.events._v1_subscription_schedule_created_event", + False, + ), + "V1SubscriptionScheduleExpiringEvent": ( + "stripe.events._v1_subscription_schedule_expiring_event", + False, + ), + "V1SubscriptionScheduleExpiringEventNotification": ( + "stripe.events._v1_subscription_schedule_expiring_event", + False, + ), + "V1SubscriptionScheduleReleasedEvent": ( + "stripe.events._v1_subscription_schedule_released_event", + False, + ), + "V1SubscriptionScheduleReleasedEventNotification": ( + "stripe.events._v1_subscription_schedule_released_event", + False, + ), + "V1SubscriptionScheduleUpdatedEvent": ( + "stripe.events._v1_subscription_schedule_updated_event", + False, + ), + "V1SubscriptionScheduleUpdatedEventNotification": ( + "stripe.events._v1_subscription_schedule_updated_event", + False, + ), + "V1TaxRateCreatedEvent": ( + "stripe.events._v1_tax_rate_created_event", + False, + ), + "V1TaxRateCreatedEventNotification": ( + "stripe.events._v1_tax_rate_created_event", + False, + ), + "V1TaxRateUpdatedEvent": ( + "stripe.events._v1_tax_rate_updated_event", + False, + ), + "V1TaxRateUpdatedEventNotification": ( + "stripe.events._v1_tax_rate_updated_event", + False, + ), + "V1TaxSettingsUpdatedEvent": ( + "stripe.events._v1_tax_settings_updated_event", + False, + ), + "V1TaxSettingsUpdatedEventNotification": ( + "stripe.events._v1_tax_settings_updated_event", + False, + ), + "V1TerminalReaderActionFailedEvent": ( + "stripe.events._v1_terminal_reader_action_failed_event", + False, + ), + "V1TerminalReaderActionFailedEventNotification": ( + "stripe.events._v1_terminal_reader_action_failed_event", + False, + ), + "V1TerminalReaderActionSucceededEvent": ( + "stripe.events._v1_terminal_reader_action_succeeded_event", + False, + ), + "V1TerminalReaderActionSucceededEventNotification": ( + "stripe.events._v1_terminal_reader_action_succeeded_event", + False, + ), + "V1TerminalReaderActionUpdatedEvent": ( + "stripe.events._v1_terminal_reader_action_updated_event", + False, + ), + "V1TerminalReaderActionUpdatedEventNotification": ( + "stripe.events._v1_terminal_reader_action_updated_event", + False, + ), + "V1TestHelpersTestClockAdvancingEvent": ( + "stripe.events._v1_test_helpers_test_clock_advancing_event", + False, + ), + "V1TestHelpersTestClockAdvancingEventNotification": ( + "stripe.events._v1_test_helpers_test_clock_advancing_event", + False, + ), + "V1TestHelpersTestClockCreatedEvent": ( + "stripe.events._v1_test_helpers_test_clock_created_event", + False, + ), + "V1TestHelpersTestClockCreatedEventNotification": ( + "stripe.events._v1_test_helpers_test_clock_created_event", + False, + ), + "V1TestHelpersTestClockDeletedEvent": ( + "stripe.events._v1_test_helpers_test_clock_deleted_event", + False, + ), + "V1TestHelpersTestClockDeletedEventNotification": ( + "stripe.events._v1_test_helpers_test_clock_deleted_event", + False, + ), + "V1TestHelpersTestClockInternalFailureEvent": ( + "stripe.events._v1_test_helpers_test_clock_internal_failure_event", + False, + ), + "V1TestHelpersTestClockInternalFailureEventNotification": ( + "stripe.events._v1_test_helpers_test_clock_internal_failure_event", + False, + ), + "V1TestHelpersTestClockReadyEvent": ( + "stripe.events._v1_test_helpers_test_clock_ready_event", + False, + ), + "V1TestHelpersTestClockReadyEventNotification": ( + "stripe.events._v1_test_helpers_test_clock_ready_event", + False, + ), + "V1TopupCanceledEvent": ("stripe.events._v1_topup_canceled_event", False), + "V1TopupCanceledEventNotification": ( + "stripe.events._v1_topup_canceled_event", + False, + ), + "V1TopupCreatedEvent": ("stripe.events._v1_topup_created_event", False), + "V1TopupCreatedEventNotification": ( + "stripe.events._v1_topup_created_event", + False, + ), + "V1TopupFailedEvent": ("stripe.events._v1_topup_failed_event", False), + "V1TopupFailedEventNotification": ( + "stripe.events._v1_topup_failed_event", + False, + ), + "V1TopupReversedEvent": ("stripe.events._v1_topup_reversed_event", False), + "V1TopupReversedEventNotification": ( + "stripe.events._v1_topup_reversed_event", + False, + ), + "V1TopupSucceededEvent": ( + "stripe.events._v1_topup_succeeded_event", + False, + ), + "V1TopupSucceededEventNotification": ( + "stripe.events._v1_topup_succeeded_event", + False, + ), + "V1TransferCreatedEvent": ( + "stripe.events._v1_transfer_created_event", + False, + ), + "V1TransferCreatedEventNotification": ( + "stripe.events._v1_transfer_created_event", + False, + ), + "V1TransferReversedEvent": ( + "stripe.events._v1_transfer_reversed_event", + False, + ), + "V1TransferReversedEventNotification": ( + "stripe.events._v1_transfer_reversed_event", + False, + ), + "V1TransferUpdatedEvent": ( + "stripe.events._v1_transfer_updated_event", + False, + ), + "V1TransferUpdatedEventNotification": ( + "stripe.events._v1_transfer_updated_event", False, ), "V2BillingCadenceBilledEvent": ( @@ -1065,6 +3414,38 @@ "stripe.events._v2_billing_rate_card_version_created_event", False, ), + "V2CommerceProductCatalogImportsFailedEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + False, + ), + "V2CommerceProductCatalogImportsFailedEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + False, + ), + "V2CommerceProductCatalogImportsProcessingEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + False, + ), + "V2CommerceProductCatalogImportsProcessingEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + False, + ), "V2CoreAccountClosedEvent": ( "stripe.events._v2_core_account_closed_event", False, @@ -1241,6 +3622,46 @@ "stripe.events._v2_core_account_updated_event", False, ), + "V2CoreApprovalRequestApprovedEvent": ( + "stripe.events._v2_core_approval_request_approved_event", + False, + ), + "V2CoreApprovalRequestApprovedEventNotification": ( + "stripe.events._v2_core_approval_request_approved_event", + False, + ), + "V2CoreApprovalRequestCanceledEvent": ( + "stripe.events._v2_core_approval_request_canceled_event", + False, + ), + "V2CoreApprovalRequestCanceledEventNotification": ( + "stripe.events._v2_core_approval_request_canceled_event", + False, + ), + "V2CoreApprovalRequestFailedEvent": ( + "stripe.events._v2_core_approval_request_failed_event", + False, + ), + "V2CoreApprovalRequestFailedEventNotification": ( + "stripe.events._v2_core_approval_request_failed_event", + False, + ), + "V2CoreApprovalRequestRejectedEvent": ( + "stripe.events._v2_core_approval_request_rejected_event", + False, + ), + "V2CoreApprovalRequestRejectedEventNotification": ( + "stripe.events._v2_core_approval_request_rejected_event", + False, + ), + "V2CoreApprovalRequestSucceededEvent": ( + "stripe.events._v2_core_approval_request_succeeded_event", + False, + ), + "V2CoreApprovalRequestSucceededEventNotification": ( + "stripe.events._v2_core_approval_request_succeeded_event", + False, + ), "V2CoreBatchJobBatchFailedEvent": ( "stripe.events._v2_core_batch_job_batch_failed_event", False, @@ -1353,12 +3774,12 @@ "stripe.events._v2_core_claimable_sandbox_expiring_event", False, ), - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent": ( - "stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event", + "V2CoreClaimableSandboxUpdatedEvent": ( + "stripe.events._v2_core_claimable_sandbox_updated_event", False, ), - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification": ( - "stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event", + "V2CoreClaimableSandboxUpdatedEventNotification": ( + "stripe.events._v2_core_claimable_sandbox_updated_event", False, ), "V2CoreEventDestinationPingEvent": ( @@ -1465,6 +3886,22 @@ "stripe.events._v2_core_health_issuing_authorization_request_timeout_resolved_event", False, ), + "V2CoreHealthMeterEventSummariesDelayedFiringEvent": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event", + False, + ), + "V2CoreHealthMeterEventSummariesDelayedFiringEventNotification": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event", + False, + ), + "V2CoreHealthMeterEventSummariesDelayedResolvedEvent": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event", + False, + ), + "V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event", + False, + ), "V2CoreHealthPaymentMethodErrorFiringEvent": ( "stripe.events._v2_core_health_payment_method_error_firing_event", False, @@ -1561,6 +3998,30 @@ "stripe.events._v2_data_reporting_query_run_updated_event", False, ), + "V2ExtendWorkflowRunFailedEvent": ( + "stripe.events._v2_extend_workflow_run_failed_event", + False, + ), + "V2ExtendWorkflowRunFailedEventNotification": ( + "stripe.events._v2_extend_workflow_run_failed_event", + False, + ), + "V2ExtendWorkflowRunStartedEvent": ( + "stripe.events._v2_extend_workflow_run_started_event", + False, + ), + "V2ExtendWorkflowRunStartedEventNotification": ( + "stripe.events._v2_extend_workflow_run_started_event", + False, + ), + "V2ExtendWorkflowRunSucceededEvent": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + False, + ), + "V2ExtendWorkflowRunSucceededEventNotification": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + False, + ), "V2IamApiKeyCreatedEvent": ( "stripe.events._v2_iam_api_key_created_event", False, @@ -1961,6 +4422,38 @@ "stripe.events._v2_money_management_transaction_updated_event", False, ), + "V2OrchestratedCommerceAgreementConfirmedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementConfirmedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementCreatedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + False, + ), + "V2OrchestratedCommerceAgreementCreatedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + False, + ), + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementTerminatedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + False, + ), + "V2OrchestratedCommerceAgreementTerminatedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + False, + ), "V2PaymentsOffSessionPaymentAttemptFailedEvent": ( "stripe.events._v2_payments_off_session_payment_attempt_failed_event", False, diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 6fa97c6b8..4cfbd35c3 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -7,15 +7,612 @@ from stripe._stripe_object import StripeObject if TYPE_CHECKING: + from stripe.events._v1_account_application_authorized_event import ( + V1AccountApplicationAuthorizedEventNotification, + ) + from stripe.events._v1_account_application_deauthorized_event import ( + V1AccountApplicationDeauthorizedEventNotification, + ) + from stripe.events._v1_account_external_account_created_event import ( + V1AccountExternalAccountCreatedEventNotification, + ) + from stripe.events._v1_account_external_account_deleted_event import ( + V1AccountExternalAccountDeletedEventNotification, + ) + from stripe.events._v1_account_external_account_updated_event import ( + V1AccountExternalAccountUpdatedEventNotification, + ) from stripe.events._v1_account_signals_including_delinquency_created_event import ( V1AccountSignalsIncludingDelinquencyCreatedEventNotification, ) + from stripe.events._v1_account_updated_event import ( + V1AccountUpdatedEventNotification, + ) + from stripe.events._v1_application_fee_created_event import ( + V1ApplicationFeeCreatedEventNotification, + ) + from stripe.events._v1_application_fee_refunded_event import ( + V1ApplicationFeeRefundedEventNotification, + ) + from stripe.events._v1_application_fee_refund_updated_event import ( + V1ApplicationFeeRefundUpdatedEventNotification, + ) + from stripe.events._v1_balance_available_event import ( + V1BalanceAvailableEventNotification, + ) + from stripe.events._v1_billing_alert_triggered_event import ( + V1BillingAlertTriggeredEventNotification, + ) from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEventNotification, ) from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v1_billing_portal_configuration_created_event import ( + V1BillingPortalConfigurationCreatedEventNotification, + ) + from stripe.events._v1_billing_portal_configuration_updated_event import ( + V1BillingPortalConfigurationUpdatedEventNotification, + ) + from stripe.events._v1_billing_portal_session_created_event import ( + V1BillingPortalSessionCreatedEventNotification, + ) + from stripe.events._v1_capability_updated_event import ( + V1CapabilityUpdatedEventNotification, + ) + from stripe.events._v1_cash_balance_funds_available_event import ( + V1CashBalanceFundsAvailableEventNotification, + ) + from stripe.events._v1_charge_captured_event import ( + V1ChargeCapturedEventNotification, + ) + from stripe.events._v1_charge_dispute_closed_event import ( + V1ChargeDisputeClosedEventNotification, + ) + from stripe.events._v1_charge_dispute_created_event import ( + V1ChargeDisputeCreatedEventNotification, + ) + from stripe.events._v1_charge_dispute_funds_reinstated_event import ( + V1ChargeDisputeFundsReinstatedEventNotification, + ) + from stripe.events._v1_charge_dispute_funds_withdrawn_event import ( + V1ChargeDisputeFundsWithdrawnEventNotification, + ) + from stripe.events._v1_charge_dispute_updated_event import ( + V1ChargeDisputeUpdatedEventNotification, + ) + from stripe.events._v1_charge_expired_event import ( + V1ChargeExpiredEventNotification, + ) + from stripe.events._v1_charge_failed_event import ( + V1ChargeFailedEventNotification, + ) + from stripe.events._v1_charge_pending_event import ( + V1ChargePendingEventNotification, + ) + from stripe.events._v1_charge_refunded_event import ( + V1ChargeRefundedEventNotification, + ) + from stripe.events._v1_charge_refund_updated_event import ( + V1ChargeRefundUpdatedEventNotification, + ) + from stripe.events._v1_charge_succeeded_event import ( + V1ChargeSucceededEventNotification, + ) + from stripe.events._v1_charge_updated_event import ( + V1ChargeUpdatedEventNotification, + ) + from stripe.events._v1_checkout_session_async_payment_failed_event import ( + V1CheckoutSessionAsyncPaymentFailedEventNotification, + ) + from stripe.events._v1_checkout_session_async_payment_succeeded_event import ( + V1CheckoutSessionAsyncPaymentSucceededEventNotification, + ) + from stripe.events._v1_checkout_session_completed_event import ( + V1CheckoutSessionCompletedEventNotification, + ) + from stripe.events._v1_checkout_session_expired_event import ( + V1CheckoutSessionExpiredEventNotification, + ) + from stripe.events._v1_climate_order_canceled_event import ( + V1ClimateOrderCanceledEventNotification, + ) + from stripe.events._v1_climate_order_created_event import ( + V1ClimateOrderCreatedEventNotification, + ) + from stripe.events._v1_climate_order_delayed_event import ( + V1ClimateOrderDelayedEventNotification, + ) + from stripe.events._v1_climate_order_delivered_event import ( + V1ClimateOrderDeliveredEventNotification, + ) + from stripe.events._v1_climate_order_product_substituted_event import ( + V1ClimateOrderProductSubstitutedEventNotification, + ) + from stripe.events._v1_climate_product_created_event import ( + V1ClimateProductCreatedEventNotification, + ) + from stripe.events._v1_climate_product_pricing_updated_event import ( + V1ClimateProductPricingUpdatedEventNotification, + ) + from stripe.events._v1_coupon_created_event import ( + V1CouponCreatedEventNotification, + ) + from stripe.events._v1_coupon_deleted_event import ( + V1CouponDeletedEventNotification, + ) + from stripe.events._v1_coupon_updated_event import ( + V1CouponUpdatedEventNotification, + ) + from stripe.events._v1_credit_note_created_event import ( + V1CreditNoteCreatedEventNotification, + ) + from stripe.events._v1_credit_note_updated_event import ( + V1CreditNoteUpdatedEventNotification, + ) + from stripe.events._v1_credit_note_voided_event import ( + V1CreditNoteVoidedEventNotification, + ) + from stripe.events._v1_customer_cash_balance_transaction_created_event import ( + V1CustomerCashBalanceTransactionCreatedEventNotification, + ) + from stripe.events._v1_customer_created_event import ( + V1CustomerCreatedEventNotification, + ) + from stripe.events._v1_customer_deleted_event import ( + V1CustomerDeletedEventNotification, + ) + from stripe.events._v1_customer_subscription_created_event import ( + V1CustomerSubscriptionCreatedEventNotification, + ) + from stripe.events._v1_customer_subscription_deleted_event import ( + V1CustomerSubscriptionDeletedEventNotification, + ) + from stripe.events._v1_customer_subscription_paused_event import ( + V1CustomerSubscriptionPausedEventNotification, + ) + from stripe.events._v1_customer_subscription_pending_update_applied_event import ( + V1CustomerSubscriptionPendingUpdateAppliedEventNotification, + ) + from stripe.events._v1_customer_subscription_pending_update_expired_event import ( + V1CustomerSubscriptionPendingUpdateExpiredEventNotification, + ) + from stripe.events._v1_customer_subscription_resumed_event import ( + V1CustomerSubscriptionResumedEventNotification, + ) + from stripe.events._v1_customer_subscription_trial_will_end_event import ( + V1CustomerSubscriptionTrialWillEndEventNotification, + ) + from stripe.events._v1_customer_subscription_updated_event import ( + V1CustomerSubscriptionUpdatedEventNotification, + ) + from stripe.events._v1_customer_tax_id_created_event import ( + V1CustomerTaxIdCreatedEventNotification, + ) + from stripe.events._v1_customer_tax_id_deleted_event import ( + V1CustomerTaxIdDeletedEventNotification, + ) + from stripe.events._v1_customer_tax_id_updated_event import ( + V1CustomerTaxIdUpdatedEventNotification, + ) + from stripe.events._v1_customer_updated_event import ( + V1CustomerUpdatedEventNotification, + ) + from stripe.events._v1_entitlements_active_entitlement_summary_updated_event import ( + V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification, + ) + from stripe.events._v1_file_created_event import ( + V1FileCreatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_created_event import ( + V1FinancialConnectionsAccountCreatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_deactivated_event import ( + V1FinancialConnectionsAccountDeactivatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_disconnected_event import ( + V1FinancialConnectionsAccountDisconnectedEventNotification, + ) + from stripe.events._v1_financial_connections_account_reactivated_event import ( + V1FinancialConnectionsAccountReactivatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_balance_event import ( + V1FinancialConnectionsAccountRefreshedBalanceEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_ownership_event import ( + V1FinancialConnectionsAccountRefreshedOwnershipEventNotification, + ) + from stripe.events._v1_financial_connections_account_refreshed_transactions_event import ( + V1FinancialConnectionsAccountRefreshedTransactionsEventNotification, + ) + from stripe.events._v1_identity_verification_session_canceled_event import ( + V1IdentityVerificationSessionCanceledEventNotification, + ) + from stripe.events._v1_identity_verification_session_created_event import ( + V1IdentityVerificationSessionCreatedEventNotification, + ) + from stripe.events._v1_identity_verification_session_processing_event import ( + V1IdentityVerificationSessionProcessingEventNotification, + ) + from stripe.events._v1_identity_verification_session_redacted_event import ( + V1IdentityVerificationSessionRedactedEventNotification, + ) + from stripe.events._v1_identity_verification_session_requires_input_event import ( + V1IdentityVerificationSessionRequiresInputEventNotification, + ) + from stripe.events._v1_identity_verification_session_verified_event import ( + V1IdentityVerificationSessionVerifiedEventNotification, + ) + from stripe.events._v1_invoice_created_event import ( + V1InvoiceCreatedEventNotification, + ) + from stripe.events._v1_invoice_deleted_event import ( + V1InvoiceDeletedEventNotification, + ) + from stripe.events._v1_invoice_finalization_failed_event import ( + V1InvoiceFinalizationFailedEventNotification, + ) + from stripe.events._v1_invoice_finalized_event import ( + V1InvoiceFinalizedEventNotification, + ) + from stripe.events._v1_invoiceitem_created_event import ( + V1InvoiceitemCreatedEventNotification, + ) + from stripe.events._v1_invoiceitem_deleted_event import ( + V1InvoiceitemDeletedEventNotification, + ) + from stripe.events._v1_invoice_marked_uncollectible_event import ( + V1InvoiceMarkedUncollectibleEventNotification, + ) + from stripe.events._v1_invoice_overdue_event import ( + V1InvoiceOverdueEventNotification, + ) + from stripe.events._v1_invoice_overpaid_event import ( + V1InvoiceOverpaidEventNotification, + ) + from stripe.events._v1_invoice_paid_event import ( + V1InvoicePaidEventNotification, + ) + from stripe.events._v1_invoice_payment_action_required_event import ( + V1InvoicePaymentActionRequiredEventNotification, + ) + from stripe.events._v1_invoice_payment_failed_event import ( + V1InvoicePaymentFailedEventNotification, + ) + from stripe.events._v1_invoice_payment_paid_event import ( + V1InvoicePaymentPaidEventNotification, + ) + from stripe.events._v1_invoice_payment_succeeded_event import ( + V1InvoicePaymentSucceededEventNotification, + ) + from stripe.events._v1_invoice_sent_event import ( + V1InvoiceSentEventNotification, + ) + from stripe.events._v1_invoice_upcoming_event import ( + V1InvoiceUpcomingEventNotification, + ) + from stripe.events._v1_invoice_updated_event import ( + V1InvoiceUpdatedEventNotification, + ) + from stripe.events._v1_invoice_voided_event import ( + V1InvoiceVoidedEventNotification, + ) + from stripe.events._v1_invoice_will_be_due_event import ( + V1InvoiceWillBeDueEventNotification, + ) + from stripe.events._v1_issuing_authorization_created_event import ( + V1IssuingAuthorizationCreatedEventNotification, + ) + from stripe.events._v1_issuing_authorization_request_event import ( + V1IssuingAuthorizationRequestEventNotification, + ) + from stripe.events._v1_issuing_authorization_updated_event import ( + V1IssuingAuthorizationUpdatedEventNotification, + ) + from stripe.events._v1_issuing_card_created_event import ( + V1IssuingCardCreatedEventNotification, + ) + from stripe.events._v1_issuing_cardholder_created_event import ( + V1IssuingCardholderCreatedEventNotification, + ) + from stripe.events._v1_issuing_cardholder_updated_event import ( + V1IssuingCardholderUpdatedEventNotification, + ) + from stripe.events._v1_issuing_card_updated_event import ( + V1IssuingCardUpdatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_closed_event import ( + V1IssuingDisputeClosedEventNotification, + ) + from stripe.events._v1_issuing_dispute_created_event import ( + V1IssuingDisputeCreatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_funds_reinstated_event import ( + V1IssuingDisputeFundsReinstatedEventNotification, + ) + from stripe.events._v1_issuing_dispute_funds_rescinded_event import ( + V1IssuingDisputeFundsRescindedEventNotification, + ) + from stripe.events._v1_issuing_dispute_submitted_event import ( + V1IssuingDisputeSubmittedEventNotification, + ) + from stripe.events._v1_issuing_dispute_updated_event import ( + V1IssuingDisputeUpdatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_activated_event import ( + V1IssuingPersonalizationDesignActivatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_deactivated_event import ( + V1IssuingPersonalizationDesignDeactivatedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_rejected_event import ( + V1IssuingPersonalizationDesignRejectedEventNotification, + ) + from stripe.events._v1_issuing_personalization_design_updated_event import ( + V1IssuingPersonalizationDesignUpdatedEventNotification, + ) + from stripe.events._v1_issuing_token_created_event import ( + V1IssuingTokenCreatedEventNotification, + ) + from stripe.events._v1_issuing_token_updated_event import ( + V1IssuingTokenUpdatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_created_event import ( + V1IssuingTransactionCreatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event import ( + V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification, + ) + from stripe.events._v1_issuing_transaction_updated_event import ( + V1IssuingTransactionUpdatedEventNotification, + ) + from stripe.events._v1_mandate_updated_event import ( + V1MandateUpdatedEventNotification, + ) + from stripe.events._v1_payment_intent_amount_capturable_updated_event import ( + V1PaymentIntentAmountCapturableUpdatedEventNotification, + ) + from stripe.events._v1_payment_intent_canceled_event import ( + V1PaymentIntentCanceledEventNotification, + ) + from stripe.events._v1_payment_intent_created_event import ( + V1PaymentIntentCreatedEventNotification, + ) + from stripe.events._v1_payment_intent_partially_funded_event import ( + V1PaymentIntentPartiallyFundedEventNotification, + ) + from stripe.events._v1_payment_intent_payment_failed_event import ( + V1PaymentIntentPaymentFailedEventNotification, + ) + from stripe.events._v1_payment_intent_processing_event import ( + V1PaymentIntentProcessingEventNotification, + ) + from stripe.events._v1_payment_intent_requires_action_event import ( + V1PaymentIntentRequiresActionEventNotification, + ) + from stripe.events._v1_payment_intent_succeeded_event import ( + V1PaymentIntentSucceededEventNotification, + ) + from stripe.events._v1_payment_link_created_event import ( + V1PaymentLinkCreatedEventNotification, + ) + from stripe.events._v1_payment_link_updated_event import ( + V1PaymentLinkUpdatedEventNotification, + ) + from stripe.events._v1_payment_method_attached_event import ( + V1PaymentMethodAttachedEventNotification, + ) + from stripe.events._v1_payment_method_automatically_updated_event import ( + V1PaymentMethodAutomaticallyUpdatedEventNotification, + ) + from stripe.events._v1_payment_method_detached_event import ( + V1PaymentMethodDetachedEventNotification, + ) + from stripe.events._v1_payment_method_updated_event import ( + V1PaymentMethodUpdatedEventNotification, + ) + from stripe.events._v1_payout_canceled_event import ( + V1PayoutCanceledEventNotification, + ) + from stripe.events._v1_payout_created_event import ( + V1PayoutCreatedEventNotification, + ) + from stripe.events._v1_payout_failed_event import ( + V1PayoutFailedEventNotification, + ) + from stripe.events._v1_payout_paid_event import ( + V1PayoutPaidEventNotification, + ) + from stripe.events._v1_payout_reconciliation_completed_event import ( + V1PayoutReconciliationCompletedEventNotification, + ) + from stripe.events._v1_payout_updated_event import ( + V1PayoutUpdatedEventNotification, + ) + from stripe.events._v1_person_created_event import ( + V1PersonCreatedEventNotification, + ) + from stripe.events._v1_person_deleted_event import ( + V1PersonDeletedEventNotification, + ) + from stripe.events._v1_person_updated_event import ( + V1PersonUpdatedEventNotification, + ) + from stripe.events._v1_plan_created_event import ( + V1PlanCreatedEventNotification, + ) + from stripe.events._v1_plan_deleted_event import ( + V1PlanDeletedEventNotification, + ) + from stripe.events._v1_plan_updated_event import ( + V1PlanUpdatedEventNotification, + ) + from stripe.events._v1_price_created_event import ( + V1PriceCreatedEventNotification, + ) + from stripe.events._v1_price_deleted_event import ( + V1PriceDeletedEventNotification, + ) + from stripe.events._v1_price_updated_event import ( + V1PriceUpdatedEventNotification, + ) + from stripe.events._v1_product_created_event import ( + V1ProductCreatedEventNotification, + ) + from stripe.events._v1_product_deleted_event import ( + V1ProductDeletedEventNotification, + ) + from stripe.events._v1_product_updated_event import ( + V1ProductUpdatedEventNotification, + ) + from stripe.events._v1_promotion_code_created_event import ( + V1PromotionCodeCreatedEventNotification, + ) + from stripe.events._v1_promotion_code_updated_event import ( + V1PromotionCodeUpdatedEventNotification, + ) + from stripe.events._v1_quote_accepted_event import ( + V1QuoteAcceptedEventNotification, + ) + from stripe.events._v1_quote_canceled_event import ( + V1QuoteCanceledEventNotification, + ) + from stripe.events._v1_quote_created_event import ( + V1QuoteCreatedEventNotification, + ) + from stripe.events._v1_quote_finalized_event import ( + V1QuoteFinalizedEventNotification, + ) + from stripe.events._v1_radar_early_fraud_warning_created_event import ( + V1RadarEarlyFraudWarningCreatedEventNotification, + ) + from stripe.events._v1_radar_early_fraud_warning_updated_event import ( + V1RadarEarlyFraudWarningUpdatedEventNotification, + ) + from stripe.events._v1_refund_created_event import ( + V1RefundCreatedEventNotification, + ) + from stripe.events._v1_refund_failed_event import ( + V1RefundFailedEventNotification, + ) + from stripe.events._v1_refund_updated_event import ( + V1RefundUpdatedEventNotification, + ) + from stripe.events._v1_review_closed_event import ( + V1ReviewClosedEventNotification, + ) + from stripe.events._v1_review_opened_event import ( + V1ReviewOpenedEventNotification, + ) + from stripe.events._v1_setup_intent_canceled_event import ( + V1SetupIntentCanceledEventNotification, + ) + from stripe.events._v1_setup_intent_created_event import ( + V1SetupIntentCreatedEventNotification, + ) + from stripe.events._v1_setup_intent_requires_action_event import ( + V1SetupIntentRequiresActionEventNotification, + ) + from stripe.events._v1_setup_intent_setup_failed_event import ( + V1SetupIntentSetupFailedEventNotification, + ) + from stripe.events._v1_setup_intent_succeeded_event import ( + V1SetupIntentSucceededEventNotification, + ) + from stripe.events._v1_sigma_scheduled_query_run_created_event import ( + V1SigmaScheduledQueryRunCreatedEventNotification, + ) + from stripe.events._v1_source_canceled_event import ( + V1SourceCanceledEventNotification, + ) + from stripe.events._v1_source_chargeable_event import ( + V1SourceChargeableEventNotification, + ) + from stripe.events._v1_source_failed_event import ( + V1SourceFailedEventNotification, + ) + from stripe.events._v1_source_refund_attributes_required_event import ( + V1SourceRefundAttributesRequiredEventNotification, + ) + from stripe.events._v1_subscription_schedule_aborted_event import ( + V1SubscriptionScheduleAbortedEventNotification, + ) + from stripe.events._v1_subscription_schedule_canceled_event import ( + V1SubscriptionScheduleCanceledEventNotification, + ) + from stripe.events._v1_subscription_schedule_completed_event import ( + V1SubscriptionScheduleCompletedEventNotification, + ) + from stripe.events._v1_subscription_schedule_created_event import ( + V1SubscriptionScheduleCreatedEventNotification, + ) + from stripe.events._v1_subscription_schedule_expiring_event import ( + V1SubscriptionScheduleExpiringEventNotification, + ) + from stripe.events._v1_subscription_schedule_released_event import ( + V1SubscriptionScheduleReleasedEventNotification, + ) + from stripe.events._v1_subscription_schedule_updated_event import ( + V1SubscriptionScheduleUpdatedEventNotification, + ) + from stripe.events._v1_tax_rate_created_event import ( + V1TaxRateCreatedEventNotification, + ) + from stripe.events._v1_tax_rate_updated_event import ( + V1TaxRateUpdatedEventNotification, + ) + from stripe.events._v1_tax_settings_updated_event import ( + V1TaxSettingsUpdatedEventNotification, + ) + from stripe.events._v1_terminal_reader_action_failed_event import ( + V1TerminalReaderActionFailedEventNotification, + ) + from stripe.events._v1_terminal_reader_action_succeeded_event import ( + V1TerminalReaderActionSucceededEventNotification, + ) + from stripe.events._v1_terminal_reader_action_updated_event import ( + V1TerminalReaderActionUpdatedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_advancing_event import ( + V1TestHelpersTestClockAdvancingEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_created_event import ( + V1TestHelpersTestClockCreatedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_deleted_event import ( + V1TestHelpersTestClockDeletedEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_internal_failure_event import ( + V1TestHelpersTestClockInternalFailureEventNotification, + ) + from stripe.events._v1_test_helpers_test_clock_ready_event import ( + V1TestHelpersTestClockReadyEventNotification, + ) + from stripe.events._v1_topup_canceled_event import ( + V1TopupCanceledEventNotification, + ) + from stripe.events._v1_topup_created_event import ( + V1TopupCreatedEventNotification, + ) + from stripe.events._v1_topup_failed_event import ( + V1TopupFailedEventNotification, + ) + from stripe.events._v1_topup_reversed_event import ( + V1TopupReversedEventNotification, + ) + from stripe.events._v1_topup_succeeded_event import ( + V1TopupSucceededEventNotification, + ) + from stripe.events._v1_transfer_created_event import ( + V1TransferCreatedEventNotification, + ) + from stripe.events._v1_transfer_reversed_event import ( + V1TransferReversedEventNotification, + ) + from stripe.events._v1_transfer_updated_event import ( + V1TransferUpdatedEventNotification, + ) from stripe.events._v2_billing_cadence_billed_event import ( V2BillingCadenceBilledEventNotification, ) @@ -130,6 +727,18 @@ from stripe.events._v2_billing_rate_card_version_created_event import ( V2BillingRateCardVersionCreatedEventNotification, ) + from stripe.events._v2_commerce_product_catalog_imports_failed_event import ( + V2CommerceProductCatalogImportsFailedEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_processing_event import ( + V2CommerceProductCatalogImportsProcessingEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_event import ( + V2CommerceProductCatalogImportsSucceededEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event import ( + V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, + ) from stripe.events._v2_core_account_closed_event import ( V2CoreAccountClosedEventNotification, ) @@ -196,6 +805,21 @@ from stripe.events._v2_core_account_updated_event import ( V2CoreAccountUpdatedEventNotification, ) + from stripe.events._v2_core_approval_request_approved_event import ( + V2CoreApprovalRequestApprovedEventNotification, + ) + from stripe.events._v2_core_approval_request_canceled_event import ( + V2CoreApprovalRequestCanceledEventNotification, + ) + from stripe.events._v2_core_approval_request_failed_event import ( + V2CoreApprovalRequestFailedEventNotification, + ) + from stripe.events._v2_core_approval_request_rejected_event import ( + V2CoreApprovalRequestRejectedEventNotification, + ) + from stripe.events._v2_core_approval_request_succeeded_event import ( + V2CoreApprovalRequestSucceededEventNotification, + ) from stripe.events._v2_core_batch_job_batch_failed_event import ( V2CoreBatchJobBatchFailedEventNotification, ) @@ -238,8 +862,8 @@ from stripe.events._v2_core_claimable_sandbox_expiring_event import ( V2CoreClaimableSandboxExpiringEventNotification, ) - from stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event import ( - V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification, + from stripe.events._v2_core_claimable_sandbox_updated_event import ( + V2CoreClaimableSandboxUpdatedEventNotification, ) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEventNotification, @@ -280,6 +904,12 @@ from stripe.events._v2_core_health_issuing_authorization_request_timeout_resolved_event import ( V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification, ) + from stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event import ( + V2CoreHealthMeterEventSummariesDelayedFiringEventNotification, + ) + from stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event import ( + V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification, + ) from stripe.events._v2_core_health_payment_method_error_firing_event import ( V2CoreHealthPaymentMethodErrorFiringEventNotification, ) @@ -316,6 +946,15 @@ from stripe.events._v2_data_reporting_query_run_updated_event import ( V2DataReportingQueryRunUpdatedEventNotification, ) + from stripe.events._v2_extend_workflow_run_failed_event import ( + V2ExtendWorkflowRunFailedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_started_event import ( + V2ExtendWorkflowRunStartedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_succeeded_event import ( + V2ExtendWorkflowRunSucceededEventNotification, + ) from stripe.events._v2_iam_api_key_created_event import ( V2IamApiKeyCreatedEventNotification, ) @@ -466,6 +1105,18 @@ from stripe.events._v2_money_management_transaction_updated_event import ( V2MoneyManagementTransactionUpdatedEventNotification, ) + from stripe.events._v2_orchestrated_commerce_agreement_confirmed_event import ( + V2OrchestratedCommerceAgreementConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_created_event import ( + V2OrchestratedCommerceAgreementCreatedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event import ( + V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_terminated_event import ( + V2OrchestratedCommerceAgreementTerminatedEventNotification, + ) from stripe.events._v2_payments_off_session_payment_attempt_failed_event import ( V2PaymentsOffSessionPaymentAttemptFailedEventNotification, ) @@ -550,17 +1201,813 @@ _V2_EVENT_CLASS_LOOKUP = { + "v1.account.application.authorized": ( + "stripe.events._v1_account_application_authorized_event", + "V1AccountApplicationAuthorizedEvent", + ), + "v1.account.application.deauthorized": ( + "stripe.events._v1_account_application_deauthorized_event", + "V1AccountApplicationDeauthorizedEvent", + ), + "v1.account.external_account.created": ( + "stripe.events._v1_account_external_account_created_event", + "V1AccountExternalAccountCreatedEvent", + ), + "v1.account.external_account.deleted": ( + "stripe.events._v1_account_external_account_deleted_event", + "V1AccountExternalAccountDeletedEvent", + ), + "v1.account.external_account.updated": ( + "stripe.events._v1_account_external_account_updated_event", + "V1AccountExternalAccountUpdatedEvent", + ), "v1.account_signals[delinquency].created": ( "stripe.events._v1_account_signals_including_delinquency_created_event", "V1AccountSignalsIncludingDelinquencyCreatedEvent", ), - "v1.billing.meter.error_report_triggered": ( - "stripe.events._v1_billing_meter_error_report_triggered_event", - "V1BillingMeterErrorReportTriggeredEvent", + "v1.account.updated": ( + "stripe.events._v1_account_updated_event", + "V1AccountUpdatedEvent", + ), + "v1.application_fee.created": ( + "stripe.events._v1_application_fee_created_event", + "V1ApplicationFeeCreatedEvent", + ), + "v1.application_fee.refunded": ( + "stripe.events._v1_application_fee_refunded_event", + "V1ApplicationFeeRefundedEvent", + ), + "v1.application_fee.refund.updated": ( + "stripe.events._v1_application_fee_refund_updated_event", + "V1ApplicationFeeRefundUpdatedEvent", + ), + "v1.balance.available": ( + "stripe.events._v1_balance_available_event", + "V1BalanceAvailableEvent", + ), + "v1.billing.alert.triggered": ( + "stripe.events._v1_billing_alert_triggered_event", + "V1BillingAlertTriggeredEvent", + ), + "v1.billing.meter.error_report_triggered": ( + "stripe.events._v1_billing_meter_error_report_triggered_event", + "V1BillingMeterErrorReportTriggeredEvent", + ), + "v1.billing.meter.no_meter_found": ( + "stripe.events._v1_billing_meter_no_meter_found_event", + "V1BillingMeterNoMeterFoundEvent", + ), + "v1.billing_portal.configuration.created": ( + "stripe.events._v1_billing_portal_configuration_created_event", + "V1BillingPortalConfigurationCreatedEvent", + ), + "v1.billing_portal.configuration.updated": ( + "stripe.events._v1_billing_portal_configuration_updated_event", + "V1BillingPortalConfigurationUpdatedEvent", + ), + "v1.billing_portal.session.created": ( + "stripe.events._v1_billing_portal_session_created_event", + "V1BillingPortalSessionCreatedEvent", + ), + "v1.capability.updated": ( + "stripe.events._v1_capability_updated_event", + "V1CapabilityUpdatedEvent", + ), + "v1.cash_balance.funds_available": ( + "stripe.events._v1_cash_balance_funds_available_event", + "V1CashBalanceFundsAvailableEvent", + ), + "v1.charge.captured": ( + "stripe.events._v1_charge_captured_event", + "V1ChargeCapturedEvent", + ), + "v1.charge.dispute.closed": ( + "stripe.events._v1_charge_dispute_closed_event", + "V1ChargeDisputeClosedEvent", + ), + "v1.charge.dispute.created": ( + "stripe.events._v1_charge_dispute_created_event", + "V1ChargeDisputeCreatedEvent", + ), + "v1.charge.dispute.funds_reinstated": ( + "stripe.events._v1_charge_dispute_funds_reinstated_event", + "V1ChargeDisputeFundsReinstatedEvent", + ), + "v1.charge.dispute.funds_withdrawn": ( + "stripe.events._v1_charge_dispute_funds_withdrawn_event", + "V1ChargeDisputeFundsWithdrawnEvent", + ), + "v1.charge.dispute.updated": ( + "stripe.events._v1_charge_dispute_updated_event", + "V1ChargeDisputeUpdatedEvent", + ), + "v1.charge.expired": ( + "stripe.events._v1_charge_expired_event", + "V1ChargeExpiredEvent", + ), + "v1.charge.failed": ( + "stripe.events._v1_charge_failed_event", + "V1ChargeFailedEvent", + ), + "v1.charge.pending": ( + "stripe.events._v1_charge_pending_event", + "V1ChargePendingEvent", + ), + "v1.charge.refunded": ( + "stripe.events._v1_charge_refunded_event", + "V1ChargeRefundedEvent", + ), + "v1.charge.refund.updated": ( + "stripe.events._v1_charge_refund_updated_event", + "V1ChargeRefundUpdatedEvent", + ), + "v1.charge.succeeded": ( + "stripe.events._v1_charge_succeeded_event", + "V1ChargeSucceededEvent", + ), + "v1.charge.updated": ( + "stripe.events._v1_charge_updated_event", + "V1ChargeUpdatedEvent", + ), + "v1.checkout.session.async_payment_failed": ( + "stripe.events._v1_checkout_session_async_payment_failed_event", + "V1CheckoutSessionAsyncPaymentFailedEvent", + ), + "v1.checkout.session.async_payment_succeeded": ( + "stripe.events._v1_checkout_session_async_payment_succeeded_event", + "V1CheckoutSessionAsyncPaymentSucceededEvent", + ), + "v1.checkout.session.completed": ( + "stripe.events._v1_checkout_session_completed_event", + "V1CheckoutSessionCompletedEvent", + ), + "v1.checkout.session.expired": ( + "stripe.events._v1_checkout_session_expired_event", + "V1CheckoutSessionExpiredEvent", + ), + "v1.climate.order.canceled": ( + "stripe.events._v1_climate_order_canceled_event", + "V1ClimateOrderCanceledEvent", + ), + "v1.climate.order.created": ( + "stripe.events._v1_climate_order_created_event", + "V1ClimateOrderCreatedEvent", + ), + "v1.climate.order.delayed": ( + "stripe.events._v1_climate_order_delayed_event", + "V1ClimateOrderDelayedEvent", + ), + "v1.climate.order.delivered": ( + "stripe.events._v1_climate_order_delivered_event", + "V1ClimateOrderDeliveredEvent", + ), + "v1.climate.order.product_substituted": ( + "stripe.events._v1_climate_order_product_substituted_event", + "V1ClimateOrderProductSubstitutedEvent", + ), + "v1.climate.product.created": ( + "stripe.events._v1_climate_product_created_event", + "V1ClimateProductCreatedEvent", + ), + "v1.climate.product.pricing_updated": ( + "stripe.events._v1_climate_product_pricing_updated_event", + "V1ClimateProductPricingUpdatedEvent", + ), + "v1.coupon.created": ( + "stripe.events._v1_coupon_created_event", + "V1CouponCreatedEvent", + ), + "v1.coupon.deleted": ( + "stripe.events._v1_coupon_deleted_event", + "V1CouponDeletedEvent", + ), + "v1.coupon.updated": ( + "stripe.events._v1_coupon_updated_event", + "V1CouponUpdatedEvent", + ), + "v1.credit_note.created": ( + "stripe.events._v1_credit_note_created_event", + "V1CreditNoteCreatedEvent", + ), + "v1.credit_note.updated": ( + "stripe.events._v1_credit_note_updated_event", + "V1CreditNoteUpdatedEvent", + ), + "v1.credit_note.voided": ( + "stripe.events._v1_credit_note_voided_event", + "V1CreditNoteVoidedEvent", + ), + "v1.customer_cash_balance_transaction.created": ( + "stripe.events._v1_customer_cash_balance_transaction_created_event", + "V1CustomerCashBalanceTransactionCreatedEvent", + ), + "v1.customer.created": ( + "stripe.events._v1_customer_created_event", + "V1CustomerCreatedEvent", + ), + "v1.customer.deleted": ( + "stripe.events._v1_customer_deleted_event", + "V1CustomerDeletedEvent", + ), + "v1.customer.subscription.created": ( + "stripe.events._v1_customer_subscription_created_event", + "V1CustomerSubscriptionCreatedEvent", + ), + "v1.customer.subscription.deleted": ( + "stripe.events._v1_customer_subscription_deleted_event", + "V1CustomerSubscriptionDeletedEvent", + ), + "v1.customer.subscription.paused": ( + "stripe.events._v1_customer_subscription_paused_event", + "V1CustomerSubscriptionPausedEvent", + ), + "v1.customer.subscription.pending_update_applied": ( + "stripe.events._v1_customer_subscription_pending_update_applied_event", + "V1CustomerSubscriptionPendingUpdateAppliedEvent", + ), + "v1.customer.subscription.pending_update_expired": ( + "stripe.events._v1_customer_subscription_pending_update_expired_event", + "V1CustomerSubscriptionPendingUpdateExpiredEvent", + ), + "v1.customer.subscription.resumed": ( + "stripe.events._v1_customer_subscription_resumed_event", + "V1CustomerSubscriptionResumedEvent", + ), + "v1.customer.subscription.trial_will_end": ( + "stripe.events._v1_customer_subscription_trial_will_end_event", + "V1CustomerSubscriptionTrialWillEndEvent", + ), + "v1.customer.subscription.updated": ( + "stripe.events._v1_customer_subscription_updated_event", + "V1CustomerSubscriptionUpdatedEvent", + ), + "v1.customer.tax_id.created": ( + "stripe.events._v1_customer_tax_id_created_event", + "V1CustomerTaxIdCreatedEvent", + ), + "v1.customer.tax_id.deleted": ( + "stripe.events._v1_customer_tax_id_deleted_event", + "V1CustomerTaxIdDeletedEvent", + ), + "v1.customer.tax_id.updated": ( + "stripe.events._v1_customer_tax_id_updated_event", + "V1CustomerTaxIdUpdatedEvent", + ), + "v1.customer.updated": ( + "stripe.events._v1_customer_updated_event", + "V1CustomerUpdatedEvent", + ), + "v1.entitlements.active_entitlement_summary.updated": ( + "stripe.events._v1_entitlements_active_entitlement_summary_updated_event", + "V1EntitlementsActiveEntitlementSummaryUpdatedEvent", + ), + "v1.file.created": ( + "stripe.events._v1_file_created_event", + "V1FileCreatedEvent", + ), + "v1.financial_connections.account.created": ( + "stripe.events._v1_financial_connections_account_created_event", + "V1FinancialConnectionsAccountCreatedEvent", + ), + "v1.financial_connections.account.deactivated": ( + "stripe.events._v1_financial_connections_account_deactivated_event", + "V1FinancialConnectionsAccountDeactivatedEvent", + ), + "v1.financial_connections.account.disconnected": ( + "stripe.events._v1_financial_connections_account_disconnected_event", + "V1FinancialConnectionsAccountDisconnectedEvent", + ), + "v1.financial_connections.account.reactivated": ( + "stripe.events._v1_financial_connections_account_reactivated_event", + "V1FinancialConnectionsAccountReactivatedEvent", + ), + "v1.financial_connections.account.refreshed_balance": ( + "stripe.events._v1_financial_connections_account_refreshed_balance_event", + "V1FinancialConnectionsAccountRefreshedBalanceEvent", + ), + "v1.financial_connections.account.refreshed_ownership": ( + "stripe.events._v1_financial_connections_account_refreshed_ownership_event", + "V1FinancialConnectionsAccountRefreshedOwnershipEvent", + ), + "v1.financial_connections.account.refreshed_transactions": ( + "stripe.events._v1_financial_connections_account_refreshed_transactions_event", + "V1FinancialConnectionsAccountRefreshedTransactionsEvent", + ), + "v1.identity.verification_session.canceled": ( + "stripe.events._v1_identity_verification_session_canceled_event", + "V1IdentityVerificationSessionCanceledEvent", + ), + "v1.identity.verification_session.created": ( + "stripe.events._v1_identity_verification_session_created_event", + "V1IdentityVerificationSessionCreatedEvent", + ), + "v1.identity.verification_session.processing": ( + "stripe.events._v1_identity_verification_session_processing_event", + "V1IdentityVerificationSessionProcessingEvent", + ), + "v1.identity.verification_session.redacted": ( + "stripe.events._v1_identity_verification_session_redacted_event", + "V1IdentityVerificationSessionRedactedEvent", + ), + "v1.identity.verification_session.requires_input": ( + "stripe.events._v1_identity_verification_session_requires_input_event", + "V1IdentityVerificationSessionRequiresInputEvent", + ), + "v1.identity.verification_session.verified": ( + "stripe.events._v1_identity_verification_session_verified_event", + "V1IdentityVerificationSessionVerifiedEvent", + ), + "v1.invoice.created": ( + "stripe.events._v1_invoice_created_event", + "V1InvoiceCreatedEvent", + ), + "v1.invoice.deleted": ( + "stripe.events._v1_invoice_deleted_event", + "V1InvoiceDeletedEvent", + ), + "v1.invoice.finalization_failed": ( + "stripe.events._v1_invoice_finalization_failed_event", + "V1InvoiceFinalizationFailedEvent", + ), + "v1.invoice.finalized": ( + "stripe.events._v1_invoice_finalized_event", + "V1InvoiceFinalizedEvent", + ), + "v1.invoiceitem.created": ( + "stripe.events._v1_invoiceitem_created_event", + "V1InvoiceitemCreatedEvent", + ), + "v1.invoiceitem.deleted": ( + "stripe.events._v1_invoiceitem_deleted_event", + "V1InvoiceitemDeletedEvent", + ), + "v1.invoice.marked_uncollectible": ( + "stripe.events._v1_invoice_marked_uncollectible_event", + "V1InvoiceMarkedUncollectibleEvent", + ), + "v1.invoice.overdue": ( + "stripe.events._v1_invoice_overdue_event", + "V1InvoiceOverdueEvent", + ), + "v1.invoice.overpaid": ( + "stripe.events._v1_invoice_overpaid_event", + "V1InvoiceOverpaidEvent", + ), + "v1.invoice.paid": ( + "stripe.events._v1_invoice_paid_event", + "V1InvoicePaidEvent", + ), + "v1.invoice.payment_action_required": ( + "stripe.events._v1_invoice_payment_action_required_event", + "V1InvoicePaymentActionRequiredEvent", + ), + "v1.invoice.payment_failed": ( + "stripe.events._v1_invoice_payment_failed_event", + "V1InvoicePaymentFailedEvent", + ), + "v1.invoice_payment.paid": ( + "stripe.events._v1_invoice_payment_paid_event", + "V1InvoicePaymentPaidEvent", + ), + "v1.invoice.payment_succeeded": ( + "stripe.events._v1_invoice_payment_succeeded_event", + "V1InvoicePaymentSucceededEvent", + ), + "v1.invoice.sent": ( + "stripe.events._v1_invoice_sent_event", + "V1InvoiceSentEvent", + ), + "v1.invoice.upcoming": ( + "stripe.events._v1_invoice_upcoming_event", + "V1InvoiceUpcomingEvent", + ), + "v1.invoice.updated": ( + "stripe.events._v1_invoice_updated_event", + "V1InvoiceUpdatedEvent", + ), + "v1.invoice.voided": ( + "stripe.events._v1_invoice_voided_event", + "V1InvoiceVoidedEvent", + ), + "v1.invoice.will_be_due": ( + "stripe.events._v1_invoice_will_be_due_event", + "V1InvoiceWillBeDueEvent", + ), + "v1.issuing_authorization.created": ( + "stripe.events._v1_issuing_authorization_created_event", + "V1IssuingAuthorizationCreatedEvent", + ), + "v1.issuing_authorization.request": ( + "stripe.events._v1_issuing_authorization_request_event", + "V1IssuingAuthorizationRequestEvent", + ), + "v1.issuing_authorization.updated": ( + "stripe.events._v1_issuing_authorization_updated_event", + "V1IssuingAuthorizationUpdatedEvent", + ), + "v1.issuing_card.created": ( + "stripe.events._v1_issuing_card_created_event", + "V1IssuingCardCreatedEvent", + ), + "v1.issuing_cardholder.created": ( + "stripe.events._v1_issuing_cardholder_created_event", + "V1IssuingCardholderCreatedEvent", + ), + "v1.issuing_cardholder.updated": ( + "stripe.events._v1_issuing_cardholder_updated_event", + "V1IssuingCardholderUpdatedEvent", + ), + "v1.issuing_card.updated": ( + "stripe.events._v1_issuing_card_updated_event", + "V1IssuingCardUpdatedEvent", + ), + "v1.issuing_dispute.closed": ( + "stripe.events._v1_issuing_dispute_closed_event", + "V1IssuingDisputeClosedEvent", + ), + "v1.issuing_dispute.created": ( + "stripe.events._v1_issuing_dispute_created_event", + "V1IssuingDisputeCreatedEvent", + ), + "v1.issuing_dispute.funds_reinstated": ( + "stripe.events._v1_issuing_dispute_funds_reinstated_event", + "V1IssuingDisputeFundsReinstatedEvent", + ), + "v1.issuing_dispute.funds_rescinded": ( + "stripe.events._v1_issuing_dispute_funds_rescinded_event", + "V1IssuingDisputeFundsRescindedEvent", + ), + "v1.issuing_dispute.submitted": ( + "stripe.events._v1_issuing_dispute_submitted_event", + "V1IssuingDisputeSubmittedEvent", + ), + "v1.issuing_dispute.updated": ( + "stripe.events._v1_issuing_dispute_updated_event", + "V1IssuingDisputeUpdatedEvent", + ), + "v1.issuing_personalization_design.activated": ( + "stripe.events._v1_issuing_personalization_design_activated_event", + "V1IssuingPersonalizationDesignActivatedEvent", + ), + "v1.issuing_personalization_design.deactivated": ( + "stripe.events._v1_issuing_personalization_design_deactivated_event", + "V1IssuingPersonalizationDesignDeactivatedEvent", + ), + "v1.issuing_personalization_design.rejected": ( + "stripe.events._v1_issuing_personalization_design_rejected_event", + "V1IssuingPersonalizationDesignRejectedEvent", + ), + "v1.issuing_personalization_design.updated": ( + "stripe.events._v1_issuing_personalization_design_updated_event", + "V1IssuingPersonalizationDesignUpdatedEvent", + ), + "v1.issuing_token.created": ( + "stripe.events._v1_issuing_token_created_event", + "V1IssuingTokenCreatedEvent", + ), + "v1.issuing_token.updated": ( + "stripe.events._v1_issuing_token_updated_event", + "V1IssuingTokenUpdatedEvent", + ), + "v1.issuing_transaction.created": ( + "stripe.events._v1_issuing_transaction_created_event", + "V1IssuingTransactionCreatedEvent", + ), + "v1.issuing_transaction.purchase_details_receipt_updated": ( + "stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event", + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent", + ), + "v1.issuing_transaction.updated": ( + "stripe.events._v1_issuing_transaction_updated_event", + "V1IssuingTransactionUpdatedEvent", + ), + "v1.mandate.updated": ( + "stripe.events._v1_mandate_updated_event", + "V1MandateUpdatedEvent", + ), + "v1.payment_intent.amount_capturable_updated": ( + "stripe.events._v1_payment_intent_amount_capturable_updated_event", + "V1PaymentIntentAmountCapturableUpdatedEvent", + ), + "v1.payment_intent.canceled": ( + "stripe.events._v1_payment_intent_canceled_event", + "V1PaymentIntentCanceledEvent", + ), + "v1.payment_intent.created": ( + "stripe.events._v1_payment_intent_created_event", + "V1PaymentIntentCreatedEvent", + ), + "v1.payment_intent.partially_funded": ( + "stripe.events._v1_payment_intent_partially_funded_event", + "V1PaymentIntentPartiallyFundedEvent", + ), + "v1.payment_intent.payment_failed": ( + "stripe.events._v1_payment_intent_payment_failed_event", + "V1PaymentIntentPaymentFailedEvent", + ), + "v1.payment_intent.processing": ( + "stripe.events._v1_payment_intent_processing_event", + "V1PaymentIntentProcessingEvent", + ), + "v1.payment_intent.requires_action": ( + "stripe.events._v1_payment_intent_requires_action_event", + "V1PaymentIntentRequiresActionEvent", + ), + "v1.payment_intent.succeeded": ( + "stripe.events._v1_payment_intent_succeeded_event", + "V1PaymentIntentSucceededEvent", + ), + "v1.payment_link.created": ( + "stripe.events._v1_payment_link_created_event", + "V1PaymentLinkCreatedEvent", + ), + "v1.payment_link.updated": ( + "stripe.events._v1_payment_link_updated_event", + "V1PaymentLinkUpdatedEvent", + ), + "v1.payment_method.attached": ( + "stripe.events._v1_payment_method_attached_event", + "V1PaymentMethodAttachedEvent", + ), + "v1.payment_method.automatically_updated": ( + "stripe.events._v1_payment_method_automatically_updated_event", + "V1PaymentMethodAutomaticallyUpdatedEvent", + ), + "v1.payment_method.detached": ( + "stripe.events._v1_payment_method_detached_event", + "V1PaymentMethodDetachedEvent", + ), + "v1.payment_method.updated": ( + "stripe.events._v1_payment_method_updated_event", + "V1PaymentMethodUpdatedEvent", + ), + "v1.payout.canceled": ( + "stripe.events._v1_payout_canceled_event", + "V1PayoutCanceledEvent", + ), + "v1.payout.created": ( + "stripe.events._v1_payout_created_event", + "V1PayoutCreatedEvent", + ), + "v1.payout.failed": ( + "stripe.events._v1_payout_failed_event", + "V1PayoutFailedEvent", + ), + "v1.payout.paid": ( + "stripe.events._v1_payout_paid_event", + "V1PayoutPaidEvent", + ), + "v1.payout.reconciliation_completed": ( + "stripe.events._v1_payout_reconciliation_completed_event", + "V1PayoutReconciliationCompletedEvent", + ), + "v1.payout.updated": ( + "stripe.events._v1_payout_updated_event", + "V1PayoutUpdatedEvent", + ), + "v1.person.created": ( + "stripe.events._v1_person_created_event", + "V1PersonCreatedEvent", + ), + "v1.person.deleted": ( + "stripe.events._v1_person_deleted_event", + "V1PersonDeletedEvent", + ), + "v1.person.updated": ( + "stripe.events._v1_person_updated_event", + "V1PersonUpdatedEvent", + ), + "v1.plan.created": ( + "stripe.events._v1_plan_created_event", + "V1PlanCreatedEvent", + ), + "v1.plan.deleted": ( + "stripe.events._v1_plan_deleted_event", + "V1PlanDeletedEvent", + ), + "v1.plan.updated": ( + "stripe.events._v1_plan_updated_event", + "V1PlanUpdatedEvent", + ), + "v1.price.created": ( + "stripe.events._v1_price_created_event", + "V1PriceCreatedEvent", + ), + "v1.price.deleted": ( + "stripe.events._v1_price_deleted_event", + "V1PriceDeletedEvent", + ), + "v1.price.updated": ( + "stripe.events._v1_price_updated_event", + "V1PriceUpdatedEvent", + ), + "v1.product.created": ( + "stripe.events._v1_product_created_event", + "V1ProductCreatedEvent", + ), + "v1.product.deleted": ( + "stripe.events._v1_product_deleted_event", + "V1ProductDeletedEvent", + ), + "v1.product.updated": ( + "stripe.events._v1_product_updated_event", + "V1ProductUpdatedEvent", + ), + "v1.promotion_code.created": ( + "stripe.events._v1_promotion_code_created_event", + "V1PromotionCodeCreatedEvent", + ), + "v1.promotion_code.updated": ( + "stripe.events._v1_promotion_code_updated_event", + "V1PromotionCodeUpdatedEvent", + ), + "v1.quote.accepted": ( + "stripe.events._v1_quote_accepted_event", + "V1QuoteAcceptedEvent", + ), + "v1.quote.canceled": ( + "stripe.events._v1_quote_canceled_event", + "V1QuoteCanceledEvent", + ), + "v1.quote.created": ( + "stripe.events._v1_quote_created_event", + "V1QuoteCreatedEvent", + ), + "v1.quote.finalized": ( + "stripe.events._v1_quote_finalized_event", + "V1QuoteFinalizedEvent", + ), + "v1.radar.early_fraud_warning.created": ( + "stripe.events._v1_radar_early_fraud_warning_created_event", + "V1RadarEarlyFraudWarningCreatedEvent", + ), + "v1.radar.early_fraud_warning.updated": ( + "stripe.events._v1_radar_early_fraud_warning_updated_event", + "V1RadarEarlyFraudWarningUpdatedEvent", + ), + "v1.refund.created": ( + "stripe.events._v1_refund_created_event", + "V1RefundCreatedEvent", + ), + "v1.refund.failed": ( + "stripe.events._v1_refund_failed_event", + "V1RefundFailedEvent", + ), + "v1.refund.updated": ( + "stripe.events._v1_refund_updated_event", + "V1RefundUpdatedEvent", + ), + "v1.review.closed": ( + "stripe.events._v1_review_closed_event", + "V1ReviewClosedEvent", + ), + "v1.review.opened": ( + "stripe.events._v1_review_opened_event", + "V1ReviewOpenedEvent", + ), + "v1.setup_intent.canceled": ( + "stripe.events._v1_setup_intent_canceled_event", + "V1SetupIntentCanceledEvent", + ), + "v1.setup_intent.created": ( + "stripe.events._v1_setup_intent_created_event", + "V1SetupIntentCreatedEvent", + ), + "v1.setup_intent.requires_action": ( + "stripe.events._v1_setup_intent_requires_action_event", + "V1SetupIntentRequiresActionEvent", + ), + "v1.setup_intent.setup_failed": ( + "stripe.events._v1_setup_intent_setup_failed_event", + "V1SetupIntentSetupFailedEvent", + ), + "v1.setup_intent.succeeded": ( + "stripe.events._v1_setup_intent_succeeded_event", + "V1SetupIntentSucceededEvent", + ), + "v1.sigma.scheduled_query_run.created": ( + "stripe.events._v1_sigma_scheduled_query_run_created_event", + "V1SigmaScheduledQueryRunCreatedEvent", + ), + "v1.source.canceled": ( + "stripe.events._v1_source_canceled_event", + "V1SourceCanceledEvent", + ), + "v1.source.chargeable": ( + "stripe.events._v1_source_chargeable_event", + "V1SourceChargeableEvent", + ), + "v1.source.failed": ( + "stripe.events._v1_source_failed_event", + "V1SourceFailedEvent", + ), + "v1.source.refund_attributes_required": ( + "stripe.events._v1_source_refund_attributes_required_event", + "V1SourceRefundAttributesRequiredEvent", + ), + "v1.subscription_schedule.aborted": ( + "stripe.events._v1_subscription_schedule_aborted_event", + "V1SubscriptionScheduleAbortedEvent", + ), + "v1.subscription_schedule.canceled": ( + "stripe.events._v1_subscription_schedule_canceled_event", + "V1SubscriptionScheduleCanceledEvent", + ), + "v1.subscription_schedule.completed": ( + "stripe.events._v1_subscription_schedule_completed_event", + "V1SubscriptionScheduleCompletedEvent", + ), + "v1.subscription_schedule.created": ( + "stripe.events._v1_subscription_schedule_created_event", + "V1SubscriptionScheduleCreatedEvent", + ), + "v1.subscription_schedule.expiring": ( + "stripe.events._v1_subscription_schedule_expiring_event", + "V1SubscriptionScheduleExpiringEvent", + ), + "v1.subscription_schedule.released": ( + "stripe.events._v1_subscription_schedule_released_event", + "V1SubscriptionScheduleReleasedEvent", + ), + "v1.subscription_schedule.updated": ( + "stripe.events._v1_subscription_schedule_updated_event", + "V1SubscriptionScheduleUpdatedEvent", + ), + "v1.tax_rate.created": ( + "stripe.events._v1_tax_rate_created_event", + "V1TaxRateCreatedEvent", + ), + "v1.tax_rate.updated": ( + "stripe.events._v1_tax_rate_updated_event", + "V1TaxRateUpdatedEvent", + ), + "v1.tax.settings.updated": ( + "stripe.events._v1_tax_settings_updated_event", + "V1TaxSettingsUpdatedEvent", ), - "v1.billing.meter.no_meter_found": ( - "stripe.events._v1_billing_meter_no_meter_found_event", - "V1BillingMeterNoMeterFoundEvent", + "v1.terminal.reader.action_failed": ( + "stripe.events._v1_terminal_reader_action_failed_event", + "V1TerminalReaderActionFailedEvent", + ), + "v1.terminal.reader.action_succeeded": ( + "stripe.events._v1_terminal_reader_action_succeeded_event", + "V1TerminalReaderActionSucceededEvent", + ), + "v1.terminal.reader.action_updated": ( + "stripe.events._v1_terminal_reader_action_updated_event", + "V1TerminalReaderActionUpdatedEvent", + ), + "v1.test_helpers.test_clock.advancing": ( + "stripe.events._v1_test_helpers_test_clock_advancing_event", + "V1TestHelpersTestClockAdvancingEvent", + ), + "v1.test_helpers.test_clock.created": ( + "stripe.events._v1_test_helpers_test_clock_created_event", + "V1TestHelpersTestClockCreatedEvent", + ), + "v1.test_helpers.test_clock.deleted": ( + "stripe.events._v1_test_helpers_test_clock_deleted_event", + "V1TestHelpersTestClockDeletedEvent", + ), + "v1.test_helpers.test_clock.internal_failure": ( + "stripe.events._v1_test_helpers_test_clock_internal_failure_event", + "V1TestHelpersTestClockInternalFailureEvent", + ), + "v1.test_helpers.test_clock.ready": ( + "stripe.events._v1_test_helpers_test_clock_ready_event", + "V1TestHelpersTestClockReadyEvent", + ), + "v1.topup.canceled": ( + "stripe.events._v1_topup_canceled_event", + "V1TopupCanceledEvent", + ), + "v1.topup.created": ( + "stripe.events._v1_topup_created_event", + "V1TopupCreatedEvent", + ), + "v1.topup.failed": ( + "stripe.events._v1_topup_failed_event", + "V1TopupFailedEvent", + ), + "v1.topup.reversed": ( + "stripe.events._v1_topup_reversed_event", + "V1TopupReversedEvent", + ), + "v1.topup.succeeded": ( + "stripe.events._v1_topup_succeeded_event", + "V1TopupSucceededEvent", + ), + "v1.transfer.created": ( + "stripe.events._v1_transfer_created_event", + "V1TransferCreatedEvent", + ), + "v1.transfer.reversed": ( + "stripe.events._v1_transfer_reversed_event", + "V1TransferReversedEvent", + ), + "v1.transfer.updated": ( + "stripe.events._v1_transfer_updated_event", + "V1TransferUpdatedEvent", ), "v2.billing.cadence.billed": ( "stripe.events._v2_billing_cadence_billed_event", @@ -714,6 +2161,22 @@ "stripe.events._v2_billing_rate_card_version_created_event", "V2BillingRateCardVersionCreatedEvent", ), + "v2.commerce.product_catalog.imports.failed": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + "V2CommerceProductCatalogImportsFailedEvent", + ), + "v2.commerce.product_catalog.imports.processing": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + "V2CommerceProductCatalogImportsProcessingEvent", + ), + "v2.commerce.product_catalog.imports.succeeded": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + "V2CommerceProductCatalogImportsSucceededEvent", + ), + "v2.commerce.product_catalog.imports.succeeded_with_errors": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + ), "v2.core.account.closed": ( "stripe.events._v2_core_account_closed_event", "V2CoreAccountClosedEvent", @@ -802,6 +2265,26 @@ "stripe.events._v2_core_account_updated_event", "V2CoreAccountUpdatedEvent", ), + "v2.core.approval_request.approved": ( + "stripe.events._v2_core_approval_request_approved_event", + "V2CoreApprovalRequestApprovedEvent", + ), + "v2.core.approval_request.canceled": ( + "stripe.events._v2_core_approval_request_canceled_event", + "V2CoreApprovalRequestCanceledEvent", + ), + "v2.core.approval_request.failed": ( + "stripe.events._v2_core_approval_request_failed_event", + "V2CoreApprovalRequestFailedEvent", + ), + "v2.core.approval_request.rejected": ( + "stripe.events._v2_core_approval_request_rejected_event", + "V2CoreApprovalRequestRejectedEvent", + ), + "v2.core.approval_request.succeeded": ( + "stripe.events._v2_core_approval_request_succeeded_event", + "V2CoreApprovalRequestSucceededEvent", + ), "v2.core.batch_job.batch_failed": ( "stripe.events._v2_core_batch_job_batch_failed_event", "V2CoreBatchJobBatchFailedEvent", @@ -858,9 +2341,9 @@ "stripe.events._v2_core_claimable_sandbox_expiring_event", "V2CoreClaimableSandboxExpiringEvent", ), - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated": ( - "stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event", - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent", + "v2.core.claimable_sandbox.updated": ( + "stripe.events._v2_core_claimable_sandbox_updated_event", + "V2CoreClaimableSandboxUpdatedEvent", ), "v2.core.event_destination.ping": ( "stripe.events._v2_core_event_destination_ping_event", @@ -914,6 +2397,14 @@ "stripe.events._v2_core_health_issuing_authorization_request_timeout_resolved_event", "V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent", ), + "v2.core.health.meter_event_summaries_delayed.firing": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event", + "V2CoreHealthMeterEventSummariesDelayedFiringEvent", + ), + "v2.core.health.meter_event_summaries_delayed.resolved": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event", + "V2CoreHealthMeterEventSummariesDelayedResolvedEvent", + ), "v2.core.health.payment_method_error.firing": ( "stripe.events._v2_core_health_payment_method_error_firing_event", "V2CoreHealthPaymentMethodErrorFiringEvent", @@ -962,6 +2453,18 @@ "stripe.events._v2_data_reporting_query_run_updated_event", "V2DataReportingQueryRunUpdatedEvent", ), + "v2.extend.workflow_run.failed": ( + "stripe.events._v2_extend_workflow_run_failed_event", + "V2ExtendWorkflowRunFailedEvent", + ), + "v2.extend.workflow_run.started": ( + "stripe.events._v2_extend_workflow_run_started_event", + "V2ExtendWorkflowRunStartedEvent", + ), + "v2.extend.workflow_run.succeeded": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + "V2ExtendWorkflowRunSucceededEvent", + ), "v2.iam.api_key.created": ( "stripe.events._v2_iam_api_key_created_event", "V2IamApiKeyCreatedEvent", @@ -1162,6 +2665,22 @@ "stripe.events._v2_money_management_transaction_updated_event", "V2MoneyManagementTransactionUpdatedEvent", ), + "v2.orchestrated_commerce.agreement.confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + "V2OrchestratedCommerceAgreementConfirmedEvent", + ), + "v2.orchestrated_commerce.agreement.created": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + "V2OrchestratedCommerceAgreementCreatedEvent", + ), + "v2.orchestrated_commerce.agreement.partially_confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + ), + "v2.orchestrated_commerce.agreement.terminated": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + "V2OrchestratedCommerceAgreementTerminatedEvent", + ), "v2.payments.off_session_payment.attempt_failed": ( "stripe.events._v2_payments_off_session_payment_attempt_failed_event", "V2PaymentsOffSessionPaymentAttemptFailedEvent", @@ -1285,10 +2804,54 @@ def get_v2_event_class(type_: str): _V2_EVENT_NOTIFICATION_CLASS_LOOKUP = { + "v1.account.application.authorized": ( + "stripe.events._v1_account_application_authorized_event", + "V1AccountApplicationAuthorizedEventNotification", + ), + "v1.account.application.deauthorized": ( + "stripe.events._v1_account_application_deauthorized_event", + "V1AccountApplicationDeauthorizedEventNotification", + ), + "v1.account.external_account.created": ( + "stripe.events._v1_account_external_account_created_event", + "V1AccountExternalAccountCreatedEventNotification", + ), + "v1.account.external_account.deleted": ( + "stripe.events._v1_account_external_account_deleted_event", + "V1AccountExternalAccountDeletedEventNotification", + ), + "v1.account.external_account.updated": ( + "stripe.events._v1_account_external_account_updated_event", + "V1AccountExternalAccountUpdatedEventNotification", + ), "v1.account_signals[delinquency].created": ( "stripe.events._v1_account_signals_including_delinquency_created_event", "V1AccountSignalsIncludingDelinquencyCreatedEventNotification", ), + "v1.account.updated": ( + "stripe.events._v1_account_updated_event", + "V1AccountUpdatedEventNotification", + ), + "v1.application_fee.created": ( + "stripe.events._v1_application_fee_created_event", + "V1ApplicationFeeCreatedEventNotification", + ), + "v1.application_fee.refunded": ( + "stripe.events._v1_application_fee_refunded_event", + "V1ApplicationFeeRefundedEventNotification", + ), + "v1.application_fee.refund.updated": ( + "stripe.events._v1_application_fee_refund_updated_event", + "V1ApplicationFeeRefundUpdatedEventNotification", + ), + "v1.balance.available": ( + "stripe.events._v1_balance_available_event", + "V1BalanceAvailableEventNotification", + ), + "v1.billing.alert.triggered": ( + "stripe.events._v1_billing_alert_triggered_event", + "V1BillingAlertTriggeredEventNotification", + ), "v1.billing.meter.error_report_triggered": ( "stripe.events._v1_billing_meter_error_report_triggered_event", "V1BillingMeterErrorReportTriggeredEventNotification", @@ -1297,6 +2860,758 @@ def get_v2_event_class(type_: str): "stripe.events._v1_billing_meter_no_meter_found_event", "V1BillingMeterNoMeterFoundEventNotification", ), + "v1.billing_portal.configuration.created": ( + "stripe.events._v1_billing_portal_configuration_created_event", + "V1BillingPortalConfigurationCreatedEventNotification", + ), + "v1.billing_portal.configuration.updated": ( + "stripe.events._v1_billing_portal_configuration_updated_event", + "V1BillingPortalConfigurationUpdatedEventNotification", + ), + "v1.billing_portal.session.created": ( + "stripe.events._v1_billing_portal_session_created_event", + "V1BillingPortalSessionCreatedEventNotification", + ), + "v1.capability.updated": ( + "stripe.events._v1_capability_updated_event", + "V1CapabilityUpdatedEventNotification", + ), + "v1.cash_balance.funds_available": ( + "stripe.events._v1_cash_balance_funds_available_event", + "V1CashBalanceFundsAvailableEventNotification", + ), + "v1.charge.captured": ( + "stripe.events._v1_charge_captured_event", + "V1ChargeCapturedEventNotification", + ), + "v1.charge.dispute.closed": ( + "stripe.events._v1_charge_dispute_closed_event", + "V1ChargeDisputeClosedEventNotification", + ), + "v1.charge.dispute.created": ( + "stripe.events._v1_charge_dispute_created_event", + "V1ChargeDisputeCreatedEventNotification", + ), + "v1.charge.dispute.funds_reinstated": ( + "stripe.events._v1_charge_dispute_funds_reinstated_event", + "V1ChargeDisputeFundsReinstatedEventNotification", + ), + "v1.charge.dispute.funds_withdrawn": ( + "stripe.events._v1_charge_dispute_funds_withdrawn_event", + "V1ChargeDisputeFundsWithdrawnEventNotification", + ), + "v1.charge.dispute.updated": ( + "stripe.events._v1_charge_dispute_updated_event", + "V1ChargeDisputeUpdatedEventNotification", + ), + "v1.charge.expired": ( + "stripe.events._v1_charge_expired_event", + "V1ChargeExpiredEventNotification", + ), + "v1.charge.failed": ( + "stripe.events._v1_charge_failed_event", + "V1ChargeFailedEventNotification", + ), + "v1.charge.pending": ( + "stripe.events._v1_charge_pending_event", + "V1ChargePendingEventNotification", + ), + "v1.charge.refunded": ( + "stripe.events._v1_charge_refunded_event", + "V1ChargeRefundedEventNotification", + ), + "v1.charge.refund.updated": ( + "stripe.events._v1_charge_refund_updated_event", + "V1ChargeRefundUpdatedEventNotification", + ), + "v1.charge.succeeded": ( + "stripe.events._v1_charge_succeeded_event", + "V1ChargeSucceededEventNotification", + ), + "v1.charge.updated": ( + "stripe.events._v1_charge_updated_event", + "V1ChargeUpdatedEventNotification", + ), + "v1.checkout.session.async_payment_failed": ( + "stripe.events._v1_checkout_session_async_payment_failed_event", + "V1CheckoutSessionAsyncPaymentFailedEventNotification", + ), + "v1.checkout.session.async_payment_succeeded": ( + "stripe.events._v1_checkout_session_async_payment_succeeded_event", + "V1CheckoutSessionAsyncPaymentSucceededEventNotification", + ), + "v1.checkout.session.completed": ( + "stripe.events._v1_checkout_session_completed_event", + "V1CheckoutSessionCompletedEventNotification", + ), + "v1.checkout.session.expired": ( + "stripe.events._v1_checkout_session_expired_event", + "V1CheckoutSessionExpiredEventNotification", + ), + "v1.climate.order.canceled": ( + "stripe.events._v1_climate_order_canceled_event", + "V1ClimateOrderCanceledEventNotification", + ), + "v1.climate.order.created": ( + "stripe.events._v1_climate_order_created_event", + "V1ClimateOrderCreatedEventNotification", + ), + "v1.climate.order.delayed": ( + "stripe.events._v1_climate_order_delayed_event", + "V1ClimateOrderDelayedEventNotification", + ), + "v1.climate.order.delivered": ( + "stripe.events._v1_climate_order_delivered_event", + "V1ClimateOrderDeliveredEventNotification", + ), + "v1.climate.order.product_substituted": ( + "stripe.events._v1_climate_order_product_substituted_event", + "V1ClimateOrderProductSubstitutedEventNotification", + ), + "v1.climate.product.created": ( + "stripe.events._v1_climate_product_created_event", + "V1ClimateProductCreatedEventNotification", + ), + "v1.climate.product.pricing_updated": ( + "stripe.events._v1_climate_product_pricing_updated_event", + "V1ClimateProductPricingUpdatedEventNotification", + ), + "v1.coupon.created": ( + "stripe.events._v1_coupon_created_event", + "V1CouponCreatedEventNotification", + ), + "v1.coupon.deleted": ( + "stripe.events._v1_coupon_deleted_event", + "V1CouponDeletedEventNotification", + ), + "v1.coupon.updated": ( + "stripe.events._v1_coupon_updated_event", + "V1CouponUpdatedEventNotification", + ), + "v1.credit_note.created": ( + "stripe.events._v1_credit_note_created_event", + "V1CreditNoteCreatedEventNotification", + ), + "v1.credit_note.updated": ( + "stripe.events._v1_credit_note_updated_event", + "V1CreditNoteUpdatedEventNotification", + ), + "v1.credit_note.voided": ( + "stripe.events._v1_credit_note_voided_event", + "V1CreditNoteVoidedEventNotification", + ), + "v1.customer_cash_balance_transaction.created": ( + "stripe.events._v1_customer_cash_balance_transaction_created_event", + "V1CustomerCashBalanceTransactionCreatedEventNotification", + ), + "v1.customer.created": ( + "stripe.events._v1_customer_created_event", + "V1CustomerCreatedEventNotification", + ), + "v1.customer.deleted": ( + "stripe.events._v1_customer_deleted_event", + "V1CustomerDeletedEventNotification", + ), + "v1.customer.subscription.created": ( + "stripe.events._v1_customer_subscription_created_event", + "V1CustomerSubscriptionCreatedEventNotification", + ), + "v1.customer.subscription.deleted": ( + "stripe.events._v1_customer_subscription_deleted_event", + "V1CustomerSubscriptionDeletedEventNotification", + ), + "v1.customer.subscription.paused": ( + "stripe.events._v1_customer_subscription_paused_event", + "V1CustomerSubscriptionPausedEventNotification", + ), + "v1.customer.subscription.pending_update_applied": ( + "stripe.events._v1_customer_subscription_pending_update_applied_event", + "V1CustomerSubscriptionPendingUpdateAppliedEventNotification", + ), + "v1.customer.subscription.pending_update_expired": ( + "stripe.events._v1_customer_subscription_pending_update_expired_event", + "V1CustomerSubscriptionPendingUpdateExpiredEventNotification", + ), + "v1.customer.subscription.resumed": ( + "stripe.events._v1_customer_subscription_resumed_event", + "V1CustomerSubscriptionResumedEventNotification", + ), + "v1.customer.subscription.trial_will_end": ( + "stripe.events._v1_customer_subscription_trial_will_end_event", + "V1CustomerSubscriptionTrialWillEndEventNotification", + ), + "v1.customer.subscription.updated": ( + "stripe.events._v1_customer_subscription_updated_event", + "V1CustomerSubscriptionUpdatedEventNotification", + ), + "v1.customer.tax_id.created": ( + "stripe.events._v1_customer_tax_id_created_event", + "V1CustomerTaxIdCreatedEventNotification", + ), + "v1.customer.tax_id.deleted": ( + "stripe.events._v1_customer_tax_id_deleted_event", + "V1CustomerTaxIdDeletedEventNotification", + ), + "v1.customer.tax_id.updated": ( + "stripe.events._v1_customer_tax_id_updated_event", + "V1CustomerTaxIdUpdatedEventNotification", + ), + "v1.customer.updated": ( + "stripe.events._v1_customer_updated_event", + "V1CustomerUpdatedEventNotification", + ), + "v1.entitlements.active_entitlement_summary.updated": ( + "stripe.events._v1_entitlements_active_entitlement_summary_updated_event", + "V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification", + ), + "v1.file.created": ( + "stripe.events._v1_file_created_event", + "V1FileCreatedEventNotification", + ), + "v1.financial_connections.account.created": ( + "stripe.events._v1_financial_connections_account_created_event", + "V1FinancialConnectionsAccountCreatedEventNotification", + ), + "v1.financial_connections.account.deactivated": ( + "stripe.events._v1_financial_connections_account_deactivated_event", + "V1FinancialConnectionsAccountDeactivatedEventNotification", + ), + "v1.financial_connections.account.disconnected": ( + "stripe.events._v1_financial_connections_account_disconnected_event", + "V1FinancialConnectionsAccountDisconnectedEventNotification", + ), + "v1.financial_connections.account.reactivated": ( + "stripe.events._v1_financial_connections_account_reactivated_event", + "V1FinancialConnectionsAccountReactivatedEventNotification", + ), + "v1.financial_connections.account.refreshed_balance": ( + "stripe.events._v1_financial_connections_account_refreshed_balance_event", + "V1FinancialConnectionsAccountRefreshedBalanceEventNotification", + ), + "v1.financial_connections.account.refreshed_ownership": ( + "stripe.events._v1_financial_connections_account_refreshed_ownership_event", + "V1FinancialConnectionsAccountRefreshedOwnershipEventNotification", + ), + "v1.financial_connections.account.refreshed_transactions": ( + "stripe.events._v1_financial_connections_account_refreshed_transactions_event", + "V1FinancialConnectionsAccountRefreshedTransactionsEventNotification", + ), + "v1.identity.verification_session.canceled": ( + "stripe.events._v1_identity_verification_session_canceled_event", + "V1IdentityVerificationSessionCanceledEventNotification", + ), + "v1.identity.verification_session.created": ( + "stripe.events._v1_identity_verification_session_created_event", + "V1IdentityVerificationSessionCreatedEventNotification", + ), + "v1.identity.verification_session.processing": ( + "stripe.events._v1_identity_verification_session_processing_event", + "V1IdentityVerificationSessionProcessingEventNotification", + ), + "v1.identity.verification_session.redacted": ( + "stripe.events._v1_identity_verification_session_redacted_event", + "V1IdentityVerificationSessionRedactedEventNotification", + ), + "v1.identity.verification_session.requires_input": ( + "stripe.events._v1_identity_verification_session_requires_input_event", + "V1IdentityVerificationSessionRequiresInputEventNotification", + ), + "v1.identity.verification_session.verified": ( + "stripe.events._v1_identity_verification_session_verified_event", + "V1IdentityVerificationSessionVerifiedEventNotification", + ), + "v1.invoice.created": ( + "stripe.events._v1_invoice_created_event", + "V1InvoiceCreatedEventNotification", + ), + "v1.invoice.deleted": ( + "stripe.events._v1_invoice_deleted_event", + "V1InvoiceDeletedEventNotification", + ), + "v1.invoice.finalization_failed": ( + "stripe.events._v1_invoice_finalization_failed_event", + "V1InvoiceFinalizationFailedEventNotification", + ), + "v1.invoice.finalized": ( + "stripe.events._v1_invoice_finalized_event", + "V1InvoiceFinalizedEventNotification", + ), + "v1.invoiceitem.created": ( + "stripe.events._v1_invoiceitem_created_event", + "V1InvoiceitemCreatedEventNotification", + ), + "v1.invoiceitem.deleted": ( + "stripe.events._v1_invoiceitem_deleted_event", + "V1InvoiceitemDeletedEventNotification", + ), + "v1.invoice.marked_uncollectible": ( + "stripe.events._v1_invoice_marked_uncollectible_event", + "V1InvoiceMarkedUncollectibleEventNotification", + ), + "v1.invoice.overdue": ( + "stripe.events._v1_invoice_overdue_event", + "V1InvoiceOverdueEventNotification", + ), + "v1.invoice.overpaid": ( + "stripe.events._v1_invoice_overpaid_event", + "V1InvoiceOverpaidEventNotification", + ), + "v1.invoice.paid": ( + "stripe.events._v1_invoice_paid_event", + "V1InvoicePaidEventNotification", + ), + "v1.invoice.payment_action_required": ( + "stripe.events._v1_invoice_payment_action_required_event", + "V1InvoicePaymentActionRequiredEventNotification", + ), + "v1.invoice.payment_failed": ( + "stripe.events._v1_invoice_payment_failed_event", + "V1InvoicePaymentFailedEventNotification", + ), + "v1.invoice_payment.paid": ( + "stripe.events._v1_invoice_payment_paid_event", + "V1InvoicePaymentPaidEventNotification", + ), + "v1.invoice.payment_succeeded": ( + "stripe.events._v1_invoice_payment_succeeded_event", + "V1InvoicePaymentSucceededEventNotification", + ), + "v1.invoice.sent": ( + "stripe.events._v1_invoice_sent_event", + "V1InvoiceSentEventNotification", + ), + "v1.invoice.upcoming": ( + "stripe.events._v1_invoice_upcoming_event", + "V1InvoiceUpcomingEventNotification", + ), + "v1.invoice.updated": ( + "stripe.events._v1_invoice_updated_event", + "V1InvoiceUpdatedEventNotification", + ), + "v1.invoice.voided": ( + "stripe.events._v1_invoice_voided_event", + "V1InvoiceVoidedEventNotification", + ), + "v1.invoice.will_be_due": ( + "stripe.events._v1_invoice_will_be_due_event", + "V1InvoiceWillBeDueEventNotification", + ), + "v1.issuing_authorization.created": ( + "stripe.events._v1_issuing_authorization_created_event", + "V1IssuingAuthorizationCreatedEventNotification", + ), + "v1.issuing_authorization.request": ( + "stripe.events._v1_issuing_authorization_request_event", + "V1IssuingAuthorizationRequestEventNotification", + ), + "v1.issuing_authorization.updated": ( + "stripe.events._v1_issuing_authorization_updated_event", + "V1IssuingAuthorizationUpdatedEventNotification", + ), + "v1.issuing_card.created": ( + "stripe.events._v1_issuing_card_created_event", + "V1IssuingCardCreatedEventNotification", + ), + "v1.issuing_cardholder.created": ( + "stripe.events._v1_issuing_cardholder_created_event", + "V1IssuingCardholderCreatedEventNotification", + ), + "v1.issuing_cardholder.updated": ( + "stripe.events._v1_issuing_cardholder_updated_event", + "V1IssuingCardholderUpdatedEventNotification", + ), + "v1.issuing_card.updated": ( + "stripe.events._v1_issuing_card_updated_event", + "V1IssuingCardUpdatedEventNotification", + ), + "v1.issuing_dispute.closed": ( + "stripe.events._v1_issuing_dispute_closed_event", + "V1IssuingDisputeClosedEventNotification", + ), + "v1.issuing_dispute.created": ( + "stripe.events._v1_issuing_dispute_created_event", + "V1IssuingDisputeCreatedEventNotification", + ), + "v1.issuing_dispute.funds_reinstated": ( + "stripe.events._v1_issuing_dispute_funds_reinstated_event", + "V1IssuingDisputeFundsReinstatedEventNotification", + ), + "v1.issuing_dispute.funds_rescinded": ( + "stripe.events._v1_issuing_dispute_funds_rescinded_event", + "V1IssuingDisputeFundsRescindedEventNotification", + ), + "v1.issuing_dispute.submitted": ( + "stripe.events._v1_issuing_dispute_submitted_event", + "V1IssuingDisputeSubmittedEventNotification", + ), + "v1.issuing_dispute.updated": ( + "stripe.events._v1_issuing_dispute_updated_event", + "V1IssuingDisputeUpdatedEventNotification", + ), + "v1.issuing_personalization_design.activated": ( + "stripe.events._v1_issuing_personalization_design_activated_event", + "V1IssuingPersonalizationDesignActivatedEventNotification", + ), + "v1.issuing_personalization_design.deactivated": ( + "stripe.events._v1_issuing_personalization_design_deactivated_event", + "V1IssuingPersonalizationDesignDeactivatedEventNotification", + ), + "v1.issuing_personalization_design.rejected": ( + "stripe.events._v1_issuing_personalization_design_rejected_event", + "V1IssuingPersonalizationDesignRejectedEventNotification", + ), + "v1.issuing_personalization_design.updated": ( + "stripe.events._v1_issuing_personalization_design_updated_event", + "V1IssuingPersonalizationDesignUpdatedEventNotification", + ), + "v1.issuing_token.created": ( + "stripe.events._v1_issuing_token_created_event", + "V1IssuingTokenCreatedEventNotification", + ), + "v1.issuing_token.updated": ( + "stripe.events._v1_issuing_token_updated_event", + "V1IssuingTokenUpdatedEventNotification", + ), + "v1.issuing_transaction.created": ( + "stripe.events._v1_issuing_transaction_created_event", + "V1IssuingTransactionCreatedEventNotification", + ), + "v1.issuing_transaction.purchase_details_receipt_updated": ( + "stripe.events._v1_issuing_transaction_purchase_details_receipt_updated_event", + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification", + ), + "v1.issuing_transaction.updated": ( + "stripe.events._v1_issuing_transaction_updated_event", + "V1IssuingTransactionUpdatedEventNotification", + ), + "v1.mandate.updated": ( + "stripe.events._v1_mandate_updated_event", + "V1MandateUpdatedEventNotification", + ), + "v1.payment_intent.amount_capturable_updated": ( + "stripe.events._v1_payment_intent_amount_capturable_updated_event", + "V1PaymentIntentAmountCapturableUpdatedEventNotification", + ), + "v1.payment_intent.canceled": ( + "stripe.events._v1_payment_intent_canceled_event", + "V1PaymentIntentCanceledEventNotification", + ), + "v1.payment_intent.created": ( + "stripe.events._v1_payment_intent_created_event", + "V1PaymentIntentCreatedEventNotification", + ), + "v1.payment_intent.partially_funded": ( + "stripe.events._v1_payment_intent_partially_funded_event", + "V1PaymentIntentPartiallyFundedEventNotification", + ), + "v1.payment_intent.payment_failed": ( + "stripe.events._v1_payment_intent_payment_failed_event", + "V1PaymentIntentPaymentFailedEventNotification", + ), + "v1.payment_intent.processing": ( + "stripe.events._v1_payment_intent_processing_event", + "V1PaymentIntentProcessingEventNotification", + ), + "v1.payment_intent.requires_action": ( + "stripe.events._v1_payment_intent_requires_action_event", + "V1PaymentIntentRequiresActionEventNotification", + ), + "v1.payment_intent.succeeded": ( + "stripe.events._v1_payment_intent_succeeded_event", + "V1PaymentIntentSucceededEventNotification", + ), + "v1.payment_link.created": ( + "stripe.events._v1_payment_link_created_event", + "V1PaymentLinkCreatedEventNotification", + ), + "v1.payment_link.updated": ( + "stripe.events._v1_payment_link_updated_event", + "V1PaymentLinkUpdatedEventNotification", + ), + "v1.payment_method.attached": ( + "stripe.events._v1_payment_method_attached_event", + "V1PaymentMethodAttachedEventNotification", + ), + "v1.payment_method.automatically_updated": ( + "stripe.events._v1_payment_method_automatically_updated_event", + "V1PaymentMethodAutomaticallyUpdatedEventNotification", + ), + "v1.payment_method.detached": ( + "stripe.events._v1_payment_method_detached_event", + "V1PaymentMethodDetachedEventNotification", + ), + "v1.payment_method.updated": ( + "stripe.events._v1_payment_method_updated_event", + "V1PaymentMethodUpdatedEventNotification", + ), + "v1.payout.canceled": ( + "stripe.events._v1_payout_canceled_event", + "V1PayoutCanceledEventNotification", + ), + "v1.payout.created": ( + "stripe.events._v1_payout_created_event", + "V1PayoutCreatedEventNotification", + ), + "v1.payout.failed": ( + "stripe.events._v1_payout_failed_event", + "V1PayoutFailedEventNotification", + ), + "v1.payout.paid": ( + "stripe.events._v1_payout_paid_event", + "V1PayoutPaidEventNotification", + ), + "v1.payout.reconciliation_completed": ( + "stripe.events._v1_payout_reconciliation_completed_event", + "V1PayoutReconciliationCompletedEventNotification", + ), + "v1.payout.updated": ( + "stripe.events._v1_payout_updated_event", + "V1PayoutUpdatedEventNotification", + ), + "v1.person.created": ( + "stripe.events._v1_person_created_event", + "V1PersonCreatedEventNotification", + ), + "v1.person.deleted": ( + "stripe.events._v1_person_deleted_event", + "V1PersonDeletedEventNotification", + ), + "v1.person.updated": ( + "stripe.events._v1_person_updated_event", + "V1PersonUpdatedEventNotification", + ), + "v1.plan.created": ( + "stripe.events._v1_plan_created_event", + "V1PlanCreatedEventNotification", + ), + "v1.plan.deleted": ( + "stripe.events._v1_plan_deleted_event", + "V1PlanDeletedEventNotification", + ), + "v1.plan.updated": ( + "stripe.events._v1_plan_updated_event", + "V1PlanUpdatedEventNotification", + ), + "v1.price.created": ( + "stripe.events._v1_price_created_event", + "V1PriceCreatedEventNotification", + ), + "v1.price.deleted": ( + "stripe.events._v1_price_deleted_event", + "V1PriceDeletedEventNotification", + ), + "v1.price.updated": ( + "stripe.events._v1_price_updated_event", + "V1PriceUpdatedEventNotification", + ), + "v1.product.created": ( + "stripe.events._v1_product_created_event", + "V1ProductCreatedEventNotification", + ), + "v1.product.deleted": ( + "stripe.events._v1_product_deleted_event", + "V1ProductDeletedEventNotification", + ), + "v1.product.updated": ( + "stripe.events._v1_product_updated_event", + "V1ProductUpdatedEventNotification", + ), + "v1.promotion_code.created": ( + "stripe.events._v1_promotion_code_created_event", + "V1PromotionCodeCreatedEventNotification", + ), + "v1.promotion_code.updated": ( + "stripe.events._v1_promotion_code_updated_event", + "V1PromotionCodeUpdatedEventNotification", + ), + "v1.quote.accepted": ( + "stripe.events._v1_quote_accepted_event", + "V1QuoteAcceptedEventNotification", + ), + "v1.quote.canceled": ( + "stripe.events._v1_quote_canceled_event", + "V1QuoteCanceledEventNotification", + ), + "v1.quote.created": ( + "stripe.events._v1_quote_created_event", + "V1QuoteCreatedEventNotification", + ), + "v1.quote.finalized": ( + "stripe.events._v1_quote_finalized_event", + "V1QuoteFinalizedEventNotification", + ), + "v1.radar.early_fraud_warning.created": ( + "stripe.events._v1_radar_early_fraud_warning_created_event", + "V1RadarEarlyFraudWarningCreatedEventNotification", + ), + "v1.radar.early_fraud_warning.updated": ( + "stripe.events._v1_radar_early_fraud_warning_updated_event", + "V1RadarEarlyFraudWarningUpdatedEventNotification", + ), + "v1.refund.created": ( + "stripe.events._v1_refund_created_event", + "V1RefundCreatedEventNotification", + ), + "v1.refund.failed": ( + "stripe.events._v1_refund_failed_event", + "V1RefundFailedEventNotification", + ), + "v1.refund.updated": ( + "stripe.events._v1_refund_updated_event", + "V1RefundUpdatedEventNotification", + ), + "v1.review.closed": ( + "stripe.events._v1_review_closed_event", + "V1ReviewClosedEventNotification", + ), + "v1.review.opened": ( + "stripe.events._v1_review_opened_event", + "V1ReviewOpenedEventNotification", + ), + "v1.setup_intent.canceled": ( + "stripe.events._v1_setup_intent_canceled_event", + "V1SetupIntentCanceledEventNotification", + ), + "v1.setup_intent.created": ( + "stripe.events._v1_setup_intent_created_event", + "V1SetupIntentCreatedEventNotification", + ), + "v1.setup_intent.requires_action": ( + "stripe.events._v1_setup_intent_requires_action_event", + "V1SetupIntentRequiresActionEventNotification", + ), + "v1.setup_intent.setup_failed": ( + "stripe.events._v1_setup_intent_setup_failed_event", + "V1SetupIntentSetupFailedEventNotification", + ), + "v1.setup_intent.succeeded": ( + "stripe.events._v1_setup_intent_succeeded_event", + "V1SetupIntentSucceededEventNotification", + ), + "v1.sigma.scheduled_query_run.created": ( + "stripe.events._v1_sigma_scheduled_query_run_created_event", + "V1SigmaScheduledQueryRunCreatedEventNotification", + ), + "v1.source.canceled": ( + "stripe.events._v1_source_canceled_event", + "V1SourceCanceledEventNotification", + ), + "v1.source.chargeable": ( + "stripe.events._v1_source_chargeable_event", + "V1SourceChargeableEventNotification", + ), + "v1.source.failed": ( + "stripe.events._v1_source_failed_event", + "V1SourceFailedEventNotification", + ), + "v1.source.refund_attributes_required": ( + "stripe.events._v1_source_refund_attributes_required_event", + "V1SourceRefundAttributesRequiredEventNotification", + ), + "v1.subscription_schedule.aborted": ( + "stripe.events._v1_subscription_schedule_aborted_event", + "V1SubscriptionScheduleAbortedEventNotification", + ), + "v1.subscription_schedule.canceled": ( + "stripe.events._v1_subscription_schedule_canceled_event", + "V1SubscriptionScheduleCanceledEventNotification", + ), + "v1.subscription_schedule.completed": ( + "stripe.events._v1_subscription_schedule_completed_event", + "V1SubscriptionScheduleCompletedEventNotification", + ), + "v1.subscription_schedule.created": ( + "stripe.events._v1_subscription_schedule_created_event", + "V1SubscriptionScheduleCreatedEventNotification", + ), + "v1.subscription_schedule.expiring": ( + "stripe.events._v1_subscription_schedule_expiring_event", + "V1SubscriptionScheduleExpiringEventNotification", + ), + "v1.subscription_schedule.released": ( + "stripe.events._v1_subscription_schedule_released_event", + "V1SubscriptionScheduleReleasedEventNotification", + ), + "v1.subscription_schedule.updated": ( + "stripe.events._v1_subscription_schedule_updated_event", + "V1SubscriptionScheduleUpdatedEventNotification", + ), + "v1.tax_rate.created": ( + "stripe.events._v1_tax_rate_created_event", + "V1TaxRateCreatedEventNotification", + ), + "v1.tax_rate.updated": ( + "stripe.events._v1_tax_rate_updated_event", + "V1TaxRateUpdatedEventNotification", + ), + "v1.tax.settings.updated": ( + "stripe.events._v1_tax_settings_updated_event", + "V1TaxSettingsUpdatedEventNotification", + ), + "v1.terminal.reader.action_failed": ( + "stripe.events._v1_terminal_reader_action_failed_event", + "V1TerminalReaderActionFailedEventNotification", + ), + "v1.terminal.reader.action_succeeded": ( + "stripe.events._v1_terminal_reader_action_succeeded_event", + "V1TerminalReaderActionSucceededEventNotification", + ), + "v1.terminal.reader.action_updated": ( + "stripe.events._v1_terminal_reader_action_updated_event", + "V1TerminalReaderActionUpdatedEventNotification", + ), + "v1.test_helpers.test_clock.advancing": ( + "stripe.events._v1_test_helpers_test_clock_advancing_event", + "V1TestHelpersTestClockAdvancingEventNotification", + ), + "v1.test_helpers.test_clock.created": ( + "stripe.events._v1_test_helpers_test_clock_created_event", + "V1TestHelpersTestClockCreatedEventNotification", + ), + "v1.test_helpers.test_clock.deleted": ( + "stripe.events._v1_test_helpers_test_clock_deleted_event", + "V1TestHelpersTestClockDeletedEventNotification", + ), + "v1.test_helpers.test_clock.internal_failure": ( + "stripe.events._v1_test_helpers_test_clock_internal_failure_event", + "V1TestHelpersTestClockInternalFailureEventNotification", + ), + "v1.test_helpers.test_clock.ready": ( + "stripe.events._v1_test_helpers_test_clock_ready_event", + "V1TestHelpersTestClockReadyEventNotification", + ), + "v1.topup.canceled": ( + "stripe.events._v1_topup_canceled_event", + "V1TopupCanceledEventNotification", + ), + "v1.topup.created": ( + "stripe.events._v1_topup_created_event", + "V1TopupCreatedEventNotification", + ), + "v1.topup.failed": ( + "stripe.events._v1_topup_failed_event", + "V1TopupFailedEventNotification", + ), + "v1.topup.reversed": ( + "stripe.events._v1_topup_reversed_event", + "V1TopupReversedEventNotification", + ), + "v1.topup.succeeded": ( + "stripe.events._v1_topup_succeeded_event", + "V1TopupSucceededEventNotification", + ), + "v1.transfer.created": ( + "stripe.events._v1_transfer_created_event", + "V1TransferCreatedEventNotification", + ), + "v1.transfer.reversed": ( + "stripe.events._v1_transfer_reversed_event", + "V1TransferReversedEventNotification", + ), + "v1.transfer.updated": ( + "stripe.events._v1_transfer_updated_event", + "V1TransferUpdatedEventNotification", + ), "v2.billing.cadence.billed": ( "stripe.events._v2_billing_cadence_billed_event", "V2BillingCadenceBilledEventNotification", @@ -1449,6 +3764,22 @@ def get_v2_event_class(type_: str): "stripe.events._v2_billing_rate_card_version_created_event", "V2BillingRateCardVersionCreatedEventNotification", ), + "v2.commerce.product_catalog.imports.failed": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + "V2CommerceProductCatalogImportsFailedEventNotification", + ), + "v2.commerce.product_catalog.imports.processing": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + "V2CommerceProductCatalogImportsProcessingEventNotification", + ), + "v2.commerce.product_catalog.imports.succeeded": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + "V2CommerceProductCatalogImportsSucceededEventNotification", + ), + "v2.commerce.product_catalog.imports.succeeded_with_errors": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification", + ), "v2.core.account.closed": ( "stripe.events._v2_core_account_closed_event", "V2CoreAccountClosedEventNotification", @@ -1537,6 +3868,26 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_account_updated_event", "V2CoreAccountUpdatedEventNotification", ), + "v2.core.approval_request.approved": ( + "stripe.events._v2_core_approval_request_approved_event", + "V2CoreApprovalRequestApprovedEventNotification", + ), + "v2.core.approval_request.canceled": ( + "stripe.events._v2_core_approval_request_canceled_event", + "V2CoreApprovalRequestCanceledEventNotification", + ), + "v2.core.approval_request.failed": ( + "stripe.events._v2_core_approval_request_failed_event", + "V2CoreApprovalRequestFailedEventNotification", + ), + "v2.core.approval_request.rejected": ( + "stripe.events._v2_core_approval_request_rejected_event", + "V2CoreApprovalRequestRejectedEventNotification", + ), + "v2.core.approval_request.succeeded": ( + "stripe.events._v2_core_approval_request_succeeded_event", + "V2CoreApprovalRequestSucceededEventNotification", + ), "v2.core.batch_job.batch_failed": ( "stripe.events._v2_core_batch_job_batch_failed_event", "V2CoreBatchJobBatchFailedEventNotification", @@ -1593,9 +3944,9 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_claimable_sandbox_expiring_event", "V2CoreClaimableSandboxExpiringEventNotification", ), - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated": ( - "stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event", - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification", + "v2.core.claimable_sandbox.updated": ( + "stripe.events._v2_core_claimable_sandbox_updated_event", + "V2CoreClaimableSandboxUpdatedEventNotification", ), "v2.core.event_destination.ping": ( "stripe.events._v2_core_event_destination_ping_event", @@ -1649,6 +4000,14 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_health_issuing_authorization_request_timeout_resolved_event", "V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification", ), + "v2.core.health.meter_event_summaries_delayed.firing": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_firing_event", + "V2CoreHealthMeterEventSummariesDelayedFiringEventNotification", + ), + "v2.core.health.meter_event_summaries_delayed.resolved": ( + "stripe.events._v2_core_health_meter_event_summaries_delayed_resolved_event", + "V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification", + ), "v2.core.health.payment_method_error.firing": ( "stripe.events._v2_core_health_payment_method_error_firing_event", "V2CoreHealthPaymentMethodErrorFiringEventNotification", @@ -1697,6 +4056,18 @@ def get_v2_event_class(type_: str): "stripe.events._v2_data_reporting_query_run_updated_event", "V2DataReportingQueryRunUpdatedEventNotification", ), + "v2.extend.workflow_run.failed": ( + "stripe.events._v2_extend_workflow_run_failed_event", + "V2ExtendWorkflowRunFailedEventNotification", + ), + "v2.extend.workflow_run.started": ( + "stripe.events._v2_extend_workflow_run_started_event", + "V2ExtendWorkflowRunStartedEventNotification", + ), + "v2.extend.workflow_run.succeeded": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + "V2ExtendWorkflowRunSucceededEventNotification", + ), "v2.iam.api_key.created": ( "stripe.events._v2_iam_api_key_created_event", "V2IamApiKeyCreatedEventNotification", @@ -1897,6 +4268,22 @@ def get_v2_event_class(type_: str): "stripe.events._v2_money_management_transaction_updated_event", "V2MoneyManagementTransactionUpdatedEventNotification", ), + "v2.orchestrated_commerce.agreement.confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + "V2OrchestratedCommerceAgreementConfirmedEventNotification", + ), + "v2.orchestrated_commerce.agreement.created": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + "V2OrchestratedCommerceAgreementCreatedEventNotification", + ), + "v2.orchestrated_commerce.agreement.partially_confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification", + ), + "v2.orchestrated_commerce.agreement.terminated": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + "V2OrchestratedCommerceAgreementTerminatedEventNotification", + ), "v2.payments.off_session_payment.attempt_failed": ( "stripe.events._v2_payments_off_session_payment_attempt_failed_event", "V2PaymentsOffSessionPaymentAttemptFailedEventNotification", @@ -2020,9 +4407,208 @@ def get_v2_event_notification_class(type_: str): ALL_EVENT_NOTIFICATIONS = Union[ + "V1AccountApplicationAuthorizedEventNotification", + "V1AccountApplicationDeauthorizedEventNotification", + "V1AccountExternalAccountCreatedEventNotification", + "V1AccountExternalAccountDeletedEventNotification", + "V1AccountExternalAccountUpdatedEventNotification", "V1AccountSignalsIncludingDelinquencyCreatedEventNotification", + "V1AccountUpdatedEventNotification", + "V1ApplicationFeeCreatedEventNotification", + "V1ApplicationFeeRefundedEventNotification", + "V1ApplicationFeeRefundUpdatedEventNotification", + "V1BalanceAvailableEventNotification", + "V1BillingAlertTriggeredEventNotification", "V1BillingMeterErrorReportTriggeredEventNotification", "V1BillingMeterNoMeterFoundEventNotification", + "V1BillingPortalConfigurationCreatedEventNotification", + "V1BillingPortalConfigurationUpdatedEventNotification", + "V1BillingPortalSessionCreatedEventNotification", + "V1CapabilityUpdatedEventNotification", + "V1CashBalanceFundsAvailableEventNotification", + "V1ChargeCapturedEventNotification", + "V1ChargeDisputeClosedEventNotification", + "V1ChargeDisputeCreatedEventNotification", + "V1ChargeDisputeFundsReinstatedEventNotification", + "V1ChargeDisputeFundsWithdrawnEventNotification", + "V1ChargeDisputeUpdatedEventNotification", + "V1ChargeExpiredEventNotification", + "V1ChargeFailedEventNotification", + "V1ChargePendingEventNotification", + "V1ChargeRefundedEventNotification", + "V1ChargeRefundUpdatedEventNotification", + "V1ChargeSucceededEventNotification", + "V1ChargeUpdatedEventNotification", + "V1CheckoutSessionAsyncPaymentFailedEventNotification", + "V1CheckoutSessionAsyncPaymentSucceededEventNotification", + "V1CheckoutSessionCompletedEventNotification", + "V1CheckoutSessionExpiredEventNotification", + "V1ClimateOrderCanceledEventNotification", + "V1ClimateOrderCreatedEventNotification", + "V1ClimateOrderDelayedEventNotification", + "V1ClimateOrderDeliveredEventNotification", + "V1ClimateOrderProductSubstitutedEventNotification", + "V1ClimateProductCreatedEventNotification", + "V1ClimateProductPricingUpdatedEventNotification", + "V1CouponCreatedEventNotification", + "V1CouponDeletedEventNotification", + "V1CouponUpdatedEventNotification", + "V1CreditNoteCreatedEventNotification", + "V1CreditNoteUpdatedEventNotification", + "V1CreditNoteVoidedEventNotification", + "V1CustomerCashBalanceTransactionCreatedEventNotification", + "V1CustomerCreatedEventNotification", + "V1CustomerDeletedEventNotification", + "V1CustomerSubscriptionCreatedEventNotification", + "V1CustomerSubscriptionDeletedEventNotification", + "V1CustomerSubscriptionPausedEventNotification", + "V1CustomerSubscriptionPendingUpdateAppliedEventNotification", + "V1CustomerSubscriptionPendingUpdateExpiredEventNotification", + "V1CustomerSubscriptionResumedEventNotification", + "V1CustomerSubscriptionTrialWillEndEventNotification", + "V1CustomerSubscriptionUpdatedEventNotification", + "V1CustomerTaxIdCreatedEventNotification", + "V1CustomerTaxIdDeletedEventNotification", + "V1CustomerTaxIdUpdatedEventNotification", + "V1CustomerUpdatedEventNotification", + "V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification", + "V1FileCreatedEventNotification", + "V1FinancialConnectionsAccountCreatedEventNotification", + "V1FinancialConnectionsAccountDeactivatedEventNotification", + "V1FinancialConnectionsAccountDisconnectedEventNotification", + "V1FinancialConnectionsAccountReactivatedEventNotification", + "V1FinancialConnectionsAccountRefreshedBalanceEventNotification", + "V1FinancialConnectionsAccountRefreshedOwnershipEventNotification", + "V1FinancialConnectionsAccountRefreshedTransactionsEventNotification", + "V1IdentityVerificationSessionCanceledEventNotification", + "V1IdentityVerificationSessionCreatedEventNotification", + "V1IdentityVerificationSessionProcessingEventNotification", + "V1IdentityVerificationSessionRedactedEventNotification", + "V1IdentityVerificationSessionRequiresInputEventNotification", + "V1IdentityVerificationSessionVerifiedEventNotification", + "V1InvoiceCreatedEventNotification", + "V1InvoiceDeletedEventNotification", + "V1InvoiceFinalizationFailedEventNotification", + "V1InvoiceFinalizedEventNotification", + "V1InvoiceitemCreatedEventNotification", + "V1InvoiceitemDeletedEventNotification", + "V1InvoiceMarkedUncollectibleEventNotification", + "V1InvoiceOverdueEventNotification", + "V1InvoiceOverpaidEventNotification", + "V1InvoicePaidEventNotification", + "V1InvoicePaymentActionRequiredEventNotification", + "V1InvoicePaymentFailedEventNotification", + "V1InvoicePaymentPaidEventNotification", + "V1InvoicePaymentSucceededEventNotification", + "V1InvoiceSentEventNotification", + "V1InvoiceUpcomingEventNotification", + "V1InvoiceUpdatedEventNotification", + "V1InvoiceVoidedEventNotification", + "V1InvoiceWillBeDueEventNotification", + "V1IssuingAuthorizationCreatedEventNotification", + "V1IssuingAuthorizationRequestEventNotification", + "V1IssuingAuthorizationUpdatedEventNotification", + "V1IssuingCardCreatedEventNotification", + "V1IssuingCardholderCreatedEventNotification", + "V1IssuingCardholderUpdatedEventNotification", + "V1IssuingCardUpdatedEventNotification", + "V1IssuingDisputeClosedEventNotification", + "V1IssuingDisputeCreatedEventNotification", + "V1IssuingDisputeFundsReinstatedEventNotification", + "V1IssuingDisputeFundsRescindedEventNotification", + "V1IssuingDisputeSubmittedEventNotification", + "V1IssuingDisputeUpdatedEventNotification", + "V1IssuingPersonalizationDesignActivatedEventNotification", + "V1IssuingPersonalizationDesignDeactivatedEventNotification", + "V1IssuingPersonalizationDesignRejectedEventNotification", + "V1IssuingPersonalizationDesignUpdatedEventNotification", + "V1IssuingTokenCreatedEventNotification", + "V1IssuingTokenUpdatedEventNotification", + "V1IssuingTransactionCreatedEventNotification", + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification", + "V1IssuingTransactionUpdatedEventNotification", + "V1MandateUpdatedEventNotification", + "V1PaymentIntentAmountCapturableUpdatedEventNotification", + "V1PaymentIntentCanceledEventNotification", + "V1PaymentIntentCreatedEventNotification", + "V1PaymentIntentPartiallyFundedEventNotification", + "V1PaymentIntentPaymentFailedEventNotification", + "V1PaymentIntentProcessingEventNotification", + "V1PaymentIntentRequiresActionEventNotification", + "V1PaymentIntentSucceededEventNotification", + "V1PaymentLinkCreatedEventNotification", + "V1PaymentLinkUpdatedEventNotification", + "V1PaymentMethodAttachedEventNotification", + "V1PaymentMethodAutomaticallyUpdatedEventNotification", + "V1PaymentMethodDetachedEventNotification", + "V1PaymentMethodUpdatedEventNotification", + "V1PayoutCanceledEventNotification", + "V1PayoutCreatedEventNotification", + "V1PayoutFailedEventNotification", + "V1PayoutPaidEventNotification", + "V1PayoutReconciliationCompletedEventNotification", + "V1PayoutUpdatedEventNotification", + "V1PersonCreatedEventNotification", + "V1PersonDeletedEventNotification", + "V1PersonUpdatedEventNotification", + "V1PlanCreatedEventNotification", + "V1PlanDeletedEventNotification", + "V1PlanUpdatedEventNotification", + "V1PriceCreatedEventNotification", + "V1PriceDeletedEventNotification", + "V1PriceUpdatedEventNotification", + "V1ProductCreatedEventNotification", + "V1ProductDeletedEventNotification", + "V1ProductUpdatedEventNotification", + "V1PromotionCodeCreatedEventNotification", + "V1PromotionCodeUpdatedEventNotification", + "V1QuoteAcceptedEventNotification", + "V1QuoteCanceledEventNotification", + "V1QuoteCreatedEventNotification", + "V1QuoteFinalizedEventNotification", + "V1RadarEarlyFraudWarningCreatedEventNotification", + "V1RadarEarlyFraudWarningUpdatedEventNotification", + "V1RefundCreatedEventNotification", + "V1RefundFailedEventNotification", + "V1RefundUpdatedEventNotification", + "V1ReviewClosedEventNotification", + "V1ReviewOpenedEventNotification", + "V1SetupIntentCanceledEventNotification", + "V1SetupIntentCreatedEventNotification", + "V1SetupIntentRequiresActionEventNotification", + "V1SetupIntentSetupFailedEventNotification", + "V1SetupIntentSucceededEventNotification", + "V1SigmaScheduledQueryRunCreatedEventNotification", + "V1SourceCanceledEventNotification", + "V1SourceChargeableEventNotification", + "V1SourceFailedEventNotification", + "V1SourceRefundAttributesRequiredEventNotification", + "V1SubscriptionScheduleAbortedEventNotification", + "V1SubscriptionScheduleCanceledEventNotification", + "V1SubscriptionScheduleCompletedEventNotification", + "V1SubscriptionScheduleCreatedEventNotification", + "V1SubscriptionScheduleExpiringEventNotification", + "V1SubscriptionScheduleReleasedEventNotification", + "V1SubscriptionScheduleUpdatedEventNotification", + "V1TaxRateCreatedEventNotification", + "V1TaxRateUpdatedEventNotification", + "V1TaxSettingsUpdatedEventNotification", + "V1TerminalReaderActionFailedEventNotification", + "V1TerminalReaderActionSucceededEventNotification", + "V1TerminalReaderActionUpdatedEventNotification", + "V1TestHelpersTestClockAdvancingEventNotification", + "V1TestHelpersTestClockCreatedEventNotification", + "V1TestHelpersTestClockDeletedEventNotification", + "V1TestHelpersTestClockInternalFailureEventNotification", + "V1TestHelpersTestClockReadyEventNotification", + "V1TopupCanceledEventNotification", + "V1TopupCreatedEventNotification", + "V1TopupFailedEventNotification", + "V1TopupReversedEventNotification", + "V1TopupSucceededEventNotification", + "V1TransferCreatedEventNotification", + "V1TransferReversedEventNotification", + "V1TransferUpdatedEventNotification", "V2BillingCadenceBilledEventNotification", "V2BillingCadenceCanceledEventNotification", "V2BillingCadenceCreatedEventNotification", @@ -2061,6 +4647,10 @@ def get_v2_event_notification_class(type_: str): "V2BillingRateCardSubscriptionServicingPausedEventNotification", "V2BillingRateCardUpdatedEventNotification", "V2BillingRateCardVersionCreatedEventNotification", + "V2CommerceProductCatalogImportsFailedEventNotification", + "V2CommerceProductCatalogImportsProcessingEventNotification", + "V2CommerceProductCatalogImportsSucceededEventNotification", + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification", "V2CoreAccountClosedEventNotification", "V2CoreAccountCreatedEventNotification", "V2CoreAccountIncludingConfigurationCardCreatorCapabilityStatusUpdatedEventNotification", @@ -2083,6 +4673,11 @@ def get_v2_event_notification_class(type_: str): "V2CoreAccountPersonUpdatedEventNotification", "V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification", "V2CoreAccountUpdatedEventNotification", + "V2CoreApprovalRequestApprovedEventNotification", + "V2CoreApprovalRequestCanceledEventNotification", + "V2CoreApprovalRequestFailedEventNotification", + "V2CoreApprovalRequestRejectedEventNotification", + "V2CoreApprovalRequestSucceededEventNotification", "V2CoreBatchJobBatchFailedEventNotification", "V2CoreBatchJobCanceledEventNotification", "V2CoreBatchJobCompletedEventNotification", @@ -2097,7 +4692,7 @@ def get_v2_event_notification_class(type_: str): "V2CoreClaimableSandboxCreatedEventNotification", "V2CoreClaimableSandboxExpiredEventNotification", "V2CoreClaimableSandboxExpiringEventNotification", - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification", + "V2CoreClaimableSandboxUpdatedEventNotification", "V2CoreEventDestinationPingEventNotification", "V2CoreHealthApiErrorFiringEventNotification", "V2CoreHealthApiErrorResolvedEventNotification", @@ -2111,6 +4706,8 @@ def get_v2_event_notification_class(type_: str): "V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEventNotification", "V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEventNotification", "V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEventNotification", + "V2CoreHealthMeterEventSummariesDelayedFiringEventNotification", + "V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification", "V2CoreHealthPaymentMethodErrorFiringEventNotification", "V2CoreHealthPaymentMethodErrorResolvedEventNotification", "V2CoreHealthSepaDebitDelayedFiringEventNotification", @@ -2123,6 +4720,9 @@ def get_v2_event_notification_class(type_: str): "V2DataReportingQueryRunFailedEventNotification", "V2DataReportingQueryRunSucceededEventNotification", "V2DataReportingQueryRunUpdatedEventNotification", + "V2ExtendWorkflowRunFailedEventNotification", + "V2ExtendWorkflowRunStartedEventNotification", + "V2ExtendWorkflowRunSucceededEventNotification", "V2IamApiKeyCreatedEventNotification", "V2IamApiKeyDefaultSecretRevealedEventNotification", "V2IamApiKeyExpiredEventNotification", @@ -2173,6 +4773,10 @@ def get_v2_event_notification_class(type_: str): "V2MoneyManagementRecipientVerificationUpdatedEventNotification", "V2MoneyManagementTransactionCreatedEventNotification", "V2MoneyManagementTransactionUpdatedEventNotification", + "V2OrchestratedCommerceAgreementConfirmedEventNotification", + "V2OrchestratedCommerceAgreementCreatedEventNotification", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification", + "V2OrchestratedCommerceAgreementTerminatedEventNotification", "V2PaymentsOffSessionPaymentAttemptFailedEventNotification", "V2PaymentsOffSessionPaymentAttemptStartedEventNotification", "V2PaymentsOffSessionPaymentAuthorizationAttemptFailedEventNotification", diff --git a/stripe/events/_v1_account_application_authorized_event.py b/stripe/events/_v1_account_application_authorized_event.py new file mode 100644 index 000000000..c261c229b --- /dev/null +++ b/stripe/events/_v1_account_application_authorized_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1AccountApplicationAuthorizedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.application.authorized" + type: Literal["v1.account.application.authorized"] + + @override + def fetch_event(self) -> "V1AccountApplicationAuthorizedEvent": + return cast( + "V1AccountApplicationAuthorizedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V1AccountApplicationAuthorizedEvent": + return cast( + "V1AccountApplicationAuthorizedEvent", + await super().fetch_event_async(), + ) + + +class V1AccountApplicationAuthorizedEvent(Event): + LOOKUP_TYPE = "v1.account.application.authorized" + type: Literal["v1.account.application.authorized"] diff --git a/stripe/events/_v1_account_application_deauthorized_event.py b/stripe/events/_v1_account_application_deauthorized_event.py new file mode 100644 index 000000000..1f9400eb5 --- /dev/null +++ b/stripe/events/_v1_account_application_deauthorized_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1AccountApplicationDeauthorizedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.application.deauthorized" + type: Literal["v1.account.application.deauthorized"] + + @override + def fetch_event(self) -> "V1AccountApplicationDeauthorizedEvent": + return cast( + "V1AccountApplicationDeauthorizedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1AccountApplicationDeauthorizedEvent": + return cast( + "V1AccountApplicationDeauthorizedEvent", + await super().fetch_event_async(), + ) + + +class V1AccountApplicationDeauthorizedEvent(Event): + LOOKUP_TYPE = "v1.account.application.deauthorized" + type: Literal["v1.account.application.deauthorized"] diff --git a/stripe/events/_v1_account_external_account_created_event.py b/stripe/events/_v1_account_external_account_created_event.py new file mode 100644 index 000000000..ccfe8fcef --- /dev/null +++ b/stripe/events/_v1_account_external_account_created_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1AccountExternalAccountCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.external_account.created" + type: Literal["v1.account.external_account.created"] + + @override + def fetch_event(self) -> "V1AccountExternalAccountCreatedEvent": + return cast( + "V1AccountExternalAccountCreatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1AccountExternalAccountCreatedEvent": + return cast( + "V1AccountExternalAccountCreatedEvent", + await super().fetch_event_async(), + ) + + +class V1AccountExternalAccountCreatedEvent(Event): + LOOKUP_TYPE = "v1.account.external_account.created" + type: Literal["v1.account.external_account.created"] diff --git a/stripe/events/_v1_account_external_account_deleted_event.py b/stripe/events/_v1_account_external_account_deleted_event.py new file mode 100644 index 000000000..c91f46bbf --- /dev/null +++ b/stripe/events/_v1_account_external_account_deleted_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1AccountExternalAccountDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.external_account.deleted" + type: Literal["v1.account.external_account.deleted"] + + @override + def fetch_event(self) -> "V1AccountExternalAccountDeletedEvent": + return cast( + "V1AccountExternalAccountDeletedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1AccountExternalAccountDeletedEvent": + return cast( + "V1AccountExternalAccountDeletedEvent", + await super().fetch_event_async(), + ) + + +class V1AccountExternalAccountDeletedEvent(Event): + LOOKUP_TYPE = "v1.account.external_account.deleted" + type: Literal["v1.account.external_account.deleted"] diff --git a/stripe/events/_v1_account_external_account_updated_event.py b/stripe/events/_v1_account_external_account_updated_event.py new file mode 100644 index 000000000..d8e2b85e6 --- /dev/null +++ b/stripe/events/_v1_account_external_account_updated_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1AccountExternalAccountUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.external_account.updated" + type: Literal["v1.account.external_account.updated"] + + @override + def fetch_event(self) -> "V1AccountExternalAccountUpdatedEvent": + return cast( + "V1AccountExternalAccountUpdatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1AccountExternalAccountUpdatedEvent": + return cast( + "V1AccountExternalAccountUpdatedEvent", + await super().fetch_event_async(), + ) + + +class V1AccountExternalAccountUpdatedEvent(Event): + LOOKUP_TYPE = "v1.account.external_account.updated" + type: Literal["v1.account.external_account.updated"] diff --git a/stripe/events/_v1_account_updated_event.py b/stripe/events/_v1_account_updated_event.py new file mode 100644 index 000000000..e9b758deb --- /dev/null +++ b/stripe/events/_v1_account_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._stripe_client import StripeClient + + +class V1AccountUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.account.updated" + type: Literal["v1.account.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1AccountUpdatedEvent": + return cast( + "V1AccountUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1AccountUpdatedEvent": + return cast( + "V1AccountUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1AccountUpdatedEvent(Event): + LOOKUP_TYPE = "v1.account.updated" + type: Literal["v1.account.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_application_fee_created_event.py b/stripe/events/_v1_application_fee_created_event.py new file mode 100644 index 000000000..59f308009 --- /dev/null +++ b/stripe/events/_v1_application_fee_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._application_fee import ApplicationFee + from stripe._stripe_client import StripeClient + + +class V1ApplicationFeeCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.application_fee.created" + type: Literal["v1.application_fee.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ApplicationFeeCreatedEvent": + return cast( + "V1ApplicationFeeCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApplicationFee": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFee", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ApplicationFeeCreatedEvent": + return cast( + "V1ApplicationFeeCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApplicationFee": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFee", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ApplicationFeeCreatedEvent(Event): + LOOKUP_TYPE = "v1.application_fee.created" + type: Literal["v1.application_fee.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApplicationFee": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApplicationFee", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_application_fee_refund_updated_event.py b/stripe/events/_v1_application_fee_refund_updated_event.py new file mode 100644 index 000000000..36386edf1 --- /dev/null +++ b/stripe/events/_v1_application_fee_refund_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._application_fee_refund import ApplicationFeeRefund + from stripe._stripe_client import StripeClient + + +class V1ApplicationFeeRefundUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.application_fee.refund.updated" + type: Literal["v1.application_fee.refund.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ApplicationFeeRefundUpdatedEvent": + return cast( + "V1ApplicationFeeRefundUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApplicationFeeRefund": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFeeRefund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ApplicationFeeRefundUpdatedEvent": + return cast( + "V1ApplicationFeeRefundUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApplicationFeeRefund": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFeeRefund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ApplicationFeeRefundUpdatedEvent(Event): + LOOKUP_TYPE = "v1.application_fee.refund.updated" + type: Literal["v1.application_fee.refund.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApplicationFeeRefund": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApplicationFeeRefund", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_application_fee_refunded_event.py b/stripe/events/_v1_application_fee_refunded_event.py new file mode 100644 index 000000000..21a06e71c --- /dev/null +++ b/stripe/events/_v1_application_fee_refunded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._application_fee import ApplicationFee + from stripe._stripe_client import StripeClient + + +class V1ApplicationFeeRefundedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.application_fee.refunded" + type: Literal["v1.application_fee.refunded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ApplicationFeeRefundedEvent": + return cast( + "V1ApplicationFeeRefundedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApplicationFee": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFee", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ApplicationFeeRefundedEvent": + return cast( + "V1ApplicationFeeRefundedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApplicationFee": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApplicationFee", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ApplicationFeeRefundedEvent(Event): + LOOKUP_TYPE = "v1.application_fee.refunded" + type: Literal["v1.application_fee.refunded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApplicationFee": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApplicationFee", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_balance_available_event.py b/stripe/events/_v1_balance_available_event.py new file mode 100644 index 000000000..7affcbad7 --- /dev/null +++ b/stripe/events/_v1_balance_available_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._balance import Balance + from stripe._stripe_client import StripeClient + + +class V1BalanceAvailableEventNotification(EventNotification): + LOOKUP_TYPE = "v1.balance.available" + type: Literal["v1.balance.available"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1BalanceAvailableEvent": + return cast( + "V1BalanceAvailableEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Balance": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Balance", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BalanceAvailableEvent": + return cast( + "V1BalanceAvailableEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Balance": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Balance", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BalanceAvailableEvent(Event): + LOOKUP_TYPE = "v1.balance.available" + type: Literal["v1.balance.available"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Balance": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Balance", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_billing_alert_triggered_event.py b/stripe/events/_v1_billing_alert_triggered_event.py new file mode 100644 index 000000000..4630da4b6 --- /dev/null +++ b/stripe/events/_v1_billing_alert_triggered_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.billing._alert import Alert + + +class V1BillingAlertTriggeredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.alert.triggered" + type: Literal["v1.billing.alert.triggered"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1BillingAlertTriggeredEvent": + return cast( + "V1BillingAlertTriggeredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Alert": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Alert", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingAlertTriggeredEvent": + return cast( + "V1BillingAlertTriggeredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Alert": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Alert", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingAlertTriggeredEvent(Event): + LOOKUP_TYPE = "v1.billing.alert.triggered" + type: Literal["v1.billing.alert.triggered"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Alert": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Alert", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index 4162d1af4..1005073d5 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -107,6 +107,7 @@ class Request(StripeObject): "meter_event_dimension_count_too_high", "meter_event_invalid_value", "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", "missing_dimension_payload_keys", "no_meter", "timestamp_in_future", diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index 32b79f0e6..9e4363394 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -60,6 +60,7 @@ class Request(StripeObject): "meter_event_dimension_count_too_high", "meter_event_invalid_value", "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", "missing_dimension_payload_keys", "no_meter", "timestamp_in_future", diff --git a/stripe/events/_v1_billing_portal_configuration_created_event.py b/stripe/events/_v1_billing_portal_configuration_created_event.py new file mode 100644 index 000000000..5683269b9 --- /dev/null +++ b/stripe/events/_v1_billing_portal_configuration_created_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.billing_portal._configuration import Configuration + + +class V1BillingPortalConfigurationCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing_portal.configuration.created" + type: Literal["v1.billing_portal.configuration.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1BillingPortalConfigurationCreatedEvent": + return cast( + "V1BillingPortalConfigurationCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Configuration": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Configuration", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1BillingPortalConfigurationCreatedEvent": + return cast( + "V1BillingPortalConfigurationCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Configuration": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Configuration", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingPortalConfigurationCreatedEvent(Event): + LOOKUP_TYPE = "v1.billing_portal.configuration.created" + type: Literal["v1.billing_portal.configuration.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Configuration": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Configuration", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_billing_portal_configuration_updated_event.py b/stripe/events/_v1_billing_portal_configuration_updated_event.py new file mode 100644 index 000000000..2fb47f4b2 --- /dev/null +++ b/stripe/events/_v1_billing_portal_configuration_updated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.billing_portal._configuration import Configuration + + +class V1BillingPortalConfigurationUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing_portal.configuration.updated" + type: Literal["v1.billing_portal.configuration.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1BillingPortalConfigurationUpdatedEvent": + return cast( + "V1BillingPortalConfigurationUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Configuration": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Configuration", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1BillingPortalConfigurationUpdatedEvent": + return cast( + "V1BillingPortalConfigurationUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Configuration": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Configuration", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingPortalConfigurationUpdatedEvent(Event): + LOOKUP_TYPE = "v1.billing_portal.configuration.updated" + type: Literal["v1.billing_portal.configuration.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Configuration": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Configuration", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_billing_portal_session_created_event.py b/stripe/events/_v1_billing_portal_session_created_event.py new file mode 100644 index 000000000..d03a79c70 --- /dev/null +++ b/stripe/events/_v1_billing_portal_session_created_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1BillingPortalSessionCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing_portal.session.created" + type: Literal["v1.billing_portal.session.created"] + + @override + def fetch_event(self) -> "V1BillingPortalSessionCreatedEvent": + return cast( + "V1BillingPortalSessionCreatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V1BillingPortalSessionCreatedEvent": + return cast( + "V1BillingPortalSessionCreatedEvent", + await super().fetch_event_async(), + ) + + +class V1BillingPortalSessionCreatedEvent(Event): + LOOKUP_TYPE = "v1.billing_portal.session.created" + type: Literal["v1.billing_portal.session.created"] diff --git a/stripe/events/_v1_capability_updated_event.py b/stripe/events/_v1_capability_updated_event.py new file mode 100644 index 000000000..c11d10421 --- /dev/null +++ b/stripe/events/_v1_capability_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._capability import Capability + from stripe._stripe_client import StripeClient + + +class V1CapabilityUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.capability.updated" + type: Literal["v1.capability.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CapabilityUpdatedEvent": + return cast( + "V1CapabilityUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Capability": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Capability", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CapabilityUpdatedEvent": + return cast( + "V1CapabilityUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Capability": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Capability", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CapabilityUpdatedEvent(Event): + LOOKUP_TYPE = "v1.capability.updated" + type: Literal["v1.capability.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Capability": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Capability", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_cash_balance_funds_available_event.py b/stripe/events/_v1_cash_balance_funds_available_event.py new file mode 100644 index 000000000..325ddc076 --- /dev/null +++ b/stripe/events/_v1_cash_balance_funds_available_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._cash_balance import CashBalance + from stripe._stripe_client import StripeClient + + +class V1CashBalanceFundsAvailableEventNotification(EventNotification): + LOOKUP_TYPE = "v1.cash_balance.funds_available" + type: Literal["v1.cash_balance.funds_available"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CashBalanceFundsAvailableEvent": + return cast( + "V1CashBalanceFundsAvailableEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CashBalance": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CashBalance", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CashBalanceFundsAvailableEvent": + return cast( + "V1CashBalanceFundsAvailableEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CashBalance": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CashBalance", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CashBalanceFundsAvailableEvent(Event): + LOOKUP_TYPE = "v1.cash_balance.funds_available" + type: Literal["v1.cash_balance.funds_available"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "CashBalance": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CashBalance", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_captured_event.py b/stripe/events/_v1_charge_captured_event.py new file mode 100644 index 000000000..3f40d04b6 --- /dev/null +++ b/stripe/events/_v1_charge_captured_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeCapturedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.captured" + type: Literal["v1.charge.captured"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeCapturedEvent": + return cast( + "V1ChargeCapturedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeCapturedEvent": + return cast( + "V1ChargeCapturedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeCapturedEvent(Event): + LOOKUP_TYPE = "v1.charge.captured" + type: Literal["v1.charge.captured"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_dispute_closed_event.py b/stripe/events/_v1_charge_dispute_closed_event.py new file mode 100644 index 000000000..3d0da2bcd --- /dev/null +++ b/stripe/events/_v1_charge_dispute_closed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._dispute import Dispute + from stripe._stripe_client import StripeClient + + +class V1ChargeDisputeClosedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.dispute.closed" + type: Literal["v1.charge.dispute.closed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeDisputeClosedEvent": + return cast( + "V1ChargeDisputeClosedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeDisputeClosedEvent": + return cast( + "V1ChargeDisputeClosedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeDisputeClosedEvent(Event): + LOOKUP_TYPE = "v1.charge.dispute.closed" + type: Literal["v1.charge.dispute.closed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_dispute_created_event.py b/stripe/events/_v1_charge_dispute_created_event.py new file mode 100644 index 000000000..e7b109c95 --- /dev/null +++ b/stripe/events/_v1_charge_dispute_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._dispute import Dispute + from stripe._stripe_client import StripeClient + + +class V1ChargeDisputeCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.dispute.created" + type: Literal["v1.charge.dispute.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeDisputeCreatedEvent": + return cast( + "V1ChargeDisputeCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeDisputeCreatedEvent": + return cast( + "V1ChargeDisputeCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeDisputeCreatedEvent(Event): + LOOKUP_TYPE = "v1.charge.dispute.created" + type: Literal["v1.charge.dispute.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_dispute_funds_reinstated_event.py b/stripe/events/_v1_charge_dispute_funds_reinstated_event.py new file mode 100644 index 000000000..31f9efb48 --- /dev/null +++ b/stripe/events/_v1_charge_dispute_funds_reinstated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._dispute import Dispute + from stripe._stripe_client import StripeClient + + +class V1ChargeDisputeFundsReinstatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.dispute.funds_reinstated" + type: Literal["v1.charge.dispute.funds_reinstated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeDisputeFundsReinstatedEvent": + return cast( + "V1ChargeDisputeFundsReinstatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeDisputeFundsReinstatedEvent": + return cast( + "V1ChargeDisputeFundsReinstatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeDisputeFundsReinstatedEvent(Event): + LOOKUP_TYPE = "v1.charge.dispute.funds_reinstated" + type: Literal["v1.charge.dispute.funds_reinstated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_dispute_funds_withdrawn_event.py b/stripe/events/_v1_charge_dispute_funds_withdrawn_event.py new file mode 100644 index 000000000..ec6168ac3 --- /dev/null +++ b/stripe/events/_v1_charge_dispute_funds_withdrawn_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._dispute import Dispute + from stripe._stripe_client import StripeClient + + +class V1ChargeDisputeFundsWithdrawnEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.dispute.funds_withdrawn" + type: Literal["v1.charge.dispute.funds_withdrawn"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeDisputeFundsWithdrawnEvent": + return cast( + "V1ChargeDisputeFundsWithdrawnEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeDisputeFundsWithdrawnEvent": + return cast( + "V1ChargeDisputeFundsWithdrawnEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeDisputeFundsWithdrawnEvent(Event): + LOOKUP_TYPE = "v1.charge.dispute.funds_withdrawn" + type: Literal["v1.charge.dispute.funds_withdrawn"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_dispute_updated_event.py b/stripe/events/_v1_charge_dispute_updated_event.py new file mode 100644 index 000000000..95e09a433 --- /dev/null +++ b/stripe/events/_v1_charge_dispute_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._dispute import Dispute + from stripe._stripe_client import StripeClient + + +class V1ChargeDisputeUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.dispute.updated" + type: Literal["v1.charge.dispute.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeDisputeUpdatedEvent": + return cast( + "V1ChargeDisputeUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeDisputeUpdatedEvent": + return cast( + "V1ChargeDisputeUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeDisputeUpdatedEvent(Event): + LOOKUP_TYPE = "v1.charge.dispute.updated" + type: Literal["v1.charge.dispute.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_expired_event.py b/stripe/events/_v1_charge_expired_event.py new file mode 100644 index 000000000..0e9b08a90 --- /dev/null +++ b/stripe/events/_v1_charge_expired_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeExpiredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.expired" + type: Literal["v1.charge.expired"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeExpiredEvent": + return cast( + "V1ChargeExpiredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeExpiredEvent": + return cast( + "V1ChargeExpiredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeExpiredEvent(Event): + LOOKUP_TYPE = "v1.charge.expired" + type: Literal["v1.charge.expired"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_failed_event.py b/stripe/events/_v1_charge_failed_event.py new file mode 100644 index 000000000..0aa91ea19 --- /dev/null +++ b/stripe/events/_v1_charge_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.failed" + type: Literal["v1.charge.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeFailedEvent": + return cast( + "V1ChargeFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeFailedEvent": + return cast( + "V1ChargeFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeFailedEvent(Event): + LOOKUP_TYPE = "v1.charge.failed" + type: Literal["v1.charge.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_pending_event.py b/stripe/events/_v1_charge_pending_event.py new file mode 100644 index 000000000..03382cecb --- /dev/null +++ b/stripe/events/_v1_charge_pending_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargePendingEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.pending" + type: Literal["v1.charge.pending"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargePendingEvent": + return cast( + "V1ChargePendingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargePendingEvent": + return cast( + "V1ChargePendingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargePendingEvent(Event): + LOOKUP_TYPE = "v1.charge.pending" + type: Literal["v1.charge.pending"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_refund_updated_event.py b/stripe/events/_v1_charge_refund_updated_event.py new file mode 100644 index 000000000..692732e39 --- /dev/null +++ b/stripe/events/_v1_charge_refund_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._refund import Refund + from stripe._stripe_client import StripeClient + + +class V1ChargeRefundUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.refund.updated" + type: Literal["v1.charge.refund.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeRefundUpdatedEvent": + return cast( + "V1ChargeRefundUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Refund": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeRefundUpdatedEvent": + return cast( + "V1ChargeRefundUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Refund": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeRefundUpdatedEvent(Event): + LOOKUP_TYPE = "v1.charge.refund.updated" + type: Literal["v1.charge.refund.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Refund": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Refund", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_refunded_event.py b/stripe/events/_v1_charge_refunded_event.py new file mode 100644 index 000000000..2ca556ec8 --- /dev/null +++ b/stripe/events/_v1_charge_refunded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeRefundedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.refunded" + type: Literal["v1.charge.refunded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeRefundedEvent": + return cast( + "V1ChargeRefundedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeRefundedEvent": + return cast( + "V1ChargeRefundedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeRefundedEvent(Event): + LOOKUP_TYPE = "v1.charge.refunded" + type: Literal["v1.charge.refunded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_succeeded_event.py b/stripe/events/_v1_charge_succeeded_event.py new file mode 100644 index 000000000..c032560ba --- /dev/null +++ b/stripe/events/_v1_charge_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.succeeded" + type: Literal["v1.charge.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeSucceededEvent": + return cast( + "V1ChargeSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeSucceededEvent": + return cast( + "V1ChargeSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeSucceededEvent(Event): + LOOKUP_TYPE = "v1.charge.succeeded" + type: Literal["v1.charge.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_charge_updated_event.py b/stripe/events/_v1_charge_updated_event.py new file mode 100644 index 000000000..76b06b8c1 --- /dev/null +++ b/stripe/events/_v1_charge_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._charge import Charge + from stripe._stripe_client import StripeClient + + +class V1ChargeUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.charge.updated" + type: Literal["v1.charge.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ChargeUpdatedEvent": + return cast( + "V1ChargeUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Charge": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ChargeUpdatedEvent": + return cast( + "V1ChargeUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Charge": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Charge", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ChargeUpdatedEvent(Event): + LOOKUP_TYPE = "v1.charge.updated" + type: Literal["v1.charge.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Charge": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Charge", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_checkout_session_async_payment_failed_event.py b/stripe/events/_v1_checkout_session_async_payment_failed_event.py new file mode 100644 index 000000000..db0337676 --- /dev/null +++ b/stripe/events/_v1_checkout_session_async_payment_failed_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.checkout._session import Session + + +class V1CheckoutSessionAsyncPaymentFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.checkout.session.async_payment_failed" + type: Literal["v1.checkout.session.async_payment_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CheckoutSessionAsyncPaymentFailedEvent": + return cast( + "V1CheckoutSessionAsyncPaymentFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Session": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CheckoutSessionAsyncPaymentFailedEvent": + return cast( + "V1CheckoutSessionAsyncPaymentFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Session": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CheckoutSessionAsyncPaymentFailedEvent(Event): + LOOKUP_TYPE = "v1.checkout.session.async_payment_failed" + type: Literal["v1.checkout.session.async_payment_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Session": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Session", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_checkout_session_async_payment_succeeded_event.py b/stripe/events/_v1_checkout_session_async_payment_succeeded_event.py new file mode 100644 index 000000000..dc7a3c993 --- /dev/null +++ b/stripe/events/_v1_checkout_session_async_payment_succeeded_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.checkout._session import Session + + +class V1CheckoutSessionAsyncPaymentSucceededEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.checkout.session.async_payment_succeeded" + type: Literal["v1.checkout.session.async_payment_succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CheckoutSessionAsyncPaymentSucceededEvent": + return cast( + "V1CheckoutSessionAsyncPaymentSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Session": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CheckoutSessionAsyncPaymentSucceededEvent": + return cast( + "V1CheckoutSessionAsyncPaymentSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Session": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CheckoutSessionAsyncPaymentSucceededEvent(Event): + LOOKUP_TYPE = "v1.checkout.session.async_payment_succeeded" + type: Literal["v1.checkout.session.async_payment_succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Session": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Session", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_checkout_session_completed_event.py b/stripe/events/_v1_checkout_session_completed_event.py new file mode 100644 index 000000000..7e330bafc --- /dev/null +++ b/stripe/events/_v1_checkout_session_completed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.checkout._session import Session + + +class V1CheckoutSessionCompletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.checkout.session.completed" + type: Literal["v1.checkout.session.completed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CheckoutSessionCompletedEvent": + return cast( + "V1CheckoutSessionCompletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Session": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CheckoutSessionCompletedEvent": + return cast( + "V1CheckoutSessionCompletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Session": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CheckoutSessionCompletedEvent(Event): + LOOKUP_TYPE = "v1.checkout.session.completed" + type: Literal["v1.checkout.session.completed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Session": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Session", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_checkout_session_expired_event.py b/stripe/events/_v1_checkout_session_expired_event.py new file mode 100644 index 000000000..015c3972f --- /dev/null +++ b/stripe/events/_v1_checkout_session_expired_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.checkout._session import Session + + +class V1CheckoutSessionExpiredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.checkout.session.expired" + type: Literal["v1.checkout.session.expired"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CheckoutSessionExpiredEvent": + return cast( + "V1CheckoutSessionExpiredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Session": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CheckoutSessionExpiredEvent": + return cast( + "V1CheckoutSessionExpiredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Session": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Session", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CheckoutSessionExpiredEvent(Event): + LOOKUP_TYPE = "v1.checkout.session.expired" + type: Literal["v1.checkout.session.expired"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Session": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Session", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_order_canceled_event.py b/stripe/events/_v1_climate_order_canceled_event.py new file mode 100644 index 000000000..782db56cc --- /dev/null +++ b/stripe/events/_v1_climate_order_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._order import Order + + +class V1ClimateOrderCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.order.canceled" + type: Literal["v1.climate.order.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateOrderCanceledEvent": + return cast( + "V1ClimateOrderCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Order": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateOrderCanceledEvent": + return cast( + "V1ClimateOrderCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Order": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateOrderCanceledEvent(Event): + LOOKUP_TYPE = "v1.climate.order.canceled" + type: Literal["v1.climate.order.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Order": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Order", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_order_created_event.py b/stripe/events/_v1_climate_order_created_event.py new file mode 100644 index 000000000..0c3cbc2c6 --- /dev/null +++ b/stripe/events/_v1_climate_order_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._order import Order + + +class V1ClimateOrderCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.order.created" + type: Literal["v1.climate.order.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateOrderCreatedEvent": + return cast( + "V1ClimateOrderCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Order": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateOrderCreatedEvent": + return cast( + "V1ClimateOrderCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Order": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateOrderCreatedEvent(Event): + LOOKUP_TYPE = "v1.climate.order.created" + type: Literal["v1.climate.order.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Order": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Order", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_order_delayed_event.py b/stripe/events/_v1_climate_order_delayed_event.py new file mode 100644 index 000000000..668ce6f19 --- /dev/null +++ b/stripe/events/_v1_climate_order_delayed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._order import Order + + +class V1ClimateOrderDelayedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.order.delayed" + type: Literal["v1.climate.order.delayed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateOrderDelayedEvent": + return cast( + "V1ClimateOrderDelayedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Order": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateOrderDelayedEvent": + return cast( + "V1ClimateOrderDelayedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Order": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateOrderDelayedEvent(Event): + LOOKUP_TYPE = "v1.climate.order.delayed" + type: Literal["v1.climate.order.delayed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Order": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Order", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_order_delivered_event.py b/stripe/events/_v1_climate_order_delivered_event.py new file mode 100644 index 000000000..66ca81873 --- /dev/null +++ b/stripe/events/_v1_climate_order_delivered_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._order import Order + + +class V1ClimateOrderDeliveredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.order.delivered" + type: Literal["v1.climate.order.delivered"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateOrderDeliveredEvent": + return cast( + "V1ClimateOrderDeliveredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Order": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateOrderDeliveredEvent": + return cast( + "V1ClimateOrderDeliveredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Order": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateOrderDeliveredEvent(Event): + LOOKUP_TYPE = "v1.climate.order.delivered" + type: Literal["v1.climate.order.delivered"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Order": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Order", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_order_product_substituted_event.py b/stripe/events/_v1_climate_order_product_substituted_event.py new file mode 100644 index 000000000..a4f25069c --- /dev/null +++ b/stripe/events/_v1_climate_order_product_substituted_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._order import Order + + +class V1ClimateOrderProductSubstitutedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.order.product_substituted" + type: Literal["v1.climate.order.product_substituted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateOrderProductSubstitutedEvent": + return cast( + "V1ClimateOrderProductSubstitutedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Order": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1ClimateOrderProductSubstitutedEvent": + return cast( + "V1ClimateOrderProductSubstitutedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Order": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Order", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateOrderProductSubstitutedEvent(Event): + LOOKUP_TYPE = "v1.climate.order.product_substituted" + type: Literal["v1.climate.order.product_substituted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Order": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Order", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_product_created_event.py b/stripe/events/_v1_climate_product_created_event.py new file mode 100644 index 000000000..8e8cf317d --- /dev/null +++ b/stripe/events/_v1_climate_product_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._product import Product + + +class V1ClimateProductCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.product.created" + type: Literal["v1.climate.product.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateProductCreatedEvent": + return cast( + "V1ClimateProductCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Product": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateProductCreatedEvent": + return cast( + "V1ClimateProductCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Product": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateProductCreatedEvent(Event): + LOOKUP_TYPE = "v1.climate.product.created" + type: Literal["v1.climate.product.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Product": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Product", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_climate_product_pricing_updated_event.py b/stripe/events/_v1_climate_product_pricing_updated_event.py new file mode 100644 index 000000000..86db78362 --- /dev/null +++ b/stripe/events/_v1_climate_product_pricing_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.climate._product import Product + + +class V1ClimateProductPricingUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.climate.product.pricing_updated" + type: Literal["v1.climate.product.pricing_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ClimateProductPricingUpdatedEvent": + return cast( + "V1ClimateProductPricingUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Product": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ClimateProductPricingUpdatedEvent": + return cast( + "V1ClimateProductPricingUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Product": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ClimateProductPricingUpdatedEvent(Event): + LOOKUP_TYPE = "v1.climate.product.pricing_updated" + type: Literal["v1.climate.product.pricing_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Product": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Product", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_coupon_created_event.py b/stripe/events/_v1_coupon_created_event.py new file mode 100644 index 000000000..ca7b0261d --- /dev/null +++ b/stripe/events/_v1_coupon_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._coupon import Coupon + from stripe._stripe_client import StripeClient + + +class V1CouponCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.coupon.created" + type: Literal["v1.coupon.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CouponCreatedEvent": + return cast( + "V1CouponCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Coupon": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CouponCreatedEvent": + return cast( + "V1CouponCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Coupon": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CouponCreatedEvent(Event): + LOOKUP_TYPE = "v1.coupon.created" + type: Literal["v1.coupon.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Coupon": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Coupon", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_coupon_deleted_event.py b/stripe/events/_v1_coupon_deleted_event.py new file mode 100644 index 000000000..c7c399af2 --- /dev/null +++ b/stripe/events/_v1_coupon_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._coupon import Coupon + from stripe._stripe_client import StripeClient + + +class V1CouponDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.coupon.deleted" + type: Literal["v1.coupon.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CouponDeletedEvent": + return cast( + "V1CouponDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Coupon": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CouponDeletedEvent": + return cast( + "V1CouponDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Coupon": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CouponDeletedEvent(Event): + LOOKUP_TYPE = "v1.coupon.deleted" + type: Literal["v1.coupon.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Coupon": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Coupon", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_coupon_updated_event.py b/stripe/events/_v1_coupon_updated_event.py new file mode 100644 index 000000000..4ab1fa5eb --- /dev/null +++ b/stripe/events/_v1_coupon_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._coupon import Coupon + from stripe._stripe_client import StripeClient + + +class V1CouponUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.coupon.updated" + type: Literal["v1.coupon.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CouponUpdatedEvent": + return cast( + "V1CouponUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Coupon": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CouponUpdatedEvent": + return cast( + "V1CouponUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Coupon": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Coupon", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CouponUpdatedEvent(Event): + LOOKUP_TYPE = "v1.coupon.updated" + type: Literal["v1.coupon.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Coupon": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Coupon", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_credit_note_created_event.py b/stripe/events/_v1_credit_note_created_event.py new file mode 100644 index 000000000..d4b55ede3 --- /dev/null +++ b/stripe/events/_v1_credit_note_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._credit_note import CreditNote + from stripe._stripe_client import StripeClient + + +class V1CreditNoteCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.credit_note.created" + type: Literal["v1.credit_note.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CreditNoteCreatedEvent": + return cast( + "V1CreditNoteCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditNote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CreditNoteCreatedEvent": + return cast( + "V1CreditNoteCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditNote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CreditNoteCreatedEvent(Event): + LOOKUP_TYPE = "v1.credit_note.created" + type: Literal["v1.credit_note.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "CreditNote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditNote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_credit_note_updated_event.py b/stripe/events/_v1_credit_note_updated_event.py new file mode 100644 index 000000000..85f2abf70 --- /dev/null +++ b/stripe/events/_v1_credit_note_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._credit_note import CreditNote + from stripe._stripe_client import StripeClient + + +class V1CreditNoteUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.credit_note.updated" + type: Literal["v1.credit_note.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CreditNoteUpdatedEvent": + return cast( + "V1CreditNoteUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditNote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CreditNoteUpdatedEvent": + return cast( + "V1CreditNoteUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditNote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CreditNoteUpdatedEvent(Event): + LOOKUP_TYPE = "v1.credit_note.updated" + type: Literal["v1.credit_note.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "CreditNote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditNote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_credit_note_voided_event.py b/stripe/events/_v1_credit_note_voided_event.py new file mode 100644 index 000000000..8e71ba8a4 --- /dev/null +++ b/stripe/events/_v1_credit_note_voided_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._credit_note import CreditNote + from stripe._stripe_client import StripeClient + + +class V1CreditNoteVoidedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.credit_note.voided" + type: Literal["v1.credit_note.voided"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CreditNoteVoidedEvent": + return cast( + "V1CreditNoteVoidedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditNote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CreditNoteVoidedEvent": + return cast( + "V1CreditNoteVoidedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditNote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CreditNote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CreditNoteVoidedEvent(Event): + LOOKUP_TYPE = "v1.credit_note.voided" + type: Literal["v1.credit_note.voided"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "CreditNote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditNote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_cash_balance_transaction_created_event.py b/stripe/events/_v1_customer_cash_balance_transaction_created_event.py new file mode 100644 index 000000000..c963c1ac6 --- /dev/null +++ b/stripe/events/_v1_customer_cash_balance_transaction_created_event.py @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._customer_cash_balance_transaction import ( + CustomerCashBalanceTransaction, + ) + from stripe._stripe_client import StripeClient + + +class V1CustomerCashBalanceTransactionCreatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.customer_cash_balance_transaction.created" + type: Literal["v1.customer_cash_balance_transaction.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerCashBalanceTransactionCreatedEvent": + return cast( + "V1CustomerCashBalanceTransactionCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CustomerCashBalanceTransaction": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CustomerCashBalanceTransaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CustomerCashBalanceTransactionCreatedEvent": + return cast( + "V1CustomerCashBalanceTransactionCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async( + self, + ) -> "CustomerCashBalanceTransaction": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "CustomerCashBalanceTransaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerCashBalanceTransactionCreatedEvent(Event): + LOOKUP_TYPE = "v1.customer_cash_balance_transaction.created" + type: Literal["v1.customer_cash_balance_transaction.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "CustomerCashBalanceTransaction": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CustomerCashBalanceTransaction", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_created_event.py b/stripe/events/_v1_customer_created_event.py new file mode 100644 index 000000000..b70fa598d --- /dev/null +++ b/stripe/events/_v1_customer_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._customer import Customer + from stripe._stripe_client import StripeClient + + +class V1CustomerCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.created" + type: Literal["v1.customer.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerCreatedEvent": + return cast( + "V1CustomerCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Customer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerCreatedEvent": + return cast( + "V1CustomerCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Customer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerCreatedEvent(Event): + LOOKUP_TYPE = "v1.customer.created" + type: Literal["v1.customer.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Customer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Customer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_deleted_event.py b/stripe/events/_v1_customer_deleted_event.py new file mode 100644 index 000000000..72e0fd98a --- /dev/null +++ b/stripe/events/_v1_customer_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._customer import Customer + from stripe._stripe_client import StripeClient + + +class V1CustomerDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.deleted" + type: Literal["v1.customer.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerDeletedEvent": + return cast( + "V1CustomerDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Customer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerDeletedEvent": + return cast( + "V1CustomerDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Customer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerDeletedEvent(Event): + LOOKUP_TYPE = "v1.customer.deleted" + type: Literal["v1.customer.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Customer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Customer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_created_event.py b/stripe/events/_v1_customer_subscription_created_event.py new file mode 100644 index 000000000..ef5e771b2 --- /dev/null +++ b/stripe/events/_v1_customer_subscription_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.created" + type: Literal["v1.customer.subscription.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionCreatedEvent": + return cast( + "V1CustomerSubscriptionCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerSubscriptionCreatedEvent": + return cast( + "V1CustomerSubscriptionCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionCreatedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.created" + type: Literal["v1.customer.subscription.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_deleted_event.py b/stripe/events/_v1_customer_subscription_deleted_event.py new file mode 100644 index 000000000..2110b01d9 --- /dev/null +++ b/stripe/events/_v1_customer_subscription_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.deleted" + type: Literal["v1.customer.subscription.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionDeletedEvent": + return cast( + "V1CustomerSubscriptionDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerSubscriptionDeletedEvent": + return cast( + "V1CustomerSubscriptionDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionDeletedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.deleted" + type: Literal["v1.customer.subscription.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_paused_event.py b/stripe/events/_v1_customer_subscription_paused_event.py new file mode 100644 index 000000000..719c35a6b --- /dev/null +++ b/stripe/events/_v1_customer_subscription_paused_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionPausedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.paused" + type: Literal["v1.customer.subscription.paused"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionPausedEvent": + return cast( + "V1CustomerSubscriptionPausedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerSubscriptionPausedEvent": + return cast( + "V1CustomerSubscriptionPausedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionPausedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.paused" + type: Literal["v1.customer.subscription.paused"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_pending_update_applied_event.py b/stripe/events/_v1_customer_subscription_pending_update_applied_event.py new file mode 100644 index 000000000..02ee45977 --- /dev/null +++ b/stripe/events/_v1_customer_subscription_pending_update_applied_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionPendingUpdateAppliedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.customer.subscription.pending_update_applied" + type: Literal["v1.customer.subscription.pending_update_applied"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionPendingUpdateAppliedEvent": + return cast( + "V1CustomerSubscriptionPendingUpdateAppliedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CustomerSubscriptionPendingUpdateAppliedEvent": + return cast( + "V1CustomerSubscriptionPendingUpdateAppliedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionPendingUpdateAppliedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.pending_update_applied" + type: Literal["v1.customer.subscription.pending_update_applied"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_pending_update_expired_event.py b/stripe/events/_v1_customer_subscription_pending_update_expired_event.py new file mode 100644 index 000000000..a39ae79bc --- /dev/null +++ b/stripe/events/_v1_customer_subscription_pending_update_expired_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionPendingUpdateExpiredEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.customer.subscription.pending_update_expired" + type: Literal["v1.customer.subscription.pending_update_expired"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionPendingUpdateExpiredEvent": + return cast( + "V1CustomerSubscriptionPendingUpdateExpiredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CustomerSubscriptionPendingUpdateExpiredEvent": + return cast( + "V1CustomerSubscriptionPendingUpdateExpiredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionPendingUpdateExpiredEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.pending_update_expired" + type: Literal["v1.customer.subscription.pending_update_expired"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_resumed_event.py b/stripe/events/_v1_customer_subscription_resumed_event.py new file mode 100644 index 000000000..29bbb6b45 --- /dev/null +++ b/stripe/events/_v1_customer_subscription_resumed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionResumedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.resumed" + type: Literal["v1.customer.subscription.resumed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionResumedEvent": + return cast( + "V1CustomerSubscriptionResumedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerSubscriptionResumedEvent": + return cast( + "V1CustomerSubscriptionResumedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionResumedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.resumed" + type: Literal["v1.customer.subscription.resumed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_trial_will_end_event.py b/stripe/events/_v1_customer_subscription_trial_will_end_event.py new file mode 100644 index 000000000..a29475e1a --- /dev/null +++ b/stripe/events/_v1_customer_subscription_trial_will_end_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionTrialWillEndEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.trial_will_end" + type: Literal["v1.customer.subscription.trial_will_end"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionTrialWillEndEvent": + return cast( + "V1CustomerSubscriptionTrialWillEndEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1CustomerSubscriptionTrialWillEndEvent": + return cast( + "V1CustomerSubscriptionTrialWillEndEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionTrialWillEndEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.trial_will_end" + type: Literal["v1.customer.subscription.trial_will_end"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_subscription_updated_event.py b/stripe/events/_v1_customer_subscription_updated_event.py new file mode 100644 index 000000000..361800ab2 --- /dev/null +++ b/stripe/events/_v1_customer_subscription_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription import Subscription + + +class V1CustomerSubscriptionUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.subscription.updated" + type: Literal["v1.customer.subscription.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerSubscriptionUpdatedEvent": + return cast( + "V1CustomerSubscriptionUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Subscription": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerSubscriptionUpdatedEvent": + return cast( + "V1CustomerSubscriptionUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Subscription": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Subscription", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerSubscriptionUpdatedEvent(Event): + LOOKUP_TYPE = "v1.customer.subscription.updated" + type: Literal["v1.customer.subscription.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Subscription": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Subscription", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_tax_id_created_event.py b/stripe/events/_v1_customer_tax_id_created_event.py new file mode 100644 index 000000000..a88eff7ab --- /dev/null +++ b/stripe/events/_v1_customer_tax_id_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._tax_id import TaxId + + +class V1CustomerTaxIdCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.tax_id.created" + type: Literal["v1.customer.tax_id.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerTaxIdCreatedEvent": + return cast( + "V1CustomerTaxIdCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TaxId": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerTaxIdCreatedEvent": + return cast( + "V1CustomerTaxIdCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TaxId": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerTaxIdCreatedEvent(Event): + LOOKUP_TYPE = "v1.customer.tax_id.created" + type: Literal["v1.customer.tax_id.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TaxId": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TaxId", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_tax_id_deleted_event.py b/stripe/events/_v1_customer_tax_id_deleted_event.py new file mode 100644 index 000000000..7b995969a --- /dev/null +++ b/stripe/events/_v1_customer_tax_id_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._tax_id import TaxId + + +class V1CustomerTaxIdDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.tax_id.deleted" + type: Literal["v1.customer.tax_id.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerTaxIdDeletedEvent": + return cast( + "V1CustomerTaxIdDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TaxId": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerTaxIdDeletedEvent": + return cast( + "V1CustomerTaxIdDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TaxId": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerTaxIdDeletedEvent(Event): + LOOKUP_TYPE = "v1.customer.tax_id.deleted" + type: Literal["v1.customer.tax_id.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TaxId": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TaxId", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_tax_id_updated_event.py b/stripe/events/_v1_customer_tax_id_updated_event.py new file mode 100644 index 000000000..47732a697 --- /dev/null +++ b/stripe/events/_v1_customer_tax_id_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._tax_id import TaxId + + +class V1CustomerTaxIdUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.tax_id.updated" + type: Literal["v1.customer.tax_id.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerTaxIdUpdatedEvent": + return cast( + "V1CustomerTaxIdUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TaxId": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerTaxIdUpdatedEvent": + return cast( + "V1CustomerTaxIdUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TaxId": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxId", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerTaxIdUpdatedEvent(Event): + LOOKUP_TYPE = "v1.customer.tax_id.updated" + type: Literal["v1.customer.tax_id.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TaxId": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TaxId", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_customer_updated_event.py b/stripe/events/_v1_customer_updated_event.py new file mode 100644 index 000000000..c4b6ee427 --- /dev/null +++ b/stripe/events/_v1_customer_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._customer import Customer + from stripe._stripe_client import StripeClient + + +class V1CustomerUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.updated" + type: Literal["v1.customer.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1CustomerUpdatedEvent": + return cast( + "V1CustomerUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Customer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerUpdatedEvent": + return cast( + "V1CustomerUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Customer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Customer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerUpdatedEvent(Event): + LOOKUP_TYPE = "v1.customer.updated" + type: Literal["v1.customer.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Customer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Customer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_entitlements_active_entitlement_summary_updated_event.py b/stripe/events/_v1_entitlements_active_entitlement_summary_updated_event.py new file mode 100644 index 000000000..6dda11274 --- /dev/null +++ b/stripe/events/_v1_entitlements_active_entitlement_summary_updated_event.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.entitlements.active_entitlement_summary.updated" + type: Literal["v1.entitlements.active_entitlement_summary.updated"] + + @override + def fetch_event( + self, + ) -> "V1EntitlementsActiveEntitlementSummaryUpdatedEvent": + return cast( + "V1EntitlementsActiveEntitlementSummaryUpdatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1EntitlementsActiveEntitlementSummaryUpdatedEvent": + return cast( + "V1EntitlementsActiveEntitlementSummaryUpdatedEvent", + await super().fetch_event_async(), + ) + + +class V1EntitlementsActiveEntitlementSummaryUpdatedEvent(Event): + LOOKUP_TYPE = "v1.entitlements.active_entitlement_summary.updated" + type: Literal["v1.entitlements.active_entitlement_summary.updated"] diff --git a/stripe/events/_v1_file_created_event.py b/stripe/events/_v1_file_created_event.py new file mode 100644 index 000000000..5b142e69d --- /dev/null +++ b/stripe/events/_v1_file_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._file import File + from stripe._stripe_client import StripeClient + + +class V1FileCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.file.created" + type: Literal["v1.file.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1FileCreatedEvent": + return cast( + "V1FileCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "File": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "File", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1FileCreatedEvent": + return cast( + "V1FileCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "File": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "File", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FileCreatedEvent(Event): + LOOKUP_TYPE = "v1.file.created" + type: Literal["v1.file.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "File": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "File", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_created_event.py b/stripe/events/_v1_financial_connections_account_created_event.py new file mode 100644 index 000000000..40ed6f922 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_created_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.financial_connections.account.created" + type: Literal["v1.financial_connections.account.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1FinancialConnectionsAccountCreatedEvent": + return cast( + "V1FinancialConnectionsAccountCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountCreatedEvent": + return cast( + "V1FinancialConnectionsAccountCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountCreatedEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.created" + type: Literal["v1.financial_connections.account.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_deactivated_event.py b/stripe/events/_v1_financial_connections_account_deactivated_event.py new file mode 100644 index 000000000..0feee1f81 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_deactivated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountDeactivatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.deactivated" + type: Literal["v1.financial_connections.account.deactivated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1FinancialConnectionsAccountDeactivatedEvent": + return cast( + "V1FinancialConnectionsAccountDeactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountDeactivatedEvent": + return cast( + "V1FinancialConnectionsAccountDeactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountDeactivatedEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.deactivated" + type: Literal["v1.financial_connections.account.deactivated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_disconnected_event.py b/stripe/events/_v1_financial_connections_account_disconnected_event.py new file mode 100644 index 000000000..6a62f193c --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_disconnected_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountDisconnectedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.disconnected" + type: Literal["v1.financial_connections.account.disconnected"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1FinancialConnectionsAccountDisconnectedEvent": + return cast( + "V1FinancialConnectionsAccountDisconnectedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountDisconnectedEvent": + return cast( + "V1FinancialConnectionsAccountDisconnectedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountDisconnectedEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.disconnected" + type: Literal["v1.financial_connections.account.disconnected"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_reactivated_event.py b/stripe/events/_v1_financial_connections_account_reactivated_event.py new file mode 100644 index 000000000..0afa58b7f --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_reactivated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountReactivatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.reactivated" + type: Literal["v1.financial_connections.account.reactivated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1FinancialConnectionsAccountReactivatedEvent": + return cast( + "V1FinancialConnectionsAccountReactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountReactivatedEvent": + return cast( + "V1FinancialConnectionsAccountReactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountReactivatedEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.reactivated" + type: Literal["v1.financial_connections.account.reactivated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_refreshed_balance_event.py b/stripe/events/_v1_financial_connections_account_refreshed_balance_event.py new file mode 100644 index 000000000..73d6cb096 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_refreshed_balance_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountRefreshedBalanceEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_balance" + type: Literal["v1.financial_connections.account.refreshed_balance"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V1FinancialConnectionsAccountRefreshedBalanceEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedBalanceEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountRefreshedBalanceEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedBalanceEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountRefreshedBalanceEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_balance" + type: Literal["v1.financial_connections.account.refreshed_balance"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_refreshed_ownership_event.py b/stripe/events/_v1_financial_connections_account_refreshed_ownership_event.py new file mode 100644 index 000000000..07a3e276c --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_refreshed_ownership_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountRefreshedOwnershipEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_ownership" + type: Literal["v1.financial_connections.account.refreshed_ownership"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V1FinancialConnectionsAccountRefreshedOwnershipEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedOwnershipEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountRefreshedOwnershipEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedOwnershipEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountRefreshedOwnershipEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_ownership" + type: Literal["v1.financial_connections.account.refreshed_ownership"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_financial_connections_account_refreshed_transactions_event.py b/stripe/events/_v1_financial_connections_account_refreshed_transactions_event.py new file mode 100644 index 000000000..b31f0ee3f --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_refreshed_transactions_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.financial_connections._account import Account + + +class V1FinancialConnectionsAccountRefreshedTransactionsEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_transactions" + type: Literal["v1.financial_connections.account.refreshed_transactions"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V1FinancialConnectionsAccountRefreshedTransactionsEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedTransactionsEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Account": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1FinancialConnectionsAccountRefreshedTransactionsEvent": + return cast( + "V1FinancialConnectionsAccountRefreshedTransactionsEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Account": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Account", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1FinancialConnectionsAccountRefreshedTransactionsEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.refreshed_transactions" + type: Literal["v1.financial_connections.account.refreshed_transactions"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Account": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Account", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_canceled_event.py b/stripe/events/_v1_identity_verification_session_canceled_event.py new file mode 100644 index 000000000..eb4c9ed8b --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_canceled_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionCanceledEventNotification( + EventNotification +): + LOOKUP_TYPE = "v1.identity.verification_session.canceled" + type: Literal["v1.identity.verification_session.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionCanceledEvent": + return cast( + "V1IdentityVerificationSessionCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionCanceledEvent": + return cast( + "V1IdentityVerificationSessionCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionCanceledEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.canceled" + type: Literal["v1.identity.verification_session.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_created_event.py b/stripe/events/_v1_identity_verification_session_created_event.py new file mode 100644 index 000000000..c29967533 --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_created_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.identity.verification_session.created" + type: Literal["v1.identity.verification_session.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionCreatedEvent": + return cast( + "V1IdentityVerificationSessionCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionCreatedEvent": + return cast( + "V1IdentityVerificationSessionCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionCreatedEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.created" + type: Literal["v1.identity.verification_session.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_processing_event.py b/stripe/events/_v1_identity_verification_session_processing_event.py new file mode 100644 index 000000000..0a92a7039 --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_processing_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionProcessingEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.identity.verification_session.processing" + type: Literal["v1.identity.verification_session.processing"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionProcessingEvent": + return cast( + "V1IdentityVerificationSessionProcessingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionProcessingEvent": + return cast( + "V1IdentityVerificationSessionProcessingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionProcessingEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.processing" + type: Literal["v1.identity.verification_session.processing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_redacted_event.py b/stripe/events/_v1_identity_verification_session_redacted_event.py new file mode 100644 index 000000000..7e6976c7a --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_redacted_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionRedactedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v1.identity.verification_session.redacted" + type: Literal["v1.identity.verification_session.redacted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionRedactedEvent": + return cast( + "V1IdentityVerificationSessionRedactedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionRedactedEvent": + return cast( + "V1IdentityVerificationSessionRedactedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionRedactedEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.redacted" + type: Literal["v1.identity.verification_session.redacted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_requires_input_event.py b/stripe/events/_v1_identity_verification_session_requires_input_event.py new file mode 100644 index 000000000..a717a3df0 --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_requires_input_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionRequiresInputEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.identity.verification_session.requires_input" + type: Literal["v1.identity.verification_session.requires_input"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionRequiresInputEvent": + return cast( + "V1IdentityVerificationSessionRequiresInputEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionRequiresInputEvent": + return cast( + "V1IdentityVerificationSessionRequiresInputEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionRequiresInputEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.requires_input" + type: Literal["v1.identity.verification_session.requires_input"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_identity_verification_session_verified_event.py b/stripe/events/_v1_identity_verification_session_verified_event.py new file mode 100644 index 000000000..1e188f418 --- /dev/null +++ b/stripe/events/_v1_identity_verification_session_verified_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.identity._verification_session import VerificationSession + + +class V1IdentityVerificationSessionVerifiedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v1.identity.verification_session.verified" + type: Literal["v1.identity.verification_session.verified"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IdentityVerificationSessionVerifiedEvent": + return cast( + "V1IdentityVerificationSessionVerifiedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "VerificationSession": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IdentityVerificationSessionVerifiedEvent": + return cast( + "V1IdentityVerificationSessionVerifiedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "VerificationSession": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "VerificationSession", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IdentityVerificationSessionVerifiedEvent(Event): + LOOKUP_TYPE = "v1.identity.verification_session.verified" + type: Literal["v1.identity.verification_session.verified"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "VerificationSession": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "VerificationSession", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_created_event.py b/stripe/events/_v1_invoice_created_event.py new file mode 100644 index 000000000..a6dc341dd --- /dev/null +++ b/stripe/events/_v1_invoice_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.created" + type: Literal["v1.invoice.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceCreatedEvent": + return cast( + "V1InvoiceCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceCreatedEvent": + return cast( + "V1InvoiceCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceCreatedEvent(Event): + LOOKUP_TYPE = "v1.invoice.created" + type: Literal["v1.invoice.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_deleted_event.py b/stripe/events/_v1_invoice_deleted_event.py new file mode 100644 index 000000000..a1ef7aa0b --- /dev/null +++ b/stripe/events/_v1_invoice_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.deleted" + type: Literal["v1.invoice.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceDeletedEvent": + return cast( + "V1InvoiceDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceDeletedEvent": + return cast( + "V1InvoiceDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceDeletedEvent(Event): + LOOKUP_TYPE = "v1.invoice.deleted" + type: Literal["v1.invoice.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_finalization_failed_event.py b/stripe/events/_v1_invoice_finalization_failed_event.py new file mode 100644 index 000000000..49b3a1ec7 --- /dev/null +++ b/stripe/events/_v1_invoice_finalization_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceFinalizationFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.finalization_failed" + type: Literal["v1.invoice.finalization_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceFinalizationFailedEvent": + return cast( + "V1InvoiceFinalizationFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceFinalizationFailedEvent": + return cast( + "V1InvoiceFinalizationFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceFinalizationFailedEvent(Event): + LOOKUP_TYPE = "v1.invoice.finalization_failed" + type: Literal["v1.invoice.finalization_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_finalized_event.py b/stripe/events/_v1_invoice_finalized_event.py new file mode 100644 index 000000000..12a336959 --- /dev/null +++ b/stripe/events/_v1_invoice_finalized_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceFinalizedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.finalized" + type: Literal["v1.invoice.finalized"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceFinalizedEvent": + return cast( + "V1InvoiceFinalizedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceFinalizedEvent": + return cast( + "V1InvoiceFinalizedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceFinalizedEvent(Event): + LOOKUP_TYPE = "v1.invoice.finalized" + type: Literal["v1.invoice.finalized"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_marked_uncollectible_event.py b/stripe/events/_v1_invoice_marked_uncollectible_event.py new file mode 100644 index 000000000..a968d8c43 --- /dev/null +++ b/stripe/events/_v1_invoice_marked_uncollectible_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceMarkedUncollectibleEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.marked_uncollectible" + type: Literal["v1.invoice.marked_uncollectible"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceMarkedUncollectibleEvent": + return cast( + "V1InvoiceMarkedUncollectibleEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceMarkedUncollectibleEvent": + return cast( + "V1InvoiceMarkedUncollectibleEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceMarkedUncollectibleEvent(Event): + LOOKUP_TYPE = "v1.invoice.marked_uncollectible" + type: Literal["v1.invoice.marked_uncollectible"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_overdue_event.py b/stripe/events/_v1_invoice_overdue_event.py new file mode 100644 index 000000000..e6860ec88 --- /dev/null +++ b/stripe/events/_v1_invoice_overdue_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceOverdueEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.overdue" + type: Literal["v1.invoice.overdue"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceOverdueEvent": + return cast( + "V1InvoiceOverdueEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceOverdueEvent": + return cast( + "V1InvoiceOverdueEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceOverdueEvent(Event): + LOOKUP_TYPE = "v1.invoice.overdue" + type: Literal["v1.invoice.overdue"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_overpaid_event.py b/stripe/events/_v1_invoice_overpaid_event.py new file mode 100644 index 000000000..fa486381f --- /dev/null +++ b/stripe/events/_v1_invoice_overpaid_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceOverpaidEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.overpaid" + type: Literal["v1.invoice.overpaid"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceOverpaidEvent": + return cast( + "V1InvoiceOverpaidEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceOverpaidEvent": + return cast( + "V1InvoiceOverpaidEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceOverpaidEvent(Event): + LOOKUP_TYPE = "v1.invoice.overpaid" + type: Literal["v1.invoice.overpaid"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_paid_event.py b/stripe/events/_v1_invoice_paid_event.py new file mode 100644 index 000000000..0f3161ee7 --- /dev/null +++ b/stripe/events/_v1_invoice_paid_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoicePaidEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.paid" + type: Literal["v1.invoice.paid"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoicePaidEvent": + return cast( + "V1InvoicePaidEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoicePaidEvent": + return cast( + "V1InvoicePaidEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoicePaidEvent(Event): + LOOKUP_TYPE = "v1.invoice.paid" + type: Literal["v1.invoice.paid"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_payment_action_required_event.py b/stripe/events/_v1_invoice_payment_action_required_event.py new file mode 100644 index 000000000..d673153e5 --- /dev/null +++ b/stripe/events/_v1_invoice_payment_action_required_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoicePaymentActionRequiredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.payment_action_required" + type: Literal["v1.invoice.payment_action_required"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoicePaymentActionRequiredEvent": + return cast( + "V1InvoicePaymentActionRequiredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoicePaymentActionRequiredEvent": + return cast( + "V1InvoicePaymentActionRequiredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoicePaymentActionRequiredEvent(Event): + LOOKUP_TYPE = "v1.invoice.payment_action_required" + type: Literal["v1.invoice.payment_action_required"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_payment_failed_event.py b/stripe/events/_v1_invoice_payment_failed_event.py new file mode 100644 index 000000000..dde134fa7 --- /dev/null +++ b/stripe/events/_v1_invoice_payment_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoicePaymentFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.payment_failed" + type: Literal["v1.invoice.payment_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoicePaymentFailedEvent": + return cast( + "V1InvoicePaymentFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoicePaymentFailedEvent": + return cast( + "V1InvoicePaymentFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoicePaymentFailedEvent(Event): + LOOKUP_TYPE = "v1.invoice.payment_failed" + type: Literal["v1.invoice.payment_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_payment_paid_event.py b/stripe/events/_v1_invoice_payment_paid_event.py new file mode 100644 index 000000000..ae02db4dc --- /dev/null +++ b/stripe/events/_v1_invoice_payment_paid_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice_payment import InvoicePayment + from stripe._stripe_client import StripeClient + + +class V1InvoicePaymentPaidEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice_payment.paid" + type: Literal["v1.invoice_payment.paid"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoicePaymentPaidEvent": + return cast( + "V1InvoicePaymentPaidEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "InvoicePayment": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoicePayment", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoicePaymentPaidEvent": + return cast( + "V1InvoicePaymentPaidEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "InvoicePayment": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoicePayment", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoicePaymentPaidEvent(Event): + LOOKUP_TYPE = "v1.invoice_payment.paid" + type: Literal["v1.invoice_payment.paid"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "InvoicePayment": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "InvoicePayment", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_payment_succeeded_event.py b/stripe/events/_v1_invoice_payment_succeeded_event.py new file mode 100644 index 000000000..28f951813 --- /dev/null +++ b/stripe/events/_v1_invoice_payment_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoicePaymentSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.payment_succeeded" + type: Literal["v1.invoice.payment_succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoicePaymentSucceededEvent": + return cast( + "V1InvoicePaymentSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoicePaymentSucceededEvent": + return cast( + "V1InvoicePaymentSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoicePaymentSucceededEvent(Event): + LOOKUP_TYPE = "v1.invoice.payment_succeeded" + type: Literal["v1.invoice.payment_succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_sent_event.py b/stripe/events/_v1_invoice_sent_event.py new file mode 100644 index 000000000..2e7f00fe3 --- /dev/null +++ b/stripe/events/_v1_invoice_sent_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceSentEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.sent" + type: Literal["v1.invoice.sent"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceSentEvent": + return cast( + "V1InvoiceSentEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceSentEvent": + return cast( + "V1InvoiceSentEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceSentEvent(Event): + LOOKUP_TYPE = "v1.invoice.sent" + type: Literal["v1.invoice.sent"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_upcoming_event.py b/stripe/events/_v1_invoice_upcoming_event.py new file mode 100644 index 000000000..58f2fde2c --- /dev/null +++ b/stripe/events/_v1_invoice_upcoming_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceUpcomingEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.upcoming" + type: Literal["v1.invoice.upcoming"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceUpcomingEvent": + return cast( + "V1InvoiceUpcomingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceUpcomingEvent": + return cast( + "V1InvoiceUpcomingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceUpcomingEvent(Event): + LOOKUP_TYPE = "v1.invoice.upcoming" + type: Literal["v1.invoice.upcoming"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_updated_event.py b/stripe/events/_v1_invoice_updated_event.py new file mode 100644 index 000000000..86ae8254f --- /dev/null +++ b/stripe/events/_v1_invoice_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.updated" + type: Literal["v1.invoice.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceUpdatedEvent": + return cast( + "V1InvoiceUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceUpdatedEvent": + return cast( + "V1InvoiceUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceUpdatedEvent(Event): + LOOKUP_TYPE = "v1.invoice.updated" + type: Literal["v1.invoice.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_voided_event.py b/stripe/events/_v1_invoice_voided_event.py new file mode 100644 index 000000000..80cc493ef --- /dev/null +++ b/stripe/events/_v1_invoice_voided_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceVoidedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.voided" + type: Literal["v1.invoice.voided"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceVoidedEvent": + return cast( + "V1InvoiceVoidedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceVoidedEvent": + return cast( + "V1InvoiceVoidedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceVoidedEvent(Event): + LOOKUP_TYPE = "v1.invoice.voided" + type: Literal["v1.invoice.voided"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoice_will_be_due_event.py b/stripe/events/_v1_invoice_will_be_due_event.py new file mode 100644 index 000000000..c38de509d --- /dev/null +++ b/stripe/events/_v1_invoice_will_be_due_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoiceWillBeDueEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.will_be_due" + type: Literal["v1.invoice.will_be_due"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceWillBeDueEvent": + return cast( + "V1InvoiceWillBeDueEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Invoice": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceWillBeDueEvent": + return cast( + "V1InvoiceWillBeDueEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Invoice": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Invoice", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceWillBeDueEvent(Event): + LOOKUP_TYPE = "v1.invoice.will_be_due" + type: Literal["v1.invoice.will_be_due"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Invoice": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Invoice", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoiceitem_created_event.py b/stripe/events/_v1_invoiceitem_created_event.py new file mode 100644 index 000000000..e22e24cc5 --- /dev/null +++ b/stripe/events/_v1_invoiceitem_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice_item import InvoiceItem + from stripe._stripe_client import StripeClient + + +class V1InvoiceitemCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoiceitem.created" + type: Literal["v1.invoiceitem.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceitemCreatedEvent": + return cast( + "V1InvoiceitemCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "InvoiceItem": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoiceItem", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceitemCreatedEvent": + return cast( + "V1InvoiceitemCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "InvoiceItem": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoiceItem", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceitemCreatedEvent(Event): + LOOKUP_TYPE = "v1.invoiceitem.created" + type: Literal["v1.invoiceitem.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "InvoiceItem": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "InvoiceItem", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_invoiceitem_deleted_event.py b/stripe/events/_v1_invoiceitem_deleted_event.py new file mode 100644 index 000000000..0c7737464 --- /dev/null +++ b/stripe/events/_v1_invoiceitem_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._invoice_item import InvoiceItem + from stripe._stripe_client import StripeClient + + +class V1InvoiceitemDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoiceitem.deleted" + type: Literal["v1.invoiceitem.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1InvoiceitemDeletedEvent": + return cast( + "V1InvoiceitemDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "InvoiceItem": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoiceItem", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1InvoiceitemDeletedEvent": + return cast( + "V1InvoiceitemDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "InvoiceItem": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "InvoiceItem", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1InvoiceitemDeletedEvent(Event): + LOOKUP_TYPE = "v1.invoiceitem.deleted" + type: Literal["v1.invoiceitem.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "InvoiceItem": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "InvoiceItem", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_authorization_created_event.py b/stripe/events/_v1_issuing_authorization_created_event.py new file mode 100644 index 000000000..54fc6c999 --- /dev/null +++ b/stripe/events/_v1_issuing_authorization_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._authorization import Authorization + + +class V1IssuingAuthorizationCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_authorization.created" + type: Literal["v1.issuing_authorization.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingAuthorizationCreatedEvent": + return cast( + "V1IssuingAuthorizationCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Authorization": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingAuthorizationCreatedEvent": + return cast( + "V1IssuingAuthorizationCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Authorization": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingAuthorizationCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_authorization.created" + type: Literal["v1.issuing_authorization.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Authorization": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Authorization", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_authorization_request_event.py b/stripe/events/_v1_issuing_authorization_request_event.py new file mode 100644 index 000000000..cf3584114 --- /dev/null +++ b/stripe/events/_v1_issuing_authorization_request_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._authorization import Authorization + + +class V1IssuingAuthorizationRequestEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_authorization.request" + type: Literal["v1.issuing_authorization.request"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingAuthorizationRequestEvent": + return cast( + "V1IssuingAuthorizationRequestEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Authorization": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingAuthorizationRequestEvent": + return cast( + "V1IssuingAuthorizationRequestEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Authorization": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingAuthorizationRequestEvent(Event): + LOOKUP_TYPE = "v1.issuing_authorization.request" + type: Literal["v1.issuing_authorization.request"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Authorization": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Authorization", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_authorization_updated_event.py b/stripe/events/_v1_issuing_authorization_updated_event.py new file mode 100644 index 000000000..b6ff24ec4 --- /dev/null +++ b/stripe/events/_v1_issuing_authorization_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._authorization import Authorization + + +class V1IssuingAuthorizationUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_authorization.updated" + type: Literal["v1.issuing_authorization.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingAuthorizationUpdatedEvent": + return cast( + "V1IssuingAuthorizationUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Authorization": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingAuthorizationUpdatedEvent": + return cast( + "V1IssuingAuthorizationUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Authorization": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Authorization", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingAuthorizationUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_authorization.updated" + type: Literal["v1.issuing_authorization.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Authorization": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Authorization", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_card_created_event.py b/stripe/events/_v1_issuing_card_created_event.py new file mode 100644 index 000000000..891fd71b2 --- /dev/null +++ b/stripe/events/_v1_issuing_card_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._card import Card + + +class V1IssuingCardCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_card.created" + type: Literal["v1.issuing_card.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingCardCreatedEvent": + return cast( + "V1IssuingCardCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Card": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Card", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingCardCreatedEvent": + return cast( + "V1IssuingCardCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Card": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Card", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingCardCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_card.created" + type: Literal["v1.issuing_card.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Card": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Card", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_card_updated_event.py b/stripe/events/_v1_issuing_card_updated_event.py new file mode 100644 index 000000000..0023dd295 --- /dev/null +++ b/stripe/events/_v1_issuing_card_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._card import Card + + +class V1IssuingCardUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_card.updated" + type: Literal["v1.issuing_card.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingCardUpdatedEvent": + return cast( + "V1IssuingCardUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Card": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Card", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingCardUpdatedEvent": + return cast( + "V1IssuingCardUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Card": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Card", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingCardUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_card.updated" + type: Literal["v1.issuing_card.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Card": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Card", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_cardholder_created_event.py b/stripe/events/_v1_issuing_cardholder_created_event.py new file mode 100644 index 000000000..39b963eeb --- /dev/null +++ b/stripe/events/_v1_issuing_cardholder_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._cardholder import Cardholder + + +class V1IssuingCardholderCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_cardholder.created" + type: Literal["v1.issuing_cardholder.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingCardholderCreatedEvent": + return cast( + "V1IssuingCardholderCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Cardholder": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Cardholder", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingCardholderCreatedEvent": + return cast( + "V1IssuingCardholderCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Cardholder": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Cardholder", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingCardholderCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_cardholder.created" + type: Literal["v1.issuing_cardholder.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Cardholder": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Cardholder", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_cardholder_updated_event.py b/stripe/events/_v1_issuing_cardholder_updated_event.py new file mode 100644 index 000000000..fa219da33 --- /dev/null +++ b/stripe/events/_v1_issuing_cardholder_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._cardholder import Cardholder + + +class V1IssuingCardholderUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_cardholder.updated" + type: Literal["v1.issuing_cardholder.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingCardholderUpdatedEvent": + return cast( + "V1IssuingCardholderUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Cardholder": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Cardholder", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingCardholderUpdatedEvent": + return cast( + "V1IssuingCardholderUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Cardholder": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Cardholder", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingCardholderUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_cardholder.updated" + type: Literal["v1.issuing_cardholder.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Cardholder": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Cardholder", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_closed_event.py b/stripe/events/_v1_issuing_dispute_closed_event.py new file mode 100644 index 000000000..f0d6ece40 --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_closed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeClosedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.closed" + type: Literal["v1.issuing_dispute.closed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeClosedEvent": + return cast( + "V1IssuingDisputeClosedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingDisputeClosedEvent": + return cast( + "V1IssuingDisputeClosedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeClosedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.closed" + type: Literal["v1.issuing_dispute.closed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_created_event.py b/stripe/events/_v1_issuing_dispute_created_event.py new file mode 100644 index 000000000..f1db95f6f --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.created" + type: Literal["v1.issuing_dispute.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeCreatedEvent": + return cast( + "V1IssuingDisputeCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingDisputeCreatedEvent": + return cast( + "V1IssuingDisputeCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.created" + type: Literal["v1.issuing_dispute.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_funds_reinstated_event.py b/stripe/events/_v1_issuing_dispute_funds_reinstated_event.py new file mode 100644 index 000000000..d56592925 --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_funds_reinstated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeFundsReinstatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.funds_reinstated" + type: Literal["v1.issuing_dispute.funds_reinstated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeFundsReinstatedEvent": + return cast( + "V1IssuingDisputeFundsReinstatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingDisputeFundsReinstatedEvent": + return cast( + "V1IssuingDisputeFundsReinstatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeFundsReinstatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.funds_reinstated" + type: Literal["v1.issuing_dispute.funds_reinstated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_funds_rescinded_event.py b/stripe/events/_v1_issuing_dispute_funds_rescinded_event.py new file mode 100644 index 000000000..ab3b97d92 --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_funds_rescinded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeFundsRescindedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.funds_rescinded" + type: Literal["v1.issuing_dispute.funds_rescinded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeFundsRescindedEvent": + return cast( + "V1IssuingDisputeFundsRescindedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingDisputeFundsRescindedEvent": + return cast( + "V1IssuingDisputeFundsRescindedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeFundsRescindedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.funds_rescinded" + type: Literal["v1.issuing_dispute.funds_rescinded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_submitted_event.py b/stripe/events/_v1_issuing_dispute_submitted_event.py new file mode 100644 index 000000000..b3ab651d6 --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_submitted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeSubmittedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.submitted" + type: Literal["v1.issuing_dispute.submitted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeSubmittedEvent": + return cast( + "V1IssuingDisputeSubmittedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingDisputeSubmittedEvent": + return cast( + "V1IssuingDisputeSubmittedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeSubmittedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.submitted" + type: Literal["v1.issuing_dispute.submitted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_dispute_updated_event.py b/stripe/events/_v1_issuing_dispute_updated_event.py new file mode 100644 index 000000000..b1064288f --- /dev/null +++ b/stripe/events/_v1_issuing_dispute_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._dispute import Dispute + + +class V1IssuingDisputeUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_dispute.updated" + type: Literal["v1.issuing_dispute.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingDisputeUpdatedEvent": + return cast( + "V1IssuingDisputeUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Dispute": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingDisputeUpdatedEvent": + return cast( + "V1IssuingDisputeUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Dispute": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Dispute", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingDisputeUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_dispute.updated" + type: Literal["v1.issuing_dispute.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Dispute": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Dispute", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_personalization_design_activated_event.py b/stripe/events/_v1_issuing_personalization_design_activated_event.py new file mode 100644 index 000000000..f8d6c3c5a --- /dev/null +++ b/stripe/events/_v1_issuing_personalization_design_activated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._personalization_design import PersonalizationDesign + + +class V1IssuingPersonalizationDesignActivatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.issuing_personalization_design.activated" + type: Literal["v1.issuing_personalization_design.activated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingPersonalizationDesignActivatedEvent": + return cast( + "V1IssuingPersonalizationDesignActivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PersonalizationDesign": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingPersonalizationDesignActivatedEvent": + return cast( + "V1IssuingPersonalizationDesignActivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PersonalizationDesign": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingPersonalizationDesignActivatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_personalization_design.activated" + type: Literal["v1.issuing_personalization_design.activated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PersonalizationDesign": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PersonalizationDesign", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_personalization_design_deactivated_event.py b/stripe/events/_v1_issuing_personalization_design_deactivated_event.py new file mode 100644 index 000000000..ff266eda5 --- /dev/null +++ b/stripe/events/_v1_issuing_personalization_design_deactivated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._personalization_design import PersonalizationDesign + + +class V1IssuingPersonalizationDesignDeactivatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.issuing_personalization_design.deactivated" + type: Literal["v1.issuing_personalization_design.deactivated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingPersonalizationDesignDeactivatedEvent": + return cast( + "V1IssuingPersonalizationDesignDeactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PersonalizationDesign": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingPersonalizationDesignDeactivatedEvent": + return cast( + "V1IssuingPersonalizationDesignDeactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PersonalizationDesign": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingPersonalizationDesignDeactivatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_personalization_design.deactivated" + type: Literal["v1.issuing_personalization_design.deactivated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PersonalizationDesign": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PersonalizationDesign", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_personalization_design_rejected_event.py b/stripe/events/_v1_issuing_personalization_design_rejected_event.py new file mode 100644 index 000000000..e603cc701 --- /dev/null +++ b/stripe/events/_v1_issuing_personalization_design_rejected_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._personalization_design import PersonalizationDesign + + +class V1IssuingPersonalizationDesignRejectedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.issuing_personalization_design.rejected" + type: Literal["v1.issuing_personalization_design.rejected"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingPersonalizationDesignRejectedEvent": + return cast( + "V1IssuingPersonalizationDesignRejectedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PersonalizationDesign": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingPersonalizationDesignRejectedEvent": + return cast( + "V1IssuingPersonalizationDesignRejectedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PersonalizationDesign": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingPersonalizationDesignRejectedEvent(Event): + LOOKUP_TYPE = "v1.issuing_personalization_design.rejected" + type: Literal["v1.issuing_personalization_design.rejected"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PersonalizationDesign": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PersonalizationDesign", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_personalization_design_updated_event.py b/stripe/events/_v1_issuing_personalization_design_updated_event.py new file mode 100644 index 000000000..d108f6c18 --- /dev/null +++ b/stripe/events/_v1_issuing_personalization_design_updated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._personalization_design import PersonalizationDesign + + +class V1IssuingPersonalizationDesignUpdatedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v1.issuing_personalization_design.updated" + type: Literal["v1.issuing_personalization_design.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingPersonalizationDesignUpdatedEvent": + return cast( + "V1IssuingPersonalizationDesignUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PersonalizationDesign": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingPersonalizationDesignUpdatedEvent": + return cast( + "V1IssuingPersonalizationDesignUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PersonalizationDesign": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PersonalizationDesign", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingPersonalizationDesignUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_personalization_design.updated" + type: Literal["v1.issuing_personalization_design.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PersonalizationDesign": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PersonalizationDesign", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_token_created_event.py b/stripe/events/_v1_issuing_token_created_event.py new file mode 100644 index 000000000..c4f1da883 --- /dev/null +++ b/stripe/events/_v1_issuing_token_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._token import Token + + +class V1IssuingTokenCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_token.created" + type: Literal["v1.issuing_token.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingTokenCreatedEvent": + return cast( + "V1IssuingTokenCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Token": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Token", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingTokenCreatedEvent": + return cast( + "V1IssuingTokenCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Token": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Token", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingTokenCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_token.created" + type: Literal["v1.issuing_token.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Token": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Token", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_token_updated_event.py b/stripe/events/_v1_issuing_token_updated_event.py new file mode 100644 index 000000000..e62f845ae --- /dev/null +++ b/stripe/events/_v1_issuing_token_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._token import Token + + +class V1IssuingTokenUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_token.updated" + type: Literal["v1.issuing_token.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingTokenUpdatedEvent": + return cast( + "V1IssuingTokenUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Token": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Token", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingTokenUpdatedEvent": + return cast( + "V1IssuingTokenUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Token": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Token", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingTokenUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_token.updated" + type: Literal["v1.issuing_token.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Token": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Token", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_transaction_created_event.py b/stripe/events/_v1_issuing_transaction_created_event.py new file mode 100644 index 000000000..5cddfd2a6 --- /dev/null +++ b/stripe/events/_v1_issuing_transaction_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._transaction import Transaction + + +class V1IssuingTransactionCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_transaction.created" + type: Literal["v1.issuing_transaction.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingTransactionCreatedEvent": + return cast( + "V1IssuingTransactionCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transaction": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingTransactionCreatedEvent": + return cast( + "V1IssuingTransactionCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transaction": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingTransactionCreatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_transaction.created" + type: Literal["v1.issuing_transaction.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transaction": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transaction", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_transaction_purchase_details_receipt_updated_event.py b/stripe/events/_v1_issuing_transaction_purchase_details_receipt_updated_event.py new file mode 100644 index 000000000..6987b30be --- /dev/null +++ b/stripe/events/_v1_issuing_transaction_purchase_details_receipt_updated_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._transaction import Transaction + + +class V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.issuing_transaction.purchase_details_receipt_updated" + type: Literal["v1.issuing_transaction.purchase_details_receipt_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent": + return cast( + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transaction": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent": + return cast( + "V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transaction": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_transaction.purchase_details_receipt_updated" + type: Literal["v1.issuing_transaction.purchase_details_receipt_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transaction": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transaction", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_issuing_transaction_updated_event.py b/stripe/events/_v1_issuing_transaction_updated_event.py new file mode 100644 index 000000000..2b1ac1cd7 --- /dev/null +++ b/stripe/events/_v1_issuing_transaction_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.issuing._transaction import Transaction + + +class V1IssuingTransactionUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.issuing_transaction.updated" + type: Literal["v1.issuing_transaction.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1IssuingTransactionUpdatedEvent": + return cast( + "V1IssuingTransactionUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transaction": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1IssuingTransactionUpdatedEvent": + return cast( + "V1IssuingTransactionUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transaction": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1IssuingTransactionUpdatedEvent(Event): + LOOKUP_TYPE = "v1.issuing_transaction.updated" + type: Literal["v1.issuing_transaction.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transaction": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transaction", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_mandate_updated_event.py b/stripe/events/_v1_mandate_updated_event.py new file mode 100644 index 000000000..0fc7e7a83 --- /dev/null +++ b/stripe/events/_v1_mandate_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._mandate import Mandate + from stripe._stripe_client import StripeClient + + +class V1MandateUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.mandate.updated" + type: Literal["v1.mandate.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1MandateUpdatedEvent": + return cast( + "V1MandateUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Mandate": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Mandate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1MandateUpdatedEvent": + return cast( + "V1MandateUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Mandate": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Mandate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1MandateUpdatedEvent(Event): + LOOKUP_TYPE = "v1.mandate.updated" + type: Literal["v1.mandate.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Mandate": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Mandate", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_amount_capturable_updated_event.py b/stripe/events/_v1_payment_intent_amount_capturable_updated_event.py new file mode 100644 index 000000000..d79e238c7 --- /dev/null +++ b/stripe/events/_v1_payment_intent_amount_capturable_updated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentAmountCapturableUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.payment_intent.amount_capturable_updated" + type: Literal["v1.payment_intent.amount_capturable_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentAmountCapturableUpdatedEvent": + return cast( + "V1PaymentIntentAmountCapturableUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1PaymentIntentAmountCapturableUpdatedEvent": + return cast( + "V1PaymentIntentAmountCapturableUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentAmountCapturableUpdatedEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.amount_capturable_updated" + type: Literal["v1.payment_intent.amount_capturable_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_canceled_event.py b/stripe/events/_v1_payment_intent_canceled_event.py new file mode 100644 index 000000000..28f03d692 --- /dev/null +++ b/stripe/events/_v1_payment_intent_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.canceled" + type: Literal["v1.payment_intent.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentCanceledEvent": + return cast( + "V1PaymentIntentCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentCanceledEvent": + return cast( + "V1PaymentIntentCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentCanceledEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.canceled" + type: Literal["v1.payment_intent.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_created_event.py b/stripe/events/_v1_payment_intent_created_event.py new file mode 100644 index 000000000..7bf143cc6 --- /dev/null +++ b/stripe/events/_v1_payment_intent_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.created" + type: Literal["v1.payment_intent.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentCreatedEvent": + return cast( + "V1PaymentIntentCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentCreatedEvent": + return cast( + "V1PaymentIntentCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentCreatedEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.created" + type: Literal["v1.payment_intent.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_partially_funded_event.py b/stripe/events/_v1_payment_intent_partially_funded_event.py new file mode 100644 index 000000000..8751dc183 --- /dev/null +++ b/stripe/events/_v1_payment_intent_partially_funded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentPartiallyFundedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.partially_funded" + type: Literal["v1.payment_intent.partially_funded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentPartiallyFundedEvent": + return cast( + "V1PaymentIntentPartiallyFundedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentPartiallyFundedEvent": + return cast( + "V1PaymentIntentPartiallyFundedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentPartiallyFundedEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.partially_funded" + type: Literal["v1.payment_intent.partially_funded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_payment_failed_event.py b/stripe/events/_v1_payment_intent_payment_failed_event.py new file mode 100644 index 000000000..d31474cf9 --- /dev/null +++ b/stripe/events/_v1_payment_intent_payment_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentPaymentFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.payment_failed" + type: Literal["v1.payment_intent.payment_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentPaymentFailedEvent": + return cast( + "V1PaymentIntentPaymentFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentPaymentFailedEvent": + return cast( + "V1PaymentIntentPaymentFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentPaymentFailedEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.payment_failed" + type: Literal["v1.payment_intent.payment_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_processing_event.py b/stripe/events/_v1_payment_intent_processing_event.py new file mode 100644 index 000000000..512bfb516 --- /dev/null +++ b/stripe/events/_v1_payment_intent_processing_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentProcessingEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.processing" + type: Literal["v1.payment_intent.processing"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentProcessingEvent": + return cast( + "V1PaymentIntentProcessingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentProcessingEvent": + return cast( + "V1PaymentIntentProcessingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentProcessingEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.processing" + type: Literal["v1.payment_intent.processing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_requires_action_event.py b/stripe/events/_v1_payment_intent_requires_action_event.py new file mode 100644 index 000000000..1539b0076 --- /dev/null +++ b/stripe/events/_v1_payment_intent_requires_action_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentRequiresActionEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.requires_action" + type: Literal["v1.payment_intent.requires_action"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentRequiresActionEvent": + return cast( + "V1PaymentIntentRequiresActionEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentRequiresActionEvent": + return cast( + "V1PaymentIntentRequiresActionEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentRequiresActionEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.requires_action" + type: Literal["v1.payment_intent.requires_action"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_intent_succeeded_event.py b/stripe/events/_v1_payment_intent_succeeded_event.py new file mode 100644 index 000000000..ba09757bc --- /dev/null +++ b/stripe/events/_v1_payment_intent_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_intent import PaymentIntent + from stripe._stripe_client import StripeClient + + +class V1PaymentIntentSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_intent.succeeded" + type: Literal["v1.payment_intent.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentIntentSucceededEvent": + return cast( + "V1PaymentIntentSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentIntentSucceededEvent": + return cast( + "V1PaymentIntentSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentIntentSucceededEvent(Event): + LOOKUP_TYPE = "v1.payment_intent.succeeded" + type: Literal["v1.payment_intent.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_link_created_event.py b/stripe/events/_v1_payment_link_created_event.py new file mode 100644 index 000000000..866bb6a36 --- /dev/null +++ b/stripe/events/_v1_payment_link_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_link import PaymentLink + from stripe._stripe_client import StripeClient + + +class V1PaymentLinkCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_link.created" + type: Literal["v1.payment_link.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentLinkCreatedEvent": + return cast( + "V1PaymentLinkCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentLink": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentLink", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentLinkCreatedEvent": + return cast( + "V1PaymentLinkCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentLink": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentLink", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentLinkCreatedEvent(Event): + LOOKUP_TYPE = "v1.payment_link.created" + type: Literal["v1.payment_link.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentLink": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentLink", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_link_updated_event.py b/stripe/events/_v1_payment_link_updated_event.py new file mode 100644 index 000000000..58c595ebe --- /dev/null +++ b/stripe/events/_v1_payment_link_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_link import PaymentLink + from stripe._stripe_client import StripeClient + + +class V1PaymentLinkUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_link.updated" + type: Literal["v1.payment_link.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentLinkUpdatedEvent": + return cast( + "V1PaymentLinkUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentLink": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentLink", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentLinkUpdatedEvent": + return cast( + "V1PaymentLinkUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentLink": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentLink", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentLinkUpdatedEvent(Event): + LOOKUP_TYPE = "v1.payment_link.updated" + type: Literal["v1.payment_link.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentLink": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentLink", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_method_attached_event.py b/stripe/events/_v1_payment_method_attached_event.py new file mode 100644 index 000000000..e035af46e --- /dev/null +++ b/stripe/events/_v1_payment_method_attached_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_method import PaymentMethod + from stripe._stripe_client import StripeClient + + +class V1PaymentMethodAttachedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_method.attached" + type: Literal["v1.payment_method.attached"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentMethodAttachedEvent": + return cast( + "V1PaymentMethodAttachedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentMethod": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentMethodAttachedEvent": + return cast( + "V1PaymentMethodAttachedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentMethod": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentMethodAttachedEvent(Event): + LOOKUP_TYPE = "v1.payment_method.attached" + type: Literal["v1.payment_method.attached"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentMethod": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentMethod", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_method_automatically_updated_event.py b/stripe/events/_v1_payment_method_automatically_updated_event.py new file mode 100644 index 000000000..e9f282e55 --- /dev/null +++ b/stripe/events/_v1_payment_method_automatically_updated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_method import PaymentMethod + from stripe._stripe_client import StripeClient + + +class V1PaymentMethodAutomaticallyUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_method.automatically_updated" + type: Literal["v1.payment_method.automatically_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentMethodAutomaticallyUpdatedEvent": + return cast( + "V1PaymentMethodAutomaticallyUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentMethod": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1PaymentMethodAutomaticallyUpdatedEvent": + return cast( + "V1PaymentMethodAutomaticallyUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentMethod": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentMethodAutomaticallyUpdatedEvent(Event): + LOOKUP_TYPE = "v1.payment_method.automatically_updated" + type: Literal["v1.payment_method.automatically_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentMethod": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentMethod", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_method_detached_event.py b/stripe/events/_v1_payment_method_detached_event.py new file mode 100644 index 000000000..529a5d93b --- /dev/null +++ b/stripe/events/_v1_payment_method_detached_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_method import PaymentMethod + from stripe._stripe_client import StripeClient + + +class V1PaymentMethodDetachedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_method.detached" + type: Literal["v1.payment_method.detached"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentMethodDetachedEvent": + return cast( + "V1PaymentMethodDetachedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentMethod": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentMethodDetachedEvent": + return cast( + "V1PaymentMethodDetachedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentMethod": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentMethodDetachedEvent(Event): + LOOKUP_TYPE = "v1.payment_method.detached" + type: Literal["v1.payment_method.detached"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentMethod": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentMethod", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payment_method_updated_event.py b/stripe/events/_v1_payment_method_updated_event.py new file mode 100644 index 000000000..79dccc516 --- /dev/null +++ b/stripe/events/_v1_payment_method_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payment_method import PaymentMethod + from stripe._stripe_client import StripeClient + + +class V1PaymentMethodUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payment_method.updated" + type: Literal["v1.payment_method.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PaymentMethodUpdatedEvent": + return cast( + "V1PaymentMethodUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PaymentMethod": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PaymentMethodUpdatedEvent": + return cast( + "V1PaymentMethodUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PaymentMethod": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PaymentMethod", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PaymentMethodUpdatedEvent(Event): + LOOKUP_TYPE = "v1.payment_method.updated" + type: Literal["v1.payment_method.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PaymentMethod": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PaymentMethod", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_canceled_event.py b/stripe/events/_v1_payout_canceled_event.py new file mode 100644 index 000000000..cb8eba5ac --- /dev/null +++ b/stripe/events/_v1_payout_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.canceled" + type: Literal["v1.payout.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutCanceledEvent": + return cast( + "V1PayoutCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PayoutCanceledEvent": + return cast( + "V1PayoutCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutCanceledEvent(Event): + LOOKUP_TYPE = "v1.payout.canceled" + type: Literal["v1.payout.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_created_event.py b/stripe/events/_v1_payout_created_event.py new file mode 100644 index 000000000..89908d300 --- /dev/null +++ b/stripe/events/_v1_payout_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.created" + type: Literal["v1.payout.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutCreatedEvent": + return cast( + "V1PayoutCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PayoutCreatedEvent": + return cast( + "V1PayoutCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutCreatedEvent(Event): + LOOKUP_TYPE = "v1.payout.created" + type: Literal["v1.payout.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_failed_event.py b/stripe/events/_v1_payout_failed_event.py new file mode 100644 index 000000000..f17aff68e --- /dev/null +++ b/stripe/events/_v1_payout_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.failed" + type: Literal["v1.payout.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutFailedEvent": + return cast( + "V1PayoutFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PayoutFailedEvent": + return cast( + "V1PayoutFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutFailedEvent(Event): + LOOKUP_TYPE = "v1.payout.failed" + type: Literal["v1.payout.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_paid_event.py b/stripe/events/_v1_payout_paid_event.py new file mode 100644 index 000000000..742eea11e --- /dev/null +++ b/stripe/events/_v1_payout_paid_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutPaidEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.paid" + type: Literal["v1.payout.paid"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutPaidEvent": + return cast( + "V1PayoutPaidEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PayoutPaidEvent": + return cast( + "V1PayoutPaidEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutPaidEvent(Event): + LOOKUP_TYPE = "v1.payout.paid" + type: Literal["v1.payout.paid"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_reconciliation_completed_event.py b/stripe/events/_v1_payout_reconciliation_completed_event.py new file mode 100644 index 000000000..76fe7bc76 --- /dev/null +++ b/stripe/events/_v1_payout_reconciliation_completed_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutReconciliationCompletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.reconciliation_completed" + type: Literal["v1.payout.reconciliation_completed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutReconciliationCompletedEvent": + return cast( + "V1PayoutReconciliationCompletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1PayoutReconciliationCompletedEvent": + return cast( + "V1PayoutReconciliationCompletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutReconciliationCompletedEvent(Event): + LOOKUP_TYPE = "v1.payout.reconciliation_completed" + type: Literal["v1.payout.reconciliation_completed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_payout_updated_event.py b/stripe/events/_v1_payout_updated_event.py new file mode 100644 index 000000000..fd8749f44 --- /dev/null +++ b/stripe/events/_v1_payout_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._payout import Payout + from stripe._stripe_client import StripeClient + + +class V1PayoutUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.payout.updated" + type: Literal["v1.payout.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PayoutUpdatedEvent": + return cast( + "V1PayoutUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Payout": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PayoutUpdatedEvent": + return cast( + "V1PayoutUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Payout": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Payout", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PayoutUpdatedEvent(Event): + LOOKUP_TYPE = "v1.payout.updated" + type: Literal["v1.payout.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Payout": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Payout", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_person_created_event.py b/stripe/events/_v1_person_created_event.py new file mode 100644 index 000000000..6c14aab3e --- /dev/null +++ b/stripe/events/_v1_person_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._person import Person + from stripe._stripe_client import StripeClient + + +class V1PersonCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.person.created" + type: Literal["v1.person.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PersonCreatedEvent": + return cast( + "V1PersonCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Person": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PersonCreatedEvent": + return cast( + "V1PersonCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Person": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PersonCreatedEvent(Event): + LOOKUP_TYPE = "v1.person.created" + type: Literal["v1.person.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Person": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Person", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_person_deleted_event.py b/stripe/events/_v1_person_deleted_event.py new file mode 100644 index 000000000..72c42a9e3 --- /dev/null +++ b/stripe/events/_v1_person_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._person import Person + from stripe._stripe_client import StripeClient + + +class V1PersonDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.person.deleted" + type: Literal["v1.person.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PersonDeletedEvent": + return cast( + "V1PersonDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Person": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PersonDeletedEvent": + return cast( + "V1PersonDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Person": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PersonDeletedEvent(Event): + LOOKUP_TYPE = "v1.person.deleted" + type: Literal["v1.person.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Person": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Person", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_person_updated_event.py b/stripe/events/_v1_person_updated_event.py new file mode 100644 index 000000000..8cd8a5ed5 --- /dev/null +++ b/stripe/events/_v1_person_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._person import Person + from stripe._stripe_client import StripeClient + + +class V1PersonUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.person.updated" + type: Literal["v1.person.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PersonUpdatedEvent": + return cast( + "V1PersonUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Person": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PersonUpdatedEvent": + return cast( + "V1PersonUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Person": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Person", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PersonUpdatedEvent(Event): + LOOKUP_TYPE = "v1.person.updated" + type: Literal["v1.person.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Person": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Person", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_plan_created_event.py b/stripe/events/_v1_plan_created_event.py new file mode 100644 index 000000000..32c5d6256 --- /dev/null +++ b/stripe/events/_v1_plan_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._plan import Plan + from stripe._stripe_client import StripeClient + + +class V1PlanCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.plan.created" + type: Literal["v1.plan.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PlanCreatedEvent": + return cast( + "V1PlanCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Plan": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PlanCreatedEvent": + return cast( + "V1PlanCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Plan": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PlanCreatedEvent(Event): + LOOKUP_TYPE = "v1.plan.created" + type: Literal["v1.plan.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Plan": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Plan", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_plan_deleted_event.py b/stripe/events/_v1_plan_deleted_event.py new file mode 100644 index 000000000..13c336b7b --- /dev/null +++ b/stripe/events/_v1_plan_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._plan import Plan + from stripe._stripe_client import StripeClient + + +class V1PlanDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.plan.deleted" + type: Literal["v1.plan.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PlanDeletedEvent": + return cast( + "V1PlanDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Plan": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PlanDeletedEvent": + return cast( + "V1PlanDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Plan": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PlanDeletedEvent(Event): + LOOKUP_TYPE = "v1.plan.deleted" + type: Literal["v1.plan.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Plan": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Plan", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_plan_updated_event.py b/stripe/events/_v1_plan_updated_event.py new file mode 100644 index 000000000..3509d9623 --- /dev/null +++ b/stripe/events/_v1_plan_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._plan import Plan + from stripe._stripe_client import StripeClient + + +class V1PlanUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.plan.updated" + type: Literal["v1.plan.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PlanUpdatedEvent": + return cast( + "V1PlanUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Plan": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PlanUpdatedEvent": + return cast( + "V1PlanUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Plan": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Plan", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PlanUpdatedEvent(Event): + LOOKUP_TYPE = "v1.plan.updated" + type: Literal["v1.plan.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Plan": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Plan", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_price_created_event.py b/stripe/events/_v1_price_created_event.py new file mode 100644 index 000000000..120114bfa --- /dev/null +++ b/stripe/events/_v1_price_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._price import Price + from stripe._stripe_client import StripeClient + + +class V1PriceCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.price.created" + type: Literal["v1.price.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PriceCreatedEvent": + return cast( + "V1PriceCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Price": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PriceCreatedEvent": + return cast( + "V1PriceCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Price": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PriceCreatedEvent(Event): + LOOKUP_TYPE = "v1.price.created" + type: Literal["v1.price.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Price": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Price", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_price_deleted_event.py b/stripe/events/_v1_price_deleted_event.py new file mode 100644 index 000000000..d463b3162 --- /dev/null +++ b/stripe/events/_v1_price_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._price import Price + from stripe._stripe_client import StripeClient + + +class V1PriceDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.price.deleted" + type: Literal["v1.price.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PriceDeletedEvent": + return cast( + "V1PriceDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Price": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PriceDeletedEvent": + return cast( + "V1PriceDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Price": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PriceDeletedEvent(Event): + LOOKUP_TYPE = "v1.price.deleted" + type: Literal["v1.price.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Price": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Price", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_price_updated_event.py b/stripe/events/_v1_price_updated_event.py new file mode 100644 index 000000000..6fa3cfe5f --- /dev/null +++ b/stripe/events/_v1_price_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._price import Price + from stripe._stripe_client import StripeClient + + +class V1PriceUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.price.updated" + type: Literal["v1.price.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PriceUpdatedEvent": + return cast( + "V1PriceUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Price": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PriceUpdatedEvent": + return cast( + "V1PriceUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Price": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Price", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PriceUpdatedEvent(Event): + LOOKUP_TYPE = "v1.price.updated" + type: Literal["v1.price.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Price": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Price", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_product_created_event.py b/stripe/events/_v1_product_created_event.py new file mode 100644 index 000000000..c2affb9a6 --- /dev/null +++ b/stripe/events/_v1_product_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._product import Product + from stripe._stripe_client import StripeClient + + +class V1ProductCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.product.created" + type: Literal["v1.product.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ProductCreatedEvent": + return cast( + "V1ProductCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Product": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ProductCreatedEvent": + return cast( + "V1ProductCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Product": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ProductCreatedEvent(Event): + LOOKUP_TYPE = "v1.product.created" + type: Literal["v1.product.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Product": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Product", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_product_deleted_event.py b/stripe/events/_v1_product_deleted_event.py new file mode 100644 index 000000000..45a757c2b --- /dev/null +++ b/stripe/events/_v1_product_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._product import Product + from stripe._stripe_client import StripeClient + + +class V1ProductDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.product.deleted" + type: Literal["v1.product.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ProductDeletedEvent": + return cast( + "V1ProductDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Product": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ProductDeletedEvent": + return cast( + "V1ProductDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Product": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ProductDeletedEvent(Event): + LOOKUP_TYPE = "v1.product.deleted" + type: Literal["v1.product.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Product": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Product", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_product_updated_event.py b/stripe/events/_v1_product_updated_event.py new file mode 100644 index 000000000..4246f9299 --- /dev/null +++ b/stripe/events/_v1_product_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._product import Product + from stripe._stripe_client import StripeClient + + +class V1ProductUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.product.updated" + type: Literal["v1.product.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ProductUpdatedEvent": + return cast( + "V1ProductUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Product": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ProductUpdatedEvent": + return cast( + "V1ProductUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Product": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Product", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ProductUpdatedEvent(Event): + LOOKUP_TYPE = "v1.product.updated" + type: Literal["v1.product.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Product": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Product", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_promotion_code_created_event.py b/stripe/events/_v1_promotion_code_created_event.py new file mode 100644 index 000000000..f37423719 --- /dev/null +++ b/stripe/events/_v1_promotion_code_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._promotion_code import PromotionCode + from stripe._stripe_client import StripeClient + + +class V1PromotionCodeCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.promotion_code.created" + type: Literal["v1.promotion_code.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PromotionCodeCreatedEvent": + return cast( + "V1PromotionCodeCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PromotionCode": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PromotionCode", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PromotionCodeCreatedEvent": + return cast( + "V1PromotionCodeCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PromotionCode": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PromotionCode", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PromotionCodeCreatedEvent(Event): + LOOKUP_TYPE = "v1.promotion_code.created" + type: Literal["v1.promotion_code.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PromotionCode": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PromotionCode", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_promotion_code_updated_event.py b/stripe/events/_v1_promotion_code_updated_event.py new file mode 100644 index 000000000..de4bcf498 --- /dev/null +++ b/stripe/events/_v1_promotion_code_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._promotion_code import PromotionCode + from stripe._stripe_client import StripeClient + + +class V1PromotionCodeUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.promotion_code.updated" + type: Literal["v1.promotion_code.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1PromotionCodeUpdatedEvent": + return cast( + "V1PromotionCodeUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "PromotionCode": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PromotionCode", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1PromotionCodeUpdatedEvent": + return cast( + "V1PromotionCodeUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "PromotionCode": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "PromotionCode", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1PromotionCodeUpdatedEvent(Event): + LOOKUP_TYPE = "v1.promotion_code.updated" + type: Literal["v1.promotion_code.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "PromotionCode": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "PromotionCode", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_quote_accepted_event.py b/stripe/events/_v1_quote_accepted_event.py new file mode 100644 index 000000000..acaea2d58 --- /dev/null +++ b/stripe/events/_v1_quote_accepted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._quote import Quote + from stripe._stripe_client import StripeClient + + +class V1QuoteAcceptedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.quote.accepted" + type: Literal["v1.quote.accepted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1QuoteAcceptedEvent": + return cast( + "V1QuoteAcceptedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Quote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1QuoteAcceptedEvent": + return cast( + "V1QuoteAcceptedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Quote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1QuoteAcceptedEvent(Event): + LOOKUP_TYPE = "v1.quote.accepted" + type: Literal["v1.quote.accepted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Quote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Quote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_quote_canceled_event.py b/stripe/events/_v1_quote_canceled_event.py new file mode 100644 index 000000000..08a44703a --- /dev/null +++ b/stripe/events/_v1_quote_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._quote import Quote + from stripe._stripe_client import StripeClient + + +class V1QuoteCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.quote.canceled" + type: Literal["v1.quote.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1QuoteCanceledEvent": + return cast( + "V1QuoteCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Quote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1QuoteCanceledEvent": + return cast( + "V1QuoteCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Quote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1QuoteCanceledEvent(Event): + LOOKUP_TYPE = "v1.quote.canceled" + type: Literal["v1.quote.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Quote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Quote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_quote_created_event.py b/stripe/events/_v1_quote_created_event.py new file mode 100644 index 000000000..2f591797f --- /dev/null +++ b/stripe/events/_v1_quote_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._quote import Quote + from stripe._stripe_client import StripeClient + + +class V1QuoteCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.quote.created" + type: Literal["v1.quote.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1QuoteCreatedEvent": + return cast( + "V1QuoteCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Quote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1QuoteCreatedEvent": + return cast( + "V1QuoteCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Quote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1QuoteCreatedEvent(Event): + LOOKUP_TYPE = "v1.quote.created" + type: Literal["v1.quote.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Quote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Quote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_quote_finalized_event.py b/stripe/events/_v1_quote_finalized_event.py new file mode 100644 index 000000000..af7266ade --- /dev/null +++ b/stripe/events/_v1_quote_finalized_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._quote import Quote + from stripe._stripe_client import StripeClient + + +class V1QuoteFinalizedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.quote.finalized" + type: Literal["v1.quote.finalized"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1QuoteFinalizedEvent": + return cast( + "V1QuoteFinalizedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Quote": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1QuoteFinalizedEvent": + return cast( + "V1QuoteFinalizedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Quote": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Quote", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1QuoteFinalizedEvent(Event): + LOOKUP_TYPE = "v1.quote.finalized" + type: Literal["v1.quote.finalized"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Quote": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Quote", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_radar_early_fraud_warning_created_event.py b/stripe/events/_v1_radar_early_fraud_warning_created_event.py new file mode 100644 index 000000000..ff8dc0036 --- /dev/null +++ b/stripe/events/_v1_radar_early_fraud_warning_created_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.radar._early_fraud_warning import EarlyFraudWarning + + +class V1RadarEarlyFraudWarningCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.radar.early_fraud_warning.created" + type: Literal["v1.radar.early_fraud_warning.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1RadarEarlyFraudWarningCreatedEvent": + return cast( + "V1RadarEarlyFraudWarningCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "EarlyFraudWarning": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "EarlyFraudWarning", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1RadarEarlyFraudWarningCreatedEvent": + return cast( + "V1RadarEarlyFraudWarningCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "EarlyFraudWarning": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "EarlyFraudWarning", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1RadarEarlyFraudWarningCreatedEvent(Event): + LOOKUP_TYPE = "v1.radar.early_fraud_warning.created" + type: Literal["v1.radar.early_fraud_warning.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "EarlyFraudWarning": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "EarlyFraudWarning", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_radar_early_fraud_warning_updated_event.py b/stripe/events/_v1_radar_early_fraud_warning_updated_event.py new file mode 100644 index 000000000..3479a9984 --- /dev/null +++ b/stripe/events/_v1_radar_early_fraud_warning_updated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.radar._early_fraud_warning import EarlyFraudWarning + + +class V1RadarEarlyFraudWarningUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.radar.early_fraud_warning.updated" + type: Literal["v1.radar.early_fraud_warning.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1RadarEarlyFraudWarningUpdatedEvent": + return cast( + "V1RadarEarlyFraudWarningUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "EarlyFraudWarning": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "EarlyFraudWarning", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1RadarEarlyFraudWarningUpdatedEvent": + return cast( + "V1RadarEarlyFraudWarningUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "EarlyFraudWarning": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "EarlyFraudWarning", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1RadarEarlyFraudWarningUpdatedEvent(Event): + LOOKUP_TYPE = "v1.radar.early_fraud_warning.updated" + type: Literal["v1.radar.early_fraud_warning.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "EarlyFraudWarning": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "EarlyFraudWarning", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_refund_created_event.py b/stripe/events/_v1_refund_created_event.py new file mode 100644 index 000000000..dc9d7bac3 --- /dev/null +++ b/stripe/events/_v1_refund_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._refund import Refund + from stripe._stripe_client import StripeClient + + +class V1RefundCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.refund.created" + type: Literal["v1.refund.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1RefundCreatedEvent": + return cast( + "V1RefundCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Refund": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1RefundCreatedEvent": + return cast( + "V1RefundCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Refund": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1RefundCreatedEvent(Event): + LOOKUP_TYPE = "v1.refund.created" + type: Literal["v1.refund.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Refund": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Refund", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_refund_failed_event.py b/stripe/events/_v1_refund_failed_event.py new file mode 100644 index 000000000..e945785ee --- /dev/null +++ b/stripe/events/_v1_refund_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._refund import Refund + from stripe._stripe_client import StripeClient + + +class V1RefundFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.refund.failed" + type: Literal["v1.refund.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1RefundFailedEvent": + return cast( + "V1RefundFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Refund": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1RefundFailedEvent": + return cast( + "V1RefundFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Refund": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1RefundFailedEvent(Event): + LOOKUP_TYPE = "v1.refund.failed" + type: Literal["v1.refund.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Refund": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Refund", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_refund_updated_event.py b/stripe/events/_v1_refund_updated_event.py new file mode 100644 index 000000000..8bf948e72 --- /dev/null +++ b/stripe/events/_v1_refund_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._refund import Refund + from stripe._stripe_client import StripeClient + + +class V1RefundUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.refund.updated" + type: Literal["v1.refund.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1RefundUpdatedEvent": + return cast( + "V1RefundUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Refund": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1RefundUpdatedEvent": + return cast( + "V1RefundUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Refund": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Refund", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1RefundUpdatedEvent(Event): + LOOKUP_TYPE = "v1.refund.updated" + type: Literal["v1.refund.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Refund": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Refund", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_review_closed_event.py b/stripe/events/_v1_review_closed_event.py new file mode 100644 index 000000000..e385827cd --- /dev/null +++ b/stripe/events/_v1_review_closed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._review import Review + from stripe._stripe_client import StripeClient + + +class V1ReviewClosedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.review.closed" + type: Literal["v1.review.closed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ReviewClosedEvent": + return cast( + "V1ReviewClosedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Review": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Review", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ReviewClosedEvent": + return cast( + "V1ReviewClosedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Review": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Review", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ReviewClosedEvent(Event): + LOOKUP_TYPE = "v1.review.closed" + type: Literal["v1.review.closed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Review": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Review", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_review_opened_event.py b/stripe/events/_v1_review_opened_event.py new file mode 100644 index 000000000..8fd8d0157 --- /dev/null +++ b/stripe/events/_v1_review_opened_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._review import Review + from stripe._stripe_client import StripeClient + + +class V1ReviewOpenedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.review.opened" + type: Literal["v1.review.opened"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1ReviewOpenedEvent": + return cast( + "V1ReviewOpenedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Review": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Review", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1ReviewOpenedEvent": + return cast( + "V1ReviewOpenedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Review": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Review", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1ReviewOpenedEvent(Event): + LOOKUP_TYPE = "v1.review.opened" + type: Literal["v1.review.opened"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Review": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Review", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_setup_intent_canceled_event.py b/stripe/events/_v1_setup_intent_canceled_event.py new file mode 100644 index 000000000..81ae4f0f0 --- /dev/null +++ b/stripe/events/_v1_setup_intent_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._setup_intent import SetupIntent + from stripe._stripe_client import StripeClient + + +class V1SetupIntentCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.setup_intent.canceled" + type: Literal["v1.setup_intent.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SetupIntentCanceledEvent": + return cast( + "V1SetupIntentCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SetupIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SetupIntentCanceledEvent": + return cast( + "V1SetupIntentCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SetupIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SetupIntentCanceledEvent(Event): + LOOKUP_TYPE = "v1.setup_intent.canceled" + type: Literal["v1.setup_intent.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SetupIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SetupIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_setup_intent_created_event.py b/stripe/events/_v1_setup_intent_created_event.py new file mode 100644 index 000000000..4f8ec3a83 --- /dev/null +++ b/stripe/events/_v1_setup_intent_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._setup_intent import SetupIntent + from stripe._stripe_client import StripeClient + + +class V1SetupIntentCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.setup_intent.created" + type: Literal["v1.setup_intent.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SetupIntentCreatedEvent": + return cast( + "V1SetupIntentCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SetupIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SetupIntentCreatedEvent": + return cast( + "V1SetupIntentCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SetupIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SetupIntentCreatedEvent(Event): + LOOKUP_TYPE = "v1.setup_intent.created" + type: Literal["v1.setup_intent.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SetupIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SetupIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_setup_intent_requires_action_event.py b/stripe/events/_v1_setup_intent_requires_action_event.py new file mode 100644 index 000000000..57884233a --- /dev/null +++ b/stripe/events/_v1_setup_intent_requires_action_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._setup_intent import SetupIntent + from stripe._stripe_client import StripeClient + + +class V1SetupIntentRequiresActionEventNotification(EventNotification): + LOOKUP_TYPE = "v1.setup_intent.requires_action" + type: Literal["v1.setup_intent.requires_action"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SetupIntentRequiresActionEvent": + return cast( + "V1SetupIntentRequiresActionEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SetupIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SetupIntentRequiresActionEvent": + return cast( + "V1SetupIntentRequiresActionEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SetupIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SetupIntentRequiresActionEvent(Event): + LOOKUP_TYPE = "v1.setup_intent.requires_action" + type: Literal["v1.setup_intent.requires_action"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SetupIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SetupIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_setup_intent_setup_failed_event.py b/stripe/events/_v1_setup_intent_setup_failed_event.py new file mode 100644 index 000000000..1938ce963 --- /dev/null +++ b/stripe/events/_v1_setup_intent_setup_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._setup_intent import SetupIntent + from stripe._stripe_client import StripeClient + + +class V1SetupIntentSetupFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.setup_intent.setup_failed" + type: Literal["v1.setup_intent.setup_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SetupIntentSetupFailedEvent": + return cast( + "V1SetupIntentSetupFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SetupIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SetupIntentSetupFailedEvent": + return cast( + "V1SetupIntentSetupFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SetupIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SetupIntentSetupFailedEvent(Event): + LOOKUP_TYPE = "v1.setup_intent.setup_failed" + type: Literal["v1.setup_intent.setup_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SetupIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SetupIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_setup_intent_succeeded_event.py b/stripe/events/_v1_setup_intent_succeeded_event.py new file mode 100644 index 000000000..04038cd16 --- /dev/null +++ b/stripe/events/_v1_setup_intent_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._setup_intent import SetupIntent + from stripe._stripe_client import StripeClient + + +class V1SetupIntentSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.setup_intent.succeeded" + type: Literal["v1.setup_intent.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SetupIntentSucceededEvent": + return cast( + "V1SetupIntentSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SetupIntent": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SetupIntentSucceededEvent": + return cast( + "V1SetupIntentSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SetupIntent": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SetupIntent", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SetupIntentSucceededEvent(Event): + LOOKUP_TYPE = "v1.setup_intent.succeeded" + type: Literal["v1.setup_intent.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SetupIntent": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SetupIntent", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_sigma_scheduled_query_run_created_event.py b/stripe/events/_v1_sigma_scheduled_query_run_created_event.py new file mode 100644 index 000000000..675d45315 --- /dev/null +++ b/stripe/events/_v1_sigma_scheduled_query_run_created_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.sigma._scheduled_query_run import ScheduledQueryRun + + +class V1SigmaScheduledQueryRunCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.sigma.scheduled_query_run.created" + type: Literal["v1.sigma.scheduled_query_run.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SigmaScheduledQueryRunCreatedEvent": + return cast( + "V1SigmaScheduledQueryRunCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ScheduledQueryRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ScheduledQueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1SigmaScheduledQueryRunCreatedEvent": + return cast( + "V1SigmaScheduledQueryRunCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ScheduledQueryRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ScheduledQueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SigmaScheduledQueryRunCreatedEvent(Event): + LOOKUP_TYPE = "v1.sigma.scheduled_query_run.created" + type: Literal["v1.sigma.scheduled_query_run.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ScheduledQueryRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ScheduledQueryRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_source_canceled_event.py b/stripe/events/_v1_source_canceled_event.py new file mode 100644 index 000000000..b2965147a --- /dev/null +++ b/stripe/events/_v1_source_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._source import Source + from stripe._stripe_client import StripeClient + + +class V1SourceCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.source.canceled" + type: Literal["v1.source.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SourceCanceledEvent": + return cast( + "V1SourceCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Source": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SourceCanceledEvent": + return cast( + "V1SourceCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Source": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SourceCanceledEvent(Event): + LOOKUP_TYPE = "v1.source.canceled" + type: Literal["v1.source.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Source": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Source", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_source_chargeable_event.py b/stripe/events/_v1_source_chargeable_event.py new file mode 100644 index 000000000..39961ba9b --- /dev/null +++ b/stripe/events/_v1_source_chargeable_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._source import Source + from stripe._stripe_client import StripeClient + + +class V1SourceChargeableEventNotification(EventNotification): + LOOKUP_TYPE = "v1.source.chargeable" + type: Literal["v1.source.chargeable"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SourceChargeableEvent": + return cast( + "V1SourceChargeableEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Source": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SourceChargeableEvent": + return cast( + "V1SourceChargeableEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Source": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SourceChargeableEvent(Event): + LOOKUP_TYPE = "v1.source.chargeable" + type: Literal["v1.source.chargeable"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Source": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Source", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_source_failed_event.py b/stripe/events/_v1_source_failed_event.py new file mode 100644 index 000000000..8f5d9a562 --- /dev/null +++ b/stripe/events/_v1_source_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._source import Source + from stripe._stripe_client import StripeClient + + +class V1SourceFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.source.failed" + type: Literal["v1.source.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SourceFailedEvent": + return cast( + "V1SourceFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Source": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SourceFailedEvent": + return cast( + "V1SourceFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Source": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SourceFailedEvent(Event): + LOOKUP_TYPE = "v1.source.failed" + type: Literal["v1.source.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Source": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Source", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_source_refund_attributes_required_event.py b/stripe/events/_v1_source_refund_attributes_required_event.py new file mode 100644 index 000000000..3bb5e4845 --- /dev/null +++ b/stripe/events/_v1_source_refund_attributes_required_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._source import Source + from stripe._stripe_client import StripeClient + + +class V1SourceRefundAttributesRequiredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.source.refund_attributes_required" + type: Literal["v1.source.refund_attributes_required"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SourceRefundAttributesRequiredEvent": + return cast( + "V1SourceRefundAttributesRequiredEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Source": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1SourceRefundAttributesRequiredEvent": + return cast( + "V1SourceRefundAttributesRequiredEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Source": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Source", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SourceRefundAttributesRequiredEvent(Event): + LOOKUP_TYPE = "v1.source.refund_attributes_required" + type: Literal["v1.source.refund_attributes_required"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Source": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Source", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_aborted_event.py b/stripe/events/_v1_subscription_schedule_aborted_event.py new file mode 100644 index 000000000..badd88115 --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_aborted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleAbortedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.aborted" + type: Literal["v1.subscription_schedule.aborted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleAbortedEvent": + return cast( + "V1SubscriptionScheduleAbortedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleAbortedEvent": + return cast( + "V1SubscriptionScheduleAbortedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleAbortedEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.aborted" + type: Literal["v1.subscription_schedule.aborted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_canceled_event.py b/stripe/events/_v1_subscription_schedule_canceled_event.py new file mode 100644 index 000000000..6d75217cd --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.canceled" + type: Literal["v1.subscription_schedule.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleCanceledEvent": + return cast( + "V1SubscriptionScheduleCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleCanceledEvent": + return cast( + "V1SubscriptionScheduleCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleCanceledEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.canceled" + type: Literal["v1.subscription_schedule.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_completed_event.py b/stripe/events/_v1_subscription_schedule_completed_event.py new file mode 100644 index 000000000..cb35ff071 --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_completed_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleCompletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.completed" + type: Literal["v1.subscription_schedule.completed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleCompletedEvent": + return cast( + "V1SubscriptionScheduleCompletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1SubscriptionScheduleCompletedEvent": + return cast( + "V1SubscriptionScheduleCompletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleCompletedEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.completed" + type: Literal["v1.subscription_schedule.completed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_created_event.py b/stripe/events/_v1_subscription_schedule_created_event.py new file mode 100644 index 000000000..cf48ce47d --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.created" + type: Literal["v1.subscription_schedule.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleCreatedEvent": + return cast( + "V1SubscriptionScheduleCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleCreatedEvent": + return cast( + "V1SubscriptionScheduleCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleCreatedEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.created" + type: Literal["v1.subscription_schedule.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_expiring_event.py b/stripe/events/_v1_subscription_schedule_expiring_event.py new file mode 100644 index 000000000..61349469f --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_expiring_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleExpiringEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.expiring" + type: Literal["v1.subscription_schedule.expiring"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleExpiringEvent": + return cast( + "V1SubscriptionScheduleExpiringEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleExpiringEvent": + return cast( + "V1SubscriptionScheduleExpiringEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleExpiringEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.expiring" + type: Literal["v1.subscription_schedule.expiring"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_released_event.py b/stripe/events/_v1_subscription_schedule_released_event.py new file mode 100644 index 000000000..2cd2a41fb --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_released_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleReleasedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.released" + type: Literal["v1.subscription_schedule.released"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleReleasedEvent": + return cast( + "V1SubscriptionScheduleReleasedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleReleasedEvent": + return cast( + "V1SubscriptionScheduleReleasedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleReleasedEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.released" + type: Literal["v1.subscription_schedule.released"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_subscription_schedule_updated_event.py b/stripe/events/_v1_subscription_schedule_updated_event.py new file mode 100644 index 000000000..989208079 --- /dev/null +++ b/stripe/events/_v1_subscription_schedule_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._subscription_schedule import SubscriptionSchedule + + +class V1SubscriptionScheduleUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.subscription_schedule.updated" + type: Literal["v1.subscription_schedule.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1SubscriptionScheduleUpdatedEvent": + return cast( + "V1SubscriptionScheduleUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "SubscriptionSchedule": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1SubscriptionScheduleUpdatedEvent": + return cast( + "V1SubscriptionScheduleUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "SubscriptionSchedule": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "SubscriptionSchedule", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1SubscriptionScheduleUpdatedEvent(Event): + LOOKUP_TYPE = "v1.subscription_schedule.updated" + type: Literal["v1.subscription_schedule.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "SubscriptionSchedule": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "SubscriptionSchedule", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_tax_rate_created_event.py b/stripe/events/_v1_tax_rate_created_event.py new file mode 100644 index 000000000..8486ec42e --- /dev/null +++ b/stripe/events/_v1_tax_rate_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._tax_rate import TaxRate + + +class V1TaxRateCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.tax_rate.created" + type: Literal["v1.tax_rate.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TaxRateCreatedEvent": + return cast( + "V1TaxRateCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TaxRate": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxRate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TaxRateCreatedEvent": + return cast( + "V1TaxRateCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TaxRate": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxRate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TaxRateCreatedEvent(Event): + LOOKUP_TYPE = "v1.tax_rate.created" + type: Literal["v1.tax_rate.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TaxRate": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TaxRate", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_tax_rate_updated_event.py b/stripe/events/_v1_tax_rate_updated_event.py new file mode 100644 index 000000000..4fa987f3d --- /dev/null +++ b/stripe/events/_v1_tax_rate_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._tax_rate import TaxRate + + +class V1TaxRateUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.tax_rate.updated" + type: Literal["v1.tax_rate.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TaxRateUpdatedEvent": + return cast( + "V1TaxRateUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TaxRate": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxRate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TaxRateUpdatedEvent": + return cast( + "V1TaxRateUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TaxRate": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TaxRate", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TaxRateUpdatedEvent(Event): + LOOKUP_TYPE = "v1.tax_rate.updated" + type: Literal["v1.tax_rate.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TaxRate": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TaxRate", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_tax_settings_updated_event.py b/stripe/events/_v1_tax_settings_updated_event.py new file mode 100644 index 000000000..6e0d979c1 --- /dev/null +++ b/stripe/events/_v1_tax_settings_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.tax._settings import Settings + + +class V1TaxSettingsUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.tax.settings.updated" + type: Literal["v1.tax.settings.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TaxSettingsUpdatedEvent": + return cast( + "V1TaxSettingsUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Settings": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Settings", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TaxSettingsUpdatedEvent": + return cast( + "V1TaxSettingsUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Settings": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Settings", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TaxSettingsUpdatedEvent(Event): + LOOKUP_TYPE = "v1.tax.settings.updated" + type: Literal["v1.tax.settings.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Settings": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Settings", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_terminal_reader_action_failed_event.py b/stripe/events/_v1_terminal_reader_action_failed_event.py new file mode 100644 index 000000000..89687bbc1 --- /dev/null +++ b/stripe/events/_v1_terminal_reader_action_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.terminal._reader import Reader + + +class V1TerminalReaderActionFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.terminal.reader.action_failed" + type: Literal["v1.terminal.reader.action_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TerminalReaderActionFailedEvent": + return cast( + "V1TerminalReaderActionFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Reader": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TerminalReaderActionFailedEvent": + return cast( + "V1TerminalReaderActionFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Reader": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TerminalReaderActionFailedEvent(Event): + LOOKUP_TYPE = "v1.terminal.reader.action_failed" + type: Literal["v1.terminal.reader.action_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Reader": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Reader", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_terminal_reader_action_succeeded_event.py b/stripe/events/_v1_terminal_reader_action_succeeded_event.py new file mode 100644 index 000000000..255fc251c --- /dev/null +++ b/stripe/events/_v1_terminal_reader_action_succeeded_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.terminal._reader import Reader + + +class V1TerminalReaderActionSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.terminal.reader.action_succeeded" + type: Literal["v1.terminal.reader.action_succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TerminalReaderActionSucceededEvent": + return cast( + "V1TerminalReaderActionSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Reader": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1TerminalReaderActionSucceededEvent": + return cast( + "V1TerminalReaderActionSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Reader": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TerminalReaderActionSucceededEvent(Event): + LOOKUP_TYPE = "v1.terminal.reader.action_succeeded" + type: Literal["v1.terminal.reader.action_succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Reader": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Reader", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_terminal_reader_action_updated_event.py b/stripe/events/_v1_terminal_reader_action_updated_event.py new file mode 100644 index 000000000..710d47e5d --- /dev/null +++ b/stripe/events/_v1_terminal_reader_action_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.terminal._reader import Reader + + +class V1TerminalReaderActionUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.terminal.reader.action_updated" + type: Literal["v1.terminal.reader.action_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TerminalReaderActionUpdatedEvent": + return cast( + "V1TerminalReaderActionUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Reader": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TerminalReaderActionUpdatedEvent": + return cast( + "V1TerminalReaderActionUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Reader": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Reader", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TerminalReaderActionUpdatedEvent(Event): + LOOKUP_TYPE = "v1.terminal.reader.action_updated" + type: Literal["v1.terminal.reader.action_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Reader": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Reader", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_test_helpers_test_clock_advancing_event.py b/stripe/events/_v1_test_helpers_test_clock_advancing_event.py new file mode 100644 index 000000000..e6cdaf6e8 --- /dev/null +++ b/stripe/events/_v1_test_helpers_test_clock_advancing_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.test_helpers._test_clock import TestClock + + +class V1TestHelpersTestClockAdvancingEventNotification(EventNotification): + LOOKUP_TYPE = "v1.test_helpers.test_clock.advancing" + type: Literal["v1.test_helpers.test_clock.advancing"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TestHelpersTestClockAdvancingEvent": + return cast( + "V1TestHelpersTestClockAdvancingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TestClock": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1TestHelpersTestClockAdvancingEvent": + return cast( + "V1TestHelpersTestClockAdvancingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TestClock": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TestHelpersTestClockAdvancingEvent(Event): + LOOKUP_TYPE = "v1.test_helpers.test_clock.advancing" + type: Literal["v1.test_helpers.test_clock.advancing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TestClock": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TestClock", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_test_helpers_test_clock_created_event.py b/stripe/events/_v1_test_helpers_test_clock_created_event.py new file mode 100644 index 000000000..31e69c15d --- /dev/null +++ b/stripe/events/_v1_test_helpers_test_clock_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.test_helpers._test_clock import TestClock + + +class V1TestHelpersTestClockCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.test_helpers.test_clock.created" + type: Literal["v1.test_helpers.test_clock.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TestHelpersTestClockCreatedEvent": + return cast( + "V1TestHelpersTestClockCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TestClock": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TestHelpersTestClockCreatedEvent": + return cast( + "V1TestHelpersTestClockCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TestClock": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TestHelpersTestClockCreatedEvent(Event): + LOOKUP_TYPE = "v1.test_helpers.test_clock.created" + type: Literal["v1.test_helpers.test_clock.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TestClock": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TestClock", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_test_helpers_test_clock_deleted_event.py b/stripe/events/_v1_test_helpers_test_clock_deleted_event.py new file mode 100644 index 000000000..584bf6d8f --- /dev/null +++ b/stripe/events/_v1_test_helpers_test_clock_deleted_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.test_helpers._test_clock import TestClock + + +class V1TestHelpersTestClockDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.test_helpers.test_clock.deleted" + type: Literal["v1.test_helpers.test_clock.deleted"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TestHelpersTestClockDeletedEvent": + return cast( + "V1TestHelpersTestClockDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TestClock": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TestHelpersTestClockDeletedEvent": + return cast( + "V1TestHelpersTestClockDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TestClock": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TestHelpersTestClockDeletedEvent(Event): + LOOKUP_TYPE = "v1.test_helpers.test_clock.deleted" + type: Literal["v1.test_helpers.test_clock.deleted"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TestClock": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TestClock", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_test_helpers_test_clock_internal_failure_event.py b/stripe/events/_v1_test_helpers_test_clock_internal_failure_event.py new file mode 100644 index 000000000..ee266caf3 --- /dev/null +++ b/stripe/events/_v1_test_helpers_test_clock_internal_failure_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.test_helpers._test_clock import TestClock + + +class V1TestHelpersTestClockInternalFailureEventNotification( + EventNotification +): + LOOKUP_TYPE = "v1.test_helpers.test_clock.internal_failure" + type: Literal["v1.test_helpers.test_clock.internal_failure"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TestHelpersTestClockInternalFailureEvent": + return cast( + "V1TestHelpersTestClockInternalFailureEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TestClock": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1TestHelpersTestClockInternalFailureEvent": + return cast( + "V1TestHelpersTestClockInternalFailureEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TestClock": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TestHelpersTestClockInternalFailureEvent(Event): + LOOKUP_TYPE = "v1.test_helpers.test_clock.internal_failure" + type: Literal["v1.test_helpers.test_clock.internal_failure"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TestClock": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TestClock", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_test_helpers_test_clock_ready_event.py b/stripe/events/_v1_test_helpers_test_clock_ready_event.py new file mode 100644 index 000000000..24cac07a0 --- /dev/null +++ b/stripe/events/_v1_test_helpers_test_clock_ready_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.test_helpers._test_clock import TestClock + + +class V1TestHelpersTestClockReadyEventNotification(EventNotification): + LOOKUP_TYPE = "v1.test_helpers.test_clock.ready" + type: Literal["v1.test_helpers.test_clock.ready"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TestHelpersTestClockReadyEvent": + return cast( + "V1TestHelpersTestClockReadyEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "TestClock": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TestHelpersTestClockReadyEvent": + return cast( + "V1TestHelpersTestClockReadyEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "TestClock": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "TestClock", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TestHelpersTestClockReadyEvent(Event): + LOOKUP_TYPE = "v1.test_helpers.test_clock.ready" + type: Literal["v1.test_helpers.test_clock.ready"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "TestClock": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "TestClock", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_topup_canceled_event.py b/stripe/events/_v1_topup_canceled_event.py new file mode 100644 index 000000000..2c3d5de6a --- /dev/null +++ b/stripe/events/_v1_topup_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._topup import Topup + + +class V1TopupCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v1.topup.canceled" + type: Literal["v1.topup.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TopupCanceledEvent": + return cast( + "V1TopupCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Topup": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TopupCanceledEvent": + return cast( + "V1TopupCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Topup": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TopupCanceledEvent(Event): + LOOKUP_TYPE = "v1.topup.canceled" + type: Literal["v1.topup.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Topup": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Topup", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_topup_created_event.py b/stripe/events/_v1_topup_created_event.py new file mode 100644 index 000000000..be9a31839 --- /dev/null +++ b/stripe/events/_v1_topup_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._topup import Topup + + +class V1TopupCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.topup.created" + type: Literal["v1.topup.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TopupCreatedEvent": + return cast( + "V1TopupCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Topup": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TopupCreatedEvent": + return cast( + "V1TopupCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Topup": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TopupCreatedEvent(Event): + LOOKUP_TYPE = "v1.topup.created" + type: Literal["v1.topup.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Topup": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Topup", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_topup_failed_event.py b/stripe/events/_v1_topup_failed_event.py new file mode 100644 index 000000000..c32834584 --- /dev/null +++ b/stripe/events/_v1_topup_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._topup import Topup + + +class V1TopupFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.topup.failed" + type: Literal["v1.topup.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TopupFailedEvent": + return cast( + "V1TopupFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Topup": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TopupFailedEvent": + return cast( + "V1TopupFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Topup": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TopupFailedEvent(Event): + LOOKUP_TYPE = "v1.topup.failed" + type: Literal["v1.topup.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Topup": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Topup", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_topup_reversed_event.py b/stripe/events/_v1_topup_reversed_event.py new file mode 100644 index 000000000..5207ca1c2 --- /dev/null +++ b/stripe/events/_v1_topup_reversed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._topup import Topup + + +class V1TopupReversedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.topup.reversed" + type: Literal["v1.topup.reversed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TopupReversedEvent": + return cast( + "V1TopupReversedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Topup": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TopupReversedEvent": + return cast( + "V1TopupReversedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Topup": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TopupReversedEvent(Event): + LOOKUP_TYPE = "v1.topup.reversed" + type: Literal["v1.topup.reversed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Topup": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Topup", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_topup_succeeded_event.py b/stripe/events/_v1_topup_succeeded_event.py new file mode 100644 index 000000000..d3b6cfbfe --- /dev/null +++ b/stripe/events/_v1_topup_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._topup import Topup + + +class V1TopupSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v1.topup.succeeded" + type: Literal["v1.topup.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TopupSucceededEvent": + return cast( + "V1TopupSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Topup": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TopupSucceededEvent": + return cast( + "V1TopupSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Topup": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Topup", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TopupSucceededEvent(Event): + LOOKUP_TYPE = "v1.topup.succeeded" + type: Literal["v1.topup.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Topup": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Topup", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_transfer_created_event.py b/stripe/events/_v1_transfer_created_event.py new file mode 100644 index 000000000..54192ddcb --- /dev/null +++ b/stripe/events/_v1_transfer_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._transfer import Transfer + + +class V1TransferCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.transfer.created" + type: Literal["v1.transfer.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TransferCreatedEvent": + return cast( + "V1TransferCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transfer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TransferCreatedEvent": + return cast( + "V1TransferCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transfer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TransferCreatedEvent(Event): + LOOKUP_TYPE = "v1.transfer.created" + type: Literal["v1.transfer.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transfer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transfer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_transfer_reversed_event.py b/stripe/events/_v1_transfer_reversed_event.py new file mode 100644 index 000000000..d44a49b93 --- /dev/null +++ b/stripe/events/_v1_transfer_reversed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._transfer import Transfer + + +class V1TransferReversedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.transfer.reversed" + type: Literal["v1.transfer.reversed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TransferReversedEvent": + return cast( + "V1TransferReversedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transfer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TransferReversedEvent": + return cast( + "V1TransferReversedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transfer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TransferReversedEvent(Event): + LOOKUP_TYPE = "v1.transfer.reversed" + type: Literal["v1.transfer.reversed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transfer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transfer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v1_transfer_updated_event.py b/stripe/events/_v1_transfer_updated_event.py new file mode 100644 index 000000000..f4d6385c7 --- /dev/null +++ b/stripe/events/_v1_transfer_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe._transfer import Transfer + + +class V1TransferUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.transfer.updated" + type: Literal["v1.transfer.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V1TransferUpdatedEvent": + return cast( + "V1TransferUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Transfer": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1TransferUpdatedEvent": + return cast( + "V1TransferUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Transfer": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Transfer", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1TransferUpdatedEvent(Event): + LOOKUP_TYPE = "v1.transfer.updated" + type: Literal["v1.transfer.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Transfer": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Transfer", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py b/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py new file mode 100644 index 000000000..94c429c27 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsFailedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.failed" + type: Literal["v2.commerce.product_catalog.imports.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsFailedEvent": + return cast( + "V2CommerceProductCatalogImportsFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsFailedEvent": + return cast( + "V2CommerceProductCatalogImportsFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsFailedEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.failed" + type: Literal["v2.commerce.product_catalog.imports.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py b/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py new file mode 100644 index 000000000..195c2bad5 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsProcessingEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.processing" + type: Literal["v2.commerce.product_catalog.imports.processing"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsProcessingEvent": + return cast( + "V2CommerceProductCatalogImportsProcessingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsProcessingEvent": + return cast( + "V2CommerceProductCatalogImportsProcessingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsProcessingEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.processing" + type: Literal["v2.commerce.product_catalog.imports.processing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py new file mode 100644 index 000000000..ddafcdcdd --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsSucceededEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded" + type: Literal["v2.commerce.product_catalog.imports.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsSucceededEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsSucceededEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsSucceededEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded" + type: Literal["v2.commerce.product_catalog.imports.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py new file mode 100644 index 000000000..fb53a3833 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded_with_errors" + type: Literal["v2.commerce.product_catalog.imports.succeeded_with_errors"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsSucceededWithErrorsEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded_with_errors" + type: Literal["v2.commerce.product_catalog.imports.succeeded_with_errors"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_approval_request_approved_event.py b/stripe/events/_v2_core_approval_request_approved_event.py new file mode 100644 index 000000000..1ab2c80b0 --- /dev/null +++ b/stripe/events/_v2_core_approval_request_approved_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._approval_request import ApprovalRequest + + +class V2CoreApprovalRequestApprovedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.approval_request.approved" + type: Literal["v2.core.approval_request.approved"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreApprovalRequestApprovedEvent": + return cast( + "V2CoreApprovalRequestApprovedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApprovalRequest": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreApprovalRequestApprovedEvent": + return cast( + "V2CoreApprovalRequestApprovedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApprovalRequest": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreApprovalRequestApprovedEvent(Event): + LOOKUP_TYPE = "v2.core.approval_request.approved" + type: Literal["v2.core.approval_request.approved"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApprovalRequest": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApprovalRequest", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_approval_request_canceled_event.py b/stripe/events/_v2_core_approval_request_canceled_event.py new file mode 100644 index 000000000..5a04e1ac8 --- /dev/null +++ b/stripe/events/_v2_core_approval_request_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._approval_request import ApprovalRequest + + +class V2CoreApprovalRequestCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.approval_request.canceled" + type: Literal["v2.core.approval_request.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreApprovalRequestCanceledEvent": + return cast( + "V2CoreApprovalRequestCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApprovalRequest": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreApprovalRequestCanceledEvent": + return cast( + "V2CoreApprovalRequestCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApprovalRequest": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreApprovalRequestCanceledEvent(Event): + LOOKUP_TYPE = "v2.core.approval_request.canceled" + type: Literal["v2.core.approval_request.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApprovalRequest": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApprovalRequest", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_approval_request_failed_event.py b/stripe/events/_v2_core_approval_request_failed_event.py new file mode 100644 index 000000000..73e478455 --- /dev/null +++ b/stripe/events/_v2_core_approval_request_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._approval_request import ApprovalRequest + + +class V2CoreApprovalRequestFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.approval_request.failed" + type: Literal["v2.core.approval_request.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreApprovalRequestFailedEvent": + return cast( + "V2CoreApprovalRequestFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApprovalRequest": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreApprovalRequestFailedEvent": + return cast( + "V2CoreApprovalRequestFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApprovalRequest": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreApprovalRequestFailedEvent(Event): + LOOKUP_TYPE = "v2.core.approval_request.failed" + type: Literal["v2.core.approval_request.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApprovalRequest": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApprovalRequest", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_approval_request_rejected_event.py b/stripe/events/_v2_core_approval_request_rejected_event.py new file mode 100644 index 000000000..d209957fa --- /dev/null +++ b/stripe/events/_v2_core_approval_request_rejected_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._approval_request import ApprovalRequest + + +class V2CoreApprovalRequestRejectedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.approval_request.rejected" + type: Literal["v2.core.approval_request.rejected"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreApprovalRequestRejectedEvent": + return cast( + "V2CoreApprovalRequestRejectedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApprovalRequest": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreApprovalRequestRejectedEvent": + return cast( + "V2CoreApprovalRequestRejectedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApprovalRequest": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreApprovalRequestRejectedEvent(Event): + LOOKUP_TYPE = "v2.core.approval_request.rejected" + type: Literal["v2.core.approval_request.rejected"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApprovalRequest": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApprovalRequest", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_approval_request_succeeded_event.py b/stripe/events/_v2_core_approval_request_succeeded_event.py new file mode 100644 index 000000000..0b7350056 --- /dev/null +++ b/stripe/events/_v2_core_approval_request_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._approval_request import ApprovalRequest + + +class V2CoreApprovalRequestSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.approval_request.succeeded" + type: Literal["v2.core.approval_request.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreApprovalRequestSucceededEvent": + return cast( + "V2CoreApprovalRequestSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ApprovalRequest": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreApprovalRequestSucceededEvent": + return cast( + "V2CoreApprovalRequestSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ApprovalRequest": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ApprovalRequest", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreApprovalRequestSucceededEvent(Event): + LOOKUP_TYPE = "v2.core.approval_request.succeeded" + type: Literal["v2.core.approval_request.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ApprovalRequest": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ApprovalRequest", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event.py b/stripe/events/_v2_core_claimable_sandbox_updated_event.py similarity index 75% rename from stripe/events/_v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event.py rename to stripe/events/_v2_core_claimable_sandbox_updated_event.py index f42f3f126..4dfff6379 100644 --- a/stripe/events/_v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event.py +++ b/stripe/events/_v2_core_claimable_sandbox_updated_event.py @@ -11,15 +11,9 @@ from stripe.v2.core._claimable_sandbox import ClaimableSandbox -class V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEventNotification( - EventNotification, -): - LOOKUP_TYPE = ( - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated" - ) - type: Literal[ - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated" - ] +class V2CoreClaimableSandboxUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.claimable_sandbox.updated" + type: Literal["v2.core.claimable_sandbox.updated"] related_object: RelatedObject def __init__( @@ -32,11 +26,9 @@ def __init__( self.related_object = RelatedObject(parsed_body["related_object"]) @override - def fetch_event( - self, - ) -> "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent": + def fetch_event(self) -> "V2CoreClaimableSandboxUpdatedEvent": return cast( - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent", + "V2CoreClaimableSandboxUpdatedEvent", super().fetch_event(), ) @@ -57,11 +49,9 @@ def fetch_related_object(self) -> "ClaimableSandbox": ) @override - async def fetch_event_async( - self, - ) -> "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent": + async def fetch_event_async(self) -> "V2CoreClaimableSandboxUpdatedEvent": return cast( - "V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent", + "V2CoreClaimableSandboxUpdatedEvent", await super().fetch_event_async(), ) @@ -82,13 +72,9 @@ async def fetch_related_object_async(self) -> "ClaimableSandbox": ) -class V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent(Event): - LOOKUP_TYPE = ( - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated" - ) - type: Literal[ - "v2.core.claimable_sandbox.sandbox_details_owner_account_updated" - ] +class V2CoreClaimableSandboxUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.claimable_sandbox.updated" + type: Literal["v2.core.claimable_sandbox.updated"] class RelatedObject(StripeObject): id: str diff --git a/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py b/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py new file mode 100644 index 000000000..3f7d0f20d --- /dev/null +++ b/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2.core._event import Event, EventNotification +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + + +class V2CoreHealthMeterEventSummariesDelayedFiringEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.core.health.meter_event_summaries_delayed.firing" + type: Literal["v2.core.health.meter_event_summaries_delayed.firing"] + + @override + def fetch_event( + self, + ) -> "V2CoreHealthMeterEventSummariesDelayedFiringEvent": + return cast( + "V2CoreHealthMeterEventSummariesDelayedFiringEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreHealthMeterEventSummariesDelayedFiringEvent": + return cast( + "V2CoreHealthMeterEventSummariesDelayedFiringEvent", + await super().fetch_event_async(), + ) + + +class V2CoreHealthMeterEventSummariesDelayedFiringEvent(Event): + LOOKUP_TYPE = "v2.core.health.meter_event_summaries_delayed.firing" + type: Literal["v2.core.health.meter_event_summaries_delayed.firing"] + + class V2CoreHealthMeterEventSummariesDelayedFiringEventData(StripeObject): + class Impact(StripeObject): + ingestion_method: Optional[Literal["import_sets"]] + """ + The ingestion method. + """ + + alert_id: str + """ + The alert ID. + """ + grouping_key: str + """ + The grouping key for the alert. + """ + impact: Impact + """ + The user impact. + """ + started_at: str + """ + The time when impact on the user experience was first detected. + """ + summary: str + """ + A short description of the alert. + """ + _inner_class_types = {"impact": Impact} + + data: V2CoreHealthMeterEventSummariesDelayedFiringEventData + """ + Data for the v2.core.health.meter_event_summaries_delayed.firing event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreHealthMeterEventSummariesDelayedFiringEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreHealthMeterEventSummariesDelayedFiringEvent.V2CoreHealthMeterEventSummariesDelayedFiringEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py b/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py new file mode 100644 index 000000000..79c0b5ae4 --- /dev/null +++ b/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2.core._event import Event, EventNotification +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + + +class V2CoreHealthMeterEventSummariesDelayedResolvedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.core.health.meter_event_summaries_delayed.resolved" + type: Literal["v2.core.health.meter_event_summaries_delayed.resolved"] + + @override + def fetch_event( + self, + ) -> "V2CoreHealthMeterEventSummariesDelayedResolvedEvent": + return cast( + "V2CoreHealthMeterEventSummariesDelayedResolvedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreHealthMeterEventSummariesDelayedResolvedEvent": + return cast( + "V2CoreHealthMeterEventSummariesDelayedResolvedEvent", + await super().fetch_event_async(), + ) + + +class V2CoreHealthMeterEventSummariesDelayedResolvedEvent(Event): + LOOKUP_TYPE = "v2.core.health.meter_event_summaries_delayed.resolved" + type: Literal["v2.core.health.meter_event_summaries_delayed.resolved"] + + class V2CoreHealthMeterEventSummariesDelayedResolvedEventData( + StripeObject + ): + class Impact(StripeObject): + ingestion_method: Optional[Literal["import_sets"]] + """ + The ingestion method. + """ + + alert_id: str + """ + The alert ID. + """ + grouping_key: str + """ + The grouping key for the alert. + """ + impact: Impact + """ + The user impact. + """ + resolved_at: str + """ + The time when the user experience has returned to expected levels. + """ + started_at: str + """ + The time when impact on the user experience was first detected. + """ + summary: str + """ + A short description of the alert. + """ + _inner_class_types = {"impact": Impact} + + data: V2CoreHealthMeterEventSummariesDelayedResolvedEventData + """ + Data for the v2.core.health.meter_event_summaries_delayed.resolved event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreHealthMeterEventSummariesDelayedResolvedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreHealthMeterEventSummariesDelayedResolvedEvent.V2CoreHealthMeterEventSummariesDelayedResolvedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/stripe/events/_v2_extend_workflow_run_failed_event.py b/stripe/events/_v2_extend_workflow_run_failed_event.py new file mode 100644 index 000000000..f3da7af8f --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_failed_event.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.failed" + type: Literal["v2.extend.workflow_run.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunFailedEvent": + return cast( + "V2ExtendWorkflowRunFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunFailedEvent": + return cast( + "V2ExtendWorkflowRunFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunFailedEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.failed" + type: Literal["v2.extend.workflow_run.failed"] + + class V2ExtendWorkflowRunFailedEventData(StripeObject): + class FailureDetails(StripeObject): + error_message: Optional[str] + """ + Optional details about the failure result. + """ + + dashboard_url: str + """ + A Stripe dashboard URL with more information about the Workflow Run failure. + """ + failure_details: FailureDetails + """ + Details about the Workflow Run's transition into the FAILED state. + """ + _inner_class_types = {"failure_details": FailureDetails} + + data: V2ExtendWorkflowRunFailedEventData + """ + Data for the v2.extend.workflow_run.failed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2ExtendWorkflowRunFailedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2ExtendWorkflowRunFailedEvent.V2ExtendWorkflowRunFailedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_extend_workflow_run_started_event.py b/stripe/events/_v2_extend_workflow_run_started_event.py new file mode 100644 index 000000000..7bd0ea3f7 --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_started_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunStartedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.started" + type: Literal["v2.extend.workflow_run.started"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunStartedEvent": + return cast( + "V2ExtendWorkflowRunStartedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunStartedEvent": + return cast( + "V2ExtendWorkflowRunStartedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunStartedEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.started" + type: Literal["v2.extend.workflow_run.started"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_extend_workflow_run_succeeded_event.py b/stripe/events/_v2_extend_workflow_run_succeeded_event.py new file mode 100644 index 000000000..27be0e345 --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.succeeded" + type: Literal["v2.extend.workflow_run.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunSucceededEvent": + return cast( + "V2ExtendWorkflowRunSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunSucceededEvent": + return cast( + "V2ExtendWorkflowRunSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunSucceededEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.succeeded" + type: Literal["v2.extend.workflow_run.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_transaction_created_event.py b/stripe/events/_v2_money_management_transaction_created_event.py index 45ff9b3c1..dac212315 100644 --- a/stripe/events/_v2_money_management_transaction_created_event.py +++ b/stripe/events/_v2_money_management_transaction_created_event.py @@ -82,6 +82,10 @@ class V2MoneyManagementTransactionCreatedEvent(Event): type: Literal["v2.money_management.transaction.created"] class V2MoneyManagementTransactionCreatedEventData(StripeObject): + treasury_transaction: Optional[str] + """ + Id of the v1 Treasury Transaction corresponding to this Transaction. + """ v1_id: Optional[str] """ Id of the v1 Transaction corresponding to this Transaction. diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py new file mode 100644 index 000000000..22baf95bf --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementConfirmedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.confirmed" + type: Literal["v2.orchestrated_commerce.agreement.confirmed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementConfirmedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementConfirmedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementConfirmedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.confirmed" + type: Literal["v2.orchestrated_commerce.agreement.confirmed"] + + class V2OrchestratedCommerceAgreementConfirmedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_confirmed_at: str + """ + The time at which the orchestrator confirmed the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_confirmed_at: str + """ + The time at which the seller confirmed the agreement. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementConfirmedEventData + """ + Data for the v2.orchestrated_commerce.agreement.confirmed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementConfirmedEvent.V2OrchestratedCommerceAgreementConfirmedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py new file mode 100644 index 000000000..754e220ea --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementCreatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.created" + type: Literal["v2.orchestrated_commerce.agreement.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementCreatedEvent": + return cast( + "V2OrchestratedCommerceAgreementCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementCreatedEvent": + return cast( + "V2OrchestratedCommerceAgreementCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementCreatedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.created" + type: Literal["v2.orchestrated_commerce.agreement.created"] + + class V2OrchestratedCommerceAgreementCreatedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + created: str + """ + The time at which the agreement was created. + """ + initiated_by: Literal["orchestrator", "seller"] + """ + The party that initiated the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementCreatedEventData + """ + Data for the v2.orchestrated_commerce.agreement.created event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementCreatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementCreatedEvent.V2OrchestratedCommerceAgreementCreatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py new file mode 100644 index 000000000..01664bd41 --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py @@ -0,0 +1,191 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.partially_confirmed" + type: Literal["v2.orchestrated_commerce.agreement.partially_confirmed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementPartiallyConfirmedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.partially_confirmed" + type: Literal["v2.orchestrated_commerce.agreement.partially_confirmed"] + + class V2OrchestratedCommerceAgreementPartiallyConfirmedEventData( + StripeObject, + ): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_confirmed_at: str + """ + The time at which the orchestrator confirmed the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_confirmed_at: str + """ + The time at which the seller confirmed the agreement. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementPartiallyConfirmedEventData + """ + Data for the v2.orchestrated_commerce.agreement.partially_confirmed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementPartiallyConfirmedEvent.V2OrchestratedCommerceAgreementPartiallyConfirmedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py new file mode 100644 index 000000000..ac0382dce --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementTerminatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.terminated" + type: Literal["v2.orchestrated_commerce.agreement.terminated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + return cast( + "V2OrchestratedCommerceAgreementTerminatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + return cast( + "V2OrchestratedCommerceAgreementTerminatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementTerminatedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.terminated" + type: Literal["v2.orchestrated_commerce.agreement.terminated"] + + class V2OrchestratedCommerceAgreementTerminatedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + terminated_at: str + """ + The time at which the agreement was terminated. + """ + terminated_by: Literal["orchestrator", "seller"] + """ + The party that terminated the agreement. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementTerminatedEventData + """ + Data for the v2.orchestrated_commerce.agreement.terminated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementTerminatedEvent.V2OrchestratedCommerceAgreementTerminatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index c0613252c..24f4898c3 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -81,6 +81,142 @@ class AmountDetails(StripeObject): The amount of cash requested by the cardholder. """ + class CryptoTransaction(StripeObject): + class CryptoTransactionConfirmed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the confirmed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the confirmed transaction. + """ + confirmed_at: int + """ + When the transaction was confirmed onchain. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: str + """ + The destination wallet address for the transaction. + """ + transaction_hash: str + """ + The blockchain transaction hash. + """ + _inner_class_types = {"fees": Fee} + + class CryptoTransactionFailed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the failed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the failed transaction. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + failed_at: int + """ + When the transaction failed. + """ + failure_reason: str + """ + The reason the transaction failed. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the attempted transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: Optional[str] + """ + The destination wallet address for the attempted transaction when one exists. + """ + transaction_hash: Optional[str] + """ + The blockchain transaction hash when one exists. + """ + _inner_class_types = {"fees": Fee} + + crypto_transaction_confirmed: Optional[CryptoTransactionConfirmed] + """ + The confirmed crypto transaction details when `type` is `crypto_transaction_confirmed`; otherwise null. + """ + crypto_transaction_failed: Optional[CryptoTransactionFailed] + """ + The failed crypto transaction details when `type` is `crypto_transaction_failed`; otherwise null. + """ + type: str + """ + The crypto transaction variant for this array entry. + """ + _inner_class_types = { + "crypto_transaction_confirmed": CryptoTransactionConfirmed, + "crypto_transaction_failed": CryptoTransactionFailed, + } + class Fleet(StripeObject): class CardholderPromptData(StripeObject): alphanumeric_id: Optional[str] @@ -272,6 +408,10 @@ class MerchantData(StripeObject): """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ + payment_facilitator_id: Optional[str] + """ + The identifier of the payment facilitator (PayFac) that processed this authorization, as assigned by the card network. Null when the transaction was not processed through a PayFac. + """ postal_code: Optional[str] """ Postal code where the seller is located @@ -280,6 +420,10 @@ class MerchantData(StripeObject): """ State where the seller is located """ + sub_merchant_id: Optional[str] + """ + The identifier of the sub-merchant involved in this authorization, as assigned by the payment facilitator. Null when the transaction was not processed through a PayFac or when no sub-merchant ID was provided. + """ tax_id: Optional[str] """ The seller's tax identification number. Currently populated for French merchants only. @@ -855,6 +999,10 @@ class ThreeDSecure(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + crypto_transactions: Optional[List[CryptoTransaction]] + """ + Array of onchain crypto transactions linked to this resource. + """ currency: str """ The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -2020,6 +2168,7 @@ def test_helpers(self): _inner_class_types = { "amount_details": AmountDetails, + "crypto_transactions": CryptoTransaction, "fleet": Fleet, "fraud_challenges": FraudChallenge, "fuel": Fuel, diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 6b644332e..bed829b7d 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -42,6 +42,142 @@ class Dispute( OBJECT_NAME: ClassVar[Literal["issuing.dispute"]] = "issuing.dispute" + class CryptoTransaction(StripeObject): + class CryptoTransactionConfirmed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the confirmed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the confirmed transaction. + """ + confirmed_at: int + """ + When the transaction was confirmed onchain. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: str + """ + The destination wallet address for the transaction. + """ + transaction_hash: str + """ + The blockchain transaction hash. + """ + _inner_class_types = {"fees": Fee} + + class CryptoTransactionFailed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the failed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the failed transaction. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + failed_at: int + """ + When the transaction failed. + """ + failure_reason: str + """ + The reason the transaction failed. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the attempted transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: Optional[str] + """ + The destination wallet address for the attempted transaction when one exists. + """ + transaction_hash: Optional[str] + """ + The blockchain transaction hash when one exists. + """ + _inner_class_types = {"fees": Fee} + + crypto_transaction_confirmed: Optional[CryptoTransactionConfirmed] + """ + The confirmed crypto transaction details when `type` is `crypto_transaction_confirmed`; otherwise null. + """ + crypto_transaction_failed: Optional[CryptoTransactionFailed] + """ + The failed crypto transaction details when `type` is `crypto_transaction_failed`; otherwise null. + """ + type: str + """ + The crypto transaction variant for this array entry. + """ + _inner_class_types = { + "crypto_transaction_confirmed": CryptoTransactionConfirmed, + "crypto_transaction_failed": CryptoTransactionFailed, + } + class Evidence(StripeObject): class Canceled(StripeObject): additional_documentation: Optional[ExpandableField["File"]] @@ -273,6 +409,10 @@ class Treasury(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + crypto_transactions: Optional[List[CryptoTransaction]] + """ + Array of onchain crypto transactions linked to this resource. + """ currency: str """ The currency the `transaction` was made in. @@ -568,4 +708,8 @@ async def submit_async( # pyright: ignore[reportGeneralTypeIssues] ), ) - _inner_class_types = {"evidence": Evidence, "treasury": Treasury} + _inner_class_types = { + "crypto_transactions": CryptoTransaction, + "evidence": Evidence, + "treasury": Treasury, + } diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index f9c1e68bc..b888d8933 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -65,6 +65,142 @@ class AmountDetails(StripeObject): The amount of cash requested by the cardholder. """ + class CryptoTransaction(StripeObject): + class CryptoTransactionConfirmed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the confirmed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the confirmed transaction. + """ + confirmed_at: int + """ + When the transaction was confirmed onchain. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: str + """ + The destination wallet address for the transaction. + """ + transaction_hash: str + """ + The blockchain transaction hash. + """ + _inner_class_types = {"fees": Fee} + + class CryptoTransactionFailed(StripeObject): + class Fee(StripeObject): + amount: str + """ + The fee amount. + """ + currency: str + """ + The fee currency. + """ + type: str + """ + The fee type. + """ + + amount: str + """ + The crypto amount for the failed transaction. + """ + amount_mcc_upcharged: Optional[str] + """ + The upcharged MCC amount, if one was applied. + """ + chain: str + """ + The blockchain network for the failed transaction. + """ + currency: str + """ + The currency of the crypto transaction amount. + """ + failed_at: int + """ + When the transaction failed. + """ + failure_reason: str + """ + The reason the transaction failed. + """ + fees: List[Fee] + """ + Fees associated with the transaction. + """ + from_address: str + """ + The source wallet address for the attempted transaction. + """ + memo: Optional[str] + """ + Memo metadata attached to the transaction, if present. + """ + to_address: Optional[str] + """ + The destination wallet address for the attempted transaction when one exists. + """ + transaction_hash: Optional[str] + """ + The blockchain transaction hash when one exists. + """ + _inner_class_types = {"fees": Fee} + + crypto_transaction_confirmed: Optional[CryptoTransactionConfirmed] + """ + The confirmed crypto transaction details when `type` is `crypto_transaction_confirmed`; otherwise null. + """ + crypto_transaction_failed: Optional[CryptoTransactionFailed] + """ + The failed crypto transaction details when `type` is `crypto_transaction_failed`; otherwise null. + """ + type: str + """ + The crypto transaction variant for this array entry. + """ + _inner_class_types = { + "crypto_transaction_confirmed": CryptoTransactionConfirmed, + "crypto_transaction_failed": CryptoTransactionFailed, + } + class MerchantData(StripeObject): category: str """ @@ -90,6 +226,10 @@ class MerchantData(StripeObject): """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ + payment_facilitator_id: Optional[str] + """ + The identifier of the payment facilitator (PayFac) that processed this authorization, as assigned by the card network. Null when the transaction was not processed through a PayFac. + """ postal_code: Optional[str] """ Postal code where the seller is located @@ -98,6 +238,10 @@ class MerchantData(StripeObject): """ State where the seller is located """ + sub_merchant_id: Optional[str] + """ + The identifier of the sub-merchant involved in this authorization, as assigned by the payment facilitator. Null when the transaction was not processed through a PayFac or when no sub-merchant ID was provided. + """ tax_id: Optional[str] """ The seller's tax identification number. Currently populated for French merchants only. @@ -394,6 +538,10 @@ class Treasury(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + crypto_transactions: Optional[List[CryptoTransaction]] + """ + Array of onchain crypto transactions linked to this resource. + """ currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -735,6 +883,7 @@ def test_helpers(self): _inner_class_types = { "amount_details": AmountDetails, + "crypto_transactions": CryptoTransaction, "merchant_data": MerchantData, "network_data": NetworkData, "purchase_details": PurchaseDetails, diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index fc23b98fd..f2e5e4f36 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -1944,6 +1944,7 @@ OrderCreateParamsLineItemDiscount as OrderCreateParamsLineItemDiscount, OrderCreateParamsLineItemPriceData as OrderCreateParamsLineItemPriceData, OrderCreateParamsLineItemProductData as OrderCreateParamsLineItemProductData, + OrderCreateParamsLineItemProductDataIdentifiers as OrderCreateParamsLineItemProductDataIdentifiers, OrderCreateParamsLineItemProductDataPackageDimensions as OrderCreateParamsLineItemProductDataPackageDimensions, OrderCreateParamsPayment as OrderCreateParamsPayment, OrderCreateParamsPaymentSettings as OrderCreateParamsPaymentSettings, @@ -2034,6 +2035,7 @@ OrderModifyParamsLineItemDiscount as OrderModifyParamsLineItemDiscount, OrderModifyParamsLineItemPriceData as OrderModifyParamsLineItemPriceData, OrderModifyParamsLineItemProductData as OrderModifyParamsLineItemProductData, + OrderModifyParamsLineItemProductDataIdentifiers as OrderModifyParamsLineItemProductDataIdentifiers, OrderModifyParamsLineItemProductDataPackageDimensions as OrderModifyParamsLineItemProductDataPackageDimensions, OrderModifyParamsPayment as OrderModifyParamsPayment, OrderModifyParamsPaymentSettings as OrderModifyParamsPaymentSettings, @@ -2127,6 +2129,7 @@ OrderUpdateParamsLineItemDiscount as OrderUpdateParamsLineItemDiscount, OrderUpdateParamsLineItemPriceData as OrderUpdateParamsLineItemPriceData, OrderUpdateParamsLineItemProductData as OrderUpdateParamsLineItemProductData, + OrderUpdateParamsLineItemProductDataIdentifiers as OrderUpdateParamsLineItemProductDataIdentifiers, OrderUpdateParamsLineItemProductDataPackageDimensions as OrderUpdateParamsLineItemProductDataPackageDimensions, OrderUpdateParamsPayment as OrderUpdateParamsPayment, OrderUpdateParamsPaymentSettings as OrderUpdateParamsPaymentSettings, @@ -4514,6 +4517,7 @@ ProductCreateParamsDefaultPriceDataCurrencyOptionsTier as ProductCreateParamsDefaultPriceDataCurrencyOptionsTier, ProductCreateParamsDefaultPriceDataCustomUnitAmount as ProductCreateParamsDefaultPriceDataCustomUnitAmount, ProductCreateParamsDefaultPriceDataRecurring as ProductCreateParamsDefaultPriceDataRecurring, + ProductCreateParamsIdentifiers as ProductCreateParamsIdentifiers, ProductCreateParamsMarketingFeature as ProductCreateParamsMarketingFeature, ProductCreateParamsPackageDimensions as ProductCreateParamsPackageDimensions, ProductCreateParamsTaxDetails as ProductCreateParamsTaxDetails, @@ -4545,6 +4549,7 @@ ) from stripe.params._product_modify_params import ( ProductModifyParams as ProductModifyParams, + ProductModifyParamsIdentifiers as ProductModifyParamsIdentifiers, ProductModifyParamsMarketingFeature as ProductModifyParamsMarketingFeature, ProductModifyParamsPackageDimensions as ProductModifyParamsPackageDimensions, ProductModifyParamsTaxDetails as ProductModifyParamsTaxDetails, @@ -4560,6 +4565,7 @@ ) from stripe.params._product_update_params import ( ProductUpdateParams as ProductUpdateParams, + ProductUpdateParamsIdentifiers as ProductUpdateParamsIdentifiers, ProductUpdateParamsMarketingFeature as ProductUpdateParamsMarketingFeature, ProductUpdateParamsPackageDimensions as ProductUpdateParamsPackageDimensions, ProductUpdateParamsTaxDetails as ProductUpdateParamsTaxDetails, @@ -11854,6 +11860,10 @@ "stripe.params._order_create_params", False, ), + "OrderCreateParamsLineItemProductDataIdentifiers": ( + "stripe.params._order_create_params", + False, + ), "OrderCreateParamsLineItemProductDataPackageDimensions": ( "stripe.params._order_create_params", False, @@ -12183,6 +12193,10 @@ "stripe.params._order_modify_params", False, ), + "OrderModifyParamsLineItemProductDataIdentifiers": ( + "stripe.params._order_modify_params", + False, + ), "OrderModifyParamsLineItemProductDataPackageDimensions": ( "stripe.params._order_modify_params", False, @@ -12513,6 +12527,10 @@ "stripe.params._order_update_params", False, ), + "OrderUpdateParamsLineItemProductDataIdentifiers": ( + "stripe.params._order_update_params", + False, + ), "OrderUpdateParamsLineItemProductDataPackageDimensions": ( "stripe.params._order_update_params", False, @@ -21321,6 +21339,10 @@ "stripe.params._product_create_params", False, ), + "ProductCreateParamsIdentifiers": ( + "stripe.params._product_create_params", + False, + ), "ProductCreateParamsMarketingFeature": ( "stripe.params._product_create_params", False, @@ -21361,6 +21383,10 @@ "ProductListParams": ("stripe.params._product_list_params", False), "ProductListParamsCreated": ("stripe.params._product_list_params", False), "ProductModifyParams": ("stripe.params._product_modify_params", False), + "ProductModifyParamsIdentifiers": ( + "stripe.params._product_modify_params", + False, + ), "ProductModifyParamsMarketingFeature": ( "stripe.params._product_modify_params", False, @@ -21380,6 +21406,10 @@ "ProductRetrieveParams": ("stripe.params._product_retrieve_params", False), "ProductSearchParams": ("stripe.params._product_search_params", False), "ProductUpdateParams": ("stripe.params._product_update_params", False), + "ProductUpdateParamsIdentifiers": ( + "stripe.params._product_update_params", + False, + ), "ProductUpdateParamsMarketingFeature": ( "stripe.params._product_update_params", False, diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index 53d3a7a4d..16fbf40c1 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -312,10 +312,6 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index ef9062ed7..adb5a66e5 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -286,7 +286,7 @@ class InvoiceCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index 83ef38ce8..c72591d34 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -253,7 +253,7 @@ class InvoiceModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index d62f8f120..3bb2244ac 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -252,7 +252,7 @@ class InvoiceUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_order_create_params.py b/stripe/params/_order_create_params.py index cf82c9f22..96dbaa6aa 100644 --- a/stripe/params/_order_create_params.py +++ b/stripe/params/_order_create_params.py @@ -232,6 +232,10 @@ class OrderCreateParamsLineItemProductData(TypedDict): `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. """ + identifiers: NotRequired["OrderCreateParamsLineItemProductDataIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -266,6 +270,37 @@ class OrderCreateParamsLineItemProductData(TypedDict): """ +class OrderCreateParamsLineItemProductDataIdentifiers(TypedDict): + ean: NotRequired["Literal['']|str"] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired["Literal['']|str"] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired["Literal['']|str"] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired["Literal['']|str"] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired["Literal['']|str"] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired["Literal['']|str"] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired["Literal['']|str"] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class OrderCreateParamsLineItemProductDataPackageDimensions(TypedDict): height: float """ diff --git a/stripe/params/_order_modify_params.py b/stripe/params/_order_modify_params.py index e704114c1..34000278a 100644 --- a/stripe/params/_order_modify_params.py +++ b/stripe/params/_order_modify_params.py @@ -238,6 +238,10 @@ class OrderModifyParamsLineItemProductData(TypedDict): `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. """ + identifiers: NotRequired["OrderModifyParamsLineItemProductDataIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -272,6 +276,37 @@ class OrderModifyParamsLineItemProductData(TypedDict): """ +class OrderModifyParamsLineItemProductDataIdentifiers(TypedDict): + ean: NotRequired["Literal['']|str"] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired["Literal['']|str"] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired["Literal['']|str"] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired["Literal['']|str"] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired["Literal['']|str"] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired["Literal['']|str"] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired["Literal['']|str"] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class OrderModifyParamsLineItemProductDataPackageDimensions(TypedDict): height: float """ diff --git a/stripe/params/_order_update_params.py b/stripe/params/_order_update_params.py index 5530940b4..73e6e515e 100644 --- a/stripe/params/_order_update_params.py +++ b/stripe/params/_order_update_params.py @@ -237,6 +237,10 @@ class OrderUpdateParamsLineItemProductData(TypedDict): `product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products. """ + identifiers: NotRequired["OrderUpdateParamsLineItemProductDataIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -271,6 +275,37 @@ class OrderUpdateParamsLineItemProductData(TypedDict): """ +class OrderUpdateParamsLineItemProductDataIdentifiers(TypedDict): + ean: NotRequired["Literal['']|str"] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired["Literal['']|str"] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired["Literal['']|str"] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired["Literal['']|str"] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired["Literal['']|str"] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired["Literal['']|str"] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired["Literal['']|str"] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class OrderUpdateParamsLineItemProductDataPackageDimensions(TypedDict): height: float """ diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 71aee7924..b9d8b5688 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -3022,10 +3022,6 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index c739be1d5..485d60218 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -3152,10 +3152,6 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "PaymentIntentCreateParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index ce7d9e73b..feac70fee 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -3005,10 +3005,6 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "PaymentIntentModifyParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index d54c41ab8..34e5bae3d 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -3004,10 +3004,6 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_price_create_params.py b/stripe/params/_price_create_params.py index 873358d14..829104990 100644 --- a/stripe/params/_price_create_params.py +++ b/stripe/params/_price_create_params.py @@ -34,6 +34,10 @@ class PriceCreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + external_reference: NotRequired[str] + """ + A custom identifier for this price, such as a SKU number or product code, that can be used to reference records from external systems. + """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. diff --git a/stripe/params/_price_modify_params.py b/stripe/params/_price_modify_params.py index a1e0d0767..725fb12f7 100644 --- a/stripe/params/_price_modify_params.py +++ b/stripe/params/_price_modify_params.py @@ -22,6 +22,10 @@ class PriceModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + external_reference: NotRequired["Literal['']|str"] + """ + A custom identifier for this price, such as a SKU number or product code, that can be used to reference records from external systems. + """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. diff --git a/stripe/params/_price_update_params.py b/stripe/params/_price_update_params.py index 2d69691f5..d52f23a72 100644 --- a/stripe/params/_price_update_params.py +++ b/stripe/params/_price_update_params.py @@ -21,6 +21,10 @@ class PriceUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + external_reference: NotRequired["Literal['']|str"] + """ + A custom identifier for this price, such as a SKU number or product code, that can be used to reference records from external systems. + """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. diff --git a/stripe/params/_product_create_params.py b/stripe/params/_product_create_params.py index 46bd9635a..015afd891 100644 --- a/stripe/params/_product_create_params.py +++ b/stripe/params/_product_create_params.py @@ -28,6 +28,10 @@ class ProductCreateParams(RequestOptions): """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. """ + identifiers: NotRequired["ProductCreateParamsIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -223,6 +227,37 @@ class ProductCreateParamsDefaultPriceDataRecurring(TypedDict): """ +class ProductCreateParamsIdentifiers(TypedDict): + ean: NotRequired[str] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired[str] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired[str] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired[str] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired[str] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired[str] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired[str] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class ProductCreateParamsMarketingFeature(TypedDict): name: str """ diff --git a/stripe/params/_product_modify_params.py b/stripe/params/_product_modify_params.py index 6aab00d0a..eec882356 100644 --- a/stripe/params/_product_modify_params.py +++ b/stripe/params/_product_modify_params.py @@ -23,6 +23,10 @@ class ProductModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + identifiers: NotRequired["ProductModifyParamsIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -78,6 +82,37 @@ class ProductModifyParams(RequestOptions): """ +class ProductModifyParamsIdentifiers(TypedDict): + ean: NotRequired["Literal['']|str"] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired["Literal['']|str"] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired["Literal['']|str"] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired["Literal['']|str"] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired["Literal['']|str"] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired["Literal['']|str"] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired["Literal['']|str"] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class ProductModifyParamsMarketingFeature(TypedDict): name: str """ diff --git a/stripe/params/_product_update_params.py b/stripe/params/_product_update_params.py index a3605914f..b9f0aebd5 100644 --- a/stripe/params/_product_update_params.py +++ b/stripe/params/_product_update_params.py @@ -22,6 +22,10 @@ class ProductUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + identifiers: NotRequired["ProductUpdateParamsIdentifiers"] + """ + Other identifiers for this product. + """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. @@ -77,6 +81,37 @@ class ProductUpdateParams(TypedDict): """ +class ProductUpdateParamsIdentifiers(TypedDict): + ean: NotRequired["Literal['']|str"] + """ + European Article Number (EAN) consisting of 8 or 13 digits and optional dashes. You may optionally provide a leading 0 for a total of 14 digits. The final digit is a validated check digit. + """ + gtin: NotRequired["Literal['']|str"] + """ + Global Trade Item Number (GTIN) consisting of 8, 12, 13, or 14 digits and optional dashes. The final digit is a validated check digit. + """ + isbn: NotRequired["Literal['']|str"] + """ + International Standard Book Number (ISBN) consisting of 10 or 13 digits and optional dashes. The final digit is a validated check digit. For ISBN-10, the final digit may be a `X`. + """ + jan: NotRequired["Literal['']|str"] + """ + Japanese Article Number (JAN) consisting of 13 digits and optional dashes. The first two digits must either be `45` or `49`. The final digit is a validated check digit. + """ + mpn: NotRequired["Literal['']|str"] + """ + Manufacturer Part Number (MPN). May include up to 70 alphanumeric characters and dashes. + """ + nsn: NotRequired["Literal['']|str"] + """ + National Stock Number (NSN) consisting of 13 digits and optional dashes. The seventh character may also be alphanumeric. + """ + upc: NotRequired["Literal['']|str"] + """ + Universal Product Code (UPC) consisting of 12 digits and optional dashes. The final digit is a validated check digit. + """ + + class ProductUpdateParamsMarketingFeature(TypedDict): name: str """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index bf700b4ab..47a9138af 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -351,10 +351,6 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "SetupIntentConfirmParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index b0d8a6169..0e25d3d4c 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -487,10 +487,6 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired["SetupIntentCreateParamsPaymentMethodDataShopeepay"] """ If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index e4218d2fa..cce5e6fbd 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -329,10 +329,6 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired["SetupIntentModifyParamsPaymentMethodDataShopeepay"] """ If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index 0bd00bdbf..4529e6a52 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -328,10 +328,6 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired["SetupIntentUpdateParamsPaymentMethodDataShopeepay"] """ If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 413303456..1f8064c9e 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -825,7 +825,7 @@ class SubscriptionCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index 25bea5e51..c23afe7c4 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -793,7 +793,7 @@ class SubscriptionModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index 41bfae2ce..64e3f9b25 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -792,7 +792,7 @@ class SubscriptionUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'upi', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 225722865..b45f443f0 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -66,6 +66,14 @@ class SessionCreateParams(RequestOptions): """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. """ + custom_payment_method_types: NotRequired[List[str]] + """ + A list of custom payment methods (e.g., `cpmt_123`) this Checkout Session can accept. + + You can add custom payment methods to your account through the dashboard under Settings > Custom Payment Methods. + + Read more about custom payment methods in checkout in our [custom payment method types guide](https://docs.stripe.com/payments/payment-methods/custom-payment-methods). + """ custom_text: NotRequired["SessionCreateParamsCustomText"] """ Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. diff --git a/stripe/params/delegated_checkout/_requested_session_confirm_params.py b/stripe/params/delegated_checkout/_requested_session_confirm_params.py index 013fcbec9..1cc5655ed 100644 --- a/stripe/params/delegated_checkout/_requested_session_confirm_params.py +++ b/stripe/params/delegated_checkout/_requested_session_confirm_params.py @@ -21,6 +21,10 @@ class RequestedSessionConfirmParams(RequestOptions): """ The PaymentMethod to use with the requested session. """ + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or complete a payment action. Required for redirect-based payment methods such as Affirm or Klarna. + """ risk_details: NotRequired["RequestedSessionConfirmParamsRiskDetails"] """ Risk details/signals associated with the requested session diff --git a/stripe/params/delegated_checkout/_requested_session_modify_params.py b/stripe/params/delegated_checkout/_requested_session_modify_params.py index a040cc012..3fd0ee434 100644 --- a/stripe/params/delegated_checkout/_requested_session_modify_params.py +++ b/stripe/params/delegated_checkout/_requested_session_modify_params.py @@ -124,7 +124,7 @@ class RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOption( """ The shipping fulfillment option. """ - type: str + type: Literal["digital", "shipping"] """ The type of fulfillment option. """ @@ -167,7 +167,7 @@ class RequestedSessionModifyParamsFulfillmentDetailsSelectedFulfillmentOptionOve """ The shipping fulfillment option. """ - type: str + type: Literal["digital", "shipping"] """ The type of fulfillment option. """ diff --git a/stripe/params/delegated_checkout/_requested_session_update_params.py b/stripe/params/delegated_checkout/_requested_session_update_params.py index d3085bb2d..ff539042d 100644 --- a/stripe/params/delegated_checkout/_requested_session_update_params.py +++ b/stripe/params/delegated_checkout/_requested_session_update_params.py @@ -123,7 +123,7 @@ class RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOption( """ The shipping fulfillment option. """ - type: str + type: Literal["digital", "shipping"] """ The type of fulfillment option. """ @@ -166,7 +166,7 @@ class RequestedSessionUpdateParamsFulfillmentDetailsSelectedFulfillmentOptionOve """ The shipping fulfillment option. """ - type: str + type: Literal["digital", "shipping"] """ The type of fulfillment option. """ diff --git a/stripe/params/radar/__init__.py b/stripe/params/radar/__init__.py index 2556bd807..1c6e1a41a 100644 --- a/stripe/params/radar/__init__.py +++ b/stripe/params/radar/__init__.py @@ -15,7 +15,9 @@ from stripe.params.radar._account_evaluation_modify_params import ( AccountEvaluationModifyParams as AccountEvaluationModifyParams, AccountEvaluationModifyParamsLoginFailed as AccountEvaluationModifyParamsLoginFailed, + AccountEvaluationModifyParamsLoginSucceeded as AccountEvaluationModifyParamsLoginSucceeded, AccountEvaluationModifyParamsRegistrationFailed as AccountEvaluationModifyParamsRegistrationFailed, + AccountEvaluationModifyParamsRegistrationSucceeded as AccountEvaluationModifyParamsRegistrationSucceeded, ) from stripe.params.radar._account_evaluation_retrieve_params import ( AccountEvaluationRetrieveParams as AccountEvaluationRetrieveParams, @@ -23,7 +25,9 @@ from stripe.params.radar._account_evaluation_update_params import ( AccountEvaluationUpdateParams as AccountEvaluationUpdateParams, AccountEvaluationUpdateParamsLoginFailed as AccountEvaluationUpdateParamsLoginFailed, + AccountEvaluationUpdateParamsLoginSucceeded as AccountEvaluationUpdateParamsLoginSucceeded, AccountEvaluationUpdateParamsRegistrationFailed as AccountEvaluationUpdateParamsRegistrationFailed, + AccountEvaluationUpdateParamsRegistrationSucceeded as AccountEvaluationUpdateParamsRegistrationSucceeded, ) from stripe.params.radar._customer_evaluation_create_params import ( CustomerEvaluationCreateParams as CustomerEvaluationCreateParams, @@ -142,10 +146,18 @@ "stripe.params.radar._account_evaluation_modify_params", False, ), + "AccountEvaluationModifyParamsLoginSucceeded": ( + "stripe.params.radar._account_evaluation_modify_params", + False, + ), "AccountEvaluationModifyParamsRegistrationFailed": ( "stripe.params.radar._account_evaluation_modify_params", False, ), + "AccountEvaluationModifyParamsRegistrationSucceeded": ( + "stripe.params.radar._account_evaluation_modify_params", + False, + ), "AccountEvaluationRetrieveParams": ( "stripe.params.radar._account_evaluation_retrieve_params", False, @@ -158,10 +170,18 @@ "stripe.params.radar._account_evaluation_update_params", False, ), + "AccountEvaluationUpdateParamsLoginSucceeded": ( + "stripe.params.radar._account_evaluation_update_params", + False, + ), "AccountEvaluationUpdateParamsRegistrationFailed": ( "stripe.params.radar._account_evaluation_update_params", False, ), + "AccountEvaluationUpdateParamsRegistrationSucceeded": ( + "stripe.params.radar._account_evaluation_update_params", + False, + ), "CustomerEvaluationCreateParams": ( "stripe.params.radar._customer_evaluation_create_params", False, diff --git a/stripe/params/radar/_account_evaluation_modify_params.py b/stripe/params/radar/_account_evaluation_modify_params.py index 917f49c03..a7d1d24c7 100644 --- a/stripe/params/radar/_account_evaluation_modify_params.py +++ b/stripe/params/radar/_account_evaluation_modify_params.py @@ -14,12 +14,22 @@ class AccountEvaluationModifyParams(RequestOptions): """ Event payload for login_failed. """ + login_succeeded: NotRequired["AccountEvaluationModifyParamsLoginSucceeded"] + """ + Event payload for login_succeeded. + """ registration_failed: NotRequired[ "AccountEvaluationModifyParamsRegistrationFailed" ] """ Event payload for registration_failed. """ + registration_succeeded: NotRequired[ + "AccountEvaluationModifyParamsRegistrationSucceeded" + ] + """ + Event payload for registration_succeeded. + """ type: Literal[ "login_failed", "login_succeeded", @@ -38,8 +48,22 @@ class AccountEvaluationModifyParamsLoginFailed(TypedDict): """ +class AccountEvaluationModifyParamsLoginSucceeded(TypedDict): + qualification: NotRequired[Literal["suspected_account_sharing"]] + """ + An optional qualification for a login success. + """ + + class AccountEvaluationModifyParamsRegistrationFailed(TypedDict): reason: Literal["other", "suspected_multi_accounting"] """ The reason why this registration failed. """ + + +class AccountEvaluationModifyParamsRegistrationSucceeded(TypedDict): + qualification: NotRequired[Literal["suspected_multi_accounting"]] + """ + An optional qualification for a registration success. + """ diff --git a/stripe/params/radar/_account_evaluation_update_params.py b/stripe/params/radar/_account_evaluation_update_params.py index 4dc342986..93a957538 100644 --- a/stripe/params/radar/_account_evaluation_update_params.py +++ b/stripe/params/radar/_account_evaluation_update_params.py @@ -13,12 +13,22 @@ class AccountEvaluationUpdateParams(TypedDict): """ Event payload for login_failed. """ + login_succeeded: NotRequired["AccountEvaluationUpdateParamsLoginSucceeded"] + """ + Event payload for login_succeeded. + """ registration_failed: NotRequired[ "AccountEvaluationUpdateParamsRegistrationFailed" ] """ Event payload for registration_failed. """ + registration_succeeded: NotRequired[ + "AccountEvaluationUpdateParamsRegistrationSucceeded" + ] + """ + Event payload for registration_succeeded. + """ type: Literal[ "login_failed", "login_succeeded", @@ -37,8 +47,22 @@ class AccountEvaluationUpdateParamsLoginFailed(TypedDict): """ +class AccountEvaluationUpdateParamsLoginSucceeded(TypedDict): + qualification: NotRequired[Literal["suspected_account_sharing"]] + """ + An optional qualification for a login success. + """ + + class AccountEvaluationUpdateParamsRegistrationFailed(TypedDict): reason: Literal["other", "suspected_multi_accounting"] """ The reason why this registration failed. """ + + +class AccountEvaluationUpdateParamsRegistrationSucceeded(TypedDict): + qualification: NotRequired[Literal["suspected_multi_accounting"]] + """ + An optional qualification for a registration success. + """ diff --git a/stripe/params/radar/_issuing_authorization_evaluation_create_params.py b/stripe/params/radar/_issuing_authorization_evaluation_create_params.py index 54cb27b44..615b94d9d 100644 --- a/stripe/params/radar/_issuing_authorization_evaluation_create_params.py +++ b/stripe/params/radar/_issuing_authorization_evaluation_create_params.py @@ -96,7 +96,7 @@ class IssuingAuthorizationEvaluationCreateParamsAuthorizationDetails( """ initiated_at: int """ - The timestamp of the authorization initiated in seconds. + The time the authorization was initiated, as a Unix timestamp in seconds. Must not be in the future. """ point_of_sale_condition: NotRequired[ Literal[ @@ -140,7 +140,7 @@ class IssuingAuthorizationEvaluationCreateParamsCardDetails(TypedDict): """ created_at: int """ - The timestamp when the card was created. + The timestamp when the card was created, as a Unix timestamp in seconds. """ last4: NotRequired[str] """ diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index 08715a764..9fd274963 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -311,10 +311,6 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ - shared_payment_granted_token: NotRequired[str] - """ - ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. - """ shopeepay: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataShopeepay" ] diff --git a/stripe/params/v2/__init__.py b/stripe/params/v2/__init__.py index 31fd1208c..1012812f5 100644 --- a/stripe/params/v2/__init__.py +++ b/stripe/params/v2/__init__.py @@ -7,8 +7,11 @@ from stripe.params.v2 import ( billing as billing, core as core, + extend as extend, iam as iam, money_management as money_management, + network as network, + orchestrated_commerce as orchestrated_commerce, payments as payments, reporting as reporting, tax as tax, @@ -19,8 +22,11 @@ _import_map = { "billing": ("stripe.params.v2.billing", True), "core": ("stripe.params.v2.core", True), + "extend": ("stripe.params.v2.extend", True), "iam": ("stripe.params.v2.iam", True), "money_management": ("stripe.params.v2.money_management", True), + "network": ("stripe.params.v2.network", True), + "orchestrated_commerce": ("stripe.params.v2.orchestrated_commerce", True), "payments": ("stripe.params.v2.payments", True), "reporting": ("stripe.params.v2.reporting", True), "tax": ("stripe.params.v2.tax", True), diff --git a/stripe/params/v2/billing/_bill_setting_create_params.py b/stripe/params/v2/billing/_bill_setting_create_params.py index 809fee5b1..b6f1a4c7d 100644 --- a/stripe/params/v2/billing/_bill_setting_create_params.py +++ b/stripe/params/v2/billing/_bill_setting_create_params.py @@ -38,14 +38,14 @@ class BillSettingCreateParamsCalculation(TypedDict): class BillSettingCreateParamsCalculationTax(TypedDict): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ class BillSettingCreateParamsInvoice(TypedDict): time_until_due: NotRequired["BillSettingCreateParamsInvoiceTimeUntilDue"] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ @@ -57,5 +57,5 @@ class BillSettingCreateParamsInvoiceTimeUntilDue(TypedDict): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ diff --git a/stripe/params/v2/billing/_bill_setting_update_params.py b/stripe/params/v2/billing/_bill_setting_update_params.py index 60a6cd9aa..ac65afc99 100644 --- a/stripe/params/v2/billing/_bill_setting_update_params.py +++ b/stripe/params/v2/billing/_bill_setting_update_params.py @@ -24,7 +24,7 @@ class BillSettingUpdateParams(TypedDict): """ live_version: NotRequired[str] """ - Optionally change the live version of the BillSetting. Providing `live_version = "latest"` will set the + Optionally change the live version of the BillSetting. Providing `live_version = "latest"` sets the BillSetting' `live_version` to its latest version. """ lookup_key: NotRequired[str] @@ -44,14 +44,14 @@ class BillSettingUpdateParamsCalculation(TypedDict): class BillSettingUpdateParamsCalculationTax(TypedDict): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ class BillSettingUpdateParamsInvoice(TypedDict): time_until_due: NotRequired["BillSettingUpdateParamsInvoiceTimeUntilDue"] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ @@ -63,5 +63,5 @@ class BillSettingUpdateParamsInvoiceTimeUntilDue(TypedDict): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ diff --git a/stripe/params/v2/billing/_cadence_create_params.py b/stripe/params/v2/billing/_cadence_create_params.py index a4e4799a2..718b432c1 100644 --- a/stripe/params/v2/billing/_cadence_create_params.py +++ b/stripe/params/v2/billing/_cadence_create_params.py @@ -43,7 +43,7 @@ class CadenceCreateParamsBillingCycle(TypedDict): """ The number of intervals (specified in the interval attribute) between cadence billings. For example, type=month and interval_count=3 bills every - 3 months. If this is not provided, it will default to 1. + 3 months. If not provided, this defaults to 1. """ month: NotRequired["CadenceCreateParamsBillingCycleMonth"] """ @@ -67,7 +67,7 @@ class CadenceCreateParamsBillingCycleDay(TypedDict): time: NotRequired["CadenceCreateParamsBillingCycleDayTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -96,20 +96,20 @@ class CadenceCreateParamsBillingCycleMonth(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ The month to anchor the billing on for a type="month" billing cycle from - 1-12. If not provided, this will default to the month the cadence was created. + 1-12. If not provided, this defaults to the month the cadence was created. This setting can only be used for monthly billing cycles with `interval_count` of 2, 3, 4 or 6. - All occurrences will be calculated from month provided. + All occurrences are calculated from the month provided. """ time: NotRequired["CadenceCreateParamsBillingCycleMonthTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -138,13 +138,13 @@ class CadenceCreateParamsBillingCycleWeek(TypedDict): """ The day of the week to bill the type=week billing cycle on. Numbered from 1-7 for Monday to Sunday respectively, based on the ISO-8601 - week day numbering. If not provided, this will default to the day the + week day numbering. If not provided, this defaults to the day the cadence was created. """ time: NotRequired["CadenceCreateParamsBillingCycleWeekTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -173,18 +173,18 @@ class CadenceCreateParamsBillingCycleYear(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ - The month to bill on from 1-12. If not provided, this will default to the + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: NotRequired["CadenceCreateParamsBillingCycleYearTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -211,7 +211,7 @@ class CadenceCreateParamsBillingCycleYearTime(TypedDict): class CadenceCreateParamsPayer(TypedDict): billing_profile: str """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ @@ -238,7 +238,7 @@ class CadenceCreateParamsSettingsBill(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ @@ -250,5 +250,5 @@ class CadenceCreateParamsSettingsCollection(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ diff --git a/stripe/params/v2/billing/_cadence_update_params.py b/stripe/params/v2/billing/_cadence_update_params.py index c96d1de26..d323f803d 100644 --- a/stripe/params/v2/billing/_cadence_update_params.py +++ b/stripe/params/v2/billing/_cadence_update_params.py @@ -35,7 +35,7 @@ class CadenceUpdateParams(TypedDict): class CadenceUpdateParamsPayer(TypedDict): billing_profile: NotRequired[str] """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ @@ -58,8 +58,8 @@ class CadenceUpdateParamsSettingsBill(TypedDict): version: NotRequired[str] """ An optional field to specify the version of Settings to use. - If not provided, this will always default to the `live_version` specified on the setting, any time the settings are used. - Using a specific version here will prevent the settings from updating, and is discouraged for cadences. + If not provided, this defaults to the `live_version` specified on the setting, any time the settings are used. + Using a specific version here prevents the settings from updating, and is discouraged for cadences. To clear a pinned version, set the version to null. """ @@ -72,7 +72,7 @@ class CadenceUpdateParamsSettingsCollection(TypedDict): version: NotRequired[str] """ An optional field to specify the version of Settings to use. - If not provided, this will always default to the `live_version` specified on the setting, any time the settings are used. - Using a specific version here will prevent the settings from updating, and is discouraged for cadences. + If not provided, this defaults to the `live_version` specified on the setting, any time the settings are used. + Using a specific version here prevents the settings from updating, and is discouraged for cadences. To clear a pinned version, set the version to null. """ diff --git a/stripe/params/v2/billing/_collection_setting_create_params.py b/stripe/params/v2/billing/_collection_setting_create_params.py index 1f1395cb2..9ce026b00 100644 --- a/stripe/params/v2/billing/_collection_setting_create_params.py +++ b/stripe/params/v2/billing/_collection_setting_create_params.py @@ -7,9 +7,9 @@ class CollectionSettingCreateParams(TypedDict): collection_method: NotRequired[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ display_name: NotRequired[str] diff --git a/stripe/params/v2/billing/_collection_setting_update_params.py b/stripe/params/v2/billing/_collection_setting_update_params.py index cfadb8650..cce3b132a 100644 --- a/stripe/params/v2/billing/_collection_setting_update_params.py +++ b/stripe/params/v2/billing/_collection_setting_update_params.py @@ -7,9 +7,9 @@ class CollectionSettingUpdateParams(TypedDict): collection_method: NotRequired[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. """ display_name: NotRequired[str] """ @@ -24,7 +24,7 @@ class CollectionSettingUpdateParams(TypedDict): live_version: NotRequired[str] """ Optionally change the live version of the CollectionSetting. Billing Cadences and other objects that refer to this - CollectionSetting will use this version when no overrides are set. Providing `live_version = "latest"` will set the + CollectionSetting uses this version when no overrides are set. Providing `live_version = "latest"` sets the CollectionSetting's `live_version` to its latest version. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_custom_pricing_unit_create_params.py b/stripe/params/v2/billing/_custom_pricing_unit_create_params.py index ee56793c8..2e6356fd9 100644 --- a/stripe/params/v2/billing/_custom_pricing_unit_create_params.py +++ b/stripe/params/v2/billing/_custom_pricing_unit_create_params.py @@ -8,7 +8,7 @@ class CustomPricingUnitCreateParams(TypedDict): display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 10 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_custom_pricing_unit_update_params.py b/stripe/params/v2/billing/_custom_pricing_unit_update_params.py index c7a0d6cb6..c7f17744c 100644 --- a/stripe/params/v2/billing/_custom_pricing_unit_update_params.py +++ b/stripe/params/v2/billing/_custom_pricing_unit_update_params.py @@ -12,7 +12,7 @@ class CustomPricingUnitUpdateParams(TypedDict): """ display_name: NotRequired[str] """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. """ lookup_key: NotRequired[str] """ diff --git a/stripe/params/v2/billing/_intent_create_params.py b/stripe/params/v2/billing/_intent_create_params.py index 51502faec..e9703018a 100644 --- a/stripe/params/v2/billing/_intent_create_params.py +++ b/stripe/params/v2/billing/_intent_create_params.py @@ -59,7 +59,7 @@ class IntentCreateParamsActionApply(TypedDict): """ effective_at: NotRequired["IntentCreateParamsActionApplyEffectiveAt"] """ - When the apply action will take effect. If not specified, defaults to on_reserve. + When the apply action takes effect. If not specified, defaults to on_reserve. """ invoice_discount_rule: NotRequired[ "IntentCreateParamsActionApplyInvoiceDiscountRule" @@ -97,7 +97,7 @@ class IntentCreateParamsActionApplyDiscount(TypedDict): class IntentCreateParamsActionApplyEffectiveAt(TypedDict): timestamp: NotRequired[str] """ - The timestamp at which the apply action will take effect. Only present if type is timestamp. Only allowed for discount actions. + The timestamp at which the apply action takes effect. Only present if type is timestamp. Only allowed for discount actions. """ type: Literal[ "current_billing_period_end", @@ -107,7 +107,7 @@ class IntentCreateParamsActionApplyEffectiveAt(TypedDict): "timestamp", ] """ - When the apply action will take effect. + When the apply action takes effect. """ @@ -135,7 +135,7 @@ class IntentCreateParamsActionApplyInvoiceDiscountRulePercentOff(TypedDict): """ percent_off: Decimal """ - Percent that will be taken off of the amount. For example, percent_off of 50.0 will make $100 amount $50 instead. + Percent that is taken off the amount. For example, a percent_off of 50.0 reduces a 100 USD amount to 50 USD. """ @@ -224,11 +224,11 @@ class IntentCreateParamsActionDeactivate(TypedDict): """ collect_at: NotRequired[Literal["next_billing_date", "on_effective_at"]] """ - When the invoice will be collected. If not specified, the default behavior is on_effective_at. + When the invoice is collected. If not specified, the default behavior is on_effective_at. """ effective_at: NotRequired["IntentCreateParamsActionDeactivateEffectiveAt"] """ - When the deactivate action will take effect. If not specified, the default behavior is on_reserve. + When the deactivate action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: ( "IntentCreateParamsActionDeactivatePricingPlanSubscriptionDetails" @@ -269,7 +269,7 @@ class IntentCreateParamsActionDeactivateCancellationDetails(TypedDict): class IntentCreateParamsActionDeactivateEffectiveAt(TypedDict): timestamp: NotRequired[str] """ - The timestamp at which the deactivate action will take effect. Only present if type is timestamp. + The timestamp at which the deactivate action takes effect. Only present if type is timestamp. """ type: Literal[ "current_billing_period_end", @@ -278,7 +278,7 @@ class IntentCreateParamsActionDeactivateEffectiveAt(TypedDict): "timestamp", ] """ - When the deactivate action will take effect. + When the deactivate action takes effect. """ @@ -335,11 +335,11 @@ class IntentCreateParamsActionDeactivatePricingPlanSubscriptionDetailsOverridesP class IntentCreateParamsActionModify(TypedDict): collect_at: NotRequired[Literal["next_billing_date", "on_effective_at"]] """ - When the invoice will be collected. If not specified, the default behavior is next_billing_date. + When the invoice is collected. If not specified, the default behavior is next_billing_date. """ effective_at: NotRequired["IntentCreateParamsActionModifyEffectiveAt"] """ - When the modify action will take effect. If not specified, the default behavior is on_reserve. + When the modify action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: ( "IntentCreateParamsActionModifyPricingPlanSubscriptionDetails" @@ -358,11 +358,11 @@ class IntentCreateParamsActionModify(TypedDict): class IntentCreateParamsActionModifyEffectiveAt(TypedDict): timestamp: NotRequired[str] """ - The timestamp at which the modify action will take effect. Only present if type is timestamp. + The timestamp at which the modify action takes effect. Only present if type is timestamp. """ type: Literal["current_billing_period_start", "on_reserve", "timestamp"] """ - When the modify action will take effect. + When the modify action takes effect. """ @@ -469,7 +469,7 @@ class IntentCreateParamsActionModifyPricingPlanSubscriptionDetailsOverridesParti class IntentCreateParamsActionRemove(TypedDict): effective_at: NotRequired["IntentCreateParamsActionRemoveEffectiveAt"] """ - When the remove action will take effect. If not specified, defaults to on_reserve. + When the remove action takes effect. If not specified, defaults to on_reserve. """ invoice_discount_rule: NotRequired[str] """ @@ -488,18 +488,18 @@ class IntentCreateParamsActionRemove(TypedDict): class IntentCreateParamsActionRemoveEffectiveAt(TypedDict): type: Literal["current_billing_period_end", "on_reserve"] """ - When the remove action will take effect. + When the remove action takes effect. """ class IntentCreateParamsActionSubscribe(TypedDict): collect_at: NotRequired[Literal["next_billing_date", "on_effective_at"]] """ - When the invoice will be collected. If not specified, defaults to on_effective_at. + When the invoice is collected. If not specified, defaults to on_effective_at. """ effective_at: NotRequired["IntentCreateParamsActionSubscribeEffectiveAt"] """ - When the subscribe action will take effect. If not specified, the default behavior is on_reserve. + When the subscribe action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: NotRequired[ "IntentCreateParamsActionSubscribePricingPlanSubscriptionDetails" @@ -524,11 +524,11 @@ class IntentCreateParamsActionSubscribe(TypedDict): class IntentCreateParamsActionSubscribeEffectiveAt(TypedDict): timestamp: NotRequired[str] """ - The timestamp at which the subscribe action will take effect. Only present if type is timestamp. + The timestamp at which the subscribe action takes effect. Only present if type is timestamp. """ type: Literal["current_billing_period_start", "on_reserve", "timestamp"] """ - When the subscribe action will take effect. + When the subscribe action takes effect. """ @@ -685,7 +685,7 @@ class IntentCreateParamsCadenceDataBillingCycle(TypedDict): """ The number of intervals (specified in the interval attribute) between cadence billings. For example, type=month and interval_count=3 bills every - 3 months. If this is not provided, it will default to 1. + 3 months. If not provided, this defaults to 1. """ month: NotRequired["IntentCreateParamsCadenceDataBillingCycleMonth"] """ @@ -709,7 +709,7 @@ class IntentCreateParamsCadenceDataBillingCycleDay(TypedDict): time: NotRequired["IntentCreateParamsCadenceDataBillingCycleDayTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -738,20 +738,20 @@ class IntentCreateParamsCadenceDataBillingCycleMonth(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ The month to anchor the billing on for a type="month" billing cycle from - 1-12. If not provided, this will default to the month the cadence was created. + 1-12. If not provided, this defaults to the month the cadence was created. This setting can only be used for monthly billing cycles with `interval_count` of 2, 3, 4 or 6. - All occurrences will be calculated from month provided. + All occurrences are calculated from the month provided. """ time: NotRequired["IntentCreateParamsCadenceDataBillingCycleMonthTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -780,13 +780,13 @@ class IntentCreateParamsCadenceDataBillingCycleWeek(TypedDict): """ The day of the week to bill the type=week billing cycle on. Numbered from 1-7 for Monday to Sunday respectively, based on the ISO-8601 - week day numbering. If not provided, this will default to the day the + week day numbering. If not provided, this defaults to the day the cadence was created. """ time: NotRequired["IntentCreateParamsCadenceDataBillingCycleWeekTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -815,18 +815,18 @@ class IntentCreateParamsCadenceDataBillingCycleYear(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ - The month to bill on from 1-12. If not provided, this will default to the + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: NotRequired["IntentCreateParamsCadenceDataBillingCycleYearTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -853,7 +853,7 @@ class IntentCreateParamsCadenceDataBillingCycleYearTime(TypedDict): class IntentCreateParamsCadenceDataPayer(TypedDict): billing_profile: NotRequired[str] """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ billing_profile_data: NotRequired[ "IntentCreateParamsCadenceDataPayerBillingProfileData" @@ -872,7 +872,7 @@ class IntentCreateParamsCadenceDataPayerBillingProfileData(TypedDict): """ The default payment method to use when billing this profile. If left blank, the `PaymentMethod` from the `PaymentIntent` provided - on commit will be used to create the profile. + on commit is used to create the profile. """ @@ -899,7 +899,7 @@ class IntentCreateParamsCadenceDataSettingsBill(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ @@ -911,5 +911,5 @@ class IntentCreateParamsCadenceDataSettingsCollection(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ diff --git a/stripe/params/v2/billing/_license_fee_create_params.py b/stripe/params/v2/billing/_license_fee_create_params.py index b29baf69f..a6d908fa2 100644 --- a/stripe/params/v2/billing/_license_fee_create_params.py +++ b/stripe/params/v2/billing/_license_fee_create_params.py @@ -31,23 +31,23 @@ class LicenseFeeCreateParams(TypedDict): """ service_interval: Literal["day", "month", "week", "year"] """ - The interval for assessing service. For example, a monthly license fee with a rate of $1 for the first 10 "workloads" - and $2 thereafter means "$1 per workload up to 10 workloads during a month of service." This is similar to but + The interval for assessing service. For example, a monthly license fee with a rate of 1 USD for the first 10 "workloads" + and 2 USD thereafter means "1 USD per workload up to 10 workloads during a month of service." This is similar to but distinct from billing interval; the service interval deals with the rate at which the customer accumulates fees, while the billing interval in Cadence deals with the rate the customer is billed. """ service_interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` + to specify quarterly service. """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the license fee is inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the license fee price includes or excludes tax. """ tiering_mode: NotRequired[Literal["graduated", "volume"]] """ - Defines whether the tiered price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiered price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ @@ -78,7 +78,7 @@ class LicenseFeeCreateParamsTier(TypedDict): """ up_to_decimal: NotRequired[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: NotRequired[Literal["inf"]] diff --git a/stripe/params/v2/billing/_license_fee_update_params.py b/stripe/params/v2/billing/_license_fee_update_params.py index 6fac1922d..175fb50dc 100644 --- a/stripe/params/v2/billing/_license_fee_update_params.py +++ b/stripe/params/v2/billing/_license_fee_update_params.py @@ -15,7 +15,7 @@ class LicenseFeeUpdateParams(TypedDict): """ live_version: NotRequired[str] """ - Changes the version that new license fee will use. Providing `live_version = "latest"` will set the + Changes the version that new license fee activations use. Providing `live_version = "latest"` sets the license fee's `live_version` to its latest version. """ lookup_key: NotRequired[str] @@ -30,7 +30,7 @@ class LicenseFeeUpdateParams(TypedDict): """ tiering_mode: NotRequired[Literal["graduated", "volume"]] """ - Defines whether the tiered price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiered price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ @@ -61,7 +61,7 @@ class LicenseFeeUpdateParamsTier(TypedDict): """ up_to_decimal: NotRequired[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: NotRequired[Literal["inf"]] diff --git a/stripe/params/v2/billing/_licensed_item_create_params.py b/stripe/params/v2/billing/_licensed_item_create_params.py index 691af6ab9..d015bad40 100644 --- a/stripe/params/v2/billing/_licensed_item_create_params.py +++ b/stripe/params/v2/billing/_licensed_item_create_params.py @@ -8,7 +8,7 @@ class LicensedItemCreateParams(TypedDict): display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_licensed_item_update_params.py b/stripe/params/v2/billing/_licensed_item_update_params.py index 4f8a7a21f..abe42151e 100644 --- a/stripe/params/v2/billing/_licensed_item_update_params.py +++ b/stripe/params/v2/billing/_licensed_item_update_params.py @@ -8,7 +8,7 @@ class LicensedItemUpdateParams(TypedDict): display_name: NotRequired[str] """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py index ee1dd55e6..b39cc81f2 100644 --- a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py +++ b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py @@ -14,12 +14,12 @@ class MeterEventAdjustmentCreateParams(TypedDict): """ type: Literal["cancel"] """ - Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + Specifies the type of cancellation. Currently supports canceling a single event. """ class MeterEventAdjustmentCreateParamsCancel(TypedDict): identifier: str """ - Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them. """ diff --git a/stripe/params/v2/billing/_metered_item_create_params.py b/stripe/params/v2/billing/_metered_item_create_params.py index bb30a5372..21da7ff6e 100644 --- a/stripe/params/v2/billing/_metered_item_create_params.py +++ b/stripe/params/v2/billing/_metered_item_create_params.py @@ -8,7 +8,7 @@ class MeteredItemCreateParams(TypedDict): display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ invoice_presentation_dimensions: NotRequired[List[str]] diff --git a/stripe/params/v2/billing/_metered_item_update_params.py b/stripe/params/v2/billing/_metered_item_update_params.py index fc3f1fdb4..59fbd0743 100644 --- a/stripe/params/v2/billing/_metered_item_update_params.py +++ b/stripe/params/v2/billing/_metered_item_update_params.py @@ -8,7 +8,7 @@ class MeteredItemUpdateParams(TypedDict): display_name: NotRequired[str] """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_one_time_item_create_params.py b/stripe/params/v2/billing/_one_time_item_create_params.py index ad8f588ff..a9fee5993 100644 --- a/stripe/params/v2/billing/_one_time_item_create_params.py +++ b/stripe/params/v2/billing/_one_time_item_create_params.py @@ -8,7 +8,7 @@ class OneTimeItemCreateParams(TypedDict): display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_one_time_item_update_params.py b/stripe/params/v2/billing/_one_time_item_update_params.py index 85f3f9c62..d389825f4 100644 --- a/stripe/params/v2/billing/_one_time_item_update_params.py +++ b/stripe/params/v2/billing/_one_time_item_update_params.py @@ -8,7 +8,7 @@ class OneTimeItemUpdateParams(TypedDict): display_name: NotRequired[str] """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_pricing_plan_create_params.py b/stripe/params/v2/billing/_pricing_plan_create_params.py index 7a76ad6ac..529adef8f 100644 --- a/stripe/params/v2/billing/_pricing_plan_create_params.py +++ b/stripe/params/v2/billing/_pricing_plan_create_params.py @@ -12,7 +12,7 @@ class PricingPlanCreateParams(TypedDict): """ description: NotRequired[str] """ - Description of pricing plan subscription. + Description of the pricing plan. Maximum length of 500 characters. """ display_name: str """ @@ -28,5 +28,5 @@ class PricingPlanCreateParams(TypedDict): """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the PricingPlan is inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the pricing plan price includes or excludes tax. """ diff --git a/stripe/params/v2/billing/_pricing_plan_subscription_update_params.py b/stripe/params/v2/billing/_pricing_plan_subscription_update_params.py index 28c1f0680..3084e8469 100644 --- a/stripe/params/v2/billing/_pricing_plan_subscription_update_params.py +++ b/stripe/params/v2/billing/_pricing_plan_subscription_update_params.py @@ -8,7 +8,7 @@ class PricingPlanSubscriptionUpdateParams(TypedDict): clear_cancel_at: NotRequired[bool] """ - When set to true, the `servicing_status_transition.will_cancel_at` field will be cleared. + When set to true, the `servicing_status_transition.will_cancel_at` field is cleared. """ metadata: NotRequired[ "Dict[str, Optional[str]]|UntypedStripeObject[Optional[str]]" diff --git a/stripe/params/v2/billing/_pricing_plan_update_params.py b/stripe/params/v2/billing/_pricing_plan_update_params.py index 6b1eede65..cf03c9fc9 100644 --- a/stripe/params/v2/billing/_pricing_plan_update_params.py +++ b/stripe/params/v2/billing/_pricing_plan_update_params.py @@ -12,7 +12,7 @@ class PricingPlanUpdateParams(TypedDict): """ description: NotRequired[str] """ - Description of pricing plan subscription. + Description of the pricing plan. Maximum length of 500 characters. """ display_name: NotRequired[str] """ diff --git a/stripe/params/v2/billing/_profile_list_params.py b/stripe/params/v2/billing/_profile_list_params.py index 56d9c6222..3c69dad24 100644 --- a/stripe/params/v2/billing/_profile_list_params.py +++ b/stripe/params/v2/billing/_profile_list_params.py @@ -28,5 +28,5 @@ class ProfileListParams(TypedDict): status: NotRequired[Literal["active", "inactive"]] """ Filter billing profiles by status. Can be combined - with all other filters. If not provided, all billing profiles will be returned. + with all other filters. If not provided, all billing profiles are returned. """ diff --git a/stripe/params/v2/billing/_rate_card_create_params.py b/stripe/params/v2/billing/_rate_card_create_params.py index 161a3c858..7acff43cd 100644 --- a/stripe/params/v2/billing/_rate_card_create_params.py +++ b/stripe/params/v2/billing/_rate_card_create_params.py @@ -26,17 +26,17 @@ class RateCardCreateParams(TypedDict): """ service_interval: Literal["day", "month", "week", "year"] """ - The interval for assessing service. For example, a monthly RateCard with a rate of $1 for the first 10 "workloads" - and $2 thereafter means "$1 per workload up to 10 workloads during a month of service." This is similar to but + The interval for assessing service. For example, a monthly RateCard with a rate of 1 USD for the first 10 "workloads" + and 2 USD thereafter means "1 USD per workload up to 10 workloads during a month of service." This is similar to but distinct from billing interval; the service interval deals with the rate at which the customer accumulates fees, while the billing interval in Cadence deals with the rate the customer is billed. """ service_interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` + to specify quarterly service. """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the rates are inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the rate card price includes or excludes tax. """ diff --git a/stripe/params/v2/billing/_rate_card_modify_rates_params.py b/stripe/params/v2/billing/_rate_card_modify_rates_params.py index 7babcf20c..7500853f2 100644 --- a/stripe/params/v2/billing/_rate_card_modify_rates_params.py +++ b/stripe/params/v2/billing/_rate_card_modify_rates_params.py @@ -34,7 +34,7 @@ class RateCardModifyRatesParamsRatesToCreate(TypedDict): """ tiering_mode: NotRequired[Literal["graduated", "volume"]] """ - Defines whether the tiered price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiered price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ @@ -58,7 +58,7 @@ class RateCardModifyRatesParamsRatesToCreate(TypedDict): class RateCardModifyRatesParamsRatesToCreateMeteredItemData(TypedDict): display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ lookup_key: NotRequired[str] @@ -111,7 +111,7 @@ class RateCardModifyRatesParamsRatesToCreateTier(TypedDict): """ up_to_decimal: NotRequired[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: NotRequired[Literal["inf"]] diff --git a/stripe/params/v2/billing/_rate_card_update_params.py b/stripe/params/v2/billing/_rate_card_update_params.py index 2828868c6..5a9dfe801 100644 --- a/stripe/params/v2/billing/_rate_card_update_params.py +++ b/stripe/params/v2/billing/_rate_card_update_params.py @@ -18,7 +18,7 @@ class RateCardUpdateParams(TypedDict): """ live_version: NotRequired[str] """ - Changes the version that new RateCard activations will use. Providing `live_version = "latest"` will set the + Changes the version that new RateCard activations use. Providing `live_version = "latest"` sets the RateCard's `live_version` to its latest version. """ lookup_key: NotRequired[str] diff --git a/stripe/params/v2/billing/_service_action_create_params.py b/stripe/params/v2/billing/_service_action_create_params.py index 318d38af3..7cf250b81 100644 --- a/stripe/params/v2/billing/_service_action_create_params.py +++ b/stripe/params/v2/billing/_service_action_create_params.py @@ -106,7 +106,7 @@ class ServiceActionCreateParamsCreditGrantApplicabilityConfigScope(TypedDict): """ price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ @@ -202,7 +202,7 @@ class ServiceActionCreateParamsCreditGrantPerTenantApplicabilityConfigScope( """ price_type: NotRequired[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ diff --git a/stripe/params/v2/billing/rate_cards/_rate_create_params.py b/stripe/params/v2/billing/rate_cards/_rate_create_params.py index 4f8a8eac4..0c94b27b6 100644 --- a/stripe/params/v2/billing/rate_cards/_rate_create_params.py +++ b/stripe/params/v2/billing/rate_cards/_rate_create_params.py @@ -23,9 +23,9 @@ class RateCreateParams(TypedDict): """ tiering_mode: NotRequired[Literal["graduated", "volume"]] """ - Defines whether the tiered price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiered price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity - grows into new tiers. One of `unit_amount`, `tiers`, or `custom_pricing_unit_amount` is required. + grows into new tiers. Can only be set if `tiers` is set. """ tiers: NotRequired[List["RateCreateParamsTier"]] """ @@ -65,7 +65,7 @@ class RateCreateParamsTier(TypedDict): """ up_to_decimal: NotRequired[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: NotRequired[Literal["inf"]] diff --git a/stripe/params/v2/commerce/__init__.py b/stripe/params/v2/commerce/__init__.py new file mode 100644 index 000000000..69b7a23f3 --- /dev/null +++ b/stripe/params/v2/commerce/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.commerce import product_catalog as product_catalog + +# name -> (import_target, is_submodule) +_import_map = { + "product_catalog": ("stripe.params.v2.commerce.product_catalog", True), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/commerce/product_catalog/__init__.py b/stripe/params/v2/commerce/product_catalog/__init__.py new file mode 100644 index 000000000..6f1e2545d --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/__init__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.commerce.product_catalog._import_create_params import ( + ImportCreateParams as ImportCreateParams, + ) + from stripe.params.v2.commerce.product_catalog._import_list_params import ( + ImportListParams as ImportListParams, + ) + from stripe.params.v2.commerce.product_catalog._import_retrieve_params import ( + ImportRetrieveParams as ImportRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ImportCreateParams": ( + "stripe.params.v2.commerce.product_catalog._import_create_params", + False, + ), + "ImportListParams": ( + "stripe.params.v2.commerce.product_catalog._import_list_params", + False, + ), + "ImportRetrieveParams": ( + "stripe.params.v2.commerce.product_catalog._import_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/commerce/product_catalog/_import_create_params.py b/stripe/params/v2/commerce/product_catalog/_import_create_params.py new file mode 100644 index 000000000..8549de060 --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_create_params.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Dict +from typing_extensions import Literal, TypedDict + + +class ImportCreateParams(TypedDict): + feed_type: Literal["inventory", "pricing", "product"] + """ + The type of catalog data to import. + """ + metadata: "Dict[str, str]|UntypedStripeObject[str]" + """ + Additional information about the import in a structured format. + """ + mode: Literal["replace", "upsert"] + """ + The strategy for handling existing catalog data during import. + """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_list_params.py b/stripe/params/v2/commerce/product_catalog/_import_list_params.py new file mode 100644 index 000000000..fecbc23da --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_list_params.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ImportListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + feed_type: NotRequired[Literal["inventory", "pricing", "product"]] + """ + Filter by the type of feed data being imported. + """ + limit: NotRequired[int] + """ + The maximum number of results per page. + """ + status: NotRequired[ + Literal[ + "awaiting_upload", + "failed", + "processing", + "succeeded", + "succeeded_with_errors", + ] + ] + """ + Filter by import status. + """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py b/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py new file mode 100644 index 000000000..d49d1d1f8 --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ImportRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index 1d7cc5df1..7a1100355 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -618,6 +618,21 @@ AccountUpdateParamsIdentityIndividualScriptNamesKana as AccountUpdateParamsIdentityIndividualScriptNamesKana, AccountUpdateParamsIdentityIndividualScriptNamesKanji as AccountUpdateParamsIdentityIndividualScriptNamesKanji, ) + from stripe.params.v2.core._approval_request_cancel_params import ( + ApprovalRequestCancelParams as ApprovalRequestCancelParams, + ) + from stripe.params.v2.core._approval_request_execute_params import ( + ApprovalRequestExecuteParams as ApprovalRequestExecuteParams, + ) + from stripe.params.v2.core._approval_request_list_params import ( + ApprovalRequestListParams as ApprovalRequestListParams, + ) + from stripe.params.v2.core._approval_request_retrieve_params import ( + ApprovalRequestRetrieveParams as ApprovalRequestRetrieveParams, + ) + from stripe.params.v2.core._approval_request_submit_params import ( + ApprovalRequestSubmitParams as ApprovalRequestSubmitParams, + ) from stripe.params.v2.core._batch_job_cancel_params import ( BatchJobCancelParams as BatchJobCancelParams, ) @@ -631,8 +646,13 @@ ) from stripe.params.v2.core._claimable_sandbox_create_params import ( ClaimableSandboxCreateParams as ClaimableSandboxCreateParams, + ClaimableSandboxCreateParamsOnboardingLinkDetails as ClaimableSandboxCreateParamsOnboardingLinkDetails, ClaimableSandboxCreateParamsPrefill as ClaimableSandboxCreateParamsPrefill, ) + from stripe.params.v2.core._claimable_sandbox_renew_onboarding_link_params import ( + ClaimableSandboxRenewOnboardingLinkParams as ClaimableSandboxRenewOnboardingLinkParams, + ClaimableSandboxRenewOnboardingLinkParamsOnboardingLinkDetails as ClaimableSandboxRenewOnboardingLinkParamsOnboardingLinkDetails, + ) from stripe.params.v2.core._claimable_sandbox_retrieve_params import ( ClaimableSandboxRetrieveParams as ClaimableSandboxRetrieveParams, ) @@ -677,21 +697,6 @@ from stripe.params.v2.core._event_retrieve_params import ( EventRetrieveParams as EventRetrieveParams, ) - from stripe.params.v2.core._workflow_invoke_params import ( - WorkflowInvokeParams as WorkflowInvokeParams, - ) - from stripe.params.v2.core._workflow_list_params import ( - WorkflowListParams as WorkflowListParams, - ) - from stripe.params.v2.core._workflow_retrieve_params import ( - WorkflowRetrieveParams as WorkflowRetrieveParams, - ) - from stripe.params.v2.core._workflow_run_list_params import ( - WorkflowRunListParams as WorkflowRunListParams, - ) - from stripe.params.v2.core._workflow_run_retrieve_params import ( - WorkflowRunRetrieveParams as WorkflowRunRetrieveParams, - ) # name -> (import_target, is_submodule) _import_map = { @@ -3074,6 +3079,26 @@ "stripe.params.v2.core._account_update_params", False, ), + "ApprovalRequestCancelParams": ( + "stripe.params.v2.core._approval_request_cancel_params", + False, + ), + "ApprovalRequestExecuteParams": ( + "stripe.params.v2.core._approval_request_execute_params", + False, + ), + "ApprovalRequestListParams": ( + "stripe.params.v2.core._approval_request_list_params", + False, + ), + "ApprovalRequestRetrieveParams": ( + "stripe.params.v2.core._approval_request_retrieve_params", + False, + ), + "ApprovalRequestSubmitParams": ( + "stripe.params.v2.core._approval_request_submit_params", + False, + ), "BatchJobCancelParams": ( "stripe.params.v2.core._batch_job_cancel_params", False, @@ -3098,10 +3123,22 @@ "stripe.params.v2.core._claimable_sandbox_create_params", False, ), + "ClaimableSandboxCreateParamsOnboardingLinkDetails": ( + "stripe.params.v2.core._claimable_sandbox_create_params", + False, + ), "ClaimableSandboxCreateParamsPrefill": ( "stripe.params.v2.core._claimable_sandbox_create_params", False, ), + "ClaimableSandboxRenewOnboardingLinkParams": ( + "stripe.params.v2.core._claimable_sandbox_renew_onboarding_link_params", + False, + ), + "ClaimableSandboxRenewOnboardingLinkParamsOnboardingLinkDetails": ( + "stripe.params.v2.core._claimable_sandbox_renew_onboarding_link_params", + False, + ), "ClaimableSandboxRetrieveParams": ( "stripe.params.v2.core._claimable_sandbox_retrieve_params", False, @@ -3171,26 +3208,6 @@ "stripe.params.v2.core._event_retrieve_params", False, ), - "WorkflowInvokeParams": ( - "stripe.params.v2.core._workflow_invoke_params", - False, - ), - "WorkflowListParams": ( - "stripe.params.v2.core._workflow_list_params", - False, - ), - "WorkflowRetrieveParams": ( - "stripe.params.v2.core._workflow_retrieve_params", - False, - ), - "WorkflowRunListParams": ( - "stripe.params.v2.core._workflow_run_list_params", - False, - ), - "WorkflowRunRetrieveParams": ( - "stripe.params.v2.core._workflow_run_retrieve_params", - False, - ), } if not TYPE_CHECKING: diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 58f9d9eea..b926ef326 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -3854,7 +3854,10 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "be_vat", "bg_uic", "bg_vat", + "bm_crn", + "bo_tin", "br_cnpj", + "bt_tpn", "ca_cn", "ca_crarr", "ca_gst_hst", @@ -3862,6 +3865,7 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ca_rid", "ch_chid", "ch_uid", + "co_nit", "cr_cpj", "cr_nite", "cy_he", @@ -3875,8 +3879,10 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "dk_cvr", "dk_vat", "do_rcn", + "ec_ruc", "ee_rk", "ee_vat", + "eg_tin", "es_cif", "es_vat", "fi_vat", @@ -3886,13 +3892,16 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "fr_vat", "gb_crn", "gb_vat", + "gh_tin", "gi_crn", "gr_afm", "gr_gemi", "gr_vat", "gt_nit", + "gy_tin", "hk_br", "hk_cr", + "hn_rtn", "hr_mbs", "hr_oib", "hr_vat", @@ -3904,9 +3913,14 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ie_vat", "it_rea", "it_vat", + "jm_trn", + "jo_crn", "jp_cn", + "ke_pin", + "ky_crn", "kz_bin", "li_uid", + "lk_tin", "lt_ccrn", "lt_vat", "lu_nif", @@ -3914,27 +3928,33 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "lu_vat", "lv_urn", "lv_vat", + "mo_tin", "mt_crn", "mt_tin", "mt_vat", + "mv_tin", "mx_rfc", "my_brn", "my_coid", "my_itn", "my_sst", "mz_nuit", + "ng_tin", "nl_kvk", "nl_rsin", "nl_vat", "no_orgnr", "nz_bn", "nz_ird", + "pa_ruc", "pe_ruc", + "ph_tin", "pk_ntn", "pl_nip", "pl_regon", "pl_vat", "pt_vat", + "py_ruc", "ro_cui", "ro_orc", "ro_vat", @@ -3949,10 +3969,15 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "sk_dic", "sk_ico", "sk_vat", + "sl_tin", + "sv_nit", "th_crn", "th_prn", "th_tin", "us_ein", + "uy_ruc", + "vg_cn", + "za_tin", ] """ Open Enum. The ID number type of a business entity. @@ -4411,8 +4436,11 @@ class AccountCreateParamsIdentityIndividualIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -4430,26 +4458,37 @@ class AccountCreateParamsIdentityIndividualIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -4457,17 +4496,22 @@ class AccountCreateParamsIdentityIndividualIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -4476,6 +4520,7 @@ class AccountCreateParamsIdentityIndividualIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index 331719143..4357f5ac6 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -835,7 +835,10 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "be_vat", "bg_uic", "bg_vat", + "bm_crn", + "bo_tin", "br_cnpj", + "bt_tpn", "ca_cn", "ca_crarr", "ca_gst_hst", @@ -843,6 +846,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ca_rid", "ch_chid", "ch_uid", + "co_nit", "cr_cpj", "cr_nite", "cy_he", @@ -856,8 +860,10 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "dk_cvr", "dk_vat", "do_rcn", + "ec_ruc", "ee_rk", "ee_vat", + "eg_tin", "es_cif", "es_vat", "fi_vat", @@ -867,13 +873,16 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "fr_vat", "gb_crn", "gb_vat", + "gh_tin", "gi_crn", "gr_afm", "gr_gemi", "gr_vat", "gt_nit", + "gy_tin", "hk_br", "hk_cr", + "hn_rtn", "hr_mbs", "hr_oib", "hr_vat", @@ -885,9 +894,14 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ie_vat", "it_rea", "it_vat", + "jm_trn", + "jo_crn", "jp_cn", + "ke_pin", + "ky_crn", "kz_bin", "li_uid", + "lk_tin", "lt_ccrn", "lt_vat", "lu_nif", @@ -895,27 +909,33 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "lu_vat", "lv_urn", "lv_vat", + "mo_tin", "mt_crn", "mt_tin", "mt_vat", + "mv_tin", "mx_rfc", "my_brn", "my_coid", "my_itn", "my_sst", "mz_nuit", + "ng_tin", "nl_kvk", "nl_rsin", "nl_vat", "no_orgnr", "nz_bn", "nz_ird", + "pa_ruc", "pe_ruc", + "ph_tin", "pk_ntn", "pl_nip", "pl_regon", "pl_vat", "pt_vat", + "py_ruc", "ro_cui", "ro_orc", "ro_vat", @@ -930,10 +950,15 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): "sk_dic", "sk_ico", "sk_vat", + "sl_tin", + "sv_nit", "th_crn", "th_prn", "th_tin", "us_ein", + "uy_ruc", + "vg_cn", + "za_tin", ] """ Open Enum. The ID number type of a business entity. @@ -1408,8 +1433,11 @@ class AccountTokenCreateParamsIdentityIndividualIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -1427,26 +1455,37 @@ class AccountTokenCreateParamsIdentityIndividualIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -1454,17 +1493,22 @@ class AccountTokenCreateParamsIdentityIndividualIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -1473,6 +1517,7 @@ class AccountTokenCreateParamsIdentityIndividualIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 92e940e78..8279545e7 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -3888,7 +3888,10 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "be_vat", "bg_uic", "bg_vat", + "bm_crn", + "bo_tin", "br_cnpj", + "bt_tpn", "ca_cn", "ca_crarr", "ca_gst_hst", @@ -3896,6 +3899,7 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ca_rid", "ch_chid", "ch_uid", + "co_nit", "cr_cpj", "cr_nite", "cy_he", @@ -3909,8 +3913,10 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "dk_cvr", "dk_vat", "do_rcn", + "ec_ruc", "ee_rk", "ee_vat", + "eg_tin", "es_cif", "es_vat", "fi_vat", @@ -3920,13 +3926,16 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "fr_vat", "gb_crn", "gb_vat", + "gh_tin", "gi_crn", "gr_afm", "gr_gemi", "gr_vat", "gt_nit", + "gy_tin", "hk_br", "hk_cr", + "hn_rtn", "hr_mbs", "hr_oib", "hr_vat", @@ -3938,9 +3947,14 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "ie_vat", "it_rea", "it_vat", + "jm_trn", + "jo_crn", "jp_cn", + "ke_pin", + "ky_crn", "kz_bin", "li_uid", + "lk_tin", "lt_ccrn", "lt_vat", "lu_nif", @@ -3948,27 +3962,33 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "lu_vat", "lv_urn", "lv_vat", + "mo_tin", "mt_crn", "mt_tin", "mt_vat", + "mv_tin", "mx_rfc", "my_brn", "my_coid", "my_itn", "my_sst", "mz_nuit", + "ng_tin", "nl_kvk", "nl_rsin", "nl_vat", "no_orgnr", "nz_bn", "nz_ird", + "pa_ruc", "pe_ruc", + "ph_tin", "pk_ntn", "pl_nip", "pl_regon", "pl_vat", "pt_vat", + "py_ruc", "ro_cui", "ro_orc", "ro_vat", @@ -3983,10 +4003,15 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): "sk_dic", "sk_ico", "sk_vat", + "sl_tin", + "sv_nit", "th_crn", "th_prn", "th_tin", "us_ein", + "uy_ruc", + "vg_cn", + "za_tin", ] """ Open Enum. The ID number type of a business entity. @@ -4447,8 +4472,11 @@ class AccountUpdateParamsIdentityIndividualIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -4466,26 +4494,37 @@ class AccountUpdateParamsIdentityIndividualIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -4493,17 +4532,22 @@ class AccountUpdateParamsIdentityIndividualIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -4512,6 +4556,7 @@ class AccountUpdateParamsIdentityIndividualIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/_approval_request_cancel_params.py b/stripe/params/v2/core/_approval_request_cancel_params.py new file mode 100644 index 000000000..a695a6d68 --- /dev/null +++ b/stripe/params/v2/core/_approval_request_cancel_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ApprovalRequestCancelParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_approval_request_execute_params.py b/stripe/params/v2/core/_approval_request_execute_params.py new file mode 100644 index 000000000..93b7b416a --- /dev/null +++ b/stripe/params/v2/core/_approval_request_execute_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ApprovalRequestExecuteParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_approval_request_list_params.py b/stripe/params/v2/core/_approval_request_list_params.py new file mode 100644 index 000000000..8bca72294 --- /dev/null +++ b/stripe/params/v2/core/_approval_request_list_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class ApprovalRequestListParams(TypedDict): + limit: NotRequired[int] + """ + Maximum number of results to return. + """ diff --git a/stripe/params/v2/core/_approval_request_retrieve_params.py b/stripe/params/v2/core/_approval_request_retrieve_params.py new file mode 100644 index 000000000..6ad431d83 --- /dev/null +++ b/stripe/params/v2/core/_approval_request_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ApprovalRequestRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_approval_request_submit_params.py b/stripe/params/v2/core/_approval_request_submit_params.py new file mode 100644 index 000000000..e555e5134 --- /dev/null +++ b/stripe/params/v2/core/_approval_request_submit_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class ApprovalRequestSubmitParams(TypedDict): + reason: NotRequired[str] + """ + The reason for submitting the approval request. + """ diff --git a/stripe/params/v2/core/_batch_job_create_params.py b/stripe/params/v2/core/_batch_job_create_params.py index a7f1b2d7a..6b642227a 100644 --- a/stripe/params/v2/core/_batch_job_create_params.py +++ b/stripe/params/v2/core/_batch_job_create_params.py @@ -32,7 +32,7 @@ class BatchJobCreateParams(TypedDict): class BatchJobCreateParamsEndpoint(TypedDict): - http_method: Literal["post"] + http_method: Literal["delete", "post"] """ The HTTP method to use when calling the endpoint. """ diff --git a/stripe/params/v2/core/_claimable_sandbox_create_params.py b/stripe/params/v2/core/_claimable_sandbox_create_params.py index fae144595..e811db55c 100644 --- a/stripe/params/v2/core/_claimable_sandbox_create_params.py +++ b/stripe/params/v2/core/_claimable_sandbox_create_params.py @@ -1,19 +1,39 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing_extensions import NotRequired, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class ClaimableSandboxCreateParams(TypedDict): + app_channel: NotRequired[Literal["public", "testing"]] + """ + The app channel that will be used when pre-installing your app on the claimable sandbox. + This field defaults to `public` if omitted. + """ enable_mcp_access: bool """ If true, returns a key that can be used with [Stripe's MCP server](https://docs.stripe.com/mcp). """ + onboarding_link_details: ( + "ClaimableSandboxCreateParamsOnboardingLinkDetails" + ) + """ + Details about the onboarding link. + """ prefill: "ClaimableSandboxCreateParamsPrefill" """ Values that are prefilled when a user claims the sandbox. When a user claims the sandbox, they will be able to update these values. """ +class ClaimableSandboxCreateParamsOnboardingLinkDetails(TypedDict): + refresh_url: str + """ + The URL the user will be redirected to if the onboarding link is expired or invalid. + The URL specified should attempt to generate a new onboarding link, + and re-direct the user to this new onboarding link so that they can proceed with the onboarding flow. + """ + + class ClaimableSandboxCreateParamsPrefill(TypedDict): country: str """ diff --git a/stripe/params/v2/core/_claimable_sandbox_renew_onboarding_link_params.py b/stripe/params/v2/core/_claimable_sandbox_renew_onboarding_link_params.py new file mode 100644 index 000000000..88a811a79 --- /dev/null +++ b/stripe/params/v2/core/_claimable_sandbox_renew_onboarding_link_params.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class ClaimableSandboxRenewOnboardingLinkParams(TypedDict): + onboarding_link_details: NotRequired[ + "ClaimableSandboxRenewOnboardingLinkParamsOnboardingLinkDetails" + ] + """ + Details about the onboarding link. + If omitted, the existing onboarding link details will be reused. + """ + + +class ClaimableSandboxRenewOnboardingLinkParamsOnboardingLinkDetails( + TypedDict +): + refresh_url: str + """ + The URL the user will be redirected to if the onboarding link is expired or invalid. + The URL specified should attempt to generate a new onboarding link, + and re-direct the user to this new onboarding link so that they can proceed with the onboarding flow. + """ diff --git a/stripe/params/v2/core/accounts/_person_create_params.py b/stripe/params/v2/core/accounts/_person_create_params.py index 02e96937f..bf1ed5f53 100644 --- a/stripe/params/v2/core/accounts/_person_create_params.py +++ b/stripe/params/v2/core/accounts/_person_create_params.py @@ -330,8 +330,11 @@ class PersonCreateParamsIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -349,26 +352,37 @@ class PersonCreateParamsIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -376,17 +390,22 @@ class PersonCreateParamsIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -395,6 +414,7 @@ class PersonCreateParamsIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/accounts/_person_token_create_params.py b/stripe/params/v2/core/accounts/_person_token_create_params.py index fd24ebbee..dacea3bf7 100644 --- a/stripe/params/v2/core/accounts/_person_token_create_params.py +++ b/stripe/params/v2/core/accounts/_person_token_create_params.py @@ -328,8 +328,11 @@ class PersonTokenCreateParamsIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -347,26 +350,37 @@ class PersonTokenCreateParamsIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -374,17 +388,22 @@ class PersonTokenCreateParamsIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -393,6 +412,7 @@ class PersonTokenCreateParamsIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/accounts/_person_update_params.py b/stripe/params/v2/core/accounts/_person_update_params.py index 2d1b43770..449f13426 100644 --- a/stripe/params/v2/core/accounts/_person_update_params.py +++ b/stripe/params/v2/core/accounts/_person_update_params.py @@ -332,8 +332,11 @@ class PersonUpdateParamsIdNumber(TypedDict): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -351,26 +354,37 @@ class PersonUpdateParamsIdNumber(TypedDict): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -378,17 +392,22 @@ class PersonUpdateParamsIdNumber(TypedDict): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -397,6 +416,7 @@ class PersonUpdateParamsIdNumber(TypedDict): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py index da013f908..943faf0a9 100644 --- a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py +++ b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py @@ -8,7 +8,9 @@ class GbBankAccountCreateParams(TypedDict): """ The Account Number of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/params/v2/extend/__init__.py b/stripe/params/v2/extend/__init__.py new file mode 100644 index 000000000..767d9f05e --- /dev/null +++ b/stripe/params/v2/extend/__init__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.extend._workflow_invoke_params import ( + WorkflowInvokeParams as WorkflowInvokeParams, + ) + from stripe.params.v2.extend._workflow_list_params import ( + WorkflowListParams as WorkflowListParams, + ) + from stripe.params.v2.extend._workflow_retrieve_params import ( + WorkflowRetrieveParams as WorkflowRetrieveParams, + ) + from stripe.params.v2.extend._workflow_run_list_params import ( + WorkflowRunListParams as WorkflowRunListParams, + ) + from stripe.params.v2.extend._workflow_run_retrieve_params import ( + WorkflowRunRetrieveParams as WorkflowRunRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "WorkflowInvokeParams": ( + "stripe.params.v2.extend._workflow_invoke_params", + False, + ), + "WorkflowListParams": ( + "stripe.params.v2.extend._workflow_list_params", + False, + ), + "WorkflowRetrieveParams": ( + "stripe.params.v2.extend._workflow_retrieve_params", + False, + ), + "WorkflowRunListParams": ( + "stripe.params.v2.extend._workflow_run_list_params", + False, + ), + "WorkflowRunRetrieveParams": ( + "stripe.params.v2.extend._workflow_run_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/core/_workflow_invoke_params.py b/stripe/params/v2/extend/_workflow_invoke_params.py similarity index 100% rename from stripe/params/v2/core/_workflow_invoke_params.py rename to stripe/params/v2/extend/_workflow_invoke_params.py diff --git a/stripe/params/v2/core/_workflow_list_params.py b/stripe/params/v2/extend/_workflow_list_params.py similarity index 82% rename from stripe/params/v2/core/_workflow_list_params.py rename to stripe/params/v2/extend/_workflow_list_params.py index 14eb57bb4..2bfaad998 100644 --- a/stripe/params/v2/core/_workflow_list_params.py +++ b/stripe/params/v2/extend/_workflow_list_params.py @@ -9,7 +9,9 @@ class WorkflowListParams(TypedDict): """ Restrict page size to no more than this number. """ - status: List[Literal["active", "archived", "draft", "inactive"]] + status: NotRequired[ + List[Literal["active", "archived", "draft", "inactive"]] + ] """ When retrieving Workflows, include only those with the specified status values. If not specified, all Workflows in active and inactive status are returned. diff --git a/stripe/params/v2/core/_workflow_retrieve_params.py b/stripe/params/v2/extend/_workflow_retrieve_params.py similarity index 100% rename from stripe/params/v2/core/_workflow_retrieve_params.py rename to stripe/params/v2/extend/_workflow_retrieve_params.py diff --git a/stripe/params/v2/core/_workflow_run_list_params.py b/stripe/params/v2/extend/_workflow_run_list_params.py similarity index 84% rename from stripe/params/v2/core/_workflow_run_list_params.py rename to stripe/params/v2/extend/_workflow_run_list_params.py index b4e3dc0fc..61a6afd17 100644 --- a/stripe/params/v2/core/_workflow_run_list_params.py +++ b/stripe/params/v2/extend/_workflow_run_list_params.py @@ -9,11 +9,11 @@ class WorkflowRunListParams(TypedDict): """ Restrict page size to no more than this number. """ - status: List[Literal["failed", "started", "succeeded"]] + status: NotRequired[List[Literal["failed", "started", "succeeded"]]] """ When retrieving Workflow Runs, include only those with the specified status values. If not specified, all Runs are returned. """ - workflow: List[str] + workflow: NotRequired[List[str]] """ When retrieving Workflow Runs, include only those associated with the Workflows specified. If not specified, all Runs are returned. """ diff --git a/stripe/params/v2/core/_workflow_run_retrieve_params.py b/stripe/params/v2/extend/_workflow_run_retrieve_params.py similarity index 100% rename from stripe/params/v2/core/_workflow_run_retrieve_params.py rename to stripe/params/v2/extend/_workflow_run_retrieve_params.py diff --git a/stripe/params/v2/iam/__init__.py b/stripe/params/v2/iam/__init__.py index 705c460ef..cc18cc4da 100644 --- a/stripe/params/v2/iam/__init__.py +++ b/stripe/params/v2/iam/__init__.py @@ -4,6 +4,9 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.v2.iam._activity_log_list_params import ( + ActivityLogListParams as ActivityLogListParams, + ) from stripe.params.v2.iam._api_key_create_params import ( ApiKeyCreateParams as ApiKeyCreateParams, ApiKeyCreateParamsPublicKey as ApiKeyCreateParamsPublicKey, @@ -29,6 +32,10 @@ # name -> (import_target, is_submodule) _import_map = { + "ActivityLogListParams": ( + "stripe.params.v2.iam._activity_log_list_params", + False, + ), "ApiKeyCreateParams": ( "stripe.params.v2.iam._api_key_create_params", False, diff --git a/stripe/params/v2/iam/_activity_log_list_params.py b/stripe/params/v2/iam/_activity_log_list_params.py new file mode 100644 index 000000000..92128a2ea --- /dev/null +++ b/stripe/params/v2/iam/_activity_log_list_params.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ActivityLogListParams(TypedDict): + action_groups: NotRequired[ + List[Literal["api_key", "user_invite", "user_roles"]] + ] + """ + Filter results to only include activity logs for the specified action group types. + """ + actions: NotRequired[ + List[ + Literal[ + "api_key_created", + "api_key_deleted", + "api_key_updated", + "api_key_viewed", + "user_invite_accepted", + "user_invite_created", + "user_invite_deleted", + "user_roles_deleted", + "user_roles_updated", + ] + ] + ] + """ + Filter results to only include activity logs for the specified action types. + """ + limit: NotRequired[int] + """ + Maximum number of results to return per page. + """ diff --git a/stripe/params/v2/money_management/__init__.py b/stripe/params/v2/money_management/__init__.py index 51ca08681..cf5efa320 100644 --- a/stripe/params/v2/money_management/__init__.py +++ b/stripe/params/v2/money_management/__init__.py @@ -37,6 +37,7 @@ ) from stripe.params.v2.money_management._financial_account_update_params import ( FinancialAccountUpdateParams as FinancialAccountUpdateParams, + FinancialAccountUpdateParamsStorage as FinancialAccountUpdateParamsStorage, ) from stripe.params.v2.money_management._financial_address_create_params import ( FinancialAddressCreateParams as FinancialAddressCreateParams, @@ -230,6 +231,10 @@ "stripe.params.v2.money_management._financial_account_update_params", False, ), + "FinancialAccountUpdateParamsStorage": ( + "stripe.params.v2.money_management._financial_account_update_params", + False, + ), "FinancialAddressCreateParams": ( "stripe.params.v2.money_management._financial_address_create_params", False, diff --git a/stripe/params/v2/money_management/_currency_conversion_create_params.py b/stripe/params/v2/money_management/_currency_conversion_create_params.py index 393d25cf4..f7109304c 100644 --- a/stripe/params/v2/money_management/_currency_conversion_create_params.py +++ b/stripe/params/v2/money_management/_currency_conversion_create_params.py @@ -10,10 +10,14 @@ class CurrencyConversionCreateParams(_CurrencyConversionCreateParamsBase): - financial_account: str + financial_account: NotRequired[str] """ The FinancialAccount id to create the CurrencyConversion on. """ + fx_quote: NotRequired[str] + """ + The FX quote to use for the conversion. + """ to: "CurrencyConversionCreateParamsTo" """ To amount object indicating the to currency or optional amount. diff --git a/stripe/params/v2/money_management/_financial_account_list_params.py b/stripe/params/v2/money_management/_financial_account_list_params.py index fc0263845..3aaffda5b 100644 --- a/stripe/params/v2/money_management/_financial_account_list_params.py +++ b/stripe/params/v2/money_management/_financial_account_list_params.py @@ -17,7 +17,16 @@ class FinancialAccountListParams(TypedDict): """ The status of the FinancialAccount to filter by. By default, closed FinancialAccounts are not returned. """ - types: NotRequired[List[Literal["accrued_fees", "payments", "storage"]]] + types: NotRequired[ + List[ + Literal[ + "accrued_fees", + "multiprocessor_settlement", + "payments", + "storage", + ] + ] + ] """ Filter for FinancialAccount `type`. By default, FinancialAccounts of any `type` are returned. """ diff --git a/stripe/params/v2/money_management/_financial_account_update_params.py b/stripe/params/v2/money_management/_financial_account_update_params.py index 1880c7c27..783074f7a 100644 --- a/stripe/params/v2/money_management/_financial_account_update_params.py +++ b/stripe/params/v2/money_management/_financial_account_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import NotRequired, TypedDict @@ -16,3 +16,16 @@ class FinancialAccountUpdateParams(TypedDict): """ Metadata associated with the FinancialAccount. """ + storage: NotRequired["FinancialAccountUpdateParamsStorage"] + """ + Parameters for updating storage-specific fields on the FinancialAccount. + """ + + +class FinancialAccountUpdateParamsStorage(TypedDict): + holds_currencies: NotRequired[List[str]] + """ + The currencies that this storage FinancialAccount can hold a balance in. Three-letter ISO currency code, in lowercase. + Adding currencies requires the corresponding holds_currencies storer capabilities to be enabled. + Removing currencies is not supported as of March 2026. + """ diff --git a/stripe/params/v2/money_management/_financial_address_create_params.py b/stripe/params/v2/money_management/_financial_address_create_params.py index db8be7391..201e95f42 100644 --- a/stripe/params/v2/money_management/_financial_address_create_params.py +++ b/stripe/params/v2/money_management/_financial_address_create_params.py @@ -14,7 +14,12 @@ class FinancialAddressCreateParams(TypedDict): """ Optional SEPA Bank account options, used to configure the type of SEPA Bank account to create, such as the originating country. """ - type: Literal["gb_bank_account", "sepa_bank_account", "us_bank_account"] + type: Literal[ + "ca_bank_account", + "gb_bank_account", + "sepa_bank_account", + "us_bank_account", + ] """ The type of FinancialAddress details to provision. """ diff --git a/stripe/params/v2/money_management/_financial_address_list_params.py b/stripe/params/v2/money_management/_financial_address_list_params.py index b504d8ece..478acda0d 100644 --- a/stripe/params/v2/money_management/_financial_address_list_params.py +++ b/stripe/params/v2/money_management/_financial_address_list_params.py @@ -12,6 +12,7 @@ class FinancialAddressListParams(TypedDict): include: NotRequired[ List[ Literal[ + "credentials.ca_bank_account.account_number", "credentials.gb_bank_account.account_number", "credentials.sepa_bank_account.iban", "credentials.us_bank_account.account_number", diff --git a/stripe/params/v2/money_management/_financial_address_retrieve_params.py b/stripe/params/v2/money_management/_financial_address_retrieve_params.py index 18a0f46fb..2f8d7ec5d 100644 --- a/stripe/params/v2/money_management/_financial_address_retrieve_params.py +++ b/stripe/params/v2/money_management/_financial_address_retrieve_params.py @@ -8,6 +8,7 @@ class FinancialAddressRetrieveParams(TypedDict): include: NotRequired[ List[ Literal[ + "credentials.ca_bank_account.account_number", "credentials.gb_bank_account.account_number", "credentials.sepa_bank_account.iban", "credentials.us_bank_account.account_number", diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py index a575c45dc..2f8a3b456 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py @@ -51,7 +51,9 @@ class OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount(TypedDict): """ The account number or IBAN of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ @@ -114,6 +116,7 @@ class OutboundSetupIntentCreateParamsPayoutMethodDataCryptoWallet(TypedDict): "polygon", "solana", "stellar", + "tempo", ] """ Which rail we should use to make an Outbound money movement to this wallet. diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py index 860c21abf..2fa84d36f 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py @@ -39,7 +39,9 @@ class OutboundSetupIntentUpdateParamsPayoutMethodDataBankAccount(TypedDict): """ The account number or IBAN of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/params/v2/network/__init__.py b/stripe/params/v2/network/__init__.py new file mode 100644 index 000000000..d8b3e6772 --- /dev/null +++ b/stripe/params/v2/network/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.network._business_profile_me_params import ( + BusinessProfileMeParams as BusinessProfileMeParams, + ) + from stripe.params.v2.network._business_profile_retrieve_params import ( + BusinessProfileRetrieveParams as BusinessProfileRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "BusinessProfileMeParams": ( + "stripe.params.v2.network._business_profile_me_params", + False, + ), + "BusinessProfileRetrieveParams": ( + "stripe.params.v2.network._business_profile_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/network/_business_profile_me_params.py b/stripe/params/v2/network/_business_profile_me_params.py new file mode 100644 index 000000000..5c77fd60e --- /dev/null +++ b/stripe/params/v2/network/_business_profile_me_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BusinessProfileMeParams(TypedDict): + pass diff --git a/stripe/params/v2/network/_business_profile_retrieve_params.py b/stripe/params/v2/network/_business_profile_retrieve_params.py new file mode 100644 index 000000000..5698bf63b --- /dev/null +++ b/stripe/params/v2/network/_business_profile_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BusinessProfileRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/__init__.py b/stripe/params/v2/orchestrated_commerce/__init__.py new file mode 100644 index 000000000..9a35ce8d0 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/__init__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.orchestrated_commerce._agreement_confirm_params import ( + AgreementConfirmParams as AgreementConfirmParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_create_params import ( + AgreementCreateParams as AgreementCreateParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_list_params import ( + AgreementListParams as AgreementListParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_retrieve_params import ( + AgreementRetrieveParams as AgreementRetrieveParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_terminate_params import ( + AgreementTerminateParams as AgreementTerminateParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "AgreementConfirmParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_confirm_params", + False, + ), + "AgreementCreateParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_create_params", + False, + ), + "AgreementListParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_list_params", + False, + ), + "AgreementRetrieveParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_retrieve_params", + False, + ), + "AgreementTerminateParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_terminate_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py new file mode 100644 index 000000000..9a5118f6d --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementConfirmParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py new file mode 100644 index 000000000..7a6e93b74 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementCreateParams(TypedDict): + orchestrator: str + """ + The Network ID of the orchestrator to create an agreement with. + """ diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py new file mode 100644 index 000000000..167d153a8 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class AgreementListParams(TypedDict): + limit: NotRequired[int] + """ + The limit for the number of results per page. + """ + network_business_profile: NotRequired[str] + """ + Filter list to Orchestrated Commerce Agreements with a specific counterparty. + """ diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py new file mode 100644 index 000000000..dc2818f65 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py new file mode 100644 index 000000000..85ebcc249 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementTerminateParams(TypedDict): + pass diff --git a/stripe/params/v2/payments/__init__.py b/stripe/params/v2/payments/__init__.py index c74fd0f74..a0c14e77e 100644 --- a/stripe/params/v2/payments/__init__.py +++ b/stripe/params/v2/payments/__init__.py @@ -12,11 +12,23 @@ ) from stripe.params.v2.payments._off_session_payment_capture_params import ( OffSessionPaymentCaptureParams as OffSessionPaymentCaptureParams, + OffSessionPaymentCaptureParamsAmountDetails as OffSessionPaymentCaptureParamsAmountDetails, + OffSessionPaymentCaptureParamsAmountDetailsLineItem as OffSessionPaymentCaptureParamsAmountDetailsLineItem, + OffSessionPaymentCaptureParamsAmountDetailsLineItemTax as OffSessionPaymentCaptureParamsAmountDetailsLineItemTax, + OffSessionPaymentCaptureParamsAmountDetailsShipping as OffSessionPaymentCaptureParamsAmountDetailsShipping, + OffSessionPaymentCaptureParamsAmountDetailsTax as OffSessionPaymentCaptureParamsAmountDetailsTax, + OffSessionPaymentCaptureParamsPaymentDetails as OffSessionPaymentCaptureParamsPaymentDetails, OffSessionPaymentCaptureParamsTransferData as OffSessionPaymentCaptureParamsTransferData, ) from stripe.params.v2.payments._off_session_payment_create_params import ( OffSessionPaymentCreateParams as OffSessionPaymentCreateParams, + OffSessionPaymentCreateParamsAmountDetails as OffSessionPaymentCreateParamsAmountDetails, + OffSessionPaymentCreateParamsAmountDetailsLineItem as OffSessionPaymentCreateParamsAmountDetailsLineItem, + OffSessionPaymentCreateParamsAmountDetailsLineItemTax as OffSessionPaymentCreateParamsAmountDetailsLineItemTax, + OffSessionPaymentCreateParamsAmountDetailsShipping as OffSessionPaymentCreateParamsAmountDetailsShipping, + OffSessionPaymentCreateParamsAmountDetailsTax as OffSessionPaymentCreateParamsAmountDetailsTax, OffSessionPaymentCreateParamsCapture as OffSessionPaymentCreateParamsCapture, + OffSessionPaymentCreateParamsPaymentDetails as OffSessionPaymentCreateParamsPaymentDetails, OffSessionPaymentCreateParamsPaymentMethodData as OffSessionPaymentCreateParamsPaymentMethodData, OffSessionPaymentCreateParamsPaymentMethodDataBillingDetails as OffSessionPaymentCreateParamsPaymentMethodDataBillingDetails, OffSessionPaymentCreateParamsPaymentMethodDataBillingDetailsAddress as OffSessionPaymentCreateParamsPaymentMethodDataBillingDetailsAddress, @@ -72,6 +84,30 @@ "stripe.params.v2.payments._off_session_payment_capture_params", False, ), + "OffSessionPaymentCaptureParamsAmountDetails": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), + "OffSessionPaymentCaptureParamsAmountDetailsLineItem": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), + "OffSessionPaymentCaptureParamsAmountDetailsLineItemTax": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), + "OffSessionPaymentCaptureParamsAmountDetailsShipping": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), + "OffSessionPaymentCaptureParamsAmountDetailsTax": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), + "OffSessionPaymentCaptureParamsPaymentDetails": ( + "stripe.params.v2.payments._off_session_payment_capture_params", + False, + ), "OffSessionPaymentCaptureParamsTransferData": ( "stripe.params.v2.payments._off_session_payment_capture_params", False, @@ -80,10 +116,34 @@ "stripe.params.v2.payments._off_session_payment_create_params", False, ), + "OffSessionPaymentCreateParamsAmountDetails": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), + "OffSessionPaymentCreateParamsAmountDetailsLineItem": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), + "OffSessionPaymentCreateParamsAmountDetailsLineItemTax": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), + "OffSessionPaymentCreateParamsAmountDetailsShipping": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), + "OffSessionPaymentCreateParamsAmountDetailsTax": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), "OffSessionPaymentCreateParamsCapture": ( "stripe.params.v2.payments._off_session_payment_create_params", False, ), + "OffSessionPaymentCreateParamsPaymentDetails": ( + "stripe.params.v2.payments._off_session_payment_create_params", + False, + ), "OffSessionPaymentCreateParamsPaymentMethodData": ( "stripe.params.v2.payments._off_session_payment_create_params", False, diff --git a/stripe/params/v2/payments/_off_session_payment_capture_params.py b/stripe/params/v2/payments/_off_session_payment_capture_params.py index da278844e..a6d442559 100644 --- a/stripe/params/v2/payments/_off_session_payment_capture_params.py +++ b/stripe/params/v2/payments/_off_session_payment_capture_params.py @@ -2,11 +2,15 @@ # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject from stripe.v2._amount import AmountParam -from typing import Dict +from typing import Dict, List from typing_extensions import NotRequired, TypedDict class OffSessionPaymentCaptureParams(TypedDict): + amount_details: NotRequired["OffSessionPaymentCaptureParamsAmountDetails"] + """ + Provides industry-specific information about the amount. + """ amount_to_capture: NotRequired[int] """ The amount to capture. @@ -22,6 +26,12 @@ class OffSessionPaymentCaptureParams(TypedDict): the object in a structured format. Learn more about [storing information in metadata](https://docs.stripe.com/payments/payment-intents#storing-information-in-metadata). """ + payment_details: NotRequired[ + "OffSessionPaymentCaptureParamsPaymentDetails" + ] + """ + Provides industry-specific information about the payment. + """ statement_descriptor: NotRequired[str] """ Text that appears on the customer's statement as the statement descriptor for a @@ -41,6 +51,108 @@ class OffSessionPaymentCaptureParams(TypedDict): """ +class OffSessionPaymentCaptureParamsAmountDetails(TypedDict): + discount_amount: NotRequired[int] + """ + The amount the total transaction was discounted for. + """ + enforce_arithmetic_validation: NotRequired[bool] + """ + Set to `false` to return arithmetic validation errors in the response without failing the request. Use this when you want the operation to proceed regardless of arithmetic errors in the line item data. + Omit or set to `true` to immediately return a 400 error when arithmetic validation fails. Use this for strict validation that prevents processing with line item data that has arithmetic inconsistencies. + For card payments, Stripe doesn't send line item data to card networks if there's an arithmetic validation error. + """ + line_items: NotRequired[ + List["OffSessionPaymentCaptureParamsAmountDetailsLineItem"] + ] + """ + A list of line items, each containing information about a product in the OffSessionPayment. There is a maximum of 10 line items. + """ + shipping: NotRequired[ + "OffSessionPaymentCaptureParamsAmountDetailsShipping" + ] + """ + Contains information about the shipping portion of the amount. + """ + tax: NotRequired["OffSessionPaymentCaptureParamsAmountDetailsTax"] + """ + Contains information about the tax portion of the amount. + """ + + +class OffSessionPaymentCaptureParamsAmountDetailsLineItem(TypedDict): + discount_amount: NotRequired[int] + """ + The amount an item was discounted for. Positive integer. + """ + product_code: NotRequired[str] + """ + Unique identifier of the product. At most 12 characters long. + """ + product_name: str + """ + Name of the product. At most 100 characters long. + """ + quantity: int + """ + Number of items of the product. Positive integer. + """ + tax: NotRequired["OffSessionPaymentCaptureParamsAmountDetailsLineItemTax"] + """ + Contains information about the tax on the item. + """ + unit_cost: int + """ + Cost of the product. Positive integer. + """ + unit_of_measure: NotRequired[str] + """ + A unit of measure for the line item, such as gallons, feet, meters, etc. + The maximum length is 12 characters. + """ + + +class OffSessionPaymentCaptureParamsAmountDetailsLineItemTax(TypedDict): + total_tax_amount: int + """ + Total portion of the amount that is for tax. + """ + + +class OffSessionPaymentCaptureParamsAmountDetailsShipping(TypedDict): + amount: NotRequired[int] + """ + Portion of the amount that is for shipping. + """ + from_postal_code: NotRequired[str] + """ + The postal code that represents the shipping source. + """ + to_postal_code: NotRequired[str] + """ + The postal code that represents the shipping destination. + """ + + +class OffSessionPaymentCaptureParamsAmountDetailsTax(TypedDict): + total_tax_amount: int + """ + Total portion of the amount that is for tax. + """ + + +class OffSessionPaymentCaptureParamsPaymentDetails(TypedDict): + customer_reference: NotRequired[str] + """ + A unique value to identify the customer. This field is applicable only for card payments. For card payments, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + order_reference: NotRequired[str] + """ + A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates. + For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + + class OffSessionPaymentCaptureParamsTransferData(TypedDict): amount: NotRequired[int] """ diff --git a/stripe/params/v2/payments/_off_session_payment_create_params.py b/stripe/params/v2/payments/_off_session_payment_create_params.py index 802b16e4c..b898e0a23 100644 --- a/stripe/params/v2/payments/_off_session_payment_create_params.py +++ b/stripe/params/v2/payments/_off_session_payment_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject from stripe.v2._amount import AmountParam -from typing import Dict +from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -11,6 +11,10 @@ class OffSessionPaymentCreateParams(TypedDict): """ The “presentment amount” to be collected from the customer. """ + amount_details: NotRequired["OffSessionPaymentCreateParamsAmountDetails"] + """ + Provides industry-specific information about the amount. + """ application_fee_amount: NotRequired[AmountParam] """ The amount of the application fee (if any) that will be requested to be applied to the @@ -28,6 +32,10 @@ class OffSessionPaymentCreateParams(TypedDict): """ ID of the Customer to which this OffSessionPayment belongs. """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ metadata: "Dict[str, str]|UntypedStripeObject[str]" """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can @@ -39,6 +47,10 @@ class OffSessionPaymentCreateParams(TypedDict): """ The account (if any) for which the funds of the OffSessionPayment are intended. """ + payment_details: NotRequired["OffSessionPaymentCreateParamsPaymentDetails"] + """ + Provides industry-specific information about the payment. + """ payment_method: NotRequired[str] """ ID of the payment method used in this OffSessionPayment. @@ -88,6 +100,94 @@ class OffSessionPaymentCreateParams(TypedDict): """ +class OffSessionPaymentCreateParamsAmountDetails(TypedDict): + discount_amount: NotRequired[int] + """ + The amount the total transaction was discounted for. + """ + enforce_arithmetic_validation: NotRequired[bool] + """ + Set to `false` to return arithmetic validation errors in the response without failing the request. Use this when you want the operation to proceed regardless of arithmetic errors in the line item data. + Omit or set to `true` to immediately return a 400 error when arithmetic validation fails. Use this for strict validation that prevents processing with line item data that has arithmetic inconsistencies. + For card payments, Stripe doesn't send line item data to card networks if there's an arithmetic validation error. + """ + line_items: NotRequired[ + List["OffSessionPaymentCreateParamsAmountDetailsLineItem"] + ] + """ + A list of line items, each containing information about a product in the OffSessionPayment. There is a maximum of 10 line items. + """ + shipping: NotRequired["OffSessionPaymentCreateParamsAmountDetailsShipping"] + """ + Contains information about the shipping portion of the amount. + """ + tax: NotRequired["OffSessionPaymentCreateParamsAmountDetailsTax"] + """ + Contains information about the tax portion of the amount. + """ + + +class OffSessionPaymentCreateParamsAmountDetailsLineItem(TypedDict): + discount_amount: NotRequired[int] + """ + The amount an item was discounted for. Positive integer. + """ + product_code: NotRequired[str] + """ + Unique identifier of the product. At most 12 characters long. + """ + product_name: str + """ + Name of the product. At most 100 characters long. + """ + quantity: int + """ + Number of items of the product. Positive integer. + """ + tax: NotRequired["OffSessionPaymentCreateParamsAmountDetailsLineItemTax"] + """ + Contains information about the tax on the item. + """ + unit_cost: int + """ + Cost of the product. Positive integer. + """ + unit_of_measure: NotRequired[str] + """ + A unit of measure for the line item, such as gallons, feet, meters, etc. + The maximum length is 12 characters. + """ + + +class OffSessionPaymentCreateParamsAmountDetailsLineItemTax(TypedDict): + total_tax_amount: int + """ + Total portion of the amount that is for tax. + """ + + +class OffSessionPaymentCreateParamsAmountDetailsShipping(TypedDict): + amount: NotRequired[int] + """ + Portion of the amount that is for shipping. + """ + from_postal_code: NotRequired[str] + """ + The postal code that represents the shipping source. + """ + to_postal_code: NotRequired[str] + """ + The postal code that represents the shipping destination. + """ + + +class OffSessionPaymentCreateParamsAmountDetailsTax(TypedDict): + total_tax_amount: int + """ + Total portion of the amount that is for tax. + """ + + class OffSessionPaymentCreateParamsCapture(TypedDict): capture_method: Literal["automatic", "manual"] """ @@ -95,6 +195,18 @@ class OffSessionPaymentCreateParamsCapture(TypedDict): """ +class OffSessionPaymentCreateParamsPaymentDetails(TypedDict): + customer_reference: NotRequired[str] + """ + A unique value to identify the customer. This field is applicable only for card payments. For card payments, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + order_reference: NotRequired[str] + """ + A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates. + For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + + class OffSessionPaymentCreateParamsPaymentMethodData(TypedDict): billing_details: NotRequired[ "OffSessionPaymentCreateParamsPaymentMethodDataBillingDetails" @@ -189,7 +301,11 @@ class OffSessionPaymentCreateParamsPaymentMethodOptions(TypedDict): class OffSessionPaymentCreateParamsPaymentMethodOptionsCard(TypedDict): - network_transaction_id: str + mcc: NotRequired[str] + """ + The merchant category code for this transaction. Used in interchange and authorization to improve auth rates. + """ + network_transaction_id: NotRequired[str] """ If you are making a Credential On File transaction with a previously saved card, you should pass the Network Transaction ID from a prior initial authorization on Stripe (from a successful SetupIntent or a PaymentIntent with `setup_future_usage` set), diff --git a/stripe/params/v2/test_helpers/_financial_address_credit_params.py b/stripe/params/v2/test_helpers/_financial_address_credit_params.py index 72931ad01..491e192aa 100644 --- a/stripe/params/v2/test_helpers/_financial_address_credit_params.py +++ b/stripe/params/v2/test_helpers/_financial_address_credit_params.py @@ -9,7 +9,9 @@ class FinancialAddressCreditParams(TypedDict): """ Object containing the amount value and currency to credit. """ - network: Literal["ach", "fps", "rtp", "sepa_credit_transfer", "wire"] + network: Literal[ + "ach", "acss", "fps", "rtp", "sepa_credit_transfer", "wire" + ] """ Open Enum. The network to use in simulating the funds flow. This will be the reflected in the resulting ReceivedCredit. """ diff --git a/stripe/radar/_account_evaluation.py b/stripe/radar/_account_evaluation.py index 4160d222d..47f075baa 100644 --- a/stripe/radar/_account_evaluation.py +++ b/stripe/radar/_account_evaluation.py @@ -38,16 +38,32 @@ class LoginFailed(StripeObject): The reason why this login failed. """ + class LoginSucceeded(StripeObject): + qualification: Optional[str] + """ + The qualification for a login success. + """ + class RegistrationFailed(StripeObject): reason: str """ The reason why this registration failed. """ + class RegistrationSucceeded(StripeObject): + qualification: Optional[str] + """ + The qualification for a registration success. + """ + login_failed: Optional[LoginFailed] """ Data about a failed login event. """ + login_succeeded: Optional[LoginSucceeded] + """ + Data about a succeeded login event. + """ occurred_at: int """ Time at which the event occurred. Measured in seconds since the Unix epoch. @@ -56,13 +72,19 @@ class RegistrationFailed(StripeObject): """ Data about a failed registration event. """ + registration_succeeded: Optional[RegistrationSucceeded] + """ + Data about a succeeded registration event. + """ type: str """ The type of event that occurred. """ _inner_class_types = { "login_failed": LoginFailed, + "login_succeeded": LoginSucceeded, "registration_failed": RegistrationFailed, + "registration_succeeded": RegistrationSucceeded, } class Signals(StripeObject): diff --git a/stripe/radar/_issuing_authorization_evaluation.py b/stripe/radar/_issuing_authorization_evaluation.py index ce94a45bf..bf2e32e83 100644 --- a/stripe/radar/_issuing_authorization_evaluation.py +++ b/stripe/radar/_issuing_authorization_evaluation.py @@ -59,7 +59,7 @@ class AuthorizationDetails(StripeObject): """ initiated_at: int """ - The timestamp of the authorization initiated in seconds. + The time the authorization was initiated, as a Unix timestamp in seconds. """ point_of_sale_condition: Optional[ Literal[ @@ -102,7 +102,7 @@ class CardDetails(StripeObject): """ created_at: int """ - The timestamp when the card was created. + The timestamp when the card was created, as a Unix timestamp in seconds. """ last4: str """ diff --git a/stripe/shared_payment/_granted_token.py b/stripe/shared_payment/_granted_token.py index 6979b59ad..1204d2055 100644 --- a/stripe/shared_payment/_granted_token.py +++ b/stripe/shared_payment/_granted_token.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: from stripe._charge import Charge + from stripe._payment_method import PaymentMethod from stripe._setup_attempt import SetupAttempt from stripe.params.shared_payment._granted_token_create_params import ( GrantedTokenCreateParams, @@ -1052,6 +1053,10 @@ class GeneratedFrom(StripeObject): """ The ID of the Charge that generated this PaymentMethod, if any. """ + payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of the PaymentMethod that generated this PaymentMethod, if any. + """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. diff --git a/stripe/shared_payment/_issued_token.py b/stripe/shared_payment/_issued_token.py index 2d28d052c..420b80e95 100644 --- a/stripe/shared_payment/_issued_token.py +++ b/stripe/shared_payment/_issued_token.py @@ -166,10 +166,6 @@ class UsageLimits(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ - customer: Optional[str] - """ - ID of an existing Customer. - """ deactivated_at: Optional[int] """ Time at which this SharedPaymentIssuedToken was deactivated. @@ -196,7 +192,7 @@ class UsageLimits(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - payment_method: Optional[str] + payment_method: str """ ID of an existing PaymentMethod. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 5fa4ee346..5ef22edd3 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -310,6 +310,35 @@ class ConfirmConfig(StripeObject): """ _inner_class_types = {"confirm_config": ConfirmConfig} + class PrintContent(StripeObject): + class Image(StripeObject): + created_at: int + """ + Creation time of the object (in seconds since the Unix epoch). + """ + filename: str + """ + The original name of the uploaded file (e.g. `receipt.png`). + """ + size: int + """ + The size (in bytes) of the uploaded file. + """ + type: str + """ + The format of the uploaded file. + """ + + image: Optional[Image] + """ + Metadata of an uploaded file + """ + type: Literal["image"] + """ + The type of content to print. Currently supports `image`. + """ + _inner_class_types = {"image": Image} + class ProcessPaymentIntent(StripeObject): class ProcessConfig(StripeObject): class Tipping(StripeObject): @@ -486,6 +515,10 @@ class LineItem(StripeObject): """ Detailed failure message, only set if status is `failed`. """ + print_content: Optional[PrintContent] + """ + Represents a reader action to print content + """ process_payment_intent: Optional[ProcessPaymentIntent] """ Represents a reader action to process a payment intent @@ -510,6 +543,7 @@ class LineItem(StripeObject): "collect_inputs", "collect_payment_method", "confirm_payment_intent", + "print_content", "process_payment_intent", "process_setup_intent", "refund_payment", @@ -522,6 +556,7 @@ class LineItem(StripeObject): "collect_inputs": CollectInputs, "collect_payment_method": CollectPaymentMethod, "confirm_payment_intent": ConfirmPaymentIntent, + "print_content": PrintContent, "process_payment_intent": ProcessPaymentIntent, "process_setup_intent": ProcessSetupIntent, "refund_payment": RefundPayment, diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 0d75a009b..9ce62e8db 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -9,19 +9,25 @@ if TYPE_CHECKING: from stripe.v2 import ( billing as billing, + commerce as commerce, core as core, data as data, + extend as extend, iam as iam, money_management as money_management, + network as network, + orchestrated_commerce as orchestrated_commerce, payments as payments, reporting as reporting, tax as tax, test_helpers as test_helpers, ) from stripe.v2._billing_service import BillingService as BillingService + from stripe.v2._commerce_service import CommerceService as CommerceService from stripe.v2._core_service import CoreService as CoreService from stripe.v2._datum_service import DatumService as DatumService from stripe.v2._deleted_object import DeletedObject as DeletedObject + from stripe.v2._extend_service import ExtendService as ExtendService from stripe.v2._financial_address_credit_simulation import ( FinancialAddressCreditSimulation as FinancialAddressCreditSimulation, ) @@ -32,6 +38,10 @@ from stripe.v2._money_management_service import ( MoneyManagementService as MoneyManagementService, ) + from stripe.v2._network_service import NetworkService as NetworkService + from stripe.v2._orchestrated_commerce_service import ( + OrchestratedCommerceService as OrchestratedCommerceService, + ) from stripe.v2._payment_service import PaymentService as PaymentService from stripe.v2._reporting_service import ( ReportingService as ReportingService, @@ -44,18 +54,24 @@ # name -> (import_target, is_submodule) _import_map = { "billing": ("stripe.v2.billing", True), + "commerce": ("stripe.v2.commerce", True), "core": ("stripe.v2.core", True), "data": ("stripe.v2.data", True), + "extend": ("stripe.v2.extend", True), "iam": ("stripe.v2.iam", True), "money_management": ("stripe.v2.money_management", True), + "network": ("stripe.v2.network", True), + "orchestrated_commerce": ("stripe.v2.orchestrated_commerce", True), "payments": ("stripe.v2.payments", True), "reporting": ("stripe.v2.reporting", True), "tax": ("stripe.v2.tax", True), "test_helpers": ("stripe.v2.test_helpers", True), "BillingService": ("stripe.v2._billing_service", False), + "CommerceService": ("stripe.v2._commerce_service", False), "CoreService": ("stripe.v2._core_service", False), "DatumService": ("stripe.v2._datum_service", False), "DeletedObject": ("stripe.v2._deleted_object", False), + "ExtendService": ("stripe.v2._extend_service", False), "FinancialAddressCreditSimulation": ( "stripe.v2._financial_address_credit_simulation", False, @@ -66,6 +82,11 @@ ), "IamService": ("stripe.v2._iam_service", False), "MoneyManagementService": ("stripe.v2._money_management_service", False), + "NetworkService": ("stripe.v2._network_service", False), + "OrchestratedCommerceService": ( + "stripe.v2._orchestrated_commerce_service", + False, + ), "PaymentService": ("stripe.v2._payment_service", False), "ReportingService": ("stripe.v2._reporting_service", False), "TaxService": ("stripe.v2._tax_service", False), diff --git a/stripe/v2/_commerce_service.py b/stripe/v2/_commerce_service.py new file mode 100644 index 000000000..cc40db470 --- /dev/null +++ b/stripe/v2/_commerce_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce._product_catalog_service import ( + ProductCatalogService, + ) + +_subservices = { + "product_catalog": [ + "stripe.v2.commerce._product_catalog_service", + "ProductCatalogService", + ], +} + + +class CommerceService(StripeService): + product_catalog: "ProductCatalogService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py index efdfabd16..09fc9ed48 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -11,6 +11,7 @@ from stripe.v2.core._account_link_service import AccountLinkService from stripe.v2.core._account_service import AccountService from stripe.v2.core._account_token_service import AccountTokenService + from stripe.v2.core._approval_request_service import ApprovalRequestService from stripe.v2.core._batch_job_service import BatchJobService from stripe.v2.core._claimable_sandbox_service import ( ClaimableSandboxService, @@ -23,8 +24,6 @@ ) from stripe.v2.core._event_service import EventService from stripe.v2.core._vault_service import VaultService - from stripe.v2.core._workflow_run_service import WorkflowRunService - from stripe.v2.core._workflow_service import WorkflowService _subservices = { "accounts": ["stripe.v2.core._account_service", "AccountService"], @@ -40,6 +39,10 @@ "stripe.v2.core._account_token_service", "AccountTokenService", ], + "approval_requests": [ + "stripe.v2.core._approval_request_service", + "ApprovalRequestService", + ], "batch_jobs": ["stripe.v2.core._batch_job_service", "BatchJobService"], "claimable_sandboxes": [ "stripe.v2.core._claimable_sandbox_service", @@ -55,11 +58,6 @@ "EventDestinationService", ], "vault": ["stripe.v2.core._vault_service", "VaultService"], - "workflows": ["stripe.v2.core._workflow_service", "WorkflowService"], - "workflow_runs": [ - "stripe.v2.core._workflow_run_service", - "WorkflowRunService", - ], } @@ -68,14 +66,13 @@ class CoreService(StripeService): account_evaluations: "AccountEvaluationService" account_links: "AccountLinkService" account_tokens: "AccountTokenService" + approval_requests: "ApprovalRequestService" batch_jobs: "BatchJobService" claimable_sandboxes: "ClaimableSandboxService" connection_sessions: "ConnectionSessionService" events: "EventService" event_destinations: "EventDestinationService" vault: "VaultService" - workflows: "WorkflowService" - workflow_runs: "WorkflowRunService" def __init__(self, requestor): super().__init__(requestor) diff --git a/stripe/v2/_extend_service.py b/stripe/v2/_extend_service.py new file mode 100644 index 000000000..40811697b --- /dev/null +++ b/stripe/v2/_extend_service.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.extend._workflow_run_service import WorkflowRunService + from stripe.v2.extend._workflow_service import WorkflowService + +_subservices = { + "workflows": ["stripe.v2.extend._workflow_service", "WorkflowService"], + "workflow_runs": [ + "stripe.v2.extend._workflow_run_service", + "WorkflowRunService", + ], +} + + +class ExtendService(StripeService): + workflows: "WorkflowService" + workflow_runs: "WorkflowRunService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_iam_service.py b/stripe/v2/_iam_service.py index cf4a1182f..4d5b0035d 100644 --- a/stripe/v2/_iam_service.py +++ b/stripe/v2/_iam_service.py @@ -5,14 +5,20 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.v2.iam._activity_log_service import ActivityLogService from stripe.v2.iam._api_key_service import ApiKeyService _subservices = { - "api_keys": ["stripe.v2.iam._api_key_service", "ApiKeyService"] + "activity_logs": [ + "stripe.v2.iam._activity_log_service", + "ActivityLogService", + ], + "api_keys": ["stripe.v2.iam._api_key_service", "ApiKeyService"], } class IamService(StripeService): + activity_logs: "ActivityLogService" api_keys: "ApiKeyService" def __init__(self, requestor): diff --git a/stripe/v2/_network_service.py b/stripe/v2/_network_service.py new file mode 100644 index 000000000..f36d3336b --- /dev/null +++ b/stripe/v2/_network_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.network._business_profile_service import ( + BusinessProfileService, + ) + +_subservices = { + "business_profiles": [ + "stripe.v2.network._business_profile_service", + "BusinessProfileService", + ], +} + + +class NetworkService(StripeService): + business_profiles: "BusinessProfileService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_orchestrated_commerce_service.py b/stripe/v2/_orchestrated_commerce_service.py new file mode 100644 index 000000000..fb845ba6a --- /dev/null +++ b/stripe/v2/_orchestrated_commerce_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.orchestrated_commerce._agreement_service import ( + AgreementService, + ) + +_subservices = { + "agreements": [ + "stripe.v2.orchestrated_commerce._agreement_service", + "AgreementService", + ], +} + + +class OrchestratedCommerceService(StripeService): + agreements: "AgreementService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/_bill_setting.py b/stripe/v2/billing/_bill_setting.py index c48dda04e..0f3921468 100644 --- a/stripe/v2/billing/_bill_setting.py +++ b/stripe/v2/billing/_bill_setting.py @@ -18,7 +18,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -36,12 +36,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} @@ -71,8 +71,8 @@ class TimeUntilDue(StripeObject): """ latest_version: str """ - The latest version of the current settings object. This will be - Updated every time an attribute of the settings is updated. + The latest version of the current settings object. This is + updated every time an attribute of the settings is updated. """ live_version: str """ diff --git a/stripe/v2/billing/_bill_setting_version.py b/stripe/v2/billing/_bill_setting_version.py index e0a1c3d4a..602aaf9fa 100644 --- a/stripe/v2/billing/_bill_setting_version.py +++ b/stripe/v2/billing/_bill_setting_version.py @@ -18,7 +18,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -36,12 +36,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} diff --git a/stripe/v2/billing/_cadence.py b/stripe/v2/billing/_cadence.py index 6cf372f5e..3c0a2987a 100644 --- a/stripe/v2/billing/_cadence.py +++ b/stripe/v2/billing/_cadence.py @@ -62,7 +62,7 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: Optional[int] """ @@ -128,11 +128,11 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: int """ - The month to bill on from 1-12. If not provided, this will default to the month the cadence was created. + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: Time """ @@ -185,7 +185,7 @@ class MaximumApplications(StripeObject): """ percent_off: Decimal """ - Percent that will be taken off of the amount. For example, percent_off of 50.0 will make $100 amount $50 instead. + Percent that is taken off the amount. For example, a percent_off of 50.0 reduces a 100 USD amount to 50 USD. """ _inner_class_types = {"maximum_applications": MaximumApplications} _field_encodings = {"percent_off": "decimal_string"} @@ -207,7 +207,7 @@ class MaximumApplications(StripeObject): class Payer(StripeObject): billing_profile: str """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ customer: Optional[str] """ @@ -255,7 +255,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -273,12 +273,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} @@ -515,9 +515,9 @@ class Filters(StripeObject): collection_method: Literal["automatic", "send_invoice"] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ email_delivery: EmailDelivery diff --git a/stripe/v2/billing/_collection_setting.py b/stripe/v2/billing/_collection_setting.py index e26bfcdc8..74b8fd9f9 100644 --- a/stripe/v2/billing/_collection_setting.py +++ b/stripe/v2/billing/_collection_setting.py @@ -219,9 +219,9 @@ class Filters(StripeObject): collection_method: Optional[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ created: str @@ -242,8 +242,8 @@ class Filters(StripeObject): """ latest_version: str """ - The latest version of the current settings object. This will be - Updated every time an attribute of the settings is updated. + The latest version of the current settings object. This is + updated every time an attribute of the settings is updated. """ live_version: str """ diff --git a/stripe/v2/billing/_collection_setting_version.py b/stripe/v2/billing/_collection_setting_version.py index ec79b634a..1b9e9efe2 100644 --- a/stripe/v2/billing/_collection_setting_version.py +++ b/stripe/v2/billing/_collection_setting_version.py @@ -219,9 +219,9 @@ class Filters(StripeObject): collection_method: Optional[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ created: str diff --git a/stripe/v2/billing/_custom_pricing_unit.py b/stripe/v2/billing/_custom_pricing_unit.py index f2226f9b0..8503a32f8 100644 --- a/stripe/v2/billing/_custom_pricing_unit.py +++ b/stripe/v2/billing/_custom_pricing_unit.py @@ -23,7 +23,7 @@ class CustomPricingUnit(StripeObject): """ display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 10 characters. """ id: str diff --git a/stripe/v2/billing/_intent.py b/stripe/v2/billing/_intent.py index bcdfca11c..3dd0afbd3 100644 --- a/stripe/v2/billing/_intent.py +++ b/stripe/v2/billing/_intent.py @@ -90,7 +90,7 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: Optional[int] """ @@ -156,11 +156,11 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: int """ - The month to bill on from 1-12. If not provided, this will default to the month the cadence was created. + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: Time """ @@ -208,12 +208,12 @@ class BillingProfileData(StripeObject): default_payment_method: Optional[str] """ The default payment method to use when billing this profile. - If none is provided, the customer `default_payment_method` will be used. + If none is provided, the customer `default_payment_method` is used. """ billing_profile: Optional[str] """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ billing_profile_data: Optional[BillingProfileData] """ @@ -285,7 +285,7 @@ class StatusTransitions(StripeObject): """ expires_at: str """ - Time at which the Billing Intent will expire. + Time at which the Billing Intent expires. """ reserved_at: Optional[str] """ diff --git a/stripe/v2/billing/_intent_action.py b/stripe/v2/billing/_intent_action.py index c7597b98b..c262c1c2f 100644 --- a/stripe/v2/billing/_intent_action.py +++ b/stripe/v2/billing/_intent_action.py @@ -39,7 +39,7 @@ class Discount(StripeObject): class EffectiveAt(StripeObject): timestamp: Optional[str] """ - The timestamp at which the apply action will take effect. Only present if type is timestamp. Only allowed for discount actions. + The timestamp at which the apply action takes effect. Only present if type is timestamp. Only allowed for discount actions. """ type: Literal[ "current_billing_period_end", @@ -49,7 +49,7 @@ class EffectiveAt(StripeObject): "timestamp", ] """ - When the apply action will take effect. + When the apply action takes effect. """ class InvoiceDiscountRule(StripeObject): @@ -66,7 +66,7 @@ class MaximumApplications(StripeObject): """ percent_off: Decimal """ - Percent that will be taken off of the amount. For example, percent_off of 50.0 will make $100 amount $50 instead. + Percent that is taken off the amount. For example, a percent_off of 50.0 reduces a 100 USD amount to 50 USD. """ _inner_class_types = { "maximum_applications": MaximumApplications, @@ -161,7 +161,7 @@ class CustomPricingUnitOverageRate(StripeObject): """ effective_at: Optional[EffectiveAt] """ - When the apply action will take effect. If not specified, defaults to on_reserve. + When the apply action takes effect. If not specified, defaults to on_reserve. """ invoice_discount_rule: Optional[InvoiceDiscountRule] """ @@ -209,7 +209,7 @@ class CancellationDetails(StripeObject): class EffectiveAt(StripeObject): timestamp: Optional[str] """ - The timestamp at which the deactivate action will take effect. Only present if type is timestamp. + The timestamp at which the deactivate action takes effect. Only present if type is timestamp. """ type: Literal[ "current_billing_period_end", @@ -218,7 +218,7 @@ class EffectiveAt(StripeObject): "timestamp", ] """ - When the deactivate action will take effect. + When the deactivate action takes effect. """ class PricingPlanSubscriptionDetails(StripeObject): @@ -268,7 +268,7 @@ class LicenseFee(StripeObject): """ effective_at: EffectiveAt """ - When the deactivate action will take effect. If not specified, the default behavior is on_reserve. + When the deactivate action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: Optional[ PricingPlanSubscriptionDetails @@ -292,13 +292,13 @@ class Modify(StripeObject): class EffectiveAt(StripeObject): timestamp: Optional[str] """ - The timestamp at which the modify action will take effect. Only present if type is timestamp. + The timestamp at which the modify action takes effect. Only present if type is timestamp. """ type: Literal[ "current_billing_period_start", "on_reserve", "timestamp" ] """ - When the modify action will take effect. + When the modify action takes effect. """ class PricingPlanSubscriptionDetails(StripeObject): @@ -390,7 +390,7 @@ class RecurringCreditGrant(StripeObject): """ effective_at: EffectiveAt """ - When the modify action will take effect. If not specified, the default behavior is on_reserve. + When the modify action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: Optional[ PricingPlanSubscriptionDetails @@ -413,12 +413,12 @@ class Remove(StripeObject): class EffectiveAt(StripeObject): type: Literal["current_billing_period_end", "on_reserve"] """ - When the remove action will take effect. + When the remove action takes effect. """ effective_at: Optional[EffectiveAt] """ - When the remove action will take effect. If not specified, defaults to on_reserve. + When the remove action takes effect. If not specified, defaults to on_reserve. """ invoice_discount_rule: Optional[str] """ @@ -438,13 +438,13 @@ class Subscribe(StripeObject): class EffectiveAt(StripeObject): timestamp: Optional[str] """ - The timestamp at which the subscribe action will take effect. Only present if type is timestamp. + The timestamp at which the subscribe action takes effect. Only present if type is timestamp. """ type: Literal[ "current_billing_period_start", "on_reserve", "timestamp" ] """ - When the subscribe action will take effect. + When the subscribe action takes effect. """ class PricingPlanSubscriptionDetails(StripeObject): @@ -566,7 +566,7 @@ class Item(StripeObject): """ effective_at: EffectiveAt """ - When the subscribe action will take effect. If not specified, the default behavior is on_reserve. + When the subscribe action takes effect. If not specified, the default behavior is on_reserve. """ pricing_plan_subscription_details: Optional[ PricingPlanSubscriptionDetails diff --git a/stripe/v2/billing/_license_fee.py b/stripe/v2/billing/_license_fee.py index 0f4cf83a7..ef6a01b0b 100644 --- a/stripe/v2/billing/_license_fee.py +++ b/stripe/v2/billing/_license_fee.py @@ -27,8 +27,8 @@ class ServiceCycle(StripeObject): """ interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` + to specify quarterly service. """ class Tier(StripeObject): @@ -43,7 +43,7 @@ class Tier(StripeObject): """ up_to_decimal: Optional[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: Optional[Literal["inf"]] @@ -96,7 +96,7 @@ class TransformQuantity(StripeObject): """ live_version: str """ - The ID of the License Fee Version that will be used by all subscriptions when no specific version is specified. + The ID of the License Fee Version used by all subscriptions when no specific version is specified. """ livemode: bool """ @@ -124,16 +124,16 @@ class TransformQuantity(StripeObject): """ service_interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` + to specify quarterly service. """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the license fee is inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the license fee price includes or excludes tax. """ tiering_mode: Optional[Literal["graduated", "volume"]] """ - Defines whether the tiering price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiering price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ diff --git a/stripe/v2/billing/_license_fee_version.py b/stripe/v2/billing/_license_fee_version.py index 72eb5ffc5..fb478c7de 100644 --- a/stripe/v2/billing/_license_fee_version.py +++ b/stripe/v2/billing/_license_fee_version.py @@ -29,7 +29,7 @@ class Tier(StripeObject): """ up_to_decimal: Optional[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: Optional[Literal["inf"]] @@ -71,7 +71,7 @@ class TransformQuantity(StripeObject): """ tiering_mode: Optional[Literal["graduated", "volume"]] """ - Defines whether the tiering price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiering price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ diff --git a/stripe/v2/billing/_licensed_item.py b/stripe/v2/billing/_licensed_item.py index 9894b7a7b..ffacb157e 100644 --- a/stripe/v2/billing/_licensed_item.py +++ b/stripe/v2/billing/_licensed_item.py @@ -27,7 +27,7 @@ class TaxDetails(StripeObject): """ display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ id: str diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 603e75d50..a8bdf3068 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -17,7 +17,7 @@ class MeterEventAdjustment(StripeObject): class Cancel(StripeObject): identifier: str """ - Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them. """ cancel: Cancel @@ -34,7 +34,7 @@ class Cancel(StripeObject): """ id: str """ - The unique id of this meter event adjustment. + The unique ID of this meter event adjustment. """ livemode: bool """ @@ -50,6 +50,6 @@ class Cancel(StripeObject): """ type: Literal["cancel"] """ - Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + Open Enum. Specifies the type of cancellation. Currently supports canceling a single event. """ _inner_class_types = {"cancel": Cancel} diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py index 90364bb1a..86fb237f1 100644 --- a/stripe/v2/billing/_meter_event_session.py +++ b/stripe/v2/billing/_meter_event_session.py @@ -15,7 +15,7 @@ class MeterEventSession(StripeObject): ) authentication_token: str """ - The authentication token for this session. Use this token when calling the + The authentication token for this session. Use this token when calling the high-throughput meter event API. """ created: str @@ -24,11 +24,11 @@ class MeterEventSession(StripeObject): """ expires_at: str """ - The time at which this session will expire. + The time at which this session expires. """ id: str """ - The unique id of this auth session. + The unique ID of this auth session. """ livemode: bool """ diff --git a/stripe/v2/billing/_meter_event_session_service.py b/stripe/v2/billing/_meter_event_session_service.py index 5bf06cd0b..348939f69 100644 --- a/stripe/v2/billing/_meter_event_session_service.py +++ b/stripe/v2/billing/_meter_event_session_service.py @@ -19,7 +19,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "MeterEventSession": """ - Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires. """ return cast( "MeterEventSession", @@ -38,7 +38,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "MeterEventSession": """ - Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires. """ return cast( "MeterEventSession", diff --git a/stripe/v2/billing/_metered_item.py b/stripe/v2/billing/_metered_item.py index 64e1d2eec..f70a125b7 100644 --- a/stripe/v2/billing/_metered_item.py +++ b/stripe/v2/billing/_metered_item.py @@ -37,7 +37,7 @@ class TaxDetails(StripeObject): """ display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ id: str diff --git a/stripe/v2/billing/_one_time_item.py b/stripe/v2/billing/_one_time_item.py index 62010dcc9..5c3313a97 100644 --- a/stripe/v2/billing/_one_time_item.py +++ b/stripe/v2/billing/_one_time_item.py @@ -27,7 +27,7 @@ class TaxDetails(StripeObject): """ display_name: str """ - Description that customers will see in the invoice line item. + Description that customers see in the invoice line item. Maximum length of 250 characters. """ id: str diff --git a/stripe/v2/billing/_pricing_plan.py b/stripe/v2/billing/_pricing_plan.py index 2ac8bcc57..c30c6f05a 100644 --- a/stripe/v2/billing/_pricing_plan.py +++ b/stripe/v2/billing/_pricing_plan.py @@ -29,8 +29,7 @@ class PricingPlan(StripeObject): """ description: Optional[str] """ - A description for pricing plan subscription. - Maximum length of 500 characters. + A description of the pricing plan. Maximum length of 500 characters. """ display_name: str """ @@ -66,5 +65,5 @@ class PricingPlan(StripeObject): """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the PricingPlan is inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the pricing plan price includes or excludes tax. """ diff --git a/stripe/v2/billing/_pricing_plan_subscription.py b/stripe/v2/billing/_pricing_plan_subscription.py index 06fa28355..4facaf009 100644 --- a/stripe/v2/billing/_pricing_plan_subscription.py +++ b/stripe/v2/billing/_pricing_plan_subscription.py @@ -112,8 +112,8 @@ class ServiceCycle(StripeObject): """ interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` + to specify quarterly service. """ class Tier(StripeObject): @@ -128,7 +128,7 @@ class Tier(StripeObject): """ up_to_decimal: Optional[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: Optional[Literal["inf"]] @@ -174,7 +174,7 @@ class TransformQuantity(StripeObject): """ tiering_mode: Optional[Literal["graduated", "volume"]] """ - Defines whether the tiering price should be graduated or volume-based. + Defines whether the tiering price is graduated or volume-based. """ tiers: List[Tier] """ @@ -190,7 +190,7 @@ class TransformQuantity(StripeObject): """ unit_label: Optional[str] """ - The unit label from the licensed item, used for display purposes (e.g. "seat", "environment"). + The unit label from the licensed item, used for display purposes (for example, "seat", "environment"). """ _inner_class_types = { "service_cycle": ServiceCycle, @@ -206,8 +206,8 @@ class ServiceCycle(StripeObject): """ interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` + to specify quarterly service. """ currency: str @@ -280,7 +280,7 @@ class Scope(StripeObject): """ price_type: Optional[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ scope: Scope @@ -356,7 +356,7 @@ class Scope(StripeObject): """ price_type: Optional[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ scope: Scope @@ -396,8 +396,8 @@ class ServiceCycle(StripeObject): """ interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` + to specify quarterly service. """ credit_grant_details: Optional[CreditGrantDetails] diff --git a/stripe/v2/billing/_pricing_plan_version.py b/stripe/v2/billing/_pricing_plan_version.py index d557abf35..99ecee902 100644 --- a/stripe/v2/billing/_pricing_plan_version.py +++ b/stripe/v2/billing/_pricing_plan_version.py @@ -21,7 +21,7 @@ class PricingPlanVersion(StripeObject): """ end_date: Optional[str] """ - The timestamp when this version became inactive. Null if it's the latest version. + The timestamp when this version became inactive. null if it's the latest version. """ id: str """ diff --git a/stripe/v2/billing/_rate_card.py b/stripe/v2/billing/_rate_card.py index a2236899d..95bd0f241 100644 --- a/stripe/v2/billing/_rate_card.py +++ b/stripe/v2/billing/_rate_card.py @@ -23,8 +23,8 @@ class ServiceCycle(StripeObject): """ interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `interval` to `"month"` + to specify quarterly service. """ active: bool @@ -55,7 +55,7 @@ class ServiceCycle(StripeObject): """ live_version: str """ - The ID of the Rate Card Version that will be used by all subscriptions when no specific version is specified. + The ID of the Rate Card Version used by all subscriptions when no specific version is specified. """ livemode: bool """ @@ -75,25 +75,25 @@ class ServiceCycle(StripeObject): """ service_cycle: ServiceCycle """ - The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a rate of $1 for the - first 10 "workloads" and $2 thereafter means "$1 per workload up to 10 workloads during a month of service." + The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a rate of 1 USD for the + first 10 "workloads" and 2 USD thereafter means "1 USD per workload up to 10 workloads during a month of service." This is similar to but distinct from billing interval; the service interval deals with the rate at which the customer accumulates fees, while the billing interval in Cadence deals with the rate the customer is billed. """ service_interval: Literal["day", "month", "week", "year"] """ - The interval for assessing service. For example, a monthly Rate Card with a rate of $1 for the first 10 "workloads" - and $2 thereafter means "$1 per workload up to 10 workloads during a month of service." This is similar to but + The interval for assessing service. For example, a monthly Rate Card with a rate of 1 USD for the first 10 "workloads" + and 2 USD thereafter means "1 USD per workload up to 10 workloads during a month of service." This is similar to but distinct from billing interval; the service interval deals with the rate at which the customer accumulates fees, while the billing interval in Cadence deals with the rate the customer is billed. """ service_interval_count: int """ - The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` in - order to specify quarterly service. + The length of the interval for assessing service. For example, set this to 3 and `service_interval` to `"month"` + to specify quarterly service. """ tax_behavior: Literal["exclusive", "inclusive"] """ - The Stripe Tax tax behavior - whether the rates are inclusive or exclusive of tax. + The tax behavior for Stripe Tax — whether the rate card price includes or excludes tax. """ _inner_class_types = {"service_cycle": ServiceCycle} diff --git a/stripe/v2/billing/_rate_card_rate.py b/stripe/v2/billing/_rate_card_rate.py index 03965b180..a10077c52 100644 --- a/stripe/v2/billing/_rate_card_rate.py +++ b/stripe/v2/billing/_rate_card_rate.py @@ -47,7 +47,7 @@ class Tier(StripeObject): """ up_to_decimal: Optional[Decimal] """ - Up to and including this quantity will be contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may + Up to and including this quantity is contained in the tier. Only one of `up_to_decimal` and `up_to_inf` may be set. """ up_to_inf: Optional[Literal["inf"]] @@ -106,7 +106,7 @@ class TransformQuantity(StripeObject): """ tiering_mode: Optional[Literal["graduated", "volume"]] """ - Defines whether the tiering price should be graduated or volume-based. In volume-based tiering, the maximum + Defines whether the tiering price is graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if `tiers` is set. """ diff --git a/stripe/v2/billing/_service_action.py b/stripe/v2/billing/_service_action.py index 2177ace92..374b756ff 100644 --- a/stripe/v2/billing/_service_action.py +++ b/stripe/v2/billing/_service_action.py @@ -62,7 +62,7 @@ class Scope(StripeObject): """ price_type: Optional[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ scope: Scope @@ -148,7 +148,7 @@ class Scope(StripeObject): """ price_type: Optional[Literal["metered"]] """ - The price type that credit grants can apply to. We currently only support the `metered` price type. This will apply to metered prices and rate cards. Cannot be used in combination with `billable_items`. + The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ scope: Scope diff --git a/stripe/v2/billing/rate_cards/_rate_service.py b/stripe/v2/billing/rate_cards/_rate_service.py index 93ead3459..bbc33a70f 100644 --- a/stripe/v2/billing/rate_cards/_rate_service.py +++ b/stripe/v2/billing/rate_cards/_rate_service.py @@ -77,7 +77,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "RateCardRate": """ - Set the Rate for a Metered Item on the latest version of a Rate Card object. This will create a new Rate Card version + Set the Rate for a Metered Item on the latest version of a Rate Card object. This creates a new Rate Card version if the Metered Item already has a rate on the Rate Card. """ return cast( @@ -103,7 +103,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "RateCardRate": """ - Set the Rate for a Metered Item on the latest version of a Rate Card object. This will create a new Rate Card version + Set the Rate for a Metered Item on the latest version of a Rate Card object. This creates a new Rate Card version if the Metered Item already has a rate on the Rate Card. """ return cast( @@ -130,7 +130,7 @@ def delete( options: Optional["RequestOptions"] = None, ) -> "DeletedObject": """ - Remove an existing Rate from a Rate Card. This will create a new Rate Card Version without that Rate. + Remove an existing Rate from a Rate Card. This creates a new Rate Card Version without that Rate. """ return cast( "DeletedObject", @@ -154,7 +154,7 @@ async def delete_async( options: Optional["RequestOptions"] = None, ) -> "DeletedObject": """ - Remove an existing Rate from a Rate Card. This will create a new Rate Card Version without that Rate. + Remove an existing Rate from a Rate Card. This creates a new Rate Card Version without that Rate. """ return cast( "DeletedObject", diff --git a/stripe/v2/commerce/__init__.py b/stripe/v2/commerce/__init__.py new file mode 100644 index 000000000..fc4dea39e --- /dev/null +++ b/stripe/v2/commerce/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce import product_catalog as product_catalog + from stripe.v2.commerce._product_catalog_import import ( + ProductCatalogImport as ProductCatalogImport, + ) + from stripe.v2.commerce._product_catalog_service import ( + ProductCatalogService as ProductCatalogService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "product_catalog": ("stripe.v2.commerce.product_catalog", True), + "ProductCatalogImport": ( + "stripe.v2.commerce._product_catalog_import", + False, + ), + "ProductCatalogService": ( + "stripe.v2.commerce._product_catalog_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/_product_catalog_import.py b/stripe/v2/commerce/_product_catalog_import.py new file mode 100644 index 000000000..e5562955f --- /dev/null +++ b/stripe/v2/commerce/_product_catalog_import.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class ProductCatalogImport(StripeObject): + """ + The product catalog import object tracks the long-running background process that handles uploading, processing and validation. + """ + + OBJECT_NAME: ClassVar[Literal["v2.commerce.product_catalog_import"]] = ( + "v2.commerce.product_catalog_import" + ) + + class StatusDetails(StripeObject): + class AwaitingUpload(StripeObject): + class UploadUrl(StripeObject): + expires_at: str + """ + The timestamp when the upload URL expires. + """ + url: str + """ + The pre-signed URL for uploading the catalog file. + """ + + upload_url: UploadUrl + """ + The pre-signed URL information for uploading the catalog file. + """ + _inner_class_types = {"upload_url": UploadUrl} + + class Failed(StripeObject): + code: Literal["file_not_found", "internal_error", "invalid_file"] + """ + The error code for this product catalog processing failure. + """ + failure_message: str + """ + A message explaining why the import failed. + """ + type: Literal["cannot_proceed", "transient_failure"] + """ + The error type for this product catalog processing failure. + """ + + class Processing(StripeObject): + error_count: int + """ + The number of records that failed to process so far. + """ + success_count: int + """ + The number of records processed so far. + """ + _field_encodings = { + "error_count": "int64_string", + "success_count": "int64_string", + } + + class Succeeded(StripeObject): + success_count: int + """ + The total number of records processed. + """ + _field_encodings = {"success_count": "int64_string"} + + class SucceededWithErrors(StripeObject): + class ErrorFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: str + """ + The timestamp when the download URL expires. + """ + url: str + """ + The pre-signed URL for downloading the error file. + """ + + content_type: str + """ + The MIME type of the error file. + """ + download_url: DownloadUrl + """ + The pre-signed URL information for downloading the error file. + """ + size: int + """ + The size of the error file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + _field_encodings = {"size": "int64_string"} + + class Sample(StripeObject): + error_message: str + """ + A description of what went wrong with this record. + """ + field: str + """ + The name of the field that caused the error. + """ + id: str + """ + The identifier of the record that failed to process. + """ + row: int + """ + The row number in the import file where the error occurred. + """ + _field_encodings = {"row": "int64_string"} + + error_count: int + """ + The total number of records that failed to process. + """ + error_file: ErrorFile + """ + A file containing details about all errors that occurred. + """ + samples: List[Sample] + """ + A sample of errors that occurred during processing. + """ + success_count: int + """ + The total number of records processed. + """ + _inner_class_types = {"error_file": ErrorFile, "samples": Sample} + _field_encodings = { + "error_count": "int64_string", + "success_count": "int64_string", + } + + awaiting_upload: Optional[AwaitingUpload] + """ + Details when the import is awaiting file upload. + """ + failed: Optional[Failed] + """ + Details when the import didn't complete. + """ + processing: Optional[Processing] + """ + Details when the import is processing. + """ + succeeded: Optional[Succeeded] + """ + Details when the import has succeeded. + """ + succeeded_with_errors: Optional[SucceededWithErrors] + """ + Details when the import completed but some records failed to process. + """ + _inner_class_types = { + "awaiting_upload": AwaitingUpload, + "failed": Failed, + "processing": Processing, + "succeeded": Succeeded, + "succeeded_with_errors": SucceededWithErrors, + } + + created: str + """ + The time this ProductCatalogImport was created. + """ + feed_type: Literal["inventory", "pricing", "product"] + """ + The type of feed data being imported into the product catalog. + """ + id: str + """ + The unique identifier for this ProductCatalogImport. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: UntypedStripeObject[str] + """ + Additional information about the object in a structured format. + """ + object: Literal["v2.commerce.product_catalog_import"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal[ + "awaiting_upload", + "failed", + "processing", + "succeeded", + "succeeded_with_errors", + ] + """ + The current status of this ProductCatalogImport. + """ + status_details: Optional[StatusDetails] + """ + Details about the current import status. + """ + _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/v2/commerce/_product_catalog_service.py b/stripe/v2/commerce/_product_catalog_service.py new file mode 100644 index 000000000..9c9c4e0b9 --- /dev/null +++ b/stripe/v2/commerce/_product_catalog_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce.product_catalog._import_service import ( + ImportService, + ) + +_subservices = { + "imports": [ + "stripe.v2.commerce.product_catalog._import_service", + "ImportService", + ], +} + + +class ProductCatalogService(StripeService): + imports: "ImportService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/product_catalog/__init__.py b/stripe/v2/commerce/product_catalog/__init__.py new file mode 100644 index 000000000..bad6e9107 --- /dev/null +++ b/stripe/v2/commerce/product_catalog/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce.product_catalog._import_service import ( + ImportService as ImportService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ImportService": ( + "stripe.v2.commerce.product_catalog._import_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/product_catalog/_import_service.py b/stripe/v2/commerce/product_catalog/_import_service.py new file mode 100644 index 000000000..cc5f28bcd --- /dev/null +++ b/stripe/v2/commerce/product_catalog/_import_service.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.commerce.product_catalog._import_create_params import ( + ImportCreateParams, + ) + from stripe.params.v2.commerce.product_catalog._import_list_params import ( + ImportListParams, + ) + from stripe.params.v2.commerce.product_catalog._import_retrieve_params import ( + ImportRetrieveParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class ImportService(StripeService): + def list( + self, + params: Optional["ImportListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProductCatalogImport]": + """ + Returns a list of ProductCatalogImport objects. + """ + return cast( + "ListObject[ProductCatalogImport]", + self._request( + "get", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ImportListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProductCatalogImport]": + """ + Returns a list of ProductCatalogImport objects. + """ + return cast( + "ListObject[ProductCatalogImport]", + await self._request_async( + "get", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "ImportCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Creates a ProductCatalogImport. + """ + return cast( + "ProductCatalogImport", + self._request( + "post", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ImportCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Creates a ProductCatalogImport. + """ + return cast( + "ProductCatalogImport", + await self._request_async( + "post", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["ImportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Retrieves a ProductCatalogImport by ID. + """ + return cast( + "ProductCatalogImport", + self._request( + "get", + "/v2/commerce/product_catalog/imports/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["ImportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Retrieves a ProductCatalogImport by ID. + """ + return cast( + "ProductCatalogImport", + await self._request_async( + "get", + "/v2/commerce/product_catalog/imports/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index b7d948242..c4ffa3334 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -35,6 +35,12 @@ from stripe.v2.core._account_token_service import ( AccountTokenService as AccountTokenService, ) + from stripe.v2.core._approval_request import ( + ApprovalRequest as ApprovalRequest, + ) + from stripe.v2.core._approval_request_service import ( + ApprovalRequestService as ApprovalRequestService, + ) from stripe.v2.core._batch_job import BatchJob as BatchJob from stripe.v2.core._batch_job_service import ( BatchJobService as BatchJobService, @@ -60,14 +66,6 @@ ) from stripe.v2.core._event_service import EventService as EventService from stripe.v2.core._vault_service import VaultService as VaultService - from stripe.v2.core._workflow import Workflow as Workflow - from stripe.v2.core._workflow_run import WorkflowRun as WorkflowRun - from stripe.v2.core._workflow_run_service import ( - WorkflowRunService as WorkflowRunService, - ) - from stripe.v2.core._workflow_service import ( - WorkflowService as WorkflowService, - ) # name -> (import_target, is_submodule) _import_map = { @@ -86,6 +84,11 @@ "AccountService": ("stripe.v2.core._account_service", False), "AccountToken": ("stripe.v2.core._account_token", False), "AccountTokenService": ("stripe.v2.core._account_token_service", False), + "ApprovalRequest": ("stripe.v2.core._approval_request", False), + "ApprovalRequestService": ( + "stripe.v2.core._approval_request_service", + False, + ), "BatchJob": ("stripe.v2.core._batch_job", False), "BatchJobService": ("stripe.v2.core._batch_job_service", False), "ClaimableSandbox": ("stripe.v2.core._claimable_sandbox", False), @@ -106,10 +109,6 @@ ), "EventService": ("stripe.v2.core._event_service", False), "VaultService": ("stripe.v2.core._vault_service", False), - "Workflow": ("stripe.v2.core._workflow", False), - "WorkflowRun": ("stripe.v2.core._workflow_run", False), - "WorkflowRunService": ("stripe.v2.core._workflow_run_service", False), - "WorkflowService": ("stripe.v2.core._workflow_service", False), } if not TYPE_CHECKING: diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index db7fca75e..8810f840f 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -3202,6 +3202,7 @@ class DefaultOutboundDestination(StripeObject): "ca_bank_account", "ch_bank_account", "ci_bank_account", + "cn_bank_account", "co_bank_account", "crypto_wallet", "cr_bank_account", @@ -3234,6 +3235,7 @@ class DefaultOutboundDestination(StripeObject): "it_bank_account", "jm_bank_account", "jo_bank_account", + "jp_bank_account", "ke_bank_account", "kh_bank_account", "kw_bank_account", @@ -6031,7 +6033,10 @@ class IdNumber(StripeObject): "be_vat", "bg_uic", "bg_vat", + "bm_crn", + "bo_tin", "br_cnpj", + "bt_tpn", "ca_cn", "ca_crarr", "ca_gst_hst", @@ -6039,6 +6044,7 @@ class IdNumber(StripeObject): "ca_rid", "ch_chid", "ch_uid", + "co_nit", "cr_cpj", "cr_nite", "cy_he", @@ -6052,8 +6058,10 @@ class IdNumber(StripeObject): "dk_cvr", "dk_vat", "do_rcn", + "ec_ruc", "ee_rk", "ee_vat", + "eg_tin", "es_cif", "es_vat", "fi_vat", @@ -6063,13 +6071,16 @@ class IdNumber(StripeObject): "fr_vat", "gb_crn", "gb_vat", + "gh_tin", "gi_crn", "gr_afm", "gr_gemi", "gr_vat", "gt_nit", + "gy_tin", "hk_br", "hk_cr", + "hn_rtn", "hr_mbs", "hr_oib", "hr_vat", @@ -6081,9 +6092,14 @@ class IdNumber(StripeObject): "ie_vat", "it_rea", "it_vat", + "jm_trn", + "jo_crn", "jp_cn", + "ke_pin", + "ky_crn", "kz_bin", "li_uid", + "lk_tin", "lt_ccrn", "lt_vat", "lu_nif", @@ -6091,27 +6107,33 @@ class IdNumber(StripeObject): "lu_vat", "lv_urn", "lv_vat", + "mo_tin", "mt_crn", "mt_tin", "mt_vat", + "mv_tin", "mx_rfc", "my_brn", "my_coid", "my_itn", "my_sst", "mz_nuit", + "ng_tin", "nl_kvk", "nl_rsin", "nl_vat", "no_orgnr", "nz_bn", "nz_ird", + "pa_ruc", "pe_ruc", + "ph_tin", "pk_ntn", "pl_nip", "pl_regon", "pl_vat", "pt_vat", + "py_ruc", "ro_cui", "ro_orc", "ro_vat", @@ -6126,10 +6148,15 @@ class IdNumber(StripeObject): "sk_dic", "sk_ico", "sk_vat", + "sl_tin", + "sv_nit", "th_crn", "th_prn", "th_tin", "us_ein", + "uy_ruc", + "vg_cn", + "za_tin", ] """ Open Enum. The ID number type of a business entity. @@ -6574,8 +6601,11 @@ class IdNumber(StripeObject): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -6593,26 +6623,37 @@ class IdNumber(StripeObject): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -6620,17 +6661,22 @@ class IdNumber(StripeObject): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -6639,6 +6685,7 @@ class IdNumber(StripeObject): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/v2/core/_account_person.py b/stripe/v2/core/_account_person.py index ccee13457..2b136f1b8 100644 --- a/stripe/v2/core/_account_person.py +++ b/stripe/v2/core/_account_person.py @@ -246,8 +246,11 @@ class IdNumber(StripeObject): "bd_nid", "be_nrn", "bg_ucn", + "bm_pp", "bn_nric", + "bo_ci", "br_cpf", + "bt_cid", "ca_sin", "ch_oasi", "cl_rut", @@ -265,26 +268,37 @@ class IdNumber(StripeObject): "do_rcn", "ec_ci", "ee_ik", + "eg_tin", "es_nif", "fi_hetu", "fr_nir", "gb_nino", + "gh_pin", "gr_afm", "gt_nit", + "gy_tin", "hk_id", + "hn_rtn", "hr_oib", "hu_ad", "id_nik", "ie_ppsn", "is_kt", "it_cf", + "jm_trn", + "jo_pin", "jp_inc", "ke_pin", + "ky_pp", "kz_iin", "li_peid", + "lk_nic", "lt_ak", "lu_nif", "lv_pk", + "mo_bir", + "mt_nic", + "mv_tin", "mx_rfc", "my_nric", "mz_nuit", @@ -292,17 +306,22 @@ class IdNumber(StripeObject): "nl_bsn", "no_nin", "nz_ird", + "pa_ruc", "pe_dni", + "ph_tin", "pk_cnic", "pk_snic", "pl_pesel", "pt_nif", + "py_ruc", "ro_cnp", "sa_tin", "se_pin", "sg_fin", "sg_nric", + "si_pin", "sk_dic", + "sv_nit", "th_lc", "th_pin", "tr_tin", @@ -311,6 +330,7 @@ class IdNumber(StripeObject): "us_ssn", "us_ssn_last_4", "uy_dni", + "vg_pp", "za_id", ] """ diff --git a/stripe/v2/core/_approval_request.py b/stripe/v2/core/_approval_request.py new file mode 100644 index 000000000..dd016b4f0 --- /dev/null +++ b/stripe/v2/core/_approval_request.py @@ -0,0 +1,320 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class ApprovalRequest(StripeObject): + """ + An approval request represents a pending action that requires review before execution. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.approval_request"]] = ( + "v2.core.approval_request" + ) + + class RequestedBy(StripeObject): + id: str + """ + Stripe-defined identifier for the requester (e.g. a restricted API key token). + """ + name: Optional[str] + """ + Merchant-defined name for the requester. + """ + + class Review(StripeObject): + class ReviewedBy(StripeObject): + id: str + """ + Stripe-defined identifier for the reviewer (e.g. a restricted API key token). + """ + name: str + """ + Merchant-defined name for the reviewer. + """ + + reason: Optional[str] + """ + The reason provided by the reviewer. + """ + result: Literal["approved", "rejected"] + """ + The result of the review. + """ + reviewed_at: str + """ + Timestamp when the review was performed. + """ + reviewed_by: ReviewedBy + """ + The reviewer who performed the review. + """ + _inner_class_types = {"reviewed_by": ReviewedBy} + + class Rule(StripeObject): + name: str + """ + The name of the rule. + """ + + class StatusDetails(StripeObject): + class Approved(StripeObject): + reason: Optional[str] + """ + The reason provided when approving the request. + """ + + class Canceled(StripeObject): + pass + + class ExecutionFailed(StripeObject): + code: str + """ + The error code for the failed execution. + """ + message: str + """ + The error message for the failed execution. + """ + type: str + """ + The error type for the failed execution. + """ + + class ExecutionStarted(StripeObject): + pass + + class ExecutionSucceeded(StripeObject): + class Result(StripeObject): + id: str + """ + The unique identifier of the executed object. + """ + object: str + """ + The object type of the executed resource. + """ + + result: Result + """ + The result of the successful execution. + """ + _inner_class_types = {"result": Result} + + class Expired(StripeObject): + pass + + class Failed(StripeObject): + error_code: str + """ + The error code for the failed execution. + """ + error_message: str + """ + The error message for the failed execution. + """ + error_type: str + """ + The error type for the failed execution. + """ + + class Pending(StripeObject): + pass + + class Rejected(StripeObject): + reason: Optional[str] + """ + The reason provided when rejecting the request. + """ + + class Succeeded(StripeObject): + class Result(StripeObject): + id: str + """ + The unique identifier of the executed object. + """ + object: str + """ + The object type of the executed resource. + """ + + result: Result + """ + The result of the successful execution. + """ + _inner_class_types = {"result": Result} + + approved: Optional[Approved] + """ + Deprecated: use requires_execution status instead. + """ + canceled: Optional[Canceled] + """ + Deprecated: use canceled status instead. + """ + execution_failed: Optional[ExecutionFailed] + """ + Deprecated: use failed status instead. + """ + execution_started: Optional[ExecutionStarted] + """ + Deprecated: use requires_execution status instead. + """ + execution_succeeded: Optional[ExecutionSucceeded] + """ + Deprecated: use succeeded status instead. + """ + expired: Optional[Expired] + """ + Deprecated: use expired status instead. + """ + failed: Optional[Failed] + """ + Details when the approval request failed. + """ + pending: Optional[Pending] + """ + Deprecated: use requires_review status instead. + """ + rejected: Optional[Rejected] + """ + Deprecated: use rejected status instead. + """ + succeeded: Optional[Succeeded] + """ + Details when the approval request succeeded. + """ + _inner_class_types = { + "approved": Approved, + "canceled": Canceled, + "execution_failed": ExecutionFailed, + "execution_started": ExecutionStarted, + "execution_succeeded": ExecutionSucceeded, + "expired": Expired, + "failed": Failed, + "pending": Pending, + "rejected": Rejected, + "succeeded": Succeeded, + } + + class StatusTransitions(StripeObject): + canceled_at: Optional[str] + """ + Timestamp when the approval request was canceled. + """ + expired_at: Optional[str] + """ + Timestamp when the approval request expired. + """ + failed_at: Optional[str] + """ + Timestamp when the approval request failed. + """ + rejected_at: Optional[str] + """ + Timestamp when the approval request was rejected. + """ + requires_execution_at: Optional[str] + """ + Timestamp when the approval request moved to requires_execution status. + """ + succeeded_at: Optional[str] + """ + Timestamp when the approval request succeeded. + """ + + action: Literal[ + "charge.create", + "dispute.close", + "inbound_transfers.money_management.create", + "invoice.create", + "outbound_payments.money_management.create", + "outbound_transfers.money_management.create", + "payment_intent.create", + "payment_intent.update", + "payout.create", + "price.update", + "refund.create", + "setup_intent.create", + "subscription.create", + "subscription.update", + "topup.create", + "transfer.create", + ] + """ + The action that was requested. + """ + created: str + """ + Time this ApprovalRequest was created. + """ + dashboard_url: Optional[str] + """ + The URL to the dashboard for this ApprovalRequest. + """ + description: Optional[str] + """ + A description of the approval request. + """ + expires_at: str + """ + The timestamp at which this ApprovalRequest will expire. + """ + id: str + """ + The unique identifier for this ApprovalRequest. + """ + livemode: bool + """ + Whether this ApprovalRequest is livemode. + """ + object: Literal["v2.core.approval_request"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + requested_by: RequestedBy + """ + The requester of this ApprovalRequest. + """ + review: Optional[Review] + """ + The review of this ApprovalRequest if it has been reviewed. + """ + rule: Optional[Rule] + """ + The rule associated with this ApprovalRequest. + """ + status: Literal[ + "approved", + "canceled", + "execution_failed", + "execution_started", + "execution_succeeded", + "expired", + "failed", + "pending", + "rejected", + "requires_execution", + "requires_review", + "succeeded", + ] + """ + The status of this ApprovalRequest. + """ + status_details: Optional[StatusDetails] + """ + The details of the status of this ApprovalRequest. + """ + status_transitions: Optional[StatusTransitions] + """ + The transitions of the status of this ApprovalRequest. + """ + _inner_class_types = { + "requested_by": RequestedBy, + "review": Review, + "rule": Rule, + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + } diff --git a/stripe/v2/core/_approval_request_service.py b/stripe/v2/core/_approval_request_service.py new file mode 100644 index 000000000..bd15c6fb2 --- /dev/null +++ b/stripe/v2/core/_approval_request_service.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.core._approval_request_cancel_params import ( + ApprovalRequestCancelParams, + ) + from stripe.params.v2.core._approval_request_execute_params import ( + ApprovalRequestExecuteParams, + ) + from stripe.params.v2.core._approval_request_list_params import ( + ApprovalRequestListParams, + ) + from stripe.params.v2.core._approval_request_retrieve_params import ( + ApprovalRequestRetrieveParams, + ) + from stripe.params.v2.core._approval_request_submit_params import ( + ApprovalRequestSubmitParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.core._approval_request import ApprovalRequest + + +class ApprovalRequestService(StripeService): + def list( + self, + params: Optional["ApprovalRequestListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ApprovalRequest]": + """ + GET /v2/core/approval_requests + Lists approval requests with optional filtering. + """ + return cast( + "ListObject[ApprovalRequest]", + self._request( + "get", + "/v2/core/approval_requests", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ApprovalRequestListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ApprovalRequest]": + """ + GET /v2/core/approval_requests + Lists approval requests with optional filtering. + """ + return cast( + "ListObject[ApprovalRequest]", + await self._request_async( + "get", + "/v2/core/approval_requests", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["ApprovalRequestRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + GET /v2/core/approval_requests/:id + Retrieves an approval request by ID. + """ + return cast( + "ApprovalRequest", + self._request( + "get", + "/v2/core/approval_requests/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["ApprovalRequestRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + GET /v2/core/approval_requests/:id + Retrieves an approval request by ID. + """ + return cast( + "ApprovalRequest", + await self._request_async( + "get", + "/v2/core/approval_requests/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + id: str, + params: Optional["ApprovalRequestCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/cancel + Cancels a pending approval request. + """ + return cast( + "ApprovalRequest", + self._request( + "post", + "/v2/core/approval_requests/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: Optional["ApprovalRequestCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/cancel + Cancels a pending approval request. + """ + return cast( + "ApprovalRequest", + await self._request_async( + "post", + "/v2/core/approval_requests/{id}/cancel".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def execute( + self, + id: str, + params: Optional["ApprovalRequestExecuteParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/execute + Executes an approved approval request. + """ + return cast( + "ApprovalRequest", + self._request( + "post", + "/v2/core/approval_requests/{id}/execute".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def execute_async( + self, + id: str, + params: Optional["ApprovalRequestExecuteParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/execute + Executes an approved approval request. + """ + return cast( + "ApprovalRequest", + await self._request_async( + "post", + "/v2/core/approval_requests/{id}/execute".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def submit( + self, + id: str, + params: Optional["ApprovalRequestSubmitParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/submit + Moves a pending approval request into the reviewer queue for auto-execution upon approval. + """ + return cast( + "ApprovalRequest", + self._request( + "post", + "/v2/core/approval_requests/{id}/submit".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_async( + self, + id: str, + params: Optional["ApprovalRequestSubmitParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ApprovalRequest": + """ + POST /v2/core/approval_requests/:id/submit + Moves a pending approval request into the reviewer queue for auto-execution upon approval. + """ + return cast( + "ApprovalRequest", + await self._request_async( + "post", + "/v2/core/approval_requests/{id}/submit".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_claimable_sandbox.py b/stripe/v2/core/_claimable_sandbox.py index 4c5230cb6..4db20da62 100644 --- a/stripe/v2/core/_claimable_sandbox.py +++ b/stripe/v2/core/_claimable_sandbox.py @@ -20,6 +20,35 @@ class ClaimableSandbox(StripeObject): "v2.core.claimable_sandbox" ) + class OnboardingLinkDetails(StripeObject): + expires_at: str + """ + The timestamp the onboarding link expires. + """ + refresh_url: str + """ + The URL the user will be redirected to if the onboarding link is expired or invalid. + The URL specified should attempt to generate a new onboarding link, + and re-direct the user to this new onboarding link so that they can proceed with the onboarding flow. + """ + url: str + """ + URL that will redirect the user to either claim or onboard the claimable sandbox depending on its status. + """ + + class OwnerDetails(StripeObject): + account: Optional[str] + """ + The ID of the livemode Stripe account that owns the sandbox. + This field is only set when owner_details.app_install_status is `installed`. + """ + app_install_status: Literal[ + "installed", "pending_install", "pending_onboarding" + ] + """ + Indicates whether the platform app is installed on the sandbox's livemode owner account. + """ + class Prefill(StripeObject): country: str """ @@ -60,17 +89,11 @@ class ApiKeys(StripeObject): """ Keys that can be used to set up an integration for this sandbox and operate on the account. This will be present only in the create response, and will be null in subsequent retrieve responses. """ - owner_account: Optional[str] - """ - The livemode sandbox Stripe account ID. This field is only set if the user activates their sandbox - and chooses to install your platform's Stripe App in their live account. - """ _inner_class_types = {"api_keys": ApiKeys} - claim_url: Optional[str] + app_channel: Literal["public", "testing"] """ - URL for user to claim sandbox into their existing Stripe account. - The value will be null if the sandbox status is `claimed` or `expired`. + The app channel that will be used when pre-installing your app on the claimable sandbox. """ claimed_at: Optional[str] """ @@ -96,6 +119,15 @@ class ApiKeys(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ + onboarding_link_details: OnboardingLinkDetails + """ + Details about the onboarding link. + """ + owner_details: Optional[OwnerDetails] + """ + Details about the livemode owner account of the sandbox. + This will be null until the sandbox is claimed. + """ prefill: Prefill """ Values prefilled during the creation of the sandbox. When a user claims the sandbox, they will be able to update these values. @@ -104,11 +136,13 @@ class ApiKeys(StripeObject): """ Data about the Stripe sandbox object. """ - status: Literal["claimed", "expired", "unclaimed"] + status: Literal["claimed", "expired", "live", "unclaimed"] """ - Status of the sandbox. One of `unclaimed`, `expired`, `claimed`. + Status of the sandbox. """ _inner_class_types = { + "onboarding_link_details": OnboardingLinkDetails, + "owner_details": OwnerDetails, "prefill": Prefill, "sandbox_details": SandboxDetails, } diff --git a/stripe/v2/core/_claimable_sandbox_service.py b/stripe/v2/core/_claimable_sandbox_service.py index 428d48e01..6c35cbe9d 100644 --- a/stripe/v2/core/_claimable_sandbox_service.py +++ b/stripe/v2/core/_claimable_sandbox_service.py @@ -10,6 +10,9 @@ from stripe.params.v2.core._claimable_sandbox_create_params import ( ClaimableSandboxCreateParams, ) + from stripe.params.v2.core._claimable_sandbox_renew_onboarding_link_params import ( + ClaimableSandboxRenewOnboardingLinkParams, + ) from stripe.params.v2.core._claimable_sandbox_retrieve_params import ( ClaimableSandboxRetrieveParams, ) @@ -100,3 +103,49 @@ async def retrieve_async( options=options, ), ) + + def renew_onboarding_link( + self, + id: str, + params: Optional["ClaimableSandboxRenewOnboardingLinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ClaimableSandbox": + """ + Renew the claimable sandbox onboarding link. This will invalidate any existing onboarding links. + The endpoint only works on a claimable sandbox with status `unclaimed` or `claimed`. + """ + return cast( + "ClaimableSandbox", + self._request( + "post", + "/v2/core/claimable_sandboxes/{id}/renew_onboarding_link".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def renew_onboarding_link_async( + self, + id: str, + params: Optional["ClaimableSandboxRenewOnboardingLinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ClaimableSandbox": + """ + Renew the claimable sandbox onboarding link. This will invalidate any existing onboarding links. + The endpoint only works on a claimable sandbox with status `unclaimed` or `claimed`. + """ + return cast( + "ClaimableSandbox", + await self._request_async( + "post", + "/v2/core/claimable_sandboxes/{id}/renew_onboarding_link".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_connection_session.py b/stripe/v2/core/_connection_session.py index 0950fcc8d..4a2cc8445 100644 --- a/stripe/v2/core/_connection_session.py +++ b/stripe/v2/core/_connection_session.py @@ -7,7 +7,8 @@ class ConnectionSession(StripeObject): """ - The ConnectionSession resource. + A short-lived, single-use session used to launch client-side Link onboarding + that connects an Account to a Link consumer account. """ OBJECT_NAME: ClassVar[Literal["v2.core.connection_session"]] = ( diff --git a/stripe/v2/core/_event.py b/stripe/v2/core/_event.py index ffb8e7d3b..5d23c5586 100644 --- a/stripe/v2/core/_event.py +++ b/stripe/v2/core/_event.py @@ -121,6 +121,10 @@ class StripeAction(StripeObject): """ Reason for the event. """ + snapshot_event: Optional[str] + """ + For interop events, this is the snapshot event ID. + """ type: str """ The type of the event. diff --git a/stripe/v2/core/accounts/_person_token_service.py b/stripe/v2/core/accounts/_person_token_service.py index 0868da342..66d9498e8 100644 --- a/stripe/v2/core/accounts/_person_token_service.py +++ b/stripe/v2/core/accounts/_person_token_service.py @@ -24,7 +24,8 @@ def create( options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": """ - Creates a Person Token associated with an Account. + Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens). + You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode. """ return cast( "AccountPersonToken", @@ -46,7 +47,8 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": """ - Creates a Person Token associated with an Account. + Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens). + You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode. """ return cast( "AccountPersonToken", diff --git a/stripe/v2/core/vault/_gb_bank_account.py b/stripe/v2/core/vault/_gb_bank_account.py index 36545b39d..ae69da68b 100644 --- a/stripe/v2/core/vault/_gb_bank_account.py +++ b/stripe/v2/core/vault/_gb_bank_account.py @@ -91,7 +91,7 @@ class Provided(StripeObject): the /archive API, and they will not be automatically archived by Stripe. Archived bank account objects cannot be used as outbound destinations and will not appear in the outbound destination list. """ - bank_account_type: Literal["checking", "savings"] + bank_account_type: Literal["checking", "futsu", "savings", "toza"] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/v2/extend/__init__.py b/stripe/v2/extend/__init__.py new file mode 100644 index 000000000..ccf21fc05 --- /dev/null +++ b/stripe/v2/extend/__init__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.extend._workflow import Workflow as Workflow + from stripe.v2.extend._workflow_run import WorkflowRun as WorkflowRun + from stripe.v2.extend._workflow_run_service import ( + WorkflowRunService as WorkflowRunService, + ) + from stripe.v2.extend._workflow_service import ( + WorkflowService as WorkflowService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Workflow": ("stripe.v2.extend._workflow", False), + "WorkflowRun": ("stripe.v2.extend._workflow_run", False), + "WorkflowRunService": ("stripe.v2.extend._workflow_run_service", False), + "WorkflowService": ("stripe.v2.extend._workflow_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/core/_workflow.py b/stripe/v2/extend/_workflow.py similarity index 87% rename from stripe/v2/core/_workflow.py rename to stripe/v2/extend/_workflow.py index 6655371ea..ad325b2ff 100644 --- a/stripe/v2/core/_workflow.py +++ b/stripe/v2/extend/_workflow.py @@ -11,20 +11,21 @@ class Workflow(StripeObject): A trigger can be a Stripe API event, or a manual invocation. """ - OBJECT_NAME: ClassVar[Literal["v2.core.workflow"]] = "v2.core.workflow" + OBJECT_NAME: ClassVar[Literal["v2.extend.workflow"]] = "v2.extend.workflow" class Trigger(StripeObject): class EventTrigger(StripeObject): + events_from: List[str] + """ + Specifies which accounts' events will trigger this Workflow. + """ type: str """ The Stripe event type that will trigger this Workflow. """ class Manual(StripeObject): - raw_schema: str - """ - An unprocessed version of the trigger's input parameter schema. - """ + pass event_trigger: Optional[EventTrigger] """ @@ -44,10 +45,6 @@ class Manual(StripeObject): """ When the Workflow was created. """ - description: str - """ - Workflow description. - """ id: str """ The unique ID of the Workflow. @@ -56,7 +53,7 @@ class Manual(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - object: Literal["v2.core.workflow"] + object: Literal["v2.extend.workflow"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ @@ -64,6 +61,10 @@ class Manual(StripeObject): """ Whether this Workflow is active, inactive, or in some other state. Only active Workflows may be invoked. """ + title: str + """ + Workflow title. + """ triggers: List[Trigger] """ Under what conditions will this Workflow launch. diff --git a/stripe/v2/core/_workflow_run.py b/stripe/v2/extend/_workflow_run.py similarity index 85% rename from stripe/v2/core/_workflow_run.py rename to stripe/v2/extend/_workflow_run.py index fada61e15..c2e377b4d 100644 --- a/stripe/v2/core/_workflow_run.py +++ b/stripe/v2/extend/_workflow_run.py @@ -10,20 +10,12 @@ class WorkflowRun(StripeObject): An execution of a Workflow in response to a triggering event. """ - OBJECT_NAME: ClassVar[Literal["v2.core.workflow_run"]] = ( - "v2.core.workflow_run" + OBJECT_NAME: ClassVar[Literal["v2.extend.workflow_run"]] = ( + "v2.extend.workflow_run" ) class StatusDetails(StripeObject): class Failed(StripeObject): - action: Optional[str] - """ - If this Workflow Run failed during the processing of an action step, the step identifier. - """ - error_code: str - """ - Category of the failure result. - """ error_message: Optional[str] """ Optional details about the failure result. @@ -33,14 +25,7 @@ class Started(StripeObject): pass class Succeeded(StripeObject): - status_code: str - """ - Category of the success result. - """ - status_message: Optional[str] - """ - Optional details about the success result. - """ + pass failed: Optional[Failed] """ @@ -76,6 +61,10 @@ class StatusTransitions(StripeObject): class Trigger(StripeObject): class EventTrigger(StripeObject): + context: str + """ + The account that generated the triggering event. + """ id: str """ The Stripe event that triggered this Run. @@ -117,7 +106,7 @@ class Manual(StripeObject): """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ - object: Literal["v2.core.workflow_run"] + object: Literal["v2.extend.workflow_run"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/stripe/v2/core/_workflow_run_service.py b/stripe/v2/extend/_workflow_run_service.py similarity index 80% rename from stripe/v2/core/_workflow_run_service.py rename to stripe/v2/extend/_workflow_run_service.py index 4d3891b34..d636ea261 100644 --- a/stripe/v2/core/_workflow_run_service.py +++ b/stripe/v2/extend/_workflow_run_service.py @@ -7,20 +7,20 @@ if TYPE_CHECKING: from stripe._request_options import RequestOptions - from stripe.params.v2.core._workflow_run_list_params import ( + from stripe.params.v2.extend._workflow_run_list_params import ( WorkflowRunListParams, ) - from stripe.params.v2.core._workflow_run_retrieve_params import ( + from stripe.params.v2.extend._workflow_run_retrieve_params import ( WorkflowRunRetrieveParams, ) from stripe.v2._list_object import ListObject - from stripe.v2.core._workflow_run import WorkflowRun + from stripe.v2.extend._workflow_run import WorkflowRun class WorkflowRunService(StripeService): def list( self, - params: "WorkflowRunListParams", + params: Optional["WorkflowRunListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[WorkflowRun]": """ @@ -30,7 +30,7 @@ def list( "ListObject[WorkflowRun]", self._request( "get", - "/v2/core/workflow_runs", + "/v2/extend/workflow_runs", base_address="api", params=params, options=options, @@ -39,7 +39,7 @@ def list( async def list_async( self, - params: "WorkflowRunListParams", + params: Optional["WorkflowRunListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[WorkflowRun]": """ @@ -49,7 +49,7 @@ async def list_async( "ListObject[WorkflowRun]", await self._request_async( "get", - "/v2/core/workflow_runs", + "/v2/extend/workflow_runs", base_address="api", params=params, options=options, @@ -69,7 +69,7 @@ def retrieve( "WorkflowRun", self._request( "get", - "/v2/core/workflow_runs/{id}".format(id=sanitize_id(id)), + "/v2/extend/workflow_runs/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, @@ -89,7 +89,7 @@ async def retrieve_async( "WorkflowRun", await self._request_async( "get", - "/v2/core/workflow_runs/{id}".format(id=sanitize_id(id)), + "/v2/extend/workflow_runs/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, diff --git a/stripe/v2/core/_workflow_service.py b/stripe/v2/extend/_workflow_service.py similarity index 79% rename from stripe/v2/core/_workflow_service.py rename to stripe/v2/extend/_workflow_service.py index 9b50fa06c..e95c51466 100644 --- a/stripe/v2/core/_workflow_service.py +++ b/stripe/v2/extend/_workflow_service.py @@ -7,22 +7,24 @@ if TYPE_CHECKING: from stripe._request_options import RequestOptions - from stripe.params.v2.core._workflow_invoke_params import ( + from stripe.params.v2.extend._workflow_invoke_params import ( WorkflowInvokeParams, ) - from stripe.params.v2.core._workflow_list_params import WorkflowListParams - from stripe.params.v2.core._workflow_retrieve_params import ( + from stripe.params.v2.extend._workflow_list_params import ( + WorkflowListParams, + ) + from stripe.params.v2.extend._workflow_retrieve_params import ( WorkflowRetrieveParams, ) from stripe.v2._list_object import ListObject - from stripe.v2.core._workflow import Workflow - from stripe.v2.core._workflow_run import WorkflowRun + from stripe.v2.extend._workflow import Workflow + from stripe.v2.extend._workflow_run import WorkflowRun class WorkflowService(StripeService): def list( self, - params: "WorkflowListParams", + params: Optional["WorkflowListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Workflow]": """ @@ -32,7 +34,7 @@ def list( "ListObject[Workflow]", self._request( "get", - "/v2/core/workflows", + "/v2/extend/workflows", base_address="api", params=params, options=options, @@ -41,7 +43,7 @@ def list( async def list_async( self, - params: "WorkflowListParams", + params: Optional["WorkflowListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Workflow]": """ @@ -51,7 +53,7 @@ async def list_async( "ListObject[Workflow]", await self._request_async( "get", - "/v2/core/workflows", + "/v2/extend/workflows", base_address="api", params=params, options=options, @@ -71,7 +73,7 @@ def retrieve( "Workflow", self._request( "get", - "/v2/core/workflows/{id}".format(id=sanitize_id(id)), + "/v2/extend/workflows/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, @@ -91,7 +93,7 @@ async def retrieve_async( "Workflow", await self._request_async( "get", - "/v2/core/workflows/{id}".format(id=sanitize_id(id)), + "/v2/extend/workflows/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, @@ -111,7 +113,7 @@ def invoke( "WorkflowRun", self._request( "post", - "/v2/core/workflows/{id}/invoke".format(id=sanitize_id(id)), + "/v2/extend/workflows/{id}/invoke".format(id=sanitize_id(id)), base_address="api", params=params, options=options, @@ -131,7 +133,7 @@ async def invoke_async( "WorkflowRun", await self._request_async( "post", - "/v2/core/workflows/{id}/invoke".format(id=sanitize_id(id)), + "/v2/extend/workflows/{id}/invoke".format(id=sanitize_id(id)), base_address="api", params=params, options=options, diff --git a/stripe/v2/iam/__init__.py b/stripe/v2/iam/__init__.py index dba3bfd03..ee91d8665 100644 --- a/stripe/v2/iam/__init__.py +++ b/stripe/v2/iam/__init__.py @@ -4,11 +4,17 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.v2.iam._activity_log import ActivityLog as ActivityLog + from stripe.v2.iam._activity_log_service import ( + ActivityLogService as ActivityLogService, + ) from stripe.v2.iam._api_key import ApiKey as ApiKey from stripe.v2.iam._api_key_service import ApiKeyService as ApiKeyService # name -> (import_target, is_submodule) _import_map = { + "ActivityLog": ("stripe.v2.iam._activity_log", False), + "ActivityLogService": ("stripe.v2.iam._activity_log_service", False), "ApiKey": ("stripe.v2.iam._api_key", False), "ApiKeyService": ("stripe.v2.iam._api_key_service", False), } diff --git a/stripe/v2/iam/_activity_log.py b/stripe/v2/iam/_activity_log.py new file mode 100644 index 000000000..b136cd457 --- /dev/null +++ b/stripe/v2/iam/_activity_log.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class ActivityLog(StripeObject): + """ + An activity log records a single action performed on an account. + """ + + OBJECT_NAME: ClassVar[Literal["v2.iam.activity_log"]] = ( + "v2.iam.activity_log" + ) + + class Actor(StripeObject): + class ApiKey(StripeObject): + id: str + """ + Unique identifier of the API key. + """ + + class User(StripeObject): + email: str + """ + Email address of the user. + """ + + api_key: Optional[ApiKey] + """ + Set when the actor is an API key. + """ + type: Literal["api_key", "user"] + """ + The type of actor. + """ + user: Optional[User] + """ + Set when the actor is a user. + """ + _inner_class_types = {"api_key": ApiKey, "user": User} + + class Details(StripeObject): + class ApiKey(StripeObject): + class ManagedBy(StripeObject): + class Application(StripeObject): + id: str + """ + Identifier of the application. + """ + + application: Optional[Application] + """ + An application. + """ + type: Literal["application"] + """ + The type of entity. + """ + _inner_class_types = {"application": Application} + + created: str + """ + Timestamp when the API key was created. + """ + expires_at: Optional[str] + """ + Timestamp when the API key expires. + """ + id: str + """ + Unique identifier of the API key. + """ + ip_allowlist: List[str] + """ + List of IP addresses allowed to use this API key. + """ + managed_by: Optional[ManagedBy] + """ + Information about the entity managing this API key. + """ + name: Optional[str] + """ + Name of the API key. + """ + new_key: Optional[str] + """ + Unique identifier of the new API key, set when this key was rotated. + """ + note: Optional[str] + """ + Note or description for the API key. + """ + type: Literal["publishable_key", "secret_key"] + """ + Type of the API key. + """ + _inner_class_types = {"managed_by": ManagedBy} + + class UserInvite(StripeObject): + invited_user_email: str + """ + Email address of the invited user. + """ + roles: List[str] + """ + Roles assigned to the invited user. + """ + + class UserRoles(StripeObject): + new_roles: List[str] + """ + Roles the user has after the change. + """ + old_roles: List[str] + """ + Roles the user had before the change. + """ + user_email: str + """ + Email address of the user whose roles were changed. + """ + + api_key: Optional[ApiKey] + """ + Details of an API key action. + """ + type: Literal["api_key", "user_invite", "user_roles"] + """ + The action group type of the activity log entry. + """ + user_invite: Optional[UserInvite] + """ + Details of a user invite action. + """ + user_roles: Optional[UserRoles] + """ + Details of a user role change action. + """ + _inner_class_types = { + "api_key": ApiKey, + "user_invite": UserInvite, + "user_roles": UserRoles, + } + + actor: Actor + """ + The actor that performed the action. + """ + context: str + """ + The account on which the action was performed. + """ + created: str + """ + Timestamp when the activity log entry was created. + """ + details: Details + """ + Action-specific details of the activity log entry. + """ + id: str + """ + Unique identifier of the activity log entry. + """ + livemode: bool + """ + Whether the action was performed in live mode. + """ + object: Literal["v2.iam.activity_log"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + type: Literal[ + "api_key_created", + "api_key_deleted", + "api_key_updated", + "api_key_viewed", + "user_invite_accepted", + "user_invite_created", + "user_invite_deleted", + "user_roles_deleted", + "user_roles_updated", + ] + """ + The type of action that was performed. + """ + _inner_class_types = {"actor": Actor, "details": Details} diff --git a/stripe/v2/iam/_activity_log_service.py b/stripe/v2/iam/_activity_log_service.py new file mode 100644 index 000000000..67ab2c604 --- /dev/null +++ b/stripe/v2/iam/_activity_log_service.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.iam._activity_log_list_params import ( + ActivityLogListParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.iam._activity_log import ActivityLog + + +class ActivityLogService(StripeService): + def list( + self, + params: Optional["ActivityLogListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ActivityLog]": + """ + List activity logs of an account. + """ + return cast( + "ListObject[ActivityLog]", + self._request( + "get", + "/v2/iam/activity_logs", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ActivityLogListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ActivityLog]": + """ + List activity logs of an account. + """ + return cast( + "ListObject[ActivityLog]", + await self._request_async( + "get", + "/v2/iam/activity_logs", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_currency_conversion.py b/stripe/v2/money_management/_currency_conversion.py index 7c8e805c7..3babcd909 100644 --- a/stripe/v2/money_management/_currency_conversion.py +++ b/stripe/v2/money_management/_currency_conversion.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from stripe.v2._amount import Amount -from typing import ClassVar +from typing import ClassVar, Optional from typing_extensions import Literal @@ -35,7 +35,7 @@ class To(StripeObject): """ The exchange rate used when processing the CurrencyConversion. """ - financial_account: str + financial_account: Optional[str] """ The FinancialAccount the CurrencyConversion was performed on. """ diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index 1145c266c..16e1a0402 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.py @@ -45,6 +45,12 @@ class ManagedBy(StripeObject): Enum describing the Stripe product that is managing this FinancialAccount. """ + class MultiprocessorSettlement(StripeObject): + settlement_currencies: List[str] + """ + Settlement currencies enabled for this FinancialAccount. + """ + class Other(StripeObject): type: str """ @@ -201,6 +207,10 @@ class Storage(StripeObject): """ Metadata associated with the FinancialAccount. """ + multiprocessor_settlement: Optional[MultiprocessorSettlement] + """ + If this is a `multiprocessor_settlement` FinancialAccount, this hash includes details specific to `multiprocessor_settlement` FinancialAccounts. + """ object: Literal["v2.money_management.financial_account"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -225,7 +235,13 @@ class Storage(StripeObject): """ If this is a `storage` FinancialAccount, this hash includes details specific to `storage` FinancialAccounts. """ - type: Literal["accrued_fees", "other", "payments", "storage"] + type: Literal[ + "accrued_fees", + "multiprocessor_settlement", + "other", + "payments", + "storage", + ] """ Type of the FinancialAccount. An additional hash is included on the FinancialAccount with a name matching this value. It contains additional information specific to the FinancialAccount type. @@ -234,6 +250,7 @@ class Storage(StripeObject): "accrued_fees": AccruedFees, "balance": Balance, "managed_by": ManagedBy, + "multiprocessor_settlement": MultiprocessorSettlement, "other": Other, "payments": Payments, "status_details": StatusDetails, diff --git a/stripe/v2/money_management/_financial_address.py b/stripe/v2/money_management/_financial_address.py index e0830da7e..05fb794f8 100644 --- a/stripe/v2/money_management/_financial_address.py +++ b/stripe/v2/money_management/_financial_address.py @@ -15,6 +15,33 @@ class FinancialAddress(StripeObject): ) class Credentials(StripeObject): + class CaBankAccount(StripeObject): + account_holder_name: str + """ + The account holder name to be used during bank transfers. + """ + account_number: Optional[str] + """ + The account number of the Canadian Bank Account. + """ + bank_name: str + """ + The name of the Bank. + """ + institution_number: str + """ + The institution number of the Canadian Bank Account. + """ + last4: str + """ + The last four digits of the Canadian Bank Account number. This will always be returned. + To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. + """ + transit_number: str + """ + The transit number of the Canadian Bank Account. + """ + class GbBankAccount(StripeObject): account_holder_name: str """ @@ -125,6 +152,10 @@ class AccountHolderAddress(StripeObject): "account_holder_address": AccountHolderAddress, } + ca_bank_account: Optional[CaBankAccount] + """ + The credentials of the Canadian Bank Account for the FinancialAddress. This contains unique banking details such as the account number, institution number, etc. of a Canadian bank account. + """ gb_bank_account: Optional[GbBankAccount] """ The credentials of the UK Bank Account for the FinancialAddress. This contains unique banking details such as the sort code, account number, etc. of a UK bank account. @@ -134,7 +165,10 @@ class AccountHolderAddress(StripeObject): The credentials of the SEPA Bank Account for the FinancialAddress. This contains unique banking details such as the IBAN, BIC, etc. of a SEPA bank account. """ type: Literal[ - "gb_bank_account", "sepa_bank_account", "us_bank_account" + "ca_bank_account", + "gb_bank_account", + "sepa_bank_account", + "us_bank_account", ] """ Open Enum. The type of Credentials that are provisioned for the FinancialAddress. @@ -144,6 +178,7 @@ class AccountHolderAddress(StripeObject): The credentials of the US Bank Account for the FinancialAddress. This contains unique banking details such as the routing number, account number, etc. of a US bank account. """ _inner_class_types = { + "ca_bank_account": CaBankAccount, "gb_bank_account": GbBankAccount, "sepa_bank_account": SepaBankAccount, "us_bank_account": UsBankAccount, diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index 41cdd6808..7f56c36ac 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -31,7 +31,7 @@ class BankAccount(StripeObject): the /archive API, and they will not be automatically archived by Stripe. Archived PayoutMethodBankAccount objects cannot be used as payout methods and will not appear in the payout method list. """ - bank_account_type: Literal["checking", "savings"] + bank_account_type: Literal["checking", "futsu", "savings", "toza"] """ The type of bank account (checking or savings). """ @@ -125,6 +125,7 @@ class CryptoWallet(StripeObject): "polygon", "solana", "stellar", + "tempo", ] """ Which rail is being used to make an outbound money movement to this wallet. diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index 2acf9a9e0..27de0043e 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -44,6 +44,25 @@ class BalanceTransfer(StripeObject): """ class BankTransfer(StripeObject): + class CaBankAccount(StripeObject): + account_holder_name: Optional[str] + """ + The account holder name of the bank account the transfer was received from. + """ + bank_name: Optional[str] + """ + The bank name the transfer was received from. + """ + last4: Optional[str] + """ + The last 4 digits of the account number that originated the transfer. + Depending on the bank, this may instead be the last 4 digits of the return account number. + """ + network: Literal["acss"] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + class GbBankAccount(StripeObject): account_holder_name: Optional[str] """ @@ -110,6 +129,10 @@ class UsBankAccount(StripeObject): The routing number of the account that originated the transfer. """ + ca_bank_account: Optional[CaBankAccount] + """ + Hash containing the transaction bank details. Present if `origin_type` field value is `ca_bank_account`. + """ financial_address: str """ Financial Address on which funds for ReceivedCredit were received. @@ -119,7 +142,10 @@ class UsBankAccount(StripeObject): Hash containing the transaction bank details. Present if `origin_type` field value is `gb_bank_account`. """ origin_type: Literal[ - "gb_bank_account", "sepa_bank_account", "us_bank_account" + "ca_bank_account", + "gb_bank_account", + "sepa_bank_account", + "us_bank_account", ] """ Open Enum. Indicates the origin of source from which external funds originated from. @@ -137,6 +163,7 @@ class UsBankAccount(StripeObject): Hash containing the transaction bank details. Present if `origin_type` field value is `us_bank_account`. """ _inner_class_types = { + "ca_bank_account": CaBankAccount, "gb_bank_account": GbBankAccount, "sepa_bank_account": SepaBankAccount, "us_bank_account": UsBankAccount, diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index 1ea980ac0..8f942c594 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -240,7 +240,6 @@ class StatusTransitions(StripeObject): "received_debit_reversal", "refund", "refund_failure", - "return", "risk_reserved_funds", "stripe_balance_payment_debit", "stripe_balance_payment_debit_reversal", diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index 3b705a124..ba3fd3e33 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -216,7 +216,6 @@ class Flow(StripeObject): "received_debit_reversal", "refund", "refund_failure", - "return", "risk_reserved_funds", "stripe_balance_payment_debit", "stripe_balance_payment_debit_reversal", diff --git a/stripe/v2/network/__init__.py b/stripe/v2/network/__init__.py new file mode 100644 index 000000000..4ac4b5d31 --- /dev/null +++ b/stripe/v2/network/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.network._business_profile import ( + BusinessProfile as BusinessProfile, + ) + from stripe.v2.network._business_profile_service import ( + BusinessProfileService as BusinessProfileService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "BusinessProfile": ("stripe.v2.network._business_profile", False), + "BusinessProfileService": ( + "stripe.v2.network._business_profile_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/network/_business_profile.py b/stripe/v2/network/_business_profile.py new file mode 100644 index 000000000..e4fdaf557 --- /dev/null +++ b/stripe/v2/network/_business_profile.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class BusinessProfile(StripeObject): + """ + The Stripe profile represents a business' public identity on the Stripe network. + """ + + OBJECT_NAME: ClassVar[Literal["v2.network.business_profile"]] = ( + "v2.network.business_profile" + ) + + class Branding(StripeObject): + class Icon(StripeObject): + original: str + """ + The URL of the image in its original size. + """ + + class Logo(StripeObject): + original: str + """ + The URL of the image in its original size. + """ + + icon: Optional[Icon] + """ + URL of the icon for the business. The image will be square and at least 128px x 128px. + """ + logo: Optional[Logo] + """ + URL of the logo for the business. The image will be at least 128px x 128px. + """ + primary_color: Optional[str] + """ + A CSS hex color value representing the primary branding color for this business. + """ + secondary_color: Optional[str] + """ + A CSS hex color value representing the secondary branding color for this business. + """ + _inner_class_types = {"icon": Icon, "logo": Logo} + + branding: Optional[Branding] + """ + Branding data for the business. + """ + description: Optional[str] + """ + The description of the business. + """ + display_name: str + """ + The display name of the Stripe profile. + """ + id: str + """ + The ID of the Stripe business profile; also known as the Network ID. This is the ID used to identify the business on the Stripe network. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.network.business_profile"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + url: Optional[str] + """ + The URL of the business. + """ + username: str + """ + The username of the Stripe profile. + """ + _inner_class_types = {"branding": Branding} diff --git a/stripe/v2/network/_business_profile_service.py b/stripe/v2/network/_business_profile_service.py new file mode 100644 index 000000000..50b7f7f57 --- /dev/null +++ b/stripe/v2/network/_business_profile_service.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.network._business_profile_me_params import ( + BusinessProfileMeParams, + ) + from stripe.params.v2.network._business_profile_retrieve_params import ( + BusinessProfileRetrieveParams, + ) + from stripe.v2.network._business_profile import BusinessProfile + + +class BusinessProfileService(StripeService): + def me( + self, + params: Optional["BusinessProfileMeParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve the Stripe profile associated with the requesting merchant and livemode. + """ + return cast( + "BusinessProfile", + self._request( + "get", + "/v2/network/business_profiles/me", + base_address="api", + params=params, + options=options, + ), + ) + + async def me_async( + self, + params: Optional["BusinessProfileMeParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve the Stripe profile associated with the requesting merchant and livemode. + """ + return cast( + "BusinessProfile", + await self._request_async( + "get", + "/v2/network/business_profiles/me", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["BusinessProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve a Stripe profile by its Network ID. + """ + return cast( + "BusinessProfile", + self._request( + "get", + "/v2/network/business_profiles/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["BusinessProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve a Stripe profile by its Network ID. + """ + return cast( + "BusinessProfile", + await self._request_async( + "get", + "/v2/network/business_profiles/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/orchestrated_commerce/__init__.py b/stripe/v2/orchestrated_commerce/__init__.py new file mode 100644 index 000000000..12a9ea3f1 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.orchestrated_commerce._agreement import ( + Agreement as Agreement, + ) + from stripe.v2.orchestrated_commerce._agreement_service import ( + AgreementService as AgreementService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Agreement": ("stripe.v2.orchestrated_commerce._agreement", False), + "AgreementService": ( + "stripe.v2.orchestrated_commerce._agreement_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/orchestrated_commerce/_agreement.py b/stripe/v2/orchestrated_commerce/_agreement.py new file mode 100644 index 000000000..56f073d40 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/_agreement.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class Agreement(StripeObject): + """ + An Orchestrated Commerce Agreement represents a mutual agreement between a seller and an orchestrator/agent on the Stripe network. + """ + + OBJECT_NAME: ClassVar[Literal["v2.orchestrated_commerce.agreement"]] = ( + "v2.orchestrated_commerce.agreement" + ) + + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + class StatusTransitions(StripeObject): + orchestrator_confirmed_at: Optional[str] + """ + The time at which the orchestrator confirmed the agreement. + """ + seller_confirmed_at: Optional[str] + """ + The time at which the seller confirmed the agreement. + """ + terminated_at: Optional[str] + """ + The time at which the agreement was terminated. + """ + + created: str + """ + The time at which the agreement was created. + """ + id: str + """ + The unique identifier for the agreement. + """ + initiated_by: Literal["orchestrator", "seller"] + """ + The party that initiated the agreement. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.orchestrated_commerce.agreement"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + status: Literal[ + "confirmed", "initiated", "partially_confirmed", "terminated" + ] + """ + The current status of the agreement. + """ + status_transitions: StatusTransitions + """ + Timestamps of key status transitions for the agreement. + """ + terminated_by: Optional[Literal["orchestrator", "seller"]] + """ + The party that terminated the agreement, if applicable. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + "status_transitions": StatusTransitions, + } diff --git a/stripe/v2/orchestrated_commerce/_agreement_service.py b/stripe/v2/orchestrated_commerce/_agreement_service.py new file mode 100644 index 000000000..f9d442497 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/_agreement_service.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.orchestrated_commerce._agreement_confirm_params import ( + AgreementConfirmParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_create_params import ( + AgreementCreateParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_list_params import ( + AgreementListParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_retrieve_params import ( + AgreementRetrieveParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_terminate_params import ( + AgreementTerminateParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class AgreementService(StripeService): + def list( + self, + params: Optional["AgreementListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Agreement]": + """ + List Agreements for the profile associated with the authenticated merchant. + """ + return cast( + "ListObject[Agreement]", + self._request( + "get", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["AgreementListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Agreement]": + """ + List Agreements for the profile associated with the authenticated merchant. + """ + return cast( + "ListObject[Agreement]", + await self._request_async( + "get", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "AgreementCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Create a new Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "AgreementCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Create a new Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["AgreementRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Retrieve an Agreement by ID. + """ + return cast( + "Agreement", + self._request( + "get", + "/v2/orchestrated_commerce/agreements/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["AgreementRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Retrieve an Agreement by ID. + """ + return cast( + "Agreement", + await self._request_async( + "get", + "/v2/orchestrated_commerce/agreements/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def confirm( + self, + id: str, + params: Optional["AgreementConfirmParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Confirm an Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements/{id}/confirm".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_async( + self, + id: str, + params: Optional["AgreementConfirmParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Confirm an Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements/{id}/confirm".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def terminate( + self, + id: str, + params: Optional["AgreementTerminateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Terminate an Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements/{id}/terminate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def terminate_async( + self, + id: str, + params: Optional["AgreementTerminateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Terminate an Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements/{id}/terminate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/payments/_off_session_payment.py b/stripe/v2/payments/_off_session_payment.py index 6396aca9d..0214ab388 100644 --- a/stripe/v2/payments/_off_session_payment.py +++ b/stripe/v2/payments/_off_session_payment.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe.v2._amount import Amount -from typing import ClassVar, Optional +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -20,6 +20,107 @@ class OffSessionPayment(StripeObject): "v2.payments.off_session_payment" ) + class AmountDetails(StripeObject): + class Error(StripeObject): + code: Optional[ + Literal[ + "amount_details_amount_mismatch", + "amount_details_amount_greater_than_tax_shipping_discount", + ] + ] + """ + The code of the error that occurred when validating the current amount details. + """ + message: Optional[str] + """ + A message providing more details about the error. + """ + + class LineItem(StripeObject): + class Tax(StripeObject): + total_tax_amount: Optional[int] + """ + Total portion of the amount that is for tax. + """ + + discount_amount: Optional[int] + """ + The amount an item was discounted for. Positive integer. + """ + product_code: Optional[str] + """ + Unique identifier of the product. At most 12 characters long. + """ + product_name: str + """ + Name of the product. At most 100 characters long. + """ + quantity: int + """ + Number of items of the product. Positive integer. + """ + tax: Optional[Tax] + """ + Contains information about the tax on the item. + """ + unit_cost: int + """ + Cost of the product. Non-negative integer. + """ + unit_of_measure: Optional[str] + """ + Unit of measure for the product. At most 12 characters long. + """ + _inner_class_types = {"tax": Tax} + + class Shipping(StripeObject): + amount: Optional[int] + """ + Portion of the amount that is for shipping. + """ + from_postal_code: Optional[str] + """ + The postal code that represents the shipping source. + """ + to_postal_code: Optional[str] + """ + The postal code that represents the shipping destination. + """ + + class Tax(StripeObject): + total_tax_amount: Optional[int] + """ + Total portion of the amount that is for tax. + """ + + discount_amount: Optional[int] + """ + The amount the total transaction was discounted for. + """ + error: Optional[Error] + """ + Contains information about the error that occurred when validating the current amount details. + This field populates when the amount details has a validation error that wasn't enforced because the [enforce_arithmetic_validation](https://docs.corp.stripe.com/api/payment_intents/create#create_payment_intent-amount_details-enforce_arithmetic_validation) parameter was set to `false`. + """ + line_items: List[LineItem] + """ + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 100 line items. + """ + shipping: Optional[Shipping] + """ + Contains information about the shipping portion of the amount. + """ + tax: Optional[Tax] + """ + Contains information about the tax portion of the amount. + """ + _inner_class_types = { + "error": Error, + "line_items": LineItem, + "shipping": Shipping, + "tax": Tax, + } + class Capture(StripeObject): capture_before: Optional[str] """ @@ -30,6 +131,17 @@ class Capture(StripeObject): The method to use to capture the payment. """ + class PaymentDetails(StripeObject): + customer_reference: Optional[str] + """ + A unique value to identify the customer. This field is applicable only for card payments. For card payments, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + order_reference: Optional[str] + """ + A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates. + For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + class PaymentsOrchestration(StripeObject): enabled: bool """ @@ -75,6 +187,10 @@ class TransferData(StripeObject): """ The amount available to be captured. """ + amount_details: Optional[AmountDetails] + """ + Provides industry-specific information about the amount. + """ amount_requested: Amount """ The “presentment amount” to be collected from the customer. @@ -100,6 +216,10 @@ class TransferData(StripeObject): """ ID of the Customer to which this OffSessionPayment belongs. """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ failure_reason: Optional[ Literal[ "authorization_expired", @@ -143,6 +263,10 @@ class TransferData(StripeObject): """ The account (if any) for which the funds of the OffSessionPayment are intended. """ + payment_details: Optional[PaymentDetails] + """ + Provides industry-specific information about the payment. + """ payment_method: str """ ID of the payment method used in this OffSessionPayment. @@ -195,7 +319,9 @@ class TransferData(StripeObject): The data that automatically creates a Transfer after the payment finalizes. Learn more about the use case for [connected accounts](https://docs.stripe.com/payments/connected-accounts). """ _inner_class_types = { + "amount_details": AmountDetails, "capture": Capture, + "payment_details": PaymentDetails, "payments_orchestration": PaymentsOrchestration, "retry_details": RetryDetails, "transfer_data": TransferData, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index a89c27419..9e741d1a9 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -45843,6 +45843,74 @@ def test_v2_billing_service_action_post_2_service( is_json=True, ) + def test_v2_commerce_product_catalog_import_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/commerce/product_catalog/imports", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.list() + http_client_mock.assert_requested( + "get", + path="/v2/commerce/product_catalog/imports", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_commerce_product_catalog_import_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/commerce/product_catalog/imports", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.create( + { + "feed_type": "pricing", + "metadata": {"key": "metadata"}, + "mode": "upsert", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/commerce/product_catalog/imports", + query_string="", + api_base="https://api.stripe.com", + post_data='{"feed_type":"pricing","metadata":{"key":"metadata"},"mode":"upsert"}', + is_json=True, + ) + + def test_v2_commerce_product_catalog_import_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/commerce/product_catalog/imports/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/commerce/product_catalog/imports/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_account_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46240,6 +46308,112 @@ def test_v2_core_account_token_get_service( api_base="https://api.stripe.com", ) + def test_v2_core_approval_request_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/approval_requests", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.approval_requests.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/approval_requests", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_approval_request_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/approval_requests/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.approval_requests.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/approval_requests/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_approval_request_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/approval_requests/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.approval_requests.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/approval_requests/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_approval_request_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/approval_requests/id_123/execute", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.approval_requests.execute("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/approval_requests/id_123/execute", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_approval_request_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/approval_requests/id_123/submit", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.approval_requests.submit("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/approval_requests/id_123/submit", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_core_batch_job_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46255,7 +46429,7 @@ def test_v2_core_batch_job_post_service( client.v2.core.batch_jobs.create( { "endpoint": { - "http_method": "post", + "http_method": "delete", "path": "/v1/subscription_schedules", }, "metadata": {"key": "metadata"}, @@ -46267,7 +46441,7 @@ def test_v2_core_batch_job_post_service( path="/v2/core/batch_jobs", query_string="", api_base="https://api.stripe.com", - post_data='{"endpoint":{"http_method":"post","path":"/v1/subscription_schedules"},"metadata":{"key":"metadata"},"skip_validation":true}', + post_data='{"endpoint":{"http_method":"delete","path":"/v1/subscription_schedules"},"metadata":{"key":"metadata"},"skip_validation":true}', is_json=True, ) @@ -46328,6 +46502,7 @@ def test_v2_core_claimable_sandbox_post_service( client.v2.core.claimable_sandboxes.create( { "enable_mcp_access": True, + "onboarding_link_details": {"refresh_url": "refresh_url"}, "prefill": { "country": "country", "email": "email", @@ -46340,7 +46515,7 @@ def test_v2_core_claimable_sandbox_post_service( path="/v2/core/claimable_sandboxes", query_string="", api_base="https://api.stripe.com", - post_data='{"enable_mcp_access":true,"prefill":{"country":"country","email":"email","name":"name"}}', + post_data='{"enable_mcp_access":true,"onboarding_link_details":{"refresh_url":"refresh_url"},"prefill":{"country":"country","email":"email","name":"name"}}', is_json=True, ) @@ -46364,6 +46539,28 @@ def test_v2_core_claimable_sandbox_get_service( api_base="https://api.stripe.com", ) + def test_v2_core_claimable_sandbox_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/claimable_sandboxes/id_123/renew_onboarding_link", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.claimable_sandboxes.renew_onboarding_link("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/claimable_sandboxes/id_123/renew_onboarding_link", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_core_connection_session_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46910,60 +47107,101 @@ def test_v2_core_vault_us_bank_account_post_5_service( is_json=True, ) - def test_v2_core_workflow_get_service( + def test_v2_data_reporting_query_run_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/data/reporting/query_runs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.data.reporting.query_runs.create({"sql": "sql"}) + http_client_mock.assert_requested( + "post", + path="/v2/data/reporting/query_runs", + query_string="", + api_base="https://api.stripe.com", + post_data='{"sql":"sql"}', + is_json=True, + ) + + def test_v2_data_reporting_query_run_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/core/workflows", - "status[0]=draft", + "/v2/data/reporting/query_runs/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.workflows.list({"status": ["draft"]}) + client.v2.data.reporting.query_runs.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/core/workflows", - query_string="status[0]=draft", + path="/v2/data/reporting/query_runs/id_123", + query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_workflow_get_2_service( + def test_v2_extend_workflow_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/core/workflows/id_123", + "/v2/extend/workflows", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.workflows.retrieve("id_123") + client.v2.extend.workflows.list() http_client_mock.assert_requested( "get", - path="/v2/core/workflows/id_123", + path="/v2/extend/workflows", query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_workflow_post_service( + def test_v2_extend_workflow_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/extend/workflows/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflows.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/extend/workflows/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_extend_workflow_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/workflows/id_123/invoke", + "/v2/extend/workflows/id_123/invoke", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.workflows.invoke( + client.v2.extend.workflows.invoke( "id_123", { "input_parameters": { @@ -46981,97 +47219,69 @@ def test_v2_core_workflow_post_service( ) http_client_mock.assert_requested( "post", - path="/v2/core/workflows/id_123/invoke", + path="/v2/extend/workflows/id_123/invoke", query_string="", api_base="https://api.stripe.com", post_data='{"input_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', is_json=True, ) - def test_v2_core_workflow_run_get_service( + def test_v2_extend_workflow_run_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/core/workflow_runs", - "status[0]=failed&workflow[0]=workflow", + "/v2/extend/workflow_runs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.workflow_runs.list( - { - "status": ["failed"], - "workflow": ["workflow"], - } - ) + client.v2.extend.workflow_runs.list() http_client_mock.assert_requested( "get", - path="/v2/core/workflow_runs", - query_string="status[0]=failed&workflow[0]=workflow", + path="/v2/extend/workflow_runs", + query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_workflow_run_get_2_service( + def test_v2_extend_workflow_run_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/core/workflow_runs/id_123", + "/v2/extend/workflow_runs/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.workflow_runs.retrieve("id_123") + client.v2.extend.workflow_runs.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/core/workflow_runs/id_123", + path="/v2/extend/workflow_runs/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_data_reporting_query_run_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/data/reporting/query_runs", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.data.reporting.query_runs.create({"sql": "sql"}) - http_client_mock.assert_requested( - "post", - path="/v2/data/reporting/query_runs", - query_string="", - api_base="https://api.stripe.com", - post_data='{"sql":"sql"}', - is_json=True, - ) - - def test_v2_data_reporting_query_run_get_service( + def test_v2_iam_activity_log_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/data/reporting/query_runs/id_123", + "/v2/iam/activity_logs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.data.reporting.query_runs.retrieve("id_123") + client.v2.iam.activity_logs.list() http_client_mock.assert_requested( "get", - path="/v2/data/reporting/query_runs/id_123", + path="/v2/iam/activity_logs", query_string="", api_base="https://api.stripe.com", ) @@ -47278,7 +47488,6 @@ def test_v2_money_management_currency_conversion_post_service( client.v2.money_management.currency_conversions.create( { - "financial_account": "financial_account", "from": { "amount": {"currency": "USD", "value": 96}, "currency": "usd", @@ -47294,7 +47503,7 @@ def test_v2_money_management_currency_conversion_post_service( path="/v2/money_management/currency_conversions", query_string="", api_base="https://api.stripe.com", - post_data='{"financial_account":"financial_account","from":{"amount":{"currency":"USD","value":96},"currency":"usd"},"to":{"amount":{"currency":"USD","value":96},"currency":"usd"}}', + post_data='{"from":{"amount":{"currency":"USD","value":96},"currency":"usd"},"to":{"amount":{"currency":"USD","value":96},"currency":"usd"}}', is_json=True, ) @@ -47463,7 +47672,7 @@ def test_v2_money_management_financial_address_post_service( client.v2.money_management.financial_addresses.create( { "financial_account": "financial_account", - "type": "gb_bank_account", + "type": "sepa_bank_account", } ) http_client_mock.assert_requested( @@ -47471,7 +47680,7 @@ def test_v2_money_management_financial_address_post_service( path="/v2/money_management/financial_addresses", query_string="", api_base="https://api.stripe.com", - post_data='{"financial_account":"financial_account","type":"gb_bank_account"}', + post_data='{"financial_account":"financial_account","type":"sepa_bank_account"}', is_json=True, ) @@ -48254,6 +48463,156 @@ def test_v2_money_management_transaction_entry_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_network_business_profile_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/network/business_profiles/me", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.network.business_profiles.me() + http_client_mock.assert_requested( + "get", + path="/v2/network/business_profiles/me", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_network_business_profile_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/network/business_profiles/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.network.business_profiles.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/network/business_profiles/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/orchestrated_commerce/agreements", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.list() + http_client_mock.assert_requested( + "get", + path="/v2/orchestrated_commerce/agreements", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.create( + { + "orchestrator": "orchestrator", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements", + query_string="", + api_base="https://api.stripe.com", + post_data='{"orchestrator":"orchestrator"}', + is_json=True, + ) + + def test_v2_orchestrated_commerce_agreement_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/orchestrated_commerce/agreements/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/orchestrated_commerce/agreements/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements/id_123/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.confirm("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements/id_123/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_orchestrated_commerce_agreement_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements/id_123/terminate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.terminate("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements/id_123/terminate", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_payments_off_session_payment_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -48882,14 +49241,14 @@ def test_v2_test_helpers_financial_address_post_service( client.v2.test_helpers.financial_addresses.credit( "id_123", - {"amount": {"currency": "USD", "value": 96}, "network": "ach"}, + {"amount": {"currency": "USD", "value": 96}, "network": "fps"}, ) http_client_mock.assert_requested( "post", path="/v2/test_helpers/financial_addresses/id_123/credit", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"network":"ach"}', + post_data='{"amount":{"currency":"USD","value":96},"network":"fps"}', is_json=True, ) @@ -49039,7 +49398,7 @@ def test_cannot_proceed_error_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/payout_methods/id_123/archive", + "/v2/extend/workflows/id_123/invoke", rbody='{"error":{"type":"cannot_proceed","code":"default_payout_method_cannot_be_archived"}}', rcode=400, ) @@ -49049,15 +49408,30 @@ def test_cannot_proceed_error_service( ) try: - client.v2.money_management.payout_methods.archive("id_123") + client.v2.extend.workflows.invoke( + "id_123", + { + "input_parameters": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + }, + ) except _error.CannotProceedError: pass http_client_mock.assert_requested( "post", - path="/v2/money_management/payout_methods/id_123/archive", + path="/v2/extend/workflows/id_123/invoke", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"input_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', is_json=True, ) @@ -49132,7 +49506,6 @@ def test_feature_not_enabled_error_service( try: client.v2.money_management.currency_conversions.create( { - "financial_account": "financial_account", "from": {}, "to": {}, } @@ -49144,7 +49517,7 @@ def test_feature_not_enabled_error_service( path="/v2/money_management/currency_conversions", query_string="", api_base="https://api.stripe.com", - post_data='{"financial_account":"financial_account","from":{},"to":{}}', + post_data='{"from":{},"to":{}}', is_json=True, ) @@ -49166,7 +49539,7 @@ def test_financial_account_not_open_error_service( client.v2.money_management.financial_addresses.create( { "financial_account": "financial_account", - "type": "gb_bank_account", + "type": "sepa_bank_account", } ) except _error.FinancialAccountNotOpenError: @@ -49176,7 +49549,39 @@ def test_financial_account_not_open_error_service( path="/v2/money_management/financial_addresses", query_string="", api_base="https://api.stripe.com", - post_data='{"financial_account":"financial_account","type":"gb_bank_account"}', + post_data='{"financial_account":"financial_account","type":"sepa_bank_account"}', + is_json=True, + ) + + def test_fx_quote_expired_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/currency_conversions", + rbody='{"error":{"type":"fx_quote_expired","code":"currency_conversion_fx_quote_expired"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.currency_conversions.create( + { + "from": {}, + "to": {}, + } + ) + except _error.FxQuoteExpiredError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/currency_conversions", + query_string="", + api_base="https://api.stripe.com", + post_data='{"from":{},"to":{}}', is_json=True, )