diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f59e56c82..0d22d0a82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,11 +109,17 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + - name: Read OpenAPI version + id: openapi + shell: bash + run: echo "version=$(< OPENAPI_VERSION)" >> "$GITHUB_OUTPUT" - name: Set up Python ${{ matrix.python_version }} uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python_version }} - uses: stripe/openapi/actions/stripe-mock@master + with: + openapi_version: ${{ steps.openapi.outputs.version }} - name: "run tests" run: just test diff --git a/.hark/changes/2026-09-30_stripe-openapi_4e2adbf1.change.md b/.hark/changes/2026-09-30_stripe-openapi_4e2adbf1.change.md new file mode 100644 index 000000000..98e907f00 --- /dev/null +++ b/.hark/changes/2026-09-30_stripe-openapi_4e2adbf1.change.md @@ -0,0 +1,98 @@ +--- +title: Update generated code +pr_url: https://github.com/stripe/stripe-python/pull/1892 +semver_level: major +is_stripe_api_change: true +--- + +* Add support for new resources `radar.BillingEvaluation`, `v2.money_management.FinancialAddressCreditSimulation`, and `v2.money_management.FinancialAddressGeneratedMicrodeposits` +* ⚠️ Remove support for resources `v2.FinancialAddressCreditSimulation` and `v2.FinancialAddressGeneratedMicrodeposits` +* Add support for `create` method on resource `radar.BillingEvaluation` +* Add support for `list` method on resource `reserve.Plan` +* Add support for `credit` method on resource `v2.money_management.FinancialAddressCreditSimulation` +* Add support for `generate_microdeposits` method on resource `v2.money_management.FinancialAddressGeneratedMicrodeposits` +* ⚠️ Remove support for `credit` method on resource `v2.FinancialAddressCreditSimulation` +* ⚠️ Remove support for `generate_microdeposits` method on resource `v2.FinancialAddressGeneratedMicrodeposits` +* Change `Tax.CalculationLineItem.performance_location` and `TaxCode.Requirement.performance_location` to be required +* Change `Account.BusinessProfile.specified_commercial_transactions_act_url` to be required +* Add support for `after_expiration` on `BillingPortal.Session` and `billing_portal.SessionCreateParams` +* Add support for new value `fundbox_ca_financing` on enums `Capital.FinancingOffer.disclaimer_variant` and `Capital.FinancingSummary.Detail.disclaimer_variant` +* Add support for `setup_credential_usage` on `Charge.PaymentMethodDetail.Card`, `PaymentIntent.PaymentMethodOption.Card`, `PaymentIntentConfirmParamsPaymentMethodOptionCard`, `PaymentIntentCreateParamsPaymentMethodOptionCard`, `PaymentIntentModifyParamsPaymentMethodOptionCard`, `SetupIntent.PaymentMethodOption.Card`, `SetupIntentConfirmParamsPaymentMethodOptionCard`, `SetupIntentCreateParamsPaymentMethodOptionCard`, and `SetupIntentModifyParamsPaymentMethodOptionCard` +* Add support for `stored_credential_usage` on `Charge.PaymentMethodDetail.Card`, `PaymentAttemptRecord.PaymentMethodDetail.Card`, `PaymentIntent.PaymentMethodOption.Card`, `PaymentIntentConfirmParamsPaymentMethodOptionCard`, `PaymentIntentCreateParamsPaymentMethodOptionCard`, `PaymentIntentModifyParamsPaymentMethodOptionCard`, and `PaymentRecord.PaymentMethodDetail.Card` +* Add support for `expires_at` on `Subscription.PaymentSetting.PaymentMethodOption.Blik.MandateOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOptionBlikMandateOption`, `SubscriptionModifyParamsPaymentSettingPaymentMethodOptionBlikMandateOption`, and `checkout.SessionCreateParamsPaymentMethodOptionBlikMandateOption` +* ⚠️ Remove support for `expires_after` on `Subscription.PaymentSetting.PaymentMethodOption.Blik.MandateOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOptionBlikMandateOption`, `SubscriptionModifyParamsPaymentSettingPaymentMethodOptionBlikMandateOption`, and `checkout.SessionCreateParamsPaymentMethodOptionBlikMandateOption` +* ⚠️ Remove support for value `on_session` from enum `checkout.SessionCreateParamsPaymentMethodOptionBlik.setup_future_usage` +* Add support for `payment_intent_data` on `checkout.SessionModifyParams` +* Add support for `appeal` on `Dispute.Evidence` and `DisputeModifyParamsEvidence` +* Add support for `livemode` on `FxQuote` +* ⚠️ Remove support for `capture_method` on `PaymentIntentConfirmParamsPaymentMethodOptionPaypay`, `PaymentIntentCreateParamsPaymentMethodOptionPaypay`, and `PaymentIntentModifyParamsPaymentMethodOptionPaypay` +* Add support for `active` on `ProductCatalog.TrialOffer`, `product_catalog.TrialOfferCreateParams`, and `product_catalog.TrialOfferListParams` +* Add support for `nickname` on `ProductCatalog.TrialOffer` and `product_catalog.TrialOfferCreateParams` +* ⚠️ Remove support for `name` on `ProductCatalog.TrialOffer` and `product_catalog.TrialOfferCreateParams` +* ⚠️ Change `ProductCatalog.TrialOffer.EndBehavior.transition` to be optional +* Change `Product.tax_details` to be required +* Add support for `status_details` on `QuotePreviewInvoice` +* Add support for `company_details` and `reference` on `QuotePreviewInvoice.PaymentSetting.PaymentMethodOption.Billie` +* Add support for `pause_schedules` on `QuotePreviewSubscriptionSchedule` +* Add support for `destination` on `Reserve.Hold`, `Reserve.Plan`, and `Reserve.Release` +* Add support for `manual_release` on `Reserve.Plan` +* ⚠️ Add support for new value `other` on enum `Reserve.Plan.status` +* ⚠️ Add support for new values `manual_release` and `other` on enum `Reserve.Plan.type` +* ⚠️ Add support for new value `hold_expired` on enum `Reserve.Release.reason` +* ⚠️ Remove support for value `bulk_hold_expiry` from enum `Reserve.Release.reason` +* Change `SubscriptionItem.current_trial` to be required +* Add support for new values `final_payment_failure` and `first_payment_failure` on enum `Subscription.StatusDetail.Paused.Subscription.type` +* Change `Subscription.TrialSetting.EndBehavior.billing_cycle_anchor` to be required +* Add support for new value `igic` on enums `Tax.Registration.CountryOption.E.type` and `tax.RegistrationCreateParamsCountryOptionE.type` +* Change `TaxCode.requirements` to be required +* ⚠️ Remove support for `configurations` on `V2.Core.AccountLink.UseCase.AccountOnboarding`, `V2.Core.AccountLink.UseCase.AccountUpdate`, `v2.core.AccountLinkCreateParamsUseCaseAccountOnboarding`, and `v2.core.AccountLinkCreateParamsUseCaseAccountUpdate` +* ⚠️ Add support for new value `rejected` on enums `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Aud.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Cad.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Eur.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Gbp.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Usd.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Aud.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Cad.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Eur.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Gbp.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Usd.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.InboundTransfer.BankAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.BankAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.Card.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.FinancialAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundTransfer.BankAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundTransfer.FinancialAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.ReceivedCredit.BankAccount.status`, `V2.Core.Account.Configuration.MoneyManager.Capability.ReceivedDebit.BankAccount.status`, `V2.Core.Account.Configuration.Recipient.Capability.BankAccount.Local.status`, `V2.Core.Account.Configuration.Recipient.Capability.BankAccount.Wire.status`, and `V2.Core.Account.Configuration.Recipient.Capability.Card.status` +* ⚠️ Add support for new values `rejected_fraud`, `rejected_incomplete_verification`, `rejected_listed`, `rejected_other`, `rejected_platform_fraud`, `rejected_platform_other`, `rejected_platform_terms_of_service`, and `rejected_terms_of_service` on enums `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Aud.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Cad.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Eur.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Gbp.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Inbound.Usd.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Aud.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Cad.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Eur.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Gbp.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.BusinessStorage.Outbound.Usd.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.InboundTransfer.BankAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.BankAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.Card.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundPayment.FinancialAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundTransfer.BankAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.OutboundTransfer.FinancialAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.ReceivedCredit.BankAccount.StatusDetail.code`, `V2.Core.Account.Configuration.MoneyManager.Capability.ReceivedDebit.BankAccount.StatusDetail.code`, `V2.Core.Account.Configuration.Recipient.Capability.BankAccount.Local.StatusDetail.code`, `V2.Core.Account.Configuration.Recipient.Capability.BankAccount.Wire.StatusDetail.code`, and `V2.Core.Account.Configuration.Recipient.Capability.Card.StatusDetail.code` +* Add support for `related_object` and `request` on `V2.Iam.ActivityLog` +* ⚠️ Add support for new value `stripe_action` on enum `V2.Iam.ActivityLog.Actor.type` +* Add support for `account_security`, `authentication`, `scim`, `sso`, and `user_profile` on `V2.Iam.ActivityLog.Detail` +* Add support for new values `account_security`, `authentication`, `issuing`, `payout`, `scim`, `sso`, and `user_profile` on enum `V2.Iam.ActivityLog.Detail.type` +* Add support for new values `anomaly_detection_settings_updated`, `issuing_activated`, `issuing_balance_transfer_created`, `issuing_card_created`, `issuing_card_sensitive_details_viewed`, `issuing_card_updated`, `issuing_cardholder_created`, `issuing_cardholder_updated`, `issuing_dispute_created`, `issuing_dispute_submitted`, `issuing_dispute_updated`, `manual_payouts_disabled`, `manual_payouts_enabled`, `payout_destination_added`, `payout_destination_removed`, `payout_destination_updated`, `payout_schedule_edits_disabled`, `payout_schedule_edits_enabled`, `scim_group_deleted`, `scim_group_member_added`, `scim_group_member_removed`, `scim_group_roles_updated`, `scim_group_updated`, `sso_domain_verified`, `sso_settings_created`, `sso_settings_deleted`, `sso_settings_updated`, `two_step_authentication_mandate_disabled`, `two_step_authentication_mandate_enabled`, `user_auth_challenge_failed`, `user_email_changed`, `user_email_verified`, `user_express_phone_number_changed`, `user_google_account_connected`, `user_google_account_disconnected`, `user_passkey_added`, `user_passkey_removed`, `user_passkey_updated`, `user_passkey_upgraded`, `user_password_changed`, `user_password_initialized`, `user_password_reset_failed`, `user_password_reset_requested`, `user_password_reset_succeeded`, `user_two_step_authentication_backup_code_used`, `user_two_step_authentication_method_added`, `user_two_step_authentication_method_removed`, `user_two_step_authentication_method_reset`, `user_two_step_authentication_method_updated`, and `user_two_step_authentication_reset_requested` on enum `V2.Iam.ActivityLog.type` +* Add support for `deposit_insurance_eligibility` on `V2.MoneyManagement.FinancialAccount.Storage` and `v2.money_management.FinancialAccountCreateParamsStorage` +* Add support for `bank_account` on `V2.MoneyManagement.FinancialAddress` and `v2.money_management.FinancialAddressCreateParams` +* Add support for `type` on `V2.MoneyManagement.FinancialAddress` +* ⚠️ Remove support for `credentials` and `currency` on `V2.MoneyManagement.FinancialAddress` +* ⚠️ Remove support for `level` on `V2.MoneyManagement.InboundTransfer.TransferHistory` +* Add support for `network_fee_details` on `V2.MoneyManagement.OutboundPaymentQuote.EstimatedFee` +* Add support for new value `network_fee` on enum `V2.MoneyManagement.OutboundPaymentQuote.EstimatedFee.type` +* Add support for `archived` on `V2.MoneyManagement.PayoutMethod` +* ⚠️ Remove support for `archived` on `V2.MoneyManagement.PayoutMethod.BankAccount` and `V2.MoneyManagement.PayoutMethod.Card` +* ⚠️ Add support for new value `ineligible` on enum `V2.MoneyManagement.PayoutMethod.UsageStatus.payments` +* ⚠️ Add support for new value `ineligible` on enum `V2.MoneyManagement.PayoutMethod.UsageStatus.transfers` +* Add support for `amount_received` on `V2.MoneyManagement.ReceivedCredit` +* Add support for `originating_bank_account` on `V2.MoneyManagement.ReceivedCredit.BankTransfer` +* ⚠️ Remove support for `origin_type` on `V2.MoneyManagement.ReceivedCredit.BankTransfer` +* Add support for `identity` on `V2.Signals.AccountActivity.AccountDetail.Datum`, `V2.Signals.AccountEvaluation.AccountDetail.Datum`, `v2.signals.AccountActivityCreateParamsAccountDetailData`, and `v2.signals.AccountEvaluationCreateParamsAccountDetailData` +* Add support for `fraudulent_website` on `V2.Signals.AccountEvaluation.EvaluatedSignal` and `V2.Signals.AccountSignal` +* Add support for new value `fraudulent_website` on enum `V2.Signals.AccountEvaluation.pending_signals` +* Add support for new value `fraudulent_website` on enums `V2.Signals.AccountEvaluation.requested_signals` and `v2.signals.AccountEvaluationCreateParams.requested_signals` +* Add support for `fraudulent_merchant` on `V2.Signals.AccountSignal` +* Add support for new values `fraudulent_merchant` and `fraudulent_website` on enums `V2.Signals.AccountSignal.type` and `v2.signals.AccountSignalListParams.type` +* ⚠️ Remove support for `created_gt`, `created_gte`, `created_lt`, and `created_lte` on `v2.money_management.AdjustmentListParams`, `v2.money_management.InboundTransferListParams`, `v2.money_management.ReceivedCreditListParams`, `v2.money_management.TransactionEntryListParams`, and `v2.money_management.TransactionListParams` +* ⚠️ Change type of `v2.money_management.AdjustmentListParams.created`, `v2.money_management.InboundTransferListParams.created`, `v2.money_management.ReceivedCreditListParams.created`, `v2.money_management.TransactionEntryListParams.created`, and `v2.money_management.TransactionListParams.created` from `DateTime` to `an object` +* Add support for new value `ineligible` on enum `v2.money_management.PayoutMethodListParamsUsageStatus.payments` +* Add support for new value `ineligible` on enum `v2.money_management.PayoutMethodListParamsUsageStatus.transfers` +* ⚠️ Remove support for `include` on `v2.money_management.FinancialAddressListParams` and `v2.money_management.FinancialAddressRetrieveParams` +* Add support for `settlement_currency` on `v2.money_management.FinancialAddressCreateParams` +* ⚠️ Add support for new value `bank_account` on enum `v2.money_management.FinancialAddressCreateParams.type` +* ⚠️ Remove support for values `gb_bank_account` and `us_bank_account` from enum `v2.money_management.FinancialAddressCreateParams.type` +* Add support for `include` on `v2.money_management.FinancialAccountListParams` and `v2.money_management.FinancialAccountRetrieveParams` +* Add support for new values `account_security`, `authentication`, `issuing`, `payout`, `scim`, `sso`, and `user_profile` on enum `v2.iam.ActivityLogListParams.action_groups` +* Add support for new values `anomaly_detection_settings_updated`, `issuing_activated`, `issuing_balance_transfer_created`, `issuing_card_created`, `issuing_card_sensitive_details_viewed`, `issuing_card_updated`, `issuing_cardholder_created`, `issuing_cardholder_updated`, `issuing_dispute_created`, `issuing_dispute_submitted`, `issuing_dispute_updated`, `manual_payouts_disabled`, `manual_payouts_enabled`, `payout_destination_added`, `payout_destination_removed`, `payout_destination_updated`, `payout_schedule_edits_disabled`, `payout_schedule_edits_enabled`, `scim_group_deleted`, `scim_group_member_added`, `scim_group_member_removed`, `scim_group_roles_updated`, `scim_group_updated`, `sso_domain_verified`, `sso_settings_created`, `sso_settings_deleted`, `sso_settings_updated`, `two_step_authentication_mandate_disabled`, `two_step_authentication_mandate_enabled`, `user_auth_challenge_failed`, `user_email_changed`, `user_email_verified`, `user_express_phone_number_changed`, `user_google_account_connected`, `user_google_account_disconnected`, `user_passkey_added`, `user_passkey_removed`, `user_passkey_updated`, `user_passkey_upgraded`, `user_password_changed`, `user_password_initialized`, `user_password_reset_failed`, `user_password_reset_requested`, `user_password_reset_succeeded`, `user_two_step_authentication_backup_code_used`, `user_two_step_authentication_method_added`, `user_two_step_authentication_method_removed`, `user_two_step_authentication_method_reset`, `user_two_step_authentication_method_updated`, and `user_two_step_authentication_reset_requested` on enum `v2.iam.ActivityLogListParams.actions` +* Add support for `treasury_transaction` on `EventsV2MoneyManagementTransactionUpdatedEvent` +* Add support for event notifications `V2SignalsAccountSignalFraudulentMerchantReadyEvent` and `V2SignalsAccountSignalFraudulentWebsiteReadyEvent` with related object `v2.signals.AccountSignal` +* Add support for error types `InvalidVaultedCredentialError`, `VerificationAttemptFailedError`, `VerificationExpiredError`, and `VerificationNotInitiatedError` +* ⚠️ Remove support for error type `ControlledByDashboardError` +* Add support for error codes `dispute_evidence_page_limit_exceeded`, `financial_connections_consent_locale_invalid`, `financial_connections_consent_locale_unsupported`, and `payment_evaluation_on_api_version_not_supported` on `QuotePreviewInvoice.LastFinalizationError` +* Add support for error codes `blocked_gb_bank_account`, `unsupported_gb_bank`, and `unsupported_us_bank` on `BlockedByStripeError` +* ⚠️ Remove support for error codes `blocked_payout_method_bank_account`, `blocked_payout_method_crypto_wallet`, `unsupported_payout_method_bank_account`, and `unsupported_payout_method_crypto_wallet` on `BlockedByStripeError` +* Add support for error codes `default_gb_bank_account_cannot_be_archived`, `gb_bank_account_incompatible_currency`, `gb_bank_account_unsupported_currency`, `incompatible_payout_method_currency`, `unsupported_payout_method_currency`, `us_bank_account_incompatible_currency`, and `us_bank_account_unsupported_currency` on `CannotProceedError` +* Add support for error codes `gb_bank_account_cannot_be_archived` and `us_bank_account_cannot_be_archived` on `ControlledByAlternateResourceError` +* ⚠️ Remove support for error codes `invalid_payout_method_bank_account` and `invalid_payout_method_crypto_wallet` on `InvalidPayoutMethodError` +* Add support for error code `limit_gb_bank_account` on `QuotaExceededError` +* ⚠️ Remove support for error codes `limit_payout_method_bank_account`, `limit_payout_method_card`, and `limit_payout_method_crypto_wallet` on `QuotaExceededError` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 308945cbf..316bdd23b 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -baff58c9d515cdd5f5c3231d101989d588788c6f \ No newline at end of file +adad04916772f880317eac10d8c026b401863f1d \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 28d67d2bf..bfaa37da3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2442 \ No newline at end of file +v2526 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c37c6b01f..8be39ba70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ reportUnnecessaryComparison = true reportUnnecessaryContains = true reportUnnecessaryIsInstance = true reportPrivateImportUsage = true -reportUnnecessaryTypeIgnoreComment = false +reportUnnecessaryTypeIgnoreComment = true [tool.mypy] follow_imports = "silent" diff --git a/stripe/__init__.py b/stripe/__init__.py index 439c6ece3..24fba4b04 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -172,6 +172,7 @@ def add_beta_version( tax as tax, terminal as terminal, test_helpers as test_helpers, + three_d_secure as three_d_secure, treasury as treasury, v2 as v2, ) @@ -333,7 +334,6 @@ def add_beta_version( CannotProceedError as CannotProceedError, CardError as CardError, ControlledByAlternateResourceError as ControlledByAlternateResourceError, - ControlledByDashboardError as ControlledByDashboardError, FeatureNotEnabledError as FeatureNotEnabledError, FinancialAccountNotOpenError as FinancialAccountNotOpenError, IdempotencyError as IdempotencyError, @@ -341,6 +341,7 @@ def add_beta_version( InvalidPaymentMethodError as InvalidPaymentMethodError, InvalidPayoutMethodError as InvalidPayoutMethodError, InvalidRequestError as InvalidRequestError, + InvalidVaultedCredentialError as InvalidVaultedCredentialError, NonZeroBalanceError as NonZeroBalanceError, NotCancelableError as NotCancelableError, PermissionError as PermissionError, @@ -351,6 +352,9 @@ def add_beta_version( StripeError as StripeError, StripeErrorWithParamCode as StripeErrorWithParamCode, TemporarySessionExpiredError as TemporarySessionExpiredError, + VerificationAttemptFailedError as VerificationAttemptFailedError, + VerificationExpiredError as VerificationExpiredError, + VerificationNotInitiatedError as VerificationNotInitiatedError, ) from stripe._error_object import ( ErrorObject as ErrorObject, @@ -531,7 +535,6 @@ def add_beta_version( from stripe._reserve_transaction import ( ReserveTransaction as ReserveTransaction, ) - from stripe._reversal import Reversal as Reversal from stripe._review import Review as Review from stripe._review_service import ReviewService as ReviewService from stripe._search_result_object import ( @@ -610,11 +613,15 @@ def add_beta_version( from stripe._test_helpers_service import ( TestHelpersService as TestHelpersService, ) + from stripe._three_d_secure_service import ( + ThreeDSecureService as ThreeDSecureService, + ) from stripe._token import Token as Token from stripe._token_service import TokenService as TokenService from stripe._topup import Topup as Topup from stripe._topup_service import TopupService as TopupService from stripe._transfer import Transfer as Transfer + from stripe._transfer_reversal import TransferReversal as TransferReversal from stripe._transfer_reversal_service import ( TransferReversalService as TransferReversalService, ) @@ -664,6 +671,7 @@ def add_beta_version( "tax": ("stripe.tax", True), "terminal": ("stripe.terminal", True), "test_helpers": ("stripe.test_helpers", True), + "three_d_secure": ("stripe.three_d_secure", True), "treasury": ("stripe.treasury", True), "v2": ("stripe.v2", True), "Account": ("stripe._account", False), @@ -791,7 +799,6 @@ def add_beta_version( "CannotProceedError": ("stripe._error", False), "CardError": ("stripe._error", False), "ControlledByAlternateResourceError": ("stripe._error", False), - "ControlledByDashboardError": ("stripe._error", False), "FeatureNotEnabledError": ("stripe._error", False), "FinancialAccountNotOpenError": ("stripe._error", False), "IdempotencyError": ("stripe._error", False), @@ -799,6 +806,7 @@ def add_beta_version( "InvalidPaymentMethodError": ("stripe._error", False), "InvalidPayoutMethodError": ("stripe._error", False), "InvalidRequestError": ("stripe._error", False), + "InvalidVaultedCredentialError": ("stripe._error", False), "NonZeroBalanceError": ("stripe._error", False), "NotCancelableError": ("stripe._error", False), "PermissionError": ("stripe._error", False), @@ -809,6 +817,9 @@ def add_beta_version( "StripeError": ("stripe._error", False), "StripeErrorWithParamCode": ("stripe._error", False), "TemporarySessionExpiredError": ("stripe._error", False), + "VerificationAttemptFailedError": ("stripe._error", False), + "VerificationExpiredError": ("stripe._error", False), + "VerificationNotInitiatedError": ("stripe._error", False), "ErrorObject": ("stripe._error_object", False), "OAuthErrorObject": ("stripe._error_object", False), "Event": ("stripe._event", False), @@ -969,7 +980,6 @@ def add_beta_version( "RequestorOptions": ("stripe._requestor_options", False), "ReserveService": ("stripe._reserve_service", False), "ReserveTransaction": ("stripe._reserve_transaction", False), - "Reversal": ("stripe._reversal", False), "Review": ("stripe._review", False), "ReviewService": ("stripe._review_service", False), "SearchResultObject": ("stripe._search_result_object", False), @@ -1018,11 +1028,13 @@ def add_beta_version( "TerminalService": ("stripe._terminal_service", False), "APIResourceTestHelpers": ("stripe._test_helpers", False), "TestHelpersService": ("stripe._test_helpers_service", False), + "ThreeDSecureService": ("stripe._three_d_secure_service", False), "Token": ("stripe._token", False), "TokenService": ("stripe._token_service", False), "Topup": ("stripe._topup", False), "TopupService": ("stripe._topup_service", False), "Transfer": ("stripe._transfer", False), + "TransferReversal": ("stripe._transfer_reversal", False), "TransferReversalService": ("stripe._transfer_reversal_service", False), "TransferService": ("stripe._transfer_service", False), "TreasuryService": ("stripe._treasury_service", False), diff --git a/stripe/_account.py b/stripe/_account.py index bf26e20cc..52afe3c44 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -304,6 +304,12 @@ class Capabilities(StripeObject): """ The status of the blik payments capability of the account, or whether the account can directly process blik charges. """ + blik_recurring_payments: Optional[ + Union[Literal["active", "inactive", "pending"], str] + ] + """ + The status of the BLIK recurring payments capability of the account, or whether the account can accept recurring and subscription BLIK payments. + """ boleto_payments: Optional[ Union[Literal["active", "inactive", "pending"], str] ] @@ -592,6 +598,12 @@ class Capabilities(StripeObject): """ The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. """ + sequra_payments: Optional[ + Union[Literal["active", "inactive", "pending"], str] + ] + """ + The status of the SeQura capability of the account, or whether the account can directly process SeQura payments. + """ shopeepay_payments: Optional[ Union[Literal["active", "inactive", "pending"], str] ] @@ -894,7 +906,7 @@ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). """ details: Optional[str] """ @@ -906,7 +918,7 @@ class Document(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). """ document: Document @@ -1137,8 +1149,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -1319,8 +1333,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -1971,7 +1987,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["AccountDeleteParams"] + cls, sid: str, /, **params: Unpack["AccountDeleteParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage. @@ -1994,7 +2010,9 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["AccountDeleteParams"]) -> "Account": + def delete( + sid: str, /, **params: Unpack["AccountDeleteParams"] + ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage. @@ -2020,9 +2038,7 @@ def delete(self, **params: Unpack["AccountDeleteParams"]) -> "Account": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AccountDeleteParams"] - ) -> "Account": + def delete(self, **params: Unpack["AccountDeleteParams"]) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage. @@ -2040,7 +2056,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["AccountDeleteParams"] + cls, sid: str, /, **params: Unpack["AccountDeleteParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage. @@ -2064,7 +2080,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["AccountDeleteParams"] + sid: str, /, **params: Unpack["AccountDeleteParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage. @@ -2093,7 +2109,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["AccountDeleteParams"] ) -> "Account": """ @@ -2153,7 +2169,7 @@ async def list_async( @classmethod def _cls_persons( - cls, account: str, **params: Unpack["AccountPersonsParams"] + cls, account: str, /, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -2172,7 +2188,7 @@ def _cls_persons( @overload @staticmethod def persons( - account: str, **params: Unpack["AccountPersonsParams"] + account: str, /, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -2189,7 +2205,7 @@ def persons( ... @class_method_variant("_cls_persons") - def persons( # pyright: ignore[reportGeneralTypeIssues] + def persons( self, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ @@ -2208,7 +2224,7 @@ def persons( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_persons_async( - cls, account: str, **params: Unpack["AccountPersonsParams"] + cls, account: str, /, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -2227,7 +2243,7 @@ async def _cls_persons_async( @overload @staticmethod async def persons_async( - account: str, **params: Unpack["AccountPersonsParams"] + account: str, /, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -2244,7 +2260,7 @@ async def persons_async( ... @class_method_variant("_cls_persons_async") - async def persons_async( # pyright: ignore[reportGeneralTypeIssues] + async def persons_async( self, **params: Unpack["AccountPersonsParams"] ) -> ListObject["Person"]: """ @@ -2263,7 +2279,7 @@ async def persons_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_reject( - cls, account: str, **params: Unpack["AccountRejectParams"] + cls, account: str, /, **params: Unpack["AccountRejectParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. @@ -2284,7 +2300,7 @@ def _cls_reject( @overload @staticmethod def reject( - account: str, **params: Unpack["AccountRejectParams"] + account: str, /, **params: Unpack["AccountRejectParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. @@ -2303,9 +2319,7 @@ def reject(self, **params: Unpack["AccountRejectParams"]) -> "Account": ... @class_method_variant("_cls_reject") - def reject( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AccountRejectParams"] - ) -> "Account": + def reject(self, **params: Unpack["AccountRejectParams"]) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. @@ -2324,7 +2338,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_reject_async( - cls, account: str, **params: Unpack["AccountRejectParams"] + cls, account: str, /, **params: Unpack["AccountRejectParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. @@ -2345,7 +2359,7 @@ async def _cls_reject_async( @overload @staticmethod async def reject_async( - account: str, **params: Unpack["AccountRejectParams"] + account: str, /, **params: Unpack["AccountRejectParams"] ) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. @@ -2366,7 +2380,7 @@ async def reject_async( ... @class_method_variant("_cls_reject_async") - async def reject_async( # pyright: ignore[reportGeneralTypeIssues] + async def reject_async( self, **params: Unpack["AccountRejectParams"] ) -> "Account": """ @@ -2387,7 +2401,7 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_unreject( - cls, account: str, **params: Unpack["AccountUnrejectParams"] + cls, account: str, /, **params: Unpack["AccountUnrejectParams"] ) -> "Account": """ With Connect, you can unreject accounts that you have previously rejected. @@ -2410,7 +2424,7 @@ def _cls_unreject( @overload @staticmethod def unreject( - account: str, **params: Unpack["AccountUnrejectParams"] + account: str, /, **params: Unpack["AccountUnrejectParams"] ) -> "Account": """ With Connect, you can unreject accounts that you have previously rejected. @@ -2433,9 +2447,7 @@ def unreject(self, **params: Unpack["AccountUnrejectParams"]) -> "Account": ... @class_method_variant("_cls_unreject") - def unreject( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AccountUnrejectParams"] - ) -> "Account": + def unreject(self, **params: Unpack["AccountUnrejectParams"]) -> "Account": """ With Connect, you can unreject accounts that you have previously rejected. @@ -2456,7 +2468,7 @@ def unreject( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_unreject_async( - cls, account: str, **params: Unpack["AccountUnrejectParams"] + cls, account: str, /, **params: Unpack["AccountUnrejectParams"] ) -> "Account": """ With Connect, you can unreject accounts that you have previously rejected. @@ -2479,7 +2491,7 @@ async def _cls_unreject_async( @overload @staticmethod async def unreject_async( - account: str, **params: Unpack["AccountUnrejectParams"] + account: str, /, **params: Unpack["AccountUnrejectParams"] ) -> "Account": """ With Connect, you can unreject accounts that you have previously rejected. @@ -2504,7 +2516,7 @@ async def unreject_async( ... @class_method_variant("_cls_unreject_async") - async def unreject_async( # pyright: ignore[reportGeneralTypeIssues] + async def unreject_async( self, **params: Unpack["AccountUnrejectParams"] ) -> "Account": """ @@ -2577,7 +2589,7 @@ def serialize(self, previous): @classmethod def list_capabilities( - cls, account: str, **params: Unpack["AccountListCapabilitiesParams"] + cls, account: str, /, **params: Unpack["AccountListCapabilitiesParams"] ) -> ListObject["Capability"]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. @@ -2595,7 +2607,7 @@ def list_capabilities( @classmethod async def list_capabilities_async( - cls, account: str, **params: Unpack["AccountListCapabilitiesParams"] + cls, account: str, /, **params: Unpack["AccountListCapabilitiesParams"] ) -> ListObject["Capability"]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. @@ -2616,6 +2628,7 @@ def retrieve_capability( cls, account: str, capability: str, + /, **params: Unpack["AccountRetrieveCapabilityParams"], ) -> "Capability": """ @@ -2638,6 +2651,7 @@ async def retrieve_capability_async( cls, account: str, capability: str, + /, **params: Unpack["AccountRetrieveCapabilityParams"], ) -> "Capability": """ @@ -2660,6 +2674,7 @@ def modify_capability( cls, account: str, capability: str, + /, **params: Unpack["AccountModifyCapabilityParams"], ) -> "Capability": """ @@ -2682,6 +2697,7 @@ async def modify_capability_async( cls, account: str, capability: str, + /, **params: Unpack["AccountModifyCapabilityParams"], ) -> "Capability": """ @@ -2704,6 +2720,7 @@ def delete_external_account( cls, account: str, id: str, + /, **params: Unpack["AccountDeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2725,6 +2742,7 @@ async def delete_external_account_async( cls, account: str, id: str, + /, **params: Unpack["AccountDeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2746,6 +2764,7 @@ def retrieve_external_account( cls, account: str, id: str, + /, **params: Unpack["AccountRetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2767,6 +2786,7 @@ async def retrieve_external_account_async( cls, account: str, id: str, + /, **params: Unpack["AccountRetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2788,6 +2808,7 @@ def modify_external_account( cls, account: str, id: str, + /, **params: Unpack["AccountModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2816,6 +2837,7 @@ async def modify_external_account_async( cls, account: str, id: str, + /, **params: Unpack["AccountModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2843,6 +2865,7 @@ async def modify_external_account_async( def list_external_accounts( cls, account: str, + /, **params: Unpack["AccountListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ @@ -2863,6 +2886,7 @@ def list_external_accounts( async def list_external_accounts_async( cls, account: str, + /, **params: Unpack["AccountListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ @@ -2883,6 +2907,7 @@ async def list_external_accounts_async( def create_external_account( cls, account: str, + /, **params: Unpack["AccountCreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2903,6 +2928,7 @@ def create_external_account( async def create_external_account_async( cls, account: str, + /, **params: Unpack["AccountCreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ @@ -2921,7 +2947,7 @@ async def create_external_account_async( @classmethod def create_login_link( - cls, account: str, **params: Unpack["AccountCreateLoginLinkParams"] + cls, account: str, /, **params: Unpack["AccountCreateLoginLinkParams"] ) -> "LoginLink": """ Creates a login link for a connected account to access the Express Dashboard. @@ -2941,7 +2967,7 @@ def create_login_link( @classmethod async def create_login_link_async( - cls, account: str, **params: Unpack["AccountCreateLoginLinkParams"] + cls, account: str, /, **params: Unpack["AccountCreateLoginLinkParams"] ) -> "LoginLink": """ Creates a login link for a connected account to access the Express Dashboard. @@ -2964,6 +2990,7 @@ def delete_person( cls, account: str, person: str, + /, **params: Unpack["AccountDeletePersonParams"], ) -> "Person": """ @@ -2985,6 +3012,7 @@ async def delete_person_async( cls, account: str, person: str, + /, **params: Unpack["AccountDeletePersonParams"], ) -> "Person": """ @@ -3006,6 +3034,7 @@ def retrieve_person( cls, account: str, person: str, + /, **params: Unpack["AccountRetrievePersonParams"], ) -> "Person": """ @@ -3027,6 +3056,7 @@ async def retrieve_person_async( cls, account: str, person: str, + /, **params: Unpack["AccountRetrievePersonParams"], ) -> "Person": """ @@ -3048,6 +3078,7 @@ def modify_person( cls, account: str, person: str, + /, **params: Unpack["AccountModifyPersonParams"], ) -> "Person": """ @@ -3069,6 +3100,7 @@ async def modify_person_async( cls, account: str, person: str, + /, **params: Unpack["AccountModifyPersonParams"], ) -> "Person": """ @@ -3087,7 +3119,7 @@ async def modify_person_async( @classmethod def list_persons( - cls, account: str, **params: Unpack["AccountListPersonsParams"] + cls, account: str, /, **params: Unpack["AccountListPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3105,7 +3137,7 @@ def list_persons( @classmethod async def list_persons_async( - cls, account: str, **params: Unpack["AccountListPersonsParams"] + cls, account: str, /, **params: Unpack["AccountListPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3123,7 +3155,7 @@ async def list_persons_async( @classmethod def create_person( - cls, account: str, **params: Unpack["AccountCreatePersonParams"] + cls, account: str, /, **params: Unpack["AccountCreatePersonParams"] ) -> "Person": """ Creates a new person. @@ -3141,7 +3173,7 @@ def create_person( @classmethod async def create_person_async( - cls, account: str, **params: Unpack["AccountCreatePersonParams"] + cls, account: str, /, **params: Unpack["AccountCreatePersonParams"] ) -> "Person": """ Creates a new person. diff --git a/stripe/_account_capability_service.py b/stripe/_account_capability_service.py index afe33c8c4..9c58c1a93 100644 --- a/stripe/_account_capability_service.py +++ b/stripe/_account_capability_service.py @@ -24,6 +24,7 @@ class AccountCapabilityService(StripeService): def list( self, account: str, + /, params: Optional["AccountCapabilityListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Capability]": @@ -46,6 +47,7 @@ def list( async def list_async( self, account: str, + /, params: Optional["AccountCapabilityListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Capability]": @@ -69,6 +71,7 @@ def retrieve( self, account: str, capability: str, + /, params: Optional["AccountCapabilityRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Capability": @@ -93,6 +96,7 @@ async def retrieve_async( self, account: str, capability: str, + /, params: Optional["AccountCapabilityRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Capability": @@ -117,6 +121,7 @@ def update( self, account: str, capability: str, + /, params: Optional["AccountCapabilityUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Capability": @@ -141,6 +146,7 @@ async def update_async( self, account: str, capability: str, + /, params: Optional["AccountCapabilityUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Capability": diff --git a/stripe/_account_external_account_service.py b/stripe/_account_external_account_service.py index c599096f0..4d78dae7a 100644 --- a/stripe/_account_external_account_service.py +++ b/stripe/_account_external_account_service.py @@ -33,6 +33,7 @@ def delete( self, account: str, id: str, + /, params: Optional["AccountExternalAccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -57,6 +58,7 @@ async def delete_async( self, account: str, id: str, + /, params: Optional["AccountExternalAccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -81,6 +83,7 @@ def retrieve( self, account: str, id: str, + /, params: Optional["AccountExternalAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -105,6 +108,7 @@ async def retrieve_async( self, account: str, id: str, + /, params: Optional["AccountExternalAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -129,6 +133,7 @@ def update( self, account: str, id: str, + /, params: Optional["AccountExternalAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -160,6 +165,7 @@ async def update_async( self, account: str, id: str, + /, params: Optional["AccountExternalAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -190,6 +196,7 @@ async def update_async( def list( self, account: str, + /, params: Optional["AccountExternalAccountListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Union[BankAccount, Card]]": @@ -212,6 +219,7 @@ def list( async def list_async( self, account: str, + /, params: Optional["AccountExternalAccountListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Union[BankAccount, Card]]": @@ -234,6 +242,7 @@ async def list_async( def create( self, account: str, + /, params: "AccountExternalAccountCreateParams", options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -256,6 +265,7 @@ def create( async def create_async( self, account: str, + /, params: "AccountExternalAccountCreateParams", options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": diff --git a/stripe/_account_login_link_service.py b/stripe/_account_login_link_service.py index 39212510d..bee20933e 100644 --- a/stripe/_account_login_link_service.py +++ b/stripe/_account_login_link_service.py @@ -17,6 +17,7 @@ class AccountLoginLinkService(StripeService): def create( self, account: str, + /, params: Optional["AccountLoginLinkCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "LoginLink": @@ -41,6 +42,7 @@ def create( async def create_async( self, account: str, + /, params: Optional["AccountLoginLinkCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "LoginLink": diff --git a/stripe/_account_notice.py b/stripe/_account_notice.py index c434f4d67..0d67422ff 100644 --- a/stripe/_account_notice.py +++ b/stripe/_account_notice.py @@ -160,7 +160,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["AccountNoticeModifyParams"] + cls, id: str, /, **params: Unpack["AccountNoticeModifyParams"] ) -> "AccountNotice": """ Updates an AccountNotice object. @@ -177,7 +177,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["AccountNoticeModifyParams"] + cls, id: str, /, **params: Unpack["AccountNoticeModifyParams"] ) -> "AccountNotice": """ Updates an AccountNotice object. diff --git a/stripe/_account_notice_service.py b/stripe/_account_notice_service.py index 44604204a..e28f14738 100644 --- a/stripe/_account_notice_service.py +++ b/stripe/_account_notice_service.py @@ -62,6 +62,7 @@ async def list_async( def retrieve( self, account_notice: str, + /, params: Optional["AccountNoticeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountNotice": @@ -84,6 +85,7 @@ def retrieve( async def retrieve_async( self, account_notice: str, + /, params: Optional["AccountNoticeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountNotice": @@ -106,6 +108,7 @@ async def retrieve_async( def update( self, account_notice: str, + /, params: "AccountNoticeUpdateParams", options: Optional["RequestOptions"] = None, ) -> "AccountNotice": @@ -128,6 +131,7 @@ def update( async def update_async( self, account_notice: str, + /, params: "AccountNoticeUpdateParams", options: Optional["RequestOptions"] = None, ) -> "AccountNotice": diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 1720d8c1a..d0b6748fa 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -31,6 +31,7 @@ def delete( self, account: str, person: str, + /, params: Optional["AccountPersonDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -55,6 +56,7 @@ async def delete_async( self, account: str, person: str, + /, params: Optional["AccountPersonDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -79,6 +81,7 @@ def retrieve( self, account: str, person: str, + /, params: Optional["AccountPersonRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -103,6 +106,7 @@ async def retrieve_async( self, account: str, person: str, + /, params: Optional["AccountPersonRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -127,6 +131,7 @@ def update( self, account: str, person: str, + /, params: Optional["AccountPersonUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -151,6 +156,7 @@ async def update_async( self, account: str, person: str, + /, params: Optional["AccountPersonUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -174,6 +180,7 @@ async def update_async( def list( self, account: str, + /, params: Optional["AccountPersonListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Person]": @@ -196,6 +203,7 @@ def list( async def list_async( self, account: str, + /, params: Optional["AccountPersonListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Person]": @@ -218,6 +226,7 @@ async def list_async( def create( self, account: str, + /, params: Optional["AccountPersonCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": @@ -240,6 +249,7 @@ def create( async def create_async( self, account: str, + /, params: Optional["AccountPersonCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Person": diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 7688842f3..99e02e8d2 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -75,6 +75,7 @@ def __getattr__(self, name): def delete( self, account: str, + /, params: Optional["AccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -101,6 +102,7 @@ def delete( async def delete_async( self, account: str, + /, params: Optional["AccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -127,6 +129,7 @@ async def delete_async( def retrieve( self, account: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -147,6 +150,7 @@ def retrieve( async def retrieve_async( self, account: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -167,6 +171,7 @@ async def retrieve_async( def update( self, account: str, + /, params: Optional["AccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -199,6 +204,7 @@ def update( async def update_async( self, account: str, + /, params: Optional["AccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -355,6 +361,7 @@ async def create_async( def reject( self, account: str, + /, params: "AccountRejectParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -379,6 +386,7 @@ def reject( async def reject_async( self, account: str, + /, params: "AccountRejectParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -403,6 +411,7 @@ async def reject_async( def unreject( self, account: str, + /, params: Optional["AccountUnrejectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -429,6 +438,7 @@ def unreject( async def unreject_async( self, account: str, + /, params: Optional["AccountUnrejectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -455,6 +465,7 @@ async def unreject_async( def serialize_batch_update( self, account: str, + /, params: Optional["AccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: diff --git a/stripe/_account_session.py b/stripe/_account_session.py index dd3fd2f5d..7d2d6edbd 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -581,7 +581,7 @@ def create( cls, **params: Unpack["AccountSessionCreateParams"] ) -> "AccountSession": """ - Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + Creates an AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", @@ -597,7 +597,7 @@ async def create_async( cls, **params: Unpack["AccountSessionCreateParams"] ) -> "AccountSession": """ - Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + Creates an AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index c0013cc7f..fca00c23c 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -19,7 +19,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "AccountSession": """ - Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + Creates an AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", @@ -38,7 +38,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "AccountSession": """ - Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + Creates an AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index fa484b087..4c6c2ffbf 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -430,8 +430,6 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): ) elif type == "controlled_by_alternate_resource": return error.ControlledByAlternateResourceError(**error_args) - elif type == "controlled_by_dashboard": - return error.ControlledByDashboardError(**error_args) elif type == "feature_not_enabled": return error.FeatureNotEnabledError(**error_args) elif type == "financial_account_not_open": @@ -445,6 +443,11 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): ) elif type == "invalid_payout_method": return error.InvalidPayoutMethodError(**error_args) + elif type == "invalid_vaulted_credential": + return error.InvalidVaultedCredentialError( + **error_args, + invalid_param=error_data.get("invalid_param"), + ) elif type == "non_zero_balance": return error.NonZeroBalanceError(**error_args) elif type == "not_cancelable": @@ -457,6 +460,21 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.RecipientNotNotifiableError(**error_args) elif type == "temporary_session_expired": return error.TemporarySessionExpiredError(**error_args) + elif type == "verification_attempt_failed": + return error.VerificationAttemptFailedError( + **error_args, + verification_status=error_data.get("verification_status"), + ) + elif type == "verification_expired": + return error.VerificationExpiredError( + **error_args, + verification_status=error_data.get("verification_status"), + ) + elif type == "verification_not_initiated": + return error.VerificationNotInitiatedError( + **error_args, + verification_status=error_data.get("verification_status"), + ) # switchCases: The end of the section generated from our OpenAPI spec return self.specific_v1_api_error( @@ -554,6 +572,7 @@ def specific_oauth_error(self, rbody, rcode, resp, rheaders, error_code): ("CODEX_CI", "codex_cli"), ("CURSOR_AGENT", "cursor"), ("GEMINI_CLI", "gemini_cli"), + ("HERMES_AGENT", "hermes"), ("OPENCLAW_SHELL", "openclaw"), ("OPENCODE", "open_code"), # aiAgents: The end of the section generated from our OpenAPI spec diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 15868d4ff..65684571e 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-08-26.preview" + CURRENT = "2026-09-30.preview" CURRENT_MAJOR = "" diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index c1691cf24..3d1518ccb 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -85,7 +85,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ApplePayDomainDeleteParams"] + cls, sid: str, /, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. @@ -103,7 +103,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["ApplePayDomainDeleteParams"] + sid: str, /, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. @@ -120,7 +120,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ @@ -134,7 +134,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ApplePayDomainDeleteParams"] + cls, sid: str, /, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. @@ -152,7 +152,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ApplePayDomainDeleteParams"] + sid: str, /, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. @@ -169,7 +169,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ApplePayDomainDeleteParams"] ) -> "ApplePayDomain": """ diff --git a/stripe/_apple_pay_domain_service.py b/stripe/_apple_pay_domain_service.py index 6c72f7d65..beb0b6559 100644 --- a/stripe/_apple_pay_domain_service.py +++ b/stripe/_apple_pay_domain_service.py @@ -27,6 +27,7 @@ class ApplePayDomainService(StripeService): def delete( self, domain: str, + /, params: Optional["ApplePayDomainDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplePayDomain": @@ -49,6 +50,7 @@ def delete( async def delete_async( self, domain: str, + /, params: Optional["ApplePayDomainDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplePayDomain": @@ -71,6 +73,7 @@ async def delete_async( def retrieve( self, domain: str, + /, params: Optional["ApplePayDomainRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplePayDomain": @@ -93,6 +96,7 @@ def retrieve( async def retrieve_async( self, domain: str, + /, params: Optional["ApplePayDomainRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplePayDomain": diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index a1db92e4e..b8412b7d0 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -159,7 +159,7 @@ async def list_async( @classmethod def _cls_refund( - cls, id: str, **params: Unpack["ApplicationFeeRefundParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -184,7 +184,7 @@ def _cls_refund( @overload @staticmethod def refund( - id: str, **params: Unpack["ApplicationFeeRefundParams"] + id: str, /, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -217,7 +217,7 @@ def refund( ... @class_method_variant("_cls_refund") - def refund( # pyright: ignore[reportGeneralTypeIssues] + def refund( self, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ @@ -244,7 +244,7 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_refund_async( - cls, id: str, **params: Unpack["ApplicationFeeRefundParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -269,7 +269,7 @@ async def _cls_refund_async( @overload @staticmethod async def refund_async( - id: str, **params: Unpack["ApplicationFeeRefundParams"] + id: str, /, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -302,7 +302,7 @@ async def refund_async( ... @class_method_variant("_cls_refund_async") - async def refund_async( # pyright: ignore[reportGeneralTypeIssues] + async def refund_async( self, **params: Unpack["ApplicationFeeRefundParams"] ) -> "ApplicationFeeRefund": """ @@ -354,6 +354,7 @@ def retrieve_refund( cls, fee: str, id: str, + /, **params: Unpack["ApplicationFeeRetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ @@ -375,6 +376,7 @@ async def retrieve_refund_async( cls, fee: str, id: str, + /, **params: Unpack["ApplicationFeeRetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ @@ -396,6 +398,7 @@ def modify_refund( cls, fee: str, id: str, + /, **params: Unpack["ApplicationFeeModifyRefundParams"], ) -> "ApplicationFeeRefund": """ @@ -419,6 +422,7 @@ async def modify_refund_async( cls, fee: str, id: str, + /, **params: Unpack["ApplicationFeeModifyRefundParams"], ) -> "ApplicationFeeRefund": """ @@ -439,7 +443,7 @@ async def modify_refund_async( @classmethod def list_refunds( - cls, id: str, **params: Unpack["ApplicationFeeListRefundsParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeListRefundsParams"] ) -> ListObject["ApplicationFeeRefund"]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. @@ -455,7 +459,7 @@ def list_refunds( @classmethod async def list_refunds_async( - cls, id: str, **params: Unpack["ApplicationFeeListRefundsParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeListRefundsParams"] ) -> ListObject["ApplicationFeeRefund"]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. @@ -471,7 +475,7 @@ async def list_refunds_async( @classmethod def create_refund( - cls, id: str, **params: Unpack["ApplicationFeeCreateRefundParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeCreateRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -495,7 +499,7 @@ def create_refund( @classmethod async def create_refund_async( - cls, id: str, **params: Unpack["ApplicationFeeCreateRefundParams"] + cls, id: str, /, **params: Unpack["ApplicationFeeCreateRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. diff --git a/stripe/_application_fee_refund_service.py b/stripe/_application_fee_refund_service.py index 1f109689e..ed0180ce1 100644 --- a/stripe/_application_fee_refund_service.py +++ b/stripe/_application_fee_refund_service.py @@ -28,6 +28,7 @@ def retrieve( self, fee: str, id: str, + /, params: Optional["ApplicationFeeRefundRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": @@ -52,6 +53,7 @@ async def retrieve_async( self, fee: str, id: str, + /, params: Optional["ApplicationFeeRefundRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": @@ -76,6 +78,7 @@ def update( self, fee: str, id: str, + /, params: Optional["ApplicationFeeRefundUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": @@ -102,6 +105,7 @@ async def update_async( self, fee: str, id: str, + /, params: Optional["ApplicationFeeRefundUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": @@ -127,6 +131,7 @@ async def update_async( def list( self, id: str, + /, params: Optional["ApplicationFeeRefundListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[ApplicationFeeRefund]": @@ -147,6 +152,7 @@ def list( async def list_async( self, id: str, + /, params: Optional["ApplicationFeeRefundListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[ApplicationFeeRefund]": @@ -167,6 +173,7 @@ async def list_async( def create( self, id: str, + /, params: Optional["ApplicationFeeRefundCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": @@ -195,6 +202,7 @@ def create( async def create_async( self, id: str, + /, params: Optional["ApplicationFeeRefundCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFeeRefund": diff --git a/stripe/_application_fee_service.py b/stripe/_application_fee_service.py index 814c3ad95..1926ea117 100644 --- a/stripe/_application_fee_service.py +++ b/stripe/_application_fee_service.py @@ -91,6 +91,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ApplicationFeeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFee": @@ -111,6 +112,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ApplicationFeeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApplicationFee": diff --git a/stripe/_apps_service.py b/stripe/_apps_service.py index d20e13470..932e6cfc3 100644 --- a/stripe/_apps_service.py +++ b/stripe/_apps_service.py @@ -5,12 +5,17 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.apps._install_service import InstallService from stripe.apps._secret_service import SecretService -_subservices = {"secrets": ["stripe.apps._secret_service", "SecretService"]} +_subservices = { + "installs": ["stripe.apps._install_service", "InstallService"], + "secrets": ["stripe.apps._secret_service", "SecretService"], +} class AppsService(StripeService): + installs: "InstallService" secrets: "SecretService" def __init__(self, requestor): diff --git a/stripe/_balance.py b/stripe/_balance.py index ecfc6549b..25fb6b9f7 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -319,7 +319,7 @@ class SourceTypes(StripeObject): available: List[Available] """ - Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://api.stripe.com#transfers) or [Payouts API](https://api.stripe.com#payouts). You can find the available balance for each currency and payment type in the `source_types` property. + Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://docs.stripe.com/api#transfers) or [Payouts API](https://docs.stripe.com/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. """ connect_reserved: Optional[List[ConnectReserved]] """ diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index a5ee4eb36..40be50da9 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -19,10 +19,10 @@ from stripe._payout import Payout from stripe._refund import Refund from stripe._reserve_transaction import ReserveTransaction - from stripe._reversal import Reversal from stripe._tax_deducted_at_source import TaxDeductedAtSource from stripe._topup import Topup from stripe._transfer import Transfer + from stripe._transfer_reversal import TransferReversal from stripe.issuing._authorization import Authorization from stripe.issuing._dispute import Dispute as IssuingDisputeResource from stripe.issuing._transaction import Transaction @@ -146,7 +146,7 @@ class FeeDetail(StripeObject): "TaxDeductedAtSource", "Topup", "Transfer", - "Reversal", + "TransferReversal", ] ] ] @@ -176,6 +176,8 @@ class FeeDetail(StripeObject): "issuing_authorization_hold", "issuing_authorization_release", "issuing_dispute", + "issuing_dispute_provisional_credit", + "issuing_dispute_provisional_credit_reversal", "issuing_transaction", "obligation_outbound", "obligation_reversal_inbound", @@ -213,7 +215,7 @@ class FeeDetail(StripeObject): str, ] """ - Transaction type: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + Transaction type: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_dispute_provisional_credit`, `issuing_dispute_provisional_credit_reversal`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. """ @classmethod diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 2166a14fc..44c7eb0c1 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -63,6 +63,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["BalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BalanceTransaction": @@ -85,6 +86,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["BalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BalanceTransaction": diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 6a36109ec..fab473665 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -42,8 +42,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -174,8 +176,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -387,7 +391,7 @@ class Error(StripeObject): @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["BankAccountDeleteParams"] + cls, sid: str, /, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -405,7 +409,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["BankAccountDeleteParams"] + sid: str, /, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -422,7 +426,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ @@ -436,7 +440,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["BankAccountDeleteParams"] + cls, sid: str, /, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -454,7 +458,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["BankAccountDeleteParams"] + sid: str, /, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -471,7 +475,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["BankAccountDeleteParams"] ) -> Union["BankAccount", "Card"]: """ diff --git a/stripe/_capability.py b/stripe/_capability.py index 45834c6a1..c1ff67e44 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -34,8 +34,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -208,8 +210,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", diff --git a/stripe/_card.py b/stripe/_card.py index 1b4e34322..741b438df 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -190,7 +190,7 @@ class Redaction(StripeObject): @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["CardDeleteParams"] + cls, sid: str, /, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -208,7 +208,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["CardDeleteParams"] + sid: str, /, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -225,7 +225,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ @@ -239,7 +239,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["CardDeleteParams"] + cls, sid: str, /, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -257,7 +257,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["CardDeleteParams"] + sid: str, /, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. @@ -274,7 +274,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["CardDeleteParams"] ) -> Union["BankAccount", "Card"]: """ diff --git a/stripe/_charge.py b/stripe/_charge.py index db8f4161d..5d4302061 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -61,7 +61,7 @@ class Charge( """ The `Charge` object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but [Account Debits](https://docs.stripe.com/connect/account-debits) may also create Charges. - Some legacy payment flows create Charges directly, which is not recommended for new integrations. + The create and capture methods are deprecated and will be deleted soon. If your integration uses either of them, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/payments/payment-intents). """ OBJECT_NAME: ClassVar[Literal["charge"]] = "charge" @@ -896,6 +896,10 @@ class ShippingAddress(StripeObject): """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ + electronic_commerce_indicator: Optional[str] + """ + The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. This is the network's final ECI and can differ from the request value. An authenticated ECI alone doesn't determine liability shift. + """ exp_month: int """ Two-digit number representing the card's expiration month. @@ -934,7 +938,7 @@ class ShippingAddress(StripeObject): """ The last four digits of the card. """ - mandate: Optional[str] + mandate: Optional[ExpandableField["Mandate"]] """ ID of the mandate used to make this payment or created by it. """ @@ -963,6 +967,18 @@ class ShippingAddress(StripeObject): """ Status of a card based on the card issuer. """ + setup_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The payment_method_options.card.setup_credential_usage value that was passed when setup_future_usage was present at confirmation, one of `recurring`, `unscheduled`, or `installment` + """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The payment_method_options.card.stored_credential_usage value that was passed for an off session, merchant-initiated transaction, one of `recurring`, `unscheduled`, `on_session`, or `installment` + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -2170,6 +2186,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2376,6 +2398,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2451,6 +2474,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, @@ -2737,14 +2761,10 @@ class TransferData(StripeObject): @classmethod def _cls_capture( - cls, charge: str, **params: Unpack["ChargeCaptureParams"] + cls, charge: str, /, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2760,38 +2780,24 @@ def _cls_capture( @overload @staticmethod def capture( - charge: str, **params: Unpack["ChargeCaptureParams"] + charge: str, /, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ ... @overload def capture(self, **params: Unpack["ChargeCaptureParams"]) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ ... @class_method_variant("_cls_capture") - def capture( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["ChargeCaptureParams"] - ) -> "Charge": + def capture(self, **params: Unpack["ChargeCaptureParams"]) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2806,14 +2812,10 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_capture_async( - cls, charge: str, **params: Unpack["ChargeCaptureParams"] + cls, charge: str, /, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2829,14 +2831,10 @@ async def _cls_capture_async( @overload @staticmethod async def capture_async( - charge: str, **params: Unpack["ChargeCaptureParams"] + charge: str, /, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ ... @@ -2845,24 +2843,16 @@ async def capture_async( self, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ ... @class_method_variant("_cls_capture_async") - async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + async def capture_async( self, **params: Unpack["ChargeCaptureParams"] ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2878,9 +2868,7 @@ async def capture_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def create(cls, **params: Unpack["ChargeCreateParams"]) -> "Charge": """ - This method is no longer recommended—use the [Payment Intents API](https://docs.stripe.com/docs/api/payment_intents) - to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge - object used to request payment. + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2896,9 +2884,7 @@ async def create_async( cls, **params: Unpack["ChargeCreateParams"] ) -> "Charge": """ - This method is no longer recommended—use the [Payment Intents API](https://docs.stripe.com/docs/api/payment_intents) - to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge - object used to request payment. + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -2951,7 +2937,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ChargeModifyParams"] + cls, id: str, /, **params: Unpack["ChargeModifyParams"] ) -> "Charge": """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -2968,7 +2954,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ChargeModifyParams"] + cls, id: str, /, **params: Unpack["ChargeModifyParams"] ) -> "Charge": """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -3066,6 +3052,7 @@ def retrieve_refund( cls, charge: str, refund: str, + /, **params: Unpack["ChargeRetrieveRefundParams"], ) -> "Refund": """ @@ -3087,6 +3074,7 @@ async def retrieve_refund_async( cls, charge: str, refund: str, + /, **params: Unpack["ChargeRetrieveRefundParams"], ) -> "Refund": """ @@ -3105,7 +3093,7 @@ async def retrieve_refund_async( @classmethod def list_refunds( - cls, charge: str, **params: Unpack["ChargeListRefundsParams"] + cls, charge: str, /, **params: Unpack["ChargeListRefundsParams"] ) -> ListObject["Refund"]: """ You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. @@ -3123,7 +3111,7 @@ def list_refunds( @classmethod async def list_refunds_async( - cls, charge: str, **params: Unpack["ChargeListRefundsParams"] + cls, charge: str, /, **params: Unpack["ChargeListRefundsParams"] ) -> ListObject["Refund"]: """ You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. diff --git a/stripe/_charge_service.py b/stripe/_charge_service.py index 2fca76593..46914d056 100644 --- a/stripe/_charge_service.py +++ b/stripe/_charge_service.py @@ -63,9 +63,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "Charge": """ - This method is no longer recommended—use the [Payment Intents API](https://docs.stripe.com/docs/api/payment_intents) - to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge - object used to request payment. + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -84,9 +82,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "Charge": """ - This method is no longer recommended—use the [Payment Intents API](https://docs.stripe.com/docs/api/payment_intents) - to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge - object used to request payment. + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -102,6 +98,7 @@ async def create_async( def retrieve( self, charge: str, + /, params: Optional["ChargeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": @@ -122,6 +119,7 @@ def retrieve( async def retrieve_async( self, charge: str, + /, params: Optional["ChargeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": @@ -142,6 +140,7 @@ async def retrieve_async( def update( self, charge: str, + /, params: Optional["ChargeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": @@ -162,6 +161,7 @@ def update( async def update_async( self, charge: str, + /, params: Optional["ChargeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": @@ -226,15 +226,12 @@ async def search_async( def capture( self, charge: str, + /, params: Optional["ChargeCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", @@ -252,15 +249,12 @@ def capture( async def capture_async( self, charge: str, + /, params: Optional["ChargeCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Charge": """ - Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. - - Uncaptured payments expire a set number of days after they are created ([7 by default](https://docs.stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. - - Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://docs.stripe.com/docs/api/payment_intents/capture). + This method is deprecated and will be removed soon. If your integration uses it, you need to update it to use a different payment flow, such as [the Payment Intents API](https://docs.stripe.com/docs/payments/payment-intents). """ return cast( "Charge", diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index ca8f1c8a8..9df3d5edd 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1440,6 +1440,9 @@ class GeneratedFrom(StripeObject): """ _inner_class_types = {"generated_from": GeneratedFrom} + class Sequra(StripeObject): + pass + class Shopeepay(StripeObject): pass @@ -1644,6 +1647,7 @@ class Zip(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] @@ -1706,6 +1710,7 @@ class Zip(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1781,6 +1786,7 @@ class Zip(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, diff --git a/stripe/_confirmation_token_service.py b/stripe/_confirmation_token_service.py index 066b43fcf..cccbceccd 100644 --- a/stripe/_confirmation_token_service.py +++ b/stripe/_confirmation_token_service.py @@ -17,6 +17,7 @@ class ConfirmationTokenService(StripeService): def retrieve( self, confirmation_token: str, + /, params: Optional["ConfirmationTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ConfirmationToken": @@ -39,6 +40,7 @@ def retrieve( async def retrieve_async( self, confirmation_token: str, + /, params: Optional["ConfirmationTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ConfirmationToken": diff --git a/stripe/_country_spec_service.py b/stripe/_country_spec_service.py index b5e14736e..135ca9160 100644 --- a/stripe/_country_spec_service.py +++ b/stripe/_country_spec_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, country: str, + /, params: Optional["CountrySpecRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CountrySpec": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, country: str, + /, params: Optional["CountrySpecRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CountrySpec": diff --git a/stripe/_coupon.py b/stripe/_coupon.py index a08aaa47c..b7b00ff47 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -26,8 +26,8 @@ class Coupon( ): """ A coupon contains information about a percent-off or amount-off discount you - might want to apply to a customer. Coupons may be applied to [subscriptions](https://api.stripe.com#subscriptions), [invoices](https://api.stripe.com#invoices), - [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://api.stripe.com#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents). + might want to apply to a customer. Coupons may be applied to [subscriptions](https://docs.stripe.com/api#subscriptions), [invoices](https://docs.stripe.com/api#invoices), + [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://docs.stripe.com/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents). """ OBJECT_NAME: ClassVar[Literal["coupon"]] = "coupon" @@ -172,7 +172,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["CouponDeleteParams"] + cls, sid: str, /, **params: Unpack["CouponDeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. @@ -189,7 +189,9 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["CouponDeleteParams"]) -> "Coupon": + def delete( + sid: str, /, **params: Unpack["CouponDeleteParams"] + ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ @@ -203,9 +205,7 @@ def delete(self, **params: Unpack["CouponDeleteParams"]) -> "Coupon": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["CouponDeleteParams"] - ) -> "Coupon": + def delete(self, **params: Unpack["CouponDeleteParams"]) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ @@ -217,7 +217,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["CouponDeleteParams"] + cls, sid: str, /, **params: Unpack["CouponDeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. @@ -235,7 +235,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["CouponDeleteParams"] + sid: str, /, **params: Unpack["CouponDeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. @@ -252,7 +252,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["CouponDeleteParams"] ) -> "Coupon": """ @@ -306,7 +306,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["CouponModifyParams"] + cls, id: str, /, **params: Unpack["CouponModifyParams"] ) -> "Coupon": """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. @@ -323,7 +323,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["CouponModifyParams"] + cls, id: str, /, **params: Unpack["CouponModifyParams"] ) -> "Coupon": """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. diff --git a/stripe/_coupon_service.py b/stripe/_coupon_service.py index 3f27ba870..f65c1061b 100644 --- a/stripe/_coupon_service.py +++ b/stripe/_coupon_service.py @@ -23,6 +23,7 @@ class CouponService(StripeService): def delete( self, coupon: str, + /, params: Optional["CouponDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": @@ -43,6 +44,7 @@ def delete( async def delete_async( self, coupon: str, + /, params: Optional["CouponDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": @@ -63,6 +65,7 @@ async def delete_async( def retrieve( self, coupon: str, + /, params: Optional["CouponRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": @@ -83,6 +86,7 @@ def retrieve( async def retrieve_async( self, coupon: str, + /, params: Optional["CouponRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": @@ -103,6 +107,7 @@ async def retrieve_async( def update( self, coupon: str, + /, params: Optional["CouponUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": @@ -123,6 +128,7 @@ def update( async def update_async( self, coupon: str, + /, params: Optional["CouponUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Coupon": diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 3a82b6822..0a8b7de4c 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -484,7 +484,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["CreditNoteModifyParams"] + cls, id: str, /, **params: Unpack["CreditNoteModifyParams"] ) -> "CreditNote": """ Updates an existing credit note. @@ -501,7 +501,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["CreditNoteModifyParams"] + cls, id: str, /, **params: Unpack["CreditNoteModifyParams"] ) -> "CreditNote": """ Updates an existing credit note. @@ -604,7 +604,7 @@ async def retrieve_async( @classmethod def _cls_void_credit_note( - cls, id: str, **params: Unpack["CreditNoteVoidCreditNoteParams"] + cls, id: str, /, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -621,7 +621,7 @@ def _cls_void_credit_note( @overload @staticmethod def void_credit_note( - id: str, **params: Unpack["CreditNoteVoidCreditNoteParams"] + id: str, /, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -638,7 +638,7 @@ def void_credit_note( ... @class_method_variant("_cls_void_credit_note") - def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] + def void_credit_note( self, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ @@ -657,7 +657,7 @@ def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_void_credit_note_async( - cls, id: str, **params: Unpack["CreditNoteVoidCreditNoteParams"] + cls, id: str, /, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -674,7 +674,7 @@ async def _cls_void_credit_note_async( @overload @staticmethod async def void_credit_note_async( - id: str, **params: Unpack["CreditNoteVoidCreditNoteParams"] + id: str, /, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -691,7 +691,7 @@ async def void_credit_note_async( ... @class_method_variant("_cls_void_credit_note_async") - async def void_credit_note_async( # pyright: ignore[reportGeneralTypeIssues] + async def void_credit_note_async( self, **params: Unpack["CreditNoteVoidCreditNoteParams"] ) -> "CreditNote": """ @@ -710,7 +710,7 @@ async def void_credit_note_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list_lines( - cls, credit_note: str, **params: Unpack["CreditNoteListLinesParams"] + cls, credit_note: str, /, **params: Unpack["CreditNoteListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -728,7 +728,7 @@ def list_lines( @classmethod async def list_lines_async( - cls, credit_note: str, **params: Unpack["CreditNoteListLinesParams"] + cls, credit_note: str, /, **params: Unpack["CreditNoteListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. diff --git a/stripe/_credit_note_line_item_service.py b/stripe/_credit_note_line_item_service.py index e5b85b2d5..ea1f5d098 100644 --- a/stripe/_credit_note_line_item_service.py +++ b/stripe/_credit_note_line_item_service.py @@ -18,6 +18,7 @@ class CreditNoteLineItemService(StripeService): def list( self, credit_note: str, + /, params: Optional["CreditNoteLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CreditNoteLineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, credit_note: str, + /, params: Optional["CreditNoteLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CreditNoteLineItem]": diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index ab9ea98e9..089760b4d 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -169,6 +169,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["CreditNoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": @@ -189,6 +190,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["CreditNoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": @@ -209,6 +211,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["CreditNoteUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": @@ -229,6 +232,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["CreditNoteUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": @@ -287,6 +291,7 @@ async def preview_async( def void_credit_note( self, id: str, + /, params: Optional["CreditNoteVoidCreditNoteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": @@ -307,6 +312,7 @@ def void_credit_note( async def void_credit_note_async( self, id: str, + /, params: Optional["CreditNoteVoidCreditNoteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditNote": diff --git a/stripe/_customer.py b/stripe/_customer.py index ca3900ef9..a8442131b 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -303,7 +303,7 @@ class Location(StripeObject): address: Optional[Address] """ - The customer's address. + The customer's billing address. """ balance: Optional[int] """ @@ -472,6 +472,7 @@ async def create_async( def _cls_create_funding_instructions( cls, customer: str, + /, **params: Unpack["CustomerCreateFundingInstructionsParams"], ) -> "FundingInstructions": """ @@ -494,6 +495,7 @@ def _cls_create_funding_instructions( @staticmethod def create_funding_instructions( customer: str, + /, **params: Unpack["CustomerCreateFundingInstructionsParams"], ) -> "FundingInstructions": """ @@ -515,7 +517,7 @@ def create_funding_instructions( ... @class_method_variant("_cls_create_funding_instructions") - def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] + def create_funding_instructions( self, **params: Unpack["CustomerCreateFundingInstructionsParams"] ) -> "FundingInstructions": """ @@ -538,6 +540,7 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] async def _cls_create_funding_instructions_async( cls, customer: str, + /, **params: Unpack["CustomerCreateFundingInstructionsParams"], ) -> "FundingInstructions": """ @@ -560,6 +563,7 @@ async def _cls_create_funding_instructions_async( @staticmethod async def create_funding_instructions_async( customer: str, + /, **params: Unpack["CustomerCreateFundingInstructionsParams"], ) -> "FundingInstructions": """ @@ -581,7 +585,7 @@ async def create_funding_instructions_async( ... @class_method_variant("_cls_create_funding_instructions_async") - async def create_funding_instructions_async( # pyright: ignore[reportGeneralTypeIssues] + async def create_funding_instructions_async( self, **params: Unpack["CustomerCreateFundingInstructionsParams"] ) -> "FundingInstructions": """ @@ -602,7 +606,7 @@ async def create_funding_instructions_async( # pyright: ignore[reportGeneralTyp @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["CustomerDeleteParams"] + cls, sid: str, /, **params: Unpack["CustomerDeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. @@ -620,7 +624,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["CustomerDeleteParams"] + sid: str, /, **params: Unpack["CustomerDeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. @@ -635,9 +639,7 @@ def delete(self, **params: Unpack["CustomerDeleteParams"]) -> "Customer": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["CustomerDeleteParams"] - ) -> "Customer": + def delete(self, **params: Unpack["CustomerDeleteParams"]) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ @@ -649,7 +651,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["CustomerDeleteParams"] + cls, sid: str, /, **params: Unpack["CustomerDeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. @@ -667,7 +669,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["CustomerDeleteParams"] + sid: str, /, **params: Unpack["CustomerDeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. @@ -684,7 +686,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["CustomerDeleteParams"] ) -> "Customer": """ @@ -698,7 +700,7 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_delete_discount( - cls, customer: str, **params: Unpack["CustomerDeleteDiscountParams"] + cls, customer: str, /, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -717,7 +719,7 @@ def _cls_delete_discount( @overload @staticmethod def delete_discount( - customer: str, **params: Unpack["CustomerDeleteDiscountParams"] + customer: str, /, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -734,7 +736,7 @@ def delete_discount( ... @class_method_variant("_cls_delete_discount") - def delete_discount( # pyright: ignore[reportGeneralTypeIssues] + def delete_discount( self, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ @@ -753,7 +755,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_discount_async( - cls, customer: str, **params: Unpack["CustomerDeleteDiscountParams"] + cls, customer: str, /, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -772,7 +774,7 @@ async def _cls_delete_discount_async( @overload @staticmethod async def delete_discount_async( - customer: str, **params: Unpack["CustomerDeleteDiscountParams"] + customer: str, /, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -789,7 +791,7 @@ async def delete_discount_async( ... @class_method_variant("_cls_delete_discount_async") - async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_discount_async( self, **params: Unpack["CustomerDeleteDiscountParams"] ) -> "Discount": """ @@ -850,6 +852,7 @@ async def list_async( def _cls_list_payment_methods( cls, customer: str, + /, **params: Unpack["CustomerListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ @@ -869,7 +872,7 @@ def _cls_list_payment_methods( @overload @staticmethod def list_payment_methods( - customer: str, **params: Unpack["CustomerListPaymentMethodsParams"] + customer: str, /, **params: Unpack["CustomerListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -886,7 +889,7 @@ def list_payment_methods( ... @class_method_variant("_cls_list_payment_methods") - def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] + def list_payment_methods( self, **params: Unpack["CustomerListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ @@ -907,6 +910,7 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_payment_methods_async( cls, customer: str, + /, **params: Unpack["CustomerListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ @@ -926,7 +930,7 @@ async def _cls_list_payment_methods_async( @overload @staticmethod async def list_payment_methods_async( - customer: str, **params: Unpack["CustomerListPaymentMethodsParams"] + customer: str, /, **params: Unpack["CustomerListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -943,7 +947,7 @@ async def list_payment_methods_async( ... @class_method_variant("_cls_list_payment_methods_async") - async def list_payment_methods_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_payment_methods_async( self, **params: Unpack["CustomerListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ @@ -962,7 +966,7 @@ async def list_payment_methods_async( # pyright: ignore[reportGeneralTypeIssues @classmethod def modify( - cls, id: str, **params: Unpack["CustomerModifyParams"] + cls, id: str, /, **params: Unpack["CustomerModifyParams"] ) -> "Customer": """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided are left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (such as a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled is retried. This retry doesn't count as an automatic retry, and doesn't affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer doesn't trigger this behavior. @@ -981,7 +985,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["CustomerModifyParams"] + cls, id: str, /, **params: Unpack["CustomerModifyParams"] ) -> "Customer": """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided are left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (such as a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled is retried. This retry doesn't count as an automatic retry, and doesn't affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer doesn't trigger this behavior. @@ -1025,6 +1029,7 @@ def _cls_retrieve_payment_method( cls, customer: str, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1047,6 +1052,7 @@ def _cls_retrieve_payment_method( def retrieve_payment_method( customer: str, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1058,6 +1064,7 @@ def retrieve_payment_method( def retrieve_payment_method( self, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1066,9 +1073,10 @@ def retrieve_payment_method( ... @class_method_variant("_cls_retrieve_payment_method") - def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] + def retrieve_payment_method( self, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1091,6 +1099,7 @@ async def _cls_retrieve_payment_method_async( cls, customer: str, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1113,6 +1122,7 @@ async def _cls_retrieve_payment_method_async( async def retrieve_payment_method_async( customer: str, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1124,6 +1134,7 @@ async def retrieve_payment_method_async( async def retrieve_payment_method_async( self, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1132,9 +1143,10 @@ async def retrieve_payment_method_async( ... @class_method_variant("_cls_retrieve_payment_method_async") - async def retrieve_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + async def retrieve_payment_method_async( self, payment_method: str, + /, **params: Unpack["CustomerRetrievePaymentMethodParams"], ) -> "PaymentMethod": """ @@ -1194,6 +1206,7 @@ async def search_auto_paging_iter_async( def list_balance_transactions( cls, customer: str, + /, **params: Unpack["CustomerListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ @@ -1214,6 +1227,7 @@ def list_balance_transactions( async def list_balance_transactions_async( cls, customer: str, + /, **params: Unpack["CustomerListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ @@ -1234,6 +1248,7 @@ async def list_balance_transactions_async( def create_balance_transaction( cls, customer: str, + /, **params: Unpack["CustomerCreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1254,6 +1269,7 @@ def create_balance_transaction( async def create_balance_transaction_async( cls, customer: str, + /, **params: Unpack["CustomerCreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1275,6 +1291,7 @@ def retrieve_balance_transaction( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerRetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1297,6 +1314,7 @@ async def retrieve_balance_transaction_async( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerRetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1319,6 +1337,7 @@ def modify_balance_transaction( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1341,6 +1360,7 @@ async def modify_balance_transaction_async( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ @@ -1362,6 +1382,7 @@ async def modify_balance_transaction_async( def list_cash_balance_transactions( cls, customer: str, + /, **params: Unpack["CustomerListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ @@ -1382,6 +1403,7 @@ def list_cash_balance_transactions( async def list_cash_balance_transactions_async( cls, customer: str, + /, **params: Unpack["CustomerListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ @@ -1403,6 +1425,7 @@ def retrieve_cash_balance_transaction( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerRetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ @@ -1425,6 +1448,7 @@ async def retrieve_cash_balance_transaction_async( cls, customer: str, transaction: str, + /, **params: Unpack["CustomerRetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ @@ -1444,7 +1468,7 @@ async def retrieve_cash_balance_transaction_async( @classmethod def list_sources( - cls, customer: str, **params: Unpack["CustomerListSourcesParams"] + cls, customer: str, /, **params: Unpack["CustomerListSourcesParams"] ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: """ List sources for a specified customer. @@ -1462,7 +1486,7 @@ def list_sources( @classmethod async def list_sources_async( - cls, customer: str, **params: Unpack["CustomerListSourcesParams"] + cls, customer: str, /, **params: Unpack["CustomerListSourcesParams"] ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: """ List sources for a specified customer. @@ -1480,7 +1504,7 @@ async def list_sources_async( @classmethod def create_source( - cls, customer: str, **params: Unpack["CustomerCreateSourceParams"] + cls, customer: str, /, **params: Unpack["CustomerCreateSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. @@ -1502,7 +1526,7 @@ def create_source( @classmethod async def create_source_async( - cls, customer: str, **params: Unpack["CustomerCreateSourceParams"] + cls, customer: str, /, **params: Unpack["CustomerCreateSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. @@ -1527,6 +1551,7 @@ def retrieve_source( cls, customer: str, id: str, + /, **params: Unpack["CustomerRetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1548,6 +1573,7 @@ async def retrieve_source_async( cls, customer: str, id: str, + /, **params: Unpack["CustomerRetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1569,6 +1595,7 @@ def modify_source( cls, customer: str, id: str, + /, **params: Unpack["CustomerModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1590,6 +1617,7 @@ async def modify_source_async( cls, customer: str, id: str, + /, **params: Unpack["CustomerModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1611,6 +1639,7 @@ def delete_source( cls, customer: str, id: str, + /, **params: Unpack["CustomerDeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1632,6 +1661,7 @@ async def delete_source_async( cls, customer: str, id: str, + /, **params: Unpack["CustomerDeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -1650,7 +1680,7 @@ async def delete_source_async( @classmethod def create_tax_id( - cls, customer: str, **params: Unpack["CustomerCreateTaxIdParams"] + cls, customer: str, /, **params: Unpack["CustomerCreateTaxIdParams"] ) -> "TaxId": """ Creates a new tax_id object for a customer. @@ -1668,7 +1698,7 @@ def create_tax_id( @classmethod async def create_tax_id_async( - cls, customer: str, **params: Unpack["CustomerCreateTaxIdParams"] + cls, customer: str, /, **params: Unpack["CustomerCreateTaxIdParams"] ) -> "TaxId": """ Creates a new tax_id object for a customer. @@ -1689,6 +1719,7 @@ def retrieve_tax_id( cls, customer: str, id: str, + /, **params: Unpack["CustomerRetrieveTaxIdParams"], ) -> "TaxId": """ @@ -1710,6 +1741,7 @@ async def retrieve_tax_id_async( cls, customer: str, id: str, + /, **params: Unpack["CustomerRetrieveTaxIdParams"], ) -> "TaxId": """ @@ -1731,6 +1763,7 @@ def delete_tax_id( cls, customer: str, id: str, + /, **params: Unpack["CustomerDeleteTaxIdParams"], ) -> "TaxId": """ @@ -1752,6 +1785,7 @@ async def delete_tax_id_async( cls, customer: str, id: str, + /, **params: Unpack["CustomerDeleteTaxIdParams"], ) -> "TaxId": """ @@ -1770,7 +1804,7 @@ async def delete_tax_id_async( @classmethod def list_tax_ids( - cls, customer: str, **params: Unpack["CustomerListTaxIdsParams"] + cls, customer: str, /, **params: Unpack["CustomerListTaxIdsParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs for a customer. @@ -1788,7 +1822,7 @@ def list_tax_ids( @classmethod async def list_tax_ids_async( - cls, customer: str, **params: Unpack["CustomerListTaxIdsParams"] + cls, customer: str, /, **params: Unpack["CustomerListTaxIdsParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs for a customer. @@ -1808,6 +1842,7 @@ async def list_tax_ids_async( def retrieve_cash_balance( cls, customer: str, + /, **params: Unpack["CustomerRetrieveCashBalanceParams"], ) -> "CashBalance": """ @@ -1828,6 +1863,7 @@ def retrieve_cash_balance( async def retrieve_cash_balance_async( cls, customer: str, + /, **params: Unpack["CustomerRetrieveCashBalanceParams"], ) -> "CashBalance": """ @@ -1846,7 +1882,10 @@ async def retrieve_cash_balance_async( @classmethod def modify_cash_balance( - cls, customer: str, **params: Unpack["CustomerModifyCashBalanceParams"] + cls, + customer: str, + /, + **params: Unpack["CustomerModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. @@ -1864,7 +1903,10 @@ def modify_cash_balance( @classmethod async def modify_cash_balance_async( - cls, customer: str, **params: Unpack["CustomerModifyCashBalanceParams"] + cls, + customer: str, + /, + **params: Unpack["CustomerModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. @@ -1887,6 +1929,7 @@ class TestHelpers(APIResourceTestHelpers["Customer"]): def _cls_fund_cash_balance( cls, customer: str, + /, **params: Unpack["CustomerFundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ @@ -1906,7 +1949,7 @@ def _cls_fund_cash_balance( @overload @staticmethod def fund_cash_balance( - customer: str, **params: Unpack["CustomerFundCashBalanceParams"] + customer: str, /, **params: Unpack["CustomerFundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -1923,7 +1966,7 @@ def fund_cash_balance( ... @class_method_variant("_cls_fund_cash_balance") - def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] + def fund_cash_balance( self, **params: Unpack["CustomerFundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ @@ -1944,6 +1987,7 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] async def _cls_fund_cash_balance_async( cls, customer: str, + /, **params: Unpack["CustomerFundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ @@ -1963,7 +2007,7 @@ async def _cls_fund_cash_balance_async( @overload @staticmethod async def fund_cash_balance_async( - customer: str, **params: Unpack["CustomerFundCashBalanceParams"] + customer: str, /, **params: Unpack["CustomerFundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -1980,7 +2024,7 @@ async def fund_cash_balance_async( ... @class_method_variant("_cls_fund_cash_balance_async") - async def fund_cash_balance_async( # pyright: ignore[reportGeneralTypeIssues] + async def fund_cash_balance_async( self, **params: Unpack["CustomerFundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ diff --git a/stripe/_customer_balance_transaction_service.py b/stripe/_customer_balance_transaction_service.py index 5a4feab8c..5c52b89da 100644 --- a/stripe/_customer_balance_transaction_service.py +++ b/stripe/_customer_balance_transaction_service.py @@ -27,6 +27,7 @@ class CustomerBalanceTransactionService(StripeService): def list( self, customer: str, + /, params: Optional["CustomerBalanceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CustomerBalanceTransaction]": @@ -49,6 +50,7 @@ def list( async def list_async( self, customer: str, + /, params: Optional["CustomerBalanceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CustomerBalanceTransaction]": @@ -71,6 +73,7 @@ async def list_async( def create( self, customer: str, + /, params: "CustomerBalanceTransactionCreateParams", options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": @@ -93,6 +96,7 @@ def create( async def create_async( self, customer: str, + /, params: "CustomerBalanceTransactionCreateParams", options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": @@ -116,6 +120,7 @@ def retrieve( self, customer: str, transaction: str, + /, params: Optional["CustomerBalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": @@ -140,6 +145,7 @@ async def retrieve_async( self, customer: str, transaction: str, + /, params: Optional["CustomerBalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": @@ -164,6 +170,7 @@ def update( self, customer: str, transaction: str, + /, params: Optional["CustomerBalanceTransactionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": @@ -188,6 +195,7 @@ async def update_async( self, customer: str, transaction: str, + /, params: Optional["CustomerBalanceTransactionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CustomerBalanceTransaction": diff --git a/stripe/_customer_cash_balance_service.py b/stripe/_customer_cash_balance_service.py index 80ea75f17..05ac73314 100644 --- a/stripe/_customer_cash_balance_service.py +++ b/stripe/_customer_cash_balance_service.py @@ -20,6 +20,7 @@ class CustomerCashBalanceService(StripeService): def retrieve( self, customer: str, + /, params: Optional["CustomerCashBalanceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CashBalance": @@ -42,6 +43,7 @@ def retrieve( async def retrieve_async( self, customer: str, + /, params: Optional["CustomerCashBalanceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CashBalance": @@ -64,6 +66,7 @@ async def retrieve_async( def update( self, customer: str, + /, params: Optional["CustomerCashBalanceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CashBalance": @@ -86,6 +89,7 @@ def update( async def update_async( self, customer: str, + /, params: Optional["CustomerCashBalanceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CashBalance": diff --git a/stripe/_customer_cash_balance_transaction_service.py b/stripe/_customer_cash_balance_transaction_service.py index e9ceb3203..5e25ad234 100644 --- a/stripe/_customer_cash_balance_transaction_service.py +++ b/stripe/_customer_cash_balance_transaction_service.py @@ -23,6 +23,7 @@ class CustomerCashBalanceTransactionService(StripeService): def list( self, customer: str, + /, params: Optional["CustomerCashBalanceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CustomerCashBalanceTransaction]": @@ -45,6 +46,7 @@ def list( async def list_async( self, customer: str, + /, params: Optional["CustomerCashBalanceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CustomerCashBalanceTransaction]": @@ -68,6 +70,7 @@ def retrieve( self, customer: str, transaction: str, + /, params: Optional[ "CustomerCashBalanceTransactionRetrieveParams" ] = None, @@ -94,6 +97,7 @@ async def retrieve_async( self, customer: str, transaction: str, + /, params: Optional[ "CustomerCashBalanceTransactionRetrieveParams" ] = None, diff --git a/stripe/_customer_funding_instructions_service.py b/stripe/_customer_funding_instructions_service.py index 463434fe7..673c64ff1 100644 --- a/stripe/_customer_funding_instructions_service.py +++ b/stripe/_customer_funding_instructions_service.py @@ -17,6 +17,7 @@ class CustomerFundingInstructionsService(StripeService): def create( self, customer: str, + /, params: "CustomerFundingInstructionsCreateParams", options: Optional["RequestOptions"] = None, ) -> "FundingInstructions": @@ -41,6 +42,7 @@ def create( async def create_async( self, customer: str, + /, params: "CustomerFundingInstructionsCreateParams", options: Optional["RequestOptions"] = None, ) -> "FundingInstructions": diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 05d0e9b6d..48eaa5fbb 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -21,6 +21,7 @@ class CustomerPaymentMethodService(StripeService): def list( self, customer: str, + /, params: Optional["CustomerPaymentMethodListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[PaymentMethod]": @@ -43,6 +44,7 @@ def list( async def list_async( self, customer: str, + /, params: Optional["CustomerPaymentMethodListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[PaymentMethod]": @@ -66,6 +68,7 @@ def retrieve( self, customer: str, payment_method: str, + /, params: Optional["CustomerPaymentMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -90,6 +93,7 @@ async def retrieve_async( self, customer: str, payment_method: str, + /, params: Optional["CustomerPaymentMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 589ccff6d..606eeac0a 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -37,6 +37,7 @@ class CustomerPaymentSourceService(StripeService): def list( self, customer: str, + /, params: Optional["CustomerPaymentSourceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Union[Account, BankAccount, Card, Source]]": @@ -59,6 +60,7 @@ def list( async def list_async( self, customer: str, + /, params: Optional["CustomerPaymentSourceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[Union[Account, BankAccount, Card, Source]]": @@ -81,6 +83,7 @@ async def list_async( def create( self, customer: str, + /, params: "CustomerPaymentSourceCreateParams", options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -107,6 +110,7 @@ def create( async def create_async( self, customer: str, + /, params: "CustomerPaymentSourceCreateParams", options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -134,6 +138,7 @@ def retrieve( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -158,6 +163,7 @@ async def retrieve_async( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -182,6 +188,7 @@ def update( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -206,6 +213,7 @@ async def update_async( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -230,6 +238,7 @@ def delete( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -254,6 +263,7 @@ async def delete_async( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -278,6 +288,7 @@ def verify( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceVerifyParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BankAccount": @@ -302,6 +313,7 @@ async def verify_async( self, customer: str, id: str, + /, params: Optional["CustomerPaymentSourceVerifyParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BankAccount": diff --git a/stripe/_customer_service.py b/stripe/_customer_service.py index b82d40da9..97f578e66 100644 --- a/stripe/_customer_service.py +++ b/stripe/_customer_service.py @@ -104,6 +104,7 @@ def __getattr__(self, name): def delete( self, customer: str, + /, params: Optional["CustomerDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -126,6 +127,7 @@ def delete( async def delete_async( self, customer: str, + /, params: Optional["CustomerDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -148,6 +150,7 @@ async def delete_async( def retrieve( self, customer: str, + /, params: Optional["CustomerRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -170,6 +173,7 @@ def retrieve( async def retrieve_async( self, customer: str, + /, params: Optional["CustomerRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -192,6 +196,7 @@ async def retrieve_async( def update( self, customer: str, + /, params: Optional["CustomerUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -216,6 +221,7 @@ def update( async def update_async( self, customer: str, + /, params: Optional["CustomerUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Customer": @@ -240,6 +246,7 @@ async def update_async( def delete_discount( self, customer: str, + /, params: Optional["CustomerDeleteDiscountParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Discount": @@ -262,6 +269,7 @@ def delete_discount( async def delete_discount_async( self, customer: str, + /, params: Optional["CustomerDeleteDiscountParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Discount": @@ -404,6 +412,7 @@ async def search_async( def serialize_batch_update( self, customer: str, + /, params: Optional["CustomerUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: diff --git a/stripe/_customer_tax_id_service.py b/stripe/_customer_tax_id_service.py index 617c1f895..6b4a7bf1a 100644 --- a/stripe/_customer_tax_id_service.py +++ b/stripe/_customer_tax_id_service.py @@ -28,6 +28,7 @@ def delete( self, customer: str, id: str, + /, params: Optional["CustomerTaxIdDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -52,6 +53,7 @@ async def delete_async( self, customer: str, id: str, + /, params: Optional["CustomerTaxIdDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -76,6 +78,7 @@ def retrieve( self, customer: str, id: str, + /, params: Optional["CustomerTaxIdRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -100,6 +103,7 @@ async def retrieve_async( self, customer: str, id: str, + /, params: Optional["CustomerTaxIdRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -123,6 +127,7 @@ async def retrieve_async( def list( self, customer: str, + /, params: Optional["CustomerTaxIdListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[TaxId]": @@ -145,6 +150,7 @@ def list( async def list_async( self, customer: str, + /, params: Optional["CustomerTaxIdListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[TaxId]": @@ -167,6 +173,7 @@ async def list_async( def create( self, customer: str, + /, params: "CustomerTaxIdCreateParams", options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -189,6 +196,7 @@ def create( async def create_async( self, customer: str, + /, params: "CustomerTaxIdCreateParams", options: Optional["RequestOptions"] = None, ) -> "TaxId": diff --git a/stripe/_discount.py b/stripe/_discount.py index d62b10208..c8f55f2d5 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -13,7 +13,7 @@ class Discount(StripeObject): """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -26,7 +26,7 @@ class Source(StripeObject): """ The coupon that was redeemed to create this discount. """ - type: Literal["coupon"] + type: Union[Literal["coupon"], str] """ The source type of the discount. """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 447d750bd..00f8ff4dc 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -34,6 +34,20 @@ class Dispute( OBJECT_NAME: ClassVar[Literal["dispute"]] = "dispute" class Evidence(StripeObject): + class Appeal(StripeObject): + class Card(StripeObject): + reason_for_filing: Optional[str] + """ + The reason for filing the appeal. + """ + supporting_files: Optional[List[str]] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `dispute_evidence` to support the appeal. + """ + + card: Optional[Card] + _inner_class_types = {"card": Card} + class EnhancedEvidence(StripeObject): class MastercardCompliance(StripeObject): fee_acknowledged: bool @@ -198,6 +212,7 @@ class VisaCompliance(StripeObject): """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. """ + appeal: Optional[Appeal] billing_address: Optional[str] """ The billing address provided by the customer. @@ -303,7 +318,10 @@ class VisaCompliance(StripeObject): """ Any additional evidence or statements. """ - _inner_class_types = {"enhanced_evidence": EnhancedEvidence} + _inner_class_types = { + "appeal": Appeal, + "enhanced_evidence": EnhancedEvidence, + } class EvidenceDetails(StripeObject): class EnhancedEligibility(StripeObject): @@ -564,7 +582,7 @@ class SmartDisputes(StripeObject): @classmethod def _cls_close( - cls, dispute: str, **params: Unpack["DisputeCloseParams"] + cls, dispute: str, /, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. @@ -585,7 +603,7 @@ def _cls_close( @overload @staticmethod def close( - dispute: str, **params: Unpack["DisputeCloseParams"] + dispute: str, /, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. @@ -604,9 +622,7 @@ def close(self, **params: Unpack["DisputeCloseParams"]) -> "Dispute": ... @class_method_variant("_cls_close") - def close( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["DisputeCloseParams"] - ) -> "Dispute": + def close(self, **params: Unpack["DisputeCloseParams"]) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. @@ -625,7 +641,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_close_async( - cls, dispute: str, **params: Unpack["DisputeCloseParams"] + cls, dispute: str, /, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. @@ -646,7 +662,7 @@ async def _cls_close_async( @overload @staticmethod async def close_async( - dispute: str, **params: Unpack["DisputeCloseParams"] + dispute: str, /, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. @@ -667,7 +683,7 @@ async def close_async( ... @class_method_variant("_cls_close_async") - async def close_async( # pyright: ignore[reportGeneralTypeIssues] + async def close_async( self, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ @@ -728,7 +744,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["DisputeModifyParams"] + cls, id: str, /, **params: Unpack["DisputeModifyParams"] ) -> "Dispute": """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. @@ -747,7 +763,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["DisputeModifyParams"] + cls, id: str, /, **params: Unpack["DisputeModifyParams"] ) -> "Dispute": """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index 0d4345fe4..ab89167af 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, dispute: str, + /, params: Optional["DisputeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -77,6 +78,7 @@ def retrieve( async def retrieve_async( self, dispute: str, + /, params: Optional["DisputeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -97,6 +99,7 @@ async def retrieve_async( def update( self, dispute: str, + /, params: Optional["DisputeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -119,6 +122,7 @@ def update( async def update_async( self, dispute: str, + /, params: Optional["DisputeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -141,6 +145,7 @@ async def update_async( def close( self, dispute: str, + /, params: Optional["DisputeCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -165,6 +170,7 @@ def close( async def close_async( self, dispute: str, + /, params: Optional["DisputeCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 88766347f..5ca8ca1e9 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -51,7 +51,7 @@ class EphemeralKey( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["EphemeralKeyDeleteParams"] + cls, sid: str, /, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. @@ -69,7 +69,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["EphemeralKeyDeleteParams"] + sid: str, /, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. @@ -86,7 +86,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ @@ -100,7 +100,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["EphemeralKeyDeleteParams"] + cls, sid: str, /, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. @@ -118,7 +118,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["EphemeralKeyDeleteParams"] + sid: str, /, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. @@ -135,7 +135,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["EphemeralKeyDeleteParams"] ) -> "EphemeralKey": """ diff --git a/stripe/_ephemeral_key_service.py b/stripe/_ephemeral_key_service.py index a8d45b08a..20cafc5a0 100644 --- a/stripe/_ephemeral_key_service.py +++ b/stripe/_ephemeral_key_service.py @@ -20,6 +20,7 @@ class EphemeralKeyService(StripeService): def delete( self, key: str, + /, params: Optional["EphemeralKeyDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EphemeralKey": @@ -40,6 +41,7 @@ def delete( async def delete_async( self, key: str, + /, params: Optional["EphemeralKeyDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EphemeralKey": diff --git a/stripe/_error.py b/stripe/_error.py index c882414cd..7272e606e 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -226,10 +226,6 @@ class ControlledByAlternateResourceError(StripeError): pass -class ControlledByDashboardError(StripeError): - pass - - class FeatureNotEnabledError(StripeError): pass @@ -268,6 +264,28 @@ class InvalidPayoutMethodError(StripeError): pass +class InvalidVaultedCredentialError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + invalid_param=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.invalid_param = invalid_param + + class NonZeroBalanceError(StripeError): pass @@ -288,4 +306,70 @@ class TemporarySessionExpiredError(StripeError): pass +class VerificationAttemptFailedError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + verification_status=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.verification_status = verification_status + + +class VerificationExpiredError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + verification_status=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.verification_status = verification_status + + +class VerificationNotInitiatedError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + verification_status=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.verification_status = verification_status + + # classDefinitions: The end of the section generated from our OpenAPI spec diff --git a/stripe/_error_object.py b/stripe/_error_object.py index 4cc563123..37998e7b3 100644 --- a/stripe/_error_object.py +++ b/stripe/_error_object.py @@ -17,7 +17,7 @@ class ErrorObject(StripeObject): # errorAnnotations: The beginning of the section generated from our OpenAPI spec advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ diff --git a/stripe/_event.py b/stripe/_event.py index 913a04347..70a8fe9f3 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -38,7 +38,7 @@ class Event(ListableAPIResource["Event"]): class Data(StripeObject): object: UntypedStripeObject[Any] """ - Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://api.stripe.com#invoice_object) as the value of the object key. + Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://docs.stripe.com/api#invoice_object) as the value of the object key. """ previous_attributes: Optional[UntypedStripeObject[Any]] """ @@ -153,6 +153,9 @@ class Request(StripeObject): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/_event_notification_handler.py b/stripe/_event_notification_handler.py index 635dd3209..a39d4edf2 100644 --- a/stripe/_event_notification_handler.py +++ b/stripe/_event_notification_handler.py @@ -39,12 +39,660 @@ from stripe._stripe_client import StripeClient # event-notification-types: The beginning of the section generated from our OpenAPI spec + 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_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_balance_settings_updated_event import ( + V1BalanceSettingsUpdatedEventNotification, + ) + from stripe.events._v1_billing_alert_triggered_event import ( + V1BillingAlertTriggeredEventNotification, + ) + from stripe.events._v1_billing_credit_balance_transaction_created_event import ( + V1BillingCreditBalanceTransactionCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_created_event import ( + V1BillingCreditGrantCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_updated_event import ( + V1BillingCreditGrantUpdatedEventNotification, + ) + from stripe.events._v1_billing_meter_created_event import ( + V1BillingMeterCreatedEventNotification, + ) + from stripe.events._v1_billing_meter_deactivated_event import ( + V1BillingMeterDeactivatedEventNotification, + ) 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_meter_reactivated_event import ( + V1BillingMeterReactivatedEventNotification, + ) + from stripe.events._v1_billing_meter_updated_event import ( + V1BillingMeterUpdatedEventNotification, + ) + 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_discount_created_event import ( + V1CustomerDiscountCreatedEventNotification, + ) + from stripe.events._v1_customer_discount_deleted_event import ( + V1CustomerDiscountDeletedEventNotification, + ) + from stripe.events._v1_customer_discount_updated_event import ( + V1CustomerDiscountUpdatedEventNotification, + ) + 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_account_numbers_updated_event import ( + V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, + ) + 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_expected_deactivation_date_updated_event import ( + V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, + ) + 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_financial_connections_account_supported_payment_method_types_updated_event import ( + V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event import ( + V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_deactivation_event import ( + V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, + ) + 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_attempt_required_event import ( + V1InvoicePaymentAttemptRequiredEventNotification, + ) + 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_commerce_product_catalog_imports_failed_event import ( V2CommerceProductCatalogImportsFailedEventNotification, ) @@ -321,6 +969,12 @@ from stripe.events._v2_signals_account_evaluation_complete_event import ( V2SignalsAccountEvaluationCompleteEventNotification, ) + from stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event import ( + V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, + ) + from stripe.events._v2_signals_account_signal_fraudulent_website_ready_event import ( + V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification, + ) # event-notification-types: The end of the section generated from our OpenAPI spec # internal type to represent any EventNotification subclass @@ -345,140 +999,2948 @@ class UnhandledNotificationDetails: CallbackReturn = TypeVar("CallbackReturn") PreHandleReturn = TypeVar("PreHandleReturn") -_FallbackCallback = Callable[ - [EventNotification, "StripeClient", UnhandledNotificationDetails], - CallbackReturn, -] +_FallbackCallback = Callable[ + [EventNotification, "StripeClient", UnhandledNotificationDetails], + CallbackReturn, +] + +_PreHandleCallback = Callable[ + [EventNotification, "StripeClient"], PreHandleReturn +] + +FallbackCallback = _FallbackCallback[None] +""" +Called when no other callback is registered for a given event notification type. +""" + +AsyncFallbackCallback = _FallbackCallback[Awaitable[None]] +""" +This async function is called when no other callback is registered for a given event notification type. +""" + +PreHandleCallback = _PreHandleCallback[bool] +""" +Called before any of your callbacks are run. Useful for filtering. +""" + +AsyncPreHandleCallback = _PreHandleCallback[Awaitable[bool]] +""" +This async function is called before any of your callbacks are run. Useful for filtering. +""" + + +class _BaseEventNotificationHandler(Generic[CallbackReturn, PreHandleReturn]): + """ + Shared internal registration machinery for the user-facing event handlers. + + Holds everything that doesn't depend on whether callbacks are awaited; the + sync and async subclasses below add only the dispatch loop itself. + """ + + def __init__( + self, + client: "StripeClient", + fallback_callback: _FallbackCallback[CallbackReturn], + ) -> None: + self._registered_handlers = {} + self._client = client + self.fallback_callback = fallback_callback + # once this is true, adding additional handlers results in an error + self._has_handled_events = False + self._pre_handle_callback: Optional[ + _PreHandleCallback[PreHandleReturn] + ] = None + + def _assert_hasnt_handled(self) -> None: + """ + Callbacks are expected to be registered on startup, so registering anything after handling an event indicates a bug. + """ + if self._has_handled_events: + raise RuntimeError( + "Cannot register new callbacks after an event has been handled. This is indicative of a bug." + ) + + def pre_handle( + self, func: _PreHandleCallback[PreHandleReturn] + ) -> _PreHandleCallback[PreHandleReturn]: + """ + Registers a function that will be run before any event-specific callbacks. A useful place to store event-agnostic logic, such as logging or checking for [duplicate event deliveries](https://docs.stripe.com/webhooks#handle-duplicate-events). + + Returning `True` causes handling to continue as normal; returning `False` returns from `.handle()` immediately, so neither the registered callback nor the fallback callback are called. + """ + self._assert_hasnt_handled() + if self._pre_handle_callback: + raise ValueError("A pre_handle callback is already registered") + + self._pre_handle_callback = func + return func + + def _callback_for(self, event_notif: "EventNotification"): + """ + Returns the callback registered for this event's type, if any. + """ + return self._registered_handlers.get(event_notif.type) + + def _unhandled_details( + self, event_notif: "EventNotification" + ) -> UnhandledNotificationDetails: + return UnhandledNotificationDetails( + is_known_event_type=not isinstance( + event_notif, UnknownEventNotification + ) + ) + + def _register( + self, + event_type: str, + func: "Callable[[EventNotificationChild, StripeClient], CallbackReturn]", + ) -> None: + self._assert_hasnt_handled() + if event_type in self._registered_handlers: + raise ValueError( + f'Callback for event type "{event_type}" is already registered' + ) + + self._registered_handlers[event_type] = func + + @property + def registered_event_types(self) -> List[str]: + """ + Returns an alphabetized list of all event types that have registered handlers. + """ + return sorted(self._registered_handlers.keys()) + + # event-notification-registration-methods: The beginning of the section generated from our OpenAPI spec + def on_v1_account_application_authorized( + self, + func: "Callable[[V1AccountApplicationAuthorizedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountApplicationAuthorizedEvent` (`v1.account.application.authorized`) event notification. + """ + self._register( + "v1.account.application.authorized", + func, + ) + return func + + def on_v1_account_application_deauthorized( + self, + func: "Callable[[V1AccountApplicationDeauthorizedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountApplicationDeauthorizedEvent` (`v1.account.application.deauthorized`) event notification. + """ + self._register( + "v1.account.application.deauthorized", + func, + ) + return func + + def on_v1_account_external_account_created( + self, + func: "Callable[[V1AccountExternalAccountCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountExternalAccountCreatedEvent` (`v1.account.external_account.created`) event notification. + """ + self._register( + "v1.account.external_account.created", + func, + ) + return func + + def on_v1_account_external_account_deleted( + self, + func: "Callable[[V1AccountExternalAccountDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountExternalAccountDeletedEvent` (`v1.account.external_account.deleted`) event notification. + """ + self._register( + "v1.account.external_account.deleted", + func, + ) + return func + + def on_v1_account_external_account_updated( + self, + func: "Callable[[V1AccountExternalAccountUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountExternalAccountUpdatedEvent` (`v1.account.external_account.updated`) event notification. + """ + self._register( + "v1.account.external_account.updated", + func, + ) + return func + + def on_v1_account_updated( + self, + func: "Callable[[V1AccountUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1AccountUpdatedEvent` (`v1.account.updated`) event notification. + """ + self._register( + "v1.account.updated", + func, + ) + return func + + def on_v1_application_fee_created( + self, + func: "Callable[[V1ApplicationFeeCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ApplicationFeeCreatedEvent` (`v1.application_fee.created`) event notification. + """ + self._register( + "v1.application_fee.created", + func, + ) + return func + + def on_v1_application_fee_refunded( + self, + func: "Callable[[V1ApplicationFeeRefundedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ApplicationFeeRefundedEvent` (`v1.application_fee.refunded`) event notification. + """ + self._register( + "v1.application_fee.refunded", + func, + ) + return func + + def on_v1_application_fee_refund_updated( + self, + func: "Callable[[V1ApplicationFeeRefundUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ApplicationFeeRefundUpdatedEvent` (`v1.application_fee.refund.updated`) event notification. + """ + self._register( + "v1.application_fee.refund.updated", + func, + ) + return func + + def on_v1_balance_available( + self, + func: "Callable[[V1BalanceAvailableEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BalanceAvailableEvent` (`v1.balance.available`) event notification. + """ + self._register( + "v1.balance.available", + func, + ) + return func + + def on_v1_balance_settings_updated( + self, + func: "Callable[[V1BalanceSettingsUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BalanceSettingsUpdatedEvent` (`v1.balance_settings.updated`) event notification. + """ + self._register( + "v1.balance_settings.updated", + func, + ) + return func + + def on_v1_billing_alert_triggered( + self, + func: "Callable[[V1BillingAlertTriggeredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingAlertTriggeredEvent` (`v1.billing.alert.triggered`) event notification. + """ + self._register( + "v1.billing.alert.triggered", + func, + ) + return func + + def on_v1_billing_credit_balance_transaction_created( + self, + func: "Callable[[V1BillingCreditBalanceTransactionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingCreditBalanceTransactionCreatedEvent` (`v1.billing.credit_balance_transaction.created`) event notification. + """ + self._register( + "v1.billing.credit_balance_transaction.created", + func, + ) + return func + + def on_v1_billing_credit_grant_created( + self, + func: "Callable[[V1BillingCreditGrantCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingCreditGrantCreatedEvent` (`v1.billing.credit_grant.created`) event notification. + """ + self._register( + "v1.billing.credit_grant.created", + func, + ) + return func + + def on_v1_billing_credit_grant_updated( + self, + func: "Callable[[V1BillingCreditGrantUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingCreditGrantUpdatedEvent` (`v1.billing.credit_grant.updated`) event notification. + """ + self._register( + "v1.billing.credit_grant.updated", + func, + ) + return func + + def on_v1_billing_meter_created( + self, + func: "Callable[[V1BillingMeterCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterCreatedEvent` (`v1.billing.meter.created`) event notification. + """ + self._register( + "v1.billing.meter.created", + func, + ) + return func + + def on_v1_billing_meter_deactivated( + self, + func: "Callable[[V1BillingMeterDeactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterDeactivatedEvent` (`v1.billing.meter.deactivated`) event notification. + """ + self._register( + "v1.billing.meter.deactivated", + func, + ) + return func + + def on_v1_billing_meter_error_report_triggered( + self, + func: "Callable[[V1BillingMeterErrorReportTriggeredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterErrorReportTriggeredEvent` (`v1.billing.meter.error_report_triggered`) event notification. + """ + self._register( + "v1.billing.meter.error_report_triggered", + func, + ) + return func + + def on_v1_billing_meter_no_meter_found( + self, + func: "Callable[[V1BillingMeterNoMeterFoundEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterNoMeterFoundEvent` (`v1.billing.meter.no_meter_found`) event notification. + """ + self._register( + "v1.billing.meter.no_meter_found", + func, + ) + return func + + def on_v1_billing_meter_reactivated( + self, + func: "Callable[[V1BillingMeterReactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterReactivatedEvent` (`v1.billing.meter.reactivated`) event notification. + """ + self._register( + "v1.billing.meter.reactivated", + func, + ) + return func + + def on_v1_billing_meter_updated( + self, + func: "Callable[[V1BillingMeterUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingMeterUpdatedEvent` (`v1.billing.meter.updated`) event notification. + """ + self._register( + "v1.billing.meter.updated", + func, + ) + return func + + def on_v1_billing_portal_configuration_created( + self, + func: "Callable[[V1BillingPortalConfigurationCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingPortalConfigurationCreatedEvent` (`v1.billing_portal.configuration.created`) event notification. + """ + self._register( + "v1.billing_portal.configuration.created", + func, + ) + return func + + def on_v1_billing_portal_configuration_updated( + self, + func: "Callable[[V1BillingPortalConfigurationUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingPortalConfigurationUpdatedEvent` (`v1.billing_portal.configuration.updated`) event notification. + """ + self._register( + "v1.billing_portal.configuration.updated", + func, + ) + return func + + def on_v1_billing_portal_session_created( + self, + func: "Callable[[V1BillingPortalSessionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1BillingPortalSessionCreatedEvent` (`v1.billing_portal.session.created`) event notification. + """ + self._register( + "v1.billing_portal.session.created", + func, + ) + return func + + def on_v1_capability_updated( + self, + func: "Callable[[V1CapabilityUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CapabilityUpdatedEvent` (`v1.capability.updated`) event notification. + """ + self._register( + "v1.capability.updated", + func, + ) + return func + + def on_v1_cash_balance_funds_available( + self, + func: "Callable[[V1CashBalanceFundsAvailableEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CashBalanceFundsAvailableEvent` (`v1.cash_balance.funds_available`) event notification. + """ + self._register( + "v1.cash_balance.funds_available", + func, + ) + return func + + def on_v1_charge_captured( + self, + func: "Callable[[V1ChargeCapturedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeCapturedEvent` (`v1.charge.captured`) event notification. + """ + self._register( + "v1.charge.captured", + func, + ) + return func + + def on_v1_charge_dispute_closed( + self, + func: "Callable[[V1ChargeDisputeClosedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeDisputeClosedEvent` (`v1.charge.dispute.closed`) event notification. + """ + self._register( + "v1.charge.dispute.closed", + func, + ) + return func + + def on_v1_charge_dispute_created( + self, + func: "Callable[[V1ChargeDisputeCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeDisputeCreatedEvent` (`v1.charge.dispute.created`) event notification. + """ + self._register( + "v1.charge.dispute.created", + func, + ) + return func + + def on_v1_charge_dispute_funds_reinstated( + self, + func: "Callable[[V1ChargeDisputeFundsReinstatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeDisputeFundsReinstatedEvent` (`v1.charge.dispute.funds_reinstated`) event notification. + """ + self._register( + "v1.charge.dispute.funds_reinstated", + func, + ) + return func + + def on_v1_charge_dispute_funds_withdrawn( + self, + func: "Callable[[V1ChargeDisputeFundsWithdrawnEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeDisputeFundsWithdrawnEvent` (`v1.charge.dispute.funds_withdrawn`) event notification. + """ + self._register( + "v1.charge.dispute.funds_withdrawn", + func, + ) + return func + + def on_v1_charge_dispute_updated( + self, + func: "Callable[[V1ChargeDisputeUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeDisputeUpdatedEvent` (`v1.charge.dispute.updated`) event notification. + """ + self._register( + "v1.charge.dispute.updated", + func, + ) + return func + + def on_v1_charge_expired( + self, + func: "Callable[[V1ChargeExpiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeExpiredEvent` (`v1.charge.expired`) event notification. + """ + self._register( + "v1.charge.expired", + func, + ) + return func + + def on_v1_charge_failed( + self, + func: "Callable[[V1ChargeFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeFailedEvent` (`v1.charge.failed`) event notification. + """ + self._register( + "v1.charge.failed", + func, + ) + return func + + def on_v1_charge_pending( + self, + func: "Callable[[V1ChargePendingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargePendingEvent` (`v1.charge.pending`) event notification. + """ + self._register( + "v1.charge.pending", + func, + ) + return func + + def on_v1_charge_refunded( + self, + func: "Callable[[V1ChargeRefundedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeRefundedEvent` (`v1.charge.refunded`) event notification. + """ + self._register( + "v1.charge.refunded", + func, + ) + return func + + def on_v1_charge_refund_updated( + self, + func: "Callable[[V1ChargeRefundUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeRefundUpdatedEvent` (`v1.charge.refund.updated`) event notification. + """ + self._register( + "v1.charge.refund.updated", + func, + ) + return func + + def on_v1_charge_succeeded( + self, + func: "Callable[[V1ChargeSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeSucceededEvent` (`v1.charge.succeeded`) event notification. + """ + self._register( + "v1.charge.succeeded", + func, + ) + return func + + def on_v1_charge_updated( + self, + func: "Callable[[V1ChargeUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ChargeUpdatedEvent` (`v1.charge.updated`) event notification. + """ + self._register( + "v1.charge.updated", + func, + ) + return func + + def on_v1_checkout_session_async_payment_failed( + self, + func: "Callable[[V1CheckoutSessionAsyncPaymentFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CheckoutSessionAsyncPaymentFailedEvent` (`v1.checkout.session.async_payment_failed`) event notification. + """ + self._register( + "v1.checkout.session.async_payment_failed", + func, + ) + return func + + def on_v1_checkout_session_async_payment_succeeded( + self, + func: "Callable[[V1CheckoutSessionAsyncPaymentSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CheckoutSessionAsyncPaymentSucceededEvent` (`v1.checkout.session.async_payment_succeeded`) event notification. + """ + self._register( + "v1.checkout.session.async_payment_succeeded", + func, + ) + return func + + def on_v1_checkout_session_completed( + self, + func: "Callable[[V1CheckoutSessionCompletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CheckoutSessionCompletedEvent` (`v1.checkout.session.completed`) event notification. + """ + self._register( + "v1.checkout.session.completed", + func, + ) + return func + + def on_v1_checkout_session_expired( + self, + func: "Callable[[V1CheckoutSessionExpiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CheckoutSessionExpiredEvent` (`v1.checkout.session.expired`) event notification. + """ + self._register( + "v1.checkout.session.expired", + func, + ) + return func + + def on_v1_climate_order_canceled( + self, + func: "Callable[[V1ClimateOrderCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateOrderCanceledEvent` (`v1.climate.order.canceled`) event notification. + """ + self._register( + "v1.climate.order.canceled", + func, + ) + return func + + def on_v1_climate_order_created( + self, + func: "Callable[[V1ClimateOrderCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateOrderCreatedEvent` (`v1.climate.order.created`) event notification. + """ + self._register( + "v1.climate.order.created", + func, + ) + return func + + def on_v1_climate_order_delayed( + self, + func: "Callable[[V1ClimateOrderDelayedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateOrderDelayedEvent` (`v1.climate.order.delayed`) event notification. + """ + self._register( + "v1.climate.order.delayed", + func, + ) + return func + + def on_v1_climate_order_delivered( + self, + func: "Callable[[V1ClimateOrderDeliveredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateOrderDeliveredEvent` (`v1.climate.order.delivered`) event notification. + """ + self._register( + "v1.climate.order.delivered", + func, + ) + return func + + def on_v1_climate_order_product_substituted( + self, + func: "Callable[[V1ClimateOrderProductSubstitutedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateOrderProductSubstitutedEvent` (`v1.climate.order.product_substituted`) event notification. + """ + self._register( + "v1.climate.order.product_substituted", + func, + ) + return func + + def on_v1_climate_product_created( + self, + func: "Callable[[V1ClimateProductCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateProductCreatedEvent` (`v1.climate.product.created`) event notification. + """ + self._register( + "v1.climate.product.created", + func, + ) + return func + + def on_v1_climate_product_pricing_updated( + self, + func: "Callable[[V1ClimateProductPricingUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ClimateProductPricingUpdatedEvent` (`v1.climate.product.pricing_updated`) event notification. + """ + self._register( + "v1.climate.product.pricing_updated", + func, + ) + return func + + def on_v1_coupon_created( + self, + func: "Callable[[V1CouponCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CouponCreatedEvent` (`v1.coupon.created`) event notification. + """ + self._register( + "v1.coupon.created", + func, + ) + return func + + def on_v1_coupon_deleted( + self, + func: "Callable[[V1CouponDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CouponDeletedEvent` (`v1.coupon.deleted`) event notification. + """ + self._register( + "v1.coupon.deleted", + func, + ) + return func + + def on_v1_coupon_updated( + self, + func: "Callable[[V1CouponUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CouponUpdatedEvent` (`v1.coupon.updated`) event notification. + """ + self._register( + "v1.coupon.updated", + func, + ) + return func + + def on_v1_credit_note_created( + self, + func: "Callable[[V1CreditNoteCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CreditNoteCreatedEvent` (`v1.credit_note.created`) event notification. + """ + self._register( + "v1.credit_note.created", + func, + ) + return func + + def on_v1_credit_note_updated( + self, + func: "Callable[[V1CreditNoteUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CreditNoteUpdatedEvent` (`v1.credit_note.updated`) event notification. + """ + self._register( + "v1.credit_note.updated", + func, + ) + return func + + def on_v1_credit_note_voided( + self, + func: "Callable[[V1CreditNoteVoidedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CreditNoteVoidedEvent` (`v1.credit_note.voided`) event notification. + """ + self._register( + "v1.credit_note.voided", + func, + ) + return func + + def on_v1_customer_cash_balance_transaction_created( + self, + func: "Callable[[V1CustomerCashBalanceTransactionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerCashBalanceTransactionCreatedEvent` (`v1.customer_cash_balance_transaction.created`) event notification. + """ + self._register( + "v1.customer_cash_balance_transaction.created", + func, + ) + return func + + def on_v1_customer_created( + self, + func: "Callable[[V1CustomerCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerCreatedEvent` (`v1.customer.created`) event notification. + """ + self._register( + "v1.customer.created", + func, + ) + return func + + def on_v1_customer_deleted( + self, + func: "Callable[[V1CustomerDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerDeletedEvent` (`v1.customer.deleted`) event notification. + """ + self._register( + "v1.customer.deleted", + func, + ) + return func + + def on_v1_customer_discount_created( + self, + func: "Callable[[V1CustomerDiscountCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerDiscountCreatedEvent` (`v1.customer.discount.created`) event notification. + """ + self._register( + "v1.customer.discount.created", + func, + ) + return func + + def on_v1_customer_discount_deleted( + self, + func: "Callable[[V1CustomerDiscountDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerDiscountDeletedEvent` (`v1.customer.discount.deleted`) event notification. + """ + self._register( + "v1.customer.discount.deleted", + func, + ) + return func + + def on_v1_customer_discount_updated( + self, + func: "Callable[[V1CustomerDiscountUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerDiscountUpdatedEvent` (`v1.customer.discount.updated`) event notification. + """ + self._register( + "v1.customer.discount.updated", + func, + ) + return func + + def on_v1_customer_subscription_created( + self, + func: "Callable[[V1CustomerSubscriptionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionCreatedEvent` (`v1.customer.subscription.created`) event notification. + """ + self._register( + "v1.customer.subscription.created", + func, + ) + return func + + def on_v1_customer_subscription_deleted( + self, + func: "Callable[[V1CustomerSubscriptionDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionDeletedEvent` (`v1.customer.subscription.deleted`) event notification. + """ + self._register( + "v1.customer.subscription.deleted", + func, + ) + return func + + def on_v1_customer_subscription_paused( + self, + func: "Callable[[V1CustomerSubscriptionPausedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionPausedEvent` (`v1.customer.subscription.paused`) event notification. + """ + self._register( + "v1.customer.subscription.paused", + func, + ) + return func + + def on_v1_customer_subscription_pending_update_applied( + self, + func: "Callable[[V1CustomerSubscriptionPendingUpdateAppliedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionPendingUpdateAppliedEvent` (`v1.customer.subscription.pending_update_applied`) event notification. + """ + self._register( + "v1.customer.subscription.pending_update_applied", + func, + ) + return func + + def on_v1_customer_subscription_pending_update_expired( + self, + func: "Callable[[V1CustomerSubscriptionPendingUpdateExpiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionPendingUpdateExpiredEvent` (`v1.customer.subscription.pending_update_expired`) event notification. + """ + self._register( + "v1.customer.subscription.pending_update_expired", + func, + ) + return func + + def on_v1_customer_subscription_resumed( + self, + func: "Callable[[V1CustomerSubscriptionResumedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionResumedEvent` (`v1.customer.subscription.resumed`) event notification. + """ + self._register( + "v1.customer.subscription.resumed", + func, + ) + return func + + def on_v1_customer_subscription_trial_will_end( + self, + func: "Callable[[V1CustomerSubscriptionTrialWillEndEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionTrialWillEndEvent` (`v1.customer.subscription.trial_will_end`) event notification. + """ + self._register( + "v1.customer.subscription.trial_will_end", + func, + ) + return func + + def on_v1_customer_subscription_updated( + self, + func: "Callable[[V1CustomerSubscriptionUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerSubscriptionUpdatedEvent` (`v1.customer.subscription.updated`) event notification. + """ + self._register( + "v1.customer.subscription.updated", + func, + ) + return func + + def on_v1_customer_tax_id_created( + self, + func: "Callable[[V1CustomerTaxIdCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerTaxIdCreatedEvent` (`v1.customer.tax_id.created`) event notification. + """ + self._register( + "v1.customer.tax_id.created", + func, + ) + return func + + def on_v1_customer_tax_id_deleted( + self, + func: "Callable[[V1CustomerTaxIdDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerTaxIdDeletedEvent` (`v1.customer.tax_id.deleted`) event notification. + """ + self._register( + "v1.customer.tax_id.deleted", + func, + ) + return func + + def on_v1_customer_tax_id_updated( + self, + func: "Callable[[V1CustomerTaxIdUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerTaxIdUpdatedEvent` (`v1.customer.tax_id.updated`) event notification. + """ + self._register( + "v1.customer.tax_id.updated", + func, + ) + return func + + def on_v1_customer_updated( + self, + func: "Callable[[V1CustomerUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1CustomerUpdatedEvent` (`v1.customer.updated`) event notification. + """ + self._register( + "v1.customer.updated", + func, + ) + return func + + def on_v1_entitlements_active_entitlement_summary_updated( + self, + func: "Callable[[V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1EntitlementsActiveEntitlementSummaryUpdatedEvent` (`v1.entitlements.active_entitlement_summary.updated`) event notification. + """ + self._register( + "v1.entitlements.active_entitlement_summary.updated", + func, + ) + return func + + def on_v1_file_created( + self, + func: "Callable[[V1FileCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FileCreatedEvent` (`v1.file.created`) event notification. + """ + self._register( + "v1.file.created", + func, + ) + return func + + def on_v1_financial_connections_account_account_numbers_updated( + self, + func: "Callable[[V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountAccountNumbersUpdatedEvent` (`v1.financial_connections.account.account_numbers_updated`) event notification. + """ + self._register( + "v1.financial_connections.account.account_numbers_updated", + func, + ) + return func + + def on_v1_financial_connections_account_created( + self, + func: "Callable[[V1FinancialConnectionsAccountCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountCreatedEvent` (`v1.financial_connections.account.created`) event notification. + """ + self._register( + "v1.financial_connections.account.created", + func, + ) + return func + + def on_v1_financial_connections_account_deactivated( + self, + func: "Callable[[V1FinancialConnectionsAccountDeactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountDeactivatedEvent` (`v1.financial_connections.account.deactivated`) event notification. + """ + self._register( + "v1.financial_connections.account.deactivated", + func, + ) + return func + + def on_v1_financial_connections_account_disconnected( + self, + func: "Callable[[V1FinancialConnectionsAccountDisconnectedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountDisconnectedEvent` (`v1.financial_connections.account.disconnected`) event notification. + """ + self._register( + "v1.financial_connections.account.disconnected", + func, + ) + return func + + def on_v1_financial_connections_account_expected_deactivation_date_updated( + self, + func: "Callable[[V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent` (`v1.financial_connections.account.expected_deactivation_date_updated`) event notification. + """ + self._register( + "v1.financial_connections.account.expected_deactivation_date_updated", + func, + ) + return func + + def on_v1_financial_connections_account_reactivated( + self, + func: "Callable[[V1FinancialConnectionsAccountReactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountReactivatedEvent` (`v1.financial_connections.account.reactivated`) event notification. + """ + self._register( + "v1.financial_connections.account.reactivated", + func, + ) + return func + + def on_v1_financial_connections_account_refreshed_balance( + self, + func: "Callable[[V1FinancialConnectionsAccountRefreshedBalanceEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountRefreshedBalanceEvent` (`v1.financial_connections.account.refreshed_balance`) event notification. + """ + self._register( + "v1.financial_connections.account.refreshed_balance", + func, + ) + return func + + def on_v1_financial_connections_account_refreshed_ownership( + self, + func: "Callable[[V1FinancialConnectionsAccountRefreshedOwnershipEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountRefreshedOwnershipEvent` (`v1.financial_connections.account.refreshed_ownership`) event notification. + """ + self._register( + "v1.financial_connections.account.refreshed_ownership", + func, + ) + return func + + def on_v1_financial_connections_account_refreshed_transactions( + self, + func: "Callable[[V1FinancialConnectionsAccountRefreshedTransactionsEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountRefreshedTransactionsEvent` (`v1.financial_connections.account.refreshed_transactions`) event notification. + """ + self._register( + "v1.financial_connections.account.refreshed_transactions", + func, + ) + return func + + def on_v1_financial_connections_account_supported_payment_method_types_updated( + self, + func: "Callable[[V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent` (`v1.financial_connections.account.supported_payment_method_types_updated`) event notification. + """ + self._register( + "v1.financial_connections.account.supported_payment_method_types_updated", + func, + ) + return func + + def on_v1_financial_connections_account_upcoming_account_number_expiry( + self, + func: "Callable[[V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent` (`v1.financial_connections.account.upcoming_account_number_expiry`) event notification. + """ + self._register( + "v1.financial_connections.account.upcoming_account_number_expiry", + func, + ) + return func + + def on_v1_financial_connections_account_upcoming_deactivation( + self, + func: "Callable[[V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1FinancialConnectionsAccountUpcomingDeactivationEvent` (`v1.financial_connections.account.upcoming_deactivation`) event notification. + """ + self._register( + "v1.financial_connections.account.upcoming_deactivation", + func, + ) + return func + + def on_v1_identity_verification_session_canceled( + self, + func: "Callable[[V1IdentityVerificationSessionCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionCanceledEvent` (`v1.identity.verification_session.canceled`) event notification. + """ + self._register( + "v1.identity.verification_session.canceled", + func, + ) + return func + + def on_v1_identity_verification_session_created( + self, + func: "Callable[[V1IdentityVerificationSessionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionCreatedEvent` (`v1.identity.verification_session.created`) event notification. + """ + self._register( + "v1.identity.verification_session.created", + func, + ) + return func + + def on_v1_identity_verification_session_processing( + self, + func: "Callable[[V1IdentityVerificationSessionProcessingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionProcessingEvent` (`v1.identity.verification_session.processing`) event notification. + """ + self._register( + "v1.identity.verification_session.processing", + func, + ) + return func + + def on_v1_identity_verification_session_redacted( + self, + func: "Callable[[V1IdentityVerificationSessionRedactedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionRedactedEvent` (`v1.identity.verification_session.redacted`) event notification. + """ + self._register( + "v1.identity.verification_session.redacted", + func, + ) + return func + + def on_v1_identity_verification_session_requires_input( + self, + func: "Callable[[V1IdentityVerificationSessionRequiresInputEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionRequiresInputEvent` (`v1.identity.verification_session.requires_input`) event notification. + """ + self._register( + "v1.identity.verification_session.requires_input", + func, + ) + return func + + def on_v1_identity_verification_session_verified( + self, + func: "Callable[[V1IdentityVerificationSessionVerifiedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IdentityVerificationSessionVerifiedEvent` (`v1.identity.verification_session.verified`) event notification. + """ + self._register( + "v1.identity.verification_session.verified", + func, + ) + return func + + def on_v1_invoice_created( + self, + func: "Callable[[V1InvoiceCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceCreatedEvent` (`v1.invoice.created`) event notification. + """ + self._register( + "v1.invoice.created", + func, + ) + return func + + def on_v1_invoice_deleted( + self, + func: "Callable[[V1InvoiceDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceDeletedEvent` (`v1.invoice.deleted`) event notification. + """ + self._register( + "v1.invoice.deleted", + func, + ) + return func + + def on_v1_invoice_finalization_failed( + self, + func: "Callable[[V1InvoiceFinalizationFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceFinalizationFailedEvent` (`v1.invoice.finalization_failed`) event notification. + """ + self._register( + "v1.invoice.finalization_failed", + func, + ) + return func + + def on_v1_invoice_finalized( + self, + func: "Callable[[V1InvoiceFinalizedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceFinalizedEvent` (`v1.invoice.finalized`) event notification. + """ + self._register( + "v1.invoice.finalized", + func, + ) + return func + + def on_v1_invoiceitem_created( + self, + func: "Callable[[V1InvoiceitemCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceitemCreatedEvent` (`v1.invoiceitem.created`) event notification. + """ + self._register( + "v1.invoiceitem.created", + func, + ) + return func + + def on_v1_invoiceitem_deleted( + self, + func: "Callable[[V1InvoiceitemDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceitemDeletedEvent` (`v1.invoiceitem.deleted`) event notification. + """ + self._register( + "v1.invoiceitem.deleted", + func, + ) + return func + + def on_v1_invoice_marked_uncollectible( + self, + func: "Callable[[V1InvoiceMarkedUncollectibleEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceMarkedUncollectibleEvent` (`v1.invoice.marked_uncollectible`) event notification. + """ + self._register( + "v1.invoice.marked_uncollectible", + func, + ) + return func + + def on_v1_invoice_overdue( + self, + func: "Callable[[V1InvoiceOverdueEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceOverdueEvent` (`v1.invoice.overdue`) event notification. + """ + self._register( + "v1.invoice.overdue", + func, + ) + return func + + def on_v1_invoice_overpaid( + self, + func: "Callable[[V1InvoiceOverpaidEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceOverpaidEvent` (`v1.invoice.overpaid`) event notification. + """ + self._register( + "v1.invoice.overpaid", + func, + ) + return func + + def on_v1_invoice_paid( + self, + func: "Callable[[V1InvoicePaidEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaidEvent` (`v1.invoice.paid`) event notification. + """ + self._register( + "v1.invoice.paid", + func, + ) + return func + + def on_v1_invoice_payment_action_required( + self, + func: "Callable[[V1InvoicePaymentActionRequiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaymentActionRequiredEvent` (`v1.invoice.payment_action_required`) event notification. + """ + self._register( + "v1.invoice.payment_action_required", + func, + ) + return func + + def on_v1_invoice_payment_attempt_required( + self, + func: "Callable[[V1InvoicePaymentAttemptRequiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaymentAttemptRequiredEvent` (`v1.invoice.payment_attempt_required`) event notification. + """ + self._register( + "v1.invoice.payment_attempt_required", + func, + ) + return func + + def on_v1_invoice_payment_failed( + self, + func: "Callable[[V1InvoicePaymentFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaymentFailedEvent` (`v1.invoice.payment_failed`) event notification. + """ + self._register( + "v1.invoice.payment_failed", + func, + ) + return func + + def on_v1_invoice_payment_paid( + self, + func: "Callable[[V1InvoicePaymentPaidEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaymentPaidEvent` (`v1.invoice_payment.paid`) event notification. + """ + self._register( + "v1.invoice_payment.paid", + func, + ) + return func + + def on_v1_invoice_payment_succeeded( + self, + func: "Callable[[V1InvoicePaymentSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoicePaymentSucceededEvent` (`v1.invoice.payment_succeeded`) event notification. + """ + self._register( + "v1.invoice.payment_succeeded", + func, + ) + return func + + def on_v1_invoice_sent( + self, + func: "Callable[[V1InvoiceSentEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceSentEvent` (`v1.invoice.sent`) event notification. + """ + self._register( + "v1.invoice.sent", + func, + ) + return func + + def on_v1_invoice_upcoming( + self, + func: "Callable[[V1InvoiceUpcomingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceUpcomingEvent` (`v1.invoice.upcoming`) event notification. + """ + self._register( + "v1.invoice.upcoming", + func, + ) + return func + + def on_v1_invoice_updated( + self, + func: "Callable[[V1InvoiceUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceUpdatedEvent` (`v1.invoice.updated`) event notification. + """ + self._register( + "v1.invoice.updated", + func, + ) + return func + + def on_v1_invoice_voided( + self, + func: "Callable[[V1InvoiceVoidedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceVoidedEvent` (`v1.invoice.voided`) event notification. + """ + self._register( + "v1.invoice.voided", + func, + ) + return func + + def on_v1_invoice_will_be_due( + self, + func: "Callable[[V1InvoiceWillBeDueEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1InvoiceWillBeDueEvent` (`v1.invoice.will_be_due`) event notification. + """ + self._register( + "v1.invoice.will_be_due", + func, + ) + return func + + def on_v1_issuing_authorization_created( + self, + func: "Callable[[V1IssuingAuthorizationCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingAuthorizationCreatedEvent` (`v1.issuing_authorization.created`) event notification. + """ + self._register( + "v1.issuing_authorization.created", + func, + ) + return func + + def on_v1_issuing_authorization_request( + self, + func: "Callable[[V1IssuingAuthorizationRequestEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingAuthorizationRequestEvent` (`v1.issuing_authorization.request`) event notification. + """ + self._register( + "v1.issuing_authorization.request", + func, + ) + return func + + def on_v1_issuing_authorization_updated( + self, + func: "Callable[[V1IssuingAuthorizationUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingAuthorizationUpdatedEvent` (`v1.issuing_authorization.updated`) event notification. + """ + self._register( + "v1.issuing_authorization.updated", + func, + ) + return func + + def on_v1_issuing_card_created( + self, + func: "Callable[[V1IssuingCardCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingCardCreatedEvent` (`v1.issuing_card.created`) event notification. + """ + self._register( + "v1.issuing_card.created", + func, + ) + return func + + def on_v1_issuing_cardholder_created( + self, + func: "Callable[[V1IssuingCardholderCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingCardholderCreatedEvent` (`v1.issuing_cardholder.created`) event notification. + """ + self._register( + "v1.issuing_cardholder.created", + func, + ) + return func + + def on_v1_issuing_cardholder_updated( + self, + func: "Callable[[V1IssuingCardholderUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingCardholderUpdatedEvent` (`v1.issuing_cardholder.updated`) event notification. + """ + self._register( + "v1.issuing_cardholder.updated", + func, + ) + return func + + def on_v1_issuing_card_updated( + self, + func: "Callable[[V1IssuingCardUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingCardUpdatedEvent` (`v1.issuing_card.updated`) event notification. + """ + self._register( + "v1.issuing_card.updated", + func, + ) + return func + + def on_v1_issuing_dispute_closed( + self, + func: "Callable[[V1IssuingDisputeClosedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeClosedEvent` (`v1.issuing_dispute.closed`) event notification. + """ + self._register( + "v1.issuing_dispute.closed", + func, + ) + return func + + def on_v1_issuing_dispute_created( + self, + func: "Callable[[V1IssuingDisputeCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeCreatedEvent` (`v1.issuing_dispute.created`) event notification. + """ + self._register( + "v1.issuing_dispute.created", + func, + ) + return func + + def on_v1_issuing_dispute_funds_reinstated( + self, + func: "Callable[[V1IssuingDisputeFundsReinstatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeFundsReinstatedEvent` (`v1.issuing_dispute.funds_reinstated`) event notification. + """ + self._register( + "v1.issuing_dispute.funds_reinstated", + func, + ) + return func + + def on_v1_issuing_dispute_funds_rescinded( + self, + func: "Callable[[V1IssuingDisputeFundsRescindedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeFundsRescindedEvent` (`v1.issuing_dispute.funds_rescinded`) event notification. + """ + self._register( + "v1.issuing_dispute.funds_rescinded", + func, + ) + return func + + def on_v1_issuing_dispute_submitted( + self, + func: "Callable[[V1IssuingDisputeSubmittedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeSubmittedEvent` (`v1.issuing_dispute.submitted`) event notification. + """ + self._register( + "v1.issuing_dispute.submitted", + func, + ) + return func + + def on_v1_issuing_dispute_updated( + self, + func: "Callable[[V1IssuingDisputeUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingDisputeUpdatedEvent` (`v1.issuing_dispute.updated`) event notification. + """ + self._register( + "v1.issuing_dispute.updated", + func, + ) + return func + + def on_v1_issuing_personalization_design_activated( + self, + func: "Callable[[V1IssuingPersonalizationDesignActivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingPersonalizationDesignActivatedEvent` (`v1.issuing_personalization_design.activated`) event notification. + """ + self._register( + "v1.issuing_personalization_design.activated", + func, + ) + return func + + def on_v1_issuing_personalization_design_deactivated( + self, + func: "Callable[[V1IssuingPersonalizationDesignDeactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingPersonalizationDesignDeactivatedEvent` (`v1.issuing_personalization_design.deactivated`) event notification. + """ + self._register( + "v1.issuing_personalization_design.deactivated", + func, + ) + return func + + def on_v1_issuing_personalization_design_rejected( + self, + func: "Callable[[V1IssuingPersonalizationDesignRejectedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingPersonalizationDesignRejectedEvent` (`v1.issuing_personalization_design.rejected`) event notification. + """ + self._register( + "v1.issuing_personalization_design.rejected", + func, + ) + return func + + def on_v1_issuing_personalization_design_updated( + self, + func: "Callable[[V1IssuingPersonalizationDesignUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingPersonalizationDesignUpdatedEvent` (`v1.issuing_personalization_design.updated`) event notification. + """ + self._register( + "v1.issuing_personalization_design.updated", + func, + ) + return func + + def on_v1_issuing_token_created( + self, + func: "Callable[[V1IssuingTokenCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingTokenCreatedEvent` (`v1.issuing_token.created`) event notification. + """ + self._register( + "v1.issuing_token.created", + func, + ) + return func + + def on_v1_issuing_token_updated( + self, + func: "Callable[[V1IssuingTokenUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingTokenUpdatedEvent` (`v1.issuing_token.updated`) event notification. + """ + self._register( + "v1.issuing_token.updated", + func, + ) + return func + + def on_v1_issuing_transaction_created( + self, + func: "Callable[[V1IssuingTransactionCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingTransactionCreatedEvent` (`v1.issuing_transaction.created`) event notification. + """ + self._register( + "v1.issuing_transaction.created", + func, + ) + return func + + def on_v1_issuing_transaction_purchase_details_receipt_updated( + self, + func: "Callable[[V1IssuingTransactionPurchaseDetailsReceiptUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingTransactionPurchaseDetailsReceiptUpdatedEvent` (`v1.issuing_transaction.purchase_details_receipt_updated`) event notification. + """ + self._register( + "v1.issuing_transaction.purchase_details_receipt_updated", + func, + ) + return func + + def on_v1_issuing_transaction_updated( + self, + func: "Callable[[V1IssuingTransactionUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1IssuingTransactionUpdatedEvent` (`v1.issuing_transaction.updated`) event notification. + """ + self._register( + "v1.issuing_transaction.updated", + func, + ) + return func + + def on_v1_mandate_updated( + self, + func: "Callable[[V1MandateUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1MandateUpdatedEvent` (`v1.mandate.updated`) event notification. + """ + self._register( + "v1.mandate.updated", + func, + ) + return func + + def on_v1_payment_intent_amount_capturable_updated( + self, + func: "Callable[[V1PaymentIntentAmountCapturableUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentAmountCapturableUpdatedEvent` (`v1.payment_intent.amount_capturable_updated`) event notification. + """ + self._register( + "v1.payment_intent.amount_capturable_updated", + func, + ) + return func + + def on_v1_payment_intent_canceled( + self, + func: "Callable[[V1PaymentIntentCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentCanceledEvent` (`v1.payment_intent.canceled`) event notification. + """ + self._register( + "v1.payment_intent.canceled", + func, + ) + return func + + def on_v1_payment_intent_created( + self, + func: "Callable[[V1PaymentIntentCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentCreatedEvent` (`v1.payment_intent.created`) event notification. + """ + self._register( + "v1.payment_intent.created", + func, + ) + return func + + def on_v1_payment_intent_partially_funded( + self, + func: "Callable[[V1PaymentIntentPartiallyFundedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentPartiallyFundedEvent` (`v1.payment_intent.partially_funded`) event notification. + """ + self._register( + "v1.payment_intent.partially_funded", + func, + ) + return func + + def on_v1_payment_intent_payment_failed( + self, + func: "Callable[[V1PaymentIntentPaymentFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentPaymentFailedEvent` (`v1.payment_intent.payment_failed`) event notification. + """ + self._register( + "v1.payment_intent.payment_failed", + func, + ) + return func + + def on_v1_payment_intent_processing( + self, + func: "Callable[[V1PaymentIntentProcessingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentProcessingEvent` (`v1.payment_intent.processing`) event notification. + """ + self._register( + "v1.payment_intent.processing", + func, + ) + return func + + def on_v1_payment_intent_requires_action( + self, + func: "Callable[[V1PaymentIntentRequiresActionEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentRequiresActionEvent` (`v1.payment_intent.requires_action`) event notification. + """ + self._register( + "v1.payment_intent.requires_action", + func, + ) + return func + + def on_v1_payment_intent_succeeded( + self, + func: "Callable[[V1PaymentIntentSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentIntentSucceededEvent` (`v1.payment_intent.succeeded`) event notification. + """ + self._register( + "v1.payment_intent.succeeded", + func, + ) + return func + + def on_v1_payment_link_created( + self, + func: "Callable[[V1PaymentLinkCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentLinkCreatedEvent` (`v1.payment_link.created`) event notification. + """ + self._register( + "v1.payment_link.created", + func, + ) + return func + + def on_v1_payment_link_updated( + self, + func: "Callable[[V1PaymentLinkUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentLinkUpdatedEvent` (`v1.payment_link.updated`) event notification. + """ + self._register( + "v1.payment_link.updated", + func, + ) + return func + + def on_v1_payment_method_attached( + self, + func: "Callable[[V1PaymentMethodAttachedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentMethodAttachedEvent` (`v1.payment_method.attached`) event notification. + """ + self._register( + "v1.payment_method.attached", + func, + ) + return func + + def on_v1_payment_method_automatically_updated( + self, + func: "Callable[[V1PaymentMethodAutomaticallyUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentMethodAutomaticallyUpdatedEvent` (`v1.payment_method.automatically_updated`) event notification. + """ + self._register( + "v1.payment_method.automatically_updated", + func, + ) + return func + + def on_v1_payment_method_detached( + self, + func: "Callable[[V1PaymentMethodDetachedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentMethodDetachedEvent` (`v1.payment_method.detached`) event notification. + """ + self._register( + "v1.payment_method.detached", + func, + ) + return func + + def on_v1_payment_method_updated( + self, + func: "Callable[[V1PaymentMethodUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PaymentMethodUpdatedEvent` (`v1.payment_method.updated`) event notification. + """ + self._register( + "v1.payment_method.updated", + func, + ) + return func + + def on_v1_payout_canceled( + self, + func: "Callable[[V1PayoutCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutCanceledEvent` (`v1.payout.canceled`) event notification. + """ + self._register( + "v1.payout.canceled", + func, + ) + return func + + def on_v1_payout_created( + self, + func: "Callable[[V1PayoutCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutCreatedEvent` (`v1.payout.created`) event notification. + """ + self._register( + "v1.payout.created", + func, + ) + return func + + def on_v1_payout_failed( + self, + func: "Callable[[V1PayoutFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutFailedEvent` (`v1.payout.failed`) event notification. + """ + self._register( + "v1.payout.failed", + func, + ) + return func + + def on_v1_payout_paid( + self, + func: "Callable[[V1PayoutPaidEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutPaidEvent` (`v1.payout.paid`) event notification. + """ + self._register( + "v1.payout.paid", + func, + ) + return func + + def on_v1_payout_reconciliation_completed( + self, + func: "Callable[[V1PayoutReconciliationCompletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutReconciliationCompletedEvent` (`v1.payout.reconciliation_completed`) event notification. + """ + self._register( + "v1.payout.reconciliation_completed", + func, + ) + return func + + def on_v1_payout_updated( + self, + func: "Callable[[V1PayoutUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PayoutUpdatedEvent` (`v1.payout.updated`) event notification. + """ + self._register( + "v1.payout.updated", + func, + ) + return func + + def on_v1_person_created( + self, + func: "Callable[[V1PersonCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PersonCreatedEvent` (`v1.person.created`) event notification. + """ + self._register( + "v1.person.created", + func, + ) + return func + + def on_v1_person_deleted( + self, + func: "Callable[[V1PersonDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PersonDeletedEvent` (`v1.person.deleted`) event notification. + """ + self._register( + "v1.person.deleted", + func, + ) + return func + + def on_v1_person_updated( + self, + func: "Callable[[V1PersonUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PersonUpdatedEvent` (`v1.person.updated`) event notification. + """ + self._register( + "v1.person.updated", + func, + ) + return func + + def on_v1_plan_created( + self, + func: "Callable[[V1PlanCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PlanCreatedEvent` (`v1.plan.created`) event notification. + """ + self._register( + "v1.plan.created", + func, + ) + return func + + def on_v1_plan_deleted( + self, + func: "Callable[[V1PlanDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PlanDeletedEvent` (`v1.plan.deleted`) event notification. + """ + self._register( + "v1.plan.deleted", + func, + ) + return func + + def on_v1_plan_updated( + self, + func: "Callable[[V1PlanUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PlanUpdatedEvent` (`v1.plan.updated`) event notification. + """ + self._register( + "v1.plan.updated", + func, + ) + return func + + def on_v1_price_created( + self, + func: "Callable[[V1PriceCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PriceCreatedEvent` (`v1.price.created`) event notification. + """ + self._register( + "v1.price.created", + func, + ) + return func + + def on_v1_price_deleted( + self, + func: "Callable[[V1PriceDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PriceDeletedEvent` (`v1.price.deleted`) event notification. + """ + self._register( + "v1.price.deleted", + func, + ) + return func + + def on_v1_price_updated( + self, + func: "Callable[[V1PriceUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PriceUpdatedEvent` (`v1.price.updated`) event notification. + """ + self._register( + "v1.price.updated", + func, + ) + return func + + def on_v1_product_created( + self, + func: "Callable[[V1ProductCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ProductCreatedEvent` (`v1.product.created`) event notification. + """ + self._register( + "v1.product.created", + func, + ) + return func + + def on_v1_product_deleted( + self, + func: "Callable[[V1ProductDeletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ProductDeletedEvent` (`v1.product.deleted`) event notification. + """ + self._register( + "v1.product.deleted", + func, + ) + return func + + def on_v1_product_updated( + self, + func: "Callable[[V1ProductUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ProductUpdatedEvent` (`v1.product.updated`) event notification. + """ + self._register( + "v1.product.updated", + func, + ) + return func + + def on_v1_promotion_code_created( + self, + func: "Callable[[V1PromotionCodeCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PromotionCodeCreatedEvent` (`v1.promotion_code.created`) event notification. + """ + self._register( + "v1.promotion_code.created", + func, + ) + return func + + def on_v1_promotion_code_updated( + self, + func: "Callable[[V1PromotionCodeUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1PromotionCodeUpdatedEvent` (`v1.promotion_code.updated`) event notification. + """ + self._register( + "v1.promotion_code.updated", + func, + ) + return func + + def on_v1_quote_accepted( + self, + func: "Callable[[V1QuoteAcceptedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1QuoteAcceptedEvent` (`v1.quote.accepted`) event notification. + """ + self._register( + "v1.quote.accepted", + func, + ) + return func + + def on_v1_quote_canceled( + self, + func: "Callable[[V1QuoteCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1QuoteCanceledEvent` (`v1.quote.canceled`) event notification. + """ + self._register( + "v1.quote.canceled", + func, + ) + return func + + def on_v1_quote_created( + self, + func: "Callable[[V1QuoteCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1QuoteCreatedEvent` (`v1.quote.created`) event notification. + """ + self._register( + "v1.quote.created", + func, + ) + return func + + def on_v1_quote_finalized( + self, + func: "Callable[[V1QuoteFinalizedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1QuoteFinalizedEvent` (`v1.quote.finalized`) event notification. + """ + self._register( + "v1.quote.finalized", + func, + ) + return func + + def on_v1_radar_early_fraud_warning_created( + self, + func: "Callable[[V1RadarEarlyFraudWarningCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1RadarEarlyFraudWarningCreatedEvent` (`v1.radar.early_fraud_warning.created`) event notification. + """ + self._register( + "v1.radar.early_fraud_warning.created", + func, + ) + return func + + def on_v1_radar_early_fraud_warning_updated( + self, + func: "Callable[[V1RadarEarlyFraudWarningUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1RadarEarlyFraudWarningUpdatedEvent` (`v1.radar.early_fraud_warning.updated`) event notification. + """ + self._register( + "v1.radar.early_fraud_warning.updated", + func, + ) + return func + + def on_v1_refund_created( + self, + func: "Callable[[V1RefundCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1RefundCreatedEvent` (`v1.refund.created`) event notification. + """ + self._register( + "v1.refund.created", + func, + ) + return func + + def on_v1_refund_failed( + self, + func: "Callable[[V1RefundFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1RefundFailedEvent` (`v1.refund.failed`) event notification. + """ + self._register( + "v1.refund.failed", + func, + ) + return func + + def on_v1_refund_updated( + self, + func: "Callable[[V1RefundUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1RefundUpdatedEvent` (`v1.refund.updated`) event notification. + """ + self._register( + "v1.refund.updated", + func, + ) + return func + + def on_v1_review_closed( + self, + func: "Callable[[V1ReviewClosedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ReviewClosedEvent` (`v1.review.closed`) event notification. + """ + self._register( + "v1.review.closed", + func, + ) + return func + + def on_v1_review_opened( + self, + func: "Callable[[V1ReviewOpenedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1ReviewOpenedEvent` (`v1.review.opened`) event notification. + """ + self._register( + "v1.review.opened", + func, + ) + return func + + def on_v1_setup_intent_canceled( + self, + func: "Callable[[V1SetupIntentCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SetupIntentCanceledEvent` (`v1.setup_intent.canceled`) event notification. + """ + self._register( + "v1.setup_intent.canceled", + func, + ) + return func + + def on_v1_setup_intent_created( + self, + func: "Callable[[V1SetupIntentCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SetupIntentCreatedEvent` (`v1.setup_intent.created`) event notification. + """ + self._register( + "v1.setup_intent.created", + func, + ) + return func + + def on_v1_setup_intent_requires_action( + self, + func: "Callable[[V1SetupIntentRequiresActionEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SetupIntentRequiresActionEvent` (`v1.setup_intent.requires_action`) event notification. + """ + self._register( + "v1.setup_intent.requires_action", + func, + ) + return func + + def on_v1_setup_intent_setup_failed( + self, + func: "Callable[[V1SetupIntentSetupFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SetupIntentSetupFailedEvent` (`v1.setup_intent.setup_failed`) event notification. + """ + self._register( + "v1.setup_intent.setup_failed", + func, + ) + return func + + def on_v1_setup_intent_succeeded( + self, + func: "Callable[[V1SetupIntentSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SetupIntentSucceededEvent` (`v1.setup_intent.succeeded`) event notification. + """ + self._register( + "v1.setup_intent.succeeded", + func, + ) + return func + + def on_v1_sigma_scheduled_query_run_created( + self, + func: "Callable[[V1SigmaScheduledQueryRunCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SigmaScheduledQueryRunCreatedEvent` (`v1.sigma.scheduled_query_run.created`) event notification. + """ + self._register( + "v1.sigma.scheduled_query_run.created", + func, + ) + return func + + def on_v1_source_canceled( + self, + func: "Callable[[V1SourceCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SourceCanceledEvent` (`v1.source.canceled`) event notification. + """ + self._register( + "v1.source.canceled", + func, + ) + return func + + def on_v1_source_chargeable( + self, + func: "Callable[[V1SourceChargeableEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SourceChargeableEvent` (`v1.source.chargeable`) event notification. + """ + self._register( + "v1.source.chargeable", + func, + ) + return func + + def on_v1_source_failed( + self, + func: "Callable[[V1SourceFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SourceFailedEvent` (`v1.source.failed`) event notification. + """ + self._register( + "v1.source.failed", + func, + ) + return func + + def on_v1_source_refund_attributes_required( + self, + func: "Callable[[V1SourceRefundAttributesRequiredEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SourceRefundAttributesRequiredEvent` (`v1.source.refund_attributes_required`) event notification. + """ + self._register( + "v1.source.refund_attributes_required", + func, + ) + return func + + def on_v1_subscription_schedule_aborted( + self, + func: "Callable[[V1SubscriptionScheduleAbortedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleAbortedEvent` (`v1.subscription_schedule.aborted`) event notification. + """ + self._register( + "v1.subscription_schedule.aborted", + func, + ) + return func + + def on_v1_subscription_schedule_canceled( + self, + func: "Callable[[V1SubscriptionScheduleCanceledEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleCanceledEvent` (`v1.subscription_schedule.canceled`) event notification. + """ + self._register( + "v1.subscription_schedule.canceled", + func, + ) + return func + + def on_v1_subscription_schedule_completed( + self, + func: "Callable[[V1SubscriptionScheduleCompletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleCompletedEvent` (`v1.subscription_schedule.completed`) event notification. + """ + self._register( + "v1.subscription_schedule.completed", + func, + ) + return func + + def on_v1_subscription_schedule_created( + self, + func: "Callable[[V1SubscriptionScheduleCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleCreatedEvent` (`v1.subscription_schedule.created`) event notification. + """ + self._register( + "v1.subscription_schedule.created", + func, + ) + return func + + def on_v1_subscription_schedule_expiring( + self, + func: "Callable[[V1SubscriptionScheduleExpiringEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleExpiringEvent` (`v1.subscription_schedule.expiring`) event notification. + """ + self._register( + "v1.subscription_schedule.expiring", + func, + ) + return func -_PreHandleCallback = Callable[ - [EventNotification, "StripeClient"], PreHandleReturn -] + def on_v1_subscription_schedule_released( + self, + func: "Callable[[V1SubscriptionScheduleReleasedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleReleasedEvent` (`v1.subscription_schedule.released`) event notification. + """ + self._register( + "v1.subscription_schedule.released", + func, + ) + return func -FallbackCallback = _FallbackCallback[None] -""" -Called when no other callback is registered for a given event notification type. -""" + def on_v1_subscription_schedule_updated( + self, + func: "Callable[[V1SubscriptionScheduleUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1SubscriptionScheduleUpdatedEvent` (`v1.subscription_schedule.updated`) event notification. + """ + self._register( + "v1.subscription_schedule.updated", + func, + ) + return func -AsyncFallbackCallback = _FallbackCallback[Awaitable[None]] -""" -This async function is called when no other callback is registered for a given event notification type. -""" + def on_v1_tax_rate_created( + self, + func: "Callable[[V1TaxRateCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TaxRateCreatedEvent` (`v1.tax_rate.created`) event notification. + """ + self._register( + "v1.tax_rate.created", + func, + ) + return func -PreHandleCallback = _PreHandleCallback[bool] -""" -Called before any of your callbacks are run. Useful for filtering. -""" + def on_v1_tax_rate_updated( + self, + func: "Callable[[V1TaxRateUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TaxRateUpdatedEvent` (`v1.tax_rate.updated`) event notification. + """ + self._register( + "v1.tax_rate.updated", + func, + ) + return func -AsyncPreHandleCallback = _PreHandleCallback[Awaitable[bool]] -""" -This async function is called before any of your callbacks are run. Useful for filtering. -""" + def on_v1_tax_settings_updated( + self, + func: "Callable[[V1TaxSettingsUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TaxSettingsUpdatedEvent` (`v1.tax.settings.updated`) event notification. + """ + self._register( + "v1.tax.settings.updated", + func, + ) + return func + def on_v1_terminal_reader_action_failed( + self, + func: "Callable[[V1TerminalReaderActionFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TerminalReaderActionFailedEvent` (`v1.terminal.reader.action_failed`) event notification. + """ + self._register( + "v1.terminal.reader.action_failed", + func, + ) + return func -class _BaseEventNotificationHandler(Generic[CallbackReturn, PreHandleReturn]): - """ - Shared internal registration machinery for the user-facing event handlers. + def on_v1_terminal_reader_action_succeeded( + self, + func: "Callable[[V1TerminalReaderActionSucceededEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TerminalReaderActionSucceededEvent` (`v1.terminal.reader.action_succeeded`) event notification. + """ + self._register( + "v1.terminal.reader.action_succeeded", + func, + ) + return func - Holds everything that doesn't depend on whether callbacks are awaited; the - sync and async subclasses below add only the dispatch loop itself. - """ + def on_v1_terminal_reader_action_updated( + self, + func: "Callable[[V1TerminalReaderActionUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TerminalReaderActionUpdatedEvent` (`v1.terminal.reader.action_updated`) event notification. + """ + self._register( + "v1.terminal.reader.action_updated", + func, + ) + return func - def __init__( + def on_v1_test_helpers_test_clock_advancing( self, - client: "StripeClient", - fallback_callback: _FallbackCallback[CallbackReturn], - ) -> None: - self._registered_handlers = {} - self._client = client - self.fallback_callback = fallback_callback - # once this is true, adding additional handlers results in an error - self._has_handled_events = False - self._pre_handle_callback: Optional[ - _PreHandleCallback[PreHandleReturn] - ] = None + func: "Callable[[V1TestHelpersTestClockAdvancingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TestHelpersTestClockAdvancingEvent` (`v1.test_helpers.test_clock.advancing`) event notification. + """ + self._register( + "v1.test_helpers.test_clock.advancing", + func, + ) + return func - def _assert_hasnt_handled(self) -> None: + def on_v1_test_helpers_test_clock_created( + self, + func: "Callable[[V1TestHelpersTestClockCreatedEventNotification, StripeClient], CallbackReturn]", + ): """ - Callbacks are expected to be registered on startup, so registering anything after handling an event indicates a bug. + Registers a callback for the `V1TestHelpersTestClockCreatedEvent` (`v1.test_helpers.test_clock.created`) event notification. """ - if self._has_handled_events: - raise RuntimeError( - "Cannot register new callbacks after an event has been handled. This is indicative of a bug." - ) + self._register( + "v1.test_helpers.test_clock.created", + func, + ) + return func - def pre_handle( - self, func: _PreHandleCallback[PreHandleReturn] - ) -> _PreHandleCallback[PreHandleReturn]: + def on_v1_test_helpers_test_clock_deleted( + self, + func: "Callable[[V1TestHelpersTestClockDeletedEventNotification, StripeClient], CallbackReturn]", + ): """ - Registers a function that will be run before any event-specific callbacks. A useful place to store event-agnostic logic, such as logging or checking for [duplicate event deliveries](https://docs.stripe.com/webhooks#handle-duplicate-events). + Registers a callback for the `V1TestHelpersTestClockDeletedEvent` (`v1.test_helpers.test_clock.deleted`) event notification. + """ + self._register( + "v1.test_helpers.test_clock.deleted", + func, + ) + return func - Returning `True` causes handling to continue as normal; returning `False` returns from `.handle()` immediately, so neither the registered callback nor the fallback callback are called. + def on_v1_test_helpers_test_clock_internal_failure( + self, + func: "Callable[[V1TestHelpersTestClockInternalFailureEventNotification, StripeClient], CallbackReturn]", + ): """ - self._assert_hasnt_handled() - if self._pre_handle_callback: - raise ValueError("A pre_handle callback is already registered") + Registers a callback for the `V1TestHelpersTestClockInternalFailureEvent` (`v1.test_helpers.test_clock.internal_failure`) event notification. + """ + self._register( + "v1.test_helpers.test_clock.internal_failure", + func, + ) + return func - self._pre_handle_callback = func + def on_v1_test_helpers_test_clock_ready( + self, + func: "Callable[[V1TestHelpersTestClockReadyEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TestHelpersTestClockReadyEvent` (`v1.test_helpers.test_clock.ready`) event notification. + """ + self._register( + "v1.test_helpers.test_clock.ready", + func, + ) return func - def _callback_for(self, event_notif: "EventNotification"): + def on_v1_topup_canceled( + self, + func: "Callable[[V1TopupCanceledEventNotification, StripeClient], CallbackReturn]", + ): """ - Returns the callback registered for this event's type, if any. + Registers a callback for the `V1TopupCanceledEvent` (`v1.topup.canceled`) event notification. """ - return self._registered_handlers.get(event_notif.type) + self._register( + "v1.topup.canceled", + func, + ) + return func - def _unhandled_details( - self, event_notif: "EventNotification" - ) -> UnhandledNotificationDetails: - return UnhandledNotificationDetails( - is_known_event_type=not isinstance( - event_notif, UnknownEventNotification - ) + def on_v1_topup_created( + self, + func: "Callable[[V1TopupCreatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TopupCreatedEvent` (`v1.topup.created`) event notification. + """ + self._register( + "v1.topup.created", + func, ) + return func - def _register( + def on_v1_topup_failed( self, - event_type: str, - func: "Callable[[EventNotificationChild, StripeClient], CallbackReturn]", - ) -> None: - self._assert_hasnt_handled() - if event_type in self._registered_handlers: - raise ValueError( - f'Callback for event type "{event_type}" is already registered' - ) + func: "Callable[[V1TopupFailedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TopupFailedEvent` (`v1.topup.failed`) event notification. + """ + self._register( + "v1.topup.failed", + func, + ) + return func - self._registered_handlers[event_type] = func + def on_v1_topup_reversed( + self, + func: "Callable[[V1TopupReversedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TopupReversedEvent` (`v1.topup.reversed`) event notification. + """ + self._register( + "v1.topup.reversed", + func, + ) + return func - @property - def registered_event_types(self) -> List[str]: + def on_v1_topup_succeeded( + self, + func: "Callable[[V1TopupSucceededEventNotification, StripeClient], CallbackReturn]", + ): """ - Returns an alphabetized list of all event types that have registered handlers. + Registers a callback for the `V1TopupSucceededEvent` (`v1.topup.succeeded`) event notification. """ - return sorted(self._registered_handlers.keys()) + self._register( + "v1.topup.succeeded", + func, + ) + return func - # event-notification-registration-methods: The beginning of the section generated from our OpenAPI spec - def on_v1_billing_meter_error_report_triggered( + def on_v1_transfer_created( self, - func: "Callable[[V1BillingMeterErrorReportTriggeredEventNotification, StripeClient], CallbackReturn]", + func: "Callable[[V1TransferCreatedEventNotification, StripeClient], CallbackReturn]", ): """ - Registers a callback for the `V1BillingMeterErrorReportTriggeredEvent` (`v1.billing.meter.error_report_triggered`) event notification. + Registers a callback for the `V1TransferCreatedEvent` (`v1.transfer.created`) event notification. """ self._register( - "v1.billing.meter.error_report_triggered", + "v1.transfer.created", func, ) return func - def on_v1_billing_meter_no_meter_found( + def on_v1_transfer_reversed( self, - func: "Callable[[V1BillingMeterNoMeterFoundEventNotification, StripeClient], CallbackReturn]", + func: "Callable[[V1TransferReversedEventNotification, StripeClient], CallbackReturn]", ): """ - Registers a callback for the `V1BillingMeterNoMeterFoundEvent` (`v1.billing.meter.no_meter_found`) event notification. + Registers a callback for the `V1TransferReversedEvent` (`v1.transfer.reversed`) event notification. """ self._register( - "v1.billing.meter.no_meter_found", + "v1.transfer.reversed", + func, + ) + return func + + def on_v1_transfer_updated( + self, + func: "Callable[[V1TransferUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V1TransferUpdatedEvent` (`v1.transfer.updated`) event notification. + """ + self._register( + "v1.transfer.updated", func, ) return func @@ -1679,6 +5141,32 @@ def on_v2_signals_account_evaluation_complete( ) return func + def on_v2_signals_account_signal_fraudulent_merchant_ready( + self, + func: "Callable[[V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2SignalsAccountSignalFraudulentMerchantReadyEvent` (`v2.signals.account_signal.fraudulent_merchant_ready`) event notification. + """ + self._register( + "v2.signals.account_signal.fraudulent_merchant_ready", + func, + ) + return func + + def on_v2_signals_account_signal_fraudulent_website_ready( + self, + func: "Callable[[V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2SignalsAccountSignalFraudulentWebsiteReadyEvent` (`v2.signals.account_signal.fraudulent_website_ready`) event notification. + """ + self._register( + "v2.signals.account_signal.fraudulent_website_ready", + func, + ) + return func + # event-notification-registration-methods: The end of the section generated from our OpenAPI spec diff --git a/stripe/_event_service.py b/stripe/_event_service.py index f11a9e1ee..2ea67cd99 100644 --- a/stripe/_event_service.py +++ b/stripe/_event_service.py @@ -55,6 +55,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["EventRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": @@ -75,6 +76,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["EventRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": diff --git a/stripe/_exchange_rate_service.py b/stripe/_exchange_rate_service.py index 16675be03..d39b18642 100644 --- a/stripe/_exchange_rate_service.py +++ b/stripe/_exchange_rate_service.py @@ -61,6 +61,7 @@ async def list_async( def retrieve( self, rate_id: str, + /, params: Optional["ExchangeRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ExchangeRate": @@ -85,6 +86,7 @@ def retrieve( async def retrieve_async( self, rate_id: str, + /, params: Optional["ExchangeRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ExchangeRate": diff --git a/stripe/_external_account_service.py b/stripe/_external_account_service.py index fa40ebf0c..54e543e43 100644 --- a/stripe/_external_account_service.py +++ b/stripe/_external_account_service.py @@ -32,6 +32,7 @@ class ExternalAccountService(StripeService): def delete( self, id: str, + /, params: Optional["ExternalAccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -52,6 +53,7 @@ def delete( async def delete_async( self, id: str, + /, params: Optional["ExternalAccountDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -72,6 +74,7 @@ async def delete_async( def retrieve( self, id: str, + /, params: Optional["ExternalAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -92,6 +95,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ExternalAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -112,6 +116,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["ExternalAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": @@ -139,6 +144,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["ExternalAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[BankAccount, Card]": diff --git a/stripe/_file.py b/stripe/_file.py index 55dc1d07d..8bf982e72 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -16,7 +16,7 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ This object represents files hosted on Stripe's servers. You can upload - files with the [create file](https://api.stripe.com#create_file) request + files with the [create file](https://docs.stripe.com/api#create_file) request (for example, when uploading dispute evidence). Stripe also creates files independently (for example, the results of a [Sigma scheduled query](https://docs.stripe.com/api#scheduled_queries)). @@ -43,7 +43,7 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ links: Optional[ListObject["FileLink"]] """ - A list of [file links](https://api.stripe.com#file_links) that point at this file. + A list of [file links](https://docs.stripe.com/api#file_links) that point at this file. """ object: Literal["file"] """ diff --git a/stripe/_file_link.py b/stripe/_file_link.py index e4c5f1117..013ed379d 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -139,7 +139,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["FileLinkModifyParams"] + cls, id: str, /, **params: Unpack["FileLinkModifyParams"] ) -> "FileLink": """ Updates an existing file link object. Expired links can no longer be updated. @@ -156,7 +156,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["FileLinkModifyParams"] + cls, id: str, /, **params: Unpack["FileLinkModifyParams"] ) -> "FileLink": """ Updates an existing file link object. Expired links can no longer be updated. diff --git a/stripe/_file_link_service.py b/stripe/_file_link_service.py index 8a9653803..c40e7fa67 100644 --- a/stripe/_file_link_service.py +++ b/stripe/_file_link_service.py @@ -95,6 +95,7 @@ async def create_async( def retrieve( self, link: str, + /, params: Optional["FileLinkRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FileLink": @@ -115,6 +116,7 @@ def retrieve( async def retrieve_async( self, link: str, + /, params: Optional["FileLinkRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FileLink": @@ -135,6 +137,7 @@ async def retrieve_async( def update( self, link: str, + /, params: Optional["FileLinkUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FileLink": @@ -155,6 +158,7 @@ def update( async def update_async( self, link: str, + /, params: Optional["FileLinkUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FileLink": diff --git a/stripe/_file_service.py b/stripe/_file_service.py index 7822f15e4..1f16e3e57 100644 --- a/stripe/_file_service.py +++ b/stripe/_file_service.py @@ -104,6 +104,7 @@ async def create_async( def retrieve( self, file: str, + /, params: Optional["FileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "File": @@ -124,6 +125,7 @@ def retrieve( async def retrieve_async( self, file: str, + /, params: Optional["FileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "File": diff --git a/stripe/_fx_quote.py b/stripe/_fx_quote.py index a17b86c74..82a909615 100644 --- a/stripe/_fx_quote.py +++ b/stripe/_fx_quote.py @@ -104,6 +104,10 @@ class Transfer(StripeObject): """ Unique identifier for the object. """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ lock_duration: Union[Literal["day", "five_minutes", "hour", "none"], str] """ The duration that the quote is locked for, from creation time. The quote will be usable for the duration specified. diff --git a/stripe/_fx_quote_service.py b/stripe/_fx_quote_service.py index ed33a3cf5..6e16c0147 100644 --- a/stripe/_fx_quote_service.py +++ b/stripe/_fx_quote_service.py @@ -94,6 +94,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["FxQuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FxQuote": @@ -114,6 +115,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FxQuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FxQuote": diff --git a/stripe/_invoice.py b/stripe/_invoice.py index ba2e97f64..0cee6fc0e 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -95,7 +95,7 @@ class Invoice( Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. - They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments + They contain [invoice items](https://docs.stripe.com/api#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, @@ -454,7 +454,7 @@ class Issuer(StripeObject): class LastFinalizationError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -515,6 +515,7 @@ class LastFinalizationError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -525,6 +526,8 @@ class LastFinalizationError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -579,6 +582,7 @@ class LastFinalizationError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -734,7 +738,7 @@ class LastFinalizationError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -745,9 +749,9 @@ class LastFinalizationError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -858,7 +862,77 @@ class Bancontact(StripeObject): """ class Billie(StripeObject): - pass + class CompanyDetails(StripeObject): + class RegisteredAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code. + """ + line1: Optional[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + registered_address: Optional[RegisteredAddress] + registered_name: Optional[str] + """ + Company or entity name. + """ + registration_number: Optional[str] + """ + The official registration number for the given registration type. + """ + registration_type: Optional[ + Literal[ + "ch_ein", + "de_hrb", + "dk_cvr", + "es_cif", + "fi_tunnus", + "fr_siren", + "fr_siret", + "it_rea", + "nl_kvk", + "no_org_number", + "no_pno", + "se_org_number", + "se_pno", + "uk_crn", + ] + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: Optional[str] + """ + VAT ID number. + """ + _inner_class_types = { + "registered_address": RegisteredAddress, + } + + company_details: Optional[CompanyDetails] + reference: Optional[str] + """ + An identifier or reference that this payment corresponds to. + """ + _inner_class_types = {"company_details": CompanyDetails} class Blik(StripeObject): pass @@ -1324,6 +1398,27 @@ class Address(StripeObject): """ _inner_class_types = {"address": Address} + class StatusDetails(StripeObject): + class Uncollectible(StripeObject): + reason: Optional[ + Union[ + Literal[ + "max_payment_attempts", + "payment_not_received", + "subscription_canceled", + "subscription_paused", + "user_forgiven", + ], + str, + ] + ] + """ + The reason why the invoice is uncollectible. + """ + + uncollectible: Optional[Uncollectible] + _inner_class_types = {"uncollectible": Uncollectible} + class StatusTransitions(StripeObject): finalized_at: Optional[int] """ @@ -1742,7 +1837,7 @@ class TaxRateDetails(StripeObject): """ rendering: Optional[Rendering] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + The rendering-related settings that control how invoices render in customer-facing interfaces such as the PDF or hosted invoice page. """ shipping_cost: Optional[ShippingCost] """ @@ -1766,6 +1861,7 @@ class TaxRateDetails(StripeObject): """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview) """ + status_details: Optional[StatusDetails] status_transitions: StatusTransitions subtotal: int """ @@ -1811,7 +1907,7 @@ class TaxRateDetails(StripeObject): @classmethod def _cls_add_lines( - cls, invoice: str, **params: Unpack["InvoiceAddLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. @@ -1830,7 +1926,7 @@ def _cls_add_lines( @overload @staticmethod def add_lines( - invoice: str, **params: Unpack["InvoiceAddLinesParams"] + invoice: str, /, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. @@ -1847,7 +1943,7 @@ def add_lines( ... @class_method_variant("_cls_add_lines") - def add_lines( # pyright: ignore[reportGeneralTypeIssues] + def add_lines( self, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ @@ -1866,7 +1962,7 @@ def add_lines( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_add_lines_async( - cls, invoice: str, **params: Unpack["InvoiceAddLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. @@ -1885,7 +1981,7 @@ async def _cls_add_lines_async( @overload @staticmethod async def add_lines_async( - invoice: str, **params: Unpack["InvoiceAddLinesParams"] + invoice: str, /, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. @@ -1902,7 +1998,7 @@ async def add_lines_async( ... @class_method_variant("_cls_add_lines_async") - async def add_lines_async( # pyright: ignore[reportGeneralTypeIssues] + async def add_lines_async( self, **params: Unpack["InvoiceAddLinesParams"] ) -> "Invoice": """ @@ -1921,7 +2017,7 @@ async def add_lines_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_attach_payment( - cls, invoice: str, **params: Unpack["InvoiceAttachPaymentParams"] + cls, invoice: str, /, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments. @@ -1949,7 +2045,7 @@ def _cls_attach_payment( @overload @staticmethod def attach_payment( - invoice: str, **params: Unpack["InvoiceAttachPaymentParams"] + invoice: str, /, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments. @@ -1984,7 +2080,7 @@ def attach_payment( ... @class_method_variant("_cls_attach_payment") - def attach_payment( # pyright: ignore[reportGeneralTypeIssues] + def attach_payment( self, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ @@ -2012,7 +2108,7 @@ def attach_payment( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_attach_payment_async( - cls, invoice: str, **params: Unpack["InvoiceAttachPaymentParams"] + cls, invoice: str, /, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments. @@ -2040,7 +2136,7 @@ async def _cls_attach_payment_async( @overload @staticmethod async def attach_payment_async( - invoice: str, **params: Unpack["InvoiceAttachPaymentParams"] + invoice: str, /, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of payments. @@ -2075,7 +2171,7 @@ async def attach_payment_async( ... @class_method_variant("_cls_attach_payment_async") - async def attach_payment_async( # pyright: ignore[reportGeneralTypeIssues] + async def attach_payment_async( self, **params: Unpack["InvoiceAttachPaymentParams"] ) -> "Invoice": """ @@ -2181,7 +2277,7 @@ async def create_preview_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["InvoiceDeleteParams"] + cls, sid: str, /, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). @@ -2198,7 +2294,9 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["InvoiceDeleteParams"]) -> "Invoice": + def delete( + sid: str, /, **params: Unpack["InvoiceDeleteParams"] + ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ @@ -2212,9 +2310,7 @@ def delete(self, **params: Unpack["InvoiceDeleteParams"]) -> "Invoice": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["InvoiceDeleteParams"] - ) -> "Invoice": + def delete(self, **params: Unpack["InvoiceDeleteParams"]) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ @@ -2226,7 +2322,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["InvoiceDeleteParams"] + cls, sid: str, /, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). @@ -2244,7 +2340,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["InvoiceDeleteParams"] + sid: str, /, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). @@ -2261,7 +2357,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ @@ -2275,7 +2371,7 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_detach_payment( - cls, invoice: str, **params: Unpack["InvoiceDetachPaymentParams"] + cls, invoice: str, /, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ Detaches a payment from the invoice, removing it from the list of payments @@ -2294,7 +2390,7 @@ def _cls_detach_payment( @overload @staticmethod def detach_payment( - invoice: str, **params: Unpack["InvoiceDetachPaymentParams"] + invoice: str, /, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ Detaches a payment from the invoice, removing it from the list of payments @@ -2311,7 +2407,7 @@ def detach_payment( ... @class_method_variant("_cls_detach_payment") - def detach_payment( # pyright: ignore[reportGeneralTypeIssues] + def detach_payment( self, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ @@ -2330,7 +2426,7 @@ def detach_payment( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_detach_payment_async( - cls, invoice: str, **params: Unpack["InvoiceDetachPaymentParams"] + cls, invoice: str, /, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ Detaches a payment from the invoice, removing it from the list of payments @@ -2349,7 +2445,7 @@ async def _cls_detach_payment_async( @overload @staticmethod async def detach_payment_async( - invoice: str, **params: Unpack["InvoiceDetachPaymentParams"] + invoice: str, /, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ Detaches a payment from the invoice, removing it from the list of payments @@ -2366,7 +2462,7 @@ async def detach_payment_async( ... @class_method_variant("_cls_detach_payment_async") - async def detach_payment_async( # pyright: ignore[reportGeneralTypeIssues] + async def detach_payment_async( self, **params: Unpack["InvoiceDetachPaymentParams"] ) -> "Invoice": """ @@ -2385,7 +2481,7 @@ async def detach_payment_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_finalize_invoice( - cls, invoice: str, **params: Unpack["InvoiceFinalizeInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -2404,7 +2500,7 @@ def _cls_finalize_invoice( @overload @staticmethod def finalize_invoice( - invoice: str, **params: Unpack["InvoiceFinalizeInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -2421,7 +2517,7 @@ def finalize_invoice( ... @class_method_variant("_cls_finalize_invoice") - def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] + def finalize_invoice( self, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ @@ -2440,7 +2536,7 @@ def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_finalize_invoice_async( - cls, invoice: str, **params: Unpack["InvoiceFinalizeInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -2459,7 +2555,7 @@ async def _cls_finalize_invoice_async( @overload @staticmethod async def finalize_invoice_async( - invoice: str, **params: Unpack["InvoiceFinalizeInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -2476,7 +2572,7 @@ async def finalize_invoice_async( ... @class_method_variant("_cls_finalize_invoice_async") - async def finalize_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + async def finalize_invoice_async( self, **params: Unpack["InvoiceFinalizeInvoiceParams"] ) -> "Invoice": """ @@ -2535,7 +2631,10 @@ async def list_async( @classmethod def _cls_mark_uncollectible( - cls, invoice: str, **params: Unpack["InvoiceMarkUncollectibleParams"] + cls, + invoice: str, + /, + **params: Unpack["InvoiceMarkUncollectibleParams"], ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -2554,7 +2653,7 @@ def _cls_mark_uncollectible( @overload @staticmethod def mark_uncollectible( - invoice: str, **params: Unpack["InvoiceMarkUncollectibleParams"] + invoice: str, /, **params: Unpack["InvoiceMarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -2571,7 +2670,7 @@ def mark_uncollectible( ... @class_method_variant("_cls_mark_uncollectible") - def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] + def mark_uncollectible( self, **params: Unpack["InvoiceMarkUncollectibleParams"] ) -> "Invoice": """ @@ -2590,7 +2689,10 @@ def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_mark_uncollectible_async( - cls, invoice: str, **params: Unpack["InvoiceMarkUncollectibleParams"] + cls, + invoice: str, + /, + **params: Unpack["InvoiceMarkUncollectibleParams"], ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -2609,7 +2711,7 @@ async def _cls_mark_uncollectible_async( @overload @staticmethod async def mark_uncollectible_async( - invoice: str, **params: Unpack["InvoiceMarkUncollectibleParams"] + invoice: str, /, **params: Unpack["InvoiceMarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -2626,7 +2728,7 @@ async def mark_uncollectible_async( ... @class_method_variant("_cls_mark_uncollectible_async") - async def mark_uncollectible_async( # pyright: ignore[reportGeneralTypeIssues] + async def mark_uncollectible_async( self, **params: Unpack["InvoiceMarkUncollectibleParams"] ) -> "Invoice": """ @@ -2645,11 +2747,12 @@ async def mark_uncollectible_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def modify( - cls, id: str, **params: Unpack["InvoiceModifyParams"] + cls, id: str, /, **params: Unpack["InvoiceModifyParams"] ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized), - monetary values, as well as collection_method, become uneditable. + you can no longer change most of its details, including monetary values and collection_method. For most invoices, + this also includes description. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass @@ -2667,11 +2770,12 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["InvoiceModifyParams"] + cls, id: str, /, **params: Unpack["InvoiceModifyParams"] ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized), - monetary values, as well as collection_method, become uneditable. + you can no longer change most of its details, including monetary values and collection_method. For most invoices, + this also includes description. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass @@ -2689,7 +2793,7 @@ async def modify_async( @classmethod def _cls_pay( - cls, invoice: str, **params: Unpack["InvoicePayParams"] + cls, invoice: str, /, **params: Unpack["InvoicePayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. @@ -2707,7 +2811,9 @@ def _cls_pay( @overload @staticmethod - def pay(invoice: str, **params: Unpack["InvoicePayParams"]) -> "Invoice": + def pay( + invoice: str, /, **params: Unpack["InvoicePayParams"] + ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ @@ -2721,9 +2827,7 @@ def pay(self, **params: Unpack["InvoicePayParams"]) -> "Invoice": ... @class_method_variant("_cls_pay") - def pay( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["InvoicePayParams"] - ) -> "Invoice": + def pay(self, **params: Unpack["InvoicePayParams"]) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ @@ -2740,7 +2844,7 @@ def pay( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_pay_async( - cls, invoice: str, **params: Unpack["InvoicePayParams"] + cls, invoice: str, /, **params: Unpack["InvoicePayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. @@ -2759,7 +2863,7 @@ async def _cls_pay_async( @overload @staticmethod async def pay_async( - invoice: str, **params: Unpack["InvoicePayParams"] + invoice: str, /, **params: Unpack["InvoicePayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. @@ -2776,7 +2880,7 @@ async def pay_async( ... @class_method_variant("_cls_pay_async") - async def pay_async( # pyright: ignore[reportGeneralTypeIssues] + async def pay_async( self, **params: Unpack["InvoicePayParams"] ) -> "Invoice": """ @@ -2795,7 +2899,7 @@ async def pay_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_remove_lines( - cls, invoice: str, **params: Unpack["InvoiceRemoveLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. @@ -2814,7 +2918,7 @@ def _cls_remove_lines( @overload @staticmethod def remove_lines( - invoice: str, **params: Unpack["InvoiceRemoveLinesParams"] + invoice: str, /, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. @@ -2831,7 +2935,7 @@ def remove_lines( ... @class_method_variant("_cls_remove_lines") - def remove_lines( # pyright: ignore[reportGeneralTypeIssues] + def remove_lines( self, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ @@ -2850,7 +2954,7 @@ def remove_lines( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_remove_lines_async( - cls, invoice: str, **params: Unpack["InvoiceRemoveLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. @@ -2869,7 +2973,7 @@ async def _cls_remove_lines_async( @overload @staticmethod async def remove_lines_async( - invoice: str, **params: Unpack["InvoiceRemoveLinesParams"] + invoice: str, /, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ Removes multiple line items from an invoice. This is only possible when an invoice is still a draft. @@ -2886,7 +2990,7 @@ async def remove_lines_async( ... @class_method_variant("_cls_remove_lines_async") - async def remove_lines_async( # pyright: ignore[reportGeneralTypeIssues] + async def remove_lines_async( self, **params: Unpack["InvoiceRemoveLinesParams"] ) -> "Invoice": """ @@ -2927,7 +3031,7 @@ async def retrieve_async( @classmethod def _cls_send_invoice( - cls, invoice: str, **params: Unpack["InvoiceSendInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -2948,7 +3052,7 @@ def _cls_send_invoice( @overload @staticmethod def send_invoice( - invoice: str, **params: Unpack["InvoiceSendInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -2969,7 +3073,7 @@ def send_invoice( ... @class_method_variant("_cls_send_invoice") - def send_invoice( # pyright: ignore[reportGeneralTypeIssues] + def send_invoice( self, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ @@ -2990,7 +3094,7 @@ def send_invoice( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_send_invoice_async( - cls, invoice: str, **params: Unpack["InvoiceSendInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -3011,7 +3115,7 @@ async def _cls_send_invoice_async( @overload @staticmethod async def send_invoice_async( - invoice: str, **params: Unpack["InvoiceSendInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -3032,7 +3136,7 @@ async def send_invoice_async( ... @class_method_variant("_cls_send_invoice_async") - async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + async def send_invoice_async( self, **params: Unpack["InvoiceSendInvoiceParams"] ) -> "Invoice": """ @@ -3053,7 +3157,7 @@ async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_update_lines( - cls, invoice: str, **params: Unpack["InvoiceUpdateLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. @@ -3072,7 +3176,7 @@ def _cls_update_lines( @overload @staticmethod def update_lines( - invoice: str, **params: Unpack["InvoiceUpdateLinesParams"] + invoice: str, /, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. @@ -3089,7 +3193,7 @@ def update_lines( ... @class_method_variant("_cls_update_lines") - def update_lines( # pyright: ignore[reportGeneralTypeIssues] + def update_lines( self, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ @@ -3108,7 +3212,7 @@ def update_lines( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_update_lines_async( - cls, invoice: str, **params: Unpack["InvoiceUpdateLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. @@ -3127,7 +3231,7 @@ async def _cls_update_lines_async( @overload @staticmethod async def update_lines_async( - invoice: str, **params: Unpack["InvoiceUpdateLinesParams"] + invoice: str, /, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ Updates multiple line items on an invoice. This is only possible when an invoice is still a draft. @@ -3144,7 +3248,7 @@ async def update_lines_async( ... @class_method_variant("_cls_update_lines_async") - async def update_lines_async( # pyright: ignore[reportGeneralTypeIssues] + async def update_lines_async( self, **params: Unpack["InvoiceUpdateLinesParams"] ) -> "Invoice": """ @@ -3163,7 +3267,7 @@ async def update_lines_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_void_invoice( - cls, invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -3184,7 +3288,7 @@ def _cls_void_invoice( @overload @staticmethod def void_invoice( - invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -3205,7 +3309,7 @@ def void_invoice( ... @class_method_variant("_cls_void_invoice") - def void_invoice( # pyright: ignore[reportGeneralTypeIssues] + def void_invoice( self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ @@ -3226,7 +3330,7 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_void_invoice_async( - cls, invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] + cls, invoice: str, /, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -3247,7 +3351,7 @@ async def _cls_void_invoice_async( @overload @staticmethod async def void_invoice_async( - invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] + invoice: str, /, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -3268,7 +3372,7 @@ async def void_invoice_async( ... @class_method_variant("_cls_void_invoice_async") - async def void_invoice_async( # pyright: ignore[reportGeneralTypeIssues] + async def void_invoice_async( self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ @@ -3327,7 +3431,7 @@ async def search_auto_paging_iter_async( @classmethod def list_lines( - cls, invoice: str, **params: Unpack["InvoiceListLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceListLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3345,7 +3449,7 @@ def list_lines( @classmethod async def list_lines_async( - cls, invoice: str, **params: Unpack["InvoiceListLinesParams"] + cls, invoice: str, /, **params: Unpack["InvoiceListLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3377,6 +3481,7 @@ async def list_lines_async( "rendering": Rendering, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, + "status_details": StatusDetails, "status_transitions": StatusTransitions, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 0bfb8073c..21d46486e 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -54,6 +54,12 @@ class InvoiceItem( OBJECT_NAME: ClassVar[Literal["invoiceitem"]] = "invoiceitem" + class InvoicingRule(StripeObject): + type: Union[Literal["defer_until_credited_items_resolved"], str] + """ + The type of invoicing rule. + """ + class Parent(StripeObject): class SubscriptionDetails(StripeObject): subscription: str @@ -149,7 +155,7 @@ class DiscountAmount(StripeObject): """ discount_amounts: List[DiscountAmount] """ - Discount amounts applied when the proration was created. + Discount amounts applied when the proration was created. This field is only populated for prorations created from subscriptions with `billing_mode=flexible`. """ _inner_class_types = { "credited_items": CreditedItems, @@ -206,6 +212,10 @@ class DiscountAmount(StripeObject): """ The ID of the invoice this invoice item belongs to. """ + invoicing_rules: Optional[List[InvoicingRule]] + """ + The rules that control when this invoice item is eligible for invoicing. All rules must be satisfied for the item to be invoiced. + """ livemode: bool """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. @@ -291,7 +301,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["InvoiceItemDeleteParams"] + cls, sid: str, /, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. @@ -309,7 +319,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["InvoiceItemDeleteParams"] + sid: str, /, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. @@ -326,7 +336,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ @@ -340,7 +350,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["InvoiceItemDeleteParams"] + cls, sid: str, /, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. @@ -358,7 +368,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["InvoiceItemDeleteParams"] + sid: str, /, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. @@ -375,7 +385,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["InvoiceItemDeleteParams"] ) -> "InvoiceItem": """ @@ -429,7 +439,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["InvoiceItemModifyParams"] + cls, id: str, /, **params: Unpack["InvoiceItemModifyParams"] ) -> "InvoiceItem": """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. @@ -446,7 +456,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["InvoiceItemModifyParams"] + cls, id: str, /, **params: Unpack["InvoiceItemModifyParams"] ) -> "InvoiceItem": """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. @@ -484,6 +494,7 @@ async def retrieve_async( return instance _inner_class_types = { + "invoicing_rules": InvoicingRule, "parent": Parent, "period": Period, "pricing": Pricing, diff --git a/stripe/_invoice_item_service.py b/stripe/_invoice_item_service.py index 975b632c3..03f73b2ec 100644 --- a/stripe/_invoice_item_service.py +++ b/stripe/_invoice_item_service.py @@ -28,6 +28,7 @@ class InvoiceItemService(StripeService): def delete( self, invoiceitem: str, + /, params: Optional["InvoiceItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": @@ -50,6 +51,7 @@ def delete( async def delete_async( self, invoiceitem: str, + /, params: Optional["InvoiceItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": @@ -72,6 +74,7 @@ async def delete_async( def retrieve( self, invoiceitem: str, + /, params: Optional["InvoiceItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": @@ -94,6 +97,7 @@ def retrieve( async def retrieve_async( self, invoiceitem: str, + /, params: Optional["InvoiceItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": @@ -116,6 +120,7 @@ async def retrieve_async( def update( self, invoiceitem: str, + /, params: Optional["InvoiceItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": @@ -138,6 +143,7 @@ def update( async def update_async( self, invoiceitem: str, + /, params: Optional["InvoiceItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceItem": diff --git a/stripe/_invoice_line_item_service.py b/stripe/_invoice_line_item_service.py index fde1d01de..cfddd8d61 100644 --- a/stripe/_invoice_line_item_service.py +++ b/stripe/_invoice_line_item_service.py @@ -21,6 +21,7 @@ class InvoiceLineItemService(StripeService): def list( self, invoice: str, + /, params: Optional["InvoiceLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[InvoiceLineItem]": @@ -43,6 +44,7 @@ def list( async def list_async( self, invoice: str, + /, params: Optional["InvoiceLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[InvoiceLineItem]": @@ -66,6 +68,7 @@ def update( self, invoice: str, line_item_id: str, + /, params: Optional["InvoiceLineItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceLineItem": @@ -93,6 +96,7 @@ async def update_async( self, invoice: str, line_item_id: str, + /, params: Optional["InvoiceLineItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceLineItem": diff --git a/stripe/_invoice_payment.py b/stripe/_invoice_payment.py index 41d54abed..27bd7b680 100644 --- a/stripe/_invoice_payment.py +++ b/stripe/_invoice_payment.py @@ -24,7 +24,7 @@ class InvoicePayment(ListableAPIResource["InvoicePayment"]): """ Invoice Payments represent payments made against invoices. Invoice Payments can be accessed in two ways: - 1. By expanding the `payments` field on the [Invoice](https://api.stripe.com#invoice) resource. + 1. By expanding the `payments` field on the [Invoice](https://docs.stripe.com/api#invoice) resource. 2. By using the Invoice Payment retrieve and list endpoints. Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices. @@ -37,7 +37,7 @@ class InvoicePayment(ListableAPIResource["InvoicePayment"]): class Payment(StripeObject): charge: Optional[ExpandableField["Charge"]] """ - ID of the successful charge for this payment when `type` is `charge`.Note: charge is only surfaced if the charge object is not associated with a payment intent. If the charge object does have a payment intent, the Invoice Payment surfaces the payment intent instead. + ID of the successful charge for this payment when `type` is `charge`. Note: charge is only surfaced if the charge object is not associated with a payment intent. If the charge object does have a payment intent, the Invoice Payment surfaces the payment intent instead. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ diff --git a/stripe/_invoice_payment_service.py b/stripe/_invoice_payment_service.py index c7e998e3f..f5ed117c7 100644 --- a/stripe/_invoice_payment_service.py +++ b/stripe/_invoice_payment_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, invoice_payment: str, + /, params: Optional["InvoicePaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoicePayment": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, invoice_payment: str, + /, params: Optional["InvoicePaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoicePayment": diff --git a/stripe/_invoice_rendering_template.py b/stripe/_invoice_rendering_template.py index f70a67258..f4516581d 100644 --- a/stripe/_invoice_rendering_template.py +++ b/stripe/_invoice_rendering_template.py @@ -70,6 +70,7 @@ class InvoiceRenderingTemplate( def _cls_archive( cls, template: str, + /, **params: Unpack["InvoiceRenderingTemplateArchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -90,6 +91,7 @@ def _cls_archive( @staticmethod def archive( template: str, + /, **params: Unpack["InvoiceRenderingTemplateArchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -107,7 +109,7 @@ def archive( ... @class_method_variant("_cls_archive") - def archive( # pyright: ignore[reportGeneralTypeIssues] + def archive( self, **params: Unpack["InvoiceRenderingTemplateArchiveParams"] ) -> "InvoiceRenderingTemplate": """ @@ -128,6 +130,7 @@ def archive( # pyright: ignore[reportGeneralTypeIssues] async def _cls_archive_async( cls, template: str, + /, **params: Unpack["InvoiceRenderingTemplateArchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -148,6 +151,7 @@ async def _cls_archive_async( @staticmethod async def archive_async( template: str, + /, **params: Unpack["InvoiceRenderingTemplateArchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -165,7 +169,7 @@ async def archive_async( ... @class_method_variant("_cls_archive_async") - async def archive_async( # pyright: ignore[reportGeneralTypeIssues] + async def archive_async( self, **params: Unpack["InvoiceRenderingTemplateArchiveParams"] ) -> "InvoiceRenderingTemplate": """ @@ -252,6 +256,7 @@ async def retrieve_async( def _cls_unarchive( cls, template: str, + /, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -272,6 +277,7 @@ def _cls_unarchive( @staticmethod def unarchive( template: str, + /, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -289,7 +295,7 @@ def unarchive( ... @class_method_variant("_cls_unarchive") - def unarchive( # pyright: ignore[reportGeneralTypeIssues] + def unarchive( self, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"] ) -> "InvoiceRenderingTemplate": """ @@ -310,6 +316,7 @@ def unarchive( # pyright: ignore[reportGeneralTypeIssues] async def _cls_unarchive_async( cls, template: str, + /, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -330,6 +337,7 @@ async def _cls_unarchive_async( @staticmethod async def unarchive_async( template: str, + /, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"], ) -> "InvoiceRenderingTemplate": """ @@ -347,7 +355,7 @@ async def unarchive_async( ... @class_method_variant("_cls_unarchive_async") - async def unarchive_async( # pyright: ignore[reportGeneralTypeIssues] + async def unarchive_async( self, **params: Unpack["InvoiceRenderingTemplateUnarchiveParams"] ) -> "InvoiceRenderingTemplate": """ diff --git a/stripe/_invoice_rendering_template_service.py b/stripe/_invoice_rendering_template_service.py index 674bc2b55..919da6209 100644 --- a/stripe/_invoice_rendering_template_service.py +++ b/stripe/_invoice_rendering_template_service.py @@ -65,6 +65,7 @@ async def list_async( def retrieve( self, template: str, + /, params: Optional["InvoiceRenderingTemplateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": @@ -87,6 +88,7 @@ def retrieve( async def retrieve_async( self, template: str, + /, params: Optional["InvoiceRenderingTemplateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": @@ -109,6 +111,7 @@ async def retrieve_async( def archive( self, template: str, + /, params: Optional["InvoiceRenderingTemplateArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": @@ -131,6 +134,7 @@ def archive( async def archive_async( self, template: str, + /, params: Optional["InvoiceRenderingTemplateArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": @@ -153,6 +157,7 @@ async def archive_async( def unarchive( self, template: str, + /, params: Optional["InvoiceRenderingTemplateUnarchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": @@ -175,6 +180,7 @@ def unarchive( async def unarchive_async( self, template: str, + /, params: Optional["InvoiceRenderingTemplateUnarchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InvoiceRenderingTemplate": diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index db1d71393..0bf370e6f 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -81,6 +81,7 @@ def __getattr__(self, name): def delete( self, invoice: str, + /, params: Optional["InvoiceDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -101,6 +102,7 @@ def delete( async def delete_async( self, invoice: str, + /, params: Optional["InvoiceDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -121,6 +123,7 @@ async def delete_async( def retrieve( self, invoice: str, + /, params: Optional["InvoiceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -141,6 +144,7 @@ def retrieve( async def retrieve_async( self, invoice: str, + /, params: Optional["InvoiceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -161,12 +165,14 @@ async def retrieve_async( def update( self, invoice: str, + /, params: Optional["InvoiceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized), - monetary values, as well as collection_method, become uneditable. + you can no longer change most of its details, including monetary values and collection_method. For most invoices, + this also includes description. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass @@ -186,12 +192,14 @@ def update( async def update_async( self, invoice: str, + /, params: Optional["InvoiceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://docs.stripe.com/docs/billing/invoices/workflow#finalized), - monetary values, as well as collection_method, become uneditable. + you can no longer change most of its details, including monetary values and collection_method. For most invoices, + this also includes description. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://docs.stripe.com/docs/billing/invoices/reconciliation) invoices, pass @@ -331,6 +339,7 @@ async def search_async( def add_lines( self, invoice: str, + /, params: "InvoiceAddLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -353,6 +362,7 @@ def add_lines( async def add_lines_async( self, invoice: str, + /, params: "InvoiceAddLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -375,6 +385,7 @@ async def add_lines_async( def attach_payment( self, invoice: str, + /, params: Optional["InvoiceAttachPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -406,6 +417,7 @@ def attach_payment( async def attach_payment_async( self, invoice: str, + /, params: Optional["InvoiceAttachPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -437,6 +449,7 @@ async def attach_payment_async( def detach_payment( self, invoice: str, + /, params: Optional["InvoiceDetachPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -459,6 +472,7 @@ def detach_payment( async def detach_payment_async( self, invoice: str, + /, params: Optional["InvoiceDetachPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -481,6 +495,7 @@ async def detach_payment_async( def finalize_invoice( self, invoice: str, + /, params: Optional["InvoiceFinalizeInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -503,6 +518,7 @@ def finalize_invoice( async def finalize_invoice_async( self, invoice: str, + /, params: Optional["InvoiceFinalizeInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -525,6 +541,7 @@ async def finalize_invoice_async( def mark_uncollectible( self, invoice: str, + /, params: Optional["InvoiceMarkUncollectibleParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -547,6 +564,7 @@ def mark_uncollectible( async def mark_uncollectible_async( self, invoice: str, + /, params: Optional["InvoiceMarkUncollectibleParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -569,6 +587,7 @@ async def mark_uncollectible_async( def pay( self, invoice: str, + /, params: Optional["InvoicePayParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -591,6 +610,7 @@ def pay( async def pay_async( self, invoice: str, + /, params: Optional["InvoicePayParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -613,6 +633,7 @@ async def pay_async( def remove_lines( self, invoice: str, + /, params: "InvoiceRemoveLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -635,6 +656,7 @@ def remove_lines( async def remove_lines_async( self, invoice: str, + /, params: "InvoiceRemoveLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -657,6 +679,7 @@ async def remove_lines_async( def send_invoice( self, invoice: str, + /, params: Optional["InvoiceSendInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -681,6 +704,7 @@ def send_invoice( async def send_invoice_async( self, invoice: str, + /, params: Optional["InvoiceSendInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -705,6 +729,7 @@ async def send_invoice_async( def update_lines( self, invoice: str, + /, params: "InvoiceUpdateLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -727,6 +752,7 @@ def update_lines( async def update_lines_async( self, invoice: str, + /, params: "InvoiceUpdateLinesParams", options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -749,6 +775,7 @@ async def update_lines_async( def void_invoice( self, invoice: str, + /, params: Optional["InvoiceVoidInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": @@ -773,6 +800,7 @@ def void_invoice( async def void_invoice_async( self, invoice: str, + /, params: Optional["InvoiceVoidInvoiceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Invoice": diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 75b7882ce..fa06b4050 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -31,7 +31,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) diff --git a/stripe/_mandate.py b/stripe/_mandate.py index b2737a058..b534a3d64 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -127,8 +127,38 @@ class BacsDebit(StripeObject): The URL that will contain the mandate that the customer has signed. """ + class Blik(StripeObject): + expires_at: Optional[int] + """ + Date at which the mandate expires. + """ + type: Literal["off_session"] + """ + Type of the mandate. + """ + class Card(StripeObject): - pass + class India(StripeObject): + inactive_reason: Optional[ + Union[ + Literal[ + "canceled", + "card_not_supported", + "currency_not_supported", + "expired", + "issuer_not_supported", + "processing_error", + "undetermined", + ], + str, + ] + ] + """ + The reason why the mandate has an `inactive` status. This field is only populated if the mandate is inactive. + """ + + india: Optional[India] + _inner_class_types = {"india": India} class Cashapp(StripeObject): pass @@ -312,6 +342,7 @@ class UsBankAccount(StripeObject): amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] + blik: Optional[Blik] card: Optional[Card] cashapp: Optional[Cashapp] kakao_pay: Optional[KakaoPay] @@ -337,6 +368,7 @@ class UsBankAccount(StripeObject): "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, + "blik": Blik, "card": Card, "cashapp": Cashapp, "kakao_pay": KakaoPay, diff --git a/stripe/_mandate_service.py b/stripe/_mandate_service.py index 429ce66b7..b763a6b87 100644 --- a/stripe/_mandate_service.py +++ b/stripe/_mandate_service.py @@ -55,6 +55,7 @@ async def list_async( def retrieve( self, mandate: str, + /, params: Optional["MandateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Mandate": @@ -75,6 +76,7 @@ def retrieve( async def retrieve_async( self, mandate: str, + /, params: Optional["MandateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Mandate": diff --git a/stripe/_margin.py b/stripe/_margin.py index 2d67bad70..533b6ed4e 100644 --- a/stripe/_margin.py +++ b/stripe/_margin.py @@ -136,7 +136,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["MarginModifyParams"] + cls, id: str, /, **params: Unpack["MarginModifyParams"] ) -> "Margin": """ Update the specified margin object. Certain fields of the margin object are not editable. @@ -153,7 +153,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["MarginModifyParams"] + cls, id: str, /, **params: Unpack["MarginModifyParams"] ) -> "Margin": """ Update the specified margin object. Certain fields of the margin object are not editable. diff --git a/stripe/_margin_service.py b/stripe/_margin_service.py index c020b2e59..78ce7ce67 100644 --- a/stripe/_margin_service.py +++ b/stripe/_margin_service.py @@ -95,6 +95,7 @@ async def create_async( def retrieve( self, margin: str, + /, params: Optional["MarginRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Margin": @@ -117,6 +118,7 @@ def retrieve( async def retrieve_async( self, margin: str, + /, params: Optional["MarginRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Margin": @@ -139,6 +141,7 @@ async def retrieve_async( def update( self, margin: str, + /, params: Optional["MarginUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Margin": @@ -161,6 +164,7 @@ def update( async def update_async( self, margin: str, + /, params: Optional["MarginUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Margin": diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 56f2b74a7..740089866 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -24,6 +24,7 @@ "application": ("stripe._application", "Application"), "application_fee": ("stripe._application_fee", "ApplicationFee"), "fee_refund": ("stripe._application_fee_refund", "ApplicationFeeRefund"), + "apps.install": ("stripe.apps._install", "Install"), "apps.secret": ("stripe.apps._secret", "Secret"), "balance": ("stripe._balance", "Balance"), "balance_settings": ("stripe._balance_settings", "BalanceSettings"), @@ -266,6 +267,10 @@ "stripe._quote_preview_subscription_schedule", "QuotePreviewSubscriptionSchedule", ), + "radar.billing_evaluation": ( + "stripe.radar._billing_evaluation", + "BillingEvaluation", + ), "radar.early_fraud_warning": ( "stripe.radar._early_fraud_warning", "EarlyFraudWarning", @@ -289,7 +294,6 @@ "stripe._reserve_transaction", "ReserveTransaction", ), - "transfer_reversal": ("stripe._reversal", "Reversal"), "review": ("stripe._review", "Review"), "setup_attempt": ("stripe._setup_attempt", "SetupAttempt"), "setup_intent": ("stripe._setup_intent", "SetupIntent"), @@ -362,9 +366,14 @@ "stripe.test_helpers._test_clock", "TestClock", ), + "three_d_secure.authentication": ( + "stripe.three_d_secure._authentication", + "Authentication", + ), "token": ("stripe._token", "Token"), "topup": ("stripe._topup", "Topup"), "transfer": ("stripe._transfer", "Transfer"), + "transfer_reversal": ("stripe._transfer_reversal", "TransferReversal"), "treasury.credit_reversal": ( "stripe.treasury._credit_reversal", "CreditReversal", @@ -481,14 +490,6 @@ "stripe.v2.extend._workflow_run", "WorkflowRun", ), - "financial_address_credit_simulation": ( - "stripe.v2._financial_address_credit_simulation", - "FinancialAddressCreditSimulation", - ), - "financial_address_generated_microdeposits": ( - "stripe.v2._financial_address_generated_microdeposits", - "FinancialAddressGeneratedMicrodeposits", - ), "v2.iam.activity_log": ("stripe.v2.iam._activity_log", "ActivityLog"), "v2.money_management.adjustment": ( "stripe.v2.money_management._adjustment", @@ -502,6 +503,14 @@ "stripe.v2.money_management._financial_address", "FinancialAddress", ), + "v2.money_management.financial_address_credit_simulation": ( + "stripe.v2.money_management._financial_address_credit_simulation", + "FinancialAddressCreditSimulation", + ), + "v2.money_management.financial_address_generated_microdeposits": ( + "stripe.v2.money_management._financial_address_generated_microdeposits", + "FinancialAddressGeneratedMicrodeposits", + ), "v2.money_management.inbound_transfer": ( "stripe.v2.money_management._inbound_transfer", "InboundTransfer", diff --git a/stripe/_order.py b/stripe/_order.py index c0f36bcc9..d4ca3f5f3 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -557,7 +557,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -963,7 +963,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -1191,7 +1191,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["OrderModifyParams"]) -> "Order": + def modify( + cls, id: str, /, **params: Unpack["OrderModifyParams"] + ) -> "Order": """ Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ @@ -1207,7 +1209,7 @@ def modify(cls, id: str, **params: Unpack["OrderModifyParams"]) -> "Order": @classmethod async def modify_async( - cls, id: str, **params: Unpack["OrderModifyParams"] + cls, id: str, /, **params: Unpack["OrderModifyParams"] ) -> "Order": """ Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1246,7 +1248,7 @@ async def retrieve_async( @classmethod def _cls_submit( - cls, id: str, **params: Unpack["OrderSubmitParams"] + cls, id: str, /, **params: Unpack["OrderSubmitParams"] ) -> "Order": """ Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. @@ -1262,7 +1264,7 @@ def _cls_submit( @overload @staticmethod - def submit(id: str, **params: Unpack["OrderSubmitParams"]) -> "Order": + def submit(id: str, /, **params: Unpack["OrderSubmitParams"]) -> "Order": """ Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. """ @@ -1276,9 +1278,7 @@ def submit(self, **params: Unpack["OrderSubmitParams"]) -> "Order": ... @class_method_variant("_cls_submit") - def submit( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["OrderSubmitParams"] - ) -> "Order": + def submit(self, **params: Unpack["OrderSubmitParams"]) -> "Order": """ Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. """ @@ -1295,7 +1295,7 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_submit_async( - cls, id: str, **params: Unpack["OrderSubmitParams"] + cls, id: str, /, **params: Unpack["OrderSubmitParams"] ) -> "Order": """ Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. @@ -1312,7 +1312,7 @@ async def _cls_submit_async( @overload @staticmethod async def submit_async( - id: str, **params: Unpack["OrderSubmitParams"] + id: str, /, **params: Unpack["OrderSubmitParams"] ) -> "Order": """ Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://docs.stripe.com/api#reopen_order) method is called. @@ -1329,7 +1329,7 @@ async def submit_async( ... @class_method_variant("_cls_submit_async") - async def submit_async( # pyright: ignore[reportGeneralTypeIssues] + async def submit_async( self, **params: Unpack["OrderSubmitParams"] ) -> "Order": """ diff --git a/stripe/_order_service.py b/stripe/_order_service.py index 53fb41c62..c4b91a87a 100644 --- a/stripe/_order_service.py +++ b/stripe/_order_service.py @@ -96,6 +96,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OrderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -116,6 +117,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OrderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -136,6 +138,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["OrderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -156,6 +159,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["OrderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -176,6 +180,7 @@ async def update_async( def submit( self, id: str, + /, params: "OrderSubmitParams", options: Optional["RequestOptions"] = None, ) -> "Order": @@ -196,6 +201,7 @@ def submit( async def submit_async( self, id: str, + /, params: "OrderSubmitParams", options: Optional["RequestOptions"] = None, ) -> "Order": diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 4957deb3a..ef3e18491 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -280,7 +280,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ funding type of the underlying payment method. """ @@ -565,7 +565,10 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed, based on the `result`. """ version: Optional[ - Union[Literal["1.0.2", "2.1.0", "2.2.0"], str] + Union[ + Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], + str, + ] ] """ The version of 3D Secure that was used. @@ -581,19 +584,24 @@ class ApplePay(StripeObject): class GooglePay(StripeObject): pass + class Link(StripeObject): + pass + apple_pay: Optional[ApplePay] dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ google_pay: Optional[GooglePay] + link: Optional[Link] type: str """ - The type of the card wallet, one of `apple_pay` or `google_pay`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ _inner_class_types = { "apple_pay": ApplePay, "google_pay": GooglePay, + "link": Link, } authorization_code: Optional[str] @@ -716,6 +724,12 @@ class GooglePay(StripeObject): """ This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -1459,6 +1473,10 @@ class Link(StripeObject): """ Two-letter ISO code representing the funding source country beneath the Link payment. You could use this attribute to get a sense of international fees. """ + funding_source_group: Optional[str] + """ + The [funding source group code](https://docs.stripe.com/payments/link/link-payment-methods) applied to this Link payment at confirmation time. + """ class MbWay(StripeObject): pass @@ -1492,6 +1510,16 @@ class Card(StripeObject): """ _inner_class_types = {"card": Card} + class Momo(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular MoMo account. You can use this attribute to check whether two MoMo accounts are the same. + """ + mandate: Optional[str] + """ + ID of the multi-use Mandate created by, or used to make, this MoMo payment. + """ + class Multibanco(StripeObject): entity: Optional[str] """ @@ -1826,7 +1854,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ Funding type of the underlying payment method. """ @@ -1905,6 +1933,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2101,6 +2135,7 @@ class Zip(StripeObject): link: Optional[Link] mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] + momo: Optional[Momo] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] nz_bank_account: Optional[NzBankAccount] @@ -2126,6 +2161,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2182,6 +2218,7 @@ class Zip(StripeObject): "link": Link, "mb_way": MbWay, "mobilepay": Mobilepay, + "momo": Momo, "multibanco": Multibanco, "naver_pay": NaverPay, "nz_bank_account": NzBankAccount, @@ -2203,6 +2240,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, diff --git a/stripe/_payment_attempt_record_service.py b/stripe/_payment_attempt_record_service.py index 0ee17d353..62893b087 100644 --- a/stripe/_payment_attempt_record_service.py +++ b/stripe/_payment_attempt_record_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["PaymentAttemptRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentAttemptRecord": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["PaymentAttemptRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentAttemptRecord": diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 748c84714..3bcd99eea 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -34,6 +34,7 @@ PaymentIntentAmountDetailsLineItem, ) from stripe._payment_method import PaymentMethod + from stripe._payment_record import PaymentRecord from stripe._review import Review from stripe._setup_intent import SetupIntent from stripe._source import Source @@ -237,7 +238,7 @@ class Tax(StripeObject): class LastPaymentError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -298,6 +299,7 @@ class LastPaymentError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -308,6 +310,8 @@ class LastPaymentError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -362,6 +366,7 @@ class LastPaymentError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -517,7 +522,7 @@ class LastPaymentError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -528,9 +533,9 @@ class LastPaymentError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -1407,6 +1412,10 @@ class QrCode(StripeObject): """ The raw data string used to generate QR code, it should be used together with QR code library. """ + expires_at: int + """ + The timestamp at which the QR code expires. + """ image_url_png: str """ The image_url_png string used to render QR code @@ -3111,16 +3120,101 @@ class Bancontact(StripeObject): """ class Billie(StripeObject): + class CompanyDetails(StripeObject): + class RegisteredAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code. + """ + line1: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + registered_address: Optional[RegisteredAddress] + registered_name: Optional[str] + """ + Company or entity name. + """ + registration_number: Optional[str] + """ + The official registration number for the given registration type. + """ + registration_type: Optional[ + Union[ + Literal[ + "ch_ein", + "de_hrb", + "dk_cvr", + "es_cif", + "fi_tunnus", + "fr_siren", + "fr_siret", + "it_rea", + "nl_kvk", + "no_org_number", + "no_pno", + "se_org_number", + "se_pno", + "uk_crn", + ], + str, + ] + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: Optional[str] + """ + VAT id number + """ + _inner_class_types = {"registered_address": RegisteredAddress} + capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ + company_details: Optional[CompanyDetails] + reference: Optional[str] + """ + An identifier or reference that this payment corresponds to. + """ + _inner_class_types = {"company_details": CompanyDetails} class Bizum(StripeObject): pass class Blik(StripeObject): - setup_future_usage: Optional[Literal["none"]] + class MandateOptions(StripeObject): + expires_at: Optional[int] + """ + Date at which the mandate expires. + """ + type: Optional[Literal["off_session"]] + """ + Type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3130,6 +3224,7 @@ class Blik(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). """ + _inner_class_types = {"mandate_options": MandateOptions} class Boleto(StripeObject): expires_after_days: int @@ -3359,6 +3454,12 @@ class Address(StripeObject): """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ + setup_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: Optional[ Union[Literal["none", "off_session", "on_session"], str] ] @@ -3380,6 +3481,12 @@ class Address(StripeObject): Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ statement_details: Optional[StatementDetails] + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Selected usage to indicate the transaction type of the off-session payment. + """ _inner_class_types = { "installments": Installments, "mandate_options": MandateOptions, @@ -4196,6 +4303,22 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Sequra(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + 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). + """ + class Shopeepay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -4417,7 +4540,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4493,6 +4616,7 @@ class Zip(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] @@ -4557,6 +4681,7 @@ class Zip(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, @@ -4707,6 +4832,7 @@ class PaymentData(StripeObject): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -4727,6 +4853,7 @@ class PaymentData(StripeObject): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -4876,7 +5003,7 @@ class PaymentData(StripeObject): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: Optional[str] """ @@ -4884,7 +5011,7 @@ class PaymentData(StripeObject): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: Optional[str] """ @@ -4944,6 +5071,7 @@ class PaymentData(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -5023,6 +5151,10 @@ class PaymentData(StripeObject): """ The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. A comprehensive list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ + payment_record: Optional[ExpandableField["PaymentRecord"]] + """ + ID of the [Payment Record object](https://docs.stripe.com/api/payment-record) created by this PaymentIntent. + """ presentment_details: Optional[PresentmentDetails] processing: Optional[Processing] """ @@ -5108,6 +5240,7 @@ class PaymentData(StripeObject): def _cls_apply_customer_balance( cls, intent: str, + /, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ @@ -5128,6 +5261,7 @@ def _cls_apply_customer_balance( @staticmethod def apply_customer_balance( intent: str, + /, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ @@ -5145,7 +5279,7 @@ def apply_customer_balance( ... @class_method_variant("_cls_apply_customer_balance") - def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] + def apply_customer_balance( self, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ @@ -5166,6 +5300,7 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] async def _cls_apply_customer_balance_async( cls, intent: str, + /, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ @@ -5186,6 +5321,7 @@ async def _cls_apply_customer_balance_async( @staticmethod async def apply_customer_balance_async( intent: str, + /, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ @@ -5203,7 +5339,7 @@ async def apply_customer_balance_async( ... @class_method_variant("_cls_apply_customer_balance_async") - async def apply_customer_balance_async( # pyright: ignore[reportGeneralTypeIssues] + async def apply_customer_balance_async( self, **params: Unpack["PaymentIntentApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ @@ -5222,7 +5358,7 @@ async def apply_customer_balance_async( # pyright: ignore[reportGeneralTypeIssu @classmethod def _cls_cancel( - cls, intent: str, **params: Unpack["PaymentIntentCancelParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://docs.stripe.com/docs/payments/intents), processing. @@ -5245,7 +5381,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - intent: str, **params: Unpack["PaymentIntentCancelParams"] + intent: str, /, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://docs.stripe.com/docs/payments/intents), processing. @@ -5270,7 +5406,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ @@ -5293,7 +5429,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, intent: str, **params: Unpack["PaymentIntentCancelParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://docs.stripe.com/docs/payments/intents), processing. @@ -5316,7 +5452,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - intent: str, **params: Unpack["PaymentIntentCancelParams"] + intent: str, /, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://docs.stripe.com/docs/payments/intents), processing. @@ -5341,7 +5477,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["PaymentIntentCancelParams"] ) -> "PaymentIntent": """ @@ -5364,7 +5500,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_capture( - cls, intent: str, **params: Unpack["PaymentIntentCaptureParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -5387,7 +5523,7 @@ def _cls_capture( @overload @staticmethod def capture( - intent: str, **params: Unpack["PaymentIntentCaptureParams"] + intent: str, /, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -5412,7 +5548,7 @@ def capture( ... @class_method_variant("_cls_capture") - def capture( # pyright: ignore[reportGeneralTypeIssues] + def capture( self, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ @@ -5435,7 +5571,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_capture_async( - cls, intent: str, **params: Unpack["PaymentIntentCaptureParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -5458,7 +5594,7 @@ async def _cls_capture_async( @overload @staticmethod async def capture_async( - intent: str, **params: Unpack["PaymentIntentCaptureParams"] + intent: str, /, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -5483,7 +5619,7 @@ async def capture_async( ... @class_method_variant("_cls_capture_async") - async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + async def capture_async( self, **params: Unpack["PaymentIntentCaptureParams"] ) -> "PaymentIntent": """ @@ -5506,7 +5642,7 @@ async def capture_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_confirm( - cls, intent: str, **params: Unpack["PaymentIntentConfirmParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -5554,7 +5690,7 @@ def _cls_confirm( @overload @staticmethod def confirm( - intent: str, **params: Unpack["PaymentIntentConfirmParams"] + intent: str, /, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -5629,7 +5765,7 @@ def confirm( ... @class_method_variant("_cls_confirm") - def confirm( # pyright: ignore[reportGeneralTypeIssues] + def confirm( self, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ @@ -5677,7 +5813,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_confirm_async( - cls, intent: str, **params: Unpack["PaymentIntentConfirmParams"] + cls, intent: str, /, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -5725,7 +5861,7 @@ async def _cls_confirm_async( @overload @staticmethod async def confirm_async( - intent: str, **params: Unpack["PaymentIntentConfirmParams"] + intent: str, /, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -5800,7 +5936,7 @@ async def confirm_async( ... @class_method_variant("_cls_confirm_async") - async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] + async def confirm_async( self, **params: Unpack["PaymentIntentConfirmParams"] ) -> "PaymentIntent": """ @@ -5900,6 +6036,7 @@ async def create_async( def _cls_decrement_authorization( cls, intent: str, + /, **params: Unpack["PaymentIntentDecrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -5935,6 +6072,7 @@ def _cls_decrement_authorization( @staticmethod def decrement_authorization( intent: str, + /, **params: Unpack["PaymentIntentDecrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -5982,7 +6120,7 @@ def decrement_authorization( ... @class_method_variant("_cls_decrement_authorization") - def decrement_authorization( # pyright: ignore[reportGeneralTypeIssues] + def decrement_authorization( self, **params: Unpack["PaymentIntentDecrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -6018,6 +6156,7 @@ def decrement_authorization( # pyright: ignore[reportGeneralTypeIssues] async def _cls_decrement_authorization_async( cls, intent: str, + /, **params: Unpack["PaymentIntentDecrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6053,6 +6192,7 @@ async def _cls_decrement_authorization_async( @staticmethod async def decrement_authorization_async( intent: str, + /, **params: Unpack["PaymentIntentDecrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6100,7 +6240,7 @@ async def decrement_authorization_async( ... @class_method_variant("_cls_decrement_authorization_async") - async def decrement_authorization_async( # pyright: ignore[reportGeneralTypeIssues] + async def decrement_authorization_async( self, **params: Unpack["PaymentIntentDecrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -6136,6 +6276,7 @@ async def decrement_authorization_async( # pyright: ignore[reportGeneralTypeIss def _cls_increment_authorization( cls, intent: str, + /, **params: Unpack["PaymentIntentIncrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6181,6 +6322,7 @@ def _cls_increment_authorization( @staticmethod def increment_authorization( intent: str, + /, **params: Unpack["PaymentIntentIncrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6248,7 +6390,7 @@ def increment_authorization( ... @class_method_variant("_cls_increment_authorization") - def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] + def increment_authorization( self, **params: Unpack["PaymentIntentIncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -6294,6 +6436,7 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] async def _cls_increment_authorization_async( cls, intent: str, + /, **params: Unpack["PaymentIntentIncrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6339,6 +6482,7 @@ async def _cls_increment_authorization_async( @staticmethod async def increment_authorization_async( intent: str, + /, **params: Unpack["PaymentIntentIncrementAuthorizationParams"], ) -> "PaymentIntent": """ @@ -6406,7 +6550,7 @@ async def increment_authorization_async( ... @class_method_variant("_cls_increment_authorization_async") - async def increment_authorization_async( # pyright: ignore[reportGeneralTypeIssues] + async def increment_authorization_async( self, **params: Unpack["PaymentIntentIncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -6490,7 +6634,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PaymentIntentModifyParams"] + cls, id: str, /, **params: Unpack["PaymentIntentModifyParams"] ) -> "PaymentIntent": """ Updates properties on a PaymentIntent object without confirming. @@ -6513,7 +6657,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PaymentIntentModifyParams"] + cls, id: str, /, **params: Unpack["PaymentIntentModifyParams"] ) -> "PaymentIntent": """ Updates properties on a PaymentIntent object without confirming. @@ -6543,7 +6687,7 @@ def retrieve( You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. - If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api#payment_intent_object) object reference for more details. + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api/payment_intents/object) object reference for more details. """ instance = cls(id, **params) instance.refresh() @@ -6558,7 +6702,7 @@ async def retrieve_async( You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. - If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api#payment_intent_object) object reference for more details. + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api/payment_intents/object) object reference for more details. """ instance = cls(id, **params) await instance.refresh_async() @@ -6566,7 +6710,10 @@ async def retrieve_async( @classmethod def _cls_trigger_action( - cls, intent: str, **params: Unpack["PaymentIntentTriggerActionParams"] + cls, + intent: str, + /, + **params: Unpack["PaymentIntentTriggerActionParams"], ) -> "PaymentIntent": """ Trigger an external action on a PaymentIntent. @@ -6585,7 +6732,7 @@ def _cls_trigger_action( @overload @staticmethod def trigger_action( - intent: str, **params: Unpack["PaymentIntentTriggerActionParams"] + intent: str, /, **params: Unpack["PaymentIntentTriggerActionParams"] ) -> "PaymentIntent": """ Trigger an external action on a PaymentIntent. @@ -6602,7 +6749,7 @@ def trigger_action( ... @class_method_variant("_cls_trigger_action") - def trigger_action( # pyright: ignore[reportGeneralTypeIssues] + def trigger_action( self, **params: Unpack["PaymentIntentTriggerActionParams"] ) -> "PaymentIntent": """ @@ -6621,7 +6768,10 @@ def trigger_action( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_trigger_action_async( - cls, intent: str, **params: Unpack["PaymentIntentTriggerActionParams"] + cls, + intent: str, + /, + **params: Unpack["PaymentIntentTriggerActionParams"], ) -> "PaymentIntent": """ Trigger an external action on a PaymentIntent. @@ -6640,7 +6790,7 @@ async def _cls_trigger_action_async( @overload @staticmethod async def trigger_action_async( - intent: str, **params: Unpack["PaymentIntentTriggerActionParams"] + intent: str, /, **params: Unpack["PaymentIntentTriggerActionParams"] ) -> "PaymentIntent": """ Trigger an external action on a PaymentIntent. @@ -6657,7 +6807,7 @@ async def trigger_action_async( ... @class_method_variant("_cls_trigger_action_async") - async def trigger_action_async( # pyright: ignore[reportGeneralTypeIssues] + async def trigger_action_async( self, **params: Unpack["PaymentIntentTriggerActionParams"] ) -> "PaymentIntent": """ @@ -6678,6 +6828,7 @@ async def trigger_action_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_verify_microdeposits( cls, intent: str, + /, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"], ) -> "PaymentIntent": """ @@ -6697,7 +6848,9 @@ def _cls_verify_microdeposits( @overload @staticmethod def verify_microdeposits( - intent: str, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"] + intent: str, + /, + **params: Unpack["PaymentIntentVerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -6714,7 +6867,7 @@ def verify_microdeposits( ... @class_method_variant("_cls_verify_microdeposits") - def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] + def verify_microdeposits( self, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"] ) -> "PaymentIntent": """ @@ -6735,6 +6888,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] async def _cls_verify_microdeposits_async( cls, intent: str, + /, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"], ) -> "PaymentIntent": """ @@ -6754,7 +6908,9 @@ async def _cls_verify_microdeposits_async( @overload @staticmethod async def verify_microdeposits_async( - intent: str, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"] + intent: str, + /, + **params: Unpack["PaymentIntentVerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -6771,7 +6927,7 @@ async def verify_microdeposits_async( ... @class_method_variant("_cls_verify_microdeposits_async") - async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] + async def verify_microdeposits_async( self, **params: Unpack["PaymentIntentVerifyMicrodepositsParams"] ) -> "PaymentIntent": """ @@ -6832,6 +6988,7 @@ async def search_auto_paging_iter_async( def list_amount_details_line_items( cls, intent: str, + /, **params: Unpack["PaymentIntentListAmountDetailsLineItemsParams"], ) -> ListObject["PaymentIntentAmountDetailsLineItem"]: """ @@ -6852,6 +7009,7 @@ def list_amount_details_line_items( async def list_amount_details_line_items_async( cls, intent: str, + /, **params: Unpack["PaymentIntentListAmountDetailsLineItemsParams"], ) -> ListObject["PaymentIntentAmountDetailsLineItem"]: """ diff --git a/stripe/_payment_intent_amount_details_line_item.py b/stripe/_payment_intent_amount_details_line_item.py index c0837ed2d..dec5e47d8 100644 --- a/stripe/_payment_intent_amount_details_line_item.py +++ b/stripe/_payment_intent_amount_details_line_item.py @@ -55,9 +55,9 @@ class Paypal(StripeObject): class Tax(StripeObject): total_tax_amount: int """ - The total amount of tax on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L2 rates. An integer greater than or equal to 0. + The total amount of tax on a single line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0. - This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field. + This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field. """ discount_amount: Optional[int] diff --git a/stripe/_payment_intent_amount_details_line_item_service.py b/stripe/_payment_intent_amount_details_line_item_service.py index a8ac4bc15..1cadd061e 100644 --- a/stripe/_payment_intent_amount_details_line_item_service.py +++ b/stripe/_payment_intent_amount_details_line_item_service.py @@ -20,6 +20,7 @@ class PaymentIntentAmountDetailsLineItemService(StripeService): def list( self, intent: str, + /, params: Optional[ "PaymentIntentAmountDetailsLineItemListParams" ] = None, @@ -44,6 +45,7 @@ def list( async def list_async( self, intent: str, + /, params: Optional[ "PaymentIntentAmountDetailsLineItemListParams" ] = None, diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 28cf4f77a..cc440d8db 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -181,6 +181,7 @@ async def create_async( def retrieve( self, intent: str, + /, params: Optional["PaymentIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -189,7 +190,7 @@ def retrieve( You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. - If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api#payment_intent_object) object reference for more details. + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api/payment_intents/object) object reference for more details. """ return cast( "PaymentIntent", @@ -207,6 +208,7 @@ def retrieve( async def retrieve_async( self, intent: str, + /, params: Optional["PaymentIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -215,7 +217,7 @@ async def retrieve_async( You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. - If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api#payment_intent_object) object reference for more details. + If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://docs.stripe.com/api/payment_intents/object) object reference for more details. """ return cast( "PaymentIntent", @@ -233,6 +235,7 @@ async def retrieve_async( def update( self, intent: str, + /, params: Optional["PaymentIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -261,6 +264,7 @@ def update( async def update_async( self, intent: str, + /, params: Optional["PaymentIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -333,6 +337,7 @@ async def search_async( def apply_customer_balance( self, intent: str, + /, params: Optional["PaymentIntentApplyCustomerBalanceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -355,6 +360,7 @@ def apply_customer_balance( async def apply_customer_balance_async( self, intent: str, + /, params: Optional["PaymentIntentApplyCustomerBalanceParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -377,6 +383,7 @@ async def apply_customer_balance_async( def cancel( self, intent: str, + /, params: Optional["PaymentIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -403,6 +410,7 @@ def cancel( async def cancel_async( self, intent: str, + /, params: Optional["PaymentIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -429,6 +437,7 @@ async def cancel_async( def capture( self, intent: str, + /, params: Optional["PaymentIntentCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -455,6 +464,7 @@ def capture( async def capture_async( self, intent: str, + /, params: Optional["PaymentIntentCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -481,6 +491,7 @@ async def capture_async( def confirm( self, intent: str, + /, params: Optional["PaymentIntentConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -532,6 +543,7 @@ def confirm( async def confirm_async( self, intent: str, + /, params: Optional["PaymentIntentConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -583,6 +595,7 @@ async def confirm_async( def decrement_authorization( self, intent: str, + /, params: "PaymentIntentDecrementAuthorizationParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -620,6 +633,7 @@ def decrement_authorization( async def decrement_authorization_async( self, intent: str, + /, params: "PaymentIntentDecrementAuthorizationParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -657,6 +671,7 @@ async def decrement_authorization_async( def increment_authorization( self, intent: str, + /, params: "PaymentIntentIncrementAuthorizationParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -704,6 +719,7 @@ def increment_authorization( async def increment_authorization_async( self, intent: str, + /, params: "PaymentIntentIncrementAuthorizationParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -751,6 +767,7 @@ async def increment_authorization_async( def verify_microdeposits( self, intent: str, + /, params: Optional["PaymentIntentVerifyMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -773,6 +790,7 @@ def verify_microdeposits( async def verify_microdeposits_async( self, intent: str, + /, params: Optional["PaymentIntentVerifyMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -795,6 +813,7 @@ async def verify_microdeposits_async( def trigger_action( self, intent: str, + /, params: "PaymentIntentTriggerActionParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": @@ -817,6 +836,7 @@ def trigger_action( async def trigger_action_async( self, intent: str, + /, params: "PaymentIntentTriggerActionParams", options: Optional["RequestOptions"] = None, ) -> "PaymentIntent": diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 080199ec6..b97888154 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -141,7 +141,7 @@ class Option(StripeObject): class Label(StripeObject): custom: Optional[str] """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -823,7 +823,7 @@ class TransferData(StripeObject): """ custom_fields: List[CustomField] """ - 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`. + 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 `elements`. """ custom_text: CustomText customer_creation: Union[Literal["always", "if_required"], str] @@ -925,6 +925,7 @@ class TransferData(StripeObject): "rechnung", "satispay", "sepa_debit", + "sequra", "shopeepay", "sofort", "sunbit", @@ -1051,6 +1052,7 @@ async def list_async( def _cls_list_line_items( cls, payment_link: str, + /, **params: Unpack["PaymentLinkListLineItemsParams"], ) -> ListObject["LineItem"]: """ @@ -1070,7 +1072,9 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - payment_link: str, **params: Unpack["PaymentLinkListLineItemsParams"] + payment_link: str, + /, + **params: Unpack["PaymentLinkListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1087,7 +1091,7 @@ def list_line_items( ... @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_line_items( self, **params: Unpack["PaymentLinkListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1108,6 +1112,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, payment_link: str, + /, **params: Unpack["PaymentLinkListLineItemsParams"], ) -> ListObject["LineItem"]: """ @@ -1127,7 +1132,9 @@ async def _cls_list_line_items_async( @overload @staticmethod async def list_line_items_async( - payment_link: str, **params: Unpack["PaymentLinkListLineItemsParams"] + payment_link: str, + /, + **params: Unpack["PaymentLinkListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1144,7 +1151,7 @@ async def list_line_items_async( ... @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_line_items_async( self, **params: Unpack["PaymentLinkListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1163,7 +1170,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def modify( - cls, id: str, **params: Unpack["PaymentLinkModifyParams"] + cls, id: str, /, **params: Unpack["PaymentLinkModifyParams"] ) -> "PaymentLink": """ Updates a payment link. @@ -1180,7 +1187,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PaymentLinkModifyParams"] + cls, id: str, /, **params: Unpack["PaymentLinkModifyParams"] ) -> "PaymentLink": """ Updates a payment link. diff --git a/stripe/_payment_link_line_item_service.py b/stripe/_payment_link_line_item_service.py index d480f536c..43d6a43da 100644 --- a/stripe/_payment_link_line_item_service.py +++ b/stripe/_payment_link_line_item_service.py @@ -18,6 +18,7 @@ class PaymentLinkLineItemService(StripeService): def list( self, payment_link: str, + /, params: Optional["PaymentLinkLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, payment_link: str, + /, params: Optional["PaymentLinkLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 0fc673475..9536b8df4 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -133,6 +133,7 @@ async def create_async( def retrieve( self, payment_link: str, + /, params: Optional["PaymentLinkRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentLink": @@ -155,6 +156,7 @@ def retrieve( async def retrieve_async( self, payment_link: str, + /, params: Optional["PaymentLinkRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentLink": @@ -177,6 +179,7 @@ async def retrieve_async( def update( self, payment_link: str, + /, params: Optional["PaymentLinkUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentLink": @@ -199,6 +202,7 @@ def update( async def update_async( self, payment_link: str, + /, params: Optional["PaymentLinkUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentLink": diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index d001a7c92..f2bbf4a56 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1422,6 +1422,9 @@ class GeneratedFrom(StripeObject): """ _inner_class_types = {"generated_from": GeneratedFrom} + class Sequra(StripeObject): + pass + class Shopeepay(StripeObject): pass @@ -1659,6 +1662,7 @@ class Zip(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shared_payment_granted_token: Optional[str] """ ID of the shared payment granted token used in the creation of this PaymentMethod. @@ -1725,6 +1729,7 @@ class Zip(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1748,7 +1753,10 @@ class Zip(StripeObject): @classmethod def _cls_attach( - cls, payment_method: str, **params: Unpack["PaymentMethodAttachParams"] + cls, + payment_method: str, + /, + **params: Unpack["PaymentMethodAttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1779,7 +1787,7 @@ def _cls_attach( @overload @staticmethod def attach( - payment_method: str, **params: Unpack["PaymentMethodAttachParams"] + payment_method: str, /, **params: Unpack["PaymentMethodAttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1820,7 +1828,7 @@ def attach( ... @class_method_variant("_cls_attach") - def attach( # pyright: ignore[reportGeneralTypeIssues] + def attach( self, **params: Unpack["PaymentMethodAttachParams"] ) -> "PaymentMethod": """ @@ -1851,7 +1859,10 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_attach_async( - cls, payment_method: str, **params: Unpack["PaymentMethodAttachParams"] + cls, + payment_method: str, + /, + **params: Unpack["PaymentMethodAttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1882,7 +1893,7 @@ async def _cls_attach_async( @overload @staticmethod async def attach_async( - payment_method: str, **params: Unpack["PaymentMethodAttachParams"] + payment_method: str, /, **params: Unpack["PaymentMethodAttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1923,7 +1934,7 @@ async def attach_async( ... @class_method_variant("_cls_attach_async") - async def attach_async( # pyright: ignore[reportGeneralTypeIssues] + async def attach_async( self, **params: Unpack["PaymentMethodAttachParams"] ) -> "PaymentMethod": """ @@ -1990,7 +2001,10 @@ async def create_async( @classmethod def _cls_detach( - cls, payment_method: str, **params: Unpack["PaymentMethodDetachParams"] + cls, + payment_method: str, + /, + **params: Unpack["PaymentMethodDetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. @@ -2009,7 +2023,7 @@ def _cls_detach( @overload @staticmethod def detach( - payment_method: str, **params: Unpack["PaymentMethodDetachParams"] + payment_method: str, /, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. @@ -2026,7 +2040,7 @@ def detach( ... @class_method_variant("_cls_detach") - def detach( # pyright: ignore[reportGeneralTypeIssues] + def detach( self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ @@ -2045,7 +2059,10 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_detach_async( - cls, payment_method: str, **params: Unpack["PaymentMethodDetachParams"] + cls, + payment_method: str, + /, + **params: Unpack["PaymentMethodDetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. @@ -2064,7 +2081,7 @@ async def _cls_detach_async( @overload @staticmethod async def detach_async( - payment_method: str, **params: Unpack["PaymentMethodDetachParams"] + payment_method: str, /, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. @@ -2081,7 +2098,7 @@ async def detach_async( ... @class_method_variant("_cls_detach_async") - async def detach_async( # pyright: ignore[reportGeneralTypeIssues] + async def detach_async( self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ @@ -2140,7 +2157,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PaymentMethodModifyParams"] + cls, id: str, /, **params: Unpack["PaymentMethodModifyParams"] ) -> "PaymentMethod": """ Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated. @@ -2157,7 +2174,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PaymentMethodModifyParams"] + cls, id: str, /, **params: Unpack["PaymentMethodModifyParams"] ) -> "PaymentMethod": """ Updates a PaymentMethod object. A PaymentMethod must be attached to a customer to be updated. @@ -2252,6 +2269,7 @@ async def retrieve_async( "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index a0ed8a425..89276b7c9 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -1238,6 +1238,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Sequra(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Union[Literal["none", "off", "on"], str] + """ + The account's display preference. + """ + value: Union[Literal["off", "on"], str] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Shopeepay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1522,6 +1544,7 @@ class DisplayPreference(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] sunbit: Optional[Sunbit] @@ -1608,6 +1631,7 @@ async def list_async( def modify( cls, id: str, + /, **params: Unpack["PaymentMethodConfigurationModifyParams"], ) -> "PaymentMethodConfiguration": """ @@ -1627,6 +1651,7 @@ def modify( async def modify_async( cls, id: str, + /, **params: Unpack["PaymentMethodConfigurationModifyParams"], ) -> "PaymentMethodConfiguration": """ @@ -1723,6 +1748,7 @@ async def retrieve_async( "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "sunbit": Sunbit, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index e8421f119..8a637b2cb 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, configuration: str, + /, params: Optional["PaymentMethodConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodConfiguration": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, configuration: str, + /, params: Optional["PaymentMethodConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodConfiguration": @@ -147,6 +149,7 @@ async def retrieve_async( def update( self, configuration: str, + /, params: Optional["PaymentMethodConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodConfiguration": @@ -169,6 +172,7 @@ def update( async def update_async( self, configuration: str, + /, params: Optional["PaymentMethodConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodConfiguration": diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 31d7467bd..52ec77b94 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -268,7 +268,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PaymentMethodDomainModifyParams"] + cls, id: str, /, **params: Unpack["PaymentMethodDomainModifyParams"] ) -> "PaymentMethodDomain": """ Updates an existing payment method domain. @@ -285,7 +285,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PaymentMethodDomainModifyParams"] + cls, id: str, /, **params: Unpack["PaymentMethodDomainModifyParams"] ) -> "PaymentMethodDomain": """ Updates an existing payment method domain. @@ -326,6 +326,7 @@ async def retrieve_async( def _cls_validate( cls, payment_method_domain: str, + /, **params: Unpack["PaymentMethodDomainValidateParams"], ) -> "PaymentMethodDomain": """ @@ -351,6 +352,7 @@ def _cls_validate( @staticmethod def validate( payment_method_domain: str, + /, **params: Unpack["PaymentMethodDomainValidateParams"], ) -> "PaymentMethodDomain": """ @@ -378,7 +380,7 @@ def validate( ... @class_method_variant("_cls_validate") - def validate( # pyright: ignore[reportGeneralTypeIssues] + def validate( self, **params: Unpack["PaymentMethodDomainValidateParams"] ) -> "PaymentMethodDomain": """ @@ -404,6 +406,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_validate_async( cls, payment_method_domain: str, + /, **params: Unpack["PaymentMethodDomainValidateParams"], ) -> "PaymentMethodDomain": """ @@ -429,6 +432,7 @@ async def _cls_validate_async( @staticmethod async def validate_async( payment_method_domain: str, + /, **params: Unpack["PaymentMethodDomainValidateParams"], ) -> "PaymentMethodDomain": """ @@ -456,7 +460,7 @@ async def validate_async( ... @class_method_variant("_cls_validate_async") - async def validate_async( # pyright: ignore[reportGeneralTypeIssues] + async def validate_async( self, **params: Unpack["PaymentMethodDomainValidateParams"] ) -> "PaymentMethodDomain": """ diff --git a/stripe/_payment_method_domain_service.py b/stripe/_payment_method_domain_service.py index 122bb45a3..f508640e4 100644 --- a/stripe/_payment_method_domain_service.py +++ b/stripe/_payment_method_domain_service.py @@ -106,6 +106,7 @@ async def create_async( def retrieve( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": @@ -128,6 +129,7 @@ def retrieve( async def retrieve_async( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": @@ -150,6 +152,7 @@ async def retrieve_async( def update( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": @@ -172,6 +175,7 @@ def update( async def update_async( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": @@ -194,6 +198,7 @@ async def update_async( def validate( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainValidateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": @@ -221,6 +226,7 @@ def validate( async def validate_async( self, payment_method_domain: str, + /, params: Optional["PaymentMethodDomainValidateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethodDomain": diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 5df68e252..6018521a1 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -113,6 +113,7 @@ async def create_async( def retrieve( self, payment_method: str, + /, params: Optional["PaymentMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -135,6 +136,7 @@ def retrieve( async def retrieve_async( self, payment_method: str, + /, params: Optional["PaymentMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -157,6 +159,7 @@ async def retrieve_async( def update( self, payment_method: str, + /, params: Optional["PaymentMethodUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -179,6 +182,7 @@ def update( async def update_async( self, payment_method: str, + /, params: Optional["PaymentMethodUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -201,6 +205,7 @@ async def update_async( def attach( self, payment_method: str, + /, params: Optional["PaymentMethodAttachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -235,6 +240,7 @@ def attach( async def attach_async( self, payment_method: str, + /, params: Optional["PaymentMethodAttachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -269,6 +275,7 @@ async def attach_async( def detach( self, payment_method: str, + /, params: Optional["PaymentMethodDetachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": @@ -291,6 +298,7 @@ def detach( async def detach_async( self, payment_method: str, + /, params: Optional["PaymentMethodDetachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index 777f8970e..a2e7a74b7 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -300,7 +300,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ funding type of the underlying payment method. """ @@ -585,7 +585,10 @@ class ThreeDSecure(StripeObject): Additional information about why 3D Secure succeeded or failed, based on the `result`. """ version: Optional[ - Union[Literal["1.0.2", "2.1.0", "2.2.0"], str] + Union[ + Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], + str, + ] ] """ The version of 3D Secure that was used. @@ -601,19 +604,24 @@ class ApplePay(StripeObject): class GooglePay(StripeObject): pass + class Link(StripeObject): + pass + apple_pay: Optional[ApplePay] dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ google_pay: Optional[GooglePay] + link: Optional[Link] type: str """ - The type of the card wallet, one of `apple_pay` or `google_pay`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ _inner_class_types = { "apple_pay": ApplePay, "google_pay": GooglePay, + "link": Link, } authorization_code: Optional[str] @@ -736,6 +744,12 @@ class GooglePay(StripeObject): """ This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -1479,6 +1493,10 @@ class Link(StripeObject): """ Two-letter ISO code representing the funding source country beneath the Link payment. You could use this attribute to get a sense of international fees. """ + funding_source_group: Optional[str] + """ + The [funding source group code](https://docs.stripe.com/payments/link/link-payment-methods) applied to this Link payment at confirmation time. + """ class MbWay(StripeObject): pass @@ -1512,6 +1530,16 @@ class Card(StripeObject): """ _inner_class_types = {"card": Card} + class Momo(StripeObject): + fingerprint: Optional[str] + """ + Uniquely identifies this particular MoMo account. You can use this attribute to check whether two MoMo accounts are the same. + """ + mandate: Optional[str] + """ + ID of the multi-use Mandate created by, or used to make, this MoMo payment. + """ + class Multibanco(StripeObject): entity: Optional[str] """ @@ -1846,7 +1874,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ Funding type of the underlying payment method. """ @@ -1925,6 +1953,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2121,6 +2155,7 @@ class Zip(StripeObject): link: Optional[Link] mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] + momo: Optional[Momo] multibanco: Optional[Multibanco] naver_pay: Optional[NaverPay] nz_bank_account: Optional[NzBankAccount] @@ -2146,6 +2181,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2202,6 +2238,7 @@ class Zip(StripeObject): "link": Link, "mb_way": MbWay, "mobilepay": Mobilepay, + "momo": Momo, "multibanco": Multibanco, "naver_pay": NaverPay, "nz_bank_account": NzBankAccount, @@ -2223,6 +2260,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, @@ -2464,6 +2502,7 @@ async def report_payment_async( def _cls_report_payment_attempt( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptParams"], ) -> "PaymentRecord": """ @@ -2484,7 +2523,7 @@ def _cls_report_payment_attempt( @overload @staticmethod def report_payment_attempt( - id: str, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] + id: str, /, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] ) -> "PaymentRecord": """ Report a new payment attempt on the specified Payment Record. A new payment @@ -2503,7 +2542,7 @@ def report_payment_attempt( ... @class_method_variant("_cls_report_payment_attempt") - def report_payment_attempt( # pyright: ignore[reportGeneralTypeIssues] + def report_payment_attempt( self, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] ) -> "PaymentRecord": """ @@ -2525,6 +2564,7 @@ def report_payment_attempt( # pyright: ignore[reportGeneralTypeIssues] async def _cls_report_payment_attempt_async( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptParams"], ) -> "PaymentRecord": """ @@ -2545,7 +2585,7 @@ async def _cls_report_payment_attempt_async( @overload @staticmethod async def report_payment_attempt_async( - id: str, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] + id: str, /, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] ) -> "PaymentRecord": """ Report a new payment attempt on the specified Payment Record. A new payment @@ -2564,7 +2604,7 @@ async def report_payment_attempt_async( ... @class_method_variant("_cls_report_payment_attempt_async") - async def report_payment_attempt_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_payment_attempt_async( self, **params: Unpack["PaymentRecordReportPaymentAttemptParams"] ) -> "PaymentRecord": """ @@ -2586,6 +2626,7 @@ async def report_payment_attempt_async( # pyright: ignore[reportGeneralTypeIssu def _cls_report_payment_attempt_canceled( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": """ @@ -2607,6 +2648,7 @@ def _cls_report_payment_attempt_canceled( @staticmethod def report_payment_attempt_canceled( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": """ @@ -2627,7 +2669,7 @@ def report_payment_attempt_canceled( ... @class_method_variant("_cls_report_payment_attempt_canceled") - def report_payment_attempt_canceled( # pyright: ignore[reportGeneralTypeIssues] + def report_payment_attempt_canceled( self, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": @@ -2650,6 +2692,7 @@ def report_payment_attempt_canceled( # pyright: ignore[reportGeneralTypeIssues] async def _cls_report_payment_attempt_canceled_async( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": """ @@ -2671,6 +2714,7 @@ async def _cls_report_payment_attempt_canceled_async( @staticmethod async def report_payment_attempt_canceled_async( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": """ @@ -2691,7 +2735,7 @@ async def report_payment_attempt_canceled_async( ... @class_method_variant("_cls_report_payment_attempt_canceled_async") - async def report_payment_attempt_canceled_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_payment_attempt_canceled_async( self, **params: Unpack["PaymentRecordReportPaymentAttemptCanceledParams"], ) -> "PaymentRecord": @@ -2714,6 +2758,7 @@ async def report_payment_attempt_canceled_async( # pyright: ignore[reportGenera def _cls_report_payment_attempt_failed( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"], ) -> "PaymentRecord": """ @@ -2735,6 +2780,7 @@ def _cls_report_payment_attempt_failed( @staticmethod def report_payment_attempt_failed( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"], ) -> "PaymentRecord": """ @@ -2754,7 +2800,7 @@ def report_payment_attempt_failed( ... @class_method_variant("_cls_report_payment_attempt_failed") - def report_payment_attempt_failed( # pyright: ignore[reportGeneralTypeIssues] + def report_payment_attempt_failed( self, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"] ) -> "PaymentRecord": """ @@ -2776,6 +2822,7 @@ def report_payment_attempt_failed( # pyright: ignore[reportGeneralTypeIssues] async def _cls_report_payment_attempt_failed_async( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"], ) -> "PaymentRecord": """ @@ -2797,6 +2844,7 @@ async def _cls_report_payment_attempt_failed_async( @staticmethod async def report_payment_attempt_failed_async( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"], ) -> "PaymentRecord": """ @@ -2816,7 +2864,7 @@ async def report_payment_attempt_failed_async( ... @class_method_variant("_cls_report_payment_attempt_failed_async") - async def report_payment_attempt_failed_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_payment_attempt_failed_async( self, **params: Unpack["PaymentRecordReportPaymentAttemptFailedParams"] ) -> "PaymentRecord": """ @@ -2838,6 +2886,7 @@ async def report_payment_attempt_failed_async( # pyright: ignore[reportGeneralT def _cls_report_payment_attempt_guaranteed( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": """ @@ -2859,6 +2908,7 @@ def _cls_report_payment_attempt_guaranteed( @staticmethod def report_payment_attempt_guaranteed( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": """ @@ -2879,7 +2929,7 @@ def report_payment_attempt_guaranteed( ... @class_method_variant("_cls_report_payment_attempt_guaranteed") - def report_payment_attempt_guaranteed( # pyright: ignore[reportGeneralTypeIssues] + def report_payment_attempt_guaranteed( self, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": @@ -2902,6 +2952,7 @@ def report_payment_attempt_guaranteed( # pyright: ignore[reportGeneralTypeIssue async def _cls_report_payment_attempt_guaranteed_async( cls, id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": """ @@ -2923,6 +2974,7 @@ async def _cls_report_payment_attempt_guaranteed_async( @staticmethod async def report_payment_attempt_guaranteed_async( id: str, + /, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": """ @@ -2943,7 +2995,7 @@ async def report_payment_attempt_guaranteed_async( ... @class_method_variant("_cls_report_payment_attempt_guaranteed_async") - async def report_payment_attempt_guaranteed_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_payment_attempt_guaranteed_async( self, **params: Unpack["PaymentRecordReportPaymentAttemptGuaranteedParams"], ) -> "PaymentRecord": @@ -2966,6 +3018,7 @@ async def report_payment_attempt_guaranteed_async( # pyright: ignore[reportGene def _cls_report_payment_attempt_informational( cls, id: str, + /, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" ], @@ -2988,6 +3041,7 @@ def _cls_report_payment_attempt_informational( @staticmethod def report_payment_attempt_informational( id: str, + /, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" ], @@ -3010,7 +3064,7 @@ def report_payment_attempt_informational( ... @class_method_variant("_cls_report_payment_attempt_informational") - def report_payment_attempt_informational( # pyright: ignore[reportGeneralTypeIssues] + def report_payment_attempt_informational( self, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" @@ -3034,6 +3088,7 @@ def report_payment_attempt_informational( # pyright: ignore[reportGeneralTypeIs async def _cls_report_payment_attempt_informational_async( cls, id: str, + /, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" ], @@ -3056,6 +3111,7 @@ async def _cls_report_payment_attempt_informational_async( @staticmethod async def report_payment_attempt_informational_async( id: str, + /, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" ], @@ -3078,7 +3134,7 @@ async def report_payment_attempt_informational_async( ... @class_method_variant("_cls_report_payment_attempt_informational_async") - async def report_payment_attempt_informational_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_payment_attempt_informational_async( self, **params: Unpack[ "PaymentRecordReportPaymentAttemptInformationalParams" @@ -3100,7 +3156,7 @@ async def report_payment_attempt_informational_async( # pyright: ignore[reportG @classmethod def _cls_report_refund( - cls, id: str, **params: Unpack["PaymentRecordReportRefundParams"] + cls, id: str, /, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ Report that the most recent payment attempt on the specified Payment Record @@ -3120,7 +3176,7 @@ def _cls_report_refund( @overload @staticmethod def report_refund( - id: str, **params: Unpack["PaymentRecordReportRefundParams"] + id: str, /, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ Report that the most recent payment attempt on the specified Payment Record @@ -3139,7 +3195,7 @@ def report_refund( ... @class_method_variant("_cls_report_refund") - def report_refund( # pyright: ignore[reportGeneralTypeIssues] + def report_refund( self, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ @@ -3159,7 +3215,7 @@ def report_refund( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_report_refund_async( - cls, id: str, **params: Unpack["PaymentRecordReportRefundParams"] + cls, id: str, /, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ Report that the most recent payment attempt on the specified Payment Record @@ -3179,7 +3235,7 @@ async def _cls_report_refund_async( @overload @staticmethod async def report_refund_async( - id: str, **params: Unpack["PaymentRecordReportRefundParams"] + id: str, /, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ Report that the most recent payment attempt on the specified Payment Record @@ -3198,7 +3254,7 @@ async def report_refund_async( ... @class_method_variant("_cls_report_refund_async") - async def report_refund_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_refund_async( self, **params: Unpack["PaymentRecordReportRefundParams"] ) -> "PaymentRecord": """ diff --git a/stripe/_payment_record_service.py b/stripe/_payment_record_service.py index 1601d6973..b10a83482 100644 --- a/stripe/_payment_record_service.py +++ b/stripe/_payment_record_service.py @@ -80,6 +80,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["PaymentRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -100,6 +101,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["PaymentRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -120,6 +122,7 @@ async def retrieve_async( def report_payment_attempt( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -143,6 +146,7 @@ def report_payment_attempt( async def report_payment_attempt_async( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -166,6 +170,7 @@ async def report_payment_attempt_async( def report_payment_attempt_canceled( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptCanceledParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -189,6 +194,7 @@ def report_payment_attempt_canceled( async def report_payment_attempt_canceled_async( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptCanceledParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -212,6 +218,7 @@ async def report_payment_attempt_canceled_async( def report_payment_attempt_failed( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptFailedParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -235,6 +242,7 @@ def report_payment_attempt_failed( async def report_payment_attempt_failed_async( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptFailedParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -258,6 +266,7 @@ async def report_payment_attempt_failed_async( def report_payment_attempt_guaranteed( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptGuaranteedParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -281,6 +290,7 @@ def report_payment_attempt_guaranteed( async def report_payment_attempt_guaranteed_async( self, id: str, + /, params: "PaymentRecordReportPaymentAttemptGuaranteedParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -304,6 +314,7 @@ async def report_payment_attempt_guaranteed_async( def report_payment_attempt_informational( self, id: str, + /, params: Optional[ "PaymentRecordReportPaymentAttemptInformationalParams" ] = None, @@ -328,6 +339,7 @@ def report_payment_attempt_informational( async def report_payment_attempt_informational_async( self, id: str, + /, params: Optional[ "PaymentRecordReportPaymentAttemptInformationalParams" ] = None, @@ -352,6 +364,7 @@ async def report_payment_attempt_informational_async( def report_refund( self, id: str, + /, params: "PaymentRecordReportRefundParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": @@ -375,6 +388,7 @@ def report_refund( async def report_refund_async( self, id: str, + /, params: "PaymentRecordReportRefundParams", options: Optional["RequestOptions"] = None, ) -> "PaymentRecord": diff --git a/stripe/_payout.py b/stripe/_payout.py index 1d40fbb53..8257fde2c 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -166,7 +166,7 @@ class TraceId(StripeObject): @classmethod def _cls_cancel( - cls, payout: str, **params: Unpack["PayoutCancelParams"] + cls, payout: str, /, **params: Unpack["PayoutCancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -185,7 +185,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - payout: str, **params: Unpack["PayoutCancelParams"] + payout: str, /, **params: Unpack["PayoutCancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -200,9 +200,7 @@ def cancel(self, **params: Unpack["PayoutCancelParams"]) -> "Payout": ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["PayoutCancelParams"] - ) -> "Payout": + def cancel(self, **params: Unpack["PayoutCancelParams"]) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ @@ -219,7 +217,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, payout: str, **params: Unpack["PayoutCancelParams"] + cls, payout: str, /, **params: Unpack["PayoutCancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -238,7 +236,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - payout: str, **params: Unpack["PayoutCancelParams"] + payout: str, /, **params: Unpack["PayoutCancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -255,7 +253,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["PayoutCancelParams"] ) -> "Payout": """ @@ -352,7 +350,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PayoutModifyParams"] + cls, id: str, /, **params: Unpack["PayoutModifyParams"] ) -> "Payout": """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. @@ -369,7 +367,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PayoutModifyParams"] + cls, id: str, /, **params: Unpack["PayoutModifyParams"] ) -> "Payout": """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. @@ -408,7 +406,7 @@ async def retrieve_async( @classmethod def _cls_reverse( - cls, payout: str, **params: Unpack["PayoutReverseParams"] + cls, payout: str, /, **params: Unpack["PayoutReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. @@ -429,7 +427,7 @@ def _cls_reverse( @overload @staticmethod def reverse( - payout: str, **params: Unpack["PayoutReverseParams"] + payout: str, /, **params: Unpack["PayoutReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. @@ -448,9 +446,7 @@ def reverse(self, **params: Unpack["PayoutReverseParams"]) -> "Payout": ... @class_method_variant("_cls_reverse") - def reverse( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["PayoutReverseParams"] - ) -> "Payout": + def reverse(self, **params: Unpack["PayoutReverseParams"]) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. @@ -469,7 +465,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_reverse_async( - cls, payout: str, **params: Unpack["PayoutReverseParams"] + cls, payout: str, /, **params: Unpack["PayoutReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. @@ -490,7 +486,7 @@ async def _cls_reverse_async( @overload @staticmethod async def reverse_async( - payout: str, **params: Unpack["PayoutReverseParams"] + payout: str, /, **params: Unpack["PayoutReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. @@ -511,7 +507,7 @@ async def reverse_async( ... @class_method_variant("_cls_reverse_async") - async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] + async def reverse_async( self, **params: Unpack["PayoutReverseParams"] ) -> "Payout": """ diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index 14920cc3a..b19b07983 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -105,6 +105,7 @@ async def create_async( def retrieve( self, payout: str, + /, params: Optional["PayoutRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, payout: str, + /, params: Optional["PayoutRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -145,6 +147,7 @@ async def retrieve_async( def update( self, payout: str, + /, params: Optional["PayoutUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -165,6 +168,7 @@ def update( async def update_async( self, payout: str, + /, params: Optional["PayoutUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -185,6 +189,7 @@ async def update_async( def cancel( self, payout: str, + /, params: Optional["PayoutCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -207,6 +212,7 @@ def cancel( async def cancel_async( self, payout: str, + /, params: Optional["PayoutCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -229,6 +235,7 @@ async def cancel_async( def reverse( self, payout: str, + /, params: Optional["PayoutReverseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": @@ -253,6 +260,7 @@ def reverse( async def reverse_async( self, payout: str, + /, params: Optional["PayoutReverseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Payout": diff --git a/stripe/_person.py b/stripe/_person.py index af69caaf4..d4ad8dcde 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -160,8 +160,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -370,8 +372,10 @@ class Error(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -593,7 +597,7 @@ class Verification(StripeObject): class AdditionalDocument(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ @@ -605,13 +609,13 @@ class AdditionalDocument(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ @@ -623,7 +627,7 @@ class Document(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ additional_document: Optional[AdditionalDocument] diff --git a/stripe/_plan.py b/stripe/_plan.py index e365c3c7f..1c1161d85 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -28,10 +28,10 @@ class Plan( UpdateableAPIResource["Plan"], ): """ - You can now model subscriptions more flexibly using the [Prices API](https://api.stripe.com#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + You can now model subscriptions more flexibly using the [Prices API](https://docs.stripe.com/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. Plans define the base price, currency, and billing cycle for recurring purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. @@ -193,7 +193,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["PlanDeleteParams"] + cls, sid: str, /, **params: Unpack["PlanDeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. @@ -210,7 +210,7 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["PlanDeleteParams"]) -> "Plan": + def delete(sid: str, /, **params: Unpack["PlanDeleteParams"]) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ @@ -224,9 +224,7 @@ def delete(self, **params: Unpack["PlanDeleteParams"]) -> "Plan": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["PlanDeleteParams"] - ) -> "Plan": + def delete(self, **params: Unpack["PlanDeleteParams"]) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ @@ -238,7 +236,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["PlanDeleteParams"] + cls, sid: str, /, **params: Unpack["PlanDeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. @@ -256,7 +254,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["PlanDeleteParams"] + sid: str, /, **params: Unpack["PlanDeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. @@ -273,7 +271,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["PlanDeleteParams"] ) -> "Plan": """ @@ -324,7 +322,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["PlanModifyParams"]) -> "Plan": + def modify( + cls, id: str, /, **params: Unpack["PlanModifyParams"] + ) -> "Plan": """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ @@ -340,7 +340,7 @@ def modify(cls, id: str, **params: Unpack["PlanModifyParams"]) -> "Plan": @classmethod async def modify_async( - cls, id: str, **params: Unpack["PlanModifyParams"] + cls, id: str, /, **params: Unpack["PlanModifyParams"] ) -> "Plan": """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. diff --git a/stripe/_plan_service.py b/stripe/_plan_service.py index 8bbdf7304..b2bcd53a8 100644 --- a/stripe/_plan_service.py +++ b/stripe/_plan_service.py @@ -20,6 +20,7 @@ class PlanService(StripeService): def delete( self, plan: str, + /, params: Optional["PlanDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -40,6 +41,7 @@ def delete( async def delete_async( self, plan: str, + /, params: Optional["PlanDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -60,6 +62,7 @@ async def delete_async( def retrieve( self, plan: str, + /, params: Optional["PlanRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -80,6 +83,7 @@ def retrieve( async def retrieve_async( self, plan: str, + /, params: Optional["PlanRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -100,6 +104,7 @@ async def retrieve_async( def update( self, plan: str, + /, params: Optional["PlanUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -120,6 +125,7 @@ def update( async def update_async( self, plan: str, + /, params: Optional["PlanUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": diff --git a/stripe/_price.py b/stripe/_price.py index 00e323558..62fc69e2c 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -38,7 +38,7 @@ class Price( ): """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. @@ -366,7 +366,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["PriceModifyParams"]) -> "Price": + def modify( + cls, id: str, /, **params: Unpack["PriceModifyParams"] + ) -> "Price": """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ @@ -382,7 +384,7 @@ def modify(cls, id: str, **params: Unpack["PriceModifyParams"]) -> "Price": @classmethod async def modify_async( - cls, id: str, **params: Unpack["PriceModifyParams"] + cls, id: str, /, **params: Unpack["PriceModifyParams"] ) -> "Price": """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. diff --git a/stripe/_price_service.py b/stripe/_price_service.py index 5207dda39..1360c49d6 100644 --- a/stripe/_price_service.py +++ b/stripe/_price_service.py @@ -97,6 +97,7 @@ async def create_async( def retrieve( self, price: str, + /, params: Optional["PriceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Price": @@ -117,6 +118,7 @@ def retrieve( async def retrieve_async( self, price: str, + /, params: Optional["PriceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Price": @@ -137,6 +139,7 @@ async def retrieve_async( def update( self, price: str, + /, params: Optional["PriceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Price": @@ -157,6 +160,7 @@ def update( async def update_async( self, price: str, + /, params: Optional["PriceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Price": diff --git a/stripe/_product.py b/stripe/_product.py index 421f692b3..a0c923b6e 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -58,7 +58,7 @@ class Product( """ Products describe the specific goods or services you offer to your customers. For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. - They can be used in conjunction with [Prices](https://api.stripe.com#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. + They can be used in conjunction with [Prices](https://docs.stripe.com/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. Related guides: [Set up a subscription](https://docs.stripe.com/billing/subscriptions/set-up-subscription), [share a Payment Link](https://docs.stripe.com/payment-links), @@ -95,7 +95,7 @@ class PackageDimensions(StripeObject): class TaxDetails(StripeObject): performance_location: Optional[str] """ - The performance location. + The ID of a tax location with type `performance`, representing where the performance takes place. """ tax_code: Optional[str] """ @@ -219,7 +219,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ProductDeleteParams"] + cls, sid: str, /, **params: Unpack["ProductDeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. @@ -236,7 +236,9 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["ProductDeleteParams"]) -> "Product": + def delete( + sid: str, /, **params: Unpack["ProductDeleteParams"] + ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ @@ -250,9 +252,7 @@ def delete(self, **params: Unpack["ProductDeleteParams"]) -> "Product": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["ProductDeleteParams"] - ) -> "Product": + def delete(self, **params: Unpack["ProductDeleteParams"]) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ @@ -264,7 +264,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ProductDeleteParams"] + cls, sid: str, /, **params: Unpack["ProductDeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. @@ -282,7 +282,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ProductDeleteParams"] + sid: str, /, **params: Unpack["ProductDeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. @@ -299,7 +299,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ProductDeleteParams"] ) -> "Product": """ @@ -353,7 +353,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ProductModifyParams"] + cls, id: str, /, **params: Unpack["ProductModifyParams"] ) -> "Product": """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -370,7 +370,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ProductModifyParams"] + cls, id: str, /, **params: Unpack["ProductModifyParams"] ) -> "Product": """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -450,6 +450,7 @@ def delete_feature( cls, product: str, id: str, + /, **params: Unpack["ProductDeleteFeatureParams"], ) -> "ProductFeature": """ @@ -471,6 +472,7 @@ async def delete_feature_async( cls, product: str, id: str, + /, **params: Unpack["ProductDeleteFeatureParams"], ) -> "ProductFeature": """ @@ -492,6 +494,7 @@ def retrieve_feature( cls, product: str, id: str, + /, **params: Unpack["ProductRetrieveFeatureParams"], ) -> "ProductFeature": """ @@ -513,6 +516,7 @@ async def retrieve_feature_async( cls, product: str, id: str, + /, **params: Unpack["ProductRetrieveFeatureParams"], ) -> "ProductFeature": """ @@ -531,7 +535,7 @@ async def retrieve_feature_async( @classmethod def list_features( - cls, product: str, **params: Unpack["ProductListFeaturesParams"] + cls, product: str, /, **params: Unpack["ProductListFeaturesParams"] ) -> ListObject["ProductFeature"]: """ Retrieve a list of features for a product @@ -549,7 +553,7 @@ def list_features( @classmethod async def list_features_async( - cls, product: str, **params: Unpack["ProductListFeaturesParams"] + cls, product: str, /, **params: Unpack["ProductListFeaturesParams"] ) -> ListObject["ProductFeature"]: """ Retrieve a list of features for a product @@ -567,7 +571,7 @@ async def list_features_async( @classmethod def create_feature( - cls, product: str, **params: Unpack["ProductCreateFeatureParams"] + cls, product: str, /, **params: Unpack["ProductCreateFeatureParams"] ) -> "ProductFeature": """ Creates a product_feature, which represents a feature attachment to a product @@ -585,7 +589,7 @@ def create_feature( @classmethod async def create_feature_async( - cls, product: str, **params: Unpack["ProductCreateFeatureParams"] + cls, product: str, /, **params: Unpack["ProductCreateFeatureParams"] ) -> "ProductFeature": """ Creates a product_feature, which represents a feature attachment to a product diff --git a/stripe/_product_feature_service.py b/stripe/_product_feature_service.py index 3eeba56fe..b53c375ec 100644 --- a/stripe/_product_feature_service.py +++ b/stripe/_product_feature_service.py @@ -28,6 +28,7 @@ def delete( self, product: str, id: str, + /, params: Optional["ProductFeatureDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductFeature": @@ -52,6 +53,7 @@ async def delete_async( self, product: str, id: str, + /, params: Optional["ProductFeatureDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductFeature": @@ -76,6 +78,7 @@ def retrieve( self, product: str, id: str, + /, params: Optional["ProductFeatureRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductFeature": @@ -100,6 +103,7 @@ async def retrieve_async( self, product: str, id: str, + /, params: Optional["ProductFeatureRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductFeature": @@ -123,6 +127,7 @@ async def retrieve_async( def list( self, product: str, + /, params: Optional["ProductFeatureListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[ProductFeature]": @@ -145,6 +150,7 @@ def list( async def list_async( self, product: str, + /, params: Optional["ProductFeatureListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[ProductFeature]": @@ -167,6 +173,7 @@ async def list_async( def create( self, product: str, + /, params: "ProductFeatureCreateParams", options: Optional["RequestOptions"] = None, ) -> "ProductFeature": @@ -189,6 +196,7 @@ def create( async def create_async( self, product: str, + /, params: "ProductFeatureCreateParams", options: Optional["RequestOptions"] = None, ) -> "ProductFeature": diff --git a/stripe/_product_service.py b/stripe/_product_service.py index c5eebca34..d042c2209 100644 --- a/stripe/_product_service.py +++ b/stripe/_product_service.py @@ -49,6 +49,7 @@ def __getattr__(self, name): def delete( self, id: str, + /, params: Optional["ProductDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -69,6 +70,7 @@ def delete( async def delete_async( self, id: str, + /, params: Optional["ProductDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -89,6 +91,7 @@ async def delete_async( def retrieve( self, id: str, + /, params: Optional["ProductRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -109,6 +112,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ProductRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -129,6 +133,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["ProductUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -149,6 +154,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["ProductUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 6b1e57dfc..8f9a7d28f 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -203,7 +203,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PromotionCodeModifyParams"] + cls, id: str, /, **params: Unpack["PromotionCodeModifyParams"] ) -> "PromotionCode": """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. @@ -220,7 +220,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PromotionCodeModifyParams"] + cls, id: str, /, **params: Unpack["PromotionCodeModifyParams"] ) -> "PromotionCode": """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. diff --git a/stripe/_promotion_code_service.py b/stripe/_promotion_code_service.py index cc7cb920d..8ffc29c3f 100644 --- a/stripe/_promotion_code_service.py +++ b/stripe/_promotion_code_service.py @@ -106,6 +106,7 @@ async def create_async( def retrieve( self, promotion_code: str, + /, params: Optional["PromotionCodeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PromotionCode": @@ -128,6 +129,7 @@ def retrieve( async def retrieve_async( self, promotion_code: str, + /, params: Optional["PromotionCodeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PromotionCode": @@ -150,6 +152,7 @@ async def retrieve_async( def update( self, promotion_code: str, + /, params: Optional["PromotionCodeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PromotionCode": @@ -172,6 +175,7 @@ def update( async def update_async( self, promotion_code: str, + /, params: Optional["PromotionCodeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PromotionCode": @@ -216,6 +220,7 @@ def serialize_batch_create( def serialize_batch_update( self, promotion_code: str, + /, params: Optional["PromotionCodeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: diff --git a/stripe/_quote.py b/stripe/_quote.py index 9ee516f7c..30640658b 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -146,7 +146,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -247,7 +247,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -906,7 +906,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -1148,7 +1148,7 @@ class TransferData(StripeObject): @classmethod def _cls_accept( - cls, quote: str, **params: Unpack["QuoteAcceptParams"] + cls, quote: str, /, **params: Unpack["QuoteAcceptParams"] ) -> "Quote": """ Accepts the specified quote. @@ -1164,7 +1164,9 @@ def _cls_accept( @overload @staticmethod - def accept(quote: str, **params: Unpack["QuoteAcceptParams"]) -> "Quote": + def accept( + quote: str, /, **params: Unpack["QuoteAcceptParams"] + ) -> "Quote": """ Accepts the specified quote. """ @@ -1178,9 +1180,7 @@ def accept(self, **params: Unpack["QuoteAcceptParams"]) -> "Quote": ... @class_method_variant("_cls_accept") - def accept( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuoteAcceptParams"] - ) -> "Quote": + def accept(self, **params: Unpack["QuoteAcceptParams"]) -> "Quote": """ Accepts the specified quote. """ @@ -1197,7 +1197,7 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_accept_async( - cls, quote: str, **params: Unpack["QuoteAcceptParams"] + cls, quote: str, /, **params: Unpack["QuoteAcceptParams"] ) -> "Quote": """ Accepts the specified quote. @@ -1214,7 +1214,7 @@ async def _cls_accept_async( @overload @staticmethod async def accept_async( - quote: str, **params: Unpack["QuoteAcceptParams"] + quote: str, /, **params: Unpack["QuoteAcceptParams"] ) -> "Quote": """ Accepts the specified quote. @@ -1231,7 +1231,7 @@ async def accept_async( ... @class_method_variant("_cls_accept_async") - async def accept_async( # pyright: ignore[reportGeneralTypeIssues] + async def accept_async( self, **params: Unpack["QuoteAcceptParams"] ) -> "Quote": """ @@ -1250,7 +1250,7 @@ async def accept_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_cancel( - cls, quote: str, **params: Unpack["QuoteCancelParams"] + cls, quote: str, /, **params: Unpack["QuoteCancelParams"] ) -> "Quote": """ Cancels the quote. @@ -1266,7 +1266,9 @@ def _cls_cancel( @overload @staticmethod - def cancel(quote: str, **params: Unpack["QuoteCancelParams"]) -> "Quote": + def cancel( + quote: str, /, **params: Unpack["QuoteCancelParams"] + ) -> "Quote": """ Cancels the quote. """ @@ -1280,9 +1282,7 @@ def cancel(self, **params: Unpack["QuoteCancelParams"]) -> "Quote": ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuoteCancelParams"] - ) -> "Quote": + def cancel(self, **params: Unpack["QuoteCancelParams"]) -> "Quote": """ Cancels the quote. """ @@ -1299,7 +1299,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, quote: str, **params: Unpack["QuoteCancelParams"] + cls, quote: str, /, **params: Unpack["QuoteCancelParams"] ) -> "Quote": """ Cancels the quote. @@ -1316,7 +1316,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - quote: str, **params: Unpack["QuoteCancelParams"] + quote: str, /, **params: Unpack["QuoteCancelParams"] ) -> "Quote": """ Cancels the quote. @@ -1333,7 +1333,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["QuoteCancelParams"] ) -> "Quote": """ @@ -1382,7 +1382,7 @@ async def create_async( @classmethod def _cls_finalize_quote( - cls, quote: str, **params: Unpack["QuoteFinalizeQuoteParams"] + cls, quote: str, /, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1399,7 +1399,7 @@ def _cls_finalize_quote( @overload @staticmethod def finalize_quote( - quote: str, **params: Unpack["QuoteFinalizeQuoteParams"] + quote: str, /, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1416,7 +1416,7 @@ def finalize_quote( ... @class_method_variant("_cls_finalize_quote") - def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] + def finalize_quote( self, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ @@ -1435,7 +1435,7 @@ def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_finalize_quote_async( - cls, quote: str, **params: Unpack["QuoteFinalizeQuoteParams"] + cls, quote: str, /, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1452,7 +1452,7 @@ async def _cls_finalize_quote_async( @overload @staticmethod async def finalize_quote_async( - quote: str, **params: Unpack["QuoteFinalizeQuoteParams"] + quote: str, /, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1469,7 +1469,7 @@ async def finalize_quote_async( ... @class_method_variant("_cls_finalize_quote_async") - async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] + async def finalize_quote_async( self, **params: Unpack["QuoteFinalizeQuoteParams"] ) -> "Quote": """ @@ -1528,6 +1528,7 @@ async def list_async( def _cls_list_computed_upfront_line_items( cls, quote: str, + /, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ @@ -1547,7 +1548,9 @@ def _cls_list_computed_upfront_line_items( @overload @staticmethod def list_computed_upfront_line_items( - quote: str, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"] + quote: str, + /, + **params: Unpack["QuoteListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1564,7 +1567,7 @@ def list_computed_upfront_line_items( ... @class_method_variant("_cls_list_computed_upfront_line_items") - def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_computed_upfront_line_items( self, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1585,6 +1588,7 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues async def _cls_list_computed_upfront_line_items_async( cls, quote: str, + /, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ @@ -1604,7 +1608,9 @@ async def _cls_list_computed_upfront_line_items_async( @overload @staticmethod async def list_computed_upfront_line_items_async( - quote: str, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"] + quote: str, + /, + **params: Unpack["QuoteListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1621,7 +1627,7 @@ async def list_computed_upfront_line_items_async( ... @class_method_variant("_cls_list_computed_upfront_line_items_async") - async def list_computed_upfront_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_computed_upfront_line_items_async( self, **params: Unpack["QuoteListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1640,7 +1646,7 @@ async def list_computed_upfront_line_items_async( # pyright: ignore[reportGener @classmethod def _cls_list_line_items( - cls, quote: str, **params: Unpack["QuoteListLineItemsParams"] + cls, quote: str, /, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1659,7 +1665,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - quote: str, **params: Unpack["QuoteListLineItemsParams"] + quote: str, /, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1676,7 +1682,7 @@ def list_line_items( ... @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_line_items( self, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1695,7 +1701,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_list_line_items_async( - cls, quote: str, **params: Unpack["QuoteListLineItemsParams"] + cls, quote: str, /, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1714,7 +1720,7 @@ async def _cls_list_line_items_async( @overload @staticmethod async def list_line_items_async( - quote: str, **params: Unpack["QuoteListLineItemsParams"] + quote: str, /, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1731,7 +1737,7 @@ async def list_line_items_async( ... @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_line_items_async( self, **params: Unpack["QuoteListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1750,7 +1756,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_list_lines( - cls, quote: str, **params: Unpack["QuoteListLinesParams"] + cls, quote: str, /, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. @@ -1767,7 +1773,7 @@ def _cls_list_lines( @overload @staticmethod def list_lines( - quote: str, **params: Unpack["QuoteListLinesParams"] + quote: str, /, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. @@ -1784,7 +1790,7 @@ def list_lines( ... @class_method_variant("_cls_list_lines") - def list_lines( # pyright: ignore[reportGeneralTypeIssues] + def list_lines( self, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ @@ -1803,7 +1809,7 @@ def list_lines( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_list_lines_async( - cls, quote: str, **params: Unpack["QuoteListLinesParams"] + cls, quote: str, /, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. @@ -1820,7 +1826,7 @@ async def _cls_list_lines_async( @overload @staticmethod async def list_lines_async( - quote: str, **params: Unpack["QuoteListLinesParams"] + quote: str, /, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. @@ -1837,7 +1843,7 @@ async def list_lines_async( ... @class_method_variant("_cls_list_lines_async") - async def list_lines_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_lines_async( self, **params: Unpack["QuoteListLinesParams"] ) -> ListObject["QuoteLine"]: """ @@ -1859,6 +1865,7 @@ def _cls_list_preview_invoice_lines( cls, quote: str, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1881,6 +1888,7 @@ def _cls_list_preview_invoice_lines( def list_preview_invoice_lines( quote: str, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1892,6 +1900,7 @@ def list_preview_invoice_lines( def list_preview_invoice_lines( self, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1900,9 +1909,10 @@ def list_preview_invoice_lines( ... @class_method_variant("_cls_list_preview_invoice_lines") - def list_preview_invoice_lines( # pyright: ignore[reportGeneralTypeIssues] + def list_preview_invoice_lines( self, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1925,6 +1935,7 @@ async def _cls_list_preview_invoice_lines_async( cls, quote: str, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1947,6 +1958,7 @@ async def _cls_list_preview_invoice_lines_async( async def list_preview_invoice_lines_async( quote: str, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1958,6 +1970,7 @@ async def list_preview_invoice_lines_async( async def list_preview_invoice_lines_async( self, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1966,9 +1979,10 @@ async def list_preview_invoice_lines_async( ... @class_method_variant("_cls_list_preview_invoice_lines_async") - async def list_preview_invoice_lines_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_preview_invoice_lines_async( self, preview_invoice: str, + /, **params: Unpack["QuoteListPreviewInvoiceLinesParams"], ) -> ListObject["InvoiceLineItem"]: """ @@ -1988,7 +2002,7 @@ async def list_preview_invoice_lines_async( # pyright: ignore[reportGeneralType @classmethod def _cls_mark_draft( - cls, quote: str, **params: Unpack["QuoteMarkDraftParams"] + cls, quote: str, /, **params: Unpack["QuoteMarkDraftParams"] ) -> "Quote": """ Converts a stale quote to draft. @@ -2007,7 +2021,7 @@ def _cls_mark_draft( @overload @staticmethod def mark_draft( - quote: str, **params: Unpack["QuoteMarkDraftParams"] + quote: str, /, **params: Unpack["QuoteMarkDraftParams"] ) -> "Quote": """ Converts a stale quote to draft. @@ -2022,9 +2036,7 @@ def mark_draft(self, **params: Unpack["QuoteMarkDraftParams"]) -> "Quote": ... @class_method_variant("_cls_mark_draft") - def mark_draft( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuoteMarkDraftParams"] - ) -> "Quote": + def mark_draft(self, **params: Unpack["QuoteMarkDraftParams"]) -> "Quote": """ Converts a stale quote to draft. """ @@ -2041,7 +2053,7 @@ def mark_draft( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_mark_draft_async( - cls, quote: str, **params: Unpack["QuoteMarkDraftParams"] + cls, quote: str, /, **params: Unpack["QuoteMarkDraftParams"] ) -> "Quote": """ Converts a stale quote to draft. @@ -2060,7 +2072,7 @@ async def _cls_mark_draft_async( @overload @staticmethod async def mark_draft_async( - quote: str, **params: Unpack["QuoteMarkDraftParams"] + quote: str, /, **params: Unpack["QuoteMarkDraftParams"] ) -> "Quote": """ Converts a stale quote to draft. @@ -2077,7 +2089,7 @@ async def mark_draft_async( ... @class_method_variant("_cls_mark_draft_async") - async def mark_draft_async( # pyright: ignore[reportGeneralTypeIssues] + async def mark_draft_async( self, **params: Unpack["QuoteMarkDraftParams"] ) -> "Quote": """ @@ -2096,7 +2108,7 @@ async def mark_draft_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_mark_stale( - cls, quote: str, **params: Unpack["QuoteMarkStaleParams"] + cls, quote: str, /, **params: Unpack["QuoteMarkStaleParams"] ) -> "Quote": """ Converts a draft or open quote to stale. @@ -2115,7 +2127,7 @@ def _cls_mark_stale( @overload @staticmethod def mark_stale( - quote: str, **params: Unpack["QuoteMarkStaleParams"] + quote: str, /, **params: Unpack["QuoteMarkStaleParams"] ) -> "Quote": """ Converts a draft or open quote to stale. @@ -2130,9 +2142,7 @@ def mark_stale(self, **params: Unpack["QuoteMarkStaleParams"]) -> "Quote": ... @class_method_variant("_cls_mark_stale") - def mark_stale( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuoteMarkStaleParams"] - ) -> "Quote": + def mark_stale(self, **params: Unpack["QuoteMarkStaleParams"]) -> "Quote": """ Converts a draft or open quote to stale. """ @@ -2149,7 +2159,7 @@ def mark_stale( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_mark_stale_async( - cls, quote: str, **params: Unpack["QuoteMarkStaleParams"] + cls, quote: str, /, **params: Unpack["QuoteMarkStaleParams"] ) -> "Quote": """ Converts a draft or open quote to stale. @@ -2168,7 +2178,7 @@ async def _cls_mark_stale_async( @overload @staticmethod async def mark_stale_async( - quote: str, **params: Unpack["QuoteMarkStaleParams"] + quote: str, /, **params: Unpack["QuoteMarkStaleParams"] ) -> "Quote": """ Converts a draft or open quote to stale. @@ -2185,7 +2195,7 @@ async def mark_stale_async( ... @class_method_variant("_cls_mark_stale_async") - async def mark_stale_async( # pyright: ignore[reportGeneralTypeIssues] + async def mark_stale_async( self, **params: Unpack["QuoteMarkStaleParams"] ) -> "Quote": """ @@ -2203,7 +2213,9 @@ async def mark_stale_async( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - def modify(cls, id: str, **params: Unpack["QuoteModifyParams"]) -> "Quote": + def modify( + cls, id: str, /, **params: Unpack["QuoteModifyParams"] + ) -> "Quote": """ A quote models prices and services for a customer. """ @@ -2219,7 +2231,7 @@ def modify(cls, id: str, **params: Unpack["QuoteModifyParams"]) -> "Quote": @classmethod async def modify_async( - cls, id: str, **params: Unpack["QuoteModifyParams"] + cls, id: str, /, **params: Unpack["QuoteModifyParams"] ) -> "Quote": """ A quote models prices and services for a customer. @@ -2235,7 +2247,9 @@ async def modify_async( ) @classmethod - def _cls_pdf(cls, quote: str, **params: Unpack["QuotePdfParams"]) -> Any: + def _cls_pdf( + cls, quote: str, /, **params: Unpack["QuotePdfParams"] + ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ @@ -2251,7 +2265,7 @@ def _cls_pdf(cls, quote: str, **params: Unpack["QuotePdfParams"]) -> Any: @overload @staticmethod - def pdf(quote: str, **params: Unpack["QuotePdfParams"]) -> Any: + def pdf(quote: str, /, **params: Unpack["QuotePdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ @@ -2265,9 +2279,7 @@ def pdf(self, **params: Unpack["QuotePdfParams"]) -> Any: ... @class_method_variant("_cls_pdf") - def pdf( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuotePdfParams"] - ) -> Any: + def pdf(self, **params: Unpack["QuotePdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ @@ -2285,7 +2297,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_pdf_async( - cls, quote: str, **params: Unpack["QuotePdfParams"] + cls, quote: str, /, **params: Unpack["QuotePdfParams"] ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) @@ -2302,7 +2314,9 @@ async def _cls_pdf_async( @overload @staticmethod - async def pdf_async(quote: str, **params: Unpack["QuotePdfParams"]) -> Any: + async def pdf_async( + quote: str, /, **params: Unpack["QuotePdfParams"] + ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ @@ -2316,9 +2330,7 @@ async def pdf_async(self, **params: Unpack["QuotePdfParams"]) -> Any: ... @class_method_variant("_cls_pdf_async") - async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuotePdfParams"] - ) -> Any: + async def pdf_async(self, **params: Unpack["QuotePdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.stripe.com/quotes/overview#quote_pdf) """ @@ -2336,7 +2348,7 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_reestimate( - cls, quote: str, **params: Unpack["QuoteReestimateParams"] + cls, quote: str, /, **params: Unpack["QuoteReestimateParams"] ) -> "Quote": """ Recompute the upcoming invoice estimate for the quote. @@ -2355,7 +2367,7 @@ def _cls_reestimate( @overload @staticmethod def reestimate( - quote: str, **params: Unpack["QuoteReestimateParams"] + quote: str, /, **params: Unpack["QuoteReestimateParams"] ) -> "Quote": """ Recompute the upcoming invoice estimate for the quote. @@ -2370,9 +2382,7 @@ def reestimate(self, **params: Unpack["QuoteReestimateParams"]) -> "Quote": ... @class_method_variant("_cls_reestimate") - def reestimate( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["QuoteReestimateParams"] - ) -> "Quote": + def reestimate(self, **params: Unpack["QuoteReestimateParams"]) -> "Quote": """ Recompute the upcoming invoice estimate for the quote. """ @@ -2389,7 +2399,7 @@ def reestimate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_reestimate_async( - cls, quote: str, **params: Unpack["QuoteReestimateParams"] + cls, quote: str, /, **params: Unpack["QuoteReestimateParams"] ) -> "Quote": """ Recompute the upcoming invoice estimate for the quote. @@ -2408,7 +2418,7 @@ async def _cls_reestimate_async( @overload @staticmethod async def reestimate_async( - quote: str, **params: Unpack["QuoteReestimateParams"] + quote: str, /, **params: Unpack["QuoteReestimateParams"] ) -> "Quote": """ Recompute the upcoming invoice estimate for the quote. @@ -2425,7 +2435,7 @@ async def reestimate_async( ... @class_method_variant("_cls_reestimate_async") - async def reestimate_async( # pyright: ignore[reportGeneralTypeIssues] + async def reestimate_async( self, **params: Unpack["QuoteReestimateParams"] ) -> "Quote": """ @@ -2466,7 +2476,7 @@ async def retrieve_async( @classmethod def list_preview_invoices( - cls, quote: str, **params: Unpack["QuoteListPreviewInvoicesParams"] + cls, quote: str, /, **params: Unpack["QuoteListPreviewInvoicesParams"] ) -> ListObject["QuotePreviewInvoice"]: """ Preview the invoices that would be generated by accepting the quote. @@ -2484,7 +2494,7 @@ def list_preview_invoices( @classmethod async def list_preview_invoices_async( - cls, quote: str, **params: Unpack["QuoteListPreviewInvoicesParams"] + cls, quote: str, /, **params: Unpack["QuoteListPreviewInvoicesParams"] ) -> ListObject["QuotePreviewInvoice"]: """ Preview the invoices that would be generated by accepting the quote. @@ -2504,6 +2514,7 @@ async def list_preview_invoices_async( def list_preview_subscription_schedules( cls, quote: str, + /, **params: Unpack["QuoteListPreviewSubscriptionSchedulesParams"], ) -> ListObject["QuotePreviewSubscriptionSchedule"]: """ @@ -2524,6 +2535,7 @@ def list_preview_subscription_schedules( async def list_preview_subscription_schedules_async( cls, quote: str, + /, **params: Unpack["QuoteListPreviewSubscriptionSchedulesParams"], ) -> ListObject["QuotePreviewSubscriptionSchedule"]: """ diff --git a/stripe/_quote_computed_upfront_line_items_service.py b/stripe/_quote_computed_upfront_line_items_service.py index a9f5cf4d2..680bfb164 100644 --- a/stripe/_quote_computed_upfront_line_items_service.py +++ b/stripe/_quote_computed_upfront_line_items_service.py @@ -18,6 +18,7 @@ class QuoteComputedUpfrontLineItemsService(StripeService): def list( self, quote: str, + /, params: Optional["QuoteComputedUpfrontLineItemsListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, quote: str, + /, params: Optional["QuoteComputedUpfrontLineItemsListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": diff --git a/stripe/_quote_line_item_service.py b/stripe/_quote_line_item_service.py index ca5571800..b4ba6f24a 100644 --- a/stripe/_quote_line_item_service.py +++ b/stripe/_quote_line_item_service.py @@ -18,6 +18,7 @@ class QuoteLineItemService(StripeService): def list( self, quote: str, + /, params: Optional["QuoteLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, quote: str, + /, params: Optional["QuoteLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": diff --git a/stripe/_quote_line_service.py b/stripe/_quote_line_service.py index d0ee8e0f5..d9d5dd724 100644 --- a/stripe/_quote_line_service.py +++ b/stripe/_quote_line_service.py @@ -16,6 +16,7 @@ class QuoteLineService(StripeService): def list( self, quote: str, + /, params: Optional["QuoteLineListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuoteLine]": @@ -36,6 +37,7 @@ def list( async def list_async( self, quote: str, + /, params: Optional["QuoteLineListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuoteLine]": diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index ee04216e6..da9cb9c45 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -35,7 +35,7 @@ class QuotePreviewInvoice(StripeObject): Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. - They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments + They contain [invoice items](https://docs.stripe.com/api#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, @@ -410,7 +410,7 @@ class Issuer(StripeObject): class LastFinalizationError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -471,6 +471,7 @@ class LastFinalizationError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -481,6 +482,8 @@ class LastFinalizationError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -535,6 +538,7 @@ class LastFinalizationError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -690,7 +694,7 @@ class LastFinalizationError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -701,9 +705,9 @@ class LastFinalizationError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -814,7 +818,77 @@ class Bancontact(StripeObject): """ class Billie(StripeObject): - pass + class CompanyDetails(StripeObject): + class RegisteredAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code. + """ + line1: Optional[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + registered_address: Optional[RegisteredAddress] + registered_name: Optional[str] + """ + Company or entity name. + """ + registration_number: Optional[str] + """ + The official registration number for the given registration type. + """ + registration_type: Optional[ + Literal[ + "ch_ein", + "de_hrb", + "dk_cvr", + "es_cif", + "fi_tunnus", + "fr_siren", + "fr_siret", + "it_rea", + "nl_kvk", + "no_org_number", + "no_pno", + "se_org_number", + "se_pno", + "uk_crn", + ] + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: Optional[str] + """ + VAT ID number. + """ + _inner_class_types = { + "registered_address": RegisteredAddress, + } + + company_details: Optional[CompanyDetails] + reference: Optional[str] + """ + An identifier or reference that this payment corresponds to. + """ + _inner_class_types = {"company_details": CompanyDetails} class Blik(StripeObject): pass @@ -1280,6 +1354,27 @@ class Address(StripeObject): """ _inner_class_types = {"address": Address} + class StatusDetails(StripeObject): + class Uncollectible(StripeObject): + reason: Optional[ + Union[ + Literal[ + "max_payment_attempts", + "payment_not_received", + "subscription_canceled", + "subscription_paused", + "user_forgiven", + ], + str, + ] + ] + """ + The reason why the invoice is uncollectible. + """ + + uncollectible: Optional[Uncollectible] + _inner_class_types = {"uncollectible": Uncollectible} + class StatusTransitions(StripeObject): finalized_at: Optional[int] """ @@ -1679,7 +1774,7 @@ class TaxRateDetails(StripeObject): """ rendering: Optional[Rendering] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + The rendering-related settings that control how invoices render in customer-facing interfaces such as the PDF or hosted invoice page. """ shipping_cost: Optional[ShippingCost] """ @@ -1703,6 +1798,7 @@ class TaxRateDetails(StripeObject): """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview) """ + status_details: Optional[StatusDetails] status_transitions: StatusTransitions subscription: Optional[ExpandableField["Subscription"]] subtotal: int @@ -1763,6 +1859,7 @@ class TaxRateDetails(StripeObject): "rendering": Rendering, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, + "status_details": StatusDetails, "status_transitions": StatusTransitions, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, diff --git a/stripe/_quote_preview_invoice_service.py b/stripe/_quote_preview_invoice_service.py index ab4109d88..a53d9841f 100644 --- a/stripe/_quote_preview_invoice_service.py +++ b/stripe/_quote_preview_invoice_service.py @@ -18,6 +18,7 @@ class QuotePreviewInvoiceService(StripeService): def list( self, quote: str, + /, params: Optional["QuotePreviewInvoiceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuotePreviewInvoice]": @@ -40,6 +41,7 @@ def list( async def list_async( self, quote: str, + /, params: Optional["QuotePreviewInvoiceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuotePreviewInvoice]": diff --git a/stripe/_quote_preview_subscription_schedule.py b/stripe/_quote_preview_subscription_schedule.py index 88175a624..3a614a98d 100644 --- a/stripe/_quote_preview_subscription_schedule.py +++ b/stripe/_quote_preview_subscription_schedule.py @@ -235,6 +235,147 @@ class FailedTransition(StripeObject): """ _inner_class_types = {"failed_transitions": FailedTransition} + class PauseSchedule(StripeObject): + class Pause(StripeObject): + class Settings(StripeObject): + class BillFor(StripeObject): + class OutstandingUsageThrough(StripeObject): + type: Union[Literal["none", "pause_at"], str] + """ + The type of outstanding usage billing behavior. + """ + + class UnusedTimeFrom(StripeObject): + type: Union[ + Literal[ + "item_current_period_start", "none", "pause_at" + ], + str, + ] + """ + The type of unused time credit behavior. + """ + + outstanding_usage_through: OutstandingUsageThrough + unused_time_from: UnusedTimeFrom + _inner_class_types = { + "outstanding_usage_through": OutstandingUsageThrough, + "unused_time_from": UnusedTimeFrom, + } + + bill_for: BillFor + invoicing_behavior: Union[ + Literal["invoice", "pending_invoice_item"], str + ] + """ + Determines how to handle debits and credits when pausing. + """ + type: Union[Literal["subscription"], str] + """ + The type of pause settings. + """ + _inner_class_types = {"bill_for": BillFor} + + class Status(StripeObject): + class Error(StripeObject): + code: Optional[str] + """ + A machine-readable error code. + """ + message: str + """ + A description of the error. + """ + + error: Optional[Error] + type: Union[Literal["error", "scheduled", "succeeded"], str] + """ + The lifecycle state of the pause operation. + """ + _inner_class_types = {"error": Error} + + pause_at: int + """ + Time at which the subscription pauses. + """ + settings: Optional[Settings] + """ + Settings controlling billing behavior during the pause. + """ + status: Status + _inner_class_types = {"settings": Settings, "status": Status} + + class Resume(StripeObject): + class Settings(StripeObject): + billing_cycle_anchor: Union[ + Literal["resume_at", "unchanged"], str + ] + """ + The billing cycle anchor that applies when the subscription is resumed. + """ + payment_behavior: Union[ + Literal[ + "resume_on_payment_attempt", + "resume_on_payment_success", + ], + str, + ] + """ + Controls whether Stripe attempts payment on the resumption invoice and how that affects the subscription's status. + """ + proration_behavior: Union[ + Literal["always_invoice", "create_prorations", "none"], str + ] + """ + Determines how to handle prorations resulting from the billing_cycle_anchor change on resume. + """ + + class Status(StripeObject): + class Error(StripeObject): + code: Optional[str] + """ + A machine-readable error code. + """ + message: str + """ + A description of the error. + """ + + error: Optional[Error] + type: Union[ + Literal[ + "error", + "pending", + "requires_action", + "scheduled", + "succeeded", + ], + str, + ] + """ + The lifecycle state of the resume operation. + """ + _inner_class_types = {"error": Error} + + resume_at: int + """ + Time at which the subscription resumes. + """ + settings: Settings + status: Status + _inner_class_types = {"settings": Settings, "status": Status} + + key: str + """ + A unique identifier for this pause schedule. + """ + pause: Pause + resume: Optional[Resume] + """ + Details about when and how the subscription resumes. + """ + _inner_class_types = {"pause": Pause, "resume": Resume} + class Phase(StripeObject): class AddInvoiceItem(StripeObject): class Discount(StripeObject): @@ -756,6 +897,10 @@ class Prebilling(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + pause_schedules: Optional[List[PauseSchedule]] + """ + The pause schedules for this subscription schedule. + """ phases: List[Phase] """ Configuration for the subscription schedule's phases. @@ -793,6 +938,7 @@ class Prebilling(StripeObject): "current_phase": CurrentPhase, "default_settings": DefaultSettings, "last_price_migration_error": LastPriceMigrationError, + "pause_schedules": PauseSchedule, "phases": Phase, "prebilling": Prebilling, } diff --git a/stripe/_quote_preview_subscription_schedule_service.py b/stripe/_quote_preview_subscription_schedule_service.py index 636a0a49b..479170869 100644 --- a/stripe/_quote_preview_subscription_schedule_service.py +++ b/stripe/_quote_preview_subscription_schedule_service.py @@ -20,6 +20,7 @@ class QuotePreviewSubscriptionScheduleService(StripeService): def list( self, quote: str, + /, params: Optional["QuotePreviewSubscriptionScheduleListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuotePreviewSubscriptionSchedule]": @@ -42,6 +43,7 @@ def list( async def list_async( self, quote: str, + /, params: Optional["QuotePreviewSubscriptionScheduleListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[QuotePreviewSubscriptionSchedule]": diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 248977ea0..02bd83dcc 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -163,6 +163,7 @@ async def create_async( def retrieve( self, quote: str, + /, params: Optional["QuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -183,6 +184,7 @@ def retrieve( async def retrieve_async( self, quote: str, + /, params: Optional["QuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -203,6 +205,7 @@ async def retrieve_async( def update( self, quote: str, + /, params: Optional["QuoteUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -223,6 +226,7 @@ def update( async def update_async( self, quote: str, + /, params: Optional["QuoteUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -243,6 +247,7 @@ async def update_async( def accept( self, quote: str, + /, params: Optional["QuoteAcceptParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -263,6 +268,7 @@ def accept( async def accept_async( self, quote: str, + /, params: Optional["QuoteAcceptParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -283,6 +289,7 @@ async def accept_async( def cancel( self, quote: str, + /, params: Optional["QuoteCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -303,6 +310,7 @@ def cancel( async def cancel_async( self, quote: str, + /, params: Optional["QuoteCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -323,6 +331,7 @@ async def cancel_async( def finalize_quote( self, quote: str, + /, params: Optional["QuoteFinalizeQuoteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -343,6 +352,7 @@ def finalize_quote( async def finalize_quote_async( self, quote: str, + /, params: Optional["QuoteFinalizeQuoteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -363,6 +373,7 @@ async def finalize_quote_async( def mark_draft( self, quote: str, + /, params: Optional["QuoteMarkDraftParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -385,6 +396,7 @@ def mark_draft( async def mark_draft_async( self, quote: str, + /, params: Optional["QuoteMarkDraftParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -407,6 +419,7 @@ async def mark_draft_async( def mark_stale( self, quote: str, + /, params: Optional["QuoteMarkStaleParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -429,6 +442,7 @@ def mark_stale( async def mark_stale_async( self, quote: str, + /, params: Optional["QuoteMarkStaleParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -451,6 +465,7 @@ async def mark_stale_async( def reestimate( self, quote: str, + /, params: Optional["QuoteReestimateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -473,6 +488,7 @@ def reestimate( async def reestimate_async( self, quote: str, + /, params: Optional["QuoteReestimateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Quote": @@ -495,6 +511,7 @@ async def reestimate_async( def pdf( self, quote: str, + /, params: Optional["QuotePdfParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Any": @@ -515,6 +532,7 @@ def pdf( async def pdf_async( self, quote: str, + /, params: Optional["QuotePdfParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Any": @@ -536,6 +554,7 @@ def list_preview_invoice_lines( self, quote: str, preview_invoice: str, + /, params: Optional["QuoteListPreviewInvoiceLinesParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[InvoiceLineItem]": @@ -560,6 +579,7 @@ async def list_preview_invoice_lines_async( self, quote: str, preview_invoice: str, + /, params: Optional["QuoteListPreviewInvoiceLinesParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[InvoiceLineItem]": diff --git a/stripe/_radar_service.py b/stripe/_radar_service.py index 767d0fa16..17948efda 100644 --- a/stripe/_radar_service.py +++ b/stripe/_radar_service.py @@ -5,6 +5,9 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.radar._billing_evaluation_service import ( + BillingEvaluationService, + ) from stripe.radar._early_fraud_warning_service import ( EarlyFraudWarningService, ) @@ -15,6 +18,10 @@ from stripe.radar._value_list_service import ValueListService _subservices = { + "billing_evaluations": [ + "stripe.radar._billing_evaluation_service", + "BillingEvaluationService", + ], "early_fraud_warnings": [ "stripe.radar._early_fraud_warning_service", "EarlyFraudWarningService", @@ -32,6 +39,7 @@ class RadarService(StripeService): + billing_evaluations: "BillingEvaluationService" early_fraud_warnings: "EarlyFraudWarningService" payment_evaluations: "PaymentEvaluationService" value_lists: "ValueListService" diff --git a/stripe/_refund.py b/stripe/_refund.py index db2a57802..a5842822e 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -17,7 +17,7 @@ from stripe._customer import Customer from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod - from stripe._reversal import Reversal + from stripe._transfer_reversal import TransferReversal from stripe.params._refund_cancel_params import RefundCancelParams from stripe.params._refund_create_params import RefundCreateParams from stripe.params._refund_expire_params import RefundExpireParams @@ -485,7 +485,7 @@ class PresentmentDetails(StripeObject): """ This is the transaction number that appears on email receipts sent for this refund. """ - source_transfer_reversal: Optional[ExpandableField["Reversal"]] + source_transfer_reversal: Optional[ExpandableField["TransferReversal"]] """ The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. """ @@ -493,14 +493,14 @@ class PresentmentDetails(StripeObject): """ Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://docs.stripe.com/refunds#failed-refunds). """ - transfer_reversal: Optional[ExpandableField["Reversal"]] + transfer_reversal: Optional[ExpandableField["TransferReversal"]] """ This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. """ @classmethod def _cls_cancel( - cls, refund: str, **params: Unpack["RefundCancelParams"] + cls, refund: str, /, **params: Unpack["RefundCancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -521,7 +521,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - refund: str, **params: Unpack["RefundCancelParams"] + refund: str, /, **params: Unpack["RefundCancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -540,9 +540,7 @@ def cancel(self, **params: Unpack["RefundCancelParams"]) -> "Refund": ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["RefundCancelParams"] - ) -> "Refund": + def cancel(self, **params: Unpack["RefundCancelParams"]) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -561,7 +559,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, refund: str, **params: Unpack["RefundCancelParams"] + cls, refund: str, /, **params: Unpack["RefundCancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -582,7 +580,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - refund: str, **params: Unpack["RefundCancelParams"] + refund: str, /, **params: Unpack["RefundCancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -603,7 +601,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["RefundCancelParams"] ) -> "Refund": """ @@ -714,7 +712,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["RefundModifyParams"] + cls, id: str, /, **params: Unpack["RefundModifyParams"] ) -> "Refund": """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. @@ -733,7 +731,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["RefundModifyParams"] + cls, id: str, /, **params: Unpack["RefundModifyParams"] ) -> "Refund": """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. @@ -777,7 +775,7 @@ class TestHelpers(APIResourceTestHelpers["Refund"]): @classmethod def _cls_expire( - cls, refund: str, **params: Unpack["RefundExpireParams"] + cls, refund: str, /, **params: Unpack["RefundExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -796,7 +794,7 @@ def _cls_expire( @overload @staticmethod def expire( - refund: str, **params: Unpack["RefundExpireParams"] + refund: str, /, **params: Unpack["RefundExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -811,9 +809,7 @@ def expire(self, **params: Unpack["RefundExpireParams"]) -> "Refund": ... @class_method_variant("_cls_expire") - def expire( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["RefundExpireParams"] - ) -> "Refund": + def expire(self, **params: Unpack["RefundExpireParams"]) -> "Refund": """ Expire a refund with a status of requires_action. """ @@ -830,7 +826,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_expire_async( - cls, refund: str, **params: Unpack["RefundExpireParams"] + cls, refund: str, /, **params: Unpack["RefundExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -849,7 +845,7 @@ async def _cls_expire_async( @overload @staticmethod async def expire_async( - refund: str, **params: Unpack["RefundExpireParams"] + refund: str, /, **params: Unpack["RefundExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -866,7 +862,7 @@ async def expire_async( ... @class_method_variant("_cls_expire_async") - async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + async def expire_async( self, **params: Unpack["RefundExpireParams"] ) -> "Refund": """ diff --git a/stripe/_refund_service.py b/stripe/_refund_service.py index 07b5c3417..d9a96c662 100644 --- a/stripe/_refund_service.py +++ b/stripe/_refund_service.py @@ -116,6 +116,7 @@ async def create_async( def retrieve( self, refund: str, + /, params: Optional["RefundRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -136,6 +137,7 @@ def retrieve( async def retrieve_async( self, refund: str, + /, params: Optional["RefundRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -156,6 +158,7 @@ async def retrieve_async( def update( self, refund: str, + /, params: Optional["RefundUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -178,6 +181,7 @@ def update( async def update_async( self, refund: str, + /, params: Optional["RefundUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -200,6 +204,7 @@ async def update_async( def cancel( self, refund: str, + /, params: Optional["RefundCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -224,6 +229,7 @@ def cancel( async def cancel_async( self, refund: str, + /, params: Optional["RefundCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": diff --git a/stripe/_review.py b/stripe/_review.py index 4f6de010e..297ae4f23 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -136,7 +136,7 @@ class Session(StripeObject): @classmethod def _cls_approve( - cls, review: str, **params: Unpack["ReviewApproveParams"] + cls, review: str, /, **params: Unpack["ReviewApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -155,7 +155,7 @@ def _cls_approve( @overload @staticmethod def approve( - review: str, **params: Unpack["ReviewApproveParams"] + review: str, /, **params: Unpack["ReviewApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -170,9 +170,7 @@ def approve(self, **params: Unpack["ReviewApproveParams"]) -> "Review": ... @class_method_variant("_cls_approve") - def approve( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["ReviewApproveParams"] - ) -> "Review": + def approve(self, **params: Unpack["ReviewApproveParams"]) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ @@ -189,7 +187,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_approve_async( - cls, review: str, **params: Unpack["ReviewApproveParams"] + cls, review: str, /, **params: Unpack["ReviewApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -208,7 +206,7 @@ async def _cls_approve_async( @overload @staticmethod async def approve_async( - review: str, **params: Unpack["ReviewApproveParams"] + review: str, /, **params: Unpack["ReviewApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -225,7 +223,7 @@ async def approve_async( ... @class_method_variant("_cls_approve_async") - async def approve_async( # pyright: ignore[reportGeneralTypeIssues] + async def approve_async( self, **params: Unpack["ReviewApproveParams"] ) -> "Review": """ diff --git a/stripe/_review_service.py b/stripe/_review_service.py index 030985dda..e2cb95135 100644 --- a/stripe/_review_service.py +++ b/stripe/_review_service.py @@ -56,6 +56,7 @@ async def list_async( def retrieve( self, review: str, + /, params: Optional["ReviewRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Review": @@ -76,6 +77,7 @@ def retrieve( async def retrieve_async( self, review: str, + /, params: Optional["ReviewRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Review": @@ -96,6 +98,7 @@ async def retrieve_async( def approve( self, review: str, + /, params: Optional["ReviewApproveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Review": @@ -118,6 +121,7 @@ def approve( async def approve_async( self, review: str, + /, params: Optional["ReviewApproveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Review": diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 707c4b8bf..6d16f3122 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -82,6 +82,12 @@ class Bancontact(StripeObject): (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + class Blik(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by BLIK to every buyer. + """ + class Boleto(StripeObject): pass @@ -472,6 +478,7 @@ class UsBankAccount(StripeObject): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] card_present: Optional[CardPresent] @@ -505,6 +512,7 @@ class UsBankAccount(StripeObject): "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, @@ -533,7 +541,7 @@ class UsBankAccount(StripeObject): class SetupError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -594,6 +602,7 @@ class SetupError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -604,6 +613,8 @@ class SetupError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -658,6 +669,7 @@ class SetupError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -813,7 +825,7 @@ class SetupError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -824,9 +836,9 @@ class SetupError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 8a1b466e7..267caf03b 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -50,7 +50,7 @@ class SetupIntent( """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -61,9 +61,9 @@ class SetupIntent( For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -88,7 +88,7 @@ class AutomaticPaymentMethods(StripeObject): class LastSetupError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -149,6 +149,7 @@ class LastSetupError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -159,6 +160,8 @@ class LastSetupError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -213,6 +216,7 @@ class LastSetupError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -368,7 +372,7 @@ class LastSetupError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -379,9 +383,9 @@ class LastSetupError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -606,6 +610,20 @@ class MandateOptions(StripeObject): class Bizum(StripeObject): pass + class Blik(StripeObject): + class MandateOptions(StripeObject): + expires_at: Optional[int] + """ + Date at which the mandate expires. + """ + type: Optional[Literal["off_session"]] + """ + Type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} + class Card(StripeObject): class MandateOptions(StripeObject): amount: int @@ -684,6 +702,12 @@ class MandateOptions(StripeObject): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + setup_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ _inner_class_types = {"mandate_options": MandateOptions} class CardPresent(StripeObject): @@ -953,6 +977,7 @@ class MandateOptions(StripeObject): amazon_pay: Optional[AmazonPay] bacs_debit: Optional[BacsDebit] bizum: Optional[Bizum] + blik: Optional[Blik] card: Optional[Card] card_present: Optional[CardPresent] klarna: Optional[Klarna] @@ -968,6 +993,7 @@ class MandateOptions(StripeObject): "amazon_pay": AmazonPay, "bacs_debit": BacsDebit, "bizum": Bizum, + "blik": Blik, "card": Card, "card_present": CardPresent, "klarna": Klarna, @@ -1006,6 +1032,7 @@ class Redaction(StripeObject): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -1026,6 +1053,7 @@ class Redaction(StripeObject): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -1195,6 +1223,7 @@ class Redaction(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1305,7 +1334,7 @@ class Redaction(StripeObject): @classmethod def _cls_cancel( - cls, intent: str, **params: Unpack["SetupIntentCancelParams"] + cls, intent: str, /, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -1326,7 +1355,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - intent: str, **params: Unpack["SetupIntentCancelParams"] + intent: str, /, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -1347,7 +1376,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ @@ -1368,7 +1397,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, intent: str, **params: Unpack["SetupIntentCancelParams"] + cls, intent: str, /, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -1389,7 +1418,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - intent: str, **params: Unpack["SetupIntentCancelParams"] + intent: str, /, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -1410,7 +1439,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["SetupIntentCancelParams"] ) -> "SetupIntent": """ @@ -1431,7 +1460,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_confirm( - cls, intent: str, **params: Unpack["SetupIntentConfirmParams"] + cls, intent: str, /, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -1463,7 +1492,7 @@ def _cls_confirm( @overload @staticmethod def confirm( - intent: str, **params: Unpack["SetupIntentConfirmParams"] + intent: str, /, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -1506,7 +1535,7 @@ def confirm( ... @class_method_variant("_cls_confirm") - def confirm( # pyright: ignore[reportGeneralTypeIssues] + def confirm( self, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ @@ -1538,7 +1567,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_confirm_async( - cls, intent: str, **params: Unpack["SetupIntentConfirmParams"] + cls, intent: str, /, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -1570,7 +1599,7 @@ async def _cls_confirm_async( @overload @staticmethod async def confirm_async( - intent: str, **params: Unpack["SetupIntentConfirmParams"] + intent: str, /, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -1613,7 +1642,7 @@ async def confirm_async( ... @class_method_variant("_cls_confirm_async") - async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] + async def confirm_async( self, **params: Unpack["SetupIntentConfirmParams"] ) -> "SetupIntent": """ @@ -1723,7 +1752,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["SetupIntentModifyParams"] + cls, id: str, /, **params: Unpack["SetupIntentModifyParams"] ) -> "SetupIntent": """ Updates a SetupIntent object. @@ -1740,7 +1769,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SetupIntentModifyParams"] + cls, id: str, /, **params: Unpack["SetupIntentModifyParams"] ) -> "SetupIntent": """ Updates a SetupIntent object. @@ -1789,6 +1818,7 @@ async def retrieve_async( def _cls_verify_microdeposits( cls, intent: str, + /, **params: Unpack["SetupIntentVerifyMicrodepositsParams"], ) -> "SetupIntent": """ @@ -1808,7 +1838,9 @@ def _cls_verify_microdeposits( @overload @staticmethod def verify_microdeposits( - intent: str, **params: Unpack["SetupIntentVerifyMicrodepositsParams"] + intent: str, + /, + **params: Unpack["SetupIntentVerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -1825,7 +1857,7 @@ def verify_microdeposits( ... @class_method_variant("_cls_verify_microdeposits") - def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] + def verify_microdeposits( self, **params: Unpack["SetupIntentVerifyMicrodepositsParams"] ) -> "SetupIntent": """ @@ -1846,6 +1878,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] async def _cls_verify_microdeposits_async( cls, intent: str, + /, **params: Unpack["SetupIntentVerifyMicrodepositsParams"], ) -> "SetupIntent": """ @@ -1865,7 +1898,9 @@ async def _cls_verify_microdeposits_async( @overload @staticmethod async def verify_microdeposits_async( - intent: str, **params: Unpack["SetupIntentVerifyMicrodepositsParams"] + intent: str, + /, + **params: Unpack["SetupIntentVerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -1882,7 +1917,7 @@ async def verify_microdeposits_async( ... @class_method_variant("_cls_verify_microdeposits_async") - async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] + async def verify_microdeposits_async( self, **params: Unpack["SetupIntentVerifyMicrodepositsParams"] ) -> "SetupIntent": """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 62d196d0c..f0adbeb4b 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -116,6 +116,7 @@ async def create_async( def retrieve( self, intent: str, + /, params: Optional["SetupIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -142,6 +143,7 @@ def retrieve( async def retrieve_async( self, intent: str, + /, params: Optional["SetupIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -168,6 +170,7 @@ async def retrieve_async( def update( self, intent: str, + /, params: Optional["SetupIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -190,6 +193,7 @@ def update( async def update_async( self, intent: str, + /, params: Optional["SetupIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -212,6 +216,7 @@ async def update_async( def cancel( self, intent: str, + /, params: Optional["SetupIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -236,6 +241,7 @@ def cancel( async def cancel_async( self, intent: str, + /, params: Optional["SetupIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -260,6 +266,7 @@ async def cancel_async( def confirm( self, intent: str, + /, params: Optional["SetupIntentConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -295,6 +302,7 @@ def confirm( async def confirm_async( self, intent: str, + /, params: Optional["SetupIntentConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -330,6 +338,7 @@ async def confirm_async( def verify_microdeposits( self, intent: str, + /, params: Optional["SetupIntentVerifyMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": @@ -352,6 +361,7 @@ def verify_microdeposits( async def verify_microdeposits_async( self, intent: str, + /, params: Optional["SetupIntentVerifyMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SetupIntent": diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index f9ac2fca9..6e8bb9872 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -221,7 +221,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ShippingRateModifyParams"] + cls, id: str, /, **params: Unpack["ShippingRateModifyParams"] ) -> "ShippingRate": """ Updates an existing shipping rate object. @@ -238,7 +238,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ShippingRateModifyParams"] + cls, id: str, /, **params: Unpack["ShippingRateModifyParams"] ) -> "ShippingRate": """ Updates an existing shipping rate object. diff --git a/stripe/_shipping_rate_service.py b/stripe/_shipping_rate_service.py index c11542923..739980bc6 100644 --- a/stripe/_shipping_rate_service.py +++ b/stripe/_shipping_rate_service.py @@ -101,6 +101,7 @@ async def create_async( def retrieve( self, shipping_rate_token: str, + /, params: Optional["ShippingRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ShippingRate": @@ -123,6 +124,7 @@ def retrieve( async def retrieve_async( self, shipping_rate_token: str, + /, params: Optional["ShippingRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ShippingRate": @@ -145,6 +147,7 @@ async def retrieve_async( def update( self, shipping_rate_token: str, + /, params: Optional["ShippingRateUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ShippingRate": @@ -167,6 +170,7 @@ def update( async def update_async( self, shipping_rate_token: str, + /, params: Optional["ShippingRateUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ShippingRate": diff --git a/stripe/_source.py b/stripe/_source.py index 3a40acfb2..4e2685bce 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -658,6 +658,7 @@ async def create_async( def _cls_list_source_transactions( cls, source: str, + /, **params: Unpack["SourceListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ @@ -677,7 +678,7 @@ def _cls_list_source_transactions( @overload @staticmethod def list_source_transactions( - source: str, **params: Unpack["SourceListSourceTransactionsParams"] + source: str, /, **params: Unpack["SourceListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -694,7 +695,7 @@ def list_source_transactions( ... @class_method_variant("_cls_list_source_transactions") - def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] + def list_source_transactions( self, **params: Unpack["SourceListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ @@ -715,6 +716,7 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_source_transactions_async( cls, source: str, + /, **params: Unpack["SourceListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ @@ -734,7 +736,7 @@ async def _cls_list_source_transactions_async( @overload @staticmethod async def list_source_transactions_async( - source: str, **params: Unpack["SourceListSourceTransactionsParams"] + source: str, /, **params: Unpack["SourceListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -751,7 +753,7 @@ async def list_source_transactions_async( ... @class_method_variant("_cls_list_source_transactions_async") - async def list_source_transactions_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_source_transactions_async( self, **params: Unpack["SourceListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ @@ -770,7 +772,7 @@ async def list_source_transactions_async( # pyright: ignore[reportGeneralTypeIs @classmethod def modify( - cls, id: str, **params: Unpack["SourceModifyParams"] + cls, id: str, /, **params: Unpack["SourceModifyParams"] ) -> "Source": """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -789,7 +791,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SourceModifyParams"] + cls, id: str, /, **params: Unpack["SourceModifyParams"] ) -> "Source": """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -830,7 +832,7 @@ async def retrieve_async( @classmethod def _cls_verify( - cls, source: str, **params: Unpack["SourceVerifyParams"] + cls, source: str, /, **params: Unpack["SourceVerifyParams"] ) -> "Source": """ Verify a given source. @@ -849,7 +851,7 @@ def _cls_verify( @overload @staticmethod def verify( - source: str, **params: Unpack["SourceVerifyParams"] + source: str, /, **params: Unpack["SourceVerifyParams"] ) -> "Source": """ Verify a given source. @@ -864,9 +866,7 @@ def verify(self, **params: Unpack["SourceVerifyParams"]) -> "Source": ... @class_method_variant("_cls_verify") - def verify( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["SourceVerifyParams"] - ) -> "Source": + def verify(self, **params: Unpack["SourceVerifyParams"]) -> "Source": """ Verify a given source. """ @@ -883,7 +883,7 @@ def verify( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_verify_async( - cls, source: str, **params: Unpack["SourceVerifyParams"] + cls, source: str, /, **params: Unpack["SourceVerifyParams"] ) -> "Source": """ Verify a given source. @@ -902,7 +902,7 @@ async def _cls_verify_async( @overload @staticmethod async def verify_async( - source: str, **params: Unpack["SourceVerifyParams"] + source: str, /, **params: Unpack["SourceVerifyParams"] ) -> "Source": """ Verify a given source. @@ -919,7 +919,7 @@ async def verify_async( ... @class_method_variant("_cls_verify_async") - async def verify_async( # pyright: ignore[reportGeneralTypeIssues] + async def verify_async( self, **params: Unpack["SourceVerifyParams"] ) -> "Source": """ diff --git a/stripe/_source_service.py b/stripe/_source_service.py index 849f2e742..7f7de39e9 100644 --- a/stripe/_source_service.py +++ b/stripe/_source_service.py @@ -54,6 +54,7 @@ def detach( self, customer: str, id: str, + /, params: Optional["SourceDetachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -78,6 +79,7 @@ async def detach_async( self, customer: str, id: str, + /, params: Optional["SourceDetachParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Union[Account, BankAccount, Card, Source]": @@ -101,6 +103,7 @@ async def detach_async( def retrieve( self, source: str, + /, params: Optional["SourceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Source": @@ -121,6 +124,7 @@ def retrieve( async def retrieve_async( self, source: str, + /, params: Optional["SourceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Source": @@ -141,6 +145,7 @@ async def retrieve_async( def update( self, source: str, + /, params: Optional["SourceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Source": @@ -163,6 +168,7 @@ def update( async def update_async( self, source: str, + /, params: Optional["SourceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Source": @@ -223,6 +229,7 @@ async def create_async( def verify( self, source: str, + /, params: "SourceVerifyParams", options: Optional["RequestOptions"] = None, ) -> "Source": @@ -245,6 +252,7 @@ def verify( async def verify_async( self, source: str, + /, params: "SourceVerifyParams", options: Optional["RequestOptions"] = None, ) -> "Source": diff --git a/stripe/_source_transaction_service.py b/stripe/_source_transaction_service.py index b40e91503..c86b48bb3 100644 --- a/stripe/_source_transaction_service.py +++ b/stripe/_source_transaction_service.py @@ -18,6 +18,7 @@ class SourceTransactionService(StripeService): def list( self, source: str, + /, params: Optional["SourceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[SourceTransaction]": @@ -40,6 +41,7 @@ def list( async def list_async( self, source: str, + /, params: Optional["SourceTransactionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[SourceTransaction]": diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index dfd53af55..78c473ee3 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -141,6 +141,7 @@ from stripe._tax_rate_service import TaxRateService from stripe._terminal_service import TerminalService from stripe._test_helpers_service import TestHelpersService + from stripe._three_d_secure_service import ThreeDSecureService from stripe._token_service import TokenService from stripe._topup_service import TopupService from stripe._transfer_service import TransferService @@ -1276,6 +1277,17 @@ def terminal(self) -> "TerminalService": def test_helpers(self) -> "TestHelpersService": return self.v1.test_helpers + @property + @deprecated( + """ + StripeClient.three_d_secure is deprecated, use StripeClient.v1.three_d_secure instead. + All functionality under it has been copied over to StripeClient.v1.three_d_secure. + See [migration guide](https://github.com/stripe/stripe-python/wiki/v1-namespace-in-StripeClient) for more on this and tips on migrating to the new v1 namespace. + """, + ) + def three_d_secure(self) -> "ThreeDSecureService": + return self.v1.three_d_secure + @property @deprecated( """ diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index b37075ab1..8fe6d87d7 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -7,7 +7,6 @@ Type, Literal, Self, - deprecated, ) from typing import ( Any, @@ -448,23 +447,6 @@ def _refresh_from( self._previous = values - @deprecated("This will be removed in a future version of stripe-python.") - def request( - self, - method: Literal["get", "post", "delete"], - url: str, - params: Optional[Dict[str, Any]] = None, - *, - base_address: BaseAddress = "api", - ) -> "StripeObject": - return StripeObject._request( - self, - method, - url, - params=params, - base_address=base_address, - ) - def _request( self, method: Literal["get", "post", "delete"], diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 1ba407dc3..ab8944412 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -373,11 +373,77 @@ class Bancontact(StripeObject): """ class Billie(StripeObject): - pass + class CompanyDetails(StripeObject): + class RegisteredAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code. + """ + line1: Optional[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + + registered_address: Optional[RegisteredAddress] + registered_name: Optional[str] + """ + Company or entity name. + """ + registration_number: Optional[str] + """ + The official registration number for the given registration type. + """ + registration_type: Optional[ + Literal[ + "ch_ein", + "de_hrb", + "dk_cvr", + "es_cif", + "fi_tunnus", + "fr_siren", + "fr_siret", + "it_rea", + "nl_kvk", + "no_org_number", + "no_pno", + "se_org_number", + "se_pno", + "uk_crn", + ] + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: Optional[str] + """ + VAT ID number. + """ + _inner_class_types = { + "registered_address": RegisteredAddress, + } + + company_details: Optional[CompanyDetails] + _inner_class_types = {"company_details": CompanyDetails} class Blik(StripeObject): class MandateOptions(StripeObject): - expires_after: Optional[int] + expires_at: Optional[int] """ Date when the mandate expires and no further payments will be charged. If not provided, the mandate will be set to be indefinite. """ @@ -788,6 +854,10 @@ class PendingUpdate(StripeObject): """ If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. """ + cancel_at_period_end: Optional[bool] + """ + Indicates whether this subscription should cancel at the end of the current period if the update is applied. + """ discount: Optional["Discount"] """ The pending subscription-level discount that will be applied when the pending update is applied. @@ -818,7 +888,7 @@ class PendingUpdate(StripeObject): """ trial_from_plan: Optional[bool] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ class Prebilling(StripeObject): @@ -850,6 +920,8 @@ class Paused(StripeObject): class Subscription(StripeObject): type: Union[ Literal[ + "final_payment_failure", + "first_payment_failure", "pause_requested", "system", "trial_end_without_payment_method", @@ -868,7 +940,7 @@ class Subscription(StripeObject): """ Unix timestamp in seconds of when the subscription status transitioned to `paused`. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of pause. """ @@ -1104,7 +1176,7 @@ class EndBehavior(StripeObject): A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. + A subscription can only enter a `paused` status [when a trial ends without a payment method](https://docs.stripe.com/billing/subscriptions/trials/free-trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://docs.stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). @@ -1139,6 +1211,7 @@ class EndBehavior(StripeObject): def _cls_cancel( cls, subscription_exposed_id: str, + /, **params: Unpack["SubscriptionCancelParams"], ) -> "Subscription": """ @@ -1165,6 +1238,7 @@ def _cls_cancel( @staticmethod def cancel( subscription_exposed_id: str, + /, **params: Unpack["SubscriptionCancelParams"], ) -> "Subscription": """ @@ -1190,7 +1264,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["SubscriptionCancelParams"] ) -> "Subscription": """ @@ -1215,6 +1289,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, subscription_exposed_id: str, + /, **params: Unpack["SubscriptionCancelParams"], ) -> "Subscription": """ @@ -1241,6 +1316,7 @@ async def _cls_cancel_async( @staticmethod async def cancel_async( subscription_exposed_id: str, + /, **params: Unpack["SubscriptionCancelParams"], ) -> "Subscription": """ @@ -1266,7 +1342,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["SubscriptionCancelParams"] ) -> "Subscription": """ @@ -1335,6 +1411,7 @@ async def create_async( def _cls_delete_discount( cls, subscription_exposed_id: str, + /, **params: Unpack["SubscriptionDeleteDiscountParams"], ) -> "Discount": """ @@ -1357,6 +1434,7 @@ def _cls_delete_discount( @staticmethod def delete_discount( subscription_exposed_id: str, + /, **params: Unpack["SubscriptionDeleteDiscountParams"], ) -> "Discount": """ @@ -1374,7 +1452,7 @@ def delete_discount( ... @class_method_variant("_cls_delete_discount") - def delete_discount( # pyright: ignore[reportGeneralTypeIssues] + def delete_discount( self, **params: Unpack["SubscriptionDeleteDiscountParams"] ) -> "Discount": """ @@ -1395,6 +1473,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] async def _cls_delete_discount_async( cls, subscription_exposed_id: str, + /, **params: Unpack["SubscriptionDeleteDiscountParams"], ) -> "Discount": """ @@ -1417,6 +1496,7 @@ async def _cls_delete_discount_async( @staticmethod async def delete_discount_async( subscription_exposed_id: str, + /, **params: Unpack["SubscriptionDeleteDiscountParams"], ) -> "Discount": """ @@ -1434,7 +1514,7 @@ async def delete_discount_async( ... @class_method_variant("_cls_delete_discount_async") - async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_discount_async( self, **params: Unpack["SubscriptionDeleteDiscountParams"] ) -> "Discount": """ @@ -1493,7 +1573,10 @@ async def list_async( @classmethod def _cls_migrate( - cls, subscription: str, **params: Unpack["SubscriptionMigrateParams"] + cls, + subscription: str, + /, + **params: Unpack["SubscriptionMigrateParams"], ) -> "Subscription": """ Upgrade the billing_mode of an existing subscription. @@ -1512,7 +1595,7 @@ def _cls_migrate( @overload @staticmethod def migrate( - subscription: str, **params: Unpack["SubscriptionMigrateParams"] + subscription: str, /, **params: Unpack["SubscriptionMigrateParams"] ) -> "Subscription": """ Upgrade the billing_mode of an existing subscription. @@ -1529,7 +1612,7 @@ def migrate( ... @class_method_variant("_cls_migrate") - def migrate( # pyright: ignore[reportGeneralTypeIssues] + def migrate( self, **params: Unpack["SubscriptionMigrateParams"] ) -> "Subscription": """ @@ -1548,7 +1631,10 @@ def migrate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_migrate_async( - cls, subscription: str, **params: Unpack["SubscriptionMigrateParams"] + cls, + subscription: str, + /, + **params: Unpack["SubscriptionMigrateParams"], ) -> "Subscription": """ Upgrade the billing_mode of an existing subscription. @@ -1567,7 +1653,7 @@ async def _cls_migrate_async( @overload @staticmethod async def migrate_async( - subscription: str, **params: Unpack["SubscriptionMigrateParams"] + subscription: str, /, **params: Unpack["SubscriptionMigrateParams"] ) -> "Subscription": """ Upgrade the billing_mode of an existing subscription. @@ -1584,7 +1670,7 @@ async def migrate_async( ... @class_method_variant("_cls_migrate_async") - async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] + async def migrate_async( self, **params: Unpack["SubscriptionMigrateParams"] ) -> "Subscription": """ @@ -1603,7 +1689,7 @@ async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def modify( - cls, id: str, **params: Unpack["SubscriptionModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionModifyParams"] ) -> "Subscription": """ Updates an existing subscription to match the specified parameters. @@ -1640,7 +1726,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SubscriptionModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionModifyParams"] ) -> "Subscription": """ Updates an existing subscription to match the specified parameters. @@ -1677,7 +1763,7 @@ async def modify_async( @classmethod def _cls_pause( - cls, subscription: str, **params: Unpack["SubscriptionPauseParams"] + cls, subscription: str, /, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules. @@ -1696,7 +1782,7 @@ def _cls_pause( @overload @staticmethod def pause( - subscription: str, **params: Unpack["SubscriptionPauseParams"] + subscription: str, /, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules. @@ -1713,7 +1799,7 @@ def pause( ... @class_method_variant("_cls_pause") - def pause( # pyright: ignore[reportGeneralTypeIssues] + def pause( self, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ @@ -1732,7 +1818,7 @@ def pause( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_pause_async( - cls, subscription: str, **params: Unpack["SubscriptionPauseParams"] + cls, subscription: str, /, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules. @@ -1751,7 +1837,7 @@ async def _cls_pause_async( @overload @staticmethod async def pause_async( - subscription: str, **params: Unpack["SubscriptionPauseParams"] + subscription: str, /, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules. @@ -1768,7 +1854,7 @@ async def pause_async( ... @class_method_variant("_cls_pause_async") - async def pause_async( # pyright: ignore[reportGeneralTypeIssues] + async def pause_async( self, **params: Unpack["SubscriptionPauseParams"] ) -> "Subscription": """ @@ -1787,7 +1873,7 @@ async def pause_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_resume( - cls, subscription: str, **params: Unpack["SubscriptionResumeParams"] + cls, subscription: str, /, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions). @@ -1806,7 +1892,7 @@ def _cls_resume( @overload @staticmethod def resume( - subscription: str, **params: Unpack["SubscriptionResumeParams"] + subscription: str, /, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions). @@ -1823,7 +1909,7 @@ def resume( ... @class_method_variant("_cls_resume") - def resume( # pyright: ignore[reportGeneralTypeIssues] + def resume( self, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ @@ -1842,7 +1928,7 @@ def resume( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_resume_async( - cls, subscription: str, **params: Unpack["SubscriptionResumeParams"] + cls, subscription: str, /, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions). @@ -1861,7 +1947,7 @@ async def _cls_resume_async( @overload @staticmethod async def resume_async( - subscription: str, **params: Unpack["SubscriptionResumeParams"] + subscription: str, /, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn't generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about [resuming subscriptions](https://docs.stripe.com/docs/billing/subscriptions/pause#resume-subscriptions). @@ -1878,7 +1964,7 @@ async def resume_async( ... @class_method_variant("_cls_resume_async") - async def resume_async( # pyright: ignore[reportGeneralTypeIssues] + async def resume_async( self, **params: Unpack["SubscriptionResumeParams"] ) -> "Subscription": """ diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 8a4735e69..263fba695 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -113,10 +113,10 @@ class Trial(StripeObject): """ plan: "Plan" """ - You can now model subscriptions more flexibly using the [Prices API](https://api.stripe.com#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + You can now model subscriptions more flexibly using the [Prices API](https://docs.stripe.com/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. Plans define the base price, currency, and billing cycle for recurring purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. @@ -125,7 +125,7 @@ class Trial(StripeObject): price: "Price" """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. @@ -182,7 +182,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["SubscriptionItemDeleteParams"] + cls, sid: str, /, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. @@ -200,7 +200,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["SubscriptionItemDeleteParams"] + sid: str, /, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. @@ -217,7 +217,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ @@ -231,7 +231,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["SubscriptionItemDeleteParams"] + cls, sid: str, /, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. @@ -249,7 +249,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["SubscriptionItemDeleteParams"] + sid: str, /, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. @@ -266,7 +266,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["SubscriptionItemDeleteParams"] ) -> "SubscriptionItem": """ @@ -320,7 +320,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["SubscriptionItemModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionItemModifyParams"] ) -> "SubscriptionItem": """ Updates the plan or quantity of an item on a current subscription. @@ -337,7 +337,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SubscriptionItemModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionItemModifyParams"] ) -> "SubscriptionItem": """ Updates the plan or quantity of an item on a current subscription. diff --git a/stripe/_subscription_item_service.py b/stripe/_subscription_item_service.py index 304404337..0abcdcec8 100644 --- a/stripe/_subscription_item_service.py +++ b/stripe/_subscription_item_service.py @@ -30,6 +30,7 @@ class SubscriptionItemService(StripeService): def delete( self, item: str, + /, params: Optional["SubscriptionItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": @@ -50,6 +51,7 @@ def delete( async def delete_async( self, item: str, + /, params: Optional["SubscriptionItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": @@ -70,6 +72,7 @@ async def delete_async( def retrieve( self, item: str, + /, params: Optional["SubscriptionItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": @@ -90,6 +93,7 @@ def retrieve( async def retrieve_async( self, item: str, + /, params: Optional["SubscriptionItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": @@ -110,6 +114,7 @@ async def retrieve_async( def update( self, item: str, + /, params: Optional["SubscriptionItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": @@ -130,6 +135,7 @@ def update( async def update_async( self, item: str, + /, params: Optional["SubscriptionItemUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionItem": diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 56dec2ec6..b81fbb62d 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -257,6 +257,147 @@ class FailedTransition(StripeObject): """ _inner_class_types = {"failed_transitions": FailedTransition} + class PauseSchedule(StripeObject): + class Pause(StripeObject): + class Settings(StripeObject): + class BillFor(StripeObject): + class OutstandingUsageThrough(StripeObject): + type: Union[Literal["none", "pause_at"], str] + """ + The type of outstanding usage billing behavior. + """ + + class UnusedTimeFrom(StripeObject): + type: Union[ + Literal[ + "item_current_period_start", "none", "pause_at" + ], + str, + ] + """ + The type of unused time credit behavior. + """ + + outstanding_usage_through: OutstandingUsageThrough + unused_time_from: UnusedTimeFrom + _inner_class_types = { + "outstanding_usage_through": OutstandingUsageThrough, + "unused_time_from": UnusedTimeFrom, + } + + bill_for: BillFor + invoicing_behavior: Union[ + Literal["invoice", "pending_invoice_item"], str + ] + """ + Determines how to handle debits and credits when pausing. + """ + type: Union[Literal["subscription"], str] + """ + The type of pause settings. + """ + _inner_class_types = {"bill_for": BillFor} + + class Status(StripeObject): + class Error(StripeObject): + code: Optional[str] + """ + A machine-readable error code. + """ + message: str + """ + A description of the error. + """ + + error: Optional[Error] + type: Union[Literal["error", "scheduled", "succeeded"], str] + """ + The lifecycle state of the pause operation. + """ + _inner_class_types = {"error": Error} + + pause_at: int + """ + Time at which the subscription pauses. + """ + settings: Optional[Settings] + """ + Settings controlling billing behavior during the pause. + """ + status: Status + _inner_class_types = {"settings": Settings, "status": Status} + + class Resume(StripeObject): + class Settings(StripeObject): + billing_cycle_anchor: Union[ + Literal["resume_at", "unchanged"], str + ] + """ + The billing cycle anchor that applies when the subscription is resumed. + """ + payment_behavior: Union[ + Literal[ + "resume_on_payment_attempt", + "resume_on_payment_success", + ], + str, + ] + """ + Controls whether Stripe attempts payment on the resumption invoice and how that affects the subscription's status. + """ + proration_behavior: Union[ + Literal["always_invoice", "create_prorations", "none"], str + ] + """ + Determines how to handle prorations resulting from the billing_cycle_anchor change on resume. + """ + + class Status(StripeObject): + class Error(StripeObject): + code: Optional[str] + """ + A machine-readable error code. + """ + message: str + """ + A description of the error. + """ + + error: Optional[Error] + type: Union[ + Literal[ + "error", + "pending", + "requires_action", + "scheduled", + "succeeded", + ], + str, + ] + """ + The lifecycle state of the resume operation. + """ + _inner_class_types = {"error": Error} + + resume_at: int + """ + Time at which the subscription resumes. + """ + settings: Settings + status: Status + _inner_class_types = {"settings": Settings, "status": Status} + + key: str + """ + A unique identifier for this pause schedule. + """ + pause: Pause + resume: Optional[Resume] + """ + Details about when and how the subscription resumes. + """ + _inner_class_types = {"pause": Pause, "resume": Resume} + class Phase(StripeObject): class AddInvoiceItem(StripeObject): class Discount(StripeObject): @@ -777,6 +918,10 @@ class Prebilling(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + pause_schedules: Optional[List[PauseSchedule]] + """ + The pause schedules for this subscription schedule. + """ phases: List[Phase] """ Configuration for the subscription schedule's phases. @@ -811,7 +956,10 @@ class Prebilling(StripeObject): @classmethod def _cls_amend( - cls, schedule: str, **params: Unpack["SubscriptionScheduleAmendParams"] + cls, + schedule: str, + /, + **params: Unpack["SubscriptionScheduleAmendParams"], ) -> "SubscriptionSchedule": """ Amends an existing subscription schedule. @@ -830,7 +978,7 @@ def _cls_amend( @overload @staticmethod def amend( - schedule: str, **params: Unpack["SubscriptionScheduleAmendParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleAmendParams"] ) -> "SubscriptionSchedule": """ Amends an existing subscription schedule. @@ -847,7 +995,7 @@ def amend( ... @class_method_variant("_cls_amend") - def amend( # pyright: ignore[reportGeneralTypeIssues] + def amend( self, **params: Unpack["SubscriptionScheduleAmendParams"] ) -> "SubscriptionSchedule": """ @@ -866,7 +1014,10 @@ def amend( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_amend_async( - cls, schedule: str, **params: Unpack["SubscriptionScheduleAmendParams"] + cls, + schedule: str, + /, + **params: Unpack["SubscriptionScheduleAmendParams"], ) -> "SubscriptionSchedule": """ Amends an existing subscription schedule. @@ -885,7 +1036,7 @@ async def _cls_amend_async( @overload @staticmethod async def amend_async( - schedule: str, **params: Unpack["SubscriptionScheduleAmendParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleAmendParams"] ) -> "SubscriptionSchedule": """ Amends an existing subscription schedule. @@ -902,7 +1053,7 @@ async def amend_async( ... @class_method_variant("_cls_amend_async") - async def amend_async( # pyright: ignore[reportGeneralTypeIssues] + async def amend_async( self, **params: Unpack["SubscriptionScheduleAmendParams"] ) -> "SubscriptionSchedule": """ @@ -923,6 +1074,7 @@ async def amend_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_cancel( cls, schedule: str, + /, **params: Unpack["SubscriptionScheduleCancelParams"], ) -> "SubscriptionSchedule": """ @@ -942,7 +1094,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - schedule: str, **params: Unpack["SubscriptionScheduleCancelParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleCancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -959,7 +1111,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["SubscriptionScheduleCancelParams"] ) -> "SubscriptionSchedule": """ @@ -980,6 +1132,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, schedule: str, + /, **params: Unpack["SubscriptionScheduleCancelParams"], ) -> "SubscriptionSchedule": """ @@ -999,7 +1152,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - schedule: str, **params: Unpack["SubscriptionScheduleCancelParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleCancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1016,7 +1169,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["SubscriptionScheduleCancelParams"] ) -> "SubscriptionSchedule": """ @@ -1107,7 +1260,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["SubscriptionScheduleModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionScheduleModifyParams"] ) -> "SubscriptionSchedule": """ Updates an existing subscription schedule. @@ -1124,7 +1277,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SubscriptionScheduleModifyParams"] + cls, id: str, /, **params: Unpack["SubscriptionScheduleModifyParams"] ) -> "SubscriptionSchedule": """ Updates an existing subscription schedule. @@ -1143,6 +1296,7 @@ async def modify_async( def _cls_release( cls, schedule: str, + /, **params: Unpack["SubscriptionScheduleReleaseParams"], ) -> "SubscriptionSchedule": """ @@ -1162,7 +1316,7 @@ def _cls_release( @overload @staticmethod def release( - schedule: str, **params: Unpack["SubscriptionScheduleReleaseParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1179,7 +1333,7 @@ def release( ... @class_method_variant("_cls_release") - def release( # pyright: ignore[reportGeneralTypeIssues] + def release( self, **params: Unpack["SubscriptionScheduleReleaseParams"] ) -> "SubscriptionSchedule": """ @@ -1200,6 +1354,7 @@ def release( # pyright: ignore[reportGeneralTypeIssues] async def _cls_release_async( cls, schedule: str, + /, **params: Unpack["SubscriptionScheduleReleaseParams"], ) -> "SubscriptionSchedule": """ @@ -1219,7 +1374,7 @@ async def _cls_release_async( @overload @staticmethod async def release_async( - schedule: str, **params: Unpack["SubscriptionScheduleReleaseParams"] + schedule: str, /, **params: Unpack["SubscriptionScheduleReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1236,7 +1391,7 @@ async def release_async( ... @class_method_variant("_cls_release_async") - async def release_async( # pyright: ignore[reportGeneralTypeIssues] + async def release_async( self, **params: Unpack["SubscriptionScheduleReleaseParams"] ) -> "SubscriptionSchedule": """ @@ -1280,6 +1435,7 @@ async def retrieve_async( "current_phase": CurrentPhase, "default_settings": DefaultSettings, "last_price_migration_error": LastPriceMigrationError, + "pause_schedules": PauseSchedule, "phases": Phase, "prebilling": Prebilling, } diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 30934f084..e44088469 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -112,6 +112,7 @@ async def create_async( def retrieve( self, schedule: str, + /, params: Optional["SubscriptionScheduleRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -134,6 +135,7 @@ def retrieve( async def retrieve_async( self, schedule: str, + /, params: Optional["SubscriptionScheduleRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -156,6 +158,7 @@ async def retrieve_async( def update( self, schedule: str, + /, params: Optional["SubscriptionScheduleUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -178,6 +181,7 @@ def update( async def update_async( self, schedule: str, + /, params: Optional["SubscriptionScheduleUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -200,6 +204,7 @@ async def update_async( def amend( self, schedule: str, + /, params: Optional["SubscriptionScheduleAmendParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -222,6 +227,7 @@ def amend( async def amend_async( self, schedule: str, + /, params: Optional["SubscriptionScheduleAmendParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -244,6 +250,7 @@ async def amend_async( def cancel( self, schedule: str, + /, params: Optional["SubscriptionScheduleCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -266,6 +273,7 @@ def cancel( async def cancel_async( self, schedule: str, + /, params: Optional["SubscriptionScheduleCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -288,6 +296,7 @@ async def cancel_async( def release( self, schedule: str, + /, params: Optional["SubscriptionScheduleReleaseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": @@ -310,6 +319,7 @@ def release( async def release_async( self, schedule: str, + /, params: Optional["SubscriptionScheduleReleaseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "SubscriptionSchedule": diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 03872deb5..a336fded6 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -48,6 +48,7 @@ class SubscriptionService(StripeService): def cancel( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -76,6 +77,7 @@ def cancel( async def cancel_async( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -104,6 +106,7 @@ async def cancel_async( def retrieve( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -128,6 +131,7 @@ def retrieve( async def retrieve_async( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -152,6 +156,7 @@ async def retrieve_async( def update( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -196,6 +201,7 @@ def update( async def update_async( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -240,6 +246,7 @@ async def update_async( def delete_discount( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionDeleteDiscountParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Discount": @@ -264,6 +271,7 @@ def delete_discount( async def delete_discount_async( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionDeleteDiscountParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Discount": @@ -420,6 +428,7 @@ async def search_async( def migrate( self, subscription: str, + /, params: "SubscriptionMigrateParams", options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -442,6 +451,7 @@ def migrate( async def migrate_async( self, subscription: str, + /, params: "SubscriptionMigrateParams", options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -464,6 +474,7 @@ async def migrate_async( def pause( self, subscription: str, + /, params: Optional["SubscriptionPauseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -486,6 +497,7 @@ def pause( async def pause_async( self, subscription: str, + /, params: Optional["SubscriptionPauseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -508,6 +520,7 @@ async def pause_async( def resume( self, subscription: str, + /, params: Optional["SubscriptionResumeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -530,6 +543,7 @@ def resume( async def resume_async( self, subscription: str, + /, params: Optional["SubscriptionResumeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Subscription": @@ -552,6 +566,7 @@ async def resume_async( def serialize_batch_cancel( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: @@ -578,6 +593,7 @@ def serialize_batch_cancel( def serialize_batch_update( self, subscription_exposed_id: str, + /, params: Optional["SubscriptionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: @@ -604,6 +620,7 @@ def serialize_batch_update( def serialize_batch_migrate( self, subscription: str, + /, params: Optional["SubscriptionMigrateParams"] = None, options: Optional["RequestOptions"] = None, ) -> str: diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index d066b697d..f87a222db 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -19,9 +19,7 @@ class TaxCode(ListableAPIResource["TaxCode"]): OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" class Requirements(StripeObject): - performance_location: Optional[ - Union[Literal["optional", "required"], str] - ] + performance_location: Union[Literal["optional", "required"], str] """ Describes whether a performance location is required for a successful tax calculation with a tax code. """ @@ -44,7 +42,7 @@ class Requirements(StripeObject): """ requirements: Optional[Requirements] """ - An object that describes more information about the tax location required for this tax code. Some [tax codes](https://docs.stripe.com/tax/tax-for-tickets/integration-guide#types-of-products) require a tax location of type `performance` to calculate tax correctly. + An object that describes more information about the tax location required for this tax code. Some tax codes require a [performance location](https://docs.stripe.com/tax/location-sales#required-versus-optional-performance-locations) to calculate tax correctly. """ @classmethod diff --git a/stripe/_tax_code_service.py b/stripe/_tax_code_service.py index ed5f2a54b..436a48f0b 100644 --- a/stripe/_tax_code_service.py +++ b/stripe/_tax_code_service.py @@ -55,6 +55,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["TaxCodeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxCode": @@ -75,6 +76,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TaxCodeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxCode": diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 370f1baf8..4f3889c73 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -275,7 +275,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["TaxIdDeleteParams"] + cls, sid: str, /, **params: Unpack["TaxIdDeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. @@ -292,7 +292,7 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["TaxIdDeleteParams"]) -> "TaxId": + def delete(sid: str, /, **params: Unpack["TaxIdDeleteParams"]) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ @@ -306,9 +306,7 @@ def delete(self, **params: Unpack["TaxIdDeleteParams"]) -> "TaxId": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["TaxIdDeleteParams"] - ) -> "TaxId": + def delete(self, **params: Unpack["TaxIdDeleteParams"]) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ @@ -320,7 +318,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["TaxIdDeleteParams"] + cls, sid: str, /, **params: Unpack["TaxIdDeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. @@ -338,7 +336,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["TaxIdDeleteParams"] + sid: str, /, **params: Unpack["TaxIdDeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. @@ -355,7 +353,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["TaxIdDeleteParams"] ) -> "TaxId": """ diff --git a/stripe/_tax_id_service.py b/stripe/_tax_id_service.py index 8b3dbefcc..9325ccd54 100644 --- a/stripe/_tax_id_service.py +++ b/stripe/_tax_id_service.py @@ -19,6 +19,7 @@ class TaxIdService(StripeService): def delete( self, id: str, + /, params: Optional["TaxIdDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -39,6 +40,7 @@ def delete( async def delete_async( self, id: str, + /, params: Optional["TaxIdDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -59,6 +61,7 @@ async def delete_async( def retrieve( self, id: str, + /, params: Optional["TaxIdRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": @@ -79,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TaxIdRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxId": diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index b39b580c8..0c3c5c77f 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -121,6 +121,7 @@ class FlatAmount(StripeObject): Literal[ "amusement_tax", "communications_tax", + "digital_excise_tax", "gst", "hst", "igst", @@ -134,6 +135,7 @@ class FlatAmount(StripeObject): "rst", "sales_tax", "service_tax", + "utility_users_tax", "vat", ], str, @@ -215,7 +217,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["TaxRateModifyParams"] + cls, id: str, /, **params: Unpack["TaxRateModifyParams"] ) -> "TaxRate": """ Updates an existing tax rate. @@ -232,7 +234,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["TaxRateModifyParams"] + cls, id: str, /, **params: Unpack["TaxRateModifyParams"] ) -> "TaxRate": """ Updates an existing tax rate. diff --git a/stripe/_tax_rate_service.py b/stripe/_tax_rate_service.py index 8645575d5..641f48ac9 100644 --- a/stripe/_tax_rate_service.py +++ b/stripe/_tax_rate_service.py @@ -95,6 +95,7 @@ async def create_async( def retrieve( self, tax_rate: str, + /, params: Optional["TaxRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxRate": @@ -117,6 +118,7 @@ def retrieve( async def retrieve_async( self, tax_rate: str, + /, params: Optional["TaxRateRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxRate": @@ -139,6 +141,7 @@ async def retrieve_async( def update( self, tax_rate: str, + /, params: Optional["TaxRateUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxRate": @@ -161,6 +164,7 @@ def update( async def update_async( self, tax_rate: str, + /, params: Optional["TaxRateUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TaxRate": diff --git a/stripe/_three_d_secure_service.py b/stripe/_three_d_secure_service.py new file mode 100644 index 000000000..06b321711 --- /dev/null +++ b/stripe/_three_d_secure_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.three_d_secure._authentication_service import ( + AuthenticationService, + ) + +_subservices = { + "authentications": [ + "stripe.three_d_secure._authentication_service", + "AuthenticationService", + ], +} + + +class ThreeDSecureService(StripeService): + authentications: "AuthenticationService" + + 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/_token_service.py b/stripe/_token_service.py index a5cd81c28..ea024866b 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -16,6 +16,7 @@ class TokenService(StripeService): def retrieve( self, token: str, + /, params: Optional["TokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Token": @@ -36,6 +37,7 @@ def retrieve( async def retrieve_async( self, token: str, + /, params: Optional["TokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Token": diff --git a/stripe/_topup.py b/stripe/_topup.py index 296cd7d7f..5ad3dc83c 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -130,7 +130,7 @@ class UsBankAccount(StripeObject): @classmethod def _cls_cancel( - cls, topup: str, **params: Unpack["TopupCancelParams"] + cls, topup: str, /, **params: Unpack["TopupCancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. @@ -146,7 +146,9 @@ def _cls_cancel( @overload @staticmethod - def cancel(topup: str, **params: Unpack["TopupCancelParams"]) -> "Topup": + def cancel( + topup: str, /, **params: Unpack["TopupCancelParams"] + ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ @@ -160,9 +162,7 @@ def cancel(self, **params: Unpack["TopupCancelParams"]) -> "Topup": ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["TopupCancelParams"] - ) -> "Topup": + def cancel(self, **params: Unpack["TopupCancelParams"]) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ @@ -179,7 +179,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, topup: str, **params: Unpack["TopupCancelParams"] + cls, topup: str, /, **params: Unpack["TopupCancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. @@ -196,7 +196,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - topup: str, **params: Unpack["TopupCancelParams"] + topup: str, /, **params: Unpack["TopupCancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. @@ -213,7 +213,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["TopupCancelParams"] ) -> "Topup": """ @@ -299,7 +299,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["TopupModifyParams"]) -> "Topup": + def modify( + cls, id: str, /, **params: Unpack["TopupModifyParams"] + ) -> "Topup": """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ @@ -315,7 +317,7 @@ def modify(cls, id: str, **params: Unpack["TopupModifyParams"]) -> "Topup": @classmethod async def modify_async( - cls, id: str, **params: Unpack["TopupModifyParams"] + cls, id: str, /, **params: Unpack["TopupModifyParams"] ) -> "Topup": """ Updates the metadata of a top-up. Other top-up details are not editable by design. diff --git a/stripe/_topup_service.py b/stripe/_topup_service.py index 0f8b849fa..652cb0207 100644 --- a/stripe/_topup_service.py +++ b/stripe/_topup_service.py @@ -96,6 +96,7 @@ async def create_async( def retrieve( self, topup: str, + /, params: Optional["TopupRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": @@ -116,6 +117,7 @@ def retrieve( async def retrieve_async( self, topup: str, + /, params: Optional["TopupRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": @@ -136,6 +138,7 @@ async def retrieve_async( def update( self, topup: str, + /, params: Optional["TopupUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": @@ -156,6 +159,7 @@ def update( async def update_async( self, topup: str, + /, params: Optional["TopupUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": @@ -176,6 +180,7 @@ async def update_async( def cancel( self, topup: str, + /, params: Optional["TopupCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": @@ -196,6 +201,7 @@ def cancel( async def cancel_async( self, topup: str, + /, params: Optional["TopupCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Topup": diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 8c8f411d9..d4552d94e 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -15,7 +15,7 @@ from stripe._account import Account from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge - from stripe._reversal import Reversal + from stripe._transfer_reversal import TransferReversal from stripe.params._transfer_create_params import TransferCreateParams from stripe.params._transfer_create_reversal_params import ( TransferCreateReversalParams, @@ -46,7 +46,7 @@ class Transfer( Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a card or bank account. This behavior has since been split - out into a [Payout](https://api.stripe.com#payout_object) object, with corresponding payout endpoints. For more + out into a [Payout](https://docs.stripe.com/api#payout_object) object, with corresponding payout endpoints. For more information, read about the [transfer/payout split](https://docs.stripe.com/transfer-payout-split). @@ -106,7 +106,7 @@ class Transfer( """ String representing the object's type. Objects of the same type share the same value. """ - reversals: ListObject["Reversal"] + reversals: ListObject["TransferReversal"] """ A list of reversals that have been applied to the transfer. """ @@ -199,7 +199,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["TransferModifyParams"] + cls, id: str, /, **params: Unpack["TransferModifyParams"] ) -> "Transfer": """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -218,7 +218,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["TransferModifyParams"] + cls, id: str, /, **params: Unpack["TransferModifyParams"] ) -> "Transfer": """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -259,13 +259,13 @@ async def retrieve_async( @classmethod def list_reversals( - cls, id: str, **params: Unpack["TransferListReversalsParams"] - ) -> ListObject["Reversal"]: + cls, id: str, /, **params: Unpack["TransferListReversalsParams"] + ) -> ListObject["TransferReversal"]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( - ListObject["Reversal"], + ListObject["TransferReversal"], cls._static_request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -275,13 +275,13 @@ def list_reversals( @classmethod async def list_reversals_async( - cls, id: str, **params: Unpack["TransferListReversalsParams"] - ) -> ListObject["Reversal"]: + cls, id: str, /, **params: Unpack["TransferListReversalsParams"] + ) -> ListObject["TransferReversal"]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( - ListObject["Reversal"], + ListObject["TransferReversal"], await cls._static_request_async( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -291,8 +291,8 @@ async def list_reversals_async( @classmethod def create_reversal( - cls, id: str, **params: Unpack["TransferCreateReversalParams"] - ) -> "Reversal": + cls, id: str, /, **params: Unpack["TransferCreateReversalParams"] + ) -> "TransferReversal": """ When you create a new reversal, you must specify a transfer to create it on. @@ -301,7 +301,7 @@ def create_reversal( Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( - "Reversal", + "TransferReversal", cls._static_request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -311,8 +311,8 @@ def create_reversal( @classmethod async def create_reversal_async( - cls, id: str, **params: Unpack["TransferCreateReversalParams"] - ) -> "Reversal": + cls, id: str, /, **params: Unpack["TransferCreateReversalParams"] + ) -> "TransferReversal": """ When you create a new reversal, you must specify a transfer to create it on. @@ -321,7 +321,7 @@ async def create_reversal_async( Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( - "Reversal", + "TransferReversal", await cls._static_request_async( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -334,13 +334,14 @@ def retrieve_reversal( cls, transfer: str, id: str, + /, **params: Unpack["TransferRetrieveReversalParams"], - ) -> "Reversal": + ) -> "TransferReversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( - "Reversal", + "TransferReversal", cls._static_request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -355,13 +356,14 @@ async def retrieve_reversal_async( cls, transfer: str, id: str, + /, **params: Unpack["TransferRetrieveReversalParams"], - ) -> "Reversal": + ) -> "TransferReversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( - "Reversal", + "TransferReversal", await cls._static_request_async( "get", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -376,15 +378,16 @@ def modify_reversal( cls, transfer: str, id: str, + /, **params: Unpack["TransferModifyReversalParams"], - ) -> "Reversal": + ) -> "TransferReversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( - "Reversal", + "TransferReversal", cls._static_request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -399,15 +402,16 @@ async def modify_reversal_async( cls, transfer: str, id: str, + /, **params: Unpack["TransferModifyReversalParams"], - ) -> "Reversal": + ) -> "TransferReversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( - "Reversal", + "TransferReversal", await cls._static_request_async( "post", "/v1/transfers/{transfer}/reversals/{id}".format( diff --git a/stripe/_reversal.py b/stripe/_transfer_reversal.py similarity index 98% rename from stripe/_reversal.py rename to stripe/_transfer_reversal.py index f6a6e5109..2a9dc2566 100644 --- a/stripe/_reversal.py +++ b/stripe/_transfer_reversal.py @@ -13,7 +13,7 @@ from stripe._refund import Refund -class Reversal(UpdateableAPIResource["Reversal"]): +class TransferReversal(UpdateableAPIResource["TransferReversal"]): """ [Stripe Connect](https://docs.stripe.com/connect) platforms can reverse transfers made to a connected account, either entirely or partially, and can also specify whether diff --git a/stripe/_transfer_reversal_service.py b/stripe/_transfer_reversal_service.py index 0d74e0684..c418478f2 100644 --- a/stripe/_transfer_reversal_service.py +++ b/stripe/_transfer_reversal_service.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: from stripe._list_object import ListObject from stripe._request_options import RequestOptions - from stripe._reversal import Reversal + from stripe._transfer_reversal import TransferReversal from stripe.params._transfer_reversal_create_params import ( TransferReversalCreateParams, ) @@ -27,14 +27,15 @@ class TransferReversalService(StripeService): def list( self, id: str, + /, params: Optional["TransferReversalListParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "ListObject[Reversal]": + ) -> "ListObject[TransferReversal]": """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( - "ListObject[Reversal]", + "ListObject[TransferReversal]", self._request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -47,14 +48,15 @@ def list( async def list_async( self, id: str, + /, params: Optional["TransferReversalListParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "ListObject[Reversal]": + ) -> "ListObject[TransferReversal]": """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( - "ListObject[Reversal]", + "ListObject[TransferReversal]", await self._request_async( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -67,9 +69,10 @@ async def list_async( def create( self, id: str, + /, params: Optional["TransferReversalCreateParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ When you create a new reversal, you must specify a transfer to create it on. @@ -78,7 +81,7 @@ def create( Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( - "Reversal", + "TransferReversal", self._request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -91,9 +94,10 @@ def create( async def create_async( self, id: str, + /, params: Optional["TransferReversalCreateParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ When you create a new reversal, you must specify a transfer to create it on. @@ -102,7 +106,7 @@ async def create_async( Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( - "Reversal", + "TransferReversal", await self._request_async( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), @@ -116,14 +120,15 @@ def retrieve( self, transfer: str, id: str, + /, params: Optional["TransferReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( - "Reversal", + "TransferReversal", self._request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -140,14 +145,15 @@ async def retrieve_async( self, transfer: str, id: str, + /, params: Optional["TransferReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( - "Reversal", + "TransferReversal", await self._request_async( "get", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -164,16 +170,17 @@ def update( self, transfer: str, id: str, + /, params: Optional["TransferReversalUpdateParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( - "Reversal", + "TransferReversal", self._request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( @@ -190,16 +197,17 @@ async def update_async( self, transfer: str, id: str, + /, params: Optional["TransferReversalUpdateParams"] = None, options: Optional["RequestOptions"] = None, - ) -> "Reversal": + ) -> "TransferReversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( - "Reversal", + "TransferReversal", await self._request_async( "post", "/v1/transfers/{transfer}/reversals/{id}".format( diff --git a/stripe/_transfer_service.py b/stripe/_transfer_service.py index 4a32fb4f8..281f12470 100644 --- a/stripe/_transfer_service.py +++ b/stripe/_transfer_service.py @@ -125,6 +125,7 @@ async def create_async( def retrieve( self, transfer: str, + /, params: Optional["TransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transfer": @@ -147,6 +148,7 @@ def retrieve( async def retrieve_async( self, transfer: str, + /, params: Optional["TransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transfer": @@ -169,6 +171,7 @@ async def retrieve_async( def update( self, transfer: str, + /, params: Optional["TransferUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transfer": @@ -193,6 +196,7 @@ def update( async def update_async( self, transfer: str, + /, params: Optional["TransferUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transfer": diff --git a/stripe/_v1_services.py b/stripe/_v1_services.py index debe42ef6..9b53dd75a 100644 --- a/stripe/_v1_services.py +++ b/stripe/_v1_services.py @@ -94,6 +94,7 @@ from stripe._tax_service import TaxService from stripe._terminal_service import TerminalService from stripe._test_helpers_service import TestHelpersService + from stripe._three_d_secure_service import ThreeDSecureService from stripe._token_service import TokenService from stripe._topup_service import TopupService from stripe._transfer_service import TransferService @@ -250,6 +251,10 @@ "tax_rates": ["stripe._tax_rate_service", "TaxRateService"], "terminal": ["stripe._terminal_service", "TerminalService"], "test_helpers": ["stripe._test_helpers_service", "TestHelpersService"], + "three_d_secure": [ + "stripe._three_d_secure_service", + "ThreeDSecureService", + ], "tokens": ["stripe._token_service", "TokenService"], "topups": ["stripe._topup_service", "TopupService"], "transfers": ["stripe._transfer_service", "TransferService"], @@ -339,6 +344,7 @@ class V1Services(StripeService): tax_rates: "TaxRateService" terminal: "TerminalService" test_helpers: "TestHelpersService" + three_d_secure: "ThreeDSecureService" tokens: "TokenService" topups: "TopupService" transfers: "TransferService" diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index 3d06acdc2..50daa50e0 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -17,7 +17,6 @@ OrchestratedCommerceService, ) from stripe.v2._signals_service import SignalsService - from stripe.v2._test_helper_service import TestHelperService _subservices = { "billing": ["stripe.v2._billing_service", "BillingService"], @@ -36,7 +35,6 @@ "OrchestratedCommerceService", ], "signals": ["stripe.v2._signals_service", "SignalsService"], - "test_helpers": ["stripe.v2._test_helper_service", "TestHelperService"], } @@ -51,7 +49,6 @@ class V2Services(StripeService): network: "NetworkService" orchestrated_commerce: "OrchestratedCommerceService" signals: "SignalsService" - test_helpers: "TestHelperService" def __init__(self, requestor): super().__init__(requestor) diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 7921cca4b..f5886872f 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -47,7 +47,7 @@ class WebhookEndpoint( OBJECT_NAME: ClassVar[Literal["webhook_endpoint"]] = "webhook_endpoint" api_version: Optional[str] """ - The API version events are rendered as for this webhook endpoint. + The API version that events are rendered as for this webhook endpoint. You can't change this value after you create the endpoint. """ application: Optional[str] """ @@ -132,7 +132,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["WebhookEndpointDeleteParams"] + cls, sid: str, /, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. @@ -150,7 +150,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["WebhookEndpointDeleteParams"] + sid: str, /, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. @@ -167,7 +167,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ @@ -181,7 +181,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["WebhookEndpointDeleteParams"] + cls, sid: str, /, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. @@ -199,7 +199,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["WebhookEndpointDeleteParams"] + sid: str, /, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. @@ -216,7 +216,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["WebhookEndpointDeleteParams"] ) -> "WebhookEndpoint": """ @@ -270,7 +270,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["WebhookEndpointModifyParams"] + cls, id: str, /, **params: Unpack["WebhookEndpointModifyParams"] ) -> "WebhookEndpoint": """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. @@ -287,7 +287,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["WebhookEndpointModifyParams"] + cls, id: str, /, **params: Unpack["WebhookEndpointModifyParams"] ) -> "WebhookEndpoint": """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 22c517185..e54453a90 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -30,6 +30,7 @@ class WebhookEndpointService(StripeService): def delete( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": @@ -52,6 +53,7 @@ def delete( async def delete_async( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": @@ -74,6 +76,7 @@ async def delete_async( def retrieve( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": @@ -96,6 +99,7 @@ def retrieve( async def retrieve_async( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": @@ -118,6 +122,7 @@ async def retrieve_async( def update( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": @@ -140,6 +145,7 @@ def update( async def update_async( self, webhook_endpoint: str, + /, params: Optional["WebhookEndpointUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WebhookEndpoint": diff --git a/stripe/apps/__init__.py b/stripe/apps/__init__.py index f4e11b24d..1d8f2463c 100644 --- a/stripe/apps/__init__.py +++ b/stripe/apps/__init__.py @@ -4,11 +4,15 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.apps._install import Install as Install + from stripe.apps._install_service import InstallService as InstallService from stripe.apps._secret import Secret as Secret from stripe.apps._secret_service import SecretService as SecretService # name -> (import_target, is_submodule) _import_map = { + "Install": ("stripe.apps._install", False), + "InstallService": ("stripe.apps._install_service", False), "Secret": ("stripe.apps._secret", False), "SecretService": ("stripe.apps._secret_service", False), } diff --git a/stripe/apps/_install.py b/stripe/apps/_install.py new file mode 100644 index 000000000..41d2fc2cf --- /dev/null +++ b/stripe/apps/_install.py @@ -0,0 +1,368 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, Union, cast, overload +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.apps._install_create_params import InstallCreateParams + from stripe.params.apps._install_list_params import InstallListParams + from stripe.params.apps._install_modify_params import InstallModifyParams + from stripe.params.apps._install_retrieve_params import ( + InstallRetrieveParams, + ) + from stripe.params.apps._install_uninstall_params import ( + InstallUninstallParams, + ) + + +class Install( + CreateableAPIResource["Install"], + ListableAPIResource["Install"], + UpdateableAPIResource["Install"], +): + """ + An app install represents a Stripe App that is installed on an account. It reports the permissions, + content security policy entries, and endpoints that the installing account has authorized, along with any + that the app's latest version requests but the account has not authorized yet. Use the Install API to + install, reauthorize, and uninstall apps, and to check the state of existing installs. + """ + + OBJECT_NAME: ClassVar[Literal["apps.install"]] = "apps.install" + + class ContentSecurityPolicyGranted(StripeObject): + connect_src: List[str] + """ + The URLs that the app can make network requests to. + """ + image_src: List[str] + """ + The URLs that the app can load images from. + """ + + class ContentSecurityPolicyPending(StripeObject): + connect_src: List[str] + """ + The URLs that the app can make network requests to. + """ + image_src: List[str] + """ + The URLs that the app can load images from. + """ + + account: str + """ + The ID of the account that the app install belongs to. + """ + app: str + """ + The ID of the app installed. + """ + approval_required: bool + """ + Whether the installer must authorize pending permissions, content security policy entries, or endpoints. For private apps, `approval_required` stays `false`; creating or reauthorizing the install through the API installs the newest completed upload and grants its permissions. + """ + auth_code: Optional[str] + """ + The authorization code for an oauth app install. + """ + channel: Union[ + Literal["private_live", "private_test", "public", "review", "testing"], + str, + ] + """ + The distribution channel associated with the app install. + """ + content_security_policy_granted: ContentSecurityPolicyGranted + content_security_policy_pending: ContentSecurityPolicyPending + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + created_by: Optional[str] + """ + The ID of the embedding platform that created the install, if applicable. + """ + endpoints_granted: List[str] + """ + The endpoint URLs authorized by the installer. + """ + endpoints_pending: List[str] + """ + The endpoint URLs requested by the latest app version that the installer has not authorized. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + object: Literal["apps.install"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + permissions_granted: List[str] + """ + The permissions authorized by the installer. + """ + permissions_pending: List[str] + """ + The permissions requested by the latest app version that the installer has not authorized. + """ + status: Union[ + Literal[ + "install_failed", + "installed", + "installing", + "uninstall_failed", + "uninstalling", + ], + str, + ] + """ + The status of the app install. + """ + + @classmethod + def create(cls, **params: Unpack["InstallCreateParams"]) -> "Install": + """ + Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer or embedding platform acting on a connected account through Stripe-Account installs or reinstalls its app there. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned. + """ + return cast( + "Install", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["InstallCreateParams"] + ) -> "Install": + """ + Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer or embedding platform acting on a connected account through Stripe-Account installs or reinstalls its app there. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned. + """ + return cast( + "Install", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["InstallListParams"] + ) -> ListObject["Install"]: + """ + Returns a list of app installs. An app developer or embedding platform filtering by its own app sees the installs across the accounts that installed it; other callers see the installs on their own account. The key selects the environment: a live key lists live installs, a sandbox API key lists the installs on that sandbox, and the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox. For existing accounts that still use legacy test mode, a test mode key lists legacy test mode installs. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["InstallListParams"] + ) -> ListObject["Install"]: + """ + Returns a list of app installs. An app developer or embedding platform filtering by its own app sees the installs across the accounts that installed it; other callers see the installs on their own account. The key selects the environment: a live key lists live installs, a sandbox API key lists the installs on that sandbox, and the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox. For existing accounts that still use legacy test mode, a test mode key lists legacy test mode installs. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def modify( + cls, id: str, /, **params: Unpack["InstallModifyParams"] + ) -> "Install": + """ + Reauthorizes an app install. The installer grants the permissions, content security policy entries, and endpoints that the version being installed requests. An account reauthorizes its own installs on any channel with its own key; app developers and embedding platforms reauthorize installs on connected accounts through Stripe-Account. For private apps, the version being installed is the newest completed upload. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Install", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, /, **params: Unpack["InstallModifyParams"] + ) -> "Install": + """ + Reauthorizes an app install. The installer grants the permissions, content security policy entries, and endpoints that the version being installed requests. An account reauthorizes its own installs on any channel with its own key; app developers and embedding platforms reauthorize installs on connected accounts through Stripe-Account. For private apps, the version being installed is the newest completed upload. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "Install", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["InstallRetrieveParams"] + ) -> "Install": + """ + Retrieves an app install. The installing account, the app's developer (with the keys of the account that owns the app or of the app's managed sandbox), and the embedding platform that created the install can retrieve it. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["InstallRetrieveParams"] + ) -> "Install": + """ + Retrieves an app install. The installing account, the app's developer (with the keys of the account that owns the app or of the app's managed sandbox), and the embedding platform that created the install can retrieve it. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_uninstall( + cls, id: str, /, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + cls._static_request( + "post", + "/v1/apps/installs/{id}/uninstall".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + def uninstall( + id: str, /, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + ... + + @overload + def uninstall( + self, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + ... + + @class_method_variant("_cls_uninstall") + def uninstall( + self, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + self._request( + "post", + "/v1/apps/installs/{id}/uninstall".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_uninstall_async( + cls, id: str, /, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + await cls._static_request_async( + "post", + "/v1/apps/installs/{id}/uninstall".format(id=sanitize_id(id)), + params=params, + ), + ) + + @overload + @staticmethod + async def uninstall_async( + id: str, /, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + ... + + @overload + async def uninstall_async( + self, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + ... + + @class_method_variant("_cls_uninstall_async") + async def uninstall_async( + self, **params: Unpack["InstallUninstallParams"] + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + await self._request_async( + "post", + "/v1/apps/installs/{id}/uninstall".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + _inner_class_types = { + "content_security_policy_granted": ContentSecurityPolicyGranted, + "content_security_policy_pending": ContentSecurityPolicyPending, + } diff --git a/stripe/apps/_install_service.py b/stripe/apps/_install_service.py new file mode 100644 index 000000000..bd6740126 --- /dev/null +++ b/stripe/apps/_install_service.py @@ -0,0 +1,224 @@ +# -*- 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._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.apps._install import Install + from stripe.params.apps._install_create_params import InstallCreateParams + from stripe.params.apps._install_list_params import InstallListParams + from stripe.params.apps._install_retrieve_params import ( + InstallRetrieveParams, + ) + from stripe.params.apps._install_uninstall_params import ( + InstallUninstallParams, + ) + from stripe.params.apps._install_update_params import InstallUpdateParams + + +class InstallService(StripeService): + def list( + self, + params: Optional["InstallListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Install]": + """ + Returns a list of app installs. An app developer or embedding platform filtering by its own app sees the installs across the accounts that installed it; other callers see the installs on their own account. The key selects the environment: a live key lists live installs, a sandbox API key lists the installs on that sandbox, and the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox. For existing accounts that still use legacy test mode, a test mode key lists legacy test mode installs. + """ + return cast( + "ListObject[Install]", + self._request( + "get", + "/v1/apps/installs", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["InstallListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Install]": + """ + Returns a list of app installs. An app developer or embedding platform filtering by its own app sees the installs across the accounts that installed it; other callers see the installs on their own account. The key selects the environment: a live key lists live installs, a sandbox API key lists the installs on that sandbox, and the key of an app's managed sandbox filtering by app lists that app's installs across every sandbox. For existing accounts that still use legacy test mode, a test mode key lists legacy test mode installs. + """ + return cast( + "ListObject[Install]", + await self._request_async( + "get", + "/v1/apps/installs", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "InstallCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer or embedding platform acting on a connected account through Stripe-Account installs or reinstalls its app there. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned. + """ + return cast( + "Install", + self._request( + "post", + "/v1/apps/installs", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "InstallCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Creates an app install. An account installs its own private app with its own key; public and testing installs are made from the Dashboard. An app developer or embedding platform acting on a connected account through Stripe-Account installs or reinstalls its app there. For a private app, creating an install installs the newest completed upload; when that version is already installed with nothing pending, the existing install is returned. + """ + return cast( + "Install", + await self._request_async( + "post", + "/v1/apps/installs", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + /, + params: Optional["InstallRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Retrieves an app install. The installing account, the app's developer (with the keys of the account that owns the app or of the app's managed sandbox), and the embedding platform that created the install can retrieve it. + """ + return cast( + "Install", + self._request( + "get", + "/v1/apps/installs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + /, + params: Optional["InstallRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Retrieves an app install. The installing account, the app's developer (with the keys of the account that owns the app or of the app's managed sandbox), and the embedding platform that created the install can retrieve it. + """ + return cast( + "Install", + await self._request_async( + "get", + "/v1/apps/installs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + /, + params: Optional["InstallUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Reauthorizes an app install. The installer grants the permissions, content security policy entries, and endpoints that the version being installed requests. An account reauthorizes its own installs on any channel with its own key; app developers and embedding platforms reauthorize installs on connected accounts through Stripe-Account. For private apps, the version being installed is the newest completed upload. + """ + return cast( + "Install", + self._request( + "post", + "/v1/apps/installs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + /, + params: Optional["InstallUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Reauthorizes an app install. The installer grants the permissions, content security policy entries, and endpoints that the version being installed requests. An account reauthorizes its own installs on any channel with its own key; app developers and embedding platforms reauthorize installs on connected accounts through Stripe-Account. For private apps, the version being installed is the newest completed upload. + """ + return cast( + "Install", + await self._request_async( + "post", + "/v1/apps/installs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def uninstall( + self, + id: str, + /, + params: Optional["InstallUninstallParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + self._request( + "post", + "/v1/apps/installs/{id}/uninstall".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def uninstall_async( + self, + id: str, + /, + params: Optional["InstallUninstallParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Install": + """ + Uninstalls an app from the account that installed it. + """ + return cast( + "Install", + await self._request_async( + "post", + "/v1/apps/installs/{id}/uninstall".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index c123e4ee2..2f79108f8 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -90,7 +90,7 @@ class Filter(StripeObject): @classmethod def _cls_activate( - cls, id: str, **params: Unpack["AlertActivateParams"] + cls, id: str, /, **params: Unpack["AlertActivateParams"] ) -> "Alert": """ Reactivates this alert, allowing it to trigger again. @@ -106,7 +106,9 @@ def _cls_activate( @overload @staticmethod - def activate(id: str, **params: Unpack["AlertActivateParams"]) -> "Alert": + def activate( + id: str, /, **params: Unpack["AlertActivateParams"] + ) -> "Alert": """ Reactivates this alert, allowing it to trigger again. """ @@ -120,9 +122,7 @@ def activate(self, **params: Unpack["AlertActivateParams"]) -> "Alert": ... @class_method_variant("_cls_activate") - def activate( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AlertActivateParams"] - ) -> "Alert": + def activate(self, **params: Unpack["AlertActivateParams"]) -> "Alert": """ Reactivates this alert, allowing it to trigger again. """ @@ -139,7 +139,7 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_activate_async( - cls, id: str, **params: Unpack["AlertActivateParams"] + cls, id: str, /, **params: Unpack["AlertActivateParams"] ) -> "Alert": """ Reactivates this alert, allowing it to trigger again. @@ -156,7 +156,7 @@ async def _cls_activate_async( @overload @staticmethod async def activate_async( - id: str, **params: Unpack["AlertActivateParams"] + id: str, /, **params: Unpack["AlertActivateParams"] ) -> "Alert": """ Reactivates this alert, allowing it to trigger again. @@ -173,7 +173,7 @@ async def activate_async( ... @class_method_variant("_cls_activate_async") - async def activate_async( # pyright: ignore[reportGeneralTypeIssues] + async def activate_async( self, **params: Unpack["AlertActivateParams"] ) -> "Alert": """ @@ -192,7 +192,7 @@ async def activate_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_archive( - cls, id: str, **params: Unpack["AlertArchiveParams"] + cls, id: str, /, **params: Unpack["AlertArchiveParams"] ) -> "Alert": """ Archives this alert, removing it from the list view and APIs. This is non-reversible. @@ -208,7 +208,7 @@ def _cls_archive( @overload @staticmethod - def archive(id: str, **params: Unpack["AlertArchiveParams"]) -> "Alert": + def archive(id: str, /, **params: Unpack["AlertArchiveParams"]) -> "Alert": """ Archives this alert, removing it from the list view and APIs. This is non-reversible. """ @@ -222,9 +222,7 @@ def archive(self, **params: Unpack["AlertArchiveParams"]) -> "Alert": ... @class_method_variant("_cls_archive") - def archive( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AlertArchiveParams"] - ) -> "Alert": + def archive(self, **params: Unpack["AlertArchiveParams"]) -> "Alert": """ Archives this alert, removing it from the list view and APIs. This is non-reversible. """ @@ -241,7 +239,7 @@ def archive( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_archive_async( - cls, id: str, **params: Unpack["AlertArchiveParams"] + cls, id: str, /, **params: Unpack["AlertArchiveParams"] ) -> "Alert": """ Archives this alert, removing it from the list view and APIs. This is non-reversible. @@ -258,7 +256,7 @@ async def _cls_archive_async( @overload @staticmethod async def archive_async( - id: str, **params: Unpack["AlertArchiveParams"] + id: str, /, **params: Unpack["AlertArchiveParams"] ) -> "Alert": """ Archives this alert, removing it from the list view and APIs. This is non-reversible. @@ -275,7 +273,7 @@ async def archive_async( ... @class_method_variant("_cls_archive_async") - async def archive_async( # pyright: ignore[reportGeneralTypeIssues] + async def archive_async( self, **params: Unpack["AlertArchiveParams"] ) -> "Alert": """ @@ -324,7 +322,7 @@ async def create_async( @classmethod def _cls_deactivate( - cls, id: str, **params: Unpack["AlertDeactivateParams"] + cls, id: str, /, **params: Unpack["AlertDeactivateParams"] ) -> "Alert": """ Deactivates this alert, preventing it from triggering. @@ -343,7 +341,7 @@ def _cls_deactivate( @overload @staticmethod def deactivate( - id: str, **params: Unpack["AlertDeactivateParams"] + id: str, /, **params: Unpack["AlertDeactivateParams"] ) -> "Alert": """ Deactivates this alert, preventing it from triggering. @@ -358,9 +356,7 @@ def deactivate(self, **params: Unpack["AlertDeactivateParams"]) -> "Alert": ... @class_method_variant("_cls_deactivate") - def deactivate( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["AlertDeactivateParams"] - ) -> "Alert": + def deactivate(self, **params: Unpack["AlertDeactivateParams"]) -> "Alert": """ Deactivates this alert, preventing it from triggering. """ @@ -377,7 +373,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_deactivate_async( - cls, id: str, **params: Unpack["AlertDeactivateParams"] + cls, id: str, /, **params: Unpack["AlertDeactivateParams"] ) -> "Alert": """ Deactivates this alert, preventing it from triggering. @@ -396,7 +392,7 @@ async def _cls_deactivate_async( @overload @staticmethod async def deactivate_async( - id: str, **params: Unpack["AlertDeactivateParams"] + id: str, /, **params: Unpack["AlertDeactivateParams"] ) -> "Alert": """ Deactivates this alert, preventing it from triggering. @@ -413,7 +409,7 @@ async def deactivate_async( ... @class_method_variant("_cls_deactivate_async") - async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + async def deactivate_async( self, **params: Unpack["AlertDeactivateParams"] ) -> "Alert": """ diff --git a/stripe/billing/_alert_service.py b/stripe/billing/_alert_service.py index 88840dc2d..5a683dc73 100644 --- a/stripe/billing/_alert_service.py +++ b/stripe/billing/_alert_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["AlertRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -123,6 +124,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AlertRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -143,6 +145,7 @@ async def retrieve_async( def activate( self, id: str, + /, params: Optional["AlertActivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -163,6 +166,7 @@ def activate( async def activate_async( self, id: str, + /, params: Optional["AlertActivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -183,6 +187,7 @@ async def activate_async( def archive( self, id: str, + /, params: Optional["AlertArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -203,6 +208,7 @@ def archive( async def archive_async( self, id: str, + /, params: Optional["AlertArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -223,6 +229,7 @@ async def archive_async( def deactivate( self, id: str, + /, params: Optional["AlertDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": @@ -245,6 +252,7 @@ def deactivate( async def deactivate_async( self, id: str, + /, params: Optional["AlertDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Alert": diff --git a/stripe/billing/_credit_balance_transaction_service.py b/stripe/billing/_credit_balance_transaction_service.py index 52f511b49..5e36f3430 100644 --- a/stripe/billing/_credit_balance_transaction_service.py +++ b/stripe/billing/_credit_balance_transaction_service.py @@ -61,6 +61,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["CreditBalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditBalanceTransaction": @@ -83,6 +84,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["CreditBalanceTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditBalanceTransaction": diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 7795584ed..cc192279c 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -187,7 +187,7 @@ async def create_async( @classmethod def _cls_expire( - cls, id: str, **params: Unpack["CreditGrantExpireParams"] + cls, id: str, /, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ Expires a credit grant. @@ -206,7 +206,7 @@ def _cls_expire( @overload @staticmethod def expire( - id: str, **params: Unpack["CreditGrantExpireParams"] + id: str, /, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ Expires a credit grant. @@ -223,7 +223,7 @@ def expire( ... @class_method_variant("_cls_expire") - def expire( # pyright: ignore[reportGeneralTypeIssues] + def expire( self, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ @@ -242,7 +242,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_expire_async( - cls, id: str, **params: Unpack["CreditGrantExpireParams"] + cls, id: str, /, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ Expires a credit grant. @@ -261,7 +261,7 @@ async def _cls_expire_async( @overload @staticmethod async def expire_async( - id: str, **params: Unpack["CreditGrantExpireParams"] + id: str, /, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ Expires a credit grant. @@ -278,7 +278,7 @@ async def expire_async( ... @class_method_variant("_cls_expire_async") - async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + async def expire_async( self, **params: Unpack["CreditGrantExpireParams"] ) -> "CreditGrant": """ @@ -337,7 +337,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["CreditGrantModifyParams"] + cls, id: str, /, **params: Unpack["CreditGrantModifyParams"] ) -> "CreditGrant": """ Updates a credit grant. @@ -354,7 +354,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["CreditGrantModifyParams"] + cls, id: str, /, **params: Unpack["CreditGrantModifyParams"] ) -> "CreditGrant": """ Updates a credit grant. @@ -393,7 +393,7 @@ async def retrieve_async( @classmethod def _cls_void_grant( - cls, id: str, **params: Unpack["CreditGrantVoidGrantParams"] + cls, id: str, /, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ Voids a credit grant. @@ -412,7 +412,7 @@ def _cls_void_grant( @overload @staticmethod def void_grant( - id: str, **params: Unpack["CreditGrantVoidGrantParams"] + id: str, /, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ Voids a credit grant. @@ -429,7 +429,7 @@ def void_grant( ... @class_method_variant("_cls_void_grant") - def void_grant( # pyright: ignore[reportGeneralTypeIssues] + def void_grant( self, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ @@ -448,7 +448,7 @@ def void_grant( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_void_grant_async( - cls, id: str, **params: Unpack["CreditGrantVoidGrantParams"] + cls, id: str, /, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ Voids a credit grant. @@ -467,7 +467,7 @@ async def _cls_void_grant_async( @overload @staticmethod async def void_grant_async( - id: str, **params: Unpack["CreditGrantVoidGrantParams"] + id: str, /, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ Voids a credit grant. @@ -484,7 +484,7 @@ async def void_grant_async( ... @class_method_variant("_cls_void_grant_async") - async def void_grant_async( # pyright: ignore[reportGeneralTypeIssues] + async def void_grant_async( self, **params: Unpack["CreditGrantVoidGrantParams"] ) -> "CreditGrant": """ diff --git a/stripe/billing/_credit_grant_service.py b/stripe/billing/_credit_grant_service.py index 047cf0f57..4a84f4b0e 100644 --- a/stripe/billing/_credit_grant_service.py +++ b/stripe/billing/_credit_grant_service.py @@ -109,6 +109,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["CreditGrantRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -129,6 +130,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["CreditGrantRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -149,6 +151,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["CreditGrantUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -169,6 +172,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["CreditGrantUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -189,6 +193,7 @@ async def update_async( def expire( self, id: str, + /, params: Optional["CreditGrantExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -211,6 +216,7 @@ def expire( async def expire_async( self, id: str, + /, params: Optional["CreditGrantExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -233,6 +239,7 @@ async def expire_async( def void_grant( self, id: str, + /, params: Optional["CreditGrantVoidGrantParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": @@ -255,6 +262,7 @@ def void_grant( async def void_grant_async( self, id: str, + /, params: Optional["CreditGrantVoidGrantParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditGrant": diff --git a/stripe/billing/_feedback_option.py b/stripe/billing/_feedback_option.py index c1b1da92c..bea3b6b8d 100644 --- a/stripe/billing/_feedback_option.py +++ b/stripe/billing/_feedback_option.py @@ -33,7 +33,11 @@ class FeedbackOption( UpdateableAPIResource["FeedbackOption"], ): """ - A resource for the feedback options model (for custom cancellation reasons) + A feedback option is a reason you can present to customers when they cancel a + subscription through the customer portal. Configure the set of options a customer + can choose from on a [portal configuration](https://docs.stripe.com/api/customer_portal/configuration). + + Related guide: [Customer management](https://docs.stripe.com/customer-management) """ OBJECT_NAME: ClassVar[Literal["billing.feedback_option"]] = ( @@ -102,7 +106,7 @@ async def create_async( @classmethod def _cls_deactivate( - cls, id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + cls, id: str, /, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. @@ -121,7 +125,7 @@ def _cls_deactivate( @overload @staticmethod def deactivate( - id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + id: str, /, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. @@ -138,7 +142,7 @@ def deactivate( ... @class_method_variant("_cls_deactivate") - def deactivate( # pyright: ignore[reportGeneralTypeIssues] + def deactivate( self, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ @@ -157,7 +161,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_deactivate_async( - cls, id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + cls, id: str, /, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. @@ -176,7 +180,7 @@ async def _cls_deactivate_async( @overload @staticmethod async def deactivate_async( - id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + id: str, /, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. @@ -193,7 +197,7 @@ async def deactivate_async( ... @class_method_variant("_cls_deactivate_async") - async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + async def deactivate_async( self, **params: Unpack["FeedbackOptionDeactivateParams"] ) -> "FeedbackOption": """ @@ -215,7 +219,7 @@ def list( cls, **params: Unpack["FeedbackOptionListParams"] ) -> ListObject["FeedbackOption"]: """ - An API method for listing the feedback options model + Returns a list of your feedback options. """ result = cls._static_request( "get", @@ -235,7 +239,7 @@ async def list_async( cls, **params: Unpack["FeedbackOptionListParams"] ) -> ListObject["FeedbackOption"]: """ - An API method for listing the feedback options model + Returns a list of your feedback options. """ result = await cls._static_request_async( "get", @@ -252,7 +256,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["FeedbackOptionModifyParams"] + cls, id: str, /, **params: Unpack["FeedbackOptionModifyParams"] ) -> "FeedbackOption": """ Updates the description of an existing feedback option. @@ -269,7 +273,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["FeedbackOptionModifyParams"] + cls, id: str, /, **params: Unpack["FeedbackOptionModifyParams"] ) -> "FeedbackOption": """ Updates the description of an existing feedback option. @@ -289,7 +293,7 @@ def retrieve( cls, id: str, **params: Unpack["FeedbackOptionRetrieveParams"] ) -> "FeedbackOption": """ - Retrieves a feedback options object given an ID. + Retrieves a feedback option object given an ID. """ instance = cls(id, **params) instance.refresh() @@ -300,7 +304,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["FeedbackOptionRetrieveParams"] ) -> "FeedbackOption": """ - Retrieves a feedback options object given an ID. + Retrieves a feedback option object given an ID. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/billing/_feedback_option_service.py b/stripe/billing/_feedback_option_service.py index e8560ac3e..ca375169d 100644 --- a/stripe/billing/_feedback_option_service.py +++ b/stripe/billing/_feedback_option_service.py @@ -33,7 +33,7 @@ def list( options: Optional["RequestOptions"] = None, ) -> "ListObject[FeedbackOption]": """ - An API method for listing the feedback options model + Returns a list of your feedback options. """ return cast( "ListObject[FeedbackOption]", @@ -52,7 +52,7 @@ async def list_async( options: Optional["RequestOptions"] = None, ) -> "ListObject[FeedbackOption]": """ - An API method for listing the feedback options model + Returns a list of your feedback options. """ return cast( "ListObject[FeedbackOption]", @@ -106,11 +106,12 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["FeedbackOptionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": """ - Retrieves a feedback options object given an ID. + Retrieves a feedback option object given an ID. """ return cast( "FeedbackOption", @@ -126,11 +127,12 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FeedbackOptionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": """ - Retrieves a feedback options object given an ID. + Retrieves a feedback option object given an ID. """ return cast( "FeedbackOption", @@ -146,6 +148,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["FeedbackOptionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": @@ -166,6 +169,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["FeedbackOptionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": @@ -186,6 +190,7 @@ async def update_async( def deactivate( self, id: str, + /, params: Optional["FeedbackOptionDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": @@ -208,6 +213,7 @@ def deactivate( async def deactivate_async( self, id: str, + /, params: Optional["FeedbackOptionDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FeedbackOption": diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 4f27637b2..48c597e6c 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -144,7 +144,7 @@ async def create_async( @classmethod def _cls_deactivate( - cls, id: str, **params: Unpack["MeterDeactivateParams"] + cls, id: str, /, **params: Unpack["MeterDeactivateParams"] ) -> "Meter": """ When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. @@ -163,7 +163,7 @@ def _cls_deactivate( @overload @staticmethod def deactivate( - id: str, **params: Unpack["MeterDeactivateParams"] + id: str, /, **params: Unpack["MeterDeactivateParams"] ) -> "Meter": """ When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. @@ -178,9 +178,7 @@ def deactivate(self, **params: Unpack["MeterDeactivateParams"]) -> "Meter": ... @class_method_variant("_cls_deactivate") - def deactivate( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["MeterDeactivateParams"] - ) -> "Meter": + def deactivate(self, **params: Unpack["MeterDeactivateParams"]) -> "Meter": """ When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. """ @@ -197,7 +195,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_deactivate_async( - cls, id: str, **params: Unpack["MeterDeactivateParams"] + cls, id: str, /, **params: Unpack["MeterDeactivateParams"] ) -> "Meter": """ When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. @@ -216,7 +214,7 @@ async def _cls_deactivate_async( @overload @staticmethod async def deactivate_async( - id: str, **params: Unpack["MeterDeactivateParams"] + id: str, /, **params: Unpack["MeterDeactivateParams"] ) -> "Meter": """ When a meter is deactivated, no more meter events will be accepted for this meter. You can't attach a deactivated meter to a price. @@ -233,7 +231,7 @@ async def deactivate_async( ... @class_method_variant("_cls_deactivate_async") - async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + async def deactivate_async( self, **params: Unpack["MeterDeactivateParams"] ) -> "Meter": """ @@ -289,7 +287,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["MeterModifyParams"]) -> "Meter": + def modify( + cls, id: str, /, **params: Unpack["MeterModifyParams"] + ) -> "Meter": """ Updates a billing meter. """ @@ -305,7 +305,7 @@ def modify(cls, id: str, **params: Unpack["MeterModifyParams"]) -> "Meter": @classmethod async def modify_async( - cls, id: str, **params: Unpack["MeterModifyParams"] + cls, id: str, /, **params: Unpack["MeterModifyParams"] ) -> "Meter": """ Updates a billing meter. @@ -322,7 +322,7 @@ async def modify_async( @classmethod def _cls_reactivate( - cls, id: str, **params: Unpack["MeterReactivateParams"] + cls, id: str, /, **params: Unpack["MeterReactivateParams"] ) -> "Meter": """ When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. @@ -341,7 +341,7 @@ def _cls_reactivate( @overload @staticmethod def reactivate( - id: str, **params: Unpack["MeterReactivateParams"] + id: str, /, **params: Unpack["MeterReactivateParams"] ) -> "Meter": """ When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. @@ -356,9 +356,7 @@ def reactivate(self, **params: Unpack["MeterReactivateParams"]) -> "Meter": ... @class_method_variant("_cls_reactivate") - def reactivate( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["MeterReactivateParams"] - ) -> "Meter": + def reactivate(self, **params: Unpack["MeterReactivateParams"]) -> "Meter": """ When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. """ @@ -375,7 +373,7 @@ def reactivate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_reactivate_async( - cls, id: str, **params: Unpack["MeterReactivateParams"] + cls, id: str, /, **params: Unpack["MeterReactivateParams"] ) -> "Meter": """ When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. @@ -394,7 +392,7 @@ async def _cls_reactivate_async( @overload @staticmethod async def reactivate_async( - id: str, **params: Unpack["MeterReactivateParams"] + id: str, /, **params: Unpack["MeterReactivateParams"] ) -> "Meter": """ When a meter is reactivated, events for this meter can be accepted and you can attach the meter to a price. @@ -411,7 +409,7 @@ async def reactivate_async( ... @class_method_variant("_cls_reactivate_async") - async def reactivate_async( # pyright: ignore[reportGeneralTypeIssues] + async def reactivate_async( self, **params: Unpack["MeterReactivateParams"] ) -> "Meter": """ @@ -452,7 +450,7 @@ async def retrieve_async( @classmethod def list_event_summaries( - cls, id: str, **params: Unpack["MeterListEventSummariesParams"] + cls, id: str, /, **params: Unpack["MeterListEventSummariesParams"] ) -> ListObject["MeterEventSummary"]: """ Retrieve a list of billing meter event summaries. @@ -470,7 +468,7 @@ def list_event_summaries( @classmethod async def list_event_summaries_async( - cls, id: str, **params: Unpack["MeterListEventSummariesParams"] + cls, id: str, /, **params: Unpack["MeterListEventSummariesParams"] ) -> ListObject["MeterEventSummary"]: """ Retrieve a list of billing meter event summaries. diff --git a/stripe/billing/_meter_event_summary_service.py b/stripe/billing/_meter_event_summary_service.py index 3cc196d0e..b12857c03 100644 --- a/stripe/billing/_meter_event_summary_service.py +++ b/stripe/billing/_meter_event_summary_service.py @@ -18,6 +18,7 @@ class MeterEventSummaryService(StripeService): def list( self, id: str, + /, params: "MeterEventSummaryListParams", options: Optional["RequestOptions"] = None, ) -> "ListObject[MeterEventSummary]": @@ -40,6 +41,7 @@ def list( async def list_async( self, id: str, + /, params: "MeterEventSummaryListParams", options: Optional["RequestOptions"] = None, ) -> "ListObject[MeterEventSummary]": diff --git a/stripe/billing/_meter_service.py b/stripe/billing/_meter_service.py index 018b4ff73..7ac2efc5d 100644 --- a/stripe/billing/_meter_service.py +++ b/stripe/billing/_meter_service.py @@ -135,6 +135,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["MeterRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -155,6 +156,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["MeterRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -175,6 +177,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["MeterUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -195,6 +198,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["MeterUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -215,6 +219,7 @@ async def update_async( def deactivate( self, id: str, + /, params: Optional["MeterDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -237,6 +242,7 @@ def deactivate( async def deactivate_async( self, id: str, + /, params: Optional["MeterDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -259,6 +265,7 @@ async def deactivate_async( def reactivate( self, id: str, + /, params: Optional["MeterReactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": @@ -281,6 +288,7 @@ def reactivate( async def reactivate_async( self, id: str, + /, params: Optional["MeterReactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Meter": diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index af85f62e6..201d3f630 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -373,7 +373,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ConfigurationModifyParams"] + cls, id: str, /, **params: Unpack["ConfigurationModifyParams"] ) -> "Configuration": """ Updates a configuration that describes the functionality of the customer portal. @@ -390,7 +390,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ConfigurationModifyParams"] + cls, id: str, /, **params: Unpack["ConfigurationModifyParams"] ) -> "Configuration": """ Updates a configuration that describes the functionality of the customer portal. diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index ba9084e70..84f33f6cd 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, configuration: str, + /, params: Optional["ConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, configuration: str, + /, params: Optional["ConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -147,6 +149,7 @@ async def retrieve_async( def update( self, configuration: str, + /, params: Optional["ConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -169,6 +172,7 @@ def update( async def update_async( self, configuration: str, + /, params: Optional["ConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 57c69dd94..8ba7ed951 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -35,6 +35,23 @@ class Session(CreateableAPIResource["Session"]): "billing_portal.session" ) + class AfterExpiration(StripeObject): + class CustomerLogin(StripeObject): + expires_at: Optional[int] + """ + The time after which the customer can no longer recover this session. + """ + + customer_login: Optional[CustomerLogin] + """ + Configuration for authenticating the customer after the session expires. + """ + type: Union[Literal["customer_login"], str] + """ + The behavior to apply when the session expires. + """ + _inner_class_types = {"customer_login": CustomerLogin} + class Flow(StripeObject): class AfterCompletion(StripeObject): class HostedConfirmation(StripeObject): @@ -183,6 +200,10 @@ class Item(StripeObject): "subscription_update_confirm": SubscriptionUpdateConfirm, } + after_expiration: Optional[AfterExpiration] + """ + Behavior after the portal session expires. + """ configuration: ExpandableField["Configuration"] """ The configuration used by this session, describing the features available. @@ -315,4 +336,4 @@ async def create_async( ), ) - _inner_class_types = {"flow": Flow} + _inner_class_types = {"after_expiration": AfterExpiration, "flow": Flow} diff --git a/stripe/capital/_financing_offer.py b/stripe/capital/_financing_offer.py index ebe816061..d02ef9fa6 100644 --- a/stripe/capital/_financing_offer.py +++ b/stripe/capital/_financing_offer.py @@ -112,6 +112,7 @@ class OfferedTerms(StripeObject): Literal[ "celtic_us_loan", "fundbox_au_financing", + "fundbox_ca_financing", "youlend_de_financing", "youlend_fr_financing", "youlend_uk_mca", @@ -234,6 +235,7 @@ async def list_async( def _cls_mark_delivered( cls, financing_offer: str, + /, **params: Unpack["FinancingOfferMarkDeliveredParams"], ) -> "FinancingOffer": """ @@ -255,6 +257,7 @@ def _cls_mark_delivered( @staticmethod def mark_delivered( financing_offer: str, + /, **params: Unpack["FinancingOfferMarkDeliveredParams"], ) -> "FinancingOffer": """ @@ -274,7 +277,7 @@ def mark_delivered( ... @class_method_variant("_cls_mark_delivered") - def mark_delivered( # pyright: ignore[reportGeneralTypeIssues] + def mark_delivered( self, **params: Unpack["FinancingOfferMarkDeliveredParams"] ) -> "FinancingOffer": """ @@ -296,6 +299,7 @@ def mark_delivered( # pyright: ignore[reportGeneralTypeIssues] async def _cls_mark_delivered_async( cls, financing_offer: str, + /, **params: Unpack["FinancingOfferMarkDeliveredParams"], ) -> "FinancingOffer": """ @@ -317,6 +321,7 @@ async def _cls_mark_delivered_async( @staticmethod async def mark_delivered_async( financing_offer: str, + /, **params: Unpack["FinancingOfferMarkDeliveredParams"], ) -> "FinancingOffer": """ @@ -336,7 +341,7 @@ async def mark_delivered_async( ... @class_method_variant("_cls_mark_delivered_async") - async def mark_delivered_async( # pyright: ignore[reportGeneralTypeIssues] + async def mark_delivered_async( self, **params: Unpack["FinancingOfferMarkDeliveredParams"] ) -> "FinancingOffer": """ diff --git a/stripe/capital/_financing_offer_service.py b/stripe/capital/_financing_offer_service.py index cdf5e08aa..4d546ed56 100644 --- a/stripe/capital/_financing_offer_service.py +++ b/stripe/capital/_financing_offer_service.py @@ -62,6 +62,7 @@ async def list_async( def retrieve( self, financing_offer: str, + /, params: Optional["FinancingOfferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingOffer": @@ -84,6 +85,7 @@ def retrieve( async def retrieve_async( self, financing_offer: str, + /, params: Optional["FinancingOfferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingOffer": @@ -106,6 +108,7 @@ async def retrieve_async( def mark_delivered( self, financing_offer: str, + /, params: Optional["FinancingOfferMarkDeliveredParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingOffer": @@ -129,6 +132,7 @@ def mark_delivered( async def mark_delivered_async( self, financing_offer: str, + /, params: Optional["FinancingOfferMarkDeliveredParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingOffer": diff --git a/stripe/capital/_financing_summary.py b/stripe/capital/_financing_summary.py index b653bc214..30c5fe854 100644 --- a/stripe/capital/_financing_summary.py +++ b/stripe/capital/_financing_summary.py @@ -13,9 +13,7 @@ class FinancingSummary(SingletonAPIResource["FinancingSummary"]): """ - A financing summary object describes a connected account's financing status in real time. - A financing status is either `accepted`, `delivered`, or `none`. - You can read the status of your connected accounts. + A financing summary object describes a connected account's financing details in real time. """ OBJECT_NAME: ClassVar[Literal["capital.financing_summary"]] = ( @@ -59,6 +57,7 @@ class CurrentRepaymentInterval(StripeObject): Literal[ "celtic_us_loan", "fundbox_au_financing", + "fundbox_ca_financing", "youlend_de_financing", "youlend_fr_financing", "youlend_uk_mca", diff --git a/stripe/capital/_financing_transaction_service.py b/stripe/capital/_financing_transaction_service.py index d58480340..d0d6c33b8 100644 --- a/stripe/capital/_financing_transaction_service.py +++ b/stripe/capital/_financing_transaction_service.py @@ -61,6 +61,7 @@ async def list_async( def retrieve( self, financing_transaction: str, + /, params: Optional["FinancingTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingTransaction": @@ -83,6 +84,7 @@ def retrieve( async def retrieve_async( self, financing_transaction: str, + /, params: Optional["FinancingTransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancingTransaction": diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 317ceea07..30fbb1a5b 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -475,7 +475,7 @@ class Option(StripeObject): class Label(StripeObject): custom: Optional[str] """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -1019,7 +1019,7 @@ class AfterpayClearpay(StripeObject): """ class Alipay(StripeObject): - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1097,7 +1097,9 @@ class MandateOptions(StripeObject): _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1812,6 +1814,12 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Sequra(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Sofort(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -1993,7 +2001,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2043,6 +2051,7 @@ class WechatPay(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] sofort: Optional[Sofort] sunbit: Optional[Sunbit] swish: Optional[Swish] @@ -2090,6 +2099,7 @@ class WechatPay(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "sofort": Sofort, "sunbit": Sunbit, "swish": Swish, @@ -2534,7 +2544,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -2628,6 +2638,10 @@ class Link(StripeObject): """ Enables user redeemable promotion codes. """ + allowed_payment_method_types: Optional[List[str]] + """ + A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. + """ amount_subtotal: Optional[int] """ Total of all items before discounts or taxes are applied. @@ -2685,7 +2699,7 @@ class Link(StripeObject): """ custom_fields: List[CustomField] """ - 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`. + 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 `elements`. """ custom_text: CustomText customer: Optional[ExpandableField["Customer"]] @@ -2984,7 +2998,7 @@ async def create_async( @classmethod def _cls_expire( - cls, session: str, **params: Unpack["SessionExpireParams"] + cls, session: str, /, **params: Unpack["SessionExpireParams"] ) -> "Session": """ A Checkout Session can be expired when it is in one of these statuses: open @@ -3005,7 +3019,7 @@ def _cls_expire( @overload @staticmethod def expire( - session: str, **params: Unpack["SessionExpireParams"] + session: str, /, **params: Unpack["SessionExpireParams"] ) -> "Session": """ A Checkout Session can be expired when it is in one of these statuses: open @@ -3024,9 +3038,7 @@ def expire(self, **params: Unpack["SessionExpireParams"]) -> "Session": ... @class_method_variant("_cls_expire") - def expire( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["SessionExpireParams"] - ) -> "Session": + def expire(self, **params: Unpack["SessionExpireParams"]) -> "Session": """ A Checkout Session can be expired when it is in one of these statuses: open @@ -3045,7 +3057,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_expire_async( - cls, session: str, **params: Unpack["SessionExpireParams"] + cls, session: str, /, **params: Unpack["SessionExpireParams"] ) -> "Session": """ A Checkout Session can be expired when it is in one of these statuses: open @@ -3066,7 +3078,7 @@ async def _cls_expire_async( @overload @staticmethod async def expire_async( - session: str, **params: Unpack["SessionExpireParams"] + session: str, /, **params: Unpack["SessionExpireParams"] ) -> "Session": """ A Checkout Session can be expired when it is in one of these statuses: open @@ -3087,7 +3099,7 @@ async def expire_async( ... @class_method_variant("_cls_expire_async") - async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + async def expire_async( self, **params: Unpack["SessionExpireParams"] ) -> "Session": """ @@ -3148,7 +3160,7 @@ async def list_async( @classmethod def _cls_list_line_items( - cls, session: str, **params: Unpack["SessionListLineItemsParams"] + cls, session: str, /, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3167,7 +3179,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - session: str, **params: Unpack["SessionListLineItemsParams"] + session: str, /, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3184,7 +3196,7 @@ def list_line_items( ... @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_line_items( self, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -3203,7 +3215,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_list_line_items_async( - cls, session: str, **params: Unpack["SessionListLineItemsParams"] + cls, session: str, /, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3222,7 +3234,7 @@ async def _cls_list_line_items_async( @overload @staticmethod async def list_line_items_async( - session: str, **params: Unpack["SessionListLineItemsParams"] + session: str, /, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3239,7 +3251,7 @@ async def list_line_items_async( ... @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_line_items_async( self, **params: Unpack["SessionListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -3258,7 +3270,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def modify( - cls, id: str, **params: Unpack["SessionModifyParams"] + cls, id: str, /, **params: Unpack["SessionModifyParams"] ) -> "Session": """ Updates a Checkout Session object. @@ -3277,7 +3289,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["SessionModifyParams"] + cls, id: str, /, **params: Unpack["SessionModifyParams"] ) -> "Session": """ Updates a Checkout Session object. diff --git a/stripe/checkout/_session_line_item_service.py b/stripe/checkout/_session_line_item_service.py index e056ae2ba..4c2855fab 100644 --- a/stripe/checkout/_session_line_item_service.py +++ b/stripe/checkout/_session_line_item_service.py @@ -18,6 +18,7 @@ class SessionLineItemService(StripeService): def list( self, session: str, + /, params: Optional["SessionLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, session: str, + /, params: Optional["SessionLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[LineItem]": diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index db68e1b5f..96664e0af 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -136,6 +136,7 @@ async def create_async( def retrieve( self, session: str, + /, params: Optional["SessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -158,6 +159,7 @@ def retrieve( async def retrieve_async( self, session: str, + /, params: Optional["SessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -180,6 +182,7 @@ async def retrieve_async( def update( self, session: str, + /, params: Optional["SessionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -204,6 +207,7 @@ def update( async def update_async( self, session: str, + /, params: Optional["SessionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -228,6 +232,7 @@ async def update_async( def expire( self, session: str, + /, params: Optional["SessionExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -252,6 +257,7 @@ def expire( async def expire_async( self, session: str, + /, params: Optional["SessionExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 75c5bcc5a..938e072a8 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -181,7 +181,7 @@ class Location(StripeObject): @classmethod def _cls_cancel( - cls, order: str, **params: Unpack["OrderCancelParams"] + cls, order: str, /, **params: Unpack["OrderCancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the @@ -202,7 +202,9 @@ def _cls_cancel( @overload @staticmethod - def cancel(order: str, **params: Unpack["OrderCancelParams"]) -> "Order": + def cancel( + order: str, /, **params: Unpack["OrderCancelParams"] + ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier @@ -222,9 +224,7 @@ def cancel(self, **params: Unpack["OrderCancelParams"]) -> "Order": ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["OrderCancelParams"] - ) -> "Order": + def cancel(self, **params: Unpack["OrderCancelParams"]) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier @@ -244,7 +244,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, order: str, **params: Unpack["OrderCancelParams"] + cls, order: str, /, **params: Unpack["OrderCancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the @@ -266,7 +266,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - order: str, **params: Unpack["OrderCancelParams"] + order: str, /, **params: Unpack["OrderCancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the @@ -289,7 +289,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["OrderCancelParams"] ) -> "Order": """ @@ -382,7 +382,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["OrderModifyParams"]) -> "Order": + def modify( + cls, id: str, /, **params: Unpack["OrderModifyParams"] + ) -> "Order": """ Updates the specified order by setting the values of the parameters passed. """ @@ -398,7 +400,7 @@ def modify(cls, id: str, **params: Unpack["OrderModifyParams"]) -> "Order": @classmethod async def modify_async( - cls, id: str, **params: Unpack["OrderModifyParams"] + cls, id: str, /, **params: Unpack["OrderModifyParams"] ) -> "Order": """ Updates the specified order by setting the values of the parameters passed. diff --git a/stripe/climate/_order_service.py b/stripe/climate/_order_service.py index 0eb3b4859..719c13ad0 100644 --- a/stripe/climate/_order_service.py +++ b/stripe/climate/_order_service.py @@ -102,6 +102,7 @@ async def create_async( def retrieve( self, order: str, + /, params: Optional["OrderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, order: str, + /, params: Optional["OrderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -142,6 +144,7 @@ async def retrieve_async( def update( self, order: str, + /, params: Optional["OrderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -162,6 +165,7 @@ def update( async def update_async( self, order: str, + /, params: Optional["OrderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -182,6 +186,7 @@ async def update_async( def cancel( self, order: str, + /, params: Optional["OrderCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": @@ -207,6 +212,7 @@ def cancel( async def cancel_async( self, order: str, + /, params: Optional["OrderCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Order": diff --git a/stripe/climate/_product_service.py b/stripe/climate/_product_service.py index d58cd419b..fe261feb8 100644 --- a/stripe/climate/_product_service.py +++ b/stripe/climate/_product_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, product: str, + /, params: Optional["ProductRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, product: str, + /, params: Optional["ProductRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Product": diff --git a/stripe/climate/_supplier_service.py b/stripe/climate/_supplier_service.py index f31a10f93..dc4598b90 100644 --- a/stripe/climate/_supplier_service.py +++ b/stripe/climate/_supplier_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, supplier: str, + /, params: Optional["SupplierRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Supplier": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, supplier: str, + /, params: Optional["SupplierRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Supplier": diff --git a/stripe/entitlements/_active_entitlement_service.py b/stripe/entitlements/_active_entitlement_service.py index db359907c..67f407459 100644 --- a/stripe/entitlements/_active_entitlement_service.py +++ b/stripe/entitlements/_active_entitlement_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ActiveEntitlementRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ActiveEntitlement": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ActiveEntitlementRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ActiveEntitlement": diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py index ece2eb797..ee834faf8 100644 --- a/stripe/entitlements/_feature.py +++ b/stripe/entitlements/_feature.py @@ -138,7 +138,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["FeatureModifyParams"] + cls, id: str, /, **params: Unpack["FeatureModifyParams"] ) -> "Feature": """ Update a feature's metadata or permanently deactivate it. @@ -155,7 +155,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["FeatureModifyParams"] + cls, id: str, /, **params: Unpack["FeatureModifyParams"] ) -> "Feature": """ Update a feature's metadata or permanently deactivate it. diff --git a/stripe/entitlements/_feature_service.py b/stripe/entitlements/_feature_service.py index 6844a337e..dfbe7304f 100644 --- a/stripe/entitlements/_feature_service.py +++ b/stripe/entitlements/_feature_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["FeatureRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Feature": @@ -123,6 +124,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FeatureRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Feature": @@ -143,6 +145,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["FeatureUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Feature": @@ -163,6 +166,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["FeatureUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Feature": diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index 41dd825ee..870b71f1f 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -15,6 +15,74 @@ 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_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_balance_settings_updated_event import ( + V1BalanceSettingsUpdatedEvent as V1BalanceSettingsUpdatedEvent, + V1BalanceSettingsUpdatedEventNotification as V1BalanceSettingsUpdatedEventNotification, + ) + from stripe.events._v1_billing_alert_triggered_event import ( + V1BillingAlertTriggeredEvent as V1BillingAlertTriggeredEvent, + V1BillingAlertTriggeredEventNotification as V1BillingAlertTriggeredEventNotification, + ) + from stripe.events._v1_billing_credit_balance_transaction_created_event import ( + V1BillingCreditBalanceTransactionCreatedEvent as V1BillingCreditBalanceTransactionCreatedEvent, + V1BillingCreditBalanceTransactionCreatedEventNotification as V1BillingCreditBalanceTransactionCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_created_event import ( + V1BillingCreditGrantCreatedEvent as V1BillingCreditGrantCreatedEvent, + V1BillingCreditGrantCreatedEventNotification as V1BillingCreditGrantCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_updated_event import ( + V1BillingCreditGrantUpdatedEvent as V1BillingCreditGrantUpdatedEvent, + V1BillingCreditGrantUpdatedEventNotification as V1BillingCreditGrantUpdatedEventNotification, + ) + from stripe.events._v1_billing_meter_created_event import ( + V1BillingMeterCreatedEvent as V1BillingMeterCreatedEvent, + V1BillingMeterCreatedEventNotification as V1BillingMeterCreatedEventNotification, + ) + from stripe.events._v1_billing_meter_deactivated_event import ( + V1BillingMeterDeactivatedEvent as V1BillingMeterDeactivatedEvent, + V1BillingMeterDeactivatedEventNotification as V1BillingMeterDeactivatedEventNotification, + ) from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEvent as V1BillingMeterErrorReportTriggeredEvent, V1BillingMeterErrorReportTriggeredEventNotification as V1BillingMeterErrorReportTriggeredEventNotification, @@ -23,6 +91,802 @@ V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, V1BillingMeterNoMeterFoundEventNotification as V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v1_billing_meter_reactivated_event import ( + V1BillingMeterReactivatedEvent as V1BillingMeterReactivatedEvent, + V1BillingMeterReactivatedEventNotification as V1BillingMeterReactivatedEventNotification, + ) + from stripe.events._v1_billing_meter_updated_event import ( + V1BillingMeterUpdatedEvent as V1BillingMeterUpdatedEvent, + V1BillingMeterUpdatedEventNotification as V1BillingMeterUpdatedEventNotification, + ) + 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_discount_created_event import ( + V1CustomerDiscountCreatedEvent as V1CustomerDiscountCreatedEvent, + V1CustomerDiscountCreatedEventNotification as V1CustomerDiscountCreatedEventNotification, + ) + from stripe.events._v1_customer_discount_deleted_event import ( + V1CustomerDiscountDeletedEvent as V1CustomerDiscountDeletedEvent, + V1CustomerDiscountDeletedEventNotification as V1CustomerDiscountDeletedEventNotification, + ) + from stripe.events._v1_customer_discount_updated_event import ( + V1CustomerDiscountUpdatedEvent as V1CustomerDiscountUpdatedEvent, + V1CustomerDiscountUpdatedEventNotification as V1CustomerDiscountUpdatedEventNotification, + ) + 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_account_numbers_updated_event import ( + V1FinancialConnectionsAccountAccountNumbersUpdatedEvent as V1FinancialConnectionsAccountAccountNumbersUpdatedEvent, + V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification as V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, + ) + 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_expected_deactivation_date_updated_event import ( + V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent as V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent, + V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification as V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, + ) + 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_financial_connections_account_supported_payment_method_types_updated_event import ( + V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent as V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent, + V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification as V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event import ( + V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent as V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent, + V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification as V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_deactivation_event import ( + V1FinancialConnectionsAccountUpcomingDeactivationEvent as V1FinancialConnectionsAccountUpcomingDeactivationEvent, + V1FinancialConnectionsAccountUpcomingDeactivationEventNotification as V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, + ) + 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_attempt_required_event import ( + V1InvoicePaymentAttemptRequiredEvent as V1InvoicePaymentAttemptRequiredEvent, + V1InvoicePaymentAttemptRequiredEventNotification as V1InvoicePaymentAttemptRequiredEventNotification, + ) + 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_commerce_product_catalog_imports_failed_event import ( V2CommerceProductCatalogImportsFailedEvent as V2CommerceProductCatalogImportsFailedEvent, V2CommerceProductCatalogImportsFailedEventNotification as V2CommerceProductCatalogImportsFailedEventNotification, @@ -391,24 +1255,1649 @@ V2SignalsAccountEvaluationCompleteEvent as V2SignalsAccountEvaluationCompleteEvent, V2SignalsAccountEvaluationCompleteEventNotification as V2SignalsAccountEvaluationCompleteEventNotification, ) + from stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event import ( + V2SignalsAccountSignalFraudulentMerchantReadyEvent as V2SignalsAccountSignalFraudulentMerchantReadyEvent, + V2SignalsAccountSignalFraudulentMerchantReadyEventNotification as V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, + ) + from stripe.events._v2_signals_account_signal_fraudulent_website_ready_event import ( + V2SignalsAccountSignalFraudulentWebsiteReadyEvent as V2SignalsAccountSignalFraudulentWebsiteReadyEvent, + V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification as V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification, + ) # name -> (import_target, is_submodule) _import_map = { "ALL_EVENT_NOTIFICATIONS": ("stripe.events._event_classes", False), - "V1BillingMeterErrorReportTriggeredEvent": ( - "stripe.events._v1_billing_meter_error_report_triggered_event", + "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, + ), + "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, + ), + "V1BalanceSettingsUpdatedEvent": ( + "stripe.events._v1_balance_settings_updated_event", + False, + ), + "V1BalanceSettingsUpdatedEventNotification": ( + "stripe.events._v1_balance_settings_updated_event", + False, + ), + "V1BillingAlertTriggeredEvent": ( + "stripe.events._v1_billing_alert_triggered_event", + False, + ), + "V1BillingAlertTriggeredEventNotification": ( + "stripe.events._v1_billing_alert_triggered_event", + False, + ), + "V1BillingCreditBalanceTransactionCreatedEvent": ( + "stripe.events._v1_billing_credit_balance_transaction_created_event", + False, + ), + "V1BillingCreditBalanceTransactionCreatedEventNotification": ( + "stripe.events._v1_billing_credit_balance_transaction_created_event", + False, + ), + "V1BillingCreditGrantCreatedEvent": ( + "stripe.events._v1_billing_credit_grant_created_event", + False, + ), + "V1BillingCreditGrantCreatedEventNotification": ( + "stripe.events._v1_billing_credit_grant_created_event", + False, + ), + "V1BillingCreditGrantUpdatedEvent": ( + "stripe.events._v1_billing_credit_grant_updated_event", + False, + ), + "V1BillingCreditGrantUpdatedEventNotification": ( + "stripe.events._v1_billing_credit_grant_updated_event", + False, + ), + "V1BillingMeterCreatedEvent": ( + "stripe.events._v1_billing_meter_created_event", + False, + ), + "V1BillingMeterCreatedEventNotification": ( + "stripe.events._v1_billing_meter_created_event", + False, + ), + "V1BillingMeterDeactivatedEvent": ( + "stripe.events._v1_billing_meter_deactivated_event", + False, + ), + "V1BillingMeterDeactivatedEventNotification": ( + "stripe.events._v1_billing_meter_deactivated_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, + ), + "V1BillingMeterReactivatedEvent": ( + "stripe.events._v1_billing_meter_reactivated_event", + False, + ), + "V1BillingMeterReactivatedEventNotification": ( + "stripe.events._v1_billing_meter_reactivated_event", + False, + ), + "V1BillingMeterUpdatedEvent": ( + "stripe.events._v1_billing_meter_updated_event", + False, + ), + "V1BillingMeterUpdatedEventNotification": ( + "stripe.events._v1_billing_meter_updated_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, + ), + "V1CustomerDiscountCreatedEvent": ( + "stripe.events._v1_customer_discount_created_event", + False, + ), + "V1CustomerDiscountCreatedEventNotification": ( + "stripe.events._v1_customer_discount_created_event", + False, + ), + "V1CustomerDiscountDeletedEvent": ( + "stripe.events._v1_customer_discount_deleted_event", + False, + ), + "V1CustomerDiscountDeletedEventNotification": ( + "stripe.events._v1_customer_discount_deleted_event", + False, + ), + "V1CustomerDiscountUpdatedEvent": ( + "stripe.events._v1_customer_discount_updated_event", + False, + ), + "V1CustomerDiscountUpdatedEventNotification": ( + "stripe.events._v1_customer_discount_updated_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, + ), + "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent": ( + "stripe.events._v1_financial_connections_account_account_numbers_updated_event", + False, + ), + "V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification": ( + "stripe.events._v1_financial_connections_account_account_numbers_updated_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, + ), + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent": ( + "stripe.events._v1_financial_connections_account_expected_deactivation_date_updated_event", + False, + ), + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification": ( + "stripe.events._v1_financial_connections_account_expected_deactivation_date_updated_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, + ), + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent": ( + "stripe.events._v1_financial_connections_account_supported_payment_method_types_updated_event", + False, + ), + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification": ( + "stripe.events._v1_financial_connections_account_supported_payment_method_types_updated_event", + False, + ), + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent": ( + "stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event", + False, + ), + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification": ( + "stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event", + False, + ), + "V1FinancialConnectionsAccountUpcomingDeactivationEvent": ( + "stripe.events._v1_financial_connections_account_upcoming_deactivation_event", + False, + ), + "V1FinancialConnectionsAccountUpcomingDeactivationEventNotification": ( + "stripe.events._v1_financial_connections_account_upcoming_deactivation_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, + ), + "V1InvoicePaymentAttemptRequiredEvent": ( + "stripe.events._v1_invoice_payment_attempt_required_event", + False, + ), + "V1InvoicePaymentAttemptRequiredEventNotification": ( + "stripe.events._v1_invoice_payment_attempt_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, ), - "V1BillingMeterErrorReportTriggeredEventNotification": ( - "stripe.events._v1_billing_meter_error_report_triggered_event", + "V1PaymentIntentRequiresActionEvent": ( + "stripe.events._v1_payment_intent_requires_action_event", False, ), - "V1BillingMeterNoMeterFoundEvent": ( - "stripe.events._v1_billing_meter_no_meter_found_event", + "V1PaymentIntentRequiresActionEventNotification": ( + "stripe.events._v1_payment_intent_requires_action_event", False, ), - "V1BillingMeterNoMeterFoundEventNotification": ( - "stripe.events._v1_billing_meter_no_meter_found_event", + "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, + ), + "V1ProductCreatedEvent": ( + "stripe.events._v1_product_created_event", + False, + ), + "V1ProductCreatedEventNotification": ( + "stripe.events._v1_product_created_event", + False, + ), + "V1ProductDeletedEvent": ( + "stripe.events._v1_product_deleted_event", + False, + ), + "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, ), "V2CommerceProductCatalogImportsFailedEvent": ( @@ -1147,6 +3636,22 @@ "stripe.events._v2_signals_account_evaluation_complete_event", False, ), + "V2SignalsAccountSignalFraudulentMerchantReadyEvent": ( + "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", + False, + ), + "V2SignalsAccountSignalFraudulentMerchantReadyEventNotification": ( + "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", + False, + ), + "V2SignalsAccountSignalFraudulentWebsiteReadyEvent": ( + "stripe.events._v2_signals_account_signal_fraudulent_website_ready_event", + False, + ), + "V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification": ( + "stripe.events._v2_signals_account_signal_fraudulent_website_ready_event", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 7f6b17b81..cc56c51a1 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -7,12 +7,660 @@ 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_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_balance_settings_updated_event import ( + V1BalanceSettingsUpdatedEventNotification, + ) + from stripe.events._v1_billing_alert_triggered_event import ( + V1BillingAlertTriggeredEventNotification, + ) + from stripe.events._v1_billing_credit_balance_transaction_created_event import ( + V1BillingCreditBalanceTransactionCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_created_event import ( + V1BillingCreditGrantCreatedEventNotification, + ) + from stripe.events._v1_billing_credit_grant_updated_event import ( + V1BillingCreditGrantUpdatedEventNotification, + ) + from stripe.events._v1_billing_meter_created_event import ( + V1BillingMeterCreatedEventNotification, + ) + from stripe.events._v1_billing_meter_deactivated_event import ( + V1BillingMeterDeactivatedEventNotification, + ) 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_meter_reactivated_event import ( + V1BillingMeterReactivatedEventNotification, + ) + from stripe.events._v1_billing_meter_updated_event import ( + V1BillingMeterUpdatedEventNotification, + ) + 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_discount_created_event import ( + V1CustomerDiscountCreatedEventNotification, + ) + from stripe.events._v1_customer_discount_deleted_event import ( + V1CustomerDiscountDeletedEventNotification, + ) + from stripe.events._v1_customer_discount_updated_event import ( + V1CustomerDiscountUpdatedEventNotification, + ) + 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_account_numbers_updated_event import ( + V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification, + ) + 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_expected_deactivation_date_updated_event import ( + V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification, + ) + 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_financial_connections_account_supported_payment_method_types_updated_event import ( + V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event import ( + V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification, + ) + from stripe.events._v1_financial_connections_account_upcoming_deactivation_event import ( + V1FinancialConnectionsAccountUpcomingDeactivationEventNotification, + ) + 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_attempt_required_event import ( + V1InvoicePaymentAttemptRequiredEventNotification, + ) + 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_commerce_product_catalog_imports_failed_event import ( V2CommerceProductCatalogImportsFailedEventNotification, ) @@ -289,16 +937,886 @@ from stripe.events._v2_signals_account_evaluation_complete_event import ( V2SignalsAccountEvaluationCompleteEventNotification, ) + from stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event import ( + V2SignalsAccountSignalFraudulentMerchantReadyEventNotification, + ) + from stripe.events._v2_signals_account_signal_fraudulent_website_ready_event import ( + V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification, + ) _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.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.balance_settings.updated": ( + "stripe.events._v1_balance_settings_updated_event", + "V1BalanceSettingsUpdatedEvent", + ), + "v1.billing.alert.triggered": ( + "stripe.events._v1_billing_alert_triggered_event", + "V1BillingAlertTriggeredEvent", + ), + "v1.billing.credit_balance_transaction.created": ( + "stripe.events._v1_billing_credit_balance_transaction_created_event", + "V1BillingCreditBalanceTransactionCreatedEvent", + ), + "v1.billing.credit_grant.created": ( + "stripe.events._v1_billing_credit_grant_created_event", + "V1BillingCreditGrantCreatedEvent", + ), + "v1.billing.credit_grant.updated": ( + "stripe.events._v1_billing_credit_grant_updated_event", + "V1BillingCreditGrantUpdatedEvent", + ), + "v1.billing.meter.created": ( + "stripe.events._v1_billing_meter_created_event", + "V1BillingMeterCreatedEvent", + ), + "v1.billing.meter.deactivated": ( + "stripe.events._v1_billing_meter_deactivated_event", + "V1BillingMeterDeactivatedEvent", + ), "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.meter.no_meter_found": ( + "stripe.events._v1_billing_meter_no_meter_found_event", + "V1BillingMeterNoMeterFoundEvent", + ), + "v1.billing.meter.reactivated": ( + "stripe.events._v1_billing_meter_reactivated_event", + "V1BillingMeterReactivatedEvent", + ), + "v1.billing.meter.updated": ( + "stripe.events._v1_billing_meter_updated_event", + "V1BillingMeterUpdatedEvent", + ), + "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.discount.created": ( + "stripe.events._v1_customer_discount_created_event", + "V1CustomerDiscountCreatedEvent", + ), + "v1.customer.discount.deleted": ( + "stripe.events._v1_customer_discount_deleted_event", + "V1CustomerDiscountDeletedEvent", + ), + "v1.customer.discount.updated": ( + "stripe.events._v1_customer_discount_updated_event", + "V1CustomerDiscountUpdatedEvent", + ), + "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.account_numbers_updated": ( + "stripe.events._v1_financial_connections_account_account_numbers_updated_event", + "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent", + ), + "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.expected_deactivation_date_updated": ( + "stripe.events._v1_financial_connections_account_expected_deactivation_date_updated_event", + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent", + ), + "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.financial_connections.account.supported_payment_method_types_updated": ( + "stripe.events._v1_financial_connections_account_supported_payment_method_types_updated_event", + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent", + ), + "v1.financial_connections.account.upcoming_account_number_expiry": ( + "stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event", + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent", + ), + "v1.financial_connections.account.upcoming_deactivation": ( + "stripe.events._v1_financial_connections_account_upcoming_deactivation_event", + "V1FinancialConnectionsAccountUpcomingDeactivationEvent", + ), + "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_attempt_required": ( + "stripe.events._v1_invoice_payment_attempt_required_event", + "V1InvoicePaymentAttemptRequiredEvent", + ), + "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.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.commerce.product_catalog.imports.failed": ( "stripe.events._v2_commerce_product_catalog_imports_failed_event", @@ -668,6 +2186,14 @@ "stripe.events._v2_signals_account_evaluation_complete_event", "V2SignalsAccountEvaluationCompleteEvent", ), + "v2.signals.account_signal.fraudulent_merchant_ready": ( + "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", + "V2SignalsAccountSignalFraudulentMerchantReadyEvent", + ), + "v2.signals.account_signal.fraudulent_website_ready": ( + "stripe.events._v2_signals_account_signal_fraudulent_website_ready_event", + "V2SignalsAccountSignalFraudulentWebsiteReadyEvent", + ), } @@ -683,6 +2209,74 @@ 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.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.balance_settings.updated": ( + "stripe.events._v1_balance_settings_updated_event", + "V1BalanceSettingsUpdatedEventNotification", + ), + "v1.billing.alert.triggered": ( + "stripe.events._v1_billing_alert_triggered_event", + "V1BillingAlertTriggeredEventNotification", + ), + "v1.billing.credit_balance_transaction.created": ( + "stripe.events._v1_billing_credit_balance_transaction_created_event", + "V1BillingCreditBalanceTransactionCreatedEventNotification", + ), + "v1.billing.credit_grant.created": ( + "stripe.events._v1_billing_credit_grant_created_event", + "V1BillingCreditGrantCreatedEventNotification", + ), + "v1.billing.credit_grant.updated": ( + "stripe.events._v1_billing_credit_grant_updated_event", + "V1BillingCreditGrantUpdatedEventNotification", + ), + "v1.billing.meter.created": ( + "stripe.events._v1_billing_meter_created_event", + "V1BillingMeterCreatedEventNotification", + ), + "v1.billing.meter.deactivated": ( + "stripe.events._v1_billing_meter_deactivated_event", + "V1BillingMeterDeactivatedEventNotification", + ), "v1.billing.meter.error_report_triggered": ( "stripe.events._v1_billing_meter_error_report_triggered_event", "V1BillingMeterErrorReportTriggeredEventNotification", @@ -691,6 +2285,802 @@ def get_v2_event_class(type_: str): "stripe.events._v1_billing_meter_no_meter_found_event", "V1BillingMeterNoMeterFoundEventNotification", ), + "v1.billing.meter.reactivated": ( + "stripe.events._v1_billing_meter_reactivated_event", + "V1BillingMeterReactivatedEventNotification", + ), + "v1.billing.meter.updated": ( + "stripe.events._v1_billing_meter_updated_event", + "V1BillingMeterUpdatedEventNotification", + ), + "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.discount.created": ( + "stripe.events._v1_customer_discount_created_event", + "V1CustomerDiscountCreatedEventNotification", + ), + "v1.customer.discount.deleted": ( + "stripe.events._v1_customer_discount_deleted_event", + "V1CustomerDiscountDeletedEventNotification", + ), + "v1.customer.discount.updated": ( + "stripe.events._v1_customer_discount_updated_event", + "V1CustomerDiscountUpdatedEventNotification", + ), + "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.account_numbers_updated": ( + "stripe.events._v1_financial_connections_account_account_numbers_updated_event", + "V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification", + ), + "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.expected_deactivation_date_updated": ( + "stripe.events._v1_financial_connections_account_expected_deactivation_date_updated_event", + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification", + ), + "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.financial_connections.account.supported_payment_method_types_updated": ( + "stripe.events._v1_financial_connections_account_supported_payment_method_types_updated_event", + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification", + ), + "v1.financial_connections.account.upcoming_account_number_expiry": ( + "stripe.events._v1_financial_connections_account_upcoming_account_number_expiry_event", + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification", + ), + "v1.financial_connections.account.upcoming_deactivation": ( + "stripe.events._v1_financial_connections_account_upcoming_deactivation_event", + "V1FinancialConnectionsAccountUpcomingDeactivationEventNotification", + ), + "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_attempt_required": ( + "stripe.events._v1_invoice_payment_attempt_required_event", + "V1InvoicePaymentAttemptRequiredEventNotification", + ), + "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.commerce.product_catalog.imports.failed": ( "stripe.events._v2_commerce_product_catalog_imports_failed_event", "V2CommerceProductCatalogImportsFailedEventNotification", @@ -1059,6 +3449,14 @@ def get_v2_event_class(type_: str): "stripe.events._v2_signals_account_evaluation_complete_event", "V2SignalsAccountEvaluationCompleteEventNotification", ), + "v2.signals.account_signal.fraudulent_merchant_ready": ( + "stripe.events._v2_signals_account_signal_fraudulent_merchant_ready_event", + "V2SignalsAccountSignalFraudulentMerchantReadyEventNotification", + ), + "v2.signals.account_signal.fraudulent_website_ready": ( + "stripe.events._v2_signals_account_signal_fraudulent_website_ready_event", + "V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification", + ), } @@ -1074,8 +3472,224 @@ def get_v2_event_notification_class(type_: str): ALL_EVENT_NOTIFICATIONS = Union[ + "V1AccountApplicationAuthorizedEventNotification", + "V1AccountApplicationDeauthorizedEventNotification", + "V1AccountExternalAccountCreatedEventNotification", + "V1AccountExternalAccountDeletedEventNotification", + "V1AccountExternalAccountUpdatedEventNotification", + "V1AccountUpdatedEventNotification", + "V1ApplicationFeeCreatedEventNotification", + "V1ApplicationFeeRefundedEventNotification", + "V1ApplicationFeeRefundUpdatedEventNotification", + "V1BalanceAvailableEventNotification", + "V1BalanceSettingsUpdatedEventNotification", + "V1BillingAlertTriggeredEventNotification", + "V1BillingCreditBalanceTransactionCreatedEventNotification", + "V1BillingCreditGrantCreatedEventNotification", + "V1BillingCreditGrantUpdatedEventNotification", + "V1BillingMeterCreatedEventNotification", + "V1BillingMeterDeactivatedEventNotification", "V1BillingMeterErrorReportTriggeredEventNotification", "V1BillingMeterNoMeterFoundEventNotification", + "V1BillingMeterReactivatedEventNotification", + "V1BillingMeterUpdatedEventNotification", + "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", + "V1CustomerDiscountCreatedEventNotification", + "V1CustomerDiscountDeletedEventNotification", + "V1CustomerDiscountUpdatedEventNotification", + "V1CustomerSubscriptionCreatedEventNotification", + "V1CustomerSubscriptionDeletedEventNotification", + "V1CustomerSubscriptionPausedEventNotification", + "V1CustomerSubscriptionPendingUpdateAppliedEventNotification", + "V1CustomerSubscriptionPendingUpdateExpiredEventNotification", + "V1CustomerSubscriptionResumedEventNotification", + "V1CustomerSubscriptionTrialWillEndEventNotification", + "V1CustomerSubscriptionUpdatedEventNotification", + "V1CustomerTaxIdCreatedEventNotification", + "V1CustomerTaxIdDeletedEventNotification", + "V1CustomerTaxIdUpdatedEventNotification", + "V1CustomerUpdatedEventNotification", + "V1EntitlementsActiveEntitlementSummaryUpdatedEventNotification", + "V1FileCreatedEventNotification", + "V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification", + "V1FinancialConnectionsAccountCreatedEventNotification", + "V1FinancialConnectionsAccountDeactivatedEventNotification", + "V1FinancialConnectionsAccountDisconnectedEventNotification", + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification", + "V1FinancialConnectionsAccountReactivatedEventNotification", + "V1FinancialConnectionsAccountRefreshedBalanceEventNotification", + "V1FinancialConnectionsAccountRefreshedOwnershipEventNotification", + "V1FinancialConnectionsAccountRefreshedTransactionsEventNotification", + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification", + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification", + "V1FinancialConnectionsAccountUpcomingDeactivationEventNotification", + "V1IdentityVerificationSessionCanceledEventNotification", + "V1IdentityVerificationSessionCreatedEventNotification", + "V1IdentityVerificationSessionProcessingEventNotification", + "V1IdentityVerificationSessionRedactedEventNotification", + "V1IdentityVerificationSessionRequiresInputEventNotification", + "V1IdentityVerificationSessionVerifiedEventNotification", + "V1InvoiceCreatedEventNotification", + "V1InvoiceDeletedEventNotification", + "V1InvoiceFinalizationFailedEventNotification", + "V1InvoiceFinalizedEventNotification", + "V1InvoiceitemCreatedEventNotification", + "V1InvoiceitemDeletedEventNotification", + "V1InvoiceMarkedUncollectibleEventNotification", + "V1InvoiceOverdueEventNotification", + "V1InvoiceOverpaidEventNotification", + "V1InvoicePaidEventNotification", + "V1InvoicePaymentActionRequiredEventNotification", + "V1InvoicePaymentAttemptRequiredEventNotification", + "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", "V2CommerceProductCatalogImportsFailedEventNotification", "V2CommerceProductCatalogImportsProcessingEventNotification", "V2CommerceProductCatalogImportsSucceededEventNotification", @@ -1168,4 +3782,6 @@ def get_v2_event_notification_class(type_: str): "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification", "V2OrchestratedCommerceAgreementTerminatedEventNotification", "V2SignalsAccountEvaluationCompleteEventNotification", + "V2SignalsAccountSignalFraudulentMerchantReadyEventNotification", + "V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification", ] 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..25a02c409 --- /dev/null +++ b/stripe/events/_v1_balance_available_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, + RelatedSingletonObject, +) +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: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + 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 RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + 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_balance_settings_updated_event.py b/stripe/events/_v1_balance_settings_updated_event.py new file mode 100644 index 000000000..6fedefec6 --- /dev/null +++ b/stripe/events/_v1_balance_settings_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, + RelatedSingletonObject, +) +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._balance_settings import BalanceSettings + from stripe._stripe_client import StripeClient + + +class V1BalanceSettingsUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.balance_settings.updated" + type: Literal["v1.balance_settings.updated"] + related_object: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) + + @override + def fetch_event(self) -> "V1BalanceSettingsUpdatedEvent": + return cast( + "V1BalanceSettingsUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BalanceSettings": + 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( + "BalanceSettings", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BalanceSettingsUpdatedEvent": + return cast( + "V1BalanceSettingsUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BalanceSettings": + 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( + "BalanceSettings", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BalanceSettingsUpdatedEvent(Event): + LOOKUP_TYPE = "v1.balance_settings.updated" + type: Literal["v1.balance_settings.updated"] + + class RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BalanceSettings": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BalanceSettings", + 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_credit_balance_transaction_created_event.py b/stripe/events/_v1_billing_credit_balance_transaction_created_event.py new file mode 100644 index 000000000..7ad8227e4 --- /dev/null +++ b/stripe/events/_v1_billing_credit_balance_transaction_created_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.billing._credit_balance_transaction import ( + CreditBalanceTransaction, + ) + + +class V1BillingCreditBalanceTransactionCreatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.billing.credit_balance_transaction.created" + type: Literal["v1.billing.credit_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) -> "V1BillingCreditBalanceTransactionCreatedEvent": + return cast( + "V1BillingCreditBalanceTransactionCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditBalanceTransaction": + 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( + "CreditBalanceTransaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V1BillingCreditBalanceTransactionCreatedEvent": + return cast( + "V1BillingCreditBalanceTransactionCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditBalanceTransaction": + 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( + "CreditBalanceTransaction", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingCreditBalanceTransactionCreatedEvent(Event): + LOOKUP_TYPE = "v1.billing.credit_balance_transaction.created" + type: Literal["v1.billing.credit_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) -> "CreditBalanceTransaction": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditBalanceTransaction", + 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_credit_grant_created_event.py b/stripe/events/_v1_billing_credit_grant_created_event.py new file mode 100644 index 000000000..26c0a675a --- /dev/null +++ b/stripe/events/_v1_billing_credit_grant_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.billing._credit_grant import CreditGrant + + +class V1BillingCreditGrantCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.credit_grant.created" + type: Literal["v1.billing.credit_grant.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) -> "V1BillingCreditGrantCreatedEvent": + return cast( + "V1BillingCreditGrantCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditGrant": + 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( + "CreditGrant", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingCreditGrantCreatedEvent": + return cast( + "V1BillingCreditGrantCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditGrant": + 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( + "CreditGrant", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingCreditGrantCreatedEvent(Event): + LOOKUP_TYPE = "v1.billing.credit_grant.created" + type: Literal["v1.billing.credit_grant.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) -> "CreditGrant": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditGrant", + 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_credit_grant_updated_event.py b/stripe/events/_v1_billing_credit_grant_updated_event.py new file mode 100644 index 000000000..c90e4a904 --- /dev/null +++ b/stripe/events/_v1_billing_credit_grant_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.billing._credit_grant import CreditGrant + + +class V1BillingCreditGrantUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.credit_grant.updated" + type: Literal["v1.billing.credit_grant.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) -> "V1BillingCreditGrantUpdatedEvent": + return cast( + "V1BillingCreditGrantUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "CreditGrant": + 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( + "CreditGrant", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingCreditGrantUpdatedEvent": + return cast( + "V1BillingCreditGrantUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "CreditGrant": + 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( + "CreditGrant", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingCreditGrantUpdatedEvent(Event): + LOOKUP_TYPE = "v1.billing.credit_grant.updated" + type: Literal["v1.billing.credit_grant.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) -> "CreditGrant": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "CreditGrant", + 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_created_event.py b/stripe/events/_v1_billing_meter_created_event.py new file mode 100644 index 000000000..0dd217593 --- /dev/null +++ b/stripe/events/_v1_billing_meter_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.billing._meter import Meter + + +class V1BillingMeterCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.meter.created" + type: Literal["v1.billing.meter.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) -> "V1BillingMeterCreatedEvent": + return cast( + "V1BillingMeterCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingMeterCreatedEvent": + return cast( + "V1BillingMeterCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingMeterCreatedEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.created" + type: Literal["v1.billing.meter.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) -> "Meter": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Meter", + 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_deactivated_event.py b/stripe/events/_v1_billing_meter_deactivated_event.py new file mode 100644 index 000000000..0f0a6e590 --- /dev/null +++ b/stripe/events/_v1_billing_meter_deactivated_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._meter import Meter + + +class V1BillingMeterDeactivatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.meter.deactivated" + type: Literal["v1.billing.meter.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) -> "V1BillingMeterDeactivatedEvent": + return cast( + "V1BillingMeterDeactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingMeterDeactivatedEvent": + return cast( + "V1BillingMeterDeactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingMeterDeactivatedEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.deactivated" + type: Literal["v1.billing.meter.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) -> "Meter": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Meter", + 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_reactivated_event.py b/stripe/events/_v1_billing_meter_reactivated_event.py new file mode 100644 index 000000000..918ea484b --- /dev/null +++ b/stripe/events/_v1_billing_meter_reactivated_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._meter import Meter + + +class V1BillingMeterReactivatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.meter.reactivated" + type: Literal["v1.billing.meter.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) -> "V1BillingMeterReactivatedEvent": + return cast( + "V1BillingMeterReactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingMeterReactivatedEvent": + return cast( + "V1BillingMeterReactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingMeterReactivatedEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.reactivated" + type: Literal["v1.billing.meter.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) -> "Meter": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Meter", + 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_updated_event.py b/stripe/events/_v1_billing_meter_updated_event.py new file mode 100644 index 000000000..f37b84db0 --- /dev/null +++ b/stripe/events/_v1_billing_meter_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.billing._meter import Meter + + +class V1BillingMeterUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.billing.meter.updated" + type: Literal["v1.billing.meter.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) -> "V1BillingMeterUpdatedEvent": + return cast( + "V1BillingMeterUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1BillingMeterUpdatedEvent": + return cast( + "V1BillingMeterUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Meter": + 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( + "Meter", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1BillingMeterUpdatedEvent(Event): + LOOKUP_TYPE = "v1.billing.meter.updated" + type: Literal["v1.billing.meter.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) -> "Meter": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Meter", + 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_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..3b44243db --- /dev/null +++ b/stripe/events/_v1_cash_balance_funds_available_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, + RelatedSingletonObject, +) +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: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + 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 RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + 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_discount_created_event.py b/stripe/events/_v1_customer_discount_created_event.py new file mode 100644 index 000000000..55871c1f5 --- /dev/null +++ b/stripe/events/_v1_customer_discount_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, + RelatedSingletonObject, +) +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._discount import Discount + from stripe._stripe_client import StripeClient + + +class V1CustomerDiscountCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.discount.created" + type: Literal["v1.customer.discount.created"] + related_object: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) + + @override + def fetch_event(self) -> "V1CustomerDiscountCreatedEvent": + return cast( + "V1CustomerDiscountCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerDiscountCreatedEvent": + return cast( + "V1CustomerDiscountCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerDiscountCreatedEvent(Event): + LOOKUP_TYPE = "v1.customer.discount.created" + type: Literal["v1.customer.discount.created"] + + class RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Discount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Discount", + 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_discount_deleted_event.py b/stripe/events/_v1_customer_discount_deleted_event.py new file mode 100644 index 000000000..11861ab46 --- /dev/null +++ b/stripe/events/_v1_customer_discount_deleted_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, + RelatedSingletonObject, +) +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._discount import Discount + from stripe._stripe_client import StripeClient + + +class V1CustomerDiscountDeletedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.discount.deleted" + type: Literal["v1.customer.discount.deleted"] + related_object: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) + + @override + def fetch_event(self) -> "V1CustomerDiscountDeletedEvent": + return cast( + "V1CustomerDiscountDeletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerDiscountDeletedEvent": + return cast( + "V1CustomerDiscountDeletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerDiscountDeletedEvent(Event): + LOOKUP_TYPE = "v1.customer.discount.deleted" + type: Literal["v1.customer.discount.deleted"] + + class RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Discount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Discount", + 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_discount_updated_event.py b/stripe/events/_v1_customer_discount_updated_event.py new file mode 100644 index 000000000..f1f9a7182 --- /dev/null +++ b/stripe/events/_v1_customer_discount_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, + RelatedSingletonObject, +) +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._discount import Discount + from stripe._stripe_client import StripeClient + + +class V1CustomerDiscountUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v1.customer.discount.updated" + type: Literal["v1.customer.discount.updated"] + related_object: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) + + @override + def fetch_event(self) -> "V1CustomerDiscountUpdatedEvent": + return cast( + "V1CustomerDiscountUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V1CustomerDiscountUpdatedEvent": + return cast( + "V1CustomerDiscountUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Discount": + 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( + "Discount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V1CustomerDiscountUpdatedEvent(Event): + LOOKUP_TYPE = "v1.customer.discount.updated" + type: Literal["v1.customer.discount.updated"] + + class RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Discount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Discount", + 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_account_numbers_updated_event.py b/stripe/events/_v1_financial_connections_account_account_numbers_updated_event.py new file mode 100644 index 000000000..2765518bc --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_account_numbers_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.financial_connections._account import Account + + +class V1FinancialConnectionsAccountAccountNumbersUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.account_numbers_updated" + type: Literal["v1.financial_connections.account.account_numbers_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, + ) -> "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent": + return cast( + "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent", + 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, + ) -> "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent": + return cast( + "V1FinancialConnectionsAccountAccountNumbersUpdatedEvent", + 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 V1FinancialConnectionsAccountAccountNumbersUpdatedEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.account_numbers_updated" + type: Literal["v1.financial_connections.account.account_numbers_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_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_expected_deactivation_date_updated_event.py b/stripe/events/_v1_financial_connections_account_expected_deactivation_date_updated_event.py new file mode 100644 index 000000000..fc69cd5fe --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_expected_deactivation_date_updated_event.py @@ -0,0 +1,127 @@ +# -*- 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 V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = ( + "v1.financial_connections.account.expected_deactivation_date_updated" + ) + type: Literal[ + "v1.financial_connections.account.expected_deactivation_date_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, + ) -> "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent": + return cast( + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent", + 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, + ) -> "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent": + return cast( + "V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent", + 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 V1FinancialConnectionsAccountExpectedDeactivationDateUpdatedEvent(Event): + LOOKUP_TYPE = ( + "v1.financial_connections.account.expected_deactivation_date_updated" + ) + type: Literal[ + "v1.financial_connections.account.expected_deactivation_date_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_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_financial_connections_account_supported_payment_method_types_updated_event.py b/stripe/events/_v1_financial_connections_account_supported_payment_method_types_updated_event.py new file mode 100644 index 000000000..295af4d97 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_supported_payment_method_types_updated_event.py @@ -0,0 +1,129 @@ +# -*- 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 V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.supported_payment_method_types_updated" + type: Literal[ + "v1.financial_connections.account.supported_payment_method_types_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, + ) -> ( + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent" + ): + return cast( + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent", + 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, + ) -> ( + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent" + ): + return cast( + "V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent", + 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 V1FinancialConnectionsAccountSupportedPaymentMethodTypesUpdatedEvent( + Event, +): + LOOKUP_TYPE = "v1.financial_connections.account.supported_payment_method_types_updated" + type: Literal[ + "v1.financial_connections.account.supported_payment_method_types_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_financial_connections_account_upcoming_account_number_expiry_event.py b/stripe/events/_v1_financial_connections_account_upcoming_account_number_expiry_event.py new file mode 100644 index 000000000..da2aa15c8 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_upcoming_account_number_expiry_event.py @@ -0,0 +1,127 @@ +# -*- 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 V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEventNotification( + EventNotification, +): + LOOKUP_TYPE = ( + "v1.financial_connections.account.upcoming_account_number_expiry" + ) + type: Literal[ + "v1.financial_connections.account.upcoming_account_number_expiry" + ] + 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, + ) -> "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent": + return cast( + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent", + 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, + ) -> "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent": + return cast( + "V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent", + 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 V1FinancialConnectionsAccountUpcomingAccountNumberExpiryEvent(Event): + LOOKUP_TYPE = ( + "v1.financial_connections.account.upcoming_account_number_expiry" + ) + type: Literal[ + "v1.financial_connections.account.upcoming_account_number_expiry" + ] + + 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_upcoming_deactivation_event.py b/stripe/events/_v1_financial_connections_account_upcoming_deactivation_event.py new file mode 100644 index 000000000..3d7b4daa0 --- /dev/null +++ b/stripe/events/_v1_financial_connections_account_upcoming_deactivation_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 V1FinancialConnectionsAccountUpcomingDeactivationEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v1.financial_connections.account.upcoming_deactivation" + type: Literal["v1.financial_connections.account.upcoming_deactivation"] + 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, + ) -> "V1FinancialConnectionsAccountUpcomingDeactivationEvent": + return cast( + "V1FinancialConnectionsAccountUpcomingDeactivationEvent", + 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, + ) -> "V1FinancialConnectionsAccountUpcomingDeactivationEvent": + return cast( + "V1FinancialConnectionsAccountUpcomingDeactivationEvent", + 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 V1FinancialConnectionsAccountUpcomingDeactivationEvent(Event): + LOOKUP_TYPE = "v1.financial_connections.account.upcoming_deactivation" + type: Literal["v1.financial_connections.account.upcoming_deactivation"] + + 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_attempt_required_event.py b/stripe/events/_v1_invoice_payment_attempt_required_event.py new file mode 100644 index 000000000..239b2bad6 --- /dev/null +++ b/stripe/events/_v1_invoice_payment_attempt_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._invoice import Invoice + from stripe._stripe_client import StripeClient + + +class V1InvoicePaymentAttemptRequiredEventNotification(EventNotification): + LOOKUP_TYPE = "v1.invoice.payment_attempt_required" + type: Literal["v1.invoice.payment_attempt_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) -> "V1InvoicePaymentAttemptRequiredEvent": + return cast( + "V1InvoicePaymentAttemptRequiredEvent", + 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, + ) -> "V1InvoicePaymentAttemptRequiredEvent": + return cast( + "V1InvoicePaymentAttemptRequiredEvent", + 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 V1InvoicePaymentAttemptRequiredEvent(Event): + LOOKUP_TYPE = "v1.invoice.payment_attempt_required" + type: Literal["v1.invoice.payment_attempt_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..8196c2d5b --- /dev/null +++ b/stripe/events/_v1_tax_settings_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, + RelatedSingletonObject, +) +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: RelatedSingletonObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedSingletonObject( + 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 RelatedSingletonObject(StripeObject): + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedSingletonObject + """ + 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_core_account_including_configuration_customer_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py index e15b8704b..ebb479694 100644 --- a/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py @@ -5,7 +5,7 @@ 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 import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -98,7 +98,7 @@ class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent( class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData( StripeObject, ): - updated_capability: Literal["automatic_indirect_tax"] + updated_capability: Union[Literal["automatic_indirect_tax"], str] """ Open Enum. The capability which had its status updated. """ diff --git a/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py index fd81f96a2..ed11fbbd1 100644 --- a/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py @@ -110,6 +110,7 @@ class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventDat "bacs_debit_payments", "bancontact_payments", "blik_payments", + "blik_recurring_payments", "boleto_payments", "card_payments", "cartes_bancaires_payments", @@ -139,8 +140,10 @@ class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventDat "promptpay_payments", "revolut_pay_payments", "samsung_pay_payments", + "satispay_payments", "sepa_bank_transfer_payments", "sepa_debit_payments", + "sequra_payments", "sunbit_payments", "swish_payments", "twint_payments", diff --git a/stripe/events/_v2_money_management_transaction_updated_event.py b/stripe/events/_v2_money_management_transaction_updated_event.py index affb5f9b9..c6ec091ed 100644 --- a/stripe/events/_v2_money_management_transaction_updated_event.py +++ b/stripe/events/_v2_money_management_transaction_updated_event.py @@ -1,12 +1,15 @@ # -*- 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, cast +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.money_management._transaction import Transaction @@ -78,6 +81,41 @@ class V2MoneyManagementTransactionUpdatedEvent(Event): LOOKUP_TYPE = "v2.money_management.transaction.updated" type: Literal["v2.money_management.transaction.updated"] + class V2MoneyManagementTransactionUpdatedEventData(StripeObject): + treasury_transaction: Optional[str] + """ + Id of the v1 Treasury Transaction corresponding to this Transaction. + """ + + data: V2MoneyManagementTransactionUpdatedEventData + """ + Data for the v2.money_management.transaction.updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2MoneyManagementTransactionUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2MoneyManagementTransactionUpdatedEvent.V2MoneyManagementTransactionUpdatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + class RelatedObject(StripeObject): id: str """ diff --git a/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py b/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py new file mode 100644 index 000000000..f6ea544b2 --- /dev/null +++ b/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_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.signals._account_signal import AccountSignal + + +class V2SignalsAccountSignalFraudulentMerchantReadyEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.signals.account_signal.fraudulent_merchant_ready" + type: Literal["v2.signals.account_signal.fraudulent_merchant_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, + ) -> "V2SignalsAccountSignalFraudulentMerchantReadyEvent": + return cast( + "V2SignalsAccountSignalFraudulentMerchantReadyEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "AccountSignal": + 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( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2SignalsAccountSignalFraudulentMerchantReadyEvent": + return cast( + "V2SignalsAccountSignalFraudulentMerchantReadyEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "AccountSignal": + 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( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2SignalsAccountSignalFraudulentMerchantReadyEvent(Event): + LOOKUP_TYPE = "v2.signals.account_signal.fraudulent_merchant_ready" + type: Literal["v2.signals.account_signal.fraudulent_merchant_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) -> "AccountSignal": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "AccountSignal", + 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_signals_account_signal_fraudulent_website_ready_event.py b/stripe/events/_v2_signals_account_signal_fraudulent_website_ready_event.py new file mode 100644 index 000000000..3ecab8d01 --- /dev/null +++ b/stripe/events/_v2_signals_account_signal_fraudulent_website_ready_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.signals._account_signal import AccountSignal + + +class V2SignalsAccountSignalFraudulentWebsiteReadyEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.signals.account_signal.fraudulent_website_ready" + type: Literal["v2.signals.account_signal.fraudulent_website_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, + ) -> "V2SignalsAccountSignalFraudulentWebsiteReadyEvent": + return cast( + "V2SignalsAccountSignalFraudulentWebsiteReadyEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "AccountSignal": + 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( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2SignalsAccountSignalFraudulentWebsiteReadyEvent": + return cast( + "V2SignalsAccountSignalFraudulentWebsiteReadyEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "AccountSignal": + 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( + "AccountSignal", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2SignalsAccountSignalFraudulentWebsiteReadyEvent(Event): + LOOKUP_TYPE = "v2.signals.account_signal.fraudulent_website_ready" + type: Literal["v2.signals.account_signal.fraudulent_website_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) -> "AccountSignal": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "AccountSignal", + 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/financial_connections/_account.py b/stripe/financial_connections/_account.py index 45c918e46..1301af8fa 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -82,7 +82,9 @@ class AccountNumber(StripeObject): """ The type of account number associated with the account. """ - status: Union[Literal["deactivated", "transactable"], str] + status: Union[ + Literal["deactivated", "expired", "pending", "transactable"], str + ] """ Whether the account number is currently active and usable for transactions. """ @@ -370,7 +372,7 @@ class TransactionRefresh(StripeObject): @classmethod def _cls_disconnect( - cls, account: str, **params: Unpack["AccountDisconnectParams"] + cls, account: str, /, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -389,7 +391,7 @@ def _cls_disconnect( @overload @staticmethod def disconnect( - account: str, **params: Unpack["AccountDisconnectParams"] + account: str, /, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -406,7 +408,7 @@ def disconnect( ... @class_method_variant("_cls_disconnect") - def disconnect( # pyright: ignore[reportGeneralTypeIssues] + def disconnect( self, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ @@ -425,7 +427,7 @@ def disconnect( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_disconnect_async( - cls, account: str, **params: Unpack["AccountDisconnectParams"] + cls, account: str, /, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -444,7 +446,7 @@ async def _cls_disconnect_async( @overload @staticmethod async def disconnect_async( - account: str, **params: Unpack["AccountDisconnectParams"] + account: str, /, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -461,7 +463,7 @@ async def disconnect_async( ... @class_method_variant("_cls_disconnect_async") - async def disconnect_async( # pyright: ignore[reportGeneralTypeIssues] + async def disconnect_async( self, **params: Unpack["AccountDisconnectParams"] ) -> "Account": """ @@ -520,7 +522,7 @@ async def list_async( @classmethod def _cls_list_owners( - cls, account: str, **params: Unpack["AccountListOwnersParams"] + cls, account: str, /, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -539,7 +541,7 @@ def _cls_list_owners( @overload @staticmethod def list_owners( - account: str, **params: Unpack["AccountListOwnersParams"] + account: str, /, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -556,7 +558,7 @@ def list_owners( ... @class_method_variant("_cls_list_owners") - def list_owners( # pyright: ignore[reportGeneralTypeIssues] + def list_owners( self, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ @@ -575,7 +577,7 @@ def list_owners( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_list_owners_async( - cls, account: str, **params: Unpack["AccountListOwnersParams"] + cls, account: str, /, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -594,7 +596,7 @@ async def _cls_list_owners_async( @overload @staticmethod async def list_owners_async( - account: str, **params: Unpack["AccountListOwnersParams"] + account: str, /, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -611,7 +613,7 @@ async def list_owners_async( ... @class_method_variant("_cls_list_owners_async") - async def list_owners_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_owners_async( self, **params: Unpack["AccountListOwnersParams"] ) -> ListObject["AccountOwner"]: """ @@ -630,7 +632,7 @@ async def list_owners_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_refresh_account( - cls, account: str, **params: Unpack["AccountRefreshAccountParams"] + cls, account: str, /, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -649,7 +651,7 @@ def _cls_refresh_account( @overload @staticmethod def refresh_account( - account: str, **params: Unpack["AccountRefreshAccountParams"] + account: str, /, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -666,7 +668,7 @@ def refresh_account( ... @class_method_variant("_cls_refresh_account") - def refresh_account( # pyright: ignore[reportGeneralTypeIssues] + def refresh_account( self, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ @@ -685,7 +687,7 @@ def refresh_account( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_refresh_account_async( - cls, account: str, **params: Unpack["AccountRefreshAccountParams"] + cls, account: str, /, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -704,7 +706,7 @@ async def _cls_refresh_account_async( @overload @staticmethod async def refresh_account_async( - account: str, **params: Unpack["AccountRefreshAccountParams"] + account: str, /, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -721,7 +723,7 @@ async def refresh_account_async( ... @class_method_variant("_cls_refresh_account_async") - async def refresh_account_async( # pyright: ignore[reportGeneralTypeIssues] + async def refresh_account_async( self, **params: Unpack["AccountRefreshAccountParams"] ) -> "Account": """ @@ -743,7 +745,7 @@ def retrieve( cls, id: str, **params: Unpack["AccountRetrieveParams"] ) -> "Account": """ - Retrieves the details of an Financial Connections Account. + Retrieves the details of a Financial Connections Account. """ instance = cls(id, **params) instance.refresh() @@ -754,7 +756,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["AccountRetrieveParams"] ) -> "Account": """ - Retrieves the details of an Financial Connections Account. + Retrieves the details of a Financial Connections Account. """ instance = cls(id, **params) await instance.refresh_async() @@ -762,7 +764,7 @@ async def retrieve_async( @classmethod def _cls_subscribe( - cls, account: str, **params: Unpack["AccountSubscribeParams"] + cls, account: str, /, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. When the account status is active, data is typically refreshed once a day. @@ -781,7 +783,7 @@ def _cls_subscribe( @overload @staticmethod def subscribe( - account: str, **params: Unpack["AccountSubscribeParams"] + account: str, /, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. When the account status is active, data is typically refreshed once a day. @@ -798,7 +800,7 @@ def subscribe( ... @class_method_variant("_cls_subscribe") - def subscribe( # pyright: ignore[reportGeneralTypeIssues] + def subscribe( self, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ @@ -817,7 +819,7 @@ def subscribe( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_subscribe_async( - cls, account: str, **params: Unpack["AccountSubscribeParams"] + cls, account: str, /, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. When the account status is active, data is typically refreshed once a day. @@ -836,7 +838,7 @@ async def _cls_subscribe_async( @overload @staticmethod async def subscribe_async( - account: str, **params: Unpack["AccountSubscribeParams"] + account: str, /, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. When the account status is active, data is typically refreshed once a day. @@ -853,7 +855,7 @@ async def subscribe_async( ... @class_method_variant("_cls_subscribe_async") - async def subscribe_async( # pyright: ignore[reportGeneralTypeIssues] + async def subscribe_async( self, **params: Unpack["AccountSubscribeParams"] ) -> "Account": """ @@ -872,7 +874,7 @@ async def subscribe_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_unsubscribe( - cls, account: str, **params: Unpack["AccountUnsubscribeParams"] + cls, account: str, /, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. @@ -891,7 +893,7 @@ def _cls_unsubscribe( @overload @staticmethod def unsubscribe( - account: str, **params: Unpack["AccountUnsubscribeParams"] + account: str, /, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. @@ -908,7 +910,7 @@ def unsubscribe( ... @class_method_variant("_cls_unsubscribe") - def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] + def unsubscribe( self, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ @@ -927,7 +929,7 @@ def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_unsubscribe_async( - cls, account: str, **params: Unpack["AccountUnsubscribeParams"] + cls, account: str, /, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. @@ -946,7 +948,7 @@ async def _cls_unsubscribe_async( @overload @staticmethod async def unsubscribe_async( - account: str, **params: Unpack["AccountUnsubscribeParams"] + account: str, /, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. @@ -963,7 +965,7 @@ async def unsubscribe_async( ... @class_method_variant("_cls_unsubscribe_async") - async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] + async def unsubscribe_async( self, **params: Unpack["AccountUnsubscribeParams"] ) -> "Account": """ @@ -984,6 +986,7 @@ async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] def list_inferred_balances( cls, account: str, + /, **params: Unpack["AccountListInferredBalancesParams"], ) -> ListObject["AccountInferredBalance"]: """ @@ -1004,6 +1007,7 @@ def list_inferred_balances( async def list_inferred_balances_async( cls, account: str, + /, **params: Unpack["AccountListInferredBalancesParams"], ) -> ListObject["AccountInferredBalance"]: """ diff --git a/stripe/financial_connections/_account_inferred_balance_service.py b/stripe/financial_connections/_account_inferred_balance_service.py index bd6373889..d8243f237 100644 --- a/stripe/financial_connections/_account_inferred_balance_service.py +++ b/stripe/financial_connections/_account_inferred_balance_service.py @@ -20,6 +20,7 @@ class AccountInferredBalanceService(StripeService): def list( self, account: str, + /, params: Optional["AccountInferredBalanceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountInferredBalance]": @@ -42,6 +43,7 @@ def list( async def list_async( self, account: str, + /, params: Optional["AccountInferredBalanceListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountInferredBalance]": diff --git a/stripe/financial_connections/_account_owner_service.py b/stripe/financial_connections/_account_owner_service.py index fa2851260..382799eb7 100644 --- a/stripe/financial_connections/_account_owner_service.py +++ b/stripe/financial_connections/_account_owner_service.py @@ -18,6 +18,7 @@ class AccountOwnerService(StripeService): def list( self, account: str, + /, params: "AccountOwnerListParams", options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountOwner]": @@ -40,6 +41,7 @@ def list( async def list_async( self, account: str, + /, params: "AccountOwnerListParams", options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountOwner]": diff --git a/stripe/financial_connections/_account_service.py b/stripe/financial_connections/_account_service.py index e0cbacdb1..baa3f80d2 100644 --- a/stripe/financial_connections/_account_service.py +++ b/stripe/financial_connections/_account_service.py @@ -111,11 +111,12 @@ async def list_async( def retrieve( self, account: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": """ - Retrieves the details of an Financial Connections Account. + Retrieves the details of a Financial Connections Account. """ return cast( "Account", @@ -133,11 +134,12 @@ def retrieve( async def retrieve_async( self, account: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": """ - Retrieves the details of an Financial Connections Account. + Retrieves the details of a Financial Connections Account. """ return cast( "Account", @@ -155,6 +157,7 @@ async def retrieve_async( def disconnect( self, account: str, + /, params: Optional["AccountDisconnectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -177,6 +180,7 @@ def disconnect( async def disconnect_async( self, account: str, + /, params: Optional["AccountDisconnectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -199,6 +203,7 @@ async def disconnect_async( def refresh( self, account: str, + /, params: "AccountRefreshParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -221,6 +226,7 @@ def refresh( async def refresh_async( self, account: str, + /, params: "AccountRefreshParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -243,6 +249,7 @@ async def refresh_async( def subscribe( self, account: str, + /, params: "AccountSubscribeParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -265,6 +272,7 @@ def subscribe( async def subscribe_async( self, account: str, + /, params: "AccountSubscribeParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -287,6 +295,7 @@ async def subscribe_async( def unsubscribe( self, account: str, + /, params: "AccountUnsubscribeParams", options: Optional["RequestOptions"] = None, ) -> "Account": @@ -309,6 +318,7 @@ def unsubscribe( async def unsubscribe_async( self, account: str, + /, params: "AccountUnsubscribeParams", options: Optional["RequestOptions"] = None, ) -> "Account": diff --git a/stripe/financial_connections/_authorization.py b/stripe/financial_connections/_authorization.py index 59c1b1111..7d5b01d2e 100644 --- a/stripe/financial_connections/_authorization.py +++ b/stripe/financial_connections/_authorization.py @@ -95,7 +95,7 @@ def retrieve( cls, id: str, **params: Unpack["AuthorizationRetrieveParams"] ) -> "Authorization": """ - Retrieves the details of an Financial Connections Authorization. + Retrieves the details of a Financial Connections Authorization. """ instance = cls(id, **params) instance.refresh() @@ -106,7 +106,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["AuthorizationRetrieveParams"] ) -> "Authorization": """ - Retrieves the details of an Financial Connections Authorization. + Retrieves the details of a Financial Connections Authorization. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/financial_connections/_authorization_service.py b/stripe/financial_connections/_authorization_service.py index a142e1922..2dcb3eaeb 100644 --- a/stripe/financial_connections/_authorization_service.py +++ b/stripe/financial_connections/_authorization_service.py @@ -17,11 +17,12 @@ class AuthorizationService(StripeService): def retrieve( self, authorization: str, + /, params: Optional["AuthorizationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": """ - Retrieves the details of an Financial Connections Authorization. + Retrieves the details of a Financial Connections Authorization. """ return cast( "Authorization", @@ -39,11 +40,12 @@ def retrieve( async def retrieve_async( self, authorization: str, + /, params: Optional["AuthorizationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": """ - Retrieves the details of an Financial Connections Authorization. + Retrieves the details of a Financial Connections Authorization. """ return cast( "Authorization", diff --git a/stripe/financial_connections/_institution_service.py b/stripe/financial_connections/_institution_service.py index fbc8c3054..f8c969e39 100644 --- a/stripe/financial_connections/_institution_service.py +++ b/stripe/financial_connections/_institution_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, institution: str, + /, params: Optional["InstitutionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Institution": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, institution: str, + /, params: Optional["InstitutionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Institution": diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 659c85fa1..f5234a6ec 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -64,10 +64,6 @@ class Filters(StripeObject): """ Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. """ - countries: Optional[List[str]] - """ - List of countries from which to filter accounts. - """ country: Optional[str] """ Country from which to filter accounts. diff --git a/stripe/financial_connections/_session_service.py b/stripe/financial_connections/_session_service.py index ca7477e04..d288cebaf 100644 --- a/stripe/financial_connections/_session_service.py +++ b/stripe/financial_connections/_session_service.py @@ -20,6 +20,7 @@ class SessionService(StripeService): def retrieve( self, session: str, + /, params: Optional["SessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": @@ -42,6 +43,7 @@ def retrieve( async def retrieve_async( self, session: str, + /, params: Optional["SessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Session": diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index bf33c3b6f..c98ba8413 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/forwarding/_request_service.py b/stripe/forwarding/_request_service.py index b52e6a3af..a1e894a3a 100644 --- a/stripe/forwarding/_request_service.py +++ b/stripe/forwarding/_request_service.py @@ -98,6 +98,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["RequestRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Request": @@ -118,6 +119,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["RequestRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Request": diff --git a/stripe/identity/_verification_report_service.py b/stripe/identity/_verification_report_service.py index 65b8b1631..6c44e40d2 100644 --- a/stripe/identity/_verification_report_service.py +++ b/stripe/identity/_verification_report_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, report: str, + /, params: Optional["VerificationReportRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationReport": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, report: str, + /, params: Optional["VerificationReportRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationReport": diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index acb8c2fde..63a0118b3 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -352,7 +352,10 @@ class Dob(StripeObject): @classmethod def _cls_cancel( - cls, session: str, **params: Unpack["VerificationSessionCancelParams"] + cls, + session: str, + /, + **params: Unpack["VerificationSessionCancelParams"], ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work). @@ -373,7 +376,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - session: str, **params: Unpack["VerificationSessionCancelParams"] + session: str, /, **params: Unpack["VerificationSessionCancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work). @@ -394,7 +397,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["VerificationSessionCancelParams"] ) -> "VerificationSession": """ @@ -415,7 +418,10 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, session: str, **params: Unpack["VerificationSessionCancelParams"] + cls, + session: str, + /, + **params: Unpack["VerificationSessionCancelParams"], ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work). @@ -436,7 +442,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - session: str, **params: Unpack["VerificationSessionCancelParams"] + session: str, /, **params: Unpack["VerificationSessionCancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work). @@ -457,7 +463,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["VerificationSessionCancelParams"] ) -> "VerificationSession": """ @@ -562,7 +568,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["VerificationSessionModifyParams"] + cls, id: str, /, **params: Unpack["VerificationSessionModifyParams"] ) -> "VerificationSession": """ Updates a VerificationSession object. @@ -582,7 +588,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["VerificationSessionModifyParams"] + cls, id: str, /, **params: Unpack["VerificationSessionModifyParams"] ) -> "VerificationSession": """ Updates a VerificationSession object. @@ -602,7 +608,10 @@ async def modify_async( @classmethod def _cls_redact( - cls, session: str, **params: Unpack["VerificationSessionRedactParams"] + cls, + session: str, + /, + **params: Unpack["VerificationSessionRedactParams"], ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -639,7 +648,7 @@ def _cls_redact( @overload @staticmethod def redact( - session: str, **params: Unpack["VerificationSessionRedactParams"] + session: str, /, **params: Unpack["VerificationSessionRedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -692,7 +701,7 @@ def redact( ... @class_method_variant("_cls_redact") - def redact( # pyright: ignore[reportGeneralTypeIssues] + def redact( self, **params: Unpack["VerificationSessionRedactParams"] ) -> "VerificationSession": """ @@ -729,7 +738,10 @@ def redact( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_redact_async( - cls, session: str, **params: Unpack["VerificationSessionRedactParams"] + cls, + session: str, + /, + **params: Unpack["VerificationSessionRedactParams"], ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -766,7 +778,7 @@ async def _cls_redact_async( @overload @staticmethod async def redact_async( - session: str, **params: Unpack["VerificationSessionRedactParams"] + session: str, /, **params: Unpack["VerificationSessionRedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -819,7 +831,7 @@ async def redact_async( ... @class_method_variant("_cls_redact_async") - async def redact_async( # pyright: ignore[reportGeneralTypeIssues] + async def redact_async( self, **params: Unpack["VerificationSessionRedactParams"] ) -> "VerificationSession": """ diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index 69aace00f..78c0af60d 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -121,6 +121,7 @@ async def create_async( def retrieve( self, session: str, + /, params: Optional["VerificationSessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -146,6 +147,7 @@ def retrieve( async def retrieve_async( self, session: str, + /, params: Optional["VerificationSessionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -171,6 +173,7 @@ async def retrieve_async( def update( self, session: str, + /, params: Optional["VerificationSessionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -196,6 +199,7 @@ def update( async def update_async( self, session: str, + /, params: Optional["VerificationSessionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -221,6 +225,7 @@ async def update_async( def cancel( self, session: str, + /, params: Optional["VerificationSessionCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -245,6 +250,7 @@ def cancel( async def cancel_async( self, session: str, + /, params: Optional["VerificationSessionCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -269,6 +275,7 @@ async def cancel_async( def redact( self, session: str, + /, params: Optional["VerificationSessionRedactParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": @@ -309,6 +316,7 @@ def redact( async def redact_async( self, session: str, + /, params: Optional["VerificationSessionRedactParams"] = None, options: Optional["RequestOptions"] = None, ) -> "VerificationSession": diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index b86412d74..5d94d766e 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -663,7 +663,10 @@ class ThreeDSecure(StripeObject): @classmethod def _cls_approve( - cls, authorization: str, **params: Unpack["AuthorizationApproveParams"] + cls, + authorization: str, + /, + **params: Unpack["AuthorizationApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -683,7 +686,7 @@ def _cls_approve( @overload @staticmethod def approve( - authorization: str, **params: Unpack["AuthorizationApproveParams"] + authorization: str, /, **params: Unpack["AuthorizationApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -702,7 +705,7 @@ def approve( ... @class_method_variant("_cls_approve") - def approve( # pyright: ignore[reportGeneralTypeIssues] + def approve( self, **params: Unpack["AuthorizationApproveParams"] ) -> "Authorization": """ @@ -722,7 +725,10 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_approve_async( - cls, authorization: str, **params: Unpack["AuthorizationApproveParams"] + cls, + authorization: str, + /, + **params: Unpack["AuthorizationApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -742,7 +748,7 @@ async def _cls_approve_async( @overload @staticmethod async def approve_async( - authorization: str, **params: Unpack["AuthorizationApproveParams"] + authorization: str, /, **params: Unpack["AuthorizationApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -761,7 +767,7 @@ async def approve_async( ... @class_method_variant("_cls_approve_async") - async def approve_async( # pyright: ignore[reportGeneralTypeIssues] + async def approve_async( self, **params: Unpack["AuthorizationApproveParams"] ) -> "Authorization": """ @@ -781,7 +787,10 @@ async def approve_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_decline( - cls, authorization: str, **params: Unpack["AuthorizationDeclineParams"] + cls, + authorization: str, + /, + **params: Unpack["AuthorizationDeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -801,7 +810,7 @@ def _cls_decline( @overload @staticmethod def decline( - authorization: str, **params: Unpack["AuthorizationDeclineParams"] + authorization: str, /, **params: Unpack["AuthorizationDeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -820,7 +829,7 @@ def decline( ... @class_method_variant("_cls_decline") - def decline( # pyright: ignore[reportGeneralTypeIssues] + def decline( self, **params: Unpack["AuthorizationDeclineParams"] ) -> "Authorization": """ @@ -840,7 +849,10 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_decline_async( - cls, authorization: str, **params: Unpack["AuthorizationDeclineParams"] + cls, + authorization: str, + /, + **params: Unpack["AuthorizationDeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -860,7 +872,7 @@ async def _cls_decline_async( @overload @staticmethod async def decline_async( - authorization: str, **params: Unpack["AuthorizationDeclineParams"] + authorization: str, /, **params: Unpack["AuthorizationDeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -879,7 +891,7 @@ async def decline_async( ... @class_method_variant("_cls_decline_async") - async def decline_async( # pyright: ignore[reportGeneralTypeIssues] + async def decline_async( self, **params: Unpack["AuthorizationDeclineParams"] ) -> "Authorization": """ @@ -939,7 +951,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["AuthorizationModifyParams"] + cls, id: str, /, **params: Unpack["AuthorizationModifyParams"] ) -> "Authorization": """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -956,7 +968,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["AuthorizationModifyParams"] + cls, id: str, /, **params: Unpack["AuthorizationModifyParams"] ) -> "Authorization": """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1000,6 +1012,7 @@ class TestHelpers(APIResourceTestHelpers["Authorization"]): def _cls_capture( cls, authorization: str, + /, **params: Unpack["AuthorizationCaptureParams"], ) -> "Authorization": """ @@ -1019,7 +1032,9 @@ def _cls_capture( @overload @staticmethod def capture( - authorization: str, **params: Unpack["AuthorizationCaptureParams"] + authorization: str, + /, + **params: Unpack["AuthorizationCaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. @@ -1036,7 +1051,7 @@ def capture( ... @class_method_variant("_cls_capture") - def capture( # pyright: ignore[reportGeneralTypeIssues] + def capture( self, **params: Unpack["AuthorizationCaptureParams"] ) -> "Authorization": """ @@ -1059,6 +1074,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] async def _cls_capture_async( cls, authorization: str, + /, **params: Unpack["AuthorizationCaptureParams"], ) -> "Authorization": """ @@ -1078,7 +1094,9 @@ async def _cls_capture_async( @overload @staticmethod async def capture_async( - authorization: str, **params: Unpack["AuthorizationCaptureParams"] + authorization: str, + /, + **params: Unpack["AuthorizationCaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. @@ -1095,7 +1113,7 @@ async def capture_async( ... @class_method_variant("_cls_capture_async") - async def capture_async( # pyright: ignore[reportGeneralTypeIssues] + async def capture_async( self, **params: Unpack["AuthorizationCaptureParams"] ) -> "Authorization": """ @@ -1150,6 +1168,7 @@ async def create_async( def _cls_expire( cls, authorization: str, + /, **params: Unpack["AuthorizationExpireParams"], ) -> "Authorization": """ @@ -1169,7 +1188,9 @@ def _cls_expire( @overload @staticmethod def expire( - authorization: str, **params: Unpack["AuthorizationExpireParams"] + authorization: str, + /, + **params: Unpack["AuthorizationExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1186,7 +1207,7 @@ def expire( ... @class_method_variant("_cls_expire") - def expire( # pyright: ignore[reportGeneralTypeIssues] + def expire( self, **params: Unpack["AuthorizationExpireParams"] ) -> "Authorization": """ @@ -1209,6 +1230,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] async def _cls_expire_async( cls, authorization: str, + /, **params: Unpack["AuthorizationExpireParams"], ) -> "Authorization": """ @@ -1228,7 +1250,9 @@ async def _cls_expire_async( @overload @staticmethod async def expire_async( - authorization: str, **params: Unpack["AuthorizationExpireParams"] + authorization: str, + /, + **params: Unpack["AuthorizationExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1245,7 +1269,7 @@ async def expire_async( ... @class_method_variant("_cls_expire_async") - async def expire_async( # pyright: ignore[reportGeneralTypeIssues] + async def expire_async( self, **params: Unpack["AuthorizationExpireParams"] ) -> "Authorization": """ @@ -1268,6 +1292,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_finalize_amount( cls, authorization: str, + /, **params: Unpack["AuthorizationFinalizeAmountParams"], ) -> "Authorization": """ @@ -1288,6 +1313,7 @@ def _cls_finalize_amount( @staticmethod def finalize_amount( authorization: str, + /, **params: Unpack["AuthorizationFinalizeAmountParams"], ) -> "Authorization": """ @@ -1305,7 +1331,7 @@ def finalize_amount( ... @class_method_variant("_cls_finalize_amount") - def finalize_amount( # pyright: ignore[reportGeneralTypeIssues] + def finalize_amount( self, **params: Unpack["AuthorizationFinalizeAmountParams"] ) -> "Authorization": """ @@ -1328,6 +1354,7 @@ def finalize_amount( # pyright: ignore[reportGeneralTypeIssues] async def _cls_finalize_amount_async( cls, authorization: str, + /, **params: Unpack["AuthorizationFinalizeAmountParams"], ) -> "Authorization": """ @@ -1348,6 +1375,7 @@ async def _cls_finalize_amount_async( @staticmethod async def finalize_amount_async( authorization: str, + /, **params: Unpack["AuthorizationFinalizeAmountParams"], ) -> "Authorization": """ @@ -1365,7 +1393,7 @@ async def finalize_amount_async( ... @class_method_variant("_cls_finalize_amount_async") - async def finalize_amount_async( # pyright: ignore[reportGeneralTypeIssues] + async def finalize_amount_async( self, **params: Unpack["AuthorizationFinalizeAmountParams"] ) -> "Authorization": """ @@ -1388,6 +1416,7 @@ async def finalize_amount_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_increment( cls, authorization: str, + /, **params: Unpack["AuthorizationIncrementParams"], ) -> "Authorization": """ @@ -1408,6 +1437,7 @@ def _cls_increment( @staticmethod def increment( authorization: str, + /, **params: Unpack["AuthorizationIncrementParams"], ) -> "Authorization": """ @@ -1425,7 +1455,7 @@ def increment( ... @class_method_variant("_cls_increment") - def increment( # pyright: ignore[reportGeneralTypeIssues] + def increment( self, **params: Unpack["AuthorizationIncrementParams"] ) -> "Authorization": """ @@ -1448,6 +1478,7 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] async def _cls_increment_async( cls, authorization: str, + /, **params: Unpack["AuthorizationIncrementParams"], ) -> "Authorization": """ @@ -1468,6 +1499,7 @@ async def _cls_increment_async( @staticmethod async def increment_async( authorization: str, + /, **params: Unpack["AuthorizationIncrementParams"], ) -> "Authorization": """ @@ -1485,7 +1517,7 @@ async def increment_async( ... @class_method_variant("_cls_increment_async") - async def increment_async( # pyright: ignore[reportGeneralTypeIssues] + async def increment_async( self, **params: Unpack["AuthorizationIncrementParams"] ) -> "Authorization": """ @@ -1508,6 +1540,7 @@ async def increment_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_respond( cls, authorization: str, + /, **params: Unpack["AuthorizationRespondParams"], ) -> "Authorization": """ @@ -1527,7 +1560,9 @@ def _cls_respond( @overload @staticmethod def respond( - authorization: str, **params: Unpack["AuthorizationRespondParams"] + authorization: str, + /, + **params: Unpack["AuthorizationRespondParams"], ) -> "Authorization": """ Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. @@ -1544,7 +1579,7 @@ def respond( ... @class_method_variant("_cls_respond") - def respond( # pyright: ignore[reportGeneralTypeIssues] + def respond( self, **params: Unpack["AuthorizationRespondParams"] ) -> "Authorization": """ @@ -1567,6 +1602,7 @@ def respond( # pyright: ignore[reportGeneralTypeIssues] async def _cls_respond_async( cls, authorization: str, + /, **params: Unpack["AuthorizationRespondParams"], ) -> "Authorization": """ @@ -1586,7 +1622,9 @@ async def _cls_respond_async( @overload @staticmethod async def respond_async( - authorization: str, **params: Unpack["AuthorizationRespondParams"] + authorization: str, + /, + **params: Unpack["AuthorizationRespondParams"], ) -> "Authorization": """ Respond to a fraud challenge on a testmode Issuing authorization, simulating either a confirmation of fraud or a correction of legitimacy. @@ -1603,7 +1641,7 @@ async def respond_async( ... @class_method_variant("_cls_respond_async") - async def respond_async( # pyright: ignore[reportGeneralTypeIssues] + async def respond_async( self, **params: Unpack["AuthorizationRespondParams"] ) -> "Authorization": """ @@ -1626,6 +1664,7 @@ async def respond_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_reverse( cls, authorization: str, + /, **params: Unpack["AuthorizationReverseParams"], ) -> "Authorization": """ @@ -1645,7 +1684,9 @@ def _cls_reverse( @overload @staticmethod def reverse( - authorization: str, **params: Unpack["AuthorizationReverseParams"] + authorization: str, + /, + **params: Unpack["AuthorizationReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1662,7 +1703,7 @@ def reverse( ... @class_method_variant("_cls_reverse") - def reverse( # pyright: ignore[reportGeneralTypeIssues] + def reverse( self, **params: Unpack["AuthorizationReverseParams"] ) -> "Authorization": """ @@ -1685,6 +1726,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] async def _cls_reverse_async( cls, authorization: str, + /, **params: Unpack["AuthorizationReverseParams"], ) -> "Authorization": """ @@ -1704,7 +1746,9 @@ async def _cls_reverse_async( @overload @staticmethod async def reverse_async( - authorization: str, **params: Unpack["AuthorizationReverseParams"] + authorization: str, + /, + **params: Unpack["AuthorizationReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1721,7 +1765,7 @@ async def reverse_async( ... @class_method_variant("_cls_reverse_async") - async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] + async def reverse_async( self, **params: Unpack["AuthorizationReverseParams"] ) -> "Authorization": """ diff --git a/stripe/issuing/_authorization_service.py b/stripe/issuing/_authorization_service.py index 0e2c82d56..afac45a81 100644 --- a/stripe/issuing/_authorization_service.py +++ b/stripe/issuing/_authorization_service.py @@ -68,6 +68,7 @@ async def list_async( def retrieve( self, authorization: str, + /, params: Optional["AuthorizationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -90,6 +91,7 @@ def retrieve( async def retrieve_async( self, authorization: str, + /, params: Optional["AuthorizationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -112,6 +114,7 @@ async def retrieve_async( def update( self, authorization: str, + /, params: Optional["AuthorizationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -134,6 +137,7 @@ def update( async def update_async( self, authorization: str, + /, params: Optional["AuthorizationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -156,6 +160,7 @@ async def update_async( def approve( self, authorization: str, + /, params: Optional["AuthorizationApproveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -179,6 +184,7 @@ def approve( async def approve_async( self, authorization: str, + /, params: Optional["AuthorizationApproveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -202,6 +208,7 @@ async def approve_async( def decline( self, authorization: str, + /, params: Optional["AuthorizationDeclineParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -225,6 +232,7 @@ def decline( async def decline_async( self, authorization: str, + /, params: Optional["AuthorizationDeclineParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 37972cc6a..ceb430ce7 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -1448,7 +1448,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["CardModifyParams"]) -> "Card": + def modify( + cls, id: str, /, **params: Unpack["CardModifyParams"] + ) -> "Card": """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ @@ -1464,7 +1466,7 @@ def modify(cls, id: str, **params: Unpack["CardModifyParams"]) -> "Card": @classmethod async def modify_async( - cls, id: str, **params: Unpack["CardModifyParams"] + cls, id: str, /, **params: Unpack["CardModifyParams"] ) -> "Card": """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1506,7 +1508,7 @@ class TestHelpers(APIResourceTestHelpers["Card"]): @classmethod def _cls_deliver_card( - cls, card: str, **params: Unpack["CardDeliverCardParams"] + cls, card: str, /, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1525,7 +1527,7 @@ def _cls_deliver_card( @overload @staticmethod def deliver_card( - card: str, **params: Unpack["CardDeliverCardParams"] + card: str, /, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1542,7 +1544,7 @@ def deliver_card( ... @class_method_variant("_cls_deliver_card") - def deliver_card( # pyright: ignore[reportGeneralTypeIssues] + def deliver_card( self, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ @@ -1561,7 +1563,7 @@ def deliver_card( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_deliver_card_async( - cls, card: str, **params: Unpack["CardDeliverCardParams"] + cls, card: str, /, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1580,7 +1582,7 @@ async def _cls_deliver_card_async( @overload @staticmethod async def deliver_card_async( - card: str, **params: Unpack["CardDeliverCardParams"] + card: str, /, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1597,7 +1599,7 @@ async def deliver_card_async( ... @class_method_variant("_cls_deliver_card_async") - async def deliver_card_async( # pyright: ignore[reportGeneralTypeIssues] + async def deliver_card_async( self, **params: Unpack["CardDeliverCardParams"] ) -> "Card": """ @@ -1616,7 +1618,7 @@ async def deliver_card_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_fail_card( - cls, card: str, **params: Unpack["CardFailCardParams"] + cls, card: str, /, **params: Unpack["CardFailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1635,7 +1637,7 @@ def _cls_fail_card( @overload @staticmethod def fail_card( - card: str, **params: Unpack["CardFailCardParams"] + card: str, /, **params: Unpack["CardFailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1650,9 +1652,7 @@ def fail_card(self, **params: Unpack["CardFailCardParams"]) -> "Card": ... @class_method_variant("_cls_fail_card") - def fail_card( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["CardFailCardParams"] - ) -> "Card": + def fail_card(self, **params: Unpack["CardFailCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ @@ -1669,7 +1669,7 @@ def fail_card( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_fail_card_async( - cls, card: str, **params: Unpack["CardFailCardParams"] + cls, card: str, /, **params: Unpack["CardFailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1688,7 +1688,7 @@ async def _cls_fail_card_async( @overload @staticmethod async def fail_card_async( - card: str, **params: Unpack["CardFailCardParams"] + card: str, /, **params: Unpack["CardFailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1705,7 +1705,7 @@ async def fail_card_async( ... @class_method_variant("_cls_fail_card_async") - async def fail_card_async( # pyright: ignore[reportGeneralTypeIssues] + async def fail_card_async( self, **params: Unpack["CardFailCardParams"] ) -> "Card": """ @@ -1724,7 +1724,7 @@ async def fail_card_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_return_card( - cls, card: str, **params: Unpack["CardReturnCardParams"] + cls, card: str, /, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1743,7 +1743,7 @@ def _cls_return_card( @overload @staticmethod def return_card( - card: str, **params: Unpack["CardReturnCardParams"] + card: str, /, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1760,7 +1760,7 @@ def return_card( ... @class_method_variant("_cls_return_card") - def return_card( # pyright: ignore[reportGeneralTypeIssues] + def return_card( self, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ @@ -1779,7 +1779,7 @@ def return_card( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_return_card_async( - cls, card: str, **params: Unpack["CardReturnCardParams"] + cls, card: str, /, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1798,7 +1798,7 @@ async def _cls_return_card_async( @overload @staticmethod async def return_card_async( - card: str, **params: Unpack["CardReturnCardParams"] + card: str, /, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1815,7 +1815,7 @@ async def return_card_async( ... @class_method_variant("_cls_return_card_async") - async def return_card_async( # pyright: ignore[reportGeneralTypeIssues] + async def return_card_async( self, **params: Unpack["CardReturnCardParams"] ) -> "Card": """ @@ -1834,7 +1834,7 @@ async def return_card_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_ship_card( - cls, card: str, **params: Unpack["CardShipCardParams"] + cls, card: str, /, **params: Unpack["CardShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1853,7 +1853,7 @@ def _cls_ship_card( @overload @staticmethod def ship_card( - card: str, **params: Unpack["CardShipCardParams"] + card: str, /, **params: Unpack["CardShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1868,9 +1868,7 @@ def ship_card(self, **params: Unpack["CardShipCardParams"]) -> "Card": ... @class_method_variant("_cls_ship_card") - def ship_card( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["CardShipCardParams"] - ) -> "Card": + def ship_card(self, **params: Unpack["CardShipCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ @@ -1887,7 +1885,7 @@ def ship_card( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_ship_card_async( - cls, card: str, **params: Unpack["CardShipCardParams"] + cls, card: str, /, **params: Unpack["CardShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1906,7 +1904,7 @@ async def _cls_ship_card_async( @overload @staticmethod async def ship_card_async( - card: str, **params: Unpack["CardShipCardParams"] + card: str, /, **params: Unpack["CardShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1923,7 +1921,7 @@ async def ship_card_async( ... @class_method_variant("_cls_ship_card_async") - async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] + async def ship_card_async( self, **params: Unpack["CardShipCardParams"] ) -> "Card": """ @@ -1942,7 +1940,7 @@ async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_submit_card( - cls, card: str, **params: Unpack["CardSubmitCardParams"] + cls, card: str, /, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. @@ -1961,7 +1959,7 @@ def _cls_submit_card( @overload @staticmethod def submit_card( - card: str, **params: Unpack["CardSubmitCardParams"] + card: str, /, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. @@ -1978,7 +1976,7 @@ def submit_card( ... @class_method_variant("_cls_submit_card") - def submit_card( # pyright: ignore[reportGeneralTypeIssues] + def submit_card( self, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ @@ -1997,7 +1995,7 @@ def submit_card( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_submit_card_async( - cls, card: str, **params: Unpack["CardSubmitCardParams"] + cls, card: str, /, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. @@ -2016,7 +2014,7 @@ async def _cls_submit_card_async( @overload @staticmethod async def submit_card_async( - card: str, **params: Unpack["CardSubmitCardParams"] + card: str, /, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later. @@ -2033,7 +2031,7 @@ async def submit_card_async( ... @class_method_variant("_cls_submit_card_async") - async def submit_card_async( # pyright: ignore[reportGeneralTypeIssues] + async def submit_card_async( self, **params: Unpack["CardSubmitCardParams"] ) -> "Card": """ diff --git a/stripe/issuing/_card_service.py b/stripe/issuing/_card_service.py index 215290129..e00a25512 100644 --- a/stripe/issuing/_card_service.py +++ b/stripe/issuing/_card_service.py @@ -95,6 +95,7 @@ async def create_async( def retrieve( self, card: str, + /, params: Optional["CardRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -115,6 +116,7 @@ def retrieve( async def retrieve_async( self, card: str, + /, params: Optional["CardRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -135,6 +137,7 @@ async def retrieve_async( def update( self, card: str, + /, params: Optional["CardUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -155,6 +158,7 @@ def update( async def update_async( self, card: str, + /, params: Optional["CardUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 49407de60..a6e555b8b 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -115,11 +115,11 @@ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: Optional[ExpandableField["File"]] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ document: Optional[Document] @@ -1309,7 +1309,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["CardholderModifyParams"] + cls, id: str, /, **params: Unpack["CardholderModifyParams"] ) -> "Cardholder": """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1326,7 +1326,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["CardholderModifyParams"] + cls, id: str, /, **params: Unpack["CardholderModifyParams"] ) -> "Cardholder": """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. diff --git a/stripe/issuing/_cardholder_service.py b/stripe/issuing/_cardholder_service.py index 54affd264..8e9f98933 100644 --- a/stripe/issuing/_cardholder_service.py +++ b/stripe/issuing/_cardholder_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, cardholder: str, + /, params: Optional["CardholderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cardholder": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, cardholder: str, + /, params: Optional["CardholderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cardholder": @@ -147,6 +149,7 @@ async def retrieve_async( def update( self, cardholder: str, + /, params: Optional["CardholderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cardholder": @@ -169,6 +172,7 @@ def update( async def update_async( self, cardholder: str, + /, params: Optional["CardholderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cardholder": diff --git a/stripe/issuing/_credit_underwriting_record.py b/stripe/issuing/_credit_underwriting_record.py index 4e6439e36..e7c7a7589 100644 --- a/stripe/issuing/_credit_underwriting_record.py +++ b/stripe/issuing/_credit_underwriting_record.py @@ -454,6 +454,7 @@ class UnderwritingException(StripeObject): def _cls_correct( cls, credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordCorrectParams"], ) -> "CreditUnderwritingRecord": """ @@ -476,6 +477,7 @@ def _cls_correct( @staticmethod def correct( credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordCorrectParams"], ) -> "CreditUnderwritingRecord": """ @@ -493,7 +495,7 @@ def correct( ... @class_method_variant("_cls_correct") - def correct( # pyright: ignore[reportGeneralTypeIssues] + def correct( self, **params: Unpack["CreditUnderwritingRecordCorrectParams"] ) -> "CreditUnderwritingRecord": """ @@ -516,6 +518,7 @@ def correct( # pyright: ignore[reportGeneralTypeIssues] async def _cls_correct_async( cls, credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordCorrectParams"], ) -> "CreditUnderwritingRecord": """ @@ -538,6 +541,7 @@ async def _cls_correct_async( @staticmethod async def correct_async( credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordCorrectParams"], ) -> "CreditUnderwritingRecord": """ @@ -555,7 +559,7 @@ async def correct_async( ... @class_method_variant("_cls_correct_async") - async def correct_async( # pyright: ignore[reportGeneralTypeIssues] + async def correct_async( self, **params: Unpack["CreditUnderwritingRecordCorrectParams"] ) -> "CreditUnderwritingRecord": """ @@ -694,6 +698,7 @@ async def list_async( def _cls_report_decision( cls, credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"], ) -> "CreditUnderwritingRecord": """ @@ -716,6 +721,7 @@ def _cls_report_decision( @staticmethod def report_decision( credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"], ) -> "CreditUnderwritingRecord": """ @@ -733,7 +739,7 @@ def report_decision( ... @class_method_variant("_cls_report_decision") - def report_decision( # pyright: ignore[reportGeneralTypeIssues] + def report_decision( self, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"] ) -> "CreditUnderwritingRecord": """ @@ -756,6 +762,7 @@ def report_decision( # pyright: ignore[reportGeneralTypeIssues] async def _cls_report_decision_async( cls, credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"], ) -> "CreditUnderwritingRecord": """ @@ -778,6 +785,7 @@ async def _cls_report_decision_async( @staticmethod async def report_decision_async( credit_underwriting_record: str, + /, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"], ) -> "CreditUnderwritingRecord": """ @@ -795,7 +803,7 @@ async def report_decision_async( ... @class_method_variant("_cls_report_decision_async") - async def report_decision_async( # pyright: ignore[reportGeneralTypeIssues] + async def report_decision_async( self, **params: Unpack["CreditUnderwritingRecordReportDecisionParams"] ) -> "CreditUnderwritingRecord": """ diff --git a/stripe/issuing/_credit_underwriting_record_service.py b/stripe/issuing/_credit_underwriting_record_service.py index b67767b2a..de3728f35 100644 --- a/stripe/issuing/_credit_underwriting_record_service.py +++ b/stripe/issuing/_credit_underwriting_record_service.py @@ -73,6 +73,7 @@ async def list_async( def retrieve( self, credit_underwriting_record: str, + /, params: Optional["CreditUnderwritingRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": @@ -97,6 +98,7 @@ def retrieve( async def retrieve_async( self, credit_underwriting_record: str, + /, params: Optional["CreditUnderwritingRecordRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": @@ -121,6 +123,7 @@ async def retrieve_async( def correct( self, credit_underwriting_record: str, + /, params: Optional["CreditUnderwritingRecordCorrectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": @@ -145,6 +148,7 @@ def correct( async def correct_async( self, credit_underwriting_record: str, + /, params: Optional["CreditUnderwritingRecordCorrectParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": @@ -169,6 +173,7 @@ async def correct_async( def report_decision( self, credit_underwriting_record: str, + /, params: "CreditUnderwritingRecordReportDecisionParams", options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": @@ -193,6 +198,7 @@ def report_decision( async def report_decision_async( self, credit_underwriting_record: str, + /, params: "CreditUnderwritingRecordReportDecisionParams", options: Optional["RequestOptions"] = None, ) -> "CreditUnderwritingRecord": diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 3be965fae..06cf5a4d4 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -434,7 +434,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["DisputeModifyParams"] + cls, id: str, /, **params: Unpack["DisputeModifyParams"] ) -> "Dispute": """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. @@ -451,7 +451,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["DisputeModifyParams"] + cls, id: str, /, **params: Unpack["DisputeModifyParams"] ) -> "Dispute": """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. @@ -490,7 +490,7 @@ async def retrieve_async( @classmethod def _cls_submit( - cls, dispute: str, **params: Unpack["DisputeSubmitParams"] + cls, dispute: str, /, **params: Unpack["DisputeSubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -509,7 +509,7 @@ def _cls_submit( @overload @staticmethod def submit( - dispute: str, **params: Unpack["DisputeSubmitParams"] + dispute: str, /, **params: Unpack["DisputeSubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -524,9 +524,7 @@ def submit(self, **params: Unpack["DisputeSubmitParams"]) -> "Dispute": ... @class_method_variant("_cls_submit") - def submit( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["DisputeSubmitParams"] - ) -> "Dispute": + def submit(self, **params: Unpack["DisputeSubmitParams"]) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ @@ -543,7 +541,7 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_submit_async( - cls, dispute: str, **params: Unpack["DisputeSubmitParams"] + cls, dispute: str, /, **params: Unpack["DisputeSubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -562,7 +560,7 @@ async def _cls_submit_async( @overload @staticmethod async def submit_async( - dispute: str, **params: Unpack["DisputeSubmitParams"] + dispute: str, /, **params: Unpack["DisputeSubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -579,7 +577,7 @@ async def submit_async( ... @class_method_variant("_cls_submit_async") - async def submit_async( # pyright: ignore[reportGeneralTypeIssues] + async def submit_async( self, **params: Unpack["DisputeSubmitParams"] ) -> "Dispute": """ diff --git a/stripe/issuing/_dispute_service.py b/stripe/issuing/_dispute_service.py index 2631bd197..498cd7415 100644 --- a/stripe/issuing/_dispute_service.py +++ b/stripe/issuing/_dispute_service.py @@ -104,6 +104,7 @@ async def create_async( def retrieve( self, dispute: str, + /, params: Optional["DisputeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -126,6 +127,7 @@ def retrieve( async def retrieve_async( self, dispute: str, + /, params: Optional["DisputeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -148,6 +150,7 @@ async def retrieve_async( def update( self, dispute: str, + /, params: Optional["DisputeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -170,6 +173,7 @@ def update( async def update_async( self, dispute: str, + /, params: Optional["DisputeUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -192,6 +196,7 @@ async def update_async( def submit( self, dispute: str, + /, params: Optional["DisputeSubmitParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": @@ -214,6 +219,7 @@ def submit( async def submit_async( self, dispute: str, + /, params: Optional["DisputeSubmitParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Dispute": diff --git a/stripe/issuing/_dispute_settlement_detail_service.py b/stripe/issuing/_dispute_settlement_detail_service.py index 792a52fed..afff6aa44 100644 --- a/stripe/issuing/_dispute_settlement_detail_service.py +++ b/stripe/issuing/_dispute_settlement_detail_service.py @@ -61,6 +61,7 @@ async def list_async( def retrieve( self, dispute_settlement_detail: str, + /, params: Optional["DisputeSettlementDetailRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DisputeSettlementDetail": @@ -85,6 +86,7 @@ def retrieve( async def retrieve_async( self, dispute_settlement_detail: str, + /, params: Optional["DisputeSettlementDetailRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DisputeSettlementDetail": diff --git a/stripe/issuing/_fraud_liability_debit_service.py b/stripe/issuing/_fraud_liability_debit_service.py index 542c492fd..81eb44168 100644 --- a/stripe/issuing/_fraud_liability_debit_service.py +++ b/stripe/issuing/_fraud_liability_debit_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, fraud_liability_debit: str, + /, params: Optional["FraudLiabilityDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FraudLiabilityDebit": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, fraud_liability_debit: str, + /, params: Optional["FraudLiabilityDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FraudLiabilityDebit": diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index cc45c428a..7f074a695 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -240,7 +240,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["PersonalizationDesignModifyParams"] + cls, id: str, /, **params: Unpack["PersonalizationDesignModifyParams"] ) -> "PersonalizationDesign": """ Updates a card personalization object. @@ -257,7 +257,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["PersonalizationDesignModifyParams"] + cls, id: str, /, **params: Unpack["PersonalizationDesignModifyParams"] ) -> "PersonalizationDesign": """ Updates a card personalization object. @@ -301,6 +301,7 @@ class TestHelpers(APIResourceTestHelpers["PersonalizationDesign"]): def _cls_activate( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignActivateParams"], ) -> "PersonalizationDesign": """ @@ -323,6 +324,7 @@ def _cls_activate( @staticmethod def activate( personalization_design: str, + /, **params: Unpack["PersonalizationDesignActivateParams"], ) -> "PersonalizationDesign": """ @@ -340,7 +342,7 @@ def activate( ... @class_method_variant("_cls_activate") - def activate( # pyright: ignore[reportGeneralTypeIssues] + def activate( self, **params: Unpack["PersonalizationDesignActivateParams"] ) -> "PersonalizationDesign": """ @@ -363,6 +365,7 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_activate_async( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignActivateParams"], ) -> "PersonalizationDesign": """ @@ -385,6 +388,7 @@ async def _cls_activate_async( @staticmethod async def activate_async( personalization_design: str, + /, **params: Unpack["PersonalizationDesignActivateParams"], ) -> "PersonalizationDesign": """ @@ -402,7 +406,7 @@ async def activate_async( ... @class_method_variant("_cls_activate_async") - async def activate_async( # pyright: ignore[reportGeneralTypeIssues] + async def activate_async( self, **params: Unpack["PersonalizationDesignActivateParams"] ) -> "PersonalizationDesign": """ @@ -425,6 +429,7 @@ async def activate_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_deactivate( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignDeactivateParams"], ) -> "PersonalizationDesign": """ @@ -447,6 +452,7 @@ def _cls_deactivate( @staticmethod def deactivate( personalization_design: str, + /, **params: Unpack["PersonalizationDesignDeactivateParams"], ) -> "PersonalizationDesign": """ @@ -464,7 +470,7 @@ def deactivate( ... @class_method_variant("_cls_deactivate") - def deactivate( # pyright: ignore[reportGeneralTypeIssues] + def deactivate( self, **params: Unpack["PersonalizationDesignDeactivateParams"] ) -> "PersonalizationDesign": """ @@ -487,6 +493,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] async def _cls_deactivate_async( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignDeactivateParams"], ) -> "PersonalizationDesign": """ @@ -509,6 +516,7 @@ async def _cls_deactivate_async( @staticmethod async def deactivate_async( personalization_design: str, + /, **params: Unpack["PersonalizationDesignDeactivateParams"], ) -> "PersonalizationDesign": """ @@ -526,7 +534,7 @@ async def deactivate_async( ... @class_method_variant("_cls_deactivate_async") - async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + async def deactivate_async( self, **params: Unpack["PersonalizationDesignDeactivateParams"] ) -> "PersonalizationDesign": """ @@ -549,6 +557,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_reject( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignRejectParams"], ) -> "PersonalizationDesign": """ @@ -571,6 +580,7 @@ def _cls_reject( @staticmethod def reject( personalization_design: str, + /, **params: Unpack["PersonalizationDesignRejectParams"], ) -> "PersonalizationDesign": """ @@ -588,7 +598,7 @@ def reject( ... @class_method_variant("_cls_reject") - def reject( # pyright: ignore[reportGeneralTypeIssues] + def reject( self, **params: Unpack["PersonalizationDesignRejectParams"] ) -> "PersonalizationDesign": """ @@ -611,6 +621,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] async def _cls_reject_async( cls, personalization_design: str, + /, **params: Unpack["PersonalizationDesignRejectParams"], ) -> "PersonalizationDesign": """ @@ -633,6 +644,7 @@ async def _cls_reject_async( @staticmethod async def reject_async( personalization_design: str, + /, **params: Unpack["PersonalizationDesignRejectParams"], ) -> "PersonalizationDesign": """ @@ -650,7 +662,7 @@ async def reject_async( ... @class_method_variant("_cls_reject_async") - async def reject_async( # pyright: ignore[reportGeneralTypeIssues] + async def reject_async( self, **params: Unpack["PersonalizationDesignRejectParams"] ) -> "PersonalizationDesign": """ diff --git a/stripe/issuing/_personalization_design_service.py b/stripe/issuing/_personalization_design_service.py index 0738bf406..285b11c59 100644 --- a/stripe/issuing/_personalization_design_service.py +++ b/stripe/issuing/_personalization_design_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, personalization_design: str, + /, params: Optional["PersonalizationDesignRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, personalization_design: str, + /, params: Optional["PersonalizationDesignRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -147,6 +149,7 @@ async def retrieve_async( def update( self, personalization_design: str, + /, params: Optional["PersonalizationDesignUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -169,6 +172,7 @@ def update( async def update_async( self, personalization_design: str, + /, params: Optional["PersonalizationDesignUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": diff --git a/stripe/issuing/_physical_bundle_service.py b/stripe/issuing/_physical_bundle_service.py index d3cba2006..3b338da3e 100644 --- a/stripe/issuing/_physical_bundle_service.py +++ b/stripe/issuing/_physical_bundle_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, physical_bundle: str, + /, params: Optional["PhysicalBundleRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PhysicalBundle": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, physical_bundle: str, + /, params: Optional["PhysicalBundleRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PhysicalBundle": diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index d222b2f1d..fd26903e2 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -55,7 +55,7 @@ class Device(StripeObject): class Mastercard(StripeObject): card_reference_id: Optional[str] """ - A unique reference ID from MasterCard to represent the card account number. + A unique reference ID from Mastercard to represent the card account number. """ token_reference_id: str """ @@ -63,11 +63,11 @@ class Mastercard(StripeObject): """ token_requestor_id: str """ - The ID of the entity requesting tokenization, specific to MasterCard. + The ID of the entity requesting tokenization, specific to Mastercard. """ token_requestor_name: Optional[str] """ - The name of the entity requesting tokenization, if known. This is directly provided from MasterCard. + The name of the entity requesting tokenization, if known. This is directly provided from Mastercard. """ class Visa(StripeObject): @@ -280,7 +280,9 @@ async def list_async( return result @classmethod - def modify(cls, id: str, **params: Unpack["TokenModifyParams"]) -> "Token": + def modify( + cls, id: str, /, **params: Unpack["TokenModifyParams"] + ) -> "Token": """ Attempts to update the specified Issuing Token object to the status specified. """ @@ -296,7 +298,7 @@ def modify(cls, id: str, **params: Unpack["TokenModifyParams"]) -> "Token": @classmethod async def modify_async( - cls, id: str, **params: Unpack["TokenModifyParams"] + cls, id: str, /, **params: Unpack["TokenModifyParams"] ) -> "Token": """ Attempts to update the specified Issuing Token object to the status specified. diff --git a/stripe/issuing/_token_service.py b/stripe/issuing/_token_service.py index 8146af5c3..d78a54920 100644 --- a/stripe/issuing/_token_service.py +++ b/stripe/issuing/_token_service.py @@ -58,6 +58,7 @@ async def list_async( def retrieve( self, token: str, + /, params: Optional["TokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Token": @@ -78,6 +79,7 @@ def retrieve( async def retrieve_async( self, token: str, + /, params: Optional["TokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Token": @@ -98,6 +100,7 @@ async def retrieve_async( def update( self, token: str, + /, params: "TokenUpdateParams", options: Optional["RequestOptions"] = None, ) -> "Token": @@ -118,6 +121,7 @@ def update( async def update_async( self, token: str, + /, params: "TokenUpdateParams", options: Optional["RequestOptions"] = None, ) -> "Token": diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index b2c688469..ca17f2601 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -510,7 +510,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["TransactionModifyParams"] + cls, id: str, /, **params: Unpack["TransactionModifyParams"] ) -> "Transaction": """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -527,7 +527,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["TransactionModifyParams"] + cls, id: str, /, **params: Unpack["TransactionModifyParams"] ) -> "Transaction": """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -633,7 +633,10 @@ async def create_unlinked_refund_async( @classmethod def _cls_refund( - cls, transaction: str, **params: Unpack["TransactionRefundParams"] + cls, + transaction: str, + /, + **params: Unpack["TransactionRefundParams"], ) -> "Transaction": """ Refund a test-mode Transaction. @@ -652,7 +655,7 @@ def _cls_refund( @overload @staticmethod def refund( - transaction: str, **params: Unpack["TransactionRefundParams"] + transaction: str, /, **params: Unpack["TransactionRefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -669,7 +672,7 @@ def refund( ... @class_method_variant("_cls_refund") - def refund( # pyright: ignore[reportGeneralTypeIssues] + def refund( self, **params: Unpack["TransactionRefundParams"] ) -> "Transaction": """ @@ -688,7 +691,10 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_refund_async( - cls, transaction: str, **params: Unpack["TransactionRefundParams"] + cls, + transaction: str, + /, + **params: Unpack["TransactionRefundParams"], ) -> "Transaction": """ Refund a test-mode Transaction. @@ -707,7 +713,7 @@ async def _cls_refund_async( @overload @staticmethod async def refund_async( - transaction: str, **params: Unpack["TransactionRefundParams"] + transaction: str, /, **params: Unpack["TransactionRefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -724,7 +730,7 @@ async def refund_async( ... @class_method_variant("_cls_refund_async") - async def refund_async( # pyright: ignore[reportGeneralTypeIssues] + async def refund_async( self, **params: Unpack["TransactionRefundParams"] ) -> "Transaction": """ diff --git a/stripe/issuing/_transaction_service.py b/stripe/issuing/_transaction_service.py index 8c888266c..33e35d5a6 100644 --- a/stripe/issuing/_transaction_service.py +++ b/stripe/issuing/_transaction_service.py @@ -62,6 +62,7 @@ async def list_async( def retrieve( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -84,6 +85,7 @@ def retrieve( async def retrieve_async( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -106,6 +108,7 @@ async def retrieve_async( def update( self, transaction: str, + /, params: Optional["TransactionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -128,6 +131,7 @@ def update( async def update_async( self, transaction: str, + /, params: Optional["TransactionUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index 3ce76ff15..e2b631155 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -26,6 +26,7 @@ tax as tax, terminal as terminal, test_helpers as test_helpers, + three_d_secure as three_d_secure, treasury as treasury, ) from stripe.params._account_capability_list_params import ( @@ -68,6 +69,7 @@ AccountCreateParamsCapabilitiesBilliePayments as AccountCreateParamsCapabilitiesBilliePayments, AccountCreateParamsCapabilitiesBizumPayments as AccountCreateParamsCapabilitiesBizumPayments, AccountCreateParamsCapabilitiesBlikPayments as AccountCreateParamsCapabilitiesBlikPayments, + AccountCreateParamsCapabilitiesBlikRecurringPayments as AccountCreateParamsCapabilitiesBlikRecurringPayments, AccountCreateParamsCapabilitiesBoletoPayments as AccountCreateParamsCapabilitiesBoletoPayments, AccountCreateParamsCapabilitiesCardIssuing as AccountCreateParamsCapabilitiesCardIssuing, AccountCreateParamsCapabilitiesCardPayments as AccountCreateParamsCapabilitiesCardPayments, @@ -116,6 +118,7 @@ AccountCreateParamsCapabilitiesScalapayPayments as AccountCreateParamsCapabilitiesScalapayPayments, AccountCreateParamsCapabilitiesSepaBankTransferPayments as AccountCreateParamsCapabilitiesSepaBankTransferPayments, AccountCreateParamsCapabilitiesSepaDebitPayments as AccountCreateParamsCapabilitiesSepaDebitPayments, + AccountCreateParamsCapabilitiesSequraPayments as AccountCreateParamsCapabilitiesSequraPayments, AccountCreateParamsCapabilitiesShopeepayPayments as AccountCreateParamsCapabilitiesShopeepayPayments, AccountCreateParamsCapabilitiesSofortPayments as AccountCreateParamsCapabilitiesSofortPayments, AccountCreateParamsCapabilitiesStripeBalancePayments as AccountCreateParamsCapabilitiesStripeBalancePayments, @@ -195,6 +198,7 @@ AccountCreateParamsSettingsPaypayPaymentsSiteAccessible as AccountCreateParamsSettingsPaypayPaymentsSiteAccessible, AccountCreateParamsSettingsPaypayPaymentsSiteInDevelopment as AccountCreateParamsSettingsPaypayPaymentsSiteInDevelopment, AccountCreateParamsSettingsPaypayPaymentsSiteRestricted as AccountCreateParamsSettingsPaypayPaymentsSiteRestricted, + AccountCreateParamsSettingsSepaDebitPayments as AccountCreateParamsSettingsSepaDebitPayments, AccountCreateParamsSettingsSmartDisputes as AccountCreateParamsSettingsSmartDisputes, AccountCreateParamsSettingsSmartDisputesAutoRespond as AccountCreateParamsSettingsSmartDisputesAutoRespond, AccountCreateParamsSettingsTaxForms as AccountCreateParamsSettingsTaxForms, @@ -485,6 +489,7 @@ AccountUpdateParamsCapabilitiesBilliePayments as AccountUpdateParamsCapabilitiesBilliePayments, AccountUpdateParamsCapabilitiesBizumPayments as AccountUpdateParamsCapabilitiesBizumPayments, AccountUpdateParamsCapabilitiesBlikPayments as AccountUpdateParamsCapabilitiesBlikPayments, + AccountUpdateParamsCapabilitiesBlikRecurringPayments as AccountUpdateParamsCapabilitiesBlikRecurringPayments, AccountUpdateParamsCapabilitiesBoletoPayments as AccountUpdateParamsCapabilitiesBoletoPayments, AccountUpdateParamsCapabilitiesCardIssuing as AccountUpdateParamsCapabilitiesCardIssuing, AccountUpdateParamsCapabilitiesCardPayments as AccountUpdateParamsCapabilitiesCardPayments, @@ -533,6 +538,7 @@ AccountUpdateParamsCapabilitiesScalapayPayments as AccountUpdateParamsCapabilitiesScalapayPayments, AccountUpdateParamsCapabilitiesSepaBankTransferPayments as AccountUpdateParamsCapabilitiesSepaBankTransferPayments, AccountUpdateParamsCapabilitiesSepaDebitPayments as AccountUpdateParamsCapabilitiesSepaDebitPayments, + AccountUpdateParamsCapabilitiesSequraPayments as AccountUpdateParamsCapabilitiesSequraPayments, AccountUpdateParamsCapabilitiesShopeepayPayments as AccountUpdateParamsCapabilitiesShopeepayPayments, AccountUpdateParamsCapabilitiesSofortPayments as AccountUpdateParamsCapabilitiesSofortPayments, AccountUpdateParamsCapabilitiesStripeBalancePayments as AccountUpdateParamsCapabilitiesStripeBalancePayments, @@ -1005,6 +1011,7 @@ ConfirmationTokenCreateParamsPaymentMethodDataSatispay as ConfirmationTokenCreateParamsPaymentMethodDataSatispay, ConfirmationTokenCreateParamsPaymentMethodDataScalapay as ConfirmationTokenCreateParamsPaymentMethodDataScalapay, ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit as ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit, + ConfirmationTokenCreateParamsPaymentMethodDataSequra as ConfirmationTokenCreateParamsPaymentMethodDataSequra, ConfirmationTokenCreateParamsPaymentMethodDataShopeepay as ConfirmationTokenCreateParamsPaymentMethodDataShopeepay, ConfirmationTokenCreateParamsPaymentMethodDataSofort as ConfirmationTokenCreateParamsPaymentMethodDataSofort, ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance as ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance, @@ -1327,6 +1334,8 @@ from stripe.params._dispute_modify_params import ( DisputeModifyParams as DisputeModifyParams, DisputeModifyParamsEvidence as DisputeModifyParamsEvidence, + DisputeModifyParamsEvidenceAppeal as DisputeModifyParamsEvidenceAppeal, + DisputeModifyParamsEvidenceAppealCard as DisputeModifyParamsEvidenceAppealCard, DisputeModifyParamsEvidenceEnhancedEvidence as DisputeModifyParamsEvidenceEnhancedEvidence, DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance as DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance, DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3 as DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3, @@ -1342,6 +1351,8 @@ from stripe.params._dispute_update_params import ( DisputeUpdateParams as DisputeUpdateParams, DisputeUpdateParamsEvidence as DisputeUpdateParamsEvidence, + DisputeUpdateParamsEvidenceAppeal as DisputeUpdateParamsEvidenceAppeal, + DisputeUpdateParamsEvidenceAppealCard as DisputeUpdateParamsEvidenceAppealCard, DisputeUpdateParamsEvidenceEnhancedEvidence as DisputeUpdateParamsEvidenceEnhancedEvidence, DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance as DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance, DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3 as DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3, @@ -1464,6 +1475,8 @@ InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBancontact as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBancontact, InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillie as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillie, + InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBlik as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBlik, InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCard as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCard, InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments as InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments, @@ -1582,6 +1595,7 @@ InvoiceCreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd as InvoiceCreatePreviewParamsScheduleDetailsPrebillingBillUntilAmendmentEnd, InvoiceCreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration as InvoiceCreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration, InvoiceCreatePreviewParamsSubscriptionDetails as InvoiceCreatePreviewParamsSubscriptionDetails, + InvoiceCreatePreviewParamsSubscriptionDetailsBillingCycleAnchor as InvoiceCreatePreviewParamsSubscriptionDetailsBillingCycleAnchor, InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode as InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode, InvoiceCreatePreviewParamsSubscriptionDetailsBillingModeFlexible as InvoiceCreatePreviewParamsSubscriptionDetailsBillingModeFlexible, InvoiceCreatePreviewParamsSubscriptionDetailsBillingSchedule as InvoiceCreatePreviewParamsSubscriptionDetailsBillingSchedule, @@ -1691,6 +1705,8 @@ InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBancontact as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBancontact, InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillie as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillie, + InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBlik as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBlik, InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCard as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCard, InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments as InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments, @@ -1788,6 +1804,8 @@ InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact, InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillie as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillie, + InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBlik as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBlik, InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCard as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCard, InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments as InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments, @@ -2361,6 +2379,7 @@ PaymentIntentConfirmParamsPaymentMethodDataSatispay as PaymentIntentConfirmParamsPaymentMethodDataSatispay, PaymentIntentConfirmParamsPaymentMethodDataScalapay as PaymentIntentConfirmParamsPaymentMethodDataScalapay, PaymentIntentConfirmParamsPaymentMethodDataSepaDebit as PaymentIntentConfirmParamsPaymentMethodDataSepaDebit, + PaymentIntentConfirmParamsPaymentMethodDataSequra as PaymentIntentConfirmParamsPaymentMethodDataSequra, PaymentIntentConfirmParamsPaymentMethodDataShopeepay as PaymentIntentConfirmParamsPaymentMethodDataShopeepay, PaymentIntentConfirmParamsPaymentMethodDataSofort as PaymentIntentConfirmParamsPaymentMethodDataSofort, PaymentIntentConfirmParamsPaymentMethodDataStripeBalance as PaymentIntentConfirmParamsPaymentMethodDataStripeBalance, @@ -2385,8 +2404,11 @@ PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions as PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions, PaymentIntentConfirmParamsPaymentMethodOptionsBancontact as PaymentIntentConfirmParamsPaymentMethodOptionsBancontact, PaymentIntentConfirmParamsPaymentMethodOptionsBillie as PaymentIntentConfirmParamsPaymentMethodOptionsBillie, + PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetails as PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetails, + PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, PaymentIntentConfirmParamsPaymentMethodOptionsBizum as PaymentIntentConfirmParamsPaymentMethodOptionsBizum, PaymentIntentConfirmParamsPaymentMethodOptionsBlik as PaymentIntentConfirmParamsPaymentMethodOptionsBlik, + PaymentIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions as PaymentIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions, PaymentIntentConfirmParamsPaymentMethodOptionsBoleto as PaymentIntentConfirmParamsPaymentMethodOptionsBoleto, PaymentIntentConfirmParamsPaymentMethodOptionsCard as PaymentIntentConfirmParamsPaymentMethodOptionsCard, PaymentIntentConfirmParamsPaymentMethodOptionsCardInstallments as PaymentIntentConfirmParamsPaymentMethodOptionsCardInstallments, @@ -2483,6 +2505,7 @@ PaymentIntentConfirmParamsPaymentMethodOptionsScalapay as PaymentIntentConfirmParamsPaymentMethodOptionsScalapay, PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebit as PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebit, PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions as PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions, + PaymentIntentConfirmParamsPaymentMethodOptionsSequra as PaymentIntentConfirmParamsPaymentMethodOptionsSequra, PaymentIntentConfirmParamsPaymentMethodOptionsShopeepay as PaymentIntentConfirmParamsPaymentMethodOptionsShopeepay, PaymentIntentConfirmParamsPaymentMethodOptionsSofort as PaymentIntentConfirmParamsPaymentMethodOptionsSofort, PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance as PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance, @@ -2650,6 +2673,7 @@ PaymentIntentCreateParamsPaymentMethodDataSatispay as PaymentIntentCreateParamsPaymentMethodDataSatispay, PaymentIntentCreateParamsPaymentMethodDataScalapay as PaymentIntentCreateParamsPaymentMethodDataScalapay, PaymentIntentCreateParamsPaymentMethodDataSepaDebit as PaymentIntentCreateParamsPaymentMethodDataSepaDebit, + PaymentIntentCreateParamsPaymentMethodDataSequra as PaymentIntentCreateParamsPaymentMethodDataSequra, PaymentIntentCreateParamsPaymentMethodDataShopeepay as PaymentIntentCreateParamsPaymentMethodDataShopeepay, PaymentIntentCreateParamsPaymentMethodDataSofort as PaymentIntentCreateParamsPaymentMethodDataSofort, PaymentIntentCreateParamsPaymentMethodDataStripeBalance as PaymentIntentCreateParamsPaymentMethodDataStripeBalance, @@ -2674,8 +2698,11 @@ PaymentIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions as PaymentIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions, PaymentIntentCreateParamsPaymentMethodOptionsBancontact as PaymentIntentCreateParamsPaymentMethodOptionsBancontact, PaymentIntentCreateParamsPaymentMethodOptionsBillie as PaymentIntentCreateParamsPaymentMethodOptionsBillie, + PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetails as PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetails, + PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, PaymentIntentCreateParamsPaymentMethodOptionsBizum as PaymentIntentCreateParamsPaymentMethodOptionsBizum, PaymentIntentCreateParamsPaymentMethodOptionsBlik as PaymentIntentCreateParamsPaymentMethodOptionsBlik, + PaymentIntentCreateParamsPaymentMethodOptionsBlikMandateOptions as PaymentIntentCreateParamsPaymentMethodOptionsBlikMandateOptions, PaymentIntentCreateParamsPaymentMethodOptionsBoleto as PaymentIntentCreateParamsPaymentMethodOptionsBoleto, PaymentIntentCreateParamsPaymentMethodOptionsCard as PaymentIntentCreateParamsPaymentMethodOptionsCard, PaymentIntentCreateParamsPaymentMethodOptionsCardInstallments as PaymentIntentCreateParamsPaymentMethodOptionsCardInstallments, @@ -2772,6 +2799,7 @@ PaymentIntentCreateParamsPaymentMethodOptionsScalapay as PaymentIntentCreateParamsPaymentMethodOptionsScalapay, PaymentIntentCreateParamsPaymentMethodOptionsSepaDebit as PaymentIntentCreateParamsPaymentMethodOptionsSepaDebit, PaymentIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions as PaymentIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions, + PaymentIntentCreateParamsPaymentMethodOptionsSequra as PaymentIntentCreateParamsPaymentMethodOptionsSequra, PaymentIntentCreateParamsPaymentMethodOptionsShopeepay as PaymentIntentCreateParamsPaymentMethodOptionsShopeepay, PaymentIntentCreateParamsPaymentMethodOptionsSofort as PaymentIntentCreateParamsPaymentMethodOptionsSofort, PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance as PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance, @@ -2986,6 +3014,7 @@ PaymentIntentModifyParamsPaymentMethodDataSatispay as PaymentIntentModifyParamsPaymentMethodDataSatispay, PaymentIntentModifyParamsPaymentMethodDataScalapay as PaymentIntentModifyParamsPaymentMethodDataScalapay, PaymentIntentModifyParamsPaymentMethodDataSepaDebit as PaymentIntentModifyParamsPaymentMethodDataSepaDebit, + PaymentIntentModifyParamsPaymentMethodDataSequra as PaymentIntentModifyParamsPaymentMethodDataSequra, PaymentIntentModifyParamsPaymentMethodDataShopeepay as PaymentIntentModifyParamsPaymentMethodDataShopeepay, PaymentIntentModifyParamsPaymentMethodDataSofort as PaymentIntentModifyParamsPaymentMethodDataSofort, PaymentIntentModifyParamsPaymentMethodDataStripeBalance as PaymentIntentModifyParamsPaymentMethodDataStripeBalance, @@ -3010,8 +3039,11 @@ PaymentIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions as PaymentIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions, PaymentIntentModifyParamsPaymentMethodOptionsBancontact as PaymentIntentModifyParamsPaymentMethodOptionsBancontact, PaymentIntentModifyParamsPaymentMethodOptionsBillie as PaymentIntentModifyParamsPaymentMethodOptionsBillie, + PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetails as PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetails, + PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, PaymentIntentModifyParamsPaymentMethodOptionsBizum as PaymentIntentModifyParamsPaymentMethodOptionsBizum, PaymentIntentModifyParamsPaymentMethodOptionsBlik as PaymentIntentModifyParamsPaymentMethodOptionsBlik, + PaymentIntentModifyParamsPaymentMethodOptionsBlikMandateOptions as PaymentIntentModifyParamsPaymentMethodOptionsBlikMandateOptions, PaymentIntentModifyParamsPaymentMethodOptionsBoleto as PaymentIntentModifyParamsPaymentMethodOptionsBoleto, PaymentIntentModifyParamsPaymentMethodOptionsCard as PaymentIntentModifyParamsPaymentMethodOptionsCard, PaymentIntentModifyParamsPaymentMethodOptionsCardInstallments as PaymentIntentModifyParamsPaymentMethodOptionsCardInstallments, @@ -3108,6 +3140,7 @@ PaymentIntentModifyParamsPaymentMethodOptionsScalapay as PaymentIntentModifyParamsPaymentMethodOptionsScalapay, PaymentIntentModifyParamsPaymentMethodOptionsSepaDebit as PaymentIntentModifyParamsPaymentMethodOptionsSepaDebit, PaymentIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions as PaymentIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions, + PaymentIntentModifyParamsPaymentMethodOptionsSequra as PaymentIntentModifyParamsPaymentMethodOptionsSequra, PaymentIntentModifyParamsPaymentMethodOptionsShopeepay as PaymentIntentModifyParamsPaymentMethodOptionsShopeepay, PaymentIntentModifyParamsPaymentMethodOptionsSofort as PaymentIntentModifyParamsPaymentMethodOptionsSofort, PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance as PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance, @@ -3284,6 +3317,7 @@ PaymentIntentUpdateParamsPaymentMethodDataSatispay as PaymentIntentUpdateParamsPaymentMethodDataSatispay, PaymentIntentUpdateParamsPaymentMethodDataScalapay as PaymentIntentUpdateParamsPaymentMethodDataScalapay, PaymentIntentUpdateParamsPaymentMethodDataSepaDebit as PaymentIntentUpdateParamsPaymentMethodDataSepaDebit, + PaymentIntentUpdateParamsPaymentMethodDataSequra as PaymentIntentUpdateParamsPaymentMethodDataSequra, PaymentIntentUpdateParamsPaymentMethodDataShopeepay as PaymentIntentUpdateParamsPaymentMethodDataShopeepay, PaymentIntentUpdateParamsPaymentMethodDataSofort as PaymentIntentUpdateParamsPaymentMethodDataSofort, PaymentIntentUpdateParamsPaymentMethodDataStripeBalance as PaymentIntentUpdateParamsPaymentMethodDataStripeBalance, @@ -3308,8 +3342,11 @@ PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions as PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions, PaymentIntentUpdateParamsPaymentMethodOptionsBancontact as PaymentIntentUpdateParamsPaymentMethodOptionsBancontact, PaymentIntentUpdateParamsPaymentMethodOptionsBillie as PaymentIntentUpdateParamsPaymentMethodOptionsBillie, + PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetails as PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetails, + PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, PaymentIntentUpdateParamsPaymentMethodOptionsBizum as PaymentIntentUpdateParamsPaymentMethodOptionsBizum, PaymentIntentUpdateParamsPaymentMethodOptionsBlik as PaymentIntentUpdateParamsPaymentMethodOptionsBlik, + PaymentIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions as PaymentIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions, PaymentIntentUpdateParamsPaymentMethodOptionsBoleto as PaymentIntentUpdateParamsPaymentMethodOptionsBoleto, PaymentIntentUpdateParamsPaymentMethodOptionsCard as PaymentIntentUpdateParamsPaymentMethodOptionsCard, PaymentIntentUpdateParamsPaymentMethodOptionsCardInstallments as PaymentIntentUpdateParamsPaymentMethodOptionsCardInstallments, @@ -3406,6 +3443,7 @@ PaymentIntentUpdateParamsPaymentMethodOptionsScalapay as PaymentIntentUpdateParamsPaymentMethodOptionsScalapay, PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebit as PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebit, PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions as PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions, + PaymentIntentUpdateParamsPaymentMethodOptionsSequra as PaymentIntentUpdateParamsPaymentMethodOptionsSequra, PaymentIntentUpdateParamsPaymentMethodOptionsShopeepay as PaymentIntentUpdateParamsPaymentMethodOptionsShopeepay, PaymentIntentUpdateParamsPaymentMethodOptionsSofort as PaymentIntentUpdateParamsPaymentMethodOptionsSofort, PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance as PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance, @@ -3711,6 +3749,8 @@ PaymentMethodConfigurationCreateParamsScalapayDisplayPreference as PaymentMethodConfigurationCreateParamsScalapayDisplayPreference, PaymentMethodConfigurationCreateParamsSepaDebit as PaymentMethodConfigurationCreateParamsSepaDebit, PaymentMethodConfigurationCreateParamsSepaDebitDisplayPreference as PaymentMethodConfigurationCreateParamsSepaDebitDisplayPreference, + PaymentMethodConfigurationCreateParamsSequra as PaymentMethodConfigurationCreateParamsSequra, + PaymentMethodConfigurationCreateParamsSequraDisplayPreference as PaymentMethodConfigurationCreateParamsSequraDisplayPreference, PaymentMethodConfigurationCreateParamsShopeepay as PaymentMethodConfigurationCreateParamsShopeepay, PaymentMethodConfigurationCreateParamsShopeepayDisplayPreference as PaymentMethodConfigurationCreateParamsShopeepayDisplayPreference, PaymentMethodConfigurationCreateParamsSofort as PaymentMethodConfigurationCreateParamsSofort, @@ -3847,6 +3887,8 @@ PaymentMethodConfigurationModifyParamsScalapayDisplayPreference as PaymentMethodConfigurationModifyParamsScalapayDisplayPreference, PaymentMethodConfigurationModifyParamsSepaDebit as PaymentMethodConfigurationModifyParamsSepaDebit, PaymentMethodConfigurationModifyParamsSepaDebitDisplayPreference as PaymentMethodConfigurationModifyParamsSepaDebitDisplayPreference, + PaymentMethodConfigurationModifyParamsSequra as PaymentMethodConfigurationModifyParamsSequra, + PaymentMethodConfigurationModifyParamsSequraDisplayPreference as PaymentMethodConfigurationModifyParamsSequraDisplayPreference, PaymentMethodConfigurationModifyParamsShopeepay as PaymentMethodConfigurationModifyParamsShopeepay, PaymentMethodConfigurationModifyParamsShopeepayDisplayPreference as PaymentMethodConfigurationModifyParamsShopeepayDisplayPreference, PaymentMethodConfigurationModifyParamsSofort as PaymentMethodConfigurationModifyParamsSofort, @@ -3983,6 +4025,8 @@ PaymentMethodConfigurationUpdateParamsScalapayDisplayPreference as PaymentMethodConfigurationUpdateParamsScalapayDisplayPreference, PaymentMethodConfigurationUpdateParamsSepaDebit as PaymentMethodConfigurationUpdateParamsSepaDebit, PaymentMethodConfigurationUpdateParamsSepaDebitDisplayPreference as PaymentMethodConfigurationUpdateParamsSepaDebitDisplayPreference, + PaymentMethodConfigurationUpdateParamsSequra as PaymentMethodConfigurationUpdateParamsSequra, + PaymentMethodConfigurationUpdateParamsSequraDisplayPreference as PaymentMethodConfigurationUpdateParamsSequraDisplayPreference, PaymentMethodConfigurationUpdateParamsShopeepay as PaymentMethodConfigurationUpdateParamsShopeepay, PaymentMethodConfigurationUpdateParamsShopeepayDisplayPreference as PaymentMethodConfigurationUpdateParamsShopeepayDisplayPreference, PaymentMethodConfigurationUpdateParamsSofort as PaymentMethodConfigurationUpdateParamsSofort, @@ -4063,6 +4107,7 @@ PaymentMethodCreateParamsSatispay as PaymentMethodCreateParamsSatispay, PaymentMethodCreateParamsScalapay as PaymentMethodCreateParamsScalapay, PaymentMethodCreateParamsSepaDebit as PaymentMethodCreateParamsSepaDebit, + PaymentMethodCreateParamsSequra as PaymentMethodCreateParamsSequra, PaymentMethodCreateParamsShopeepay as PaymentMethodCreateParamsShopeepay, PaymentMethodCreateParamsSofort as PaymentMethodCreateParamsSofort, PaymentMethodCreateParamsStripeBalance as PaymentMethodCreateParamsStripeBalance, @@ -4105,7 +4150,6 @@ PaymentMethodModifyParamsBillingDetailsAddress as PaymentMethodModifyParamsBillingDetailsAddress, PaymentMethodModifyParamsCard as PaymentMethodModifyParamsCard, PaymentMethodModifyParamsCardNetworks as PaymentMethodModifyParamsCardNetworks, - PaymentMethodModifyParamsPayto as PaymentMethodModifyParamsPayto, PaymentMethodModifyParamsUsBankAccount as PaymentMethodModifyParamsUsBankAccount, ) from stripe.params._payment_method_retrieve_params import ( @@ -4117,7 +4161,6 @@ PaymentMethodUpdateParamsBillingDetailsAddress as PaymentMethodUpdateParamsBillingDetailsAddress, PaymentMethodUpdateParamsCard as PaymentMethodUpdateParamsCard, PaymentMethodUpdateParamsCardNetworks as PaymentMethodUpdateParamsCardNetworks, - PaymentMethodUpdateParamsPayto as PaymentMethodUpdateParamsPayto, PaymentMethodUpdateParamsUsBankAccount as PaymentMethodUpdateParamsUsBankAccount, ) from stripe.params._payment_record_list_params import ( @@ -4140,6 +4183,7 @@ ) from stripe.params._payment_record_report_payment_attempt_params import ( PaymentRecordReportPaymentAttemptParams as PaymentRecordReportPaymentAttemptParams, + PaymentRecordReportPaymentAttemptParamsCanceled as PaymentRecordReportPaymentAttemptParamsCanceled, PaymentRecordReportPaymentAttemptParamsFailed as PaymentRecordReportPaymentAttemptParamsFailed, PaymentRecordReportPaymentAttemptParamsGuaranteed as PaymentRecordReportPaymentAttemptParamsGuaranteed, PaymentRecordReportPaymentAttemptParamsPaymentMethodDetails as PaymentRecordReportPaymentAttemptParamsPaymentMethodDetails, @@ -4152,6 +4196,7 @@ from stripe.params._payment_record_report_payment_params import ( PaymentRecordReportPaymentParams as PaymentRecordReportPaymentParams, PaymentRecordReportPaymentParamsAmountRequested as PaymentRecordReportPaymentParamsAmountRequested, + PaymentRecordReportPaymentParamsCanceled as PaymentRecordReportPaymentParamsCanceled, PaymentRecordReportPaymentParamsCustomerDetails as PaymentRecordReportPaymentParamsCustomerDetails, PaymentRecordReportPaymentParamsFailed as PaymentRecordReportPaymentParamsFailed, PaymentRecordReportPaymentParamsGuaranteed as PaymentRecordReportPaymentParamsGuaranteed, @@ -4695,6 +4740,7 @@ SetupIntentConfirmParamsPaymentMethodDataSatispay as SetupIntentConfirmParamsPaymentMethodDataSatispay, SetupIntentConfirmParamsPaymentMethodDataScalapay as SetupIntentConfirmParamsPaymentMethodDataScalapay, SetupIntentConfirmParamsPaymentMethodDataSepaDebit as SetupIntentConfirmParamsPaymentMethodDataSepaDebit, + SetupIntentConfirmParamsPaymentMethodDataSequra as SetupIntentConfirmParamsPaymentMethodDataSequra, SetupIntentConfirmParamsPaymentMethodDataShopeepay as SetupIntentConfirmParamsPaymentMethodDataShopeepay, SetupIntentConfirmParamsPaymentMethodDataSofort as SetupIntentConfirmParamsPaymentMethodDataSofort, SetupIntentConfirmParamsPaymentMethodDataStripeBalance as SetupIntentConfirmParamsPaymentMethodDataStripeBalance, @@ -4713,6 +4759,8 @@ SetupIntentConfirmParamsPaymentMethodOptionsBacsDebit as SetupIntentConfirmParamsPaymentMethodOptionsBacsDebit, SetupIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions, SetupIntentConfirmParamsPaymentMethodOptionsBizum as SetupIntentConfirmParamsPaymentMethodOptionsBizum, + SetupIntentConfirmParamsPaymentMethodOptionsBlik as SetupIntentConfirmParamsPaymentMethodOptionsBlik, + SetupIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions, SetupIntentConfirmParamsPaymentMethodOptionsCard as SetupIntentConfirmParamsPaymentMethodOptionsCard, SetupIntentConfirmParamsPaymentMethodOptionsCardMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsCardMandateOptions, SetupIntentConfirmParamsPaymentMethodOptionsCardPresent as SetupIntentConfirmParamsPaymentMethodOptionsCardPresent, @@ -4804,6 +4852,7 @@ SetupIntentCreateParamsPaymentMethodDataSatispay as SetupIntentCreateParamsPaymentMethodDataSatispay, SetupIntentCreateParamsPaymentMethodDataScalapay as SetupIntentCreateParamsPaymentMethodDataScalapay, SetupIntentCreateParamsPaymentMethodDataSepaDebit as SetupIntentCreateParamsPaymentMethodDataSepaDebit, + SetupIntentCreateParamsPaymentMethodDataSequra as SetupIntentCreateParamsPaymentMethodDataSequra, SetupIntentCreateParamsPaymentMethodDataShopeepay as SetupIntentCreateParamsPaymentMethodDataShopeepay, SetupIntentCreateParamsPaymentMethodDataSofort as SetupIntentCreateParamsPaymentMethodDataSofort, SetupIntentCreateParamsPaymentMethodDataStripeBalance as SetupIntentCreateParamsPaymentMethodDataStripeBalance, @@ -4822,6 +4871,8 @@ SetupIntentCreateParamsPaymentMethodOptionsBacsDebit as SetupIntentCreateParamsPaymentMethodOptionsBacsDebit, SetupIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions, SetupIntentCreateParamsPaymentMethodOptionsBizum as SetupIntentCreateParamsPaymentMethodOptionsBizum, + SetupIntentCreateParamsPaymentMethodOptionsBlik as SetupIntentCreateParamsPaymentMethodOptionsBlik, + SetupIntentCreateParamsPaymentMethodOptionsBlikMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsBlikMandateOptions, SetupIntentCreateParamsPaymentMethodOptionsCard as SetupIntentCreateParamsPaymentMethodOptionsCard, SetupIntentCreateParamsPaymentMethodOptionsCardMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsCardMandateOptions, SetupIntentCreateParamsPaymentMethodOptionsCardPresent as SetupIntentCreateParamsPaymentMethodOptionsCardPresent, @@ -4913,6 +4964,7 @@ SetupIntentModifyParamsPaymentMethodDataSatispay as SetupIntentModifyParamsPaymentMethodDataSatispay, SetupIntentModifyParamsPaymentMethodDataScalapay as SetupIntentModifyParamsPaymentMethodDataScalapay, SetupIntentModifyParamsPaymentMethodDataSepaDebit as SetupIntentModifyParamsPaymentMethodDataSepaDebit, + SetupIntentModifyParamsPaymentMethodDataSequra as SetupIntentModifyParamsPaymentMethodDataSequra, SetupIntentModifyParamsPaymentMethodDataShopeepay as SetupIntentModifyParamsPaymentMethodDataShopeepay, SetupIntentModifyParamsPaymentMethodDataSofort as SetupIntentModifyParamsPaymentMethodDataSofort, SetupIntentModifyParamsPaymentMethodDataStripeBalance as SetupIntentModifyParamsPaymentMethodDataStripeBalance, @@ -4931,6 +4983,8 @@ SetupIntentModifyParamsPaymentMethodOptionsBacsDebit as SetupIntentModifyParamsPaymentMethodOptionsBacsDebit, SetupIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions, SetupIntentModifyParamsPaymentMethodOptionsBizum as SetupIntentModifyParamsPaymentMethodOptionsBizum, + SetupIntentModifyParamsPaymentMethodOptionsBlik as SetupIntentModifyParamsPaymentMethodOptionsBlik, + SetupIntentModifyParamsPaymentMethodOptionsBlikMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsBlikMandateOptions, SetupIntentModifyParamsPaymentMethodOptionsCard as SetupIntentModifyParamsPaymentMethodOptionsCard, SetupIntentModifyParamsPaymentMethodOptionsCardMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsCardMandateOptions, SetupIntentModifyParamsPaymentMethodOptionsCardPresent as SetupIntentModifyParamsPaymentMethodOptionsCardPresent, @@ -5020,6 +5074,7 @@ SetupIntentUpdateParamsPaymentMethodDataSatispay as SetupIntentUpdateParamsPaymentMethodDataSatispay, SetupIntentUpdateParamsPaymentMethodDataScalapay as SetupIntentUpdateParamsPaymentMethodDataScalapay, SetupIntentUpdateParamsPaymentMethodDataSepaDebit as SetupIntentUpdateParamsPaymentMethodDataSepaDebit, + SetupIntentUpdateParamsPaymentMethodDataSequra as SetupIntentUpdateParamsPaymentMethodDataSequra, SetupIntentUpdateParamsPaymentMethodDataShopeepay as SetupIntentUpdateParamsPaymentMethodDataShopeepay, SetupIntentUpdateParamsPaymentMethodDataSofort as SetupIntentUpdateParamsPaymentMethodDataSofort, SetupIntentUpdateParamsPaymentMethodDataStripeBalance as SetupIntentUpdateParamsPaymentMethodDataStripeBalance, @@ -5038,6 +5093,8 @@ SetupIntentUpdateParamsPaymentMethodOptionsBacsDebit as SetupIntentUpdateParamsPaymentMethodOptionsBacsDebit, SetupIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions, SetupIntentUpdateParamsPaymentMethodOptionsBizum as SetupIntentUpdateParamsPaymentMethodOptionsBizum, + SetupIntentUpdateParamsPaymentMethodOptionsBlik as SetupIntentUpdateParamsPaymentMethodOptionsBlik, + SetupIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions, SetupIntentUpdateParamsPaymentMethodOptionsCard as SetupIntentUpdateParamsPaymentMethodOptionsCard, SetupIntentUpdateParamsPaymentMethodOptionsCardMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsCardMandateOptions, SetupIntentUpdateParamsPaymentMethodOptionsCardPresent as SetupIntentUpdateParamsPaymentMethodOptionsCardPresent, @@ -5194,6 +5251,8 @@ SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact, SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillie as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillie, + SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlik as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlik, SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions, SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCard as SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCard, @@ -5286,6 +5345,7 @@ SubscriptionModifyParamsAddInvoiceItemPriceData as SubscriptionModifyParamsAddInvoiceItemPriceData, SubscriptionModifyParamsAutomaticTax as SubscriptionModifyParamsAutomaticTax, SubscriptionModifyParamsAutomaticTaxLiability as SubscriptionModifyParamsAutomaticTaxLiability, + SubscriptionModifyParamsBillingCycleAnchor as SubscriptionModifyParamsBillingCycleAnchor, SubscriptionModifyParamsBillingSchedule as SubscriptionModifyParamsBillingSchedule, SubscriptionModifyParamsBillingScheduleAppliesTo as SubscriptionModifyParamsBillingScheduleAppliesTo, SubscriptionModifyParamsBillingScheduleBillUntil as SubscriptionModifyParamsBillingScheduleBillUntil, @@ -5313,6 +5373,8 @@ SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBancontact as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBancontact, SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillie as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillie, + SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlik as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlik, SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions, SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsCard as SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsCard, @@ -5346,6 +5408,7 @@ ) from stripe.params._subscription_resume_params import ( SubscriptionResumeParams as SubscriptionResumeParams, + SubscriptionResumeParamsBillingCycleAnchor as SubscriptionResumeParamsBillingCycleAnchor, ) from stripe.params._subscription_retrieve_params import ( SubscriptionRetrieveParams as SubscriptionRetrieveParams, @@ -5404,6 +5467,17 @@ SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleCreateParamsDefaultSettingsTransferData as SubscriptionScheduleCreateParamsDefaultSettingsTransferData, + SubscriptionScheduleCreateParamsPauseSchedule as SubscriptionScheduleCreateParamsPauseSchedule, + SubscriptionScheduleCreateParamsPauseSchedulePause as SubscriptionScheduleCreateParamsPauseSchedulePause, + SubscriptionScheduleCreateParamsPauseSchedulePausePauseAt as SubscriptionScheduleCreateParamsPauseSchedulePausePauseAt, + SubscriptionScheduleCreateParamsPauseSchedulePauseSettings as SubscriptionScheduleCreateParamsPauseSchedulePauseSettings, + SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillFor as SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillFor, + SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough as SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough, + SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom as SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom, + SubscriptionScheduleCreateParamsPauseScheduleResume as SubscriptionScheduleCreateParamsPauseScheduleResume, + SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAt as SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAt, + SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAtDuration as SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAtDuration, + SubscriptionScheduleCreateParamsPauseScheduleResumeSettings as SubscriptionScheduleCreateParamsPauseScheduleResumeSettings, SubscriptionScheduleCreateParamsPhase as SubscriptionScheduleCreateParamsPhase, SubscriptionScheduleCreateParamsPhaseAddInvoiceItem as SubscriptionScheduleCreateParamsPhaseAddInvoiceItem, SubscriptionScheduleCreateParamsPhaseAddInvoiceItemDiscount as SubscriptionScheduleCreateParamsPhaseAddInvoiceItemDiscount, @@ -5454,6 +5528,17 @@ SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleModifyParamsDefaultSettingsTransferData as SubscriptionScheduleModifyParamsDefaultSettingsTransferData, + SubscriptionScheduleModifyParamsPauseSchedule as SubscriptionScheduleModifyParamsPauseSchedule, + SubscriptionScheduleModifyParamsPauseSchedulePause as SubscriptionScheduleModifyParamsPauseSchedulePause, + SubscriptionScheduleModifyParamsPauseSchedulePausePauseAt as SubscriptionScheduleModifyParamsPauseSchedulePausePauseAt, + SubscriptionScheduleModifyParamsPauseSchedulePauseSettings as SubscriptionScheduleModifyParamsPauseSchedulePauseSettings, + SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillFor as SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillFor, + SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough as SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough, + SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom as SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom, + SubscriptionScheduleModifyParamsPauseScheduleResume as SubscriptionScheduleModifyParamsPauseScheduleResume, + SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAt as SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAt, + SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAtDuration as SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAtDuration, + SubscriptionScheduleModifyParamsPauseScheduleResumeSettings as SubscriptionScheduleModifyParamsPauseScheduleResumeSettings, SubscriptionScheduleModifyParamsPhase as SubscriptionScheduleModifyParamsPhase, SubscriptionScheduleModifyParamsPhaseAddInvoiceItem as SubscriptionScheduleModifyParamsPhaseAddInvoiceItem, SubscriptionScheduleModifyParamsPhaseAddInvoiceItemDiscount as SubscriptionScheduleModifyParamsPhaseAddInvoiceItemDiscount, @@ -5503,6 +5588,17 @@ SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleUpdateParamsDefaultSettingsTransferData as SubscriptionScheduleUpdateParamsDefaultSettingsTransferData, + SubscriptionScheduleUpdateParamsPauseSchedule as SubscriptionScheduleUpdateParamsPauseSchedule, + SubscriptionScheduleUpdateParamsPauseSchedulePause as SubscriptionScheduleUpdateParamsPauseSchedulePause, + SubscriptionScheduleUpdateParamsPauseSchedulePausePauseAt as SubscriptionScheduleUpdateParamsPauseSchedulePausePauseAt, + SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings as SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings, + SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillFor as SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillFor, + SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough as SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough, + SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom as SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom, + SubscriptionScheduleUpdateParamsPauseScheduleResume as SubscriptionScheduleUpdateParamsPauseScheduleResume, + SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAt as SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAt, + SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAtDuration as SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAtDuration, + SubscriptionScheduleUpdateParamsPauseScheduleResumeSettings as SubscriptionScheduleUpdateParamsPauseScheduleResumeSettings, SubscriptionScheduleUpdateParamsPhase as SubscriptionScheduleUpdateParamsPhase, SubscriptionScheduleUpdateParamsPhaseAddInvoiceItem as SubscriptionScheduleUpdateParamsPhaseAddInvoiceItem, SubscriptionScheduleUpdateParamsPhaseAddInvoiceItemDiscount as SubscriptionScheduleUpdateParamsPhaseAddInvoiceItemDiscount, @@ -5551,6 +5647,7 @@ SubscriptionUpdateParamsAddInvoiceItemPriceData as SubscriptionUpdateParamsAddInvoiceItemPriceData, SubscriptionUpdateParamsAutomaticTax as SubscriptionUpdateParamsAutomaticTax, SubscriptionUpdateParamsAutomaticTaxLiability as SubscriptionUpdateParamsAutomaticTaxLiability, + SubscriptionUpdateParamsBillingCycleAnchor as SubscriptionUpdateParamsBillingCycleAnchor, SubscriptionUpdateParamsBillingSchedule as SubscriptionUpdateParamsBillingSchedule, SubscriptionUpdateParamsBillingScheduleAppliesTo as SubscriptionUpdateParamsBillingScheduleAppliesTo, SubscriptionUpdateParamsBillingScheduleBillUntil as SubscriptionUpdateParamsBillingScheduleBillUntil, @@ -5578,6 +5675,8 @@ SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions, SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact, SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillie as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillie, + SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails, + SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress, SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlik as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlik, SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions, SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCard as SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCard, @@ -5796,6 +5895,7 @@ "tax": ("stripe.params.tax", True), "terminal": ("stripe.params.terminal", True), "test_helpers": ("stripe.params.test_helpers", True), + "three_d_secure": ("stripe.params.three_d_secure", True), "treasury": ("stripe.params.treasury", True), "AccountCapabilityListParams": ( "stripe.params._account_capability_list_params", @@ -5910,6 +6010,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsCapabilitiesBlikRecurringPayments": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsCapabilitiesBoletoPayments": ( "stripe.params._account_create_params", False, @@ -6102,6 +6206,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsCapabilitiesSequraPayments": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsCapabilitiesShopeepayPayments": ( "stripe.params._account_create_params", False, @@ -6415,6 +6523,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsSettingsSepaDebitPayments": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsSettingsSmartDisputes": ( "stripe.params._account_create_params", False, @@ -7255,6 +7367,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsCapabilitiesBlikRecurringPayments": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsCapabilitiesBoletoPayments": ( "stripe.params._account_update_params", False, @@ -7447,6 +7563,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsCapabilitiesSequraPayments": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsCapabilitiesShopeepayPayments": ( "stripe.params._account_update_params", False, @@ -9038,6 +9158,10 @@ "stripe.params._confirmation_token_create_params", False, ), + "ConfirmationTokenCreateParamsPaymentMethodDataSequra": ( + "stripe.params._confirmation_token_create_params", + False, + ), "ConfirmationTokenCreateParamsPaymentMethodDataShopeepay": ( "stripe.params._confirmation_token_create_params", False, @@ -9677,6 +9801,14 @@ "stripe.params._dispute_modify_params", False, ), + "DisputeModifyParamsEvidenceAppeal": ( + "stripe.params._dispute_modify_params", + False, + ), + "DisputeModifyParamsEvidenceAppealCard": ( + "stripe.params._dispute_modify_params", + False, + ), "DisputeModifyParamsEvidenceEnhancedEvidence": ( "stripe.params._dispute_modify_params", False, @@ -9715,6 +9847,14 @@ "stripe.params._dispute_update_params", False, ), + "DisputeUpdateParamsEvidenceAppeal": ( + "stripe.params._dispute_update_params", + False, + ), + "DisputeUpdateParamsEvidenceAppealCard": ( + "stripe.params._dispute_update_params", + False, + ), "DisputeUpdateParamsEvidenceEnhancedEvidence": ( "stripe.params._dispute_update_params", False, @@ -9961,6 +10101,14 @@ "stripe.params._invoice_create_params", False, ), + "InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._invoice_create_params", + False, + ), + "InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._invoice_create_params", + False, + ), "InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._invoice_create_params", False, @@ -10425,6 +10573,10 @@ "stripe.params._invoice_create_preview_params", False, ), + "InvoiceCreatePreviewParamsSubscriptionDetailsBillingCycleAnchor": ( + "stripe.params._invoice_create_preview_params", + False, + ), "InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode": ( "stripe.params._invoice_create_preview_params", False, @@ -10726,6 +10878,14 @@ "stripe.params._invoice_modify_params", False, ), + "InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._invoice_modify_params", + False, + ), + "InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._invoice_modify_params", + False, + ), "InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._invoice_modify_params", False, @@ -10998,6 +11158,14 @@ "stripe.params._invoice_update_params", False, ), + "InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._invoice_update_params", + False, + ), + "InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._invoice_update_params", + False, + ), "InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._invoice_update_params", False, @@ -13056,6 +13224,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodDataSequra": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodDataShopeepay": ( "stripe.params._payment_intent_confirm_params", False, @@ -13152,6 +13324,14 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._payment_intent_confirm_params", + False, + ), + "PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsBizum": ( "stripe.params._payment_intent_confirm_params", False, @@ -13160,6 +13340,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsBoleto": ( "stripe.params._payment_intent_confirm_params", False, @@ -13544,6 +13728,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsSequra": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsShopeepay": ( "stripe.params._payment_intent_confirm_params", False, @@ -14204,6 +14392,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodDataSequra": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodDataShopeepay": ( "stripe.params._payment_intent_create_params", False, @@ -14300,6 +14492,14 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._payment_intent_create_params", + False, + ), + "PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsBizum": ( "stripe.params._payment_intent_create_params", False, @@ -14308,6 +14508,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsBoleto": ( "stripe.params._payment_intent_create_params", False, @@ -14692,6 +14896,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsSequra": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsShopeepay": ( "stripe.params._payment_intent_create_params", False, @@ -15508,6 +15716,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodDataSequra": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodDataShopeepay": ( "stripe.params._payment_intent_modify_params", False, @@ -15604,6 +15816,14 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._payment_intent_modify_params", + False, + ), + "PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsBizum": ( "stripe.params._payment_intent_modify_params", False, @@ -15612,6 +15832,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsBoleto": ( "stripe.params._payment_intent_modify_params", False, @@ -15996,6 +16220,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsSequra": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsShopeepay": ( "stripe.params._payment_intent_modify_params", False, @@ -16668,6 +16896,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodDataSequra": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodDataShopeepay": ( "stripe.params._payment_intent_update_params", False, @@ -16764,6 +16996,14 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._payment_intent_update_params", + False, + ), + "PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsBizum": ( "stripe.params._payment_intent_update_params", False, @@ -16772,6 +17012,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsBoleto": ( "stripe.params._payment_intent_update_params", False, @@ -17156,6 +17400,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsSequra": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsShopeepay": ( "stripe.params._payment_intent_update_params", False, @@ -18296,6 +18544,14 @@ "stripe.params._payment_method_configuration_create_params", False, ), + "PaymentMethodConfigurationCreateParamsSequra": ( + "stripe.params._payment_method_configuration_create_params", + False, + ), + "PaymentMethodConfigurationCreateParamsSequraDisplayPreference": ( + "stripe.params._payment_method_configuration_create_params", + False, + ), "PaymentMethodConfigurationCreateParamsShopeepay": ( "stripe.params._payment_method_configuration_create_params", False, @@ -18824,6 +19080,14 @@ "stripe.params._payment_method_configuration_modify_params", False, ), + "PaymentMethodConfigurationModifyParamsSequra": ( + "stripe.params._payment_method_configuration_modify_params", + False, + ), + "PaymentMethodConfigurationModifyParamsSequraDisplayPreference": ( + "stripe.params._payment_method_configuration_modify_params", + False, + ), "PaymentMethodConfigurationModifyParamsShopeepay": ( "stripe.params._payment_method_configuration_modify_params", False, @@ -19352,6 +19616,14 @@ "stripe.params._payment_method_configuration_update_params", False, ), + "PaymentMethodConfigurationUpdateParamsSequra": ( + "stripe.params._payment_method_configuration_update_params", + False, + ), + "PaymentMethodConfigurationUpdateParamsSequraDisplayPreference": ( + "stripe.params._payment_method_configuration_update_params", + False, + ), "PaymentMethodConfigurationUpdateParamsShopeepay": ( "stripe.params._payment_method_configuration_update_params", False, @@ -19664,6 +19936,10 @@ "stripe.params._payment_method_create_params", False, ), + "PaymentMethodCreateParamsSequra": ( + "stripe.params._payment_method_create_params", + False, + ), "PaymentMethodCreateParamsShopeepay": ( "stripe.params._payment_method_create_params", False, @@ -19760,10 +20036,6 @@ "stripe.params._payment_method_modify_params", False, ), - "PaymentMethodModifyParamsPayto": ( - "stripe.params._payment_method_modify_params", - False, - ), "PaymentMethodModifyParamsUsBankAccount": ( "stripe.params._payment_method_modify_params", False, @@ -19792,10 +20064,6 @@ "stripe.params._payment_method_update_params", False, ), - "PaymentMethodUpdateParamsPayto": ( - "stripe.params._payment_method_update_params", - False, - ), "PaymentMethodUpdateParamsUsBankAccount": ( "stripe.params._payment_method_update_params", False, @@ -19836,6 +20104,10 @@ "stripe.params._payment_record_report_payment_attempt_params", False, ), + "PaymentRecordReportPaymentAttemptParamsCanceled": ( + "stripe.params._payment_record_report_payment_attempt_params", + False, + ), "PaymentRecordReportPaymentAttemptParamsFailed": ( "stripe.params._payment_record_report_payment_attempt_params", False, @@ -19876,6 +20148,10 @@ "stripe.params._payment_record_report_payment_params", False, ), + "PaymentRecordReportPaymentParamsCanceled": ( + "stripe.params._payment_record_report_payment_params", + False, + ), "PaymentRecordReportPaymentParamsCustomerDetails": ( "stripe.params._payment_record_report_payment_params", False, @@ -21228,6 +21504,10 @@ "stripe.params._setup_intent_confirm_params", False, ), + "SetupIntentConfirmParamsPaymentMethodDataSequra": ( + "stripe.params._setup_intent_confirm_params", + False, + ), "SetupIntentConfirmParamsPaymentMethodDataShopeepay": ( "stripe.params._setup_intent_confirm_params", False, @@ -21300,6 +21580,14 @@ "stripe.params._setup_intent_confirm_params", False, ), + "SetupIntentConfirmParamsPaymentMethodOptionsBlik": ( + "stripe.params._setup_intent_confirm_params", + False, + ), + "SetupIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._setup_intent_confirm_params", + False, + ), "SetupIntentConfirmParamsPaymentMethodOptionsCard": ( "stripe.params._setup_intent_confirm_params", False, @@ -21656,6 +21944,10 @@ "stripe.params._setup_intent_create_params", False, ), + "SetupIntentCreateParamsPaymentMethodDataSequra": ( + "stripe.params._setup_intent_create_params", + False, + ), "SetupIntentCreateParamsPaymentMethodDataShopeepay": ( "stripe.params._setup_intent_create_params", False, @@ -21728,6 +22020,14 @@ "stripe.params._setup_intent_create_params", False, ), + "SetupIntentCreateParamsPaymentMethodOptionsBlik": ( + "stripe.params._setup_intent_create_params", + False, + ), + "SetupIntentCreateParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._setup_intent_create_params", + False, + ), "SetupIntentCreateParamsPaymentMethodOptionsCard": ( "stripe.params._setup_intent_create_params", False, @@ -22076,6 +22376,10 @@ "stripe.params._setup_intent_modify_params", False, ), + "SetupIntentModifyParamsPaymentMethodDataSequra": ( + "stripe.params._setup_intent_modify_params", + False, + ), "SetupIntentModifyParamsPaymentMethodDataShopeepay": ( "stripe.params._setup_intent_modify_params", False, @@ -22148,6 +22452,14 @@ "stripe.params._setup_intent_modify_params", False, ), + "SetupIntentModifyParamsPaymentMethodOptionsBlik": ( + "stripe.params._setup_intent_modify_params", + False, + ), + "SetupIntentModifyParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._setup_intent_modify_params", + False, + ), "SetupIntentModifyParamsPaymentMethodOptionsCard": ( "stripe.params._setup_intent_modify_params", False, @@ -22488,6 +22800,10 @@ "stripe.params._setup_intent_update_params", False, ), + "SetupIntentUpdateParamsPaymentMethodDataSequra": ( + "stripe.params._setup_intent_update_params", + False, + ), "SetupIntentUpdateParamsPaymentMethodDataShopeepay": ( "stripe.params._setup_intent_update_params", False, @@ -22560,6 +22876,14 @@ "stripe.params._setup_intent_update_params", False, ), + "SetupIntentUpdateParamsPaymentMethodOptionsBlik": ( + "stripe.params._setup_intent_update_params", + False, + ), + "SetupIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions": ( + "stripe.params._setup_intent_update_params", + False, + ), "SetupIntentUpdateParamsPaymentMethodOptionsCard": ( "stripe.params._setup_intent_update_params", False, @@ -23029,6 +23353,14 @@ "stripe.params._subscription_create_params", False, ), + "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._subscription_create_params", + False, + ), + "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._subscription_create_params", + False, + ), "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._subscription_create_params", False, @@ -23317,6 +23649,10 @@ "stripe.params._subscription_modify_params", False, ), + "SubscriptionModifyParamsBillingCycleAnchor": ( + "stripe.params._subscription_modify_params", + False, + ), "SubscriptionModifyParamsBillingSchedule": ( "stripe.params._subscription_modify_params", False, @@ -23425,6 +23761,14 @@ "stripe.params._subscription_modify_params", False, ), + "SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._subscription_modify_params", + False, + ), + "SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._subscription_modify_params", + False, + ), "SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._subscription_modify_params", False, @@ -23541,6 +23885,10 @@ "stripe.params._subscription_resume_params", False, ), + "SubscriptionResumeParamsBillingCycleAnchor": ( + "stripe.params._subscription_resume_params", + False, + ), "SubscriptionRetrieveParams": ( "stripe.params._subscription_retrieve_params", False, @@ -23741,6 +24089,50 @@ "stripe.params._subscription_schedule_create_params", False, ), + "SubscriptionScheduleCreateParamsPauseSchedule": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePause": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePausePauseAt": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettings": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillFor": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseScheduleResume": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAt": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAtDuration": ( + "stripe.params._subscription_schedule_create_params", + False, + ), + "SubscriptionScheduleCreateParamsPauseScheduleResumeSettings": ( + "stripe.params._subscription_schedule_create_params", + False, + ), "SubscriptionScheduleCreateParamsPhase": ( "stripe.params._subscription_schedule_create_params", False, @@ -23925,6 +24317,50 @@ "stripe.params._subscription_schedule_modify_params", False, ), + "SubscriptionScheduleModifyParamsPauseSchedule": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePause": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePausePauseAt": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettings": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillFor": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseScheduleResume": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAt": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAtDuration": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), + "SubscriptionScheduleModifyParamsPauseScheduleResumeSettings": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), "SubscriptionScheduleModifyParamsPhase": ( "stripe.params._subscription_schedule_modify_params", False, @@ -24097,6 +24533,50 @@ "stripe.params._subscription_schedule_update_params", False, ), + "SubscriptionScheduleUpdateParamsPauseSchedule": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePause": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePausePauseAt": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillFor": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseScheduleResume": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAt": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAtDuration": ( + "stripe.params._subscription_schedule_update_params", + False, + ), + "SubscriptionScheduleUpdateParamsPauseScheduleResumeSettings": ( + "stripe.params._subscription_schedule_update_params", + False, + ), "SubscriptionScheduleUpdateParamsPhase": ( "stripe.params._subscription_schedule_update_params", False, @@ -24273,6 +24753,10 @@ "stripe.params._subscription_update_params", False, ), + "SubscriptionUpdateParamsBillingCycleAnchor": ( + "stripe.params._subscription_update_params", + False, + ), "SubscriptionUpdateParamsBillingSchedule": ( "stripe.params._subscription_update_params", False, @@ -24381,6 +24865,14 @@ "stripe.params._subscription_update_params", False, ), + "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails": ( + "stripe.params._subscription_update_params", + False, + ), + "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress": ( + "stripe.params._subscription_update_params", + False, + ), "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlik": ( "stripe.params._subscription_update_params", False, diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index 58d9e0894..0e85a7e99 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -9,7 +9,7 @@ class AccountCreateParams(RequestOptions): account_token: NotRequired[str] """ - An [account token](https://api.stripe.com#create_account_token), used to securely provide details to the account. + An [account token](https://docs.stripe.com/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired["AccountCreateParamsBusinessProfile"] """ @@ -306,6 +306,12 @@ class AccountCreateParamsCapabilities(TypedDict): """ The blik_payments capability. """ + blik_recurring_payments: NotRequired[ + "AccountCreateParamsCapabilitiesBlikRecurringPayments" + ] + """ + The blik_recurring_payments capability. + """ boleto_payments: NotRequired[ "AccountCreateParamsCapabilitiesBoletoPayments" ] @@ -566,6 +572,12 @@ class AccountCreateParamsCapabilities(TypedDict): """ The sepa_debit_payments capability. """ + sequra_payments: NotRequired[ + "AccountCreateParamsCapabilitiesSequraPayments" + ] + """ + The sequra_payments capability. + """ shopeepay_payments: NotRequired[ "AccountCreateParamsCapabilitiesShopeepayPayments" ] @@ -756,6 +768,13 @@ class AccountCreateParamsCapabilitiesBlikPayments(TypedDict): """ +class AccountCreateParamsCapabilitiesBlikRecurringPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountCreateParamsCapabilitiesBoletoPayments(TypedDict): requested: NotRequired[bool] """ @@ -1092,6 +1111,13 @@ class AccountCreateParamsCapabilitiesSepaDebitPayments(TypedDict): """ +class AccountCreateParamsCapabilitiesSequraPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountCreateParamsCapabilitiesShopeepayPayments(TypedDict): requested: NotRequired[bool] """ @@ -1545,11 +1571,11 @@ class AccountCreateParamsCompanyVerification(TypedDict): class AccountCreateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1675,49 +1701,49 @@ class AccountCreateParamsDocuments(TypedDict): class AccountCreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyLicense(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyMinisterialDecree(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyRegistrationVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyTaxIdVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsProofOfAddress(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -1726,7 +1752,7 @@ class AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership( ): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner" @@ -2076,22 +2102,22 @@ class AccountCreateParamsIndividualVerification(TypedDict): class AccountCreateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountCreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -2167,6 +2193,12 @@ class AccountCreateParamsSettings(TypedDict): """ Settings specific to the PayPay payments method. """ + sepa_debit_payments: NotRequired[ + "AccountCreateParamsSettingsSepaDebitPayments" + ] + """ + Settings specific to SEPA Direct Debit payments. + """ smart_disputes: NotRequired["AccountCreateParamsSettingsSmartDisputes"] """ Settings specific to the account's use of Smart Disputes. @@ -2430,6 +2462,13 @@ class AccountCreateParamsSettingsPaypayPaymentsSiteRestricted(TypedDict): """ +class AccountCreateParamsSettingsSepaDebitPayments(TypedDict): + creditor_id: NotRequired[str] + """ + The business creditor id for european payments. + """ + + class AccountCreateParamsSettingsSmartDisputes(TypedDict): auto_respond: NotRequired[ "AccountCreateParamsSettingsSmartDisputesAutoRespond" diff --git a/stripe/params/_account_create_person_params.py b/stripe/params/_account_create_person_params.py index bf931c4cc..740ce5f50 100644 --- a/stripe/params/_account_create_person_params.py +++ b/stripe/params/_account_create_person_params.py @@ -285,21 +285,21 @@ class AccountCreatePersonParamsDocuments(TypedDict): class AccountCreatePersonParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreatePersonParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreatePersonParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -467,20 +467,20 @@ class AccountCreatePersonParamsVerification(TypedDict): class AccountCreatePersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountCreatePersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_external_account_update_params.py b/stripe/params/_account_external_account_update_params.py index 3149e110e..5dabbe5bd 100644 --- a/stripe/params/_account_external_account_update_params.py +++ b/stripe/params/_account_external_account_update_params.py @@ -92,5 +92,5 @@ class AccountExternalAccountUpdateParamsDocumentsBankAccountOwnershipVerificatio ): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_account_modify_external_account_params.py b/stripe/params/_account_modify_external_account_params.py index 06184111d..e0e45d1fe 100644 --- a/stripe/params/_account_modify_external_account_params.py +++ b/stripe/params/_account_modify_external_account_params.py @@ -93,5 +93,5 @@ class AccountModifyExternalAccountParamsDocumentsBankAccountOwnershipVerificatio ): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_account_modify_person_params.py b/stripe/params/_account_modify_person_params.py index 49bfd097c..d51aed0fd 100644 --- a/stripe/params/_account_modify_person_params.py +++ b/stripe/params/_account_modify_person_params.py @@ -285,21 +285,21 @@ class AccountModifyPersonParamsDocuments(TypedDict): class AccountModifyPersonParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountModifyPersonParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountModifyPersonParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -467,20 +467,20 @@ class AccountModifyPersonParamsVerification(TypedDict): class AccountModifyPersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountModifyPersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_person_create_params.py b/stripe/params/_account_person_create_params.py index 04397606d..87b602ce9 100644 --- a/stripe/params/_account_person_create_params.py +++ b/stripe/params/_account_person_create_params.py @@ -284,21 +284,21 @@ class AccountPersonCreateParamsDocuments(TypedDict): class AccountPersonCreateParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonCreateParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonCreateParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -466,20 +466,20 @@ class AccountPersonCreateParamsVerification(TypedDict): class AccountPersonCreateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountPersonCreateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_person_update_params.py b/stripe/params/_account_person_update_params.py index 5a00cb530..c8d5d94de 100644 --- a/stripe/params/_account_person_update_params.py +++ b/stripe/params/_account_person_update_params.py @@ -284,21 +284,21 @@ class AccountPersonUpdateParamsDocuments(TypedDict): class AccountPersonUpdateParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonUpdateParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonUpdateParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -466,20 +466,20 @@ class AccountPersonUpdateParamsVerification(TypedDict): class AccountPersonUpdateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountPersonUpdateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_reject_params.py b/stripe/params/_account_reject_params.py index 4e1be3a1a..629e546fc 100644 --- a/stripe/params/_account_reject_params.py +++ b/stripe/params/_account_reject_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired @@ -14,7 +14,18 @@ class AccountRejectParams(RequestOptions): """ Whether to pause payouts on the account as part of the rejection. Defaults to `pause`. Use `none` to leave payouts enabled. """ - reason: str + reason: Union[ + Literal[ + "credit", + "fraud_no_intent_to_fulfill", + "fraud_other", + "fraud_payment_method_casher", + "fraud_payment_method_tester", + "other", + "terms_of_service", + ], + str, + ] """ - The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. + The reason for rejecting the account. Can be `fraud_payment_method_casher`, `fraud_payment_method_tester`, `fraud_no_intent_to_fulfill`, `fraud_other`, `credit`, `terms_of_service`, or `other`. """ diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index c57933354..590da8d68 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -8,7 +8,7 @@ class AccountUpdateParams(TypedDict): account_token: NotRequired[str] """ - An [account token](https://api.stripe.com#create_account_token), used to securely provide details to the account. + An [account token](https://docs.stripe.com/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired["AccountUpdateParamsBusinessProfile"] """ @@ -293,6 +293,12 @@ class AccountUpdateParamsCapabilities(TypedDict): """ The blik_payments capability. """ + blik_recurring_payments: NotRequired[ + "AccountUpdateParamsCapabilitiesBlikRecurringPayments" + ] + """ + The blik_recurring_payments capability. + """ boleto_payments: NotRequired[ "AccountUpdateParamsCapabilitiesBoletoPayments" ] @@ -553,6 +559,12 @@ class AccountUpdateParamsCapabilities(TypedDict): """ The sepa_debit_payments capability. """ + sequra_payments: NotRequired[ + "AccountUpdateParamsCapabilitiesSequraPayments" + ] + """ + The sequra_payments capability. + """ shopeepay_payments: NotRequired[ "AccountUpdateParamsCapabilitiesShopeepayPayments" ] @@ -743,6 +755,13 @@ class AccountUpdateParamsCapabilitiesBlikPayments(TypedDict): """ +class AccountUpdateParamsCapabilitiesBlikRecurringPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountUpdateParamsCapabilitiesBoletoPayments(TypedDict): requested: NotRequired[bool] """ @@ -1079,6 +1098,13 @@ class AccountUpdateParamsCapabilitiesSepaDebitPayments(TypedDict): """ +class AccountUpdateParamsCapabilitiesSequraPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountUpdateParamsCapabilitiesShopeepayPayments(TypedDict): requested: NotRequired[bool] """ @@ -1529,11 +1555,11 @@ class AccountUpdateParamsCompanyVerification(TypedDict): class AccountUpdateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1593,56 +1619,56 @@ class AccountUpdateParamsDocuments(TypedDict): class AccountUpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyLicense(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyMinisterialDecree(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyRegistrationVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyTaxIdVerification(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsProofOfAddress(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountUpdateParamsDocumentsProofOfRegistrationSigner" @@ -1664,7 +1690,7 @@ class AccountUpdateParamsDocumentsProofOfUltimateBeneficialOwnership( ): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountUpdateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner" @@ -2014,22 +2040,22 @@ class AccountUpdateParamsIndividualVerification(TypedDict): class AccountUpdateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountUpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_balance_transaction_list_params.py b/stripe/params/_balance_transaction_list_params.py index 04d0554ca..3f7cced0b 100644 --- a/stripe/params/_balance_transaction_list_params.py +++ b/stripe/params/_balance_transaction_list_params.py @@ -40,7 +40,7 @@ class BalanceTransactionListParams(RequestOptions): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. + Only returns transactions of the given type. One of: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_dispute_provisional_credit`, `issuing_dispute_provisional_credit_reversal`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. """ diff --git a/stripe/params/_charge_create_params.py b/stripe/params/_charge_create_params.py index 6d5b58deb..cfa3e339b 100644 --- a/stripe/params/_charge_create_params.py +++ b/stripe/params/_charge_create_params.py @@ -18,7 +18,7 @@ class ChargeCreateParams(RequestOptions): """ capture: NotRequired[bool] """ - Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://api.stripe.com#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://docs.stripe.com/charges/placing-a-hold) documentation. + Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://docs.stripe.com/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://docs.stripe.com/charges/placing-a-hold) documentation. """ currency: NotRequired[str] """ diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index 08e8c1568..374c93967 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -72,13 +72,13 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataAuBecsDebit" @@ -324,6 +324,10 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -408,6 +412,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -868,6 +873,10 @@ class ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class ConfirmationTokenCreateParamsPaymentMethodDataSequra(TypedDict): + pass + + class ConfirmationTokenCreateParamsPaymentMethodDataShopeepay(TypedDict): pass diff --git a/stripe/params/_customer_create_params.py b/stripe/params/_customer_create_params.py index 7903ff669..47ee9ecd3 100644 --- a/stripe/params/_customer_create_params.py +++ b/stripe/params/_customer_create_params.py @@ -41,7 +41,7 @@ class CustomerCreateParams(RequestOptions): """ invoice_prefix: NotRequired[str] """ - The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + The prefix for the customer used to generate unique invoice numbers. Must be 1–12 uppercase letters or numbers. """ invoice_settings: NotRequired["CustomerCreateParamsInvoiceSettings"] """ diff --git a/stripe/params/_customer_list_payment_methods_params.py b/stripe/params/_customer_list_payment_methods_params.py index 8dfad26c8..b35b90059 100644 --- a/stripe/params/_customer_list_payment_methods_params.py +++ b/stripe/params/_customer_list_payment_methods_params.py @@ -29,7 +29,7 @@ class CustomerListPaymentMethodsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_modify_params.py b/stripe/params/_customer_modify_params.py index 31190633c..49ce2e0d1 100644 --- a/stripe/params/_customer_modify_params.py +++ b/stripe/params/_customer_modify_params.py @@ -49,7 +49,7 @@ class CustomerModifyParams(RequestOptions): """ invoice_prefix: NotRequired[str] """ - The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + The prefix for the customer used to generate unique invoice numbers. Must be 1–12 uppercase letters or numbers. """ invoice_settings: NotRequired["CustomerModifyParamsInvoiceSettings"] """ diff --git a/stripe/params/_customer_payment_method_list_params.py b/stripe/params/_customer_payment_method_list_params.py index c54bb03be..cfea95b0f 100644 --- a/stripe/params/_customer_payment_method_list_params.py +++ b/stripe/params/_customer_payment_method_list_params.py @@ -28,7 +28,7 @@ class CustomerPaymentMethodListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_update_params.py b/stripe/params/_customer_update_params.py index 779fa949a..a07528cfe 100644 --- a/stripe/params/_customer_update_params.py +++ b/stripe/params/_customer_update_params.py @@ -48,7 +48,7 @@ class CustomerUpdateParams(TypedDict): """ invoice_prefix: NotRequired[str] """ - The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. + The prefix for the customer used to generate unique invoice numbers. Must be 1–12 uppercase letters or numbers. """ invoice_settings: NotRequired["CustomerUpdateParamsInvoiceSettings"] """ diff --git a/stripe/params/_dispute_modify_params.py b/stripe/params/_dispute_modify_params.py index c8a19886a..dca30c049 100644 --- a/stripe/params/_dispute_modify_params.py +++ b/stripe/params/_dispute_modify_params.py @@ -43,6 +43,10 @@ class DisputeModifyParamsEvidence(TypedDict): """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ + appeal: NotRequired["Literal['']|DisputeModifyParamsEvidenceAppeal"] + """ + Evidence to submit when appealing a dispute. + """ billing_address: NotRequired[str] """ The billing address provided by the customer. @@ -155,6 +159,24 @@ class DisputeModifyParamsEvidence(TypedDict): """ +class DisputeModifyParamsEvidenceAppeal(TypedDict): + card: NotRequired["Literal['']|DisputeModifyParamsEvidenceAppealCard"] + """ + Evidence for a card dispute appeal. + """ + + +class DisputeModifyParamsEvidenceAppealCard(TypedDict): + reason_for_filing: NotRequired["Literal['']|str"] + """ + An explanation of the reason for filing the appeal. + """ + supporting_files: NotRequired["Literal['']|List[str]"] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `dispute_evidence` to support the appeal. + """ + + class DisputeModifyParamsEvidenceEnhancedEvidence(TypedDict): mastercard_compliance: NotRequired[ "DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance" diff --git a/stripe/params/_dispute_update_params.py b/stripe/params/_dispute_update_params.py index 7552c9bf0..31ec882ea 100644 --- a/stripe/params/_dispute_update_params.py +++ b/stripe/params/_dispute_update_params.py @@ -42,6 +42,10 @@ class DisputeUpdateParamsEvidence(TypedDict): """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ + appeal: NotRequired["Literal['']|DisputeUpdateParamsEvidenceAppeal"] + """ + Evidence to submit when appealing a dispute. + """ billing_address: NotRequired[str] """ The billing address provided by the customer. @@ -154,6 +158,24 @@ class DisputeUpdateParamsEvidence(TypedDict): """ +class DisputeUpdateParamsEvidenceAppeal(TypedDict): + card: NotRequired["Literal['']|DisputeUpdateParamsEvidenceAppealCard"] + """ + Evidence for a card dispute appeal. + """ + + +class DisputeUpdateParamsEvidenceAppealCard(TypedDict): + reason_for_filing: NotRequired["Literal['']|str"] + """ + An explanation of the reason for filing the appeal. + """ + supporting_files: NotRequired["Literal['']|List[str]"] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `dispute_evidence` to support the appeal. + """ + + class DisputeUpdateParamsEvidenceEnhancedEvidence(TypedDict): mastercard_compliance: NotRequired[ "DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance" diff --git a/stripe/params/_external_account_update_params.py b/stripe/params/_external_account_update_params.py index eca7d995b..f0043f0eb 100644 --- a/stripe/params/_external_account_update_params.py +++ b/stripe/params/_external_account_update_params.py @@ -92,5 +92,5 @@ class ExternalAccountUpdateParamsDocumentsBankAccountOwnershipVerification( ): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_file_create_params.py b/stripe/params/_file_create_params.py index 9105b6868..0e03f42de 100644 --- a/stripe/params/_file_create_params.py +++ b/stripe/params/_file_create_params.py @@ -17,7 +17,7 @@ class FileCreateParams(RequestOptions): """ file_link_data: NotRequired["FileCreateParamsFileLinkData"] """ - Optional parameters that automatically create a [file link](https://api.stripe.com#file_links) for the newly created file. + Optional parameters that automatically create a [file link](https://docs.stripe.com/api#file_links) for the newly created file. """ purpose: Union[ Literal[ diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index 2a41b4623..41fbca1c7 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -286,7 +286,7 @@ class InvoiceAddLinesParamsLineTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index 5fc23a786..b9fcbee20 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -133,7 +133,7 @@ class InvoiceCreateParams(RequestOptions): """ rendering: NotRequired["InvoiceCreateParamsRendering"] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + The rendering-related settings that control how invoices render in customer-facing interfaces such as the PDF or hosted invoice page. """ shipping_cost: NotRequired["InvoiceCreateParamsShippingCost"] """ @@ -412,7 +412,74 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBancontact( class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillie(TypedDict): - pass + company_details: NotRequired[ + "Literal['']|InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBlik(TypedDict): diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index 0d0c69c32..fa7b75236 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -1905,7 +1905,9 @@ class InvoiceCreatePreviewParamsScheduleDetailsPrebillingBillUntilDuration( class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|str|int"] + billing_cycle_anchor: NotRequired[ + "InvoiceCreatePreviewParamsSubscriptionDetailsBillingCycleAnchor" + ] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://docs.stripe.com/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ @@ -1989,6 +1991,19 @@ class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict): """ +class InvoiceCreatePreviewParamsSubscriptionDetailsBillingCycleAnchor( + TypedDict, +): + timestamp: NotRequired[int] + """ + A timestamp to use as the subscription's billing cycle anchor. Only valid when `type` is `timestamp`. + """ + type: Union[Literal["now", "timestamp", "unchanged"], str] + """ + Determines how the subscription's billing cycle anchor behaves for the invoice preview. + """ + + class InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): flexible: NotRequired[ "InvoiceCreatePreviewParamsSubscriptionDetailsBillingModeFlexible" @@ -2120,13 +2135,13 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData" ] """ - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. """ quantity: NotRequired[int] """ @@ -2268,7 +2283,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsPause(TypedDict): """ Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The type of pause to apply. Defaults to `subscription`. """ diff --git a/stripe/params/_invoice_item_modify_params.py b/stripe/params/_invoice_item_modify_params.py index a2a09c294..fa0c86bd7 100644 --- a/stripe/params/_invoice_item_modify_params.py +++ b/stripe/params/_invoice_item_modify_params.py @@ -28,6 +28,10 @@ class InvoiceItemModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + invoicing_rules: NotRequired[Literal[""]] + """ + Pass an empty string to remove previously-defined invoicing rules. Setting invoicing rules is not supported. + """ margins: NotRequired["Literal['']|List[str]"] """ The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. diff --git a/stripe/params/_invoice_item_update_params.py b/stripe/params/_invoice_item_update_params.py index df0fcdfcf..b50318ed5 100644 --- a/stripe/params/_invoice_item_update_params.py +++ b/stripe/params/_invoice_item_update_params.py @@ -27,6 +27,10 @@ class InvoiceItemUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ + invoicing_rules: NotRequired[Literal[""]] + """ + Pass an empty string to remove previously-defined invoicing rules. Setting invoicing rules is not supported. + """ margins: NotRequired["Literal['']|List[str]"] """ The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index 7cbc5c4cb..29612fab7 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -270,7 +270,7 @@ class InvoiceLineItemUpdateParamsTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index e7d42d4f3..56fca24e7 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -111,7 +111,7 @@ class InvoiceModifyParams(RequestOptions): """ rendering: NotRequired["InvoiceModifyParamsRendering"] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + The rendering-related settings that control how invoices render in customer-facing interfaces such as the PDF or hosted invoice page. """ shipping_cost: NotRequired["Literal['']|InvoiceModifyParamsShippingCost"] """ @@ -377,7 +377,74 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBancontact( class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillie(TypedDict): - pass + company_details: NotRequired[ + "Literal['']|InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBlik(TypedDict): diff --git a/stripe/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index 2518c0f28..4461d9bfb 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -290,7 +290,7 @@ class InvoiceUpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index a04860b3b..e96332bf2 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -110,7 +110,7 @@ class InvoiceUpdateParams(TypedDict): """ rendering: NotRequired["InvoiceUpdateParamsRendering"] """ - The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + The rendering-related settings that control how invoices render in customer-facing interfaces such as the PDF or hosted invoice page. """ shipping_cost: NotRequired["Literal['']|InvoiceUpdateParamsShippingCost"] """ @@ -376,7 +376,74 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact( class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillie(TypedDict): - pass + company_details: NotRequired[ + "Literal['']|InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBlik(TypedDict): diff --git a/stripe/params/_order_create_params.py b/stripe/params/_order_create_params.py index 39dbcf848..3197039e7 100644 --- a/stripe/params/_order_create_params.py +++ b/stripe/params/_order_create_params.py @@ -2081,7 +2081,7 @@ class OrderCreateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_order_modify_params.py b/stripe/params/_order_modify_params.py index 16f082804..db9e40be3 100644 --- a/stripe/params/_order_modify_params.py +++ b/stripe/params/_order_modify_params.py @@ -2091,7 +2091,7 @@ class OrderModifyParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_order_update_params.py b/stripe/params/_order_update_params.py index f4583aedf..e9c574fea 100644 --- a/stripe/params/_order_update_params.py +++ b/stripe/params/_order_update_params.py @@ -2090,7 +2090,7 @@ class OrderUpdateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index a916e3e84..c83f04094 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -27,6 +27,7 @@ class PaymentIntentConfirmParams(RequestOptions): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -47,6 +48,7 @@ class PaymentIntentConfirmParams(RequestOptions): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -147,7 +149,7 @@ class PaymentIntentConfirmParams(RequestOptions): Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://docs.stripe.com/payments/save-card-without-authentication). """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -184,7 +186,7 @@ class PaymentIntentConfirmParams(RequestOptions): payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://docs.stripe.com/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - If the payment method is attached to a Customer, it must match the [customer](https://api.stripe.com#create_payment_intent-customer) that is set on this PaymentIntent. + If the payment method is attached to a Customer, it must match the [customer](https://docs.stripe.com/api#create_payment_intent-customer) that is set on this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodData" @@ -2331,13 +2333,13 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ alma: NotRequired["PaymentIntentConfirmParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodDataAuBecsDebit" @@ -2573,6 +2575,10 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["PaymentIntentConfirmParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -2657,6 +2663,7 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -3115,6 +3122,10 @@ class PaymentIntentConfirmParamsPaymentMethodDataSepaDebit(TypedDict): """ +class PaymentIntentConfirmParamsPaymentMethodDataSequra(TypedDict): + pass + + class PaymentIntentConfirmParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -3523,6 +3534,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + sequra: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsSequra" + ] + """ + If this is a `sequra` PaymentMethod, this sub-hash contains details about the SeQura payment method options. + """ shopeepay: NotRequired[ "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsShopeepay" ] @@ -3838,6 +3855,74 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + company_details: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT id number + """ + + +class PaymentIntentConfirmParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class PaymentIntentConfirmParamsPaymentMethodOptionsBizum(TypedDict): @@ -3849,7 +3934,15 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + mandate_options: NotRequired[ + "PaymentIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']|str" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3863,6 +3956,15 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBlik(TypedDict): """ +class PaymentIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions( + TypedDict, +): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ @@ -3965,6 +4067,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3993,6 +4101,18 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + stored_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + + When making an off session payment with a previously saved card (that was saved with a SetupIntent or with a PaymentIntent with `setup_future_usage`), set this parameter to indicate the type of transaction. + + You can set this parameter at any time before or during PaymentIntent confirmation, and confirm this PaymentIntent with `off_session=true`. + + Note that this parameter is currently unsupported with the `setup_future_usage` parameter. + """ three_d_secure: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -6009,14 +6129,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaypalLineItemTax( class PaymentIntentConfirmParamsPaymentMethodOptionsPaypay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. - """ + pass class PaymentIntentConfirmParamsPaymentMethodOptionsPayto(TypedDict): @@ -6293,6 +6406,29 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class PaymentIntentConfirmParamsPaymentMethodOptionsSequra(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + 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). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsShopeepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6590,7 +6726,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index ba1c4df03..39448db10 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -27,6 +27,7 @@ class PaymentIntentCreateParams(RequestOptions): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -47,6 +48,7 @@ class PaymentIntentCreateParams(RequestOptions): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -164,7 +166,7 @@ class PaymentIntentCreateParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -172,7 +174,7 @@ class PaymentIntentCreateParams(RequestOptions): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ @@ -236,6 +238,7 @@ class PaymentIntentCreateParams(RequestOptions): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -297,7 +300,7 @@ class PaymentIntentCreateParams(RequestOptions): ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://docs.stripe.com/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. - If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://api.stripe.com#create_payment_intent-customer) parameter of this PaymentIntent. + If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://docs.stripe.com/api#create_payment_intent-customer) parameter of this PaymentIntent. end """ payment_method_configuration: NotRequired[str] @@ -2463,13 +2466,13 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["PaymentIntentCreateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "PaymentIntentCreateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentCreateParamsPaymentMethodDataAuBecsDebit" @@ -2699,6 +2702,10 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["PaymentIntentCreateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -2783,6 +2790,7 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -3241,6 +3249,10 @@ class PaymentIntentCreateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class PaymentIntentCreateParamsPaymentMethodDataSequra(TypedDict): + pass + + class PaymentIntentCreateParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -3649,6 +3661,12 @@ class PaymentIntentCreateParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + sequra: NotRequired[ + "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsSequra" + ] + """ + If this is a `sequra` PaymentMethod, this sub-hash contains details about the SeQura payment method options. + """ shopeepay: NotRequired[ "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsShopeepay" ] @@ -3962,6 +3980,74 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + company_details: NotRequired[ + "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT id number + """ + + +class PaymentIntentCreateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class PaymentIntentCreateParamsPaymentMethodOptionsBizum(TypedDict): @@ -3973,7 +4059,15 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + mandate_options: NotRequired[ + "PaymentIntentCreateParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']|str" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3987,6 +4081,15 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBlik(TypedDict): """ +class PaymentIntentCreateParamsPaymentMethodOptionsBlikMandateOptions( + TypedDict, +): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ @@ -4089,6 +4192,12 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCard(TypedDict): """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -4117,6 +4226,18 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + stored_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + + When making an off session payment with a previously saved card (that was saved with a SetupIntent or with a PaymentIntent with `setup_future_usage`), set this parameter to indicate the type of transaction. + + You can set this parameter at any time before or during PaymentIntent confirmation, and confirm this PaymentIntent with `off_session=true`. + + Note that this parameter is currently unsupported with the `setup_future_usage` parameter. + """ three_d_secure: NotRequired[ "PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -6129,14 +6250,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaypalLineItemTax( class PaymentIntentCreateParamsPaymentMethodOptionsPaypay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. - """ + pass class PaymentIntentCreateParamsPaymentMethodOptionsPayto(TypedDict): @@ -6413,6 +6527,29 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class PaymentIntentCreateParamsPaymentMethodOptionsSequra(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + 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). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsShopeepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6710,7 +6847,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index fea6c40b0..2424e32ab 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -27,6 +27,7 @@ class PaymentIntentModifyParams(RequestOptions): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -47,6 +48,7 @@ class PaymentIntentModifyParams(RequestOptions): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -146,7 +148,7 @@ class PaymentIntentModifyParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -154,14 +156,14 @@ class PaymentIntentModifyParams(RequestOptions): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -2316,13 +2318,13 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ alma: NotRequired["PaymentIntentModifyParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "PaymentIntentModifyParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentModifyParamsPaymentMethodDataAuBecsDebit" @@ -2552,6 +2554,10 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["PaymentIntentModifyParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -2636,6 +2642,7 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -3094,6 +3101,10 @@ class PaymentIntentModifyParamsPaymentMethodDataSepaDebit(TypedDict): """ +class PaymentIntentModifyParamsPaymentMethodDataSequra(TypedDict): + pass + + class PaymentIntentModifyParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -3502,6 +3513,12 @@ class PaymentIntentModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + sequra: NotRequired[ + "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsSequra" + ] + """ + If this is a `sequra` PaymentMethod, this sub-hash contains details about the SeQura payment method options. + """ shopeepay: NotRequired[ "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsShopeepay" ] @@ -3815,6 +3832,74 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + company_details: NotRequired[ + "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT id number + """ + + +class PaymentIntentModifyParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class PaymentIntentModifyParamsPaymentMethodOptionsBizum(TypedDict): @@ -3826,7 +3911,15 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + mandate_options: NotRequired[ + "PaymentIntentModifyParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']|str" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3840,6 +3933,15 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBlik(TypedDict): """ +class PaymentIntentModifyParamsPaymentMethodOptionsBlikMandateOptions( + TypedDict, +): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ @@ -3942,6 +4044,12 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCard(TypedDict): """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3970,6 +4078,18 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + stored_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + + When making an off session payment with a previously saved card (that was saved with a SetupIntent or with a PaymentIntent with `setup_future_usage`), set this parameter to indicate the type of transaction. + + You can set this parameter at any time before or during PaymentIntent confirmation, and confirm this PaymentIntent with `off_session=true`. + + Note that this parameter is currently unsupported with the `setup_future_usage` parameter. + """ three_d_secure: NotRequired[ "PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -5982,14 +6102,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaypalLineItemTax( class PaymentIntentModifyParamsPaymentMethodOptionsPaypay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. - """ + pass class PaymentIntentModifyParamsPaymentMethodOptionsPayto(TypedDict): @@ -6266,6 +6379,29 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class PaymentIntentModifyParamsPaymentMethodOptionsSequra(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + 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). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsShopeepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6563,7 +6699,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 9a0356742..4e1809f60 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -26,6 +26,7 @@ class PaymentIntentUpdateParams(TypedDict): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -46,6 +47,7 @@ class PaymentIntentUpdateParams(TypedDict): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -145,7 +147,7 @@ class PaymentIntentUpdateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -153,14 +155,14 @@ class PaymentIntentUpdateParams(TypedDict): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -2315,13 +2317,13 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["PaymentIntentUpdateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodDataAuBecsDebit" @@ -2551,6 +2553,10 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["PaymentIntentUpdateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -2635,6 +2641,7 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -3093,6 +3100,10 @@ class PaymentIntentUpdateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class PaymentIntentUpdateParamsPaymentMethodDataSequra(TypedDict): + pass + + class PaymentIntentUpdateParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -3501,6 +3512,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + sequra: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsSequra" + ] + """ + If this is a `sequra` PaymentMethod, this sub-hash contains details about the SeQura payment method options. + """ shopeepay: NotRequired[ "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsShopeepay" ] @@ -3814,6 +3831,74 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBillie(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + company_details: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + reference: NotRequired[str] + """ + An identifier or reference that this payment corresponds to. + """ + + +class PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT id number + """ + + +class PaymentIntentUpdateParamsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class PaymentIntentUpdateParamsPaymentMethodOptionsBizum(TypedDict): @@ -3825,7 +3910,15 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBlik(TypedDict): """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ - setup_future_usage: NotRequired["Literal['']|Literal['none']"] + mandate_options: NotRequired[ + "PaymentIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session']|str" + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3839,6 +3932,15 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBlik(TypedDict): """ +class PaymentIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions( + TypedDict, +): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ @@ -3941,6 +4043,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3969,6 +4077,18 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): """ Statement details for this payment intent. You can use this to override the merchant details shown on your customers' statements. """ + stored_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + + When making an off session payment with a previously saved card (that was saved with a SetupIntent or with a PaymentIntent with `setup_future_usage`), set this parameter to indicate the type of transaction. + + You can set this parameter at any time before or during PaymentIntent confirmation, and confirm this PaymentIntent with `off_session=true`. + + Note that this parameter is currently unsupported with the `setup_future_usage` parameter. + """ three_d_secure: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure" ] @@ -5981,14 +6101,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaypalLineItemTax( class PaymentIntentUpdateParamsPaymentMethodOptionsPaypay(TypedDict): - capture_method: NotRequired["Literal['']|Literal['manual']"] - """ - Controls when the funds are captured from the customer's account. - - If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. - - If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. - """ + pass class PaymentIntentUpdateParamsPaymentMethodOptionsPayto(TypedDict): @@ -6265,6 +6378,29 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class PaymentIntentUpdateParamsPaymentMethodOptionsSequra(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://docs.stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + 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). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsShopeepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -6562,7 +6698,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index 5ef607219..dd25529ed 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -42,11 +42,11 @@ class PaymentLinkCreateParams(RequestOptions): """ custom_fields: NotRequired[List["PaymentLinkCreateParamsCustomField"]] """ - 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`. + 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 `elements`. """ custom_text: NotRequired["PaymentLinkCreateParamsCustomText"] """ - Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. + Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `elements`. """ customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ @@ -154,6 +154,7 @@ class PaymentLinkCreateParams(RequestOptions): "rechnung", "satispay", "sepa_debit", + "sequra", "shopeepay", "sofort", "sunbit", @@ -356,7 +357,7 @@ class PaymentLinkCreateParamsCustomFieldDropdownOption(TypedDict): class PaymentLinkCreateParamsCustomFieldLabel(TypedDict): custom: str """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -1168,7 +1169,7 @@ class PaymentLinkCreateParamsTaxIdCollection(TypedDict): """ required: NotRequired["Literal['if_supported', 'never']|str"] """ - Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. + Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `elements`. """ diff --git a/stripe/params/_payment_link_modify_params.py b/stripe/params/_payment_link_modify_params.py index 413a5f382..225c977d7 100644 --- a/stripe/params/_payment_link_modify_params.py +++ b/stripe/params/_payment_link_modify_params.py @@ -43,11 +43,11 @@ class PaymentLinkModifyParams(RequestOptions): "Literal['']|List[PaymentLinkModifyParamsCustomField]" ] """ - 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`. + 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 `elements`. """ custom_text: NotRequired["PaymentLinkModifyParamsCustomText"] """ - Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. + Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `elements`. """ customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ @@ -114,7 +114,7 @@ class PaymentLinkModifyParams(RequestOptions): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). @@ -308,7 +308,7 @@ class PaymentLinkModifyParamsCustomFieldDropdownOption(TypedDict): class PaymentLinkModifyParamsCustomFieldLabel(TypedDict): custom: str """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -1007,7 +1007,7 @@ class PaymentLinkModifyParamsTaxIdCollection(TypedDict): """ required: NotRequired["Literal['if_supported', 'never']|str"] """ - Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. + Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `elements`. """ diff --git a/stripe/params/_payment_link_update_params.py b/stripe/params/_payment_link_update_params.py index 16bd69135..7c516c87e 100644 --- a/stripe/params/_payment_link_update_params.py +++ b/stripe/params/_payment_link_update_params.py @@ -42,11 +42,11 @@ class PaymentLinkUpdateParams(TypedDict): "Literal['']|List[PaymentLinkUpdateParamsCustomField]" ] """ - 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`. + 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 `elements`. """ custom_text: NotRequired["PaymentLinkUpdateParamsCustomText"] """ - Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. + Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `elements`. """ customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ @@ -113,7 +113,7 @@ class PaymentLinkUpdateParams(TypedDict): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). @@ -307,7 +307,7 @@ class PaymentLinkUpdateParamsCustomFieldDropdownOption(TypedDict): class PaymentLinkUpdateParamsCustomFieldLabel(TypedDict): custom: str """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -1006,7 +1006,7 @@ class PaymentLinkUpdateParamsTaxIdCollection(TypedDict): """ required: NotRequired["Literal['if_supported', 'never']|str"] """ - Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. + Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `elements`. """ diff --git a/stripe/params/_payment_method_configuration_create_params.py b/stripe/params/_payment_method_configuration_create_params.py index 9a1e4e1b7..36daf6e97 100644 --- a/stripe/params/_payment_method_configuration_create_params.py +++ b/stripe/params/_payment_method_configuration_create_params.py @@ -262,6 +262,10 @@ class PaymentMethodConfigurationCreateParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://docs.stripe.com/payments/sepa-debit) for more details. """ + sequra: NotRequired["PaymentMethodConfigurationCreateParamsSequra"] + """ + SeQura is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers customers payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with SeQura, then return to your website or app. You get [immediate notification](https://docs.stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ shopeepay: NotRequired["PaymentMethodConfigurationCreateParamsShopeepay"] """ ShopeePay is a [single use](https://docs.stripe.com/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. @@ -1256,6 +1260,22 @@ class PaymentMethodConfigurationCreateParamsSepaDebitDisplayPreference( """ +class PaymentMethodConfigurationCreateParamsSequra(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationCreateParamsSequraDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationCreateParamsSequraDisplayPreference(TypedDict): + preference: NotRequired["Literal['none', 'off', 'on']|str"] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationCreateParamsShopeepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationCreateParamsShopeepayDisplayPreference" diff --git a/stripe/params/_payment_method_configuration_modify_params.py b/stripe/params/_payment_method_configuration_modify_params.py index b965969a0..b8f175074 100644 --- a/stripe/params/_payment_method_configuration_modify_params.py +++ b/stripe/params/_payment_method_configuration_modify_params.py @@ -262,6 +262,10 @@ class PaymentMethodConfigurationModifyParams(RequestOptions): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://docs.stripe.com/payments/sepa-debit) for more details. """ + sequra: NotRequired["PaymentMethodConfigurationModifyParamsSequra"] + """ + SeQura is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers customers payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with SeQura, then return to your website or app. You get [immediate notification](https://docs.stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ shopeepay: NotRequired["PaymentMethodConfigurationModifyParamsShopeepay"] """ ShopeePay is a [single use](https://docs.stripe.com/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. @@ -1256,6 +1260,22 @@ class PaymentMethodConfigurationModifyParamsSepaDebitDisplayPreference( """ +class PaymentMethodConfigurationModifyParamsSequra(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationModifyParamsSequraDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationModifyParamsSequraDisplayPreference(TypedDict): + preference: NotRequired["Literal['none', 'off', 'on']|str"] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationModifyParamsShopeepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationModifyParamsShopeepayDisplayPreference" diff --git a/stripe/params/_payment_method_configuration_update_params.py b/stripe/params/_payment_method_configuration_update_params.py index 361635803..890dbedbc 100644 --- a/stripe/params/_payment_method_configuration_update_params.py +++ b/stripe/params/_payment_method_configuration_update_params.py @@ -261,6 +261,10 @@ class PaymentMethodConfigurationUpdateParams(TypedDict): """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://docs.stripe.com/payments/sepa-debit) for more details. """ + sequra: NotRequired["PaymentMethodConfigurationUpdateParamsSequra"] + """ + SeQura is a [single-use](https://docs.stripe.com/payments/payment-methods#usage) payment method that offers customers payment terms ranging from 7-120 days. Customers are redirected from your website or app, authorize the payment with SeQura, then return to your website or app. You get [immediate notification](https://docs.stripe.com/payments/payment-methods#payment-notification) of whether the payment succeeded or failed. + """ shopeepay: NotRequired["PaymentMethodConfigurationUpdateParamsShopeepay"] """ ShopeePay is a [single use](https://docs.stripe.com/payments/payment-methods#usage) digital wallet payment method popular in Indonesia. When paying with GoPay, customers authenticate and approve payments using the Shopee app. Desktop checkout is performed by scanning a QR code. When checking out on mobile, customers are redirected to the Shopee app to confirm payment. @@ -1255,6 +1259,22 @@ class PaymentMethodConfigurationUpdateParamsSepaDebitDisplayPreference( """ +class PaymentMethodConfigurationUpdateParamsSequra(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationUpdateParamsSequraDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationUpdateParamsSequraDisplayPreference(TypedDict): + preference: NotRequired["Literal['none', 'off', 'on']|str"] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationUpdateParamsShopeepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationUpdateParamsShopeepayDisplayPreference" diff --git a/stripe/params/_payment_method_create_params.py b/stripe/params/_payment_method_create_params.py index f80abf105..478879e4a 100644 --- a/stripe/params/_payment_method_create_params.py +++ b/stripe/params/_payment_method_create_params.py @@ -31,11 +31,11 @@ class PaymentMethodCreateParams(RequestOptions): """ alma: NotRequired["PaymentMethodCreateParamsAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired["PaymentMethodCreateParamsAmazonPay"] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired["PaymentMethodCreateParamsAuBecsDebit"] """ @@ -249,6 +249,10 @@ class PaymentMethodCreateParams(RequestOptions): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["PaymentMethodCreateParamsSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shopeepay: NotRequired["PaymentMethodCreateParamsShopeepay"] """ If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method. @@ -274,7 +278,7 @@ class PaymentMethodCreateParams(RequestOptions): If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -758,6 +762,10 @@ class PaymentMethodCreateParamsSepaDebit(TypedDict): """ +class PaymentMethodCreateParamsSequra(TypedDict): + pass + + class PaymentMethodCreateParamsShopeepay(TypedDict): pass diff --git a/stripe/params/_payment_method_list_params.py b/stripe/params/_payment_method_list_params.py index 098b88099..abe192e57 100644 --- a/stripe/params/_payment_method_list_params.py +++ b/stripe/params/_payment_method_list_params.py @@ -37,7 +37,7 @@ class PaymentMethodListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ Filters the list by the object `type` field. Unfiltered, the list returns all payment method types except `custom`. If your integration expects only one type of payment method in the response, specify that type value in the request to reduce your payload. diff --git a/stripe/params/_payment_method_modify_params.py b/stripe/params/_payment_method_modify_params.py index 89c62df5f..ad7683066 100644 --- a/stripe/params/_payment_method_modify_params.py +++ b/stripe/params/_payment_method_modify_params.py @@ -31,10 +31,6 @@ class PaymentMethodModifyParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - payto: NotRequired["PaymentMethodModifyParamsPayto"] - """ - If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. - """ us_bank_account: NotRequired["PaymentMethodModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -117,21 +113,6 @@ class PaymentMethodModifyParamsCardNetworks(TypedDict): """ -class PaymentMethodModifyParamsPayto(TypedDict): - account_number: NotRequired[str] - """ - The account number for the bank account. - """ - bsb_number: NotRequired[str] - """ - Bank-State-Branch number of the bank account. - """ - pay_id: NotRequired[str] - """ - The PayID alias for the bank account. - """ - - class PaymentMethodModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ diff --git a/stripe/params/_payment_method_update_params.py b/stripe/params/_payment_method_update_params.py index 4bd40a7b1..7e9ec72b0 100644 --- a/stripe/params/_payment_method_update_params.py +++ b/stripe/params/_payment_method_update_params.py @@ -30,10 +30,6 @@ class PaymentMethodUpdateParams(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - payto: NotRequired["PaymentMethodUpdateParamsPayto"] - """ - If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method. - """ us_bank_account: NotRequired["PaymentMethodUpdateParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -116,21 +112,6 @@ class PaymentMethodUpdateParamsCardNetworks(TypedDict): """ -class PaymentMethodUpdateParamsPayto(TypedDict): - account_number: NotRequired[str] - """ - The account number for the bank account. - """ - bsb_number: NotRequired[str] - """ - Bank-State-Branch number of the bank account. - """ - pay_id: NotRequired[str] - """ - The PayID alias for the bank account. - """ - - class PaymentMethodUpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ diff --git a/stripe/params/_payment_record_report_payment_attempt_informational_params.py b/stripe/params/_payment_record_report_payment_attempt_informational_params.py index 8e2b9efe1..e868b0926 100644 --- a/stripe/params/_payment_record_report_payment_attempt_informational_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_informational_params.py @@ -44,7 +44,7 @@ class PaymentRecordReportPaymentAttemptInformationalParamsCustomerDetails( """ email: NotRequired[str] """ - The customer's phone number. + The customer's email address. """ name: NotRequired[str] """ diff --git a/stripe/params/_payment_record_report_payment_attempt_params.py b/stripe/params/_payment_record_report_payment_attempt_params.py index 64fefbab7..06eac213e 100644 --- a/stripe/params/_payment_record_report_payment_attempt_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_params.py @@ -7,6 +7,10 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): + canceled: NotRequired["PaymentRecordReportPaymentAttemptParamsCanceled"] + """ + Information about the payment attempt cancelation. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -35,7 +39,7 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - outcome: NotRequired["Literal['failed', 'guaranteed']|str"] + outcome: NotRequired["Literal['canceled', 'failed', 'guaranteed']|str"] """ The outcome of the reported payment. """ @@ -53,6 +57,13 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): """ +class PaymentRecordReportPaymentAttemptParamsCanceled(TypedDict): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + + class PaymentRecordReportPaymentAttemptParamsFailed(TypedDict): failed_at: int """ diff --git a/stripe/params/_payment_record_report_payment_params.py b/stripe/params/_payment_record_report_payment_params.py index 76dea78ce..cc41e3793 100644 --- a/stripe/params/_payment_record_report_payment_params.py +++ b/stripe/params/_payment_record_report_payment_params.py @@ -11,6 +11,10 @@ class PaymentRecordReportPaymentParams(RequestOptions): """ The amount you initially requested for this payment. """ + canceled: NotRequired["PaymentRecordReportPaymentParamsCanceled"] + """ + Information about the payment attempt cancelation. + """ customer_details: NotRequired[ "PaymentRecordReportPaymentParamsCustomerDetails" ] @@ -47,7 +51,7 @@ class PaymentRecordReportPaymentParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - outcome: NotRequired["Literal['failed', 'guaranteed']|str"] + outcome: NotRequired["Literal['canceled', 'failed', 'guaranteed']|str"] """ The outcome of the reported payment. """ @@ -82,6 +86,13 @@ class PaymentRecordReportPaymentParamsAmountRequested(TypedDict): """ +class PaymentRecordReportPaymentParamsCanceled(TypedDict): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + + class PaymentRecordReportPaymentParamsCustomerDetails(TypedDict): customer: NotRequired[str] """ @@ -89,7 +100,7 @@ class PaymentRecordReportPaymentParamsCustomerDetails(TypedDict): """ email: NotRequired[str] """ - The customer's phone number. + The customer's email address. """ name: NotRequired[str] """ diff --git a/stripe/params/_payout_create_params.py b/stripe/params/_payout_create_params.py index bf98c6d19..1b1d439b2 100644 --- a/stripe/params/_payout_create_params.py +++ b/stripe/params/_payout_create_params.py @@ -9,7 +9,7 @@ class PayoutCreateParams(RequestOptions): amount: int """ - A positive integer in cents representing how much to payout. + A positive integer in cents representing how much to pay out. """ currency: str """ diff --git a/stripe/params/_plan_create_params.py b/stripe/params/_plan_create_params.py index cdf68a865..98b7c252c 100644 --- a/stripe/params/_plan_create_params.py +++ b/stripe/params/_plan_create_params.py @@ -34,7 +34,7 @@ class PlanCreateParams(RequestOptions): """ id: NotRequired[str] """ - An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. + An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can use the same plan ID in live mode and in your sandboxes. """ interval: Union[Literal["day", "month", "week", "year"], str] """ diff --git a/stripe/params/_product_list_params.py b/stripe/params/_product_list_params.py index 280732a53..a235f2a5d 100644 --- a/stripe/params/_product_list_params.py +++ b/stripe/params/_product_list_params.py @@ -24,7 +24,7 @@ class ProductListParams(RequestOptions): """ ids: NotRequired[List[str]] """ - Only return products with the given IDs. Cannot be used with [starting_after](https://api.stripe.com#list_products-starting_after) or [ending_before](https://api.stripe.com#list_products-ending_before). + Only return products with the given IDs. Cannot be used with [starting_after](https://docs.stripe.com/api#list_products-starting_after) or [ending_before](https://docs.stripe.com/api#list_products-ending_before). """ limit: NotRequired[int] """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index 6ff55bc20..41c2df3e3 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -27,6 +27,7 @@ class SetupIntentConfirmParams(RequestOptions): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -47,6 +48,7 @@ class SetupIntentConfirmParams(RequestOptions): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -234,13 +236,13 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ alma: NotRequired["SetupIntentConfirmParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "SetupIntentConfirmParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentConfirmParamsPaymentMethodDataAuBecsDebit" @@ -466,6 +468,10 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["SetupIntentConfirmParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -550,6 +556,7 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1008,6 +1015,10 @@ class SetupIntentConfirmParamsPaymentMethodDataSepaDebit(TypedDict): """ +class SetupIntentConfirmParamsPaymentMethodDataSequra(TypedDict): + pass + + class SetupIntentConfirmParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -1120,6 +1131,10 @@ class SetupIntentConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `bizum` SetupIntent, this sub-hash contains details about the Bizum payment method options. """ + blik: NotRequired["SetupIntentConfirmParamsPaymentMethodOptionsBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ card: NotRequired["SetupIntentConfirmParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1244,6 +1259,28 @@ class SetupIntentConfirmParamsPaymentMethodOptionsBizum(TypedDict): pass +class SetupIntentConfirmParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + mandate_options: NotRequired[ + "SetupIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + + +class SetupIntentConfirmParamsPaymentMethodOptionsBlikMandateOptions( + TypedDict +): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class SetupIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentConfirmParamsPaymentMethodOptionsCardMandateOptions" @@ -1269,6 +1306,12 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ three_d_secure: NotRequired[ "SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 07516bdd4..dc5be320f 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -27,6 +27,7 @@ class SetupIntentCreateParams(RequestOptions): "boleto", "capchase_pay", "card", + "card_present", "cashapp", "check_scan", "click_to_pay", @@ -47,6 +48,7 @@ class SetupIntentCreateParams(RequestOptions): "grabpay", "id_bank_transfer", "ideal", + "interac_present", "kakao_pay", "klarna", "knet", @@ -208,6 +210,7 @@ class SetupIntentCreateParams(RequestOptions): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -378,13 +381,13 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["SetupIntentCreateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "SetupIntentCreateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentCreateParamsPaymentMethodDataAuBecsDebit" @@ -606,6 +609,10 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["SetupIntentCreateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -688,6 +695,7 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1144,6 +1152,10 @@ class SetupIntentCreateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class SetupIntentCreateParamsPaymentMethodDataSequra(TypedDict): + pass + + class SetupIntentCreateParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -1256,6 +1268,10 @@ class SetupIntentCreateParamsPaymentMethodOptions(TypedDict): """ If this is a `bizum` SetupIntent, this sub-hash contains details about the Bizum payment method options. """ + blik: NotRequired["SetupIntentCreateParamsPaymentMethodOptionsBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ card: NotRequired["SetupIntentCreateParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1380,6 +1396,26 @@ class SetupIntentCreateParamsPaymentMethodOptionsBizum(TypedDict): pass +class SetupIntentCreateParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + mandate_options: NotRequired[ + "SetupIntentCreateParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + + +class SetupIntentCreateParamsPaymentMethodOptionsBlikMandateOptions(TypedDict): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class SetupIntentCreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentCreateParamsPaymentMethodOptionsCardMandateOptions" @@ -1405,6 +1441,12 @@ class SetupIntentCreateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ three_d_secure: NotRequired[ "SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecure" ] diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 5dee0cb6b..b58824c6c 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -8,7 +8,7 @@ class SetupIntentModifyParams(RequestOptions): allowed_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'card_present', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'interac_present', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" ] """ The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). @@ -36,7 +36,7 @@ class SetupIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -111,13 +111,13 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ alma: NotRequired["SetupIntentModifyParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "SetupIntentModifyParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentModifyParamsPaymentMethodDataAuBecsDebit" @@ -339,6 +339,10 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["SetupIntentModifyParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -421,6 +425,7 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -877,6 +882,10 @@ class SetupIntentModifyParamsPaymentMethodDataSepaDebit(TypedDict): """ +class SetupIntentModifyParamsPaymentMethodDataSequra(TypedDict): + pass + + class SetupIntentModifyParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -989,6 +998,10 @@ class SetupIntentModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `bizum` SetupIntent, this sub-hash contains details about the Bizum payment method options. """ + blik: NotRequired["SetupIntentModifyParamsPaymentMethodOptionsBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ card: NotRequired["SetupIntentModifyParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1113,6 +1126,26 @@ class SetupIntentModifyParamsPaymentMethodOptionsBizum(TypedDict): pass +class SetupIntentModifyParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + mandate_options: NotRequired[ + "SetupIntentModifyParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + + +class SetupIntentModifyParamsPaymentMethodOptionsBlikMandateOptions(TypedDict): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class SetupIntentModifyParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentModifyParamsPaymentMethodOptionsCardMandateOptions" @@ -1138,6 +1171,12 @@ class SetupIntentModifyParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ three_d_secure: NotRequired[ "SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecure" ] diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index 1cbbe0279..1ddf59f9b 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -7,7 +7,7 @@ class SetupIntentUpdateParams(TypedDict): allowed_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'card_present', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'interac_present', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" ] """ The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). @@ -35,7 +35,7 @@ class SetupIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -110,13 +110,13 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["SetupIntentUpdateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "SetupIntentUpdateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentUpdateParamsPaymentMethodDataAuBecsDebit" @@ -338,6 +338,10 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["SetupIntentUpdateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -420,6 +424,7 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -876,6 +881,10 @@ class SetupIntentUpdateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class SetupIntentUpdateParamsPaymentMethodDataSequra(TypedDict): + pass + + class SetupIntentUpdateParamsPaymentMethodDataShopeepay(TypedDict): pass @@ -988,6 +997,10 @@ class SetupIntentUpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `bizum` SetupIntent, this sub-hash contains details about the Bizum payment method options. """ + blik: NotRequired["SetupIntentUpdateParamsPaymentMethodOptionsBlik"] + """ + If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + """ card: NotRequired["SetupIntentUpdateParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. @@ -1112,6 +1125,26 @@ class SetupIntentUpdateParamsPaymentMethodOptionsBizum(TypedDict): pass +class SetupIntentUpdateParamsPaymentMethodOptionsBlik(TypedDict): + code: NotRequired[str] + """ + The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. + """ + mandate_options: NotRequired[ + "SetupIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions" + ] + """ + Details of the BLIK mandate + """ + + +class SetupIntentUpdateParamsPaymentMethodOptionsBlikMandateOptions(TypedDict): + expires_at: NotRequired[int] + """ + Expiry date of the mandate. + """ + + class SetupIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentUpdateParamsPaymentMethodOptionsCardMandateOptions" @@ -1137,6 +1170,12 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ + setup_credential_usage: NotRequired[ + "Literal['installment', 'recurring', 'unscheduled']|str" + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ three_d_secure: NotRequired[ "SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure" ] diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 09d4d2ff3..7931bce09 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -164,15 +164,15 @@ class SubscriptionCreateParams(RequestOptions): """ trial_end: NotRequired["Literal['now']|int"] """ - Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ trial_from_plan: NotRequired[bool] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ trial_period_days: NotRequired[int] """ - Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ trial_settings: NotRequired["SubscriptionCreateParamsTrialSettings"] """ @@ -855,7 +855,70 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact( class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillie( TypedDict, ): - pass + company_details: NotRequired[ + "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + + +class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlik( @@ -872,7 +935,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlik( class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions( TypedDict, ): - expires_after: NotRequired[int] + expires_at: NotRequired[int] """ Date when the mandate expires and no further payments will be charged. If not provided, the mandate will be set to be indefinite. """ @@ -1188,8 +1251,8 @@ class SubscriptionCreateParamsTrialSettingsEndBehavior(TypedDict): """ Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. """ - missing_payment_method: Union[ - Literal["cancel", "create_invoice", "pause"], str + missing_payment_method: NotRequired[ + "Literal['cancel', 'create_invoice', 'pause']|str" ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_subscription_item_modify_params.py b/stripe/params/_subscription_item_modify_params.py index ef0db72f7..62708e694 100644 --- a/stripe/params/_subscription_item_modify_params.py +++ b/stripe/params/_subscription_item_modify_params.py @@ -50,11 +50,11 @@ class SubscriptionItemModifyParams(RequestOptions): """ price: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionItemModifyParamsPriceData"] """ - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. """ proration_behavior: NotRequired[ "Literal['always_invoice', 'create_prorations', 'none']|str" diff --git a/stripe/params/_subscription_item_update_params.py b/stripe/params/_subscription_item_update_params.py index c2bdf7b7c..e3c6e3f02 100644 --- a/stripe/params/_subscription_item_update_params.py +++ b/stripe/params/_subscription_item_update_params.py @@ -49,11 +49,11 @@ class SubscriptionItemUpdateParams(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionItemUpdateParamsPriceData"] """ - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. """ proration_behavior: NotRequired[ "Literal['always_invoice', 'create_prorations', 'none']|str" diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index e348679ec..9d241e7fc 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -22,9 +22,11 @@ class SubscriptionModifyParams(RequestOptions): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|str"] + billing_cycle_anchor: NotRequired[ + "SubscriptionModifyParamsBillingCycleAnchor" + ] """ - Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). + Controls how the subscription's billing cycle anchor changes. Set `type` to `now` to reset the billing cycle anchor to the current time (in UTC), or `unchanged` to preserve it. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ billing_schedules: NotRequired[ "Literal['']|List[SubscriptionModifyParamsBillingSchedule]" @@ -160,7 +162,7 @@ class SubscriptionModifyParams(RequestOptions): """ trial_from_plan: NotRequired[bool] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ trial_settings: NotRequired["SubscriptionModifyParamsTrialSettings"] """ @@ -336,6 +338,13 @@ class SubscriptionModifyParamsAutomaticTaxLiability(TypedDict): """ +class SubscriptionModifyParamsBillingCycleAnchor(TypedDict): + type: Union[Literal["now", "unchanged"], str] + """ + Determines how the billing cycle anchor changes when the subscription is updated. + """ + + class SubscriptionModifyParamsBillingSchedule(TypedDict): applies_to: NotRequired[ List["SubscriptionModifyParamsBillingScheduleAppliesTo"] @@ -555,11 +564,11 @@ class SubscriptionModifyParamsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionModifyParamsItemPriceData"] """ - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. """ quantity: NotRequired[int] """ @@ -831,7 +840,70 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBancontact( class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillie( TypedDict, ): - pass + company_details: NotRequired[ + "Literal['']|SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + + +class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlik( @@ -848,7 +920,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlik( class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions( TypedDict, ): - expires_after: NotRequired[int] + expires_at: NotRequired[int] """ Date when the mandate expires and no further payments will be charged. If not provided, the mandate will be set to be indefinite. """ @@ -1164,8 +1236,8 @@ class SubscriptionModifyParamsTrialSettingsEndBehavior(TypedDict): """ Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. """ - missing_payment_method: Union[ - Literal["cancel", "create_invoice", "pause"], str + missing_payment_method: NotRequired[ + "Literal['cancel', 'create_invoice', 'pause']|str" ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_subscription_pause_params.py b/stripe/params/_subscription_pause_params.py index 8bd4a447e..41e9e5257 100644 --- a/stripe/params/_subscription_pause_params.py +++ b/stripe/params/_subscription_pause_params.py @@ -20,7 +20,7 @@ class SubscriptionPauseParams(RequestOptions): """ Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The type of pause to apply. Defaults to `subscription`. """ diff --git a/stripe/params/_subscription_resume_params.py b/stripe/params/_subscription_resume_params.py index 49c365aca..5e4cd9e3b 100644 --- a/stripe/params/_subscription_resume_params.py +++ b/stripe/params/_subscription_resume_params.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List -from typing_extensions import Literal, NotRequired +from typing import List, Union +from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionResumeParams(RequestOptions): - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|str"] + billing_cycle_anchor: NotRequired[ + "SubscriptionResumeParamsBillingCycleAnchor" + ] """ The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ @@ -30,3 +32,10 @@ class SubscriptionResumeParams(RequestOptions): """ If set, prorations will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same prorations that were previewed with the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint. """ + + +class SubscriptionResumeParamsBillingCycleAnchor(TypedDict): + type: Union[Literal["now", "unchanged"], str] + """ + Determines how the billing cycle anchor changes when the subscription resumes. + """ diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index ffa0f79fb..77576b184 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -52,6 +52,12 @@ class SubscriptionScheduleCreateParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + pause_schedules: NotRequired[ + List["SubscriptionScheduleCreateParamsPauseSchedule"] + ] + """ + Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. + """ phases: NotRequired[List["SubscriptionScheduleCreateParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. @@ -241,6 +247,163 @@ class SubscriptionScheduleCreateParamsDefaultSettingsTransferData(TypedDict): """ +class SubscriptionScheduleCreateParamsPauseSchedule(TypedDict): + key: NotRequired[str] + """ + A unique identifier for this pause schedule entry. + """ + pause: NotRequired["SubscriptionScheduleCreateParamsPauseSchedulePause"] + """ + Configuration for when and how the subscription pauses. + """ + resume: NotRequired["SubscriptionScheduleCreateParamsPauseScheduleResume"] + """ + Configuration for when and how the subscription resumes. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePause(TypedDict): + pause_at: "SubscriptionScheduleCreateParamsPauseSchedulePausePauseAt" + """ + When to pause the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettings" + ] + """ + Settings controlling billing behavior during the pause. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePausePauseAt(TypedDict): + timestamp: NotRequired[int] + """ + The Unix timestamp at which to pause the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["now", "timestamp"], str] + """ + When to pause the subscription. Use `now` to pause immediately or `timestamp` to pause at a specific time. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePauseSettings(TypedDict): + bill_for: NotRequired[ + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillFor" + ] + """ + Controls what to bill for when pausing the subscription. + """ + invoicing_behavior: NotRequired[ + "Literal['invoice', 'pending_invoice_item']|str" + ] + """ + Determines whether to generate an invoice for outstanding amounts when pausing. When adding a pause schedule, defaults to `pending_invoice_item`. On updates, the existing value is preserved if not provided. + """ + type: NotRequired["Literal['subscription']|str"] + """ + The pause type. Currently only `subscription` is supported. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillFor( + TypedDict, +): + outstanding_usage_through: NotRequired[ + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough" + ] + """ + Controls whether to collect metered usage accrued up to the pause date. + """ + unused_time_from: NotRequired[ + "SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom" + ] + """ + Controls how unused time on subscription items is credited when pausing. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough( + TypedDict, +): + type: NotRequired["Literal['none', 'pause_at']|str"] + """ + Determines whether to collect metered usage accrued up to the pause date. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleCreateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom( + TypedDict, +): + type: NotRequired[ + "Literal['item_current_period_start', 'none', 'pause_at']|str" + ] + """ + Determines which point in the billing period unused time is credited from. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleCreateParamsPauseScheduleResume(TypedDict): + resume_at: "SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAt" + """ + When to resume the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleCreateParamsPauseScheduleResumeSettings" + ] + """ + Settings controlling how the subscription resumes. + """ + + +class SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAt(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAtDuration" + ] + """ + The duration after which to resume the subscription. Required when `type` is `duration`. + """ + timestamp: NotRequired[int] + """ + The Unix timestamp at which to resume the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["duration", "now", "timestamp"], str] + """ + When to resume the subscription. Use `now` to resume immediately, `duration` to resume after a set duration, or `timestamp` to resume at a specific time. + """ + + +class SubscriptionScheduleCreateParamsPauseScheduleResumeResumeAtDuration( + TypedDict, +): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The time unit for the resume duration. One of `day`, `week`, `month`, or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals after which the subscription resumes. + """ + + +class SubscriptionScheduleCreateParamsPauseScheduleResumeSettings(TypedDict): + billing_cycle_anchor: NotRequired["Literal['resume_at', 'unchanged']|str"] + """ + Controls the billing cycle anchor when the subscription resumes. When adding a pause schedule, defaults to `resume_at`. On updates, the existing value is preserved if not provided. + """ + payment_behavior: NotRequired[ + "Literal['resume_on_payment_attempt', 'resume_on_payment_success']|str" + ] + """ + Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. When adding a pause schedule, defaults to `resume_on_payment_success`. On updates, the existing value is preserved if not provided. + """ + proration_behavior: NotRequired[ + "Literal['always_invoice', 'create_prorations', 'none']|str" + ] + """ + Determines how to handle prorations when the subscription resumes. When adding a pause schedule, defaults to `create_prorations`. On updates, the existing value is preserved if not provided. + """ + + class SubscriptionScheduleCreateParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionScheduleCreateParamsPhaseAddInvoiceItem"] diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index 4ceff3705..d6619b367 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -36,6 +36,12 @@ class SubscriptionScheduleModifyParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + pause_schedules: NotRequired[ + "Literal['']|List[SubscriptionScheduleModifyParamsPauseSchedule]" + ] + """ + Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. Include a key to update an existing entry. Omit to leave an existing pause schedule unchanged, or pass "" to clear it. + """ phases: NotRequired[List["SubscriptionScheduleModifyParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. @@ -207,6 +213,169 @@ class SubscriptionScheduleModifyParamsDefaultSettingsTransferData(TypedDict): """ +class SubscriptionScheduleModifyParamsPauseSchedule(TypedDict): + key: NotRequired[str] + """ + A unique identifier for this pause schedule entry. + """ + pause: NotRequired["SubscriptionScheduleModifyParamsPauseSchedulePause"] + """ + Configuration for when and how the subscription pauses. + """ + resume: NotRequired[ + "Literal['']|SubscriptionScheduleModifyParamsPauseScheduleResume" + ] + """ + Configuration for when and how the subscription resumes. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePause(TypedDict): + pause_at: NotRequired[ + "SubscriptionScheduleModifyParamsPauseSchedulePausePauseAt" + ] + """ + When to pause the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettings" + ] + """ + Settings controlling billing behavior during the pause. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePausePauseAt(TypedDict): + timestamp: NotRequired[int] + """ + The Unix timestamp at which to pause the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["now", "timestamp"], str] + """ + When to pause the subscription. Use `now` to pause immediately or `timestamp` to pause at a specific time. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePauseSettings(TypedDict): + bill_for: NotRequired[ + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillFor" + ] + """ + Controls what to bill for when pausing the subscription. + """ + invoicing_behavior: NotRequired[ + "Literal['invoice', 'pending_invoice_item']|str" + ] + """ + Determines whether to generate an invoice for outstanding amounts when pausing. When adding a pause schedule, defaults to `pending_invoice_item`. On updates, the existing value is preserved if not provided. + """ + type: NotRequired["Literal['subscription']|str"] + """ + The pause type. Currently only `subscription` is supported. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillFor( + TypedDict, +): + outstanding_usage_through: NotRequired[ + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough" + ] + """ + Controls whether to collect metered usage accrued up to the pause date. + """ + unused_time_from: NotRequired[ + "SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom" + ] + """ + Controls how unused time on subscription items is credited when pausing. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough( + TypedDict, +): + type: NotRequired["Literal['none', 'pause_at']|str"] + """ + Determines whether to collect metered usage accrued up to the pause date. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleModifyParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom( + TypedDict, +): + type: NotRequired[ + "Literal['item_current_period_start', 'none', 'pause_at']|str" + ] + """ + Determines which point in the billing period unused time is credited from. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleModifyParamsPauseScheduleResume(TypedDict): + resume_at: NotRequired[ + "SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAt" + ] + """ + When to resume the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleModifyParamsPauseScheduleResumeSettings" + ] + """ + Settings controlling how the subscription resumes. + """ + + +class SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAt(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAtDuration" + ] + """ + The duration after which to resume the subscription. Required when `type` is `duration`. + """ + timestamp: NotRequired[int] + """ + The Unix timestamp at which to resume the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["duration", "now", "timestamp"], str] + """ + When to resume the subscription. Use `now` to resume immediately, `duration` to resume after a set duration, or `timestamp` to resume at a specific time. + """ + + +class SubscriptionScheduleModifyParamsPauseScheduleResumeResumeAtDuration( + TypedDict, +): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The time unit for the resume duration. One of `day`, `week`, `month`, or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals after which the subscription resumes. + """ + + +class SubscriptionScheduleModifyParamsPauseScheduleResumeSettings(TypedDict): + billing_cycle_anchor: NotRequired["Literal['resume_at', 'unchanged']|str"] + """ + Controls the billing cycle anchor when the subscription resumes. When adding a pause schedule, defaults to `resume_at`. On updates, the existing value is preserved if not provided. + """ + payment_behavior: NotRequired[ + "Literal['resume_on_payment_attempt', 'resume_on_payment_success']|str" + ] + """ + Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. When adding a pause schedule, defaults to `resume_on_payment_success`. On updates, the existing value is preserved if not provided. + """ + proration_behavior: NotRequired[ + "Literal['always_invoice', 'create_prorations', 'none']|str" + ] + """ + Determines how to handle prorations when the subscription resumes. When adding a pause schedule, defaults to `create_prorations`. On updates, the existing value is preserved if not provided. + """ + + class SubscriptionScheduleModifyParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionScheduleModifyParamsPhaseAddInvoiceItem"] diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index 9c4897457..42d722fe0 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -35,6 +35,12 @@ class SubscriptionScheduleUpdateParams(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + pause_schedules: NotRequired[ + "Literal['']|List[SubscriptionScheduleUpdateParamsPauseSchedule]" + ] + """ + Configures the subscription's pause behavior and, optionally, its resume behavior. Only one entry is supported. Include a key to update an existing entry. Omit to leave an existing pause schedule unchanged, or pass "" to clear it. + """ phases: NotRequired[List["SubscriptionScheduleUpdateParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. @@ -206,6 +212,169 @@ class SubscriptionScheduleUpdateParamsDefaultSettingsTransferData(TypedDict): """ +class SubscriptionScheduleUpdateParamsPauseSchedule(TypedDict): + key: NotRequired[str] + """ + A unique identifier for this pause schedule entry. + """ + pause: NotRequired["SubscriptionScheduleUpdateParamsPauseSchedulePause"] + """ + Configuration for when and how the subscription pauses. + """ + resume: NotRequired[ + "Literal['']|SubscriptionScheduleUpdateParamsPauseScheduleResume" + ] + """ + Configuration for when and how the subscription resumes. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePause(TypedDict): + pause_at: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseSchedulePausePauseAt" + ] + """ + When to pause the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings" + ] + """ + Settings controlling billing behavior during the pause. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePausePauseAt(TypedDict): + timestamp: NotRequired[int] + """ + The Unix timestamp at which to pause the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["now", "timestamp"], str] + """ + When to pause the subscription. Use `now` to pause immediately or `timestamp` to pause at a specific time. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings(TypedDict): + bill_for: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillFor" + ] + """ + Controls what to bill for when pausing the subscription. + """ + invoicing_behavior: NotRequired[ + "Literal['invoice', 'pending_invoice_item']|str" + ] + """ + Determines whether to generate an invoice for outstanding amounts when pausing. When adding a pause schedule, defaults to `pending_invoice_item`. On updates, the existing value is preserved if not provided. + """ + type: NotRequired["Literal['subscription']|str"] + """ + The pause type. Currently only `subscription` is supported. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillFor( + TypedDict, +): + outstanding_usage_through: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough" + ] + """ + Controls whether to collect metered usage accrued up to the pause date. + """ + unused_time_from: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom" + ] + """ + Controls how unused time on subscription items is credited when pausing. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForOutstandingUsageThrough( + TypedDict, +): + type: NotRequired["Literal['none', 'pause_at']|str"] + """ + Determines whether to collect metered usage accrued up to the pause date. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleUpdateParamsPauseSchedulePauseSettingsBillForUnusedTimeFrom( + TypedDict, +): + type: NotRequired[ + "Literal['item_current_period_start', 'none', 'pause_at']|str" + ] + """ + Determines which point in the billing period unused time is credited from. When adding a pause schedule, defaults to `pause_at`. On updates, the existing value is preserved if not provided. + """ + + +class SubscriptionScheduleUpdateParamsPauseScheduleResume(TypedDict): + resume_at: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAt" + ] + """ + When to resume the subscription. + """ + settings: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseScheduleResumeSettings" + ] + """ + Settings controlling how the subscription resumes. + """ + + +class SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAt(TypedDict): + duration: NotRequired[ + "SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAtDuration" + ] + """ + The duration after which to resume the subscription. Required when `type` is `duration`. + """ + timestamp: NotRequired[int] + """ + The Unix timestamp at which to resume the subscription. Required when `type` is `timestamp`. + """ + type: Union[Literal["duration", "now", "timestamp"], str] + """ + When to resume the subscription. Use `now` to resume immediately, `duration` to resume after a set duration, or `timestamp` to resume at a specific time. + """ + + +class SubscriptionScheduleUpdateParamsPauseScheduleResumeResumeAtDuration( + TypedDict, +): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The time unit for the resume duration. One of `day`, `week`, `month`, or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals after which the subscription resumes. + """ + + +class SubscriptionScheduleUpdateParamsPauseScheduleResumeSettings(TypedDict): + billing_cycle_anchor: NotRequired["Literal['resume_at', 'unchanged']|str"] + """ + Controls the billing cycle anchor when the subscription resumes. When adding a pause schedule, defaults to `resume_at`. On updates, the existing value is preserved if not provided. + """ + payment_behavior: NotRequired[ + "Literal['resume_on_payment_attempt', 'resume_on_payment_success']|str" + ] + """ + Controls whether Stripe attempts payment on the resumption invoice and how payment affects the subscription's status. When adding a pause schedule, defaults to `resume_on_payment_success`. On updates, the existing value is preserved if not provided. + """ + proration_behavior: NotRequired[ + "Literal['always_invoice', 'create_prorations', 'none']|str" + ] + """ + Determines how to handle prorations when the subscription resumes. When adding a pause schedule, defaults to `create_prorations`. On updates, the existing value is preserved if not provided. + """ + + class SubscriptionScheduleUpdateParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionScheduleUpdateParamsPhaseAddInvoiceItem"] diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index 375990e29..8d9e953e8 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -21,9 +21,11 @@ class SubscriptionUpdateParams(TypedDict): """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ - billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|str"] + billing_cycle_anchor: NotRequired[ + "SubscriptionUpdateParamsBillingCycleAnchor" + ] """ - Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). + Controls how the subscription's billing cycle anchor changes. Set `type` to `now` to reset the billing cycle anchor to the current time (in UTC), or `unchanged` to preserve it. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ billing_schedules: NotRequired[ "Literal['']|List[SubscriptionUpdateParamsBillingSchedule]" @@ -159,7 +161,7 @@ class SubscriptionUpdateParams(TypedDict): """ trial_from_plan: NotRequired[bool] """ - Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials) to learn more. + Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://docs.stripe.com/billing/subscriptions/trials/free-trials) to learn more. """ trial_settings: NotRequired["SubscriptionUpdateParamsTrialSettings"] """ @@ -335,6 +337,13 @@ class SubscriptionUpdateParamsAutomaticTaxLiability(TypedDict): """ +class SubscriptionUpdateParamsBillingCycleAnchor(TypedDict): + type: Union[Literal["now", "unchanged"], str] + """ + Determines how the billing cycle anchor changes when the subscription is updated. + """ + + class SubscriptionUpdateParamsBillingSchedule(TypedDict): applies_to: NotRequired[ List["SubscriptionUpdateParamsBillingScheduleAppliesTo"] @@ -554,11 +563,11 @@ class SubscriptionUpdateParamsItem(TypedDict): """ price: NotRequired[str] """ - The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + The ID of the price object. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionUpdateParamsItemPriceData"] """ - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. + Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. You can use either `price` or `price_data`, but not both, to set or change this item's price. If you're updating an existing item without changing its price, omit both. """ quantity: NotRequired[int] """ @@ -830,7 +839,70 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact( class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillie( TypedDict, ): - pass + company_details: NotRequired[ + "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails" + ] + """ + Registration details about the buyer's organization. + """ + + +class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetails( + TypedDict, +): + registered_address: NotRequired[ + "Literal['']|SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress" + ] + """ + The address the company or entity is registered with. + """ + registered_name: NotRequired[str] + """ + Company or entity name. + """ + registration_number: NotRequired[str] + """ + The official registration number for the given registration type. + """ + registration_type: NotRequired[ + "Literal['']|Literal['ch_ein', 'de_hrb', 'dk_cvr', 'es_cif', 'fi_tunnus', 'fr_siren', 'fr_siret', 'it_rea', 'nl_kvk', 'no_org_number', 'no_pno', 'se_org_number', 'se_pno', 'uk_crn']|str" + ] + """ + Type of registration the company or entity holds in their registered country. + """ + vat: NotRequired[str] + """ + VAT ID number. + """ + + +class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBillieCompanyDetailsRegisteredAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code. + """ + line1: NotRequired[str] + """ + Address line 1 (for example, street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (for example, apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlik( @@ -847,7 +919,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlik( class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBlikMandateOptions( TypedDict, ): - expires_after: NotRequired[int] + expires_at: NotRequired[int] """ Date when the mandate expires and no further payments will be charged. If not provided, the mandate will be set to be indefinite. """ @@ -1163,8 +1235,8 @@ class SubscriptionUpdateParamsTrialSettingsEndBehavior(TypedDict): """ Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. """ - missing_payment_method: Union[ - Literal["cancel", "create_invoice", "pause"], str + missing_payment_method: NotRequired[ + "Literal['cancel', 'create_invoice', 'pause']|str" ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_tax_rate_create_params.py b/stripe/params/_tax_rate_create_params.py index fd468e032..2ca0e360c 100644 --- a/stripe/params/_tax_rate_create_params.py +++ b/stripe/params/_tax_rate_create_params.py @@ -48,7 +48,7 @@ class TaxRateCreateParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_tax_rate_modify_params.py b/stripe/params/_tax_rate_modify_params.py index f80102138..d31f79dec 100644 --- a/stripe/params/_tax_rate_modify_params.py +++ b/stripe/params/_tax_rate_modify_params.py @@ -42,7 +42,7 @@ class TaxRateModifyParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_tax_rate_update_params.py b/stripe/params/_tax_rate_update_params.py index 6b7fff635..5394fe4e6 100644 --- a/stripe/params/_tax_rate_update_params.py +++ b/stripe/params/_tax_rate_update_params.py @@ -41,7 +41,7 @@ class TaxRateUpdateParams(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" + "Literal['amusement_tax', 'communications_tax', 'digital_excise_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'utility_users_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_token_create_params.py b/stripe/params/_token_create_params.py index c12dbfaae..0a541b75a 100644 --- a/stripe/params/_token_create_params.py +++ b/stripe/params/_token_create_params.py @@ -402,11 +402,11 @@ class TokenCreateParamsAccountCompanyVerification(TypedDict): class TokenCreateParamsAccountCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -685,22 +685,22 @@ class TokenCreateParamsAccountIndividualVerificationAdditionalDocument( ): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class TokenCreateParamsAccountIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1081,21 +1081,21 @@ class TokenCreateParamsPersonDocuments(TypedDict): class TokenCreateParamsPersonDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class TokenCreateParamsPersonDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class TokenCreateParamsPersonDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -1263,22 +1263,22 @@ class TokenCreateParamsPersonVerification(TypedDict): class TokenCreateParamsPersonVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class TokenCreateParamsPersonVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_topup_create_params.py b/stripe/params/_topup_create_params.py index 930c37cd3..5c28bc286 100644 --- a/stripe/params/_topup_create_params.py +++ b/stripe/params/_topup_create_params.py @@ -41,7 +41,7 @@ class TopupCreateParams(RequestOptions): """ source: NotRequired[str] """ - The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://docs.stripe.com/connect/testing#testing-top-ups)). + The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. While testing, this can be a test bank token (see [Testing Top-ups](https://docs.stripe.com/connect/testing#testing-top-ups)). """ statement_descriptor: NotRequired[str] """ diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index 439acc8cb..d5de75116 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -136,6 +136,7 @@ class WebhookEndpointCreateParams(RequestOptions): "2026-06-24.dahlia", "2026-07-29.dahlia", "2026-08-26.dahlia", + "2026-09-30.endive", ] ] """ @@ -163,6 +164,9 @@ class WebhookEndpointCreateParams(RequestOptions): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/_webhook_endpoint_modify_params.py b/stripe/params/_webhook_endpoint_modify_params.py index 717613716..b132e9878 100644 --- a/stripe/params/_webhook_endpoint_modify_params.py +++ b/stripe/params/_webhook_endpoint_modify_params.py @@ -30,6 +30,9 @@ class WebhookEndpointModifyParams(RequestOptions): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/_webhook_endpoint_update_params.py b/stripe/params/_webhook_endpoint_update_params.py index 20731ac5b..49d7edc00 100644 --- a/stripe/params/_webhook_endpoint_update_params.py +++ b/stripe/params/_webhook_endpoint_update_params.py @@ -29,6 +29,9 @@ class WebhookEndpointUpdateParams(TypedDict): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/apps/__init__.py b/stripe/params/apps/__init__.py index dd5370ee8..a169a47af 100644 --- a/stripe/params/apps/__init__.py +++ b/stripe/params/apps/__init__.py @@ -4,6 +4,25 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.apps._install_create_params import ( + InstallCreateParams as InstallCreateParams, + ) + from stripe.params.apps._install_list_params import ( + InstallListParams as InstallListParams, + InstallListParamsCreated as InstallListParamsCreated, + ) + from stripe.params.apps._install_modify_params import ( + InstallModifyParams as InstallModifyParams, + ) + from stripe.params.apps._install_retrieve_params import ( + InstallRetrieveParams as InstallRetrieveParams, + ) + from stripe.params.apps._install_uninstall_params import ( + InstallUninstallParams as InstallUninstallParams, + ) + from stripe.params.apps._install_update_params import ( + InstallUpdateParams as InstallUpdateParams, + ) from stripe.params.apps._secret_create_params import ( SecretCreateParams as SecretCreateParams, SecretCreateParamsScope as SecretCreateParamsScope, @@ -23,6 +42,31 @@ # name -> (import_target, is_submodule) _import_map = { + "InstallCreateParams": ( + "stripe.params.apps._install_create_params", + False, + ), + "InstallListParams": ("stripe.params.apps._install_list_params", False), + "InstallListParamsCreated": ( + "stripe.params.apps._install_list_params", + False, + ), + "InstallModifyParams": ( + "stripe.params.apps._install_modify_params", + False, + ), + "InstallRetrieveParams": ( + "stripe.params.apps._install_retrieve_params", + False, + ), + "InstallUninstallParams": ( + "stripe.params.apps._install_uninstall_params", + False, + ), + "InstallUpdateParams": ( + "stripe.params.apps._install_update_params", + False, + ), "SecretCreateParams": ("stripe.params.apps._secret_create_params", False), "SecretCreateParamsScope": ( "stripe.params.apps._secret_create_params", diff --git a/stripe/params/apps/_install_create_params.py b/stripe/params/apps/_install_create_params.py new file mode 100644 index 000000000..a287a4696 --- /dev/null +++ b/stripe/params/apps/_install_create_params.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired + + +class InstallCreateParams(RequestOptions): + app: str + """ + The ID of the app to install. + """ + channel: NotRequired[ + "Literal['private_live', 'private_test', 'public', 'testing']|str" + ] + """ + The distribution channel to install from. Defaults to `public`. A private app must be installed on `private_test` or `private_live`, matching the mode of the API key. + """ + code_challenge: NotRequired[str] + """ + For OAuth apps, the PKCE code challenge used to issue the `auth_code` returned on the install. Must be 43 to 128 characters and contain only letters, numbers, `-`, `.`, `_`, and `~`. Only applies to installs made by the app developer or an embedding platform; ignored when an account installs its own private app. + """ + code_challenge_method: NotRequired[str] + """ + The method used to derive `code_challenge`. Required when `code_challenge` is provided, and must be `S256`. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/apps/_install_list_params.py b/stripe/params/apps/_install_list_params.py new file mode 100644 index 000000000..0b17bd1ac --- /dev/null +++ b/stripe/params/apps/_install_list_params.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class InstallListParams(RequestOptions): + account: NotRequired[str] + """ + Only return installs made by this account. Only useful to app developers and embedding platforms, whose lists span the accounts that installed their app. + """ + app: NotRequired[str] + """ + Only return installs for the app specified by this app ID. + """ + approval_required: NotRequired[bool] + """ + Only return installs whose installer must authorize pending permissions, content security policy entries, or endpoints. + """ + channel: NotRequired[ + "Literal['private_live', 'private_test', 'public', 'testing']|str" + ] + """ + Only return installs in the distribution channel specified by this channel name. + """ + created: NotRequired["InstallListParamsCreated|int"] + """ + Only return app installs that were created during the given date interval. + """ + created_by: NotRequired[str] + """ + Only return installs created by the embedding platform specified by this account ID. + """ + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + "Literal['install_failed', 'installed', 'installing', 'uninstall_failed', 'uninstalling']|str" + ] + """ + Only return installs with the given status. + """ + + +class InstallListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ diff --git a/stripe/params/apps/_install_modify_params.py b/stripe/params/apps/_install_modify_params.py new file mode 100644 index 000000000..b2e10ef43 --- /dev/null +++ b/stripe/params/apps/_install_modify_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class InstallModifyParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/apps/_install_retrieve_params.py b/stripe/params/apps/_install_retrieve_params.py new file mode 100644 index 000000000..ee3371f49 --- /dev/null +++ b/stripe/params/apps/_install_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class InstallRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/apps/_install_uninstall_params.py b/stripe/params/apps/_install_uninstall_params.py new file mode 100644 index 000000000..e9a49f93f --- /dev/null +++ b/stripe/params/apps/_install_uninstall_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class InstallUninstallParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/apps/_install_update_params.py b/stripe/params/apps/_install_update_params.py new file mode 100644 index 000000000..bd02faf89 --- /dev/null +++ b/stripe/params/apps/_install_update_params.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class InstallUpdateParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing/_feedback_option_create_params.py b/stripe/params/billing/_feedback_option_create_params.py index 5676db13f..dab92123a 100644 --- a/stripe/params/billing/_feedback_option_create_params.py +++ b/stripe/params/billing/_feedback_option_create_params.py @@ -7,6 +7,9 @@ class FeedbackOptionCreateParams(RequestOptions): description: str + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/params/billing/_feedback_option_modify_params.py b/stripe/params/billing/_feedback_option_modify_params.py index a84f24863..6a55d21b2 100644 --- a/stripe/params/billing/_feedback_option_modify_params.py +++ b/stripe/params/billing/_feedback_option_modify_params.py @@ -7,6 +7,9 @@ class FeedbackOptionModifyParams(RequestOptions): description: NotRequired[str] + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/params/billing/_feedback_option_update_params.py b/stripe/params/billing/_feedback_option_update_params.py index 29704b4a7..36a6bdee1 100644 --- a/stripe/params/billing/_feedback_option_update_params.py +++ b/stripe/params/billing/_feedback_option_update_params.py @@ -6,6 +6,9 @@ class FeedbackOptionUpdateParams(TypedDict): description: NotRequired[str] + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. diff --git a/stripe/params/billing_portal/__init__.py b/stripe/params/billing_portal/__init__.py index 1fe2f4e00..ee89e8a21 100644 --- a/stripe/params/billing_portal/__init__.py +++ b/stripe/params/billing_portal/__init__.py @@ -60,6 +60,8 @@ ) from stripe.params.billing_portal._session_create_params import ( SessionCreateParams as SessionCreateParams, + SessionCreateParamsAfterExpiration as SessionCreateParamsAfterExpiration, + SessionCreateParamsAfterExpirationCustomerLogin as SessionCreateParamsAfterExpirationCustomerLogin, SessionCreateParamsFlowData as SessionCreateParamsFlowData, SessionCreateParamsFlowDataAfterCompletion as SessionCreateParamsFlowDataAfterCompletion, SessionCreateParamsFlowDataAfterCompletionHostedConfirmation as SessionCreateParamsFlowDataAfterCompletionHostedConfirmation, @@ -255,6 +257,14 @@ "stripe.params.billing_portal._session_create_params", False, ), + "SessionCreateParamsAfterExpiration": ( + "stripe.params.billing_portal._session_create_params", + False, + ), + "SessionCreateParamsAfterExpirationCustomerLogin": ( + "stripe.params.billing_portal._session_create_params", + False, + ), "SessionCreateParamsFlowData": ( "stripe.params.billing_portal._session_create_params", False, diff --git a/stripe/params/billing_portal/_session_create_params.py b/stripe/params/billing_portal/_session_create_params.py index 6e712458a..119c13523 100644 --- a/stripe/params/billing_portal/_session_create_params.py +++ b/stripe/params/billing_portal/_session_create_params.py @@ -6,6 +6,10 @@ class SessionCreateParams(RequestOptions): + after_expiration: NotRequired["SessionCreateParamsAfterExpiration"] + """ + Behavior after the portal session expires. + """ configuration: NotRequired[str] """ The ID of an existing [configuration](https://docs.stripe.com/api/customer_portal/configurations) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. @@ -42,6 +46,26 @@ class SessionCreateParams(RequestOptions): """ +class SessionCreateParamsAfterExpiration(TypedDict): + customer_login: NotRequired[ + "SessionCreateParamsAfterExpirationCustomerLogin" + ] + """ + Configuration for authenticating the customer after the session expires. + """ + type: Union[Literal["customer_login"], str] + """ + The behavior to apply when the session expires. + """ + + +class SessionCreateParamsAfterExpirationCustomerLogin(TypedDict): + expires_at: NotRequired[int] + """ + The Unix timestamp after which the customer can no longer recover this session. Leave unset to allow recovery without a deadline. + """ + + class SessionCreateParamsFlowData(TypedDict): after_completion: NotRequired["SessionCreateParamsFlowDataAfterCompletion"] """ diff --git a/stripe/params/checkout/__init__.py b/stripe/params/checkout/__init__.py index 3741ed560..cc790abe0 100644 --- a/stripe/params/checkout/__init__.py +++ b/stripe/params/checkout/__init__.py @@ -108,6 +108,7 @@ SessionCreateParamsPaymentMethodOptionsScalapay as SessionCreateParamsPaymentMethodOptionsScalapay, SessionCreateParamsPaymentMethodOptionsSepaDebit as SessionCreateParamsPaymentMethodOptionsSepaDebit, SessionCreateParamsPaymentMethodOptionsSepaDebitMandateOptions as SessionCreateParamsPaymentMethodOptionsSepaDebitMandateOptions, + SessionCreateParamsPaymentMethodOptionsSequra as SessionCreateParamsPaymentMethodOptionsSequra, SessionCreateParamsPaymentMethodOptionsSofort as SessionCreateParamsPaymentMethodOptionsSofort, SessionCreateParamsPaymentMethodOptionsSunbit as SessionCreateParamsPaymentMethodOptionsSunbit, SessionCreateParamsPaymentMethodOptionsSwish as SessionCreateParamsPaymentMethodOptionsSwish, @@ -176,6 +177,7 @@ SessionModifyParamsLineItemPriceDataProductData as SessionModifyParamsLineItemPriceDataProductData, SessionModifyParamsLineItemPriceDataProductDataTaxDetails as SessionModifyParamsLineItemPriceDataProductDataTaxDetails, SessionModifyParamsLineItemPriceDataRecurring as SessionModifyParamsLineItemPriceDataRecurring, + SessionModifyParamsPaymentIntentData as SessionModifyParamsPaymentIntentData, SessionModifyParamsShippingOption as SessionModifyParamsShippingOption, SessionModifyParamsShippingOptionShippingRateData as SessionModifyParamsShippingOptionShippingRateData, SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate as SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate, @@ -209,6 +211,7 @@ SessionUpdateParamsLineItemPriceDataProductData as SessionUpdateParamsLineItemPriceDataProductData, SessionUpdateParamsLineItemPriceDataProductDataTaxDetails as SessionUpdateParamsLineItemPriceDataProductDataTaxDetails, SessionUpdateParamsLineItemPriceDataRecurring as SessionUpdateParamsLineItemPriceDataRecurring, + SessionUpdateParamsPaymentIntentData as SessionUpdateParamsPaymentIntentData, SessionUpdateParamsShippingOption as SessionUpdateParamsShippingOption, SessionUpdateParamsShippingOptionShippingRateData as SessionUpdateParamsShippingOptionShippingRateData, SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimate as SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimate, @@ -636,6 +639,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsPaymentMethodOptionsSequra": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsPaymentMethodOptionsSofort": ( "stripe.params.checkout._session_create_params", False, @@ -868,6 +875,10 @@ "stripe.params.checkout._session_modify_params", False, ), + "SessionModifyParamsPaymentIntentData": ( + "stripe.params.checkout._session_modify_params", + False, + ), "SessionModifyParamsShippingOption": ( "stripe.params.checkout._session_modify_params", False, @@ -984,6 +995,10 @@ "stripe.params.checkout._session_update_params", False, ), + "SessionUpdateParamsPaymentIntentData": ( + "stripe.params.checkout._session_update_params", + False, + ), "SessionUpdateParamsShippingOption": ( "stripe.params.checkout._session_update_params", False, diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 71d083fbc..1833fccd9 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -20,6 +20,82 @@ class SessionCreateParams(RequestOptions): """ Enables user redeemable promotion codes. """ + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "gopay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shopeepay", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, + ] + ] + ] + """ + A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. + + Unlike `payment_method_types`, this acts as a filter on the dynamically computed set of + eligible payment methods rather than an explicit static list. Only payment methods that + are both dynamically eligible and present in this list will be offered to the customer. + """ automatic_tax: NotRequired["SessionCreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. @@ -52,11 +128,11 @@ class SessionCreateParams(RequestOptions): """ custom_fields: NotRequired[List["SessionCreateParamsCustomField"]] """ - 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`. + 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 `elements`. """ custom_text: NotRequired["SessionCreateParamsCustomText"] """ - Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. + Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `elements`. """ customer: NotRequired[str] """ @@ -157,6 +233,7 @@ class SessionCreateParams(RequestOptions): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "sunbit", @@ -234,7 +311,7 @@ class SessionCreateParams(RequestOptions): For `subscription` mode, there is a maximum of 20 line items and optional items with recurring Prices and 20 line items and optional items with one-time Prices. - You can't set this parameter if `ui_mode` is `custom`. + You can't set this parameter if `ui_mode` is `elements` or `form`. """ origin_context: NotRequired["Literal['mobile_app', 'web']|str"] """ @@ -269,90 +346,9 @@ class SessionCreateParams(RequestOptions): """ Payment-method-specific configuration. """ - payment_method_types: NotRequired[ - List[ - Union[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "gopay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "paypay", - "payto", - "pix", - "promptpay", - "qris", - "rechnung", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "shopeepay", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", - ], - str, - ] - ] - ] - """ - A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. - - You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - See [Dynamic Payment Methods](https://docs.stripe.com/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. - - Read more about the supported payment methods and their requirements in our [payment - method details guide](https://docs.stripe.com/docs/payments/checkout/payment-methods). - - If multiple payment methods are passed, Checkout will dynamically reorder them to - prioritize the most relevant payment methods based on the customer's location and - other characteristics. - """ permissions: NotRequired["SessionCreateParamsPermissions"] """ - This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. Can only be set when creating `embedded` or `custom` sessions. + This property is used to set up permissions for various actions (for example, update) on the CheckoutSession object. Can only be set when creating `embedded_page` or `elements` sessions. For specific permissions, please refer to their dedicated subsections, such as `permissions.update_shipping_details`. """ @@ -637,7 +633,7 @@ class SessionCreateParamsCustomFieldDropdownOption(TypedDict): class SessionCreateParamsCustomFieldLabel(TypedDict): custom: str """ - Custom text for the label, displayed to the customer. Up to 50 characters. + Custom text for the label, displayed to the customer. Up to 100 characters. """ type: Literal["custom"] """ @@ -1408,6 +1404,10 @@ class SessionCreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Sepa Debit payment method options. """ + sequra: NotRequired["SessionCreateParamsPaymentMethodOptionsSequra"] + """ + contains details about the SeQura payment method options. + """ sofort: NotRequired["SessionCreateParamsPaymentMethodOptionsSofort"] """ contains details about the Sofort payment method options. @@ -1541,7 +1541,7 @@ class SessionCreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): class SessionCreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1629,7 +1629,7 @@ class SessionCreateParamsPaymentMethodOptionsBacsDebitMandateOptions( class SessionCreateParamsPaymentMethodOptionsBancontact(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1656,12 +1656,12 @@ class SessionCreateParamsPaymentMethodOptionsBlik(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']|str" + "Literal['']|Literal['none', 'off_session']|str" ] class SessionCreateParamsPaymentMethodOptionsBlikMandateOptions(TypedDict): - expires_after: NotRequired[int] + expires_at: NotRequired[int] """ Date when the mandate expires and no further payments will be charged. If not provided, the mandate will be set to be indefinite. """ @@ -1733,7 +1733,7 @@ class SessionCreateParamsPaymentMethodOptionsCard(TypedDict): "SessionCreateParamsPaymentMethodOptionsCardRestrictions" ] """ - Restrictions to apply to the card payment method. For example, you can block specific card brands. You can't set this parameter if `ui_mode` is `custom`. + Restrictions to apply to the card payment method. For example, you can block specific card brands. You can't set this parameter if `ui_mode` is `elements`. """ setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ @@ -2462,6 +2462,13 @@ class SessionCreateParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class SessionCreateParamsPaymentMethodOptionsSequra(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + + class SessionCreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ @@ -2615,7 +2622,7 @@ class SessionCreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3280,7 +3287,7 @@ class SessionCreateParamsTaxIdCollection(TypedDict): """ required: NotRequired["Literal['if_supported', 'never']|str"] """ - Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. + Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `elements`. """ diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index 63d9f075b..83bb9293e 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -16,7 +16,7 @@ class SessionModifyParams(RequestOptions): "SessionModifyParamsCollectedInformation" ] """ - Information about the customer collected within the Checkout Session. Can only be set when updating `embedded` or `custom` sessions. + Information about the customer collected within the Checkout Session. Can only be set when updating `embedded_page` or `elements` sessions. """ discounts: NotRequired["Literal['']|List[SessionModifyParamsDiscount]"] """ @@ -52,6 +52,12 @@ class SessionModifyParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_intent_data: NotRequired["SessionModifyParamsPaymentIntentData"] + """ + A subset of parameters to apply to the PaymentIntent for Checkout Sessions in `payment` mode. + + You can only update these parameters when `ui_mode` is `elements` and while the session is active. If the PaymentIntent requires customer action or confirmation, updating these parameters abandons the current payment attempt and returns the PaymentIntent to `requires_payment_method`. You can't update these parameters after the PaymentIntent begins processing, requires capture, succeeds, or is canceled. + """ shipping_options: NotRequired[ "Literal['']|List[SessionModifyParamsShippingOption]" ] @@ -334,6 +340,49 @@ class SessionModifyParamsLineItemPriceDataRecurring(TypedDict): """ +class SessionModifyParamsPaymentIntentData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Pass an empty string to clear a previously configured value. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + + Pass an empty string to remove a previously supplied configuration. + """ + statement_descriptor: NotRequired["Literal['']|str"] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Pass an empty string to clear a previously configured value. + """ + statement_descriptor_suffix: NotRequired["Literal['']|str"] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Pass an empty string to clear a previously configured value. + """ + + class SessionModifyParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index babaf9889..755bd8c7e 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -15,7 +15,7 @@ class SessionUpdateParams(TypedDict): "SessionUpdateParamsCollectedInformation" ] """ - Information about the customer collected within the Checkout Session. Can only be set when updating `embedded` or `custom` sessions. + Information about the customer collected within the Checkout Session. Can only be set when updating `embedded_page` or `elements` sessions. """ discounts: NotRequired["Literal['']|List[SessionUpdateParamsDiscount]"] """ @@ -51,6 +51,12 @@ class SessionUpdateParams(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_intent_data: NotRequired["SessionUpdateParamsPaymentIntentData"] + """ + A subset of parameters to apply to the PaymentIntent for Checkout Sessions in `payment` mode. + + You can only update these parameters when `ui_mode` is `elements` and while the session is active. If the PaymentIntent requires customer action or confirmation, updating these parameters abandons the current payment attempt and returns the PaymentIntent to `requires_payment_method`. You can't update these parameters after the PaymentIntent begins processing, requires capture, succeeds, or is canceled. + """ shipping_options: NotRequired[ "Literal['']|List[SessionUpdateParamsShippingOption]" ] @@ -333,6 +339,49 @@ class SessionUpdateParamsLineItemPriceDataRecurring(TypedDict): """ +class SessionUpdateParamsPaymentIntentData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Pass an empty string to clear a previously configured value. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + + Pass an empty string to remove a previously supplied configuration. + """ + statement_descriptor: NotRequired["Literal['']|str"] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Pass an empty string to clear a previously configured value. + """ + statement_descriptor_suffix: NotRequired["Literal['']|str"] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Pass an empty string to clear a previously configured value. + """ + + class SessionUpdateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/params/financial_connections/_session_create_params.py b/stripe/params/financial_connections/_session_create_params.py index 78e1fdcf3..a7a4d990f 100644 --- a/stripe/params/financial_connections/_session_create_params.py +++ b/stripe/params/financial_connections/_session_create_params.py @@ -108,9 +108,9 @@ class SessionCreateParamsFilters(TypedDict): """ Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. """ - countries: NotRequired[List[str]] + country: NotRequired[str] """ - List of countries from which to collect accounts. + Country from which to collect accounts. """ institution: NotRequired[str] """ diff --git a/stripe/params/issuing/_cardholder_create_params.py b/stripe/params/issuing/_cardholder_create_params.py index eaaaaf6d3..d475b57f1 100644 --- a/stripe/params/issuing/_cardholder_create_params.py +++ b/stripe/params/issuing/_cardholder_create_params.py @@ -178,11 +178,11 @@ class CardholderCreateParamsIndividualVerification(TypedDict): class CardholderCreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/issuing/_cardholder_modify_params.py b/stripe/params/issuing/_cardholder_modify_params.py index 0879f25e0..f712514fc 100644 --- a/stripe/params/issuing/_cardholder_modify_params.py +++ b/stripe/params/issuing/_cardholder_modify_params.py @@ -173,11 +173,11 @@ class CardholderModifyParamsIndividualVerification(TypedDict): class CardholderModifyParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/issuing/_cardholder_update_params.py b/stripe/params/issuing/_cardholder_update_params.py index 2c543593b..e5f3a5aa5 100644 --- a/stripe/params/issuing/_cardholder_update_params.py +++ b/stripe/params/issuing/_cardholder_update_params.py @@ -172,11 +172,11 @@ class CardholderUpdateParamsIndividualVerification(TypedDict): class CardholderUpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/product_catalog/__init__.py b/stripe/params/product_catalog/__init__.py index 924165051..3ad2e93c2 100644 --- a/stripe/params/product_catalog/__init__.py +++ b/stripe/params/product_catalog/__init__.py @@ -15,9 +15,15 @@ TrialOfferListParams as TrialOfferListParams, TrialOfferListParamsCreated as TrialOfferListParamsCreated, ) + from stripe.params.product_catalog._trial_offer_modify_params import ( + TrialOfferModifyParams as TrialOfferModifyParams, + ) from stripe.params.product_catalog._trial_offer_retrieve_params import ( TrialOfferRetrieveParams as TrialOfferRetrieveParams, ) + from stripe.params.product_catalog._trial_offer_update_params import ( + TrialOfferUpdateParams as TrialOfferUpdateParams, + ) # name -> (import_target, is_submodule) _import_map = { @@ -49,10 +55,18 @@ "stripe.params.product_catalog._trial_offer_list_params", False, ), + "TrialOfferModifyParams": ( + "stripe.params.product_catalog._trial_offer_modify_params", + False, + ), "TrialOfferRetrieveParams": ( "stripe.params.product_catalog._trial_offer_retrieve_params", False, ), + "TrialOfferUpdateParams": ( + "stripe.params.product_catalog._trial_offer_update_params", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/params/product_catalog/_trial_offer_create_params.py b/stripe/params/product_catalog/_trial_offer_create_params.py index 888a1fe89..cab382bbc 100644 --- a/stripe/params/product_catalog/_trial_offer_create_params.py +++ b/stripe/params/product_catalog/_trial_offer_create_params.py @@ -6,6 +6,10 @@ class TrialOfferCreateParams(RequestOptions): + active: NotRequired[bool] + """ + Whether the trial offer can be used for new subscriptions. Defaults to true. + """ duration: "TrialOfferCreateParamsDuration" """ Duration of one service period of the trial. @@ -18,9 +22,9 @@ class TrialOfferCreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - name: NotRequired[str] + nickname: NotRequired[str] """ - A brief, user-friendly name for the trial offer-for identification purposes. + A brief description of the trial offer, hidden from customers. """ price: str """ diff --git a/stripe/params/product_catalog/_trial_offer_list_params.py b/stripe/params/product_catalog/_trial_offer_list_params.py index 4f33248cb..0ff6b9759 100644 --- a/stripe/params/product_catalog/_trial_offer_list_params.py +++ b/stripe/params/product_catalog/_trial_offer_list_params.py @@ -6,6 +6,10 @@ class TrialOfferListParams(RequestOptions): + active: NotRequired[bool] + """ + Only return trial offers that are active (`true`) or archived (`false`). If omitted, both active and archived trial offers are returned. + """ created: NotRequired["TrialOfferListParamsCreated|int"] """ Only return trial offers that were created during the given date interval. diff --git a/stripe/params/product_catalog/_trial_offer_modify_params.py b/stripe/params/product_catalog/_trial_offer_modify_params.py new file mode 100644 index 000000000..9b6cb3423 --- /dev/null +++ b/stripe/params/product_catalog/_trial_offer_modify_params.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class TrialOfferModifyParams(RequestOptions): + active: NotRequired[bool] + """ + Whether the trial offer can be used for new purchases. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/product_catalog/_trial_offer_update_params.py b/stripe/params/product_catalog/_trial_offer_update_params.py new file mode 100644 index 000000000..5093edd44 --- /dev/null +++ b/stripe/params/product_catalog/_trial_offer_update_params.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class TrialOfferUpdateParams(TypedDict): + active: NotRequired[bool] + """ + Whether the trial offer can be used for new purchases. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/radar/__init__.py b/stripe/params/radar/__init__.py index a7ce92a99..232321888 100644 --- a/stripe/params/radar/__init__.py +++ b/stripe/params/radar/__init__.py @@ -4,6 +4,20 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams as BillingEvaluationCreateParams, + BillingEvaluationCreateParamsClientDeviceMetadataDetails as BillingEvaluationCreateParamsClientDeviceMetadataDetails, + BillingEvaluationCreateParamsCustomerDetails as BillingEvaluationCreateParamsCustomerDetails, + BillingEvaluationCreateParamsCustomerDetailsData as BillingEvaluationCreateParamsCustomerDetailsData, + BillingEvaluationCreateParamsPaymentDetails as BillingEvaluationCreateParamsPaymentDetails, + BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails, + BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress, + BillingEvaluationCreateParamsPaymentDetailsShippingDetails as BillingEvaluationCreateParamsPaymentDetailsShippingDetails, + BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress, + ) from stripe.params.radar._early_fraud_warning_list_params import ( EarlyFraudWarningListParams as EarlyFraudWarningListParams, EarlyFraudWarningListParamsCreated as EarlyFraudWarningListParamsCreated, @@ -59,6 +73,54 @@ # name -> (import_target, is_submodule) _import_map = { + "BillingEvaluationCreateParams": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsClientDeviceMetadataDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsCustomerDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsCustomerDetailsData": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsShippingDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), "EarlyFraudWarningListParams": ( "stripe.params.radar._early_fraud_warning_list_params", False, diff --git a/stripe/params/radar/_billing_evaluation_create_params.py b/stripe/params/radar/_billing_evaluation_create_params.py new file mode 100644 index 000000000..9be71426a --- /dev/null +++ b/stripe/params/radar/_billing_evaluation_create_params.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List, Union +from typing_extensions import Literal, NotRequired, TypedDict + + +class BillingEvaluationCreateParams(RequestOptions): + client_device_metadata_details: NotRequired[ + "BillingEvaluationCreateParamsClientDeviceMetadataDetails" + ] + """ + Details about the client device to associate with the billing evaluation. + """ + customer_details: "BillingEvaluationCreateParamsCustomerDetails" + """ + Details about the customer whose upcoming payment is being evaluated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_details: "BillingEvaluationCreateParamsPaymentDetails" + """ + Details about the upcoming payment being evaluated. + """ + + +class BillingEvaluationCreateParamsClientDeviceMetadataDetails(TypedDict): + radar_session: str + """ + ID for the Radar Session to associate with the billing evaluation. A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions about the customer behind the upcoming payment. + """ + + +class BillingEvaluationCreateParamsCustomerDetails(TypedDict): + customer: NotRequired[str] + """ + The ID of the customer whose upcoming payment is being evaluated. + """ + customer_account: NotRequired[str] + """ + The ID of the Account representing the customer whose upcoming payment is being evaluated. + """ + data: NotRequired["BillingEvaluationCreateParamsCustomerDetailsData"] + """ + Attributes of the customer being evaluated. Exactly one of `customer`, `customer_account`, and `data` must be supplied: use `data` when the customer isn't represented by a Customer or an Account. + """ + + +class BillingEvaluationCreateParamsCustomerDetailsData(TypedDict): + email: NotRequired[str] + """ + The email address of the customer being evaluated. + """ + name: NotRequired[str] + """ + The full name or business name of the customer being evaluated. + """ + phone: NotRequired[str] + """ + The phone number of the customer being evaluated. + """ + + +class BillingEvaluationCreateParamsPaymentDetails(TypedDict): + amount: int + """ + The amount that the upcoming payment collects. A positive integer representing how much is charged in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (for example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + """ + 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). + """ + description: NotRequired[str] + """ + An arbitrary description of the upcoming payment. + """ + money_movement_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails" + ] + """ + Details about how the money for the upcoming payment moves. + """ + payment_method_details: ( + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails" + ) + """ + Details about the payment method that the upcoming payment is charged to. + """ + shipping_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsShippingDetails" + ] + """ + Shipping details for the goods or services covered by the upcoming payment. + """ + statement_descriptor: NotRequired[str] + """ + The statement descriptor that appears on the customer's statement for the upcoming payment. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( + TypedDict, +): + card: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard" + ] + """ + Describes card money movement details. + """ + money_movement_type: Union[Literal["card"], str] + """ + Describes the type of money movement. Currently only `card` is supported. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard( + TypedDict, +): + customer_presence: NotRequired["Literal['off_session', 'on_session']|str"] + """ + Describes the presence of the customer during the payment. + """ + payment_type: NotRequired[ + "Literal['one_off', 'recurring', 'setup_one_off', 'setup_recurring']|str" + ] + """ + Describes the type of payment. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails( + TypedDict, +): + billing_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails" + ] + """ + Billing information associated with the payment method used for the upcoming payment. + """ + payment_method: str + """ + ID of the payment method that the upcoming payment is charged to. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails( + TypedDict, +): + address: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired[str] + """ + Email address. + """ + name: NotRequired[str] + """ + Full name. + """ + phone: NotRequired[str] + """ + Billing phone number (including extension). + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + +class BillingEvaluationCreateParamsPaymentDetailsShippingDetails(TypedDict): + address: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress" + ] + """ + Shipping address. + """ + name: NotRequired[str] + """ + Shipping name. + """ + phone: NotRequired[str] + """ + Shipping phone number. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ diff --git a/stripe/params/radar/_payment_evaluation_create_params.py b/stripe/params/radar/_payment_evaluation_create_params.py index b575ad3a3..bc2360774 100644 --- a/stripe/params/radar/_payment_evaluation_create_params.py +++ b/stripe/params/radar/_payment_evaluation_create_params.py @@ -105,11 +105,11 @@ class PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( "PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard" ] """ - Describes card money movement details for the payment evaluation. + Describes card money movement details. """ money_movement_type: Literal["card"] """ - Describes the type of money movement. Currently only `card` is supported. + Describes the type of money movement. """ diff --git a/stripe/params/reserve/__init__.py b/stripe/params/reserve/__init__.py index 83513fd5e..7a962ff10 100644 --- a/stripe/params/reserve/__init__.py +++ b/stripe/params/reserve/__init__.py @@ -10,6 +10,9 @@ from stripe.params.reserve._hold_retrieve_params import ( HoldRetrieveParams as HoldRetrieveParams, ) + from stripe.params.reserve._plan_list_params import ( + PlanListParams as PlanListParams, + ) from stripe.params.reserve._plan_retrieve_params import ( PlanRetrieveParams as PlanRetrieveParams, ) @@ -27,6 +30,7 @@ "stripe.params.reserve._hold_retrieve_params", False, ), + "PlanListParams": ("stripe.params.reserve._plan_list_params", False), "PlanRetrieveParams": ( "stripe.params.reserve._plan_retrieve_params", False, diff --git a/stripe/params/reserve/_plan_list_params.py b/stripe/params/reserve/_plan_list_params.py new file mode 100644 index 000000000..c27cba241 --- /dev/null +++ b/stripe/params/reserve/_plan_list_params.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired + + +class PlanListParams(RequestOptions): + destination: NotRequired[ + "Literal['risk_reserved', 'settlement_reserved']|str" + ] + """ + Only return ReservePlans with the specified destination. If omitted, returns ReservePlans with any destination. + """ + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired["Literal['active', 'disabled', 'expired']|str"] + """ + Only return ReservePlans with the specified status. If omitted, returns ReservePlans with any status. + """ diff --git a/stripe/params/tax/__init__.py b/stripe/params/tax/__init__.py index 2831563eb..42a40429f 100644 --- a/stripe/params/tax/__init__.py +++ b/stripe/params/tax/__init__.py @@ -57,7 +57,6 @@ RegistrationCreateParamsCountryOptionsAo as RegistrationCreateParamsCountryOptionsAo, RegistrationCreateParamsCountryOptionsAoStandard as RegistrationCreateParamsCountryOptionsAoStandard, RegistrationCreateParamsCountryOptionsAt as RegistrationCreateParamsCountryOptionsAt, - RegistrationCreateParamsCountryOptionsAtIgic as RegistrationCreateParamsCountryOptionsAtIgic, RegistrationCreateParamsCountryOptionsAtStandard as RegistrationCreateParamsCountryOptionsAtStandard, RegistrationCreateParamsCountryOptionsAu as RegistrationCreateParamsCountryOptionsAu, RegistrationCreateParamsCountryOptionsAuStandard as RegistrationCreateParamsCountryOptionsAuStandard, @@ -71,12 +70,10 @@ RegistrationCreateParamsCountryOptionsBd as RegistrationCreateParamsCountryOptionsBd, RegistrationCreateParamsCountryOptionsBdStandard as RegistrationCreateParamsCountryOptionsBdStandard, RegistrationCreateParamsCountryOptionsBe as RegistrationCreateParamsCountryOptionsBe, - RegistrationCreateParamsCountryOptionsBeIgic as RegistrationCreateParamsCountryOptionsBeIgic, RegistrationCreateParamsCountryOptionsBeStandard as RegistrationCreateParamsCountryOptionsBeStandard, RegistrationCreateParamsCountryOptionsBf as RegistrationCreateParamsCountryOptionsBf, RegistrationCreateParamsCountryOptionsBfStandard as RegistrationCreateParamsCountryOptionsBfStandard, RegistrationCreateParamsCountryOptionsBg as RegistrationCreateParamsCountryOptionsBg, - RegistrationCreateParamsCountryOptionsBgIgic as RegistrationCreateParamsCountryOptionsBgIgic, RegistrationCreateParamsCountryOptionsBgStandard as RegistrationCreateParamsCountryOptionsBgStandard, RegistrationCreateParamsCountryOptionsBh as RegistrationCreateParamsCountryOptionsBh, RegistrationCreateParamsCountryOptionsBhStandard as RegistrationCreateParamsCountryOptionsBhStandard, @@ -96,20 +93,15 @@ RegistrationCreateParamsCountryOptionsCr as RegistrationCreateParamsCountryOptionsCr, RegistrationCreateParamsCountryOptionsCv as RegistrationCreateParamsCountryOptionsCv, RegistrationCreateParamsCountryOptionsCy as RegistrationCreateParamsCountryOptionsCy, - RegistrationCreateParamsCountryOptionsCyIgic as RegistrationCreateParamsCountryOptionsCyIgic, RegistrationCreateParamsCountryOptionsCyStandard as RegistrationCreateParamsCountryOptionsCyStandard, RegistrationCreateParamsCountryOptionsCz as RegistrationCreateParamsCountryOptionsCz, - RegistrationCreateParamsCountryOptionsCzIgic as RegistrationCreateParamsCountryOptionsCzIgic, RegistrationCreateParamsCountryOptionsCzStandard as RegistrationCreateParamsCountryOptionsCzStandard, RegistrationCreateParamsCountryOptionsDe as RegistrationCreateParamsCountryOptionsDe, - RegistrationCreateParamsCountryOptionsDeIgic as RegistrationCreateParamsCountryOptionsDeIgic, RegistrationCreateParamsCountryOptionsDeStandard as RegistrationCreateParamsCountryOptionsDeStandard, RegistrationCreateParamsCountryOptionsDk as RegistrationCreateParamsCountryOptionsDk, - RegistrationCreateParamsCountryOptionsDkIgic as RegistrationCreateParamsCountryOptionsDkIgic, RegistrationCreateParamsCountryOptionsDkStandard as RegistrationCreateParamsCountryOptionsDkStandard, RegistrationCreateParamsCountryOptionsEc as RegistrationCreateParamsCountryOptionsEc, RegistrationCreateParamsCountryOptionsEe as RegistrationCreateParamsCountryOptionsEe, - RegistrationCreateParamsCountryOptionsEeIgic as RegistrationCreateParamsCountryOptionsEeIgic, RegistrationCreateParamsCountryOptionsEeStandard as RegistrationCreateParamsCountryOptionsEeStandard, RegistrationCreateParamsCountryOptionsEg as RegistrationCreateParamsCountryOptionsEg, RegistrationCreateParamsCountryOptionsEs as RegistrationCreateParamsCountryOptionsEs, @@ -118,10 +110,8 @@ RegistrationCreateParamsCountryOptionsEt as RegistrationCreateParamsCountryOptionsEt, RegistrationCreateParamsCountryOptionsEtStandard as RegistrationCreateParamsCountryOptionsEtStandard, RegistrationCreateParamsCountryOptionsFi as RegistrationCreateParamsCountryOptionsFi, - RegistrationCreateParamsCountryOptionsFiIgic as RegistrationCreateParamsCountryOptionsFiIgic, RegistrationCreateParamsCountryOptionsFiStandard as RegistrationCreateParamsCountryOptionsFiStandard, RegistrationCreateParamsCountryOptionsFr as RegistrationCreateParamsCountryOptionsFr, - RegistrationCreateParamsCountryOptionsFrIgic as RegistrationCreateParamsCountryOptionsFrIgic, RegistrationCreateParamsCountryOptionsFrStandard as RegistrationCreateParamsCountryOptionsFrStandard, RegistrationCreateParamsCountryOptionsGb as RegistrationCreateParamsCountryOptionsGb, RegistrationCreateParamsCountryOptionsGbStandard as RegistrationCreateParamsCountryOptionsGbStandard, @@ -129,23 +119,18 @@ RegistrationCreateParamsCountryOptionsGn as RegistrationCreateParamsCountryOptionsGn, RegistrationCreateParamsCountryOptionsGnStandard as RegistrationCreateParamsCountryOptionsGnStandard, RegistrationCreateParamsCountryOptionsGr as RegistrationCreateParamsCountryOptionsGr, - RegistrationCreateParamsCountryOptionsGrIgic as RegistrationCreateParamsCountryOptionsGrIgic, RegistrationCreateParamsCountryOptionsGrStandard as RegistrationCreateParamsCountryOptionsGrStandard, RegistrationCreateParamsCountryOptionsHr as RegistrationCreateParamsCountryOptionsHr, - RegistrationCreateParamsCountryOptionsHrIgic as RegistrationCreateParamsCountryOptionsHrIgic, RegistrationCreateParamsCountryOptionsHrStandard as RegistrationCreateParamsCountryOptionsHrStandard, RegistrationCreateParamsCountryOptionsHu as RegistrationCreateParamsCountryOptionsHu, - RegistrationCreateParamsCountryOptionsHuIgic as RegistrationCreateParamsCountryOptionsHuIgic, RegistrationCreateParamsCountryOptionsHuStandard as RegistrationCreateParamsCountryOptionsHuStandard, RegistrationCreateParamsCountryOptionsId as RegistrationCreateParamsCountryOptionsId, RegistrationCreateParamsCountryOptionsIe as RegistrationCreateParamsCountryOptionsIe, - RegistrationCreateParamsCountryOptionsIeIgic as RegistrationCreateParamsCountryOptionsIeIgic, RegistrationCreateParamsCountryOptionsIeStandard as RegistrationCreateParamsCountryOptionsIeStandard, RegistrationCreateParamsCountryOptionsIn as RegistrationCreateParamsCountryOptionsIn, RegistrationCreateParamsCountryOptionsIs as RegistrationCreateParamsCountryOptionsIs, RegistrationCreateParamsCountryOptionsIsStandard as RegistrationCreateParamsCountryOptionsIsStandard, RegistrationCreateParamsCountryOptionsIt as RegistrationCreateParamsCountryOptionsIt, - RegistrationCreateParamsCountryOptionsItIgic as RegistrationCreateParamsCountryOptionsItIgic, RegistrationCreateParamsCountryOptionsItStandard as RegistrationCreateParamsCountryOptionsItStandard, RegistrationCreateParamsCountryOptionsJp as RegistrationCreateParamsCountryOptionsJp, RegistrationCreateParamsCountryOptionsJpStandard as RegistrationCreateParamsCountryOptionsJpStandard, @@ -157,13 +142,10 @@ RegistrationCreateParamsCountryOptionsLa as RegistrationCreateParamsCountryOptionsLa, RegistrationCreateParamsCountryOptionsLk as RegistrationCreateParamsCountryOptionsLk, RegistrationCreateParamsCountryOptionsLt as RegistrationCreateParamsCountryOptionsLt, - RegistrationCreateParamsCountryOptionsLtIgic as RegistrationCreateParamsCountryOptionsLtIgic, RegistrationCreateParamsCountryOptionsLtStandard as RegistrationCreateParamsCountryOptionsLtStandard, RegistrationCreateParamsCountryOptionsLu as RegistrationCreateParamsCountryOptionsLu, - RegistrationCreateParamsCountryOptionsLuIgic as RegistrationCreateParamsCountryOptionsLuIgic, RegistrationCreateParamsCountryOptionsLuStandard as RegistrationCreateParamsCountryOptionsLuStandard, RegistrationCreateParamsCountryOptionsLv as RegistrationCreateParamsCountryOptionsLv, - RegistrationCreateParamsCountryOptionsLvIgic as RegistrationCreateParamsCountryOptionsLvIgic, RegistrationCreateParamsCountryOptionsLvStandard as RegistrationCreateParamsCountryOptionsLvStandard, RegistrationCreateParamsCountryOptionsMa as RegistrationCreateParamsCountryOptionsMa, RegistrationCreateParamsCountryOptionsMd as RegistrationCreateParamsCountryOptionsMd, @@ -174,13 +156,11 @@ RegistrationCreateParamsCountryOptionsMr as RegistrationCreateParamsCountryOptionsMr, RegistrationCreateParamsCountryOptionsMrStandard as RegistrationCreateParamsCountryOptionsMrStandard, RegistrationCreateParamsCountryOptionsMt as RegistrationCreateParamsCountryOptionsMt, - RegistrationCreateParamsCountryOptionsMtIgic as RegistrationCreateParamsCountryOptionsMtIgic, RegistrationCreateParamsCountryOptionsMtStandard as RegistrationCreateParamsCountryOptionsMtStandard, RegistrationCreateParamsCountryOptionsMx as RegistrationCreateParamsCountryOptionsMx, RegistrationCreateParamsCountryOptionsMy as RegistrationCreateParamsCountryOptionsMy, RegistrationCreateParamsCountryOptionsNg as RegistrationCreateParamsCountryOptionsNg, RegistrationCreateParamsCountryOptionsNl as RegistrationCreateParamsCountryOptionsNl, - RegistrationCreateParamsCountryOptionsNlIgic as RegistrationCreateParamsCountryOptionsNlIgic, RegistrationCreateParamsCountryOptionsNlStandard as RegistrationCreateParamsCountryOptionsNlStandard, RegistrationCreateParamsCountryOptionsNo as RegistrationCreateParamsCountryOptionsNo, RegistrationCreateParamsCountryOptionsNoStandard as RegistrationCreateParamsCountryOptionsNoStandard, @@ -192,28 +172,22 @@ RegistrationCreateParamsCountryOptionsPe as RegistrationCreateParamsCountryOptionsPe, RegistrationCreateParamsCountryOptionsPh as RegistrationCreateParamsCountryOptionsPh, RegistrationCreateParamsCountryOptionsPl as RegistrationCreateParamsCountryOptionsPl, - RegistrationCreateParamsCountryOptionsPlIgic as RegistrationCreateParamsCountryOptionsPlIgic, RegistrationCreateParamsCountryOptionsPlStandard as RegistrationCreateParamsCountryOptionsPlStandard, RegistrationCreateParamsCountryOptionsPt as RegistrationCreateParamsCountryOptionsPt, - RegistrationCreateParamsCountryOptionsPtIgic as RegistrationCreateParamsCountryOptionsPtIgic, RegistrationCreateParamsCountryOptionsPtStandard as RegistrationCreateParamsCountryOptionsPtStandard, RegistrationCreateParamsCountryOptionsRo as RegistrationCreateParamsCountryOptionsRo, - RegistrationCreateParamsCountryOptionsRoIgic as RegistrationCreateParamsCountryOptionsRoIgic, RegistrationCreateParamsCountryOptionsRoStandard as RegistrationCreateParamsCountryOptionsRoStandard, RegistrationCreateParamsCountryOptionsRs as RegistrationCreateParamsCountryOptionsRs, RegistrationCreateParamsCountryOptionsRsStandard as RegistrationCreateParamsCountryOptionsRsStandard, RegistrationCreateParamsCountryOptionsRu as RegistrationCreateParamsCountryOptionsRu, RegistrationCreateParamsCountryOptionsSa as RegistrationCreateParamsCountryOptionsSa, RegistrationCreateParamsCountryOptionsSe as RegistrationCreateParamsCountryOptionsSe, - RegistrationCreateParamsCountryOptionsSeIgic as RegistrationCreateParamsCountryOptionsSeIgic, RegistrationCreateParamsCountryOptionsSeStandard as RegistrationCreateParamsCountryOptionsSeStandard, RegistrationCreateParamsCountryOptionsSg as RegistrationCreateParamsCountryOptionsSg, RegistrationCreateParamsCountryOptionsSgStandard as RegistrationCreateParamsCountryOptionsSgStandard, RegistrationCreateParamsCountryOptionsSi as RegistrationCreateParamsCountryOptionsSi, - RegistrationCreateParamsCountryOptionsSiIgic as RegistrationCreateParamsCountryOptionsSiIgic, RegistrationCreateParamsCountryOptionsSiStandard as RegistrationCreateParamsCountryOptionsSiStandard, RegistrationCreateParamsCountryOptionsSk as RegistrationCreateParamsCountryOptionsSk, - RegistrationCreateParamsCountryOptionsSkIgic as RegistrationCreateParamsCountryOptionsSkIgic, RegistrationCreateParamsCountryOptionsSkStandard as RegistrationCreateParamsCountryOptionsSkStandard, RegistrationCreateParamsCountryOptionsSn as RegistrationCreateParamsCountryOptionsSn, RegistrationCreateParamsCountryOptionsSr as RegistrationCreateParamsCountryOptionsSr, @@ -402,10 +376,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsAtIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsAtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -458,10 +428,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsBeIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsBeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -478,10 +444,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsBgIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsBgStandard": ( "stripe.params.tax._registration_create_params", False, @@ -558,10 +520,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsCyIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsCyStandard": ( "stripe.params.tax._registration_create_params", False, @@ -570,10 +528,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsCzIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsCzStandard": ( "stripe.params.tax._registration_create_params", False, @@ -582,10 +536,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsDeIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsDeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -594,10 +544,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsDkIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsDkStandard": ( "stripe.params.tax._registration_create_params", False, @@ -610,10 +556,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsEeIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsEeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -646,10 +588,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsFiIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsFiStandard": ( "stripe.params.tax._registration_create_params", False, @@ -658,10 +596,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsFrIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsFrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -690,10 +624,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsGrIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsGrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -702,10 +632,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsHrIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsHrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -714,10 +640,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsHuIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsHuStandard": ( "stripe.params.tax._registration_create_params", False, @@ -730,10 +652,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsIeIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsIeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -754,10 +672,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsItIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsItStandard": ( "stripe.params.tax._registration_create_params", False, @@ -802,10 +716,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsLtIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsLtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -814,10 +724,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsLuIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsLuStandard": ( "stripe.params.tax._registration_create_params", False, @@ -826,10 +732,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsLvIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsLvStandard": ( "stripe.params.tax._registration_create_params", False, @@ -870,10 +772,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsMtIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsMtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -894,10 +792,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsNlIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsNlStandard": ( "stripe.params.tax._registration_create_params", False, @@ -942,10 +836,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsPlIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsPlStandard": ( "stripe.params.tax._registration_create_params", False, @@ -954,10 +844,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsPtIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsPtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -966,10 +852,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsRoIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsRoStandard": ( "stripe.params.tax._registration_create_params", False, @@ -994,10 +876,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsSeIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsSeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -1014,10 +892,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsSiIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsSiStandard": ( "stripe.params.tax._registration_create_params", False, @@ -1026,10 +900,6 @@ "stripe.params.tax._registration_create_params", False, ), - "RegistrationCreateParamsCountryOptionsSkIgic": ( - "stripe.params.tax._registration_create_params", - False, - ), "RegistrationCreateParamsCountryOptionsSkStandard": ( "stripe.params.tax._registration_create_params", False, diff --git a/stripe/params/tax/_form_list_params.py b/stripe/params/tax/_form_list_params.py index 055b02386..86cd786d3 100644 --- a/stripe/params/tax/_form_list_params.py +++ b/stripe/params/tax/_form_list_params.py @@ -45,5 +45,5 @@ class FormListParamsPayee(TypedDict): """ type: NotRequired["Literal['account', 'external_reference']|str"] """ - Specifies the payee type. Either `account` or `external_reference`. + Specifies the payee type. """ diff --git a/stripe/params/tax/_registration_create_params.py b/stripe/params/tax/_registration_create_params.py index dd0aa8138..b2cba2c0d 100644 --- a/stripe/params/tax/_registration_create_params.py +++ b/stripe/params/tax/_registration_create_params.py @@ -506,10 +506,6 @@ class RegistrationCreateParamsCountryOptionsAoStandard(TypedDict): class RegistrationCreateParamsCountryOptionsAt(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsAtIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsAtStandard"] """ Options for the standard registration. @@ -520,13 +516,6 @@ class RegistrationCreateParamsCountryOptionsAt(TypedDict): """ -class RegistrationCreateParamsCountryOptionsAtIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsAtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -644,10 +633,6 @@ class RegistrationCreateParamsCountryOptionsBdStandard(TypedDict): class RegistrationCreateParamsCountryOptionsBe(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsBeIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsBeStandard"] """ Options for the standard registration. @@ -658,13 +643,6 @@ class RegistrationCreateParamsCountryOptionsBe(TypedDict): """ -class RegistrationCreateParamsCountryOptionsBeIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsBeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -695,10 +673,6 @@ class RegistrationCreateParamsCountryOptionsBfStandard(TypedDict): class RegistrationCreateParamsCountryOptionsBg(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsBgIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsBgStandard"] """ Options for the standard registration. @@ -709,13 +683,6 @@ class RegistrationCreateParamsCountryOptionsBg(TypedDict): """ -class RegistrationCreateParamsCountryOptionsBgIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsBgStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -875,10 +842,6 @@ class RegistrationCreateParamsCountryOptionsCv(TypedDict): class RegistrationCreateParamsCountryOptionsCy(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsCyIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsCyStandard"] """ Options for the standard registration. @@ -889,13 +852,6 @@ class RegistrationCreateParamsCountryOptionsCy(TypedDict): """ -class RegistrationCreateParamsCountryOptionsCyIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsCyStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -906,10 +862,6 @@ class RegistrationCreateParamsCountryOptionsCyStandard(TypedDict): class RegistrationCreateParamsCountryOptionsCz(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsCzIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsCzStandard"] """ Options for the standard registration. @@ -920,13 +872,6 @@ class RegistrationCreateParamsCountryOptionsCz(TypedDict): """ -class RegistrationCreateParamsCountryOptionsCzIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsCzStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -937,10 +882,6 @@ class RegistrationCreateParamsCountryOptionsCzStandard(TypedDict): class RegistrationCreateParamsCountryOptionsDe(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsDeIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsDeStandard"] """ Options for the standard registration. @@ -951,13 +892,6 @@ class RegistrationCreateParamsCountryOptionsDe(TypedDict): """ -class RegistrationCreateParamsCountryOptionsDeIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsDeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -968,10 +902,6 @@ class RegistrationCreateParamsCountryOptionsDeStandard(TypedDict): class RegistrationCreateParamsCountryOptionsDk(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsDkIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsDkStandard"] """ Options for the standard registration. @@ -982,13 +912,6 @@ class RegistrationCreateParamsCountryOptionsDk(TypedDict): """ -class RegistrationCreateParamsCountryOptionsDkIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsDkStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1006,10 +929,6 @@ class RegistrationCreateParamsCountryOptionsEc(TypedDict): class RegistrationCreateParamsCountryOptionsEe(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsEeIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsEeStandard"] """ Options for the standard registration. @@ -1020,13 +939,6 @@ class RegistrationCreateParamsCountryOptionsEe(TypedDict): """ -class RegistrationCreateParamsCountryOptionsEeIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsEeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1052,9 +964,11 @@ class RegistrationCreateParamsCountryOptionsEs(TypedDict): """ Options for the standard registration. """ - type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] + type: Union[ + Literal["igic", "ioss", "oss_non_union", "oss_union", "standard"], str + ] """ - Type of registration to be created in an EU country. + Type of registration to be created in ES. """ @@ -1095,10 +1009,6 @@ class RegistrationCreateParamsCountryOptionsEtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsFi(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsFiIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsFiStandard"] """ Options for the standard registration. @@ -1109,13 +1019,6 @@ class RegistrationCreateParamsCountryOptionsFi(TypedDict): """ -class RegistrationCreateParamsCountryOptionsFiIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsFiStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1126,10 +1029,6 @@ class RegistrationCreateParamsCountryOptionsFiStandard(TypedDict): class RegistrationCreateParamsCountryOptionsFr(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsFrIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsFrStandard"] """ Options for the standard registration. @@ -1140,13 +1039,6 @@ class RegistrationCreateParamsCountryOptionsFr(TypedDict): """ -class RegistrationCreateParamsCountryOptionsFrIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsFrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1204,10 +1096,6 @@ class RegistrationCreateParamsCountryOptionsGnStandard(TypedDict): class RegistrationCreateParamsCountryOptionsGr(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsGrIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsGrStandard"] """ Options for the standard registration. @@ -1218,13 +1106,6 @@ class RegistrationCreateParamsCountryOptionsGr(TypedDict): """ -class RegistrationCreateParamsCountryOptionsGrIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsGrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1235,10 +1116,6 @@ class RegistrationCreateParamsCountryOptionsGrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsHr(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsHrIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsHrStandard"] """ Options for the standard registration. @@ -1249,13 +1126,6 @@ class RegistrationCreateParamsCountryOptionsHr(TypedDict): """ -class RegistrationCreateParamsCountryOptionsHrIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsHrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1266,10 +1136,6 @@ class RegistrationCreateParamsCountryOptionsHrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsHu(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsHuIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsHuStandard"] """ Options for the standard registration. @@ -1280,13 +1146,6 @@ class RegistrationCreateParamsCountryOptionsHu(TypedDict): """ -class RegistrationCreateParamsCountryOptionsHuIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsHuStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1304,10 +1163,6 @@ class RegistrationCreateParamsCountryOptionsId(TypedDict): class RegistrationCreateParamsCountryOptionsIe(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsIeIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsIeStandard"] """ Options for the standard registration. @@ -1318,13 +1173,6 @@ class RegistrationCreateParamsCountryOptionsIe(TypedDict): """ -class RegistrationCreateParamsCountryOptionsIeIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsIeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1362,10 +1210,6 @@ class RegistrationCreateParamsCountryOptionsIsStandard(TypedDict): class RegistrationCreateParamsCountryOptionsIt(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsItIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsItStandard"] """ Options for the standard registration. @@ -1376,13 +1220,6 @@ class RegistrationCreateParamsCountryOptionsIt(TypedDict): """ -class RegistrationCreateParamsCountryOptionsItIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsItStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1462,10 +1299,6 @@ class RegistrationCreateParamsCountryOptionsLk(TypedDict): class RegistrationCreateParamsCountryOptionsLt(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsLtIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLtStandard"] """ Options for the standard registration. @@ -1476,13 +1309,6 @@ class RegistrationCreateParamsCountryOptionsLt(TypedDict): """ -class RegistrationCreateParamsCountryOptionsLtIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsLtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1493,10 +1319,6 @@ class RegistrationCreateParamsCountryOptionsLtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsLu(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsLuIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLuStandard"] """ Options for the standard registration. @@ -1507,13 +1329,6 @@ class RegistrationCreateParamsCountryOptionsLu(TypedDict): """ -class RegistrationCreateParamsCountryOptionsLuIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsLuStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1524,10 +1339,6 @@ class RegistrationCreateParamsCountryOptionsLuStandard(TypedDict): class RegistrationCreateParamsCountryOptionsLv(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsLvIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLvStandard"] """ Options for the standard registration. @@ -1538,13 +1349,6 @@ class RegistrationCreateParamsCountryOptionsLv(TypedDict): """ -class RegistrationCreateParamsCountryOptionsLvIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsLvStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1629,10 +1433,6 @@ class RegistrationCreateParamsCountryOptionsMrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsMt(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsMtIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsMtStandard"] """ Options for the standard registration. @@ -1643,13 +1443,6 @@ class RegistrationCreateParamsCountryOptionsMt(TypedDict): """ -class RegistrationCreateParamsCountryOptionsMtIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsMtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1681,10 +1474,6 @@ class RegistrationCreateParamsCountryOptionsNg(TypedDict): class RegistrationCreateParamsCountryOptionsNl(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsNlIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsNlStandard"] """ Options for the standard registration. @@ -1695,13 +1484,6 @@ class RegistrationCreateParamsCountryOptionsNl(TypedDict): """ -class RegistrationCreateParamsCountryOptionsNlIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsNlStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1793,10 +1575,6 @@ class RegistrationCreateParamsCountryOptionsPh(TypedDict): class RegistrationCreateParamsCountryOptionsPl(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsPlIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsPlStandard"] """ Options for the standard registration. @@ -1807,13 +1585,6 @@ class RegistrationCreateParamsCountryOptionsPl(TypedDict): """ -class RegistrationCreateParamsCountryOptionsPlIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsPlStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1824,10 +1595,6 @@ class RegistrationCreateParamsCountryOptionsPlStandard(TypedDict): class RegistrationCreateParamsCountryOptionsPt(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsPtIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsPtStandard"] """ Options for the standard registration. @@ -1838,13 +1605,6 @@ class RegistrationCreateParamsCountryOptionsPt(TypedDict): """ -class RegistrationCreateParamsCountryOptionsPtIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsPtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1855,10 +1615,6 @@ class RegistrationCreateParamsCountryOptionsPtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsRo(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsRoIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsRoStandard"] """ Options for the standard registration. @@ -1869,13 +1625,6 @@ class RegistrationCreateParamsCountryOptionsRo(TypedDict): """ -class RegistrationCreateParamsCountryOptionsRoIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsRoStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1920,10 +1669,6 @@ class RegistrationCreateParamsCountryOptionsSa(TypedDict): class RegistrationCreateParamsCountryOptionsSe(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsSeIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSeStandard"] """ Options for the standard registration. @@ -1934,13 +1679,6 @@ class RegistrationCreateParamsCountryOptionsSe(TypedDict): """ -class RegistrationCreateParamsCountryOptionsSeIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsSeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1971,10 +1709,6 @@ class RegistrationCreateParamsCountryOptionsSgStandard(TypedDict): class RegistrationCreateParamsCountryOptionsSi(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsSiIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSiStandard"] """ Options for the standard registration. @@ -1985,13 +1719,6 @@ class RegistrationCreateParamsCountryOptionsSi(TypedDict): """ -class RegistrationCreateParamsCountryOptionsSiIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsSiStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -2002,10 +1729,6 @@ class RegistrationCreateParamsCountryOptionsSiStandard(TypedDict): class RegistrationCreateParamsCountryOptionsSk(TypedDict): - igic: NotRequired["RegistrationCreateParamsCountryOptionsSkIgic"] - """ - Options for the IGIC registration. - """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSkStandard"] """ Options for the standard registration. @@ -2016,13 +1739,6 @@ class RegistrationCreateParamsCountryOptionsSk(TypedDict): """ -class RegistrationCreateParamsCountryOptionsSkIgic(TypedDict): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - - class RegistrationCreateParamsCountryOptionsSkStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -2060,7 +1776,7 @@ class RegistrationCreateParamsCountryOptionsSrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsTh(TypedDict): - type: Literal["simplified"] + type: Union[Literal["simplified"], str] """ Type of registration to be created in `country`. """ diff --git a/stripe/params/terminal/_configuration_create_params.py b/stripe/params/terminal/_configuration_create_params.py index cd759e341..1dc75052c 100644 --- a/stripe/params/terminal/_configuration_create_params.py +++ b/stripe/params/terminal/_configuration_create_params.py @@ -95,14 +95,14 @@ class ConfigurationCreateParamsBbposWiseposE(TypedDict): class ConfigurationCreateParamsCellular(TypedDict): enabled: bool """ - Determines whether to allow the reader to connect to a cellular network. Defaults to false. + Determines whether to allow the reader to connect to a cellular network. """ class ConfigurationCreateParamsOffline(TypedDict): enabled: bool """ - Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + Determines whether to allow transactions to be collected while reader is offline. """ diff --git a/stripe/params/terminal/_configuration_modify_params.py b/stripe/params/terminal/_configuration_modify_params.py index cea171fd8..d64fabbc6 100644 --- a/stripe/params/terminal/_configuration_modify_params.py +++ b/stripe/params/terminal/_configuration_modify_params.py @@ -111,14 +111,14 @@ class ConfigurationModifyParamsBbposWiseposE(TypedDict): class ConfigurationModifyParamsCellular(TypedDict): enabled: bool """ - Determines whether to allow the reader to connect to a cellular network. Defaults to false. + Determines whether to allow the reader to connect to a cellular network. """ class ConfigurationModifyParamsOffline(TypedDict): enabled: bool """ - Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + Determines whether to allow transactions to be collected while reader is offline. """ diff --git a/stripe/params/terminal/_configuration_update_params.py b/stripe/params/terminal/_configuration_update_params.py index 6b5dfae23..d19c8dbf8 100644 --- a/stripe/params/terminal/_configuration_update_params.py +++ b/stripe/params/terminal/_configuration_update_params.py @@ -110,14 +110,14 @@ class ConfigurationUpdateParamsBbposWiseposE(TypedDict): class ConfigurationUpdateParamsCellular(TypedDict): enabled: bool """ - Determines whether to allow the reader to connect to a cellular network. Defaults to false. + Determines whether to allow the reader to connect to a cellular network. """ class ConfigurationUpdateParamsOffline(TypedDict): enabled: bool """ - Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + Determines whether to allow transactions to be collected while reader is offline. """ diff --git a/stripe/params/test_helpers/__init__.py b/stripe/params/test_helpers/__init__.py index 2c8adbbf3..675bf8db4 100644 --- a/stripe/params/test_helpers/__init__.py +++ b/stripe/params/test_helpers/__init__.py @@ -69,6 +69,7 @@ ConfirmationTokenCreateParamsPaymentMethodDataSatispay as ConfirmationTokenCreateParamsPaymentMethodDataSatispay, ConfirmationTokenCreateParamsPaymentMethodDataScalapay as ConfirmationTokenCreateParamsPaymentMethodDataScalapay, ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit as ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit, + ConfirmationTokenCreateParamsPaymentMethodDataSequra as ConfirmationTokenCreateParamsPaymentMethodDataSequra, ConfirmationTokenCreateParamsPaymentMethodDataShopeepay as ConfirmationTokenCreateParamsPaymentMethodDataShopeepay, ConfirmationTokenCreateParamsPaymentMethodDataSofort as ConfirmationTokenCreateParamsPaymentMethodDataSofort, ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance as ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance, @@ -347,6 +348,10 @@ "stripe.params.test_helpers._confirmation_token_create_params", False, ), + "ConfirmationTokenCreateParamsPaymentMethodDataSequra": ( + "stripe.params.test_helpers._confirmation_token_create_params", + False, + ), "ConfirmationTokenCreateParamsPaymentMethodDataShopeepay": ( "stripe.params.test_helpers._confirmation_token_create_params", False, diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index b898f7316..4b774fdc0 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -71,13 +71,13 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ alma: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataAlma"] """ - If this is a Alma PaymentMethod, this hash contains details about the Alma payment method. + If this is an Alma PaymentMethod, this hash contains details about the Alma payment method. """ amazon_pay: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataAmazonPay" ] """ - If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. + If this is an AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataAuBecsDebit" @@ -323,6 +323,10 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ + sequra: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSequra"] + """ + If this is a SeQura PaymentMethod, this hash contains details about the SeQura payment method. + """ shared_payment_granted_token: NotRequired[str] """ ID of the SharedPaymentGrantedToken used to confirm this PaymentIntent. @@ -407,6 +411,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -867,6 +872,10 @@ class ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit(TypedDict): """ +class ConfirmationTokenCreateParamsPaymentMethodDataSequra(TypedDict): + pass + + class ConfirmationTokenCreateParamsPaymentMethodDataShopeepay(TypedDict): pass diff --git a/stripe/params/test_helpers/treasury/_received_credit_create_params.py b/stripe/params/test_helpers/treasury/_received_credit_create_params.py index b1735a925..0ca81305a 100644 --- a/stripe/params/test_helpers/treasury/_received_credit_create_params.py +++ b/stripe/params/test_helpers/treasury/_received_credit_create_params.py @@ -31,7 +31,7 @@ class ReceivedCreditCreateParams(TypedDict): """ Initiating payment method details for the object. """ - network: Union[Literal["ach", "us_domestic_wire"], str] + network: Union[Literal["ach", "rtp", "us_domestic_wire"], str] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/three_d_secure/__init__.py b/stripe/params/three_d_secure/__init__.py new file mode 100644 index 000000000..0af5982e0 --- /dev/null +++ b/stripe/params/three_d_secure/__init__.py @@ -0,0 +1,155 @@ +# -*- 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.three_d_secure._authentication_cancel_params import ( + AuthenticationCancelParams as AuthenticationCancelParams, + ) + from stripe.params.three_d_secure._authentication_create_params import ( + AuthenticationCreateParams as AuthenticationCreateParams, + AuthenticationCreateParamsAcquirerDetails as AuthenticationCreateParamsAcquirerDetails, + AuthenticationCreateParamsChannel as AuthenticationCreateParamsChannel, + AuthenticationCreateParamsChannelBrowser as AuthenticationCreateParamsChannelBrowser, + AuthenticationCreateParamsChannelThreeRI as AuthenticationCreateParamsChannelThreeRI, + AuthenticationCreateParamsFlowPreference as AuthenticationCreateParamsFlowPreference, + AuthenticationCreateParamsFlowPreferenceChallenge as AuthenticationCreateParamsFlowPreferenceChallenge, + AuthenticationCreateParamsFlowPreferenceDataShare as AuthenticationCreateParamsFlowPreferenceDataShare, + AuthenticationCreateParamsFlowPreferenceFrictionless as AuthenticationCreateParamsFlowPreferenceFrictionless, + AuthenticationCreateParamsFutureUsage as AuthenticationCreateParamsFutureUsage, + AuthenticationCreateParamsFutureUsageInstallment as AuthenticationCreateParamsFutureUsageInstallment, + AuthenticationCreateParamsFutureUsageInstallmentExpiry as AuthenticationCreateParamsFutureUsageInstallmentExpiry, + AuthenticationCreateParamsFutureUsageRecurring as AuthenticationCreateParamsFutureUsageRecurring, + AuthenticationCreateParamsFutureUsageRecurringExpiry as AuthenticationCreateParamsFutureUsageRecurringExpiry, + AuthenticationCreateParamsPaymentMethodData as AuthenticationCreateParamsPaymentMethodData, + AuthenticationCreateParamsPaymentMethodDataBillingDetails as AuthenticationCreateParamsPaymentMethodDataBillingDetails, + AuthenticationCreateParamsPaymentMethodDataBillingDetailsAddress as AuthenticationCreateParamsPaymentMethodDataBillingDetailsAddress, + AuthenticationCreateParamsPaymentMethodDataCard as AuthenticationCreateParamsPaymentMethodDataCard, + AuthenticationCreateParamsShippingAddress as AuthenticationCreateParamsShippingAddress, + ) + from stripe.params.three_d_secure._authentication_list_params import ( + AuthenticationListParams as AuthenticationListParams, + AuthenticationListParamsCreated as AuthenticationListParamsCreated, + ) + from stripe.params.three_d_secure._authentication_retrieve_params import ( + AuthenticationRetrieveParams as AuthenticationRetrieveParams, + ) + from stripe.params.three_d_secure._authentication_submit_params import ( + AuthenticationSubmitParams as AuthenticationSubmitParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "AuthenticationCancelParams": ( + "stripe.params.three_d_secure._authentication_cancel_params", + False, + ), + "AuthenticationCreateParams": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsAcquirerDetails": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsChannel": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsChannelBrowser": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsChannelThreeRI": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFlowPreference": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFlowPreferenceChallenge": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFlowPreferenceDataShare": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFlowPreferenceFrictionless": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFutureUsage": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFutureUsageInstallment": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFutureUsageInstallmentExpiry": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFutureUsageRecurring": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsFutureUsageRecurringExpiry": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsPaymentMethodData": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsPaymentMethodDataBillingDetails": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsPaymentMethodDataBillingDetailsAddress": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsPaymentMethodDataCard": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationCreateParamsShippingAddress": ( + "stripe.params.three_d_secure._authentication_create_params", + False, + ), + "AuthenticationListParams": ( + "stripe.params.three_d_secure._authentication_list_params", + False, + ), + "AuthenticationListParamsCreated": ( + "stripe.params.three_d_secure._authentication_list_params", + False, + ), + "AuthenticationRetrieveParams": ( + "stripe.params.three_d_secure._authentication_retrieve_params", + False, + ), + "AuthenticationSubmitParams": ( + "stripe.params.three_d_secure._authentication_submit_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/three_d_secure/_authentication_cancel_params.py b/stripe/params/three_d_secure/_authentication_cancel_params.py new file mode 100644 index 000000000..972a963c4 --- /dev/null +++ b/stripe/params/three_d_secure/_authentication_cancel_params.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List +from typing_extensions import Literal, NotRequired + + +class AuthenticationCancelParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ diff --git a/stripe/params/three_d_secure/_authentication_create_params.py b/stripe/params/three_d_secure/_authentication_create_params.py new file mode 100644 index 000000000..75a28293c --- /dev/null +++ b/stripe/params/three_d_secure/_authentication_create_params.py @@ -0,0 +1,430 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List, Union +from typing_extensions import Literal, NotRequired, TypedDict + + +class AuthenticationCreateParams(RequestOptions): + acquirer_details: NotRequired["AuthenticationCreateParamsAcquirerDetails"] + """ + Contains additional details about the acquirer for this 3DS Authentication. + + Refer to the [Pass acquirer details and directory server section of the standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#pass-acquirer-details-and-directory-server) for more information. + """ + amount: NotRequired[int] + """ + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). You can't include this parameter if `message_category` is `non_payment_authentication` + """ + channel: "AuthenticationCreateParamsChannel" + """ + Contains additional details on the channel used for this 3DS Authentication. + """ + currency: NotRequired[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). + """ + directory_server: NotRequired[ + "Literal['american_express', 'cartes_bancaires', 'discover', 'mastercard', 'visa']|str" + ] + """ + The 3DS directory server with which this 3DS Authentication was processed. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + flow_preference: NotRequired["AuthenticationCreateParamsFlowPreference"] + """ + Contains additional details on your flow preference for this 3DS Authentication. + + Refer to the [Specify a flow preference section of the standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#specify-a-flow-preference) for more information. + """ + future_usage: NotRequired["AuthenticationCreateParamsFutureUsage"] + """ + Contains information about future usage of this 3DS Authentication + """ + message_category: Union[ + Literal["non_payment_authentication", "payment_authentication"], str + ] + """ + Indicates whether this 3DS Authentication is being performed for a payment or non-payment use case. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_method: NotRequired[str] + """ + ID of the payment method (a PaymentMethod object) to attach to this 3DS Authentication. + """ + payment_method_data: NotRequired[ + "AuthenticationCreateParamsPaymentMethodData" + ] + """ + Hash used to generate the PaymentMethod to be used for this Authentication. This is mutually exclusive with the `payment_method` parameter. + """ + reason: NotRequired[ + "Literal['cardholder_authentication', 'issuer_requested', 'liability_shift', 'processing_costs', 'regulatory_compliance']|str" + ] + """ + The reason for invoking standalone 3DS. This is tailored specifically for cases when you want Stripe to help determine the standalone 3DS flow to fit your use case instead of needing to select a specific 3DS flow. + + This parameter is exclusive with `flow_preference`. You can either use `reason` for controlling 3DS according to your business requirements, or use `flow_preference` for having fine-grained control over your 3DS flow preference. + """ + shipping_address: NotRequired["AuthenticationCreateParamsShippingAddress"] + """ + The shipping address requested by the cardholder. You should try to include as complete address information as possible. + """ + submit: NotRequired[ + "Literal['always', 'if_fingerprinting_not_supported', 'never']|str" + ] + """ + Set to `always` to skip the fingerprinting step and submit this Authentication immediately or `if_fingerprinting_not_supported` to submit this Authentication only if fingerprinting is not available. This parameter defaults to `never`. + + Refer to the [Submit at creation section of the standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-at-creation) for more information. + """ + + +class AuthenticationCreateParamsAcquirerDetails(TypedDict): + acquirer_bin: str + """ + The Acquirer BIN (specific to the directory_server). + """ + acquirer_country: str + """ + The two-letter country code of the acquirer ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + acquirer_merchant_id: str + """ + The Merchant ID (or Card Acceptor ID) that your acquirer assigned you (specific to the directory_server). + """ + mcc: NotRequired[str] + """ + The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) as defined by each payment system or directory server. + """ + merchant_name: NotRequired[str] + """ + The merchant name assigned by the acquirer or payment system. Same name used in the authorization message as defined in [ISO 8583](https://en.wikipedia.org/wiki/ISO_8583). + """ + requestor_id: NotRequired[str] + """ + Requestor ID if you're enrolled in the card network's 3DS program. Otherwise, you can omit this field because Stripe assigns a Requestor ID with the card networks. + """ + + +class AuthenticationCreateParamsChannel(TypedDict): + browser: NotRequired["AuthenticationCreateParamsChannelBrowser"] + """ + Contains additional details about the browser details you collected. + """ + three_r_i: NotRequired["AuthenticationCreateParamsChannelThreeRI"] + """ + Contains additional details about the 3DS Requestor Initiated (3RI) channel. + """ + type: Union[Literal["browser", "three_r_i"], str] + """ + Type of channel you would prefer to use for this 3DS Authentication. + """ + + +class AuthenticationCreateParamsChannelBrowser(TypedDict): + accept_header: str + """ + The HTTP accept headers from the cardholder's browser. Collected server-side. + """ + color_depth: NotRequired[int] + """ + The color depth of the cardholder's screen. + + Returned from the `screen.colorDepth` property. + """ + device_id: NotRequired[str] + """ + Unique and immutable identifier linked to a device that is consistent across 3DS transactions for the specific user device. For example: hardware device ID or a platform-calculated device fingerprint. + """ + ip_address: str + """ + The IP address of the browser. Included in the HTTP request to your server before you create the 3DS Authentication. + + Collected server-side. + """ + java_enabled: NotRequired[bool] + """ + The cardholder browser's ability to execute Java. Returned from the navigator.javaEnabled property. + """ + javascript_enabled: bool + """ + The cardholder browser's ability to execute JavaScript. + """ + language: str + """ + An IETF BCP 47 language tag representing the browser language. Typically returned from the `navigator.language` property, but might also be returned from `navigator.languages` or `navigator.browserLanguage`. + + In some cases, this value might be an array. To cast it to a string or null value, you can use the `getBrowserLanguage()` [example function](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#pass-client-side-collected-channel-information). + """ + screen_height: NotRequired[int] + """ + The total height of the cardholder's screen in pixels. + + Returned from the `screen.height` property. + """ + screen_width: NotRequired[int] + """ + The total width of the cardholder's screen in pixels. + + Returned from the `screen.width` property. + """ + timezone_offset: NotRequired[int] + """ + The time difference between UTC time and the local time of the cardholder's browser, in minutes. + + Returned by `new Date().getTimezoneOffset()` + """ + user_agent: str + """ + The browser user agent. You can retrieve this value on the client side using the `navigator.userAgent` property, or in the HTTP request to your server before you create the 3DS Authentication. + """ + + +class AuthenticationCreateParamsChannelThreeRI(TypedDict): + previous_authentication: str + """ + ID of a prior `Authentication`. For example, the first recurring transaction that was authenticated by the cardholder. + """ + type: Union[ + Literal[ + "delayed_shipment", "other_payment", "recurring", "split_shipment" + ], + str, + ] + """ + It provides additional information to the ACS to determine the best approach for handling a 3RI request. + """ + + +class AuthenticationCreateParamsFlowPreference(TypedDict): + challenge: NotRequired["AuthenticationCreateParamsFlowPreferenceChallenge"] + """ + Contains additional details about your challenge flow preference for this 3DS Authentication. + """ + data_share: NotRequired[ + "AuthenticationCreateParamsFlowPreferenceDataShare" + ] + """ + Contains additional details about your data share only flow preference for this 3DS Authentication. + """ + frictionless: NotRequired[ + "AuthenticationCreateParamsFlowPreferenceFrictionless" + ] + """ + Contains additional details about your frictionless flow preference for this 3DS Authentication. + """ + type: Union[Literal["challenge", "data_share", "frictionless"], str] + """ + Type of flow you requested for this 3DS Authentication. + """ + + +class AuthenticationCreateParamsFlowPreferenceChallenge(TypedDict): + type: Union[Literal["mandated", "preferred"], str] + """ + Type of challenge flow you requested for this 3DS Authentication. + """ + + +class AuthenticationCreateParamsFlowPreferenceDataShare(TypedDict): + type: Union[Literal["ds_specific", "emv_standard"], str] + """ + Type of data share only flow you requested for this 3DS Authentication. + """ + + +class AuthenticationCreateParamsFlowPreferenceFrictionless(TypedDict): + type: Union[Literal["low_risk", "none"], str] + """ + Type of frictionless flow you requested for this 3DS Authentication. + """ + + +class AuthenticationCreateParamsFutureUsage(TypedDict): + installment: NotRequired[ + "AuthenticationCreateParamsFutureUsageInstallment" + ] + """ + Parameters related to an installment payment. + """ + recurring: NotRequired["AuthenticationCreateParamsFutureUsageRecurring"] + """ + Parameters related to a recurring payment. + """ + type: Union[Literal["card_on_file", "installment", "recurring"], str] + """ + The type of future usage declared for this 3DS Authentication + """ + + +class AuthenticationCreateParamsFutureUsageInstallment(TypedDict): + amount: int + """ + A non-negative integer representing the future authorizations' amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + """ + expiry: "AuthenticationCreateParamsFutureUsageInstallmentExpiry" + """ + Information about the expiry of the future usage of this authentication. + """ + interval: NotRequired[Literal["day"]] + """ + The unit of time for `interval_count`. + """ + interval_count: NotRequired[int] + """ + The minimum number of time intervals between authorizations. Must be greater than 0, and defaults to 1. + """ + number: int + """ + The maximum number of installments. Must be greater than 1. + """ + + +class AuthenticationCreateParamsFutureUsageInstallmentExpiry(TypedDict): + date: NotRequired[str] + """ + The date before which the last authorization related to this authentication will occur. + """ + type: Union[Literal["date", "never"], str] + """ + The type of expiry for the future use of this authentication. + """ + + +class AuthenticationCreateParamsFutureUsageRecurring(TypedDict): + amount: int + """ + A non-negative integer representing the future authorizations' amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + """ + expiry: "AuthenticationCreateParamsFutureUsageRecurringExpiry" + """ + Information about the expiry of the future usage of this authentication. + """ + interval: NotRequired[Literal["day"]] + """ + The unit of time for `interval_count`. + """ + interval_count: NotRequired[int] + """ + The minimum number of time intervals between authorizations. Must be greater than 0, and defaults to 1. + """ + + +class AuthenticationCreateParamsFutureUsageRecurringExpiry(TypedDict): + date: NotRequired[str] + """ + The date before which the last authorization related to this authentication will occur. + """ + type: Union[Literal["date", "never"], str] + """ + The type of expiry for the future use of this authentication. + """ + + +class AuthenticationCreateParamsPaymentMethodData(TypedDict): + billing_details: NotRequired[ + "AuthenticationCreateParamsPaymentMethodDataBillingDetails" + ] + """ + Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + """ + card: "AuthenticationCreateParamsPaymentMethodDataCard" + type: Literal["card"] + """ + The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + """ + + +class AuthenticationCreateParamsPaymentMethodDataBillingDetails(TypedDict): + address: NotRequired[ + "AuthenticationCreateParamsPaymentMethodDataBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired[str] + """ + Email address. + """ + name: NotRequired[str] + """ + Full name. + """ + phone: NotRequired[str] + """ + Billing phone number (including extension). + """ + + +class AuthenticationCreateParamsPaymentMethodDataBillingDetailsAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + Country subdivision code defined in ISO 3166-2. + """ + + +class AuthenticationCreateParamsPaymentMethodDataCard(TypedDict): + cvc: NotRequired[str] + exp_month: NotRequired[int] + exp_year: NotRequired[int] + number: NotRequired[str] + token: NotRequired[str] + + +class AuthenticationCreateParamsShippingAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + Country subdivision code defined in ISO 3166-2. + """ diff --git a/stripe/params/three_d_secure/_authentication_list_params.py b/stripe/params/three_d_secure/_authentication_list_params.py new file mode 100644 index 000000000..4cdd49167 --- /dev/null +++ b/stripe/params/three_d_secure/_authentication_list_params.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class AuthenticationListParams(RequestOptions): + created: NotRequired["AuthenticationListParamsCreated|int"] + """ + A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + """ + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[ + "Literal['canceled', 'error', 'failed', 'requires_challenge', 'requires_submission', 'succeeded']|str" + ] + """ + Only return 3D Secure Authentications for specified status. + """ + + +class AuthenticationListParamsCreated(TypedDict): + gt: NotRequired[int] + """ + Minimum value to filter by (exclusive) + """ + gte: NotRequired[int] + """ + Minimum value to filter by (inclusive) + """ + lt: NotRequired[int] + """ + Maximum value to filter by (exclusive) + """ + lte: NotRequired[int] + """ + Maximum value to filter by (inclusive) + """ diff --git a/stripe/params/three_d_secure/_authentication_retrieve_params.py b/stripe/params/three_d_secure/_authentication_retrieve_params.py new file mode 100644 index 000000000..c331c241a --- /dev/null +++ b/stripe/params/three_d_secure/_authentication_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class AuthenticationRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/three_d_secure/_authentication_submit_params.py b/stripe/params/three_d_secure/_authentication_submit_params.py new file mode 100644 index 000000000..84bdd02ee --- /dev/null +++ b/stripe/params/three_d_secure/_authentication_submit_params.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List +from typing_extensions import Literal, NotRequired + + +class AuthenticationSubmitParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + fingerprinting_result: NotRequired[str] + """ + The fingerprinting result of the issuer fingerprinting step. + + Refer to the [Issuer fingerprinting section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#issuer-fingerprinting) for more information. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ diff --git a/stripe/params/treasury/_received_credit_create_params.py b/stripe/params/treasury/_received_credit_create_params.py index 8797a0097..f59d7aa3e 100644 --- a/stripe/params/treasury/_received_credit_create_params.py +++ b/stripe/params/treasury/_received_credit_create_params.py @@ -32,7 +32,7 @@ class ReceivedCreditCreateParams(RequestOptions): """ Initiating payment method details for the object. """ - network: Union[Literal["ach", "us_domestic_wire"], str] + network: Union[Literal["ach", "rtp", "us_domestic_wire"], str] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/v2/__init__.py b/stripe/params/v2/__init__.py index a097727e3..30c6613c7 100644 --- a/stripe/params/v2/__init__.py +++ b/stripe/params/v2/__init__.py @@ -13,7 +13,6 @@ network as network, orchestrated_commerce as orchestrated_commerce, signals as signals, - test_helpers as test_helpers, ) # name -> (import_target, is_submodule) @@ -26,7 +25,6 @@ "network": ("stripe.params.v2.network", True), "orchestrated_commerce": ("stripe.params.v2.orchestrated_commerce", True), "signals": ("stripe.params.v2.signals", True), - "test_helpers": ("stripe.params.v2.test_helpers", True), } if not TYPE_CHECKING: diff --git a/stripe/params/v2/billing/_cadence_list_params.py b/stripe/params/v2/billing/_cadence_list_params.py index ee791b64b..8b87cbb0f 100644 --- a/stripe/params/v2/billing/_cadence_list_params.py +++ b/stripe/params/v2/billing/_cadence_list_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class CadenceListParams(TypedDict): - include: NotRequired[List[Literal["settings_data"]]] + include: NotRequired[List[Union[Literal["settings_data"], str]]] """ Additional resource to include in the response. """ @@ -35,7 +35,7 @@ class CadenceListParamsPayer(TypedDict): """ The ID of the Customer object. If provided, only cadences that specifically reference the provided customer ID will be returned. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ diff --git a/stripe/params/v2/billing/_cadence_retrieve_params.py b/stripe/params/v2/billing/_cadence_retrieve_params.py index 8324c83d1..2629799cc 100644 --- a/stripe/params/v2/billing/_cadence_retrieve_params.py +++ b/stripe/params/v2/billing/_cadence_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class CadenceRetrieveParams(TypedDict): - include: NotRequired[List[Literal["settings_data"]]] + include: NotRequired[List[Union[Literal["settings_data"], str]]] """ Additional resource to include in the response. """ diff --git a/stripe/params/v2/billing/_collection_setting_create_params.py b/stripe/params/v2/billing/_collection_setting_create_params.py index 9d8c260af..7ef3011f0 100644 --- a/stripe/params/v2/billing/_collection_setting_create_params.py +++ b/stripe/params/v2/billing/_collection_setting_create_params.py @@ -180,7 +180,7 @@ class CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired[Literal["bank_transfer"]] + funding_type: NotRequired["Literal['bank_transfer']|str"] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/params/v2/billing/_collection_setting_update_params.py b/stripe/params/v2/billing/_collection_setting_update_params.py index f9878966d..89c19dc4a 100644 --- a/stripe/params/v2/billing/_collection_setting_update_params.py +++ b/stripe/params/v2/billing/_collection_setting_update_params.py @@ -186,7 +186,7 @@ class CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired[Literal["bank_transfer"]] + funding_type: NotRequired["Literal['bank_transfer']|str"] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ 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 b39cc81f2..2de4e99d4 100644 --- a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py +++ b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import Union from typing_extensions import Literal, TypedDict @@ -12,7 +13,7 @@ class MeterEventAdjustmentCreateParams(TypedDict): """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ - type: Literal["cancel"] + type: Union[Literal["cancel"], str] """ Specifies the type of cancellation. Currently supports canceling a single event. """ diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index 1a412b1b4..845c640b3 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -35,6 +35,7 @@ AccountCreateParamsConfigurationMerchantCapabilitiesBacsDebitPayments as AccountCreateParamsConfigurationMerchantCapabilitiesBacsDebitPayments, AccountCreateParamsConfigurationMerchantCapabilitiesBancontactPayments as AccountCreateParamsConfigurationMerchantCapabilitiesBancontactPayments, AccountCreateParamsConfigurationMerchantCapabilitiesBlikPayments as AccountCreateParamsConfigurationMerchantCapabilitiesBlikPayments, + AccountCreateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments as AccountCreateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments, AccountCreateParamsConfigurationMerchantCapabilitiesBoletoPayments as AccountCreateParamsConfigurationMerchantCapabilitiesBoletoPayments, AccountCreateParamsConfigurationMerchantCapabilitiesCardPayments as AccountCreateParamsConfigurationMerchantCapabilitiesCardPayments, AccountCreateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments as AccountCreateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments, @@ -63,8 +64,10 @@ AccountCreateParamsConfigurationMerchantCapabilitiesPromptpayPayments as AccountCreateParamsConfigurationMerchantCapabilitiesPromptpayPayments, AccountCreateParamsConfigurationMerchantCapabilitiesRevolutPayPayments as AccountCreateParamsConfigurationMerchantCapabilitiesRevolutPayPayments, AccountCreateParamsConfigurationMerchantCapabilitiesSamsungPayPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSamsungPayPayments, + AccountCreateParamsConfigurationMerchantCapabilitiesSatispayPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSatispayPayments, AccountCreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments, AccountCreateParamsConfigurationMerchantCapabilitiesSepaDebitPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSepaDebitPayments, + AccountCreateParamsConfigurationMerchantCapabilitiesSequraPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSequraPayments, AccountCreateParamsConfigurationMerchantCapabilitiesSunbitPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSunbitPayments, AccountCreateParamsConfigurationMerchantCapabilitiesSwishPayments as AccountCreateParamsConfigurationMerchantCapabilitiesSwishPayments, AccountCreateParamsConfigurationMerchantCapabilitiesTwintPayments as AccountCreateParamsConfigurationMerchantCapabilitiesTwintPayments, @@ -78,6 +81,7 @@ AccountCreateParamsConfigurationMerchantScriptStatementDescriptor as AccountCreateParamsConfigurationMerchantScriptStatementDescriptor, AccountCreateParamsConfigurationMerchantScriptStatementDescriptorKana as AccountCreateParamsConfigurationMerchantScriptStatementDescriptorKana, AccountCreateParamsConfigurationMerchantScriptStatementDescriptorKanji as AccountCreateParamsConfigurationMerchantScriptStatementDescriptorKanji, + AccountCreateParamsConfigurationMerchantSepaDebitPayments as AccountCreateParamsConfigurationMerchantSepaDebitPayments, AccountCreateParamsConfigurationMerchantSmartDisputes as AccountCreateParamsConfigurationMerchantSmartDisputes, AccountCreateParamsConfigurationMerchantSmartDisputesAutoRespond as AccountCreateParamsConfigurationMerchantSmartDisputesAutoRespond, AccountCreateParamsConfigurationMerchantStatementDescriptor as AccountCreateParamsConfigurationMerchantStatementDescriptor, @@ -284,6 +288,7 @@ AccountUpdateParamsConfigurationMerchantCapabilitiesBacsDebitPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesBacsDebitPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesBancontactPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesBancontactPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesBlikPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesBlikPayments, + AccountUpdateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesBoletoPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesBoletoPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesCardPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesCardPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesCartesBancairesPayments, @@ -312,8 +317,10 @@ AccountUpdateParamsConfigurationMerchantCapabilitiesPromptpayPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesPromptpayPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesRevolutPayPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesRevolutPayPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesSamsungPayPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSamsungPayPayments, + AccountUpdateParamsConfigurationMerchantCapabilitiesSatispayPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSatispayPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesSepaDebitPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSepaDebitPayments, + AccountUpdateParamsConfigurationMerchantCapabilitiesSequraPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSequraPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesSunbitPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSunbitPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesSwishPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesSwishPayments, AccountUpdateParamsConfigurationMerchantCapabilitiesTwintPayments as AccountUpdateParamsConfigurationMerchantCapabilitiesTwintPayments, @@ -327,6 +334,7 @@ AccountUpdateParamsConfigurationMerchantScriptStatementDescriptor as AccountUpdateParamsConfigurationMerchantScriptStatementDescriptor, AccountUpdateParamsConfigurationMerchantScriptStatementDescriptorKana as AccountUpdateParamsConfigurationMerchantScriptStatementDescriptorKana, AccountUpdateParamsConfigurationMerchantScriptStatementDescriptorKanji as AccountUpdateParamsConfigurationMerchantScriptStatementDescriptorKanji, + AccountUpdateParamsConfigurationMerchantSepaDebitPayments as AccountUpdateParamsConfigurationMerchantSepaDebitPayments, AccountUpdateParamsConfigurationMerchantSmartDisputes as AccountUpdateParamsConfigurationMerchantSmartDisputes, AccountUpdateParamsConfigurationMerchantSmartDisputesAutoRespond as AccountUpdateParamsConfigurationMerchantSmartDisputesAutoRespond, AccountUpdateParamsConfigurationMerchantStatementDescriptor as AccountUpdateParamsConfigurationMerchantStatementDescriptor, @@ -602,6 +610,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationMerchantCapabilitiesBoletoPayments": ( "stripe.params.v2.core._account_create_params", False, @@ -714,6 +726,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationMerchantCapabilitiesSatispayPayments": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments": ( "stripe.params.v2.core._account_create_params", False, @@ -722,6 +738,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationMerchantCapabilitiesSequraPayments": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationMerchantCapabilitiesSunbitPayments": ( "stripe.params.v2.core._account_create_params", False, @@ -774,6 +794,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationMerchantSepaDebitPayments": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationMerchantSmartDisputes": ( "stripe.params.v2.core._account_create_params", False, @@ -1547,6 +1571,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationMerchantCapabilitiesBoletoPayments": ( "stripe.params.v2.core._account_update_params", False, @@ -1659,6 +1687,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationMerchantCapabilitiesSatispayPayments": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments": ( "stripe.params.v2.core._account_update_params", False, @@ -1667,6 +1699,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationMerchantCapabilitiesSequraPayments": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationMerchantCapabilitiesSunbitPayments": ( "stripe.params.v2.core._account_update_params", False, @@ -1719,6 +1755,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationMerchantSepaDebitPayments": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationMerchantSmartDisputes": ( "stripe.params.v2.core._account_update_params", False, diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 8a52e2cc5..ed29159d1 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -10,7 +10,7 @@ class AccountCreateParams(TypedDict): account_token: NotRequired[str] """ - The account token generated by the account token api. + The account token generated by the account token API. """ configuration: NotRequired["AccountCreateParamsConfiguration"] """ @@ -298,6 +298,12 @@ class AccountCreateParamsConfigurationMerchant(TypedDict): """ Settings for the default text that appears on statements for language variations. """ + sepa_debit_payments: NotRequired[ + "AccountCreateParamsConfigurationMerchantSepaDebitPayments" + ] + """ + Settings used for SEPA Direct Debit payments. + """ smart_disputes: NotRequired[ "AccountCreateParamsConfigurationMerchantSmartDisputes" ] @@ -403,6 +409,12 @@ class AccountCreateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process BLIK payments. """ + blik_recurring_payments: NotRequired[ + "AccountCreateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments" + ] + """ + Allow the merchant to process recurring BLIK payments. + """ boleto_payments: NotRequired[ "AccountCreateParamsConfigurationMerchantCapabilitiesBoletoPayments" ] @@ -571,6 +583,12 @@ class AccountCreateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process Samsung Pay payments. """ + satispay_payments: NotRequired[ + "AccountCreateParamsConfigurationMerchantCapabilitiesSatispayPayments" + ] + """ + Allow the merchant to process Satispay payments. + """ sepa_bank_transfer_payments: NotRequired[ "AccountCreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments" ] @@ -583,6 +601,12 @@ class AccountCreateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process SEPA Direct Debit payments. """ + sequra_payments: NotRequired[ + "AccountCreateParamsConfigurationMerchantCapabilitiesSequraPayments" + ] + """ + Allow the merchant to process SeQura payments. + """ sunbit_payments: NotRequired[ "AccountCreateParamsConfigurationMerchantCapabilitiesSunbitPayments" ] @@ -705,6 +729,15 @@ class AccountCreateParamsConfigurationMerchantCapabilitiesBlikPayments( """ +class AccountCreateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments( + TypedDict, +): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountCreateParamsConfigurationMerchantCapabilitiesBoletoPayments( TypedDict, ): @@ -957,6 +990,15 @@ class AccountCreateParamsConfigurationMerchantCapabilitiesSamsungPayPayments( """ +class AccountCreateParamsConfigurationMerchantCapabilitiesSatispayPayments( + TypedDict, +): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountCreateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments( TypedDict, ): @@ -975,6 +1017,15 @@ class AccountCreateParamsConfigurationMerchantCapabilitiesSepaDebitPayments( """ +class AccountCreateParamsConfigurationMerchantCapabilitiesSequraPayments( + TypedDict, +): + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountCreateParamsConfigurationMerchantCapabilitiesSunbitPayments( TypedDict, ): @@ -1124,6 +1175,13 @@ class AccountCreateParamsConfigurationMerchantScriptStatementDescriptorKanji( """ +class AccountCreateParamsConfigurationMerchantSepaDebitPayments(TypedDict): + creditor_id: NotRequired[str] + """ + Creditor ID for SEPA Direct Debit payments. + """ + + class AccountCreateParamsConfigurationMerchantSmartDisputes(TypedDict): auto_respond: NotRequired[ "AccountCreateParamsConfigurationMerchantSmartDisputesAutoRespond" @@ -2210,7 +2268,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVer """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2223,7 +2281,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2236,7 +2294,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAsso """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2249,7 +2307,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecre """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2262,7 +2320,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVeri """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2275,7 +2333,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerificatio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2288,7 +2346,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2314,7 +2372,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2333,7 +2391,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2361,7 +2419,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBenefici """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2865,7 +2923,7 @@ class AccountCreateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2876,7 +2934,7 @@ class AccountCreateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2889,7 +2947,7 @@ class AccountCreateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2915,7 +2973,7 @@ class AccountCreateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2939,7 +2997,7 @@ class AccountCreateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_account_link_create_params.py b/stripe/params/v2/core/_account_link_create_params.py index 8b278c16f..03bef84a6 100644 --- a/stripe/params/v2/core/_account_link_create_params.py +++ b/stripe/params/v2/core/_account_link_create_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List, Union +from typing import Union from typing_extensions import Literal, NotRequired, TypedDict @@ -11,7 +11,9 @@ class AccountLinkCreateParams(TypedDict): """ use_case: "AccountLinkCreateParamsUseCase" """ - The use case of the AccountLink. + Specifies the Stripe-hosted flow for this Account Link. Set `type` and the matching options hash—for example, + `account_onboarding`—to configure the flow, including which Account configurations to collect information for and + any flow-specific collection or redirect options. """ @@ -39,17 +41,6 @@ class AccountLinkCreateParamsUseCaseAccountOnboarding(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[ - Union[ - Literal[ - "customer", "merchant", "money_manager", "recipient", "storer" - ], - str, - ] - ] - """ - Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. - """ refresh_url: str """ The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. @@ -80,17 +71,6 @@ class AccountLinkCreateParamsUseCaseAccountUpdate(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[ - Union[ - Literal[ - "customer", "merchant", "money_manager", "recipient", "storer" - ], - str, - ] - ] - """ - Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. - """ refresh_url: str """ The URL the user will be redirected to if the Account Link is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new Account Link with the same parameters used to create the original Account Link, then redirect the user to the new Account Link URL so they can continue the flow. Make sure to authenticate the user before redirecting to the new Account Link, in case the URL leaks to a third party. If a new Account Link can't be generated, or if the redirect fails, you should display a useful error to the user. diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index 9a7025f73..6cfc56b0d 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -392,7 +392,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnersh """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -405,7 +405,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -418,7 +418,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumO """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -431,7 +431,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterial """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -444,7 +444,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyRegistratio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -457,7 +457,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerifi """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -470,7 +470,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsPrimaryVerificatio """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -496,7 +496,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -515,7 +515,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfRegistratio """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -543,7 +543,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBen """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1063,7 +1063,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1074,7 +1074,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1087,7 +1087,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -1113,7 +1113,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -1137,7 +1137,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 27098b211..19572c866 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -10,7 +10,7 @@ class AccountUpdateParams(TypedDict): account_token: NotRequired[str] """ - The account token generated by the account token api. + The account token generated by the account token API. """ configuration: NotRequired["AccountUpdateParamsConfiguration"] """ @@ -316,6 +316,12 @@ class AccountUpdateParamsConfigurationMerchant(TypedDict): """ Settings for the default text that appears on statements for language variations. """ + sepa_debit_payments: NotRequired[ + "AccountUpdateParamsConfigurationMerchantSepaDebitPayments" + ] + """ + Settings for SEPA Direct Debit payments. + """ smart_disputes: NotRequired[ "AccountUpdateParamsConfigurationMerchantSmartDisputes" ] @@ -421,6 +427,12 @@ class AccountUpdateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process BLIK payments. """ + blik_recurring_payments: NotRequired[ + "AccountUpdateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments" + ] + """ + Allow the merchant to process recurring BLIK payments. + """ boleto_payments: NotRequired[ "AccountUpdateParamsConfigurationMerchantCapabilitiesBoletoPayments" ] @@ -589,6 +601,12 @@ class AccountUpdateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process Samsung Pay payments. """ + satispay_payments: NotRequired[ + "AccountUpdateParamsConfigurationMerchantCapabilitiesSatispayPayments" + ] + """ + Allow the merchant to process Satispay payments. + """ sepa_bank_transfer_payments: NotRequired[ "AccountUpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments" ] @@ -601,6 +619,12 @@ class AccountUpdateParamsConfigurationMerchantCapabilities(TypedDict): """ Allow the merchant to process SEPA Direct Debit payments. """ + sequra_payments: NotRequired[ + "AccountUpdateParamsConfigurationMerchantCapabilitiesSequraPayments" + ] + """ + Allow the merchant to process SeQura payments. + """ sunbit_payments: NotRequired[ "AccountUpdateParamsConfigurationMerchantCapabilitiesSunbitPayments" ] @@ -723,6 +747,15 @@ class AccountUpdateParamsConfigurationMerchantCapabilitiesBlikPayments( """ +class AccountUpdateParamsConfigurationMerchantCapabilitiesBlikRecurringPayments( + TypedDict, +): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountUpdateParamsConfigurationMerchantCapabilitiesBoletoPayments( TypedDict, ): @@ -975,6 +1008,15 @@ class AccountUpdateParamsConfigurationMerchantCapabilitiesSamsungPayPayments( """ +class AccountUpdateParamsConfigurationMerchantCapabilitiesSatispayPayments( + TypedDict, +): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountUpdateParamsConfigurationMerchantCapabilitiesSepaBankTransferPayments( TypedDict, ): @@ -993,6 +1035,15 @@ class AccountUpdateParamsConfigurationMerchantCapabilitiesSepaDebitPayments( """ +class AccountUpdateParamsConfigurationMerchantCapabilitiesSequraPayments( + TypedDict, +): + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + class AccountUpdateParamsConfigurationMerchantCapabilitiesSunbitPayments( TypedDict, ): @@ -1142,6 +1193,13 @@ class AccountUpdateParamsConfigurationMerchantScriptStatementDescriptorKanji( """ +class AccountUpdateParamsConfigurationMerchantSepaDebitPayments(TypedDict): + creditor_id: NotRequired[str] + """ + Creditor ID for SEPA Direct Debit payments. + """ + + class AccountUpdateParamsConfigurationMerchantSmartDisputes(TypedDict): auto_respond: NotRequired[ "AccountUpdateParamsConfigurationMerchantSmartDisputesAutoRespond" @@ -2267,7 +2325,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVer """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2280,7 +2338,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2293,7 +2351,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAsso """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2306,7 +2364,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecre """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2319,7 +2377,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVeri """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2332,7 +2390,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerificatio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2345,7 +2403,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2371,7 +2429,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2390,7 +2448,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2418,7 +2476,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBenefici """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2924,7 +2982,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2935,7 +2993,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -2948,7 +3006,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2974,7 +3032,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -2998,7 +3056,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_event_destination_create_params.py b/stripe/params/v2/core/_event_destination_create_params.py index 4e3f42040..7396977c0 100644 --- a/stripe/params/v2/core/_event_destination_create_params.py +++ b/stripe/params/v2/core/_event_destination_create_params.py @@ -10,29 +10,29 @@ class EventDestinationCreateParams(TypedDict): "EventDestinationCreateParamsAmazonEventbridge" ] """ - Amazon EventBridge configuration. + AWS account and region where Stripe creates the EventBridge partner event source. """ azure_event_grid: NotRequired["EventDestinationCreateParamsAzureEventGrid"] """ - Azure Event Grid configuration. + Azure subscription, resource group, and region where Stripe creates the partner topic. """ description: NotRequired[str] """ - An optional description of what the event destination is used for. + An optional user-defined description of the destination's purpose. """ enabled_events: List[str] """ - The list of events to enable for this endpoint. + The list of event types enabled for delivery to this destination. """ event_payload: Literal["snapshot", "thin"] """ - Payload type of events being subscribed to. + Whether to deliver as snapshot or thin events. """ events_from: NotRequired[List[str]] """ - Specifies which accounts' events route to this destination. + The account or organization scopes that can supply events. Use this with `enabled_events` to define the subscription. `@self`: Receive events from the account that owns the event destination. - `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + `@accounts`: Receive events emitted from other accounts you manage, including your v1 and v2 accounts. `@organization_members`: Receive events from accounts directly linked to the organization. `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. """ @@ -47,63 +47,63 @@ class EventDestinationCreateParams(TypedDict): ] ] """ - Additional fields to include in the response. + Include normally redacted webhook fields in the create response. Public API clients must include `webhook_endpoint.signing_secret` to receive the signing secret. """ metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] """ - Metadata. + User-defined key/value data for the destination. """ name: str """ - Event destination name. + A user-defined label for identifying the destination. """ snapshot_api_version: NotRequired[str] """ - If using the snapshot event payload, the API version events are rendered as. + For snapshot events only, the Stripe API version used to render event objects; do not provide this for thin events. """ type: Union[ Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"], str, ] """ - Event destination type. + The delivery transport. Chosen when the destination is created and cannot be changed by update. """ webhook_endpoint: NotRequired[ "EventDestinationCreateParamsWebhookEndpoint" ] """ - Webhook endpoint configuration. + Delivery target for the webhook endpoint. Live mode requires HTTPS; sandbox mode also supports HTTP. """ class EventDestinationCreateParamsAmazonEventbridge(TypedDict): aws_account_id: str """ - The AWS account ID. + Your AWS account where Stripe creates the partner event source. """ aws_region: str """ - The region of the AWS event source. + The AWS region where Stripe creates the partner event source. """ class EventDestinationCreateParamsAzureEventGrid(TypedDict): azure_region: str """ - The Azure region. + The Azure region where Stripe creates the partner topic. """ azure_resource_group_name: str """ - The name of the Azure resource group. + The Azure resource group where Stripe creates the partner topic. """ azure_subscription_id: str """ - The Azure subscription ID. + The Azure subscription where Stripe creates the partner topic. """ class EventDestinationCreateParamsWebhookEndpoint(TypedDict): url: str """ - The URL of the webhook endpoint. + The URL where Stripe sends matching events. Live mode requires HTTPS; sandbox mode also supports HTTP. """ diff --git a/stripe/params/v2/core/_event_destination_list_params.py b/stripe/params/v2/core/_event_destination_list_params.py index c0320468a..74743a4f1 100644 --- a/stripe/params/v2/core/_event_destination_list_params.py +++ b/stripe/params/v2/core/_event_destination_list_params.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class EventDestinationListParams(TypedDict): - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ - Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + Include the normally redacted `webhook_endpoint.url` in each returned destination. """ limit: NotRequired[int] """ diff --git a/stripe/params/v2/core/_event_destination_retrieve_params.py b/stripe/params/v2/core/_event_destination_retrieve_params.py index d43606b1d..ad0200416 100644 --- a/stripe/params/v2/core/_event_destination_retrieve_params.py +++ b/stripe/params/v2/core/_event_destination_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class EventDestinationRetrieveParams(TypedDict): - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/core/_event_destination_update_params.py b/stripe/params/v2/core/_event_destination_update_params.py index bc0feb0b8..f86bd85a4 100644 --- a/stripe/params/v2/core/_event_destination_update_params.py +++ b/stripe/params/v2/core/_event_destination_update_params.py @@ -1,22 +1,22 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict class EventDestinationUpdateParams(TypedDict): description: NotRequired[str] """ - An optional description of what the event destination is used for. + An optional user-defined description of the destination's purpose; it does not control routing. """ enabled_events: NotRequired[List[str]] """ - The list of events to enable for this endpoint. + The list of event types enabled for delivery to this destination. Event scopes are configured when the destination is created. """ - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ - Additional fields to include in the response. Currently supports `webhook_endpoint.url`. + Include the normally redacted `webhook_endpoint.url` in the response. """ metadata: NotRequired[ "Dict[str, Optional[str]]|UntypedStripeObject[Optional[str]]" @@ -26,18 +26,18 @@ class EventDestinationUpdateParams(TypedDict): """ name: NotRequired[str] """ - Event destination name. + A user-defined label for identifying the destination; it does not control routing. """ webhook_endpoint: NotRequired[ "EventDestinationUpdateParamsWebhookEndpoint" ] """ - Webhook endpoint configuration. + New delivery target for the webhook endpoint. Live mode requires HTTPS; sandbox mode also supports HTTP. """ class EventDestinationUpdateParamsWebhookEndpoint(TypedDict): url: str """ - The URL of the webhook endpoint. + The URL where Stripe sends matching events. Live mode requires HTTPS; sandbox mode also supports HTTP. """ diff --git a/stripe/params/v2/core/accounts/_person_create_params.py b/stripe/params/v2/core/accounts/_person_create_params.py index 4e7b02531..74e36cf35 100644 --- a/stripe/params/v2/core/accounts/_person_create_params.py +++ b/stripe/params/v2/core/accounts/_person_create_params.py @@ -245,7 +245,7 @@ class PersonCreateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -256,7 +256,7 @@ class PersonCreateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -267,7 +267,7 @@ class PersonCreateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -289,7 +289,7 @@ class PersonCreateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -311,7 +311,7 @@ class PersonCreateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ 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 15a321f83..3b1b8fc23 100644 --- a/stripe/params/v2/core/accounts/_person_token_create_params.py +++ b/stripe/params/v2/core/accounts/_person_token_create_params.py @@ -239,7 +239,7 @@ class PersonTokenCreateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -250,7 +250,7 @@ class PersonTokenCreateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -261,7 +261,7 @@ class PersonTokenCreateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -285,7 +285,7 @@ class PersonTokenCreateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -309,7 +309,7 @@ class PersonTokenCreateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/accounts/_person_update_params.py b/stripe/params/v2/core/accounts/_person_update_params.py index ed45a4816..2318e45f2 100644 --- a/stripe/params/v2/core/accounts/_person_update_params.py +++ b/stripe/params/v2/core/accounts/_person_update_params.py @@ -247,7 +247,7 @@ class PersonUpdateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -258,7 +258,7 @@ class PersonUpdateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -269,7 +269,7 @@ class PersonUpdateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -291,7 +291,7 @@ class PersonUpdateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -313,7 +313,7 @@ class PersonUpdateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/iam/_activity_log_list_params.py b/stripe/params/v2/iam/_activity_log_list_params.py index 5c0f39a72..f4cf3cbfe 100644 --- a/stripe/params/v2/iam/_activity_log_list_params.py +++ b/stripe/params/v2/iam/_activity_log_list_params.py @@ -6,7 +6,23 @@ class ActivityLogListParams(TypedDict): action_groups: NotRequired[ - List[Union[Literal["api_key", "user_invite", "user_roles"], str]] + List[ + Union[ + Literal[ + "account_security", + "api_key", + "authentication", + "issuing", + "payout", + "scim", + "sso", + "user_invite", + "user_profile", + "user_roles", + ], + str, + ] + ] ] """ Filter results to only include activity logs for the specified action group types. @@ -15,15 +31,65 @@ class ActivityLogListParams(TypedDict): List[ Union[ Literal[ + "anomaly_detection_settings_updated", "api_key_created", "api_key_deleted", "api_key_updated", "api_key_viewed", + "issuing_activated", + "issuing_balance_transfer_created", + "issuing_cardholder_created", + "issuing_cardholder_updated", + "issuing_card_created", + "issuing_card_sensitive_details_viewed", + "issuing_card_updated", + "issuing_dispute_created", + "issuing_dispute_submitted", + "issuing_dispute_updated", + "manual_payouts_disabled", + "manual_payouts_enabled", + "payout_destination_added", + "payout_destination_removed", + "payout_destination_updated", + "payout_schedule_edits_disabled", + "payout_schedule_edits_enabled", + "scim_group_deleted", + "scim_group_member_added", + "scim_group_member_removed", + "scim_group_roles_updated", + "scim_group_updated", + "sso_domain_verified", + "sso_settings_created", + "sso_settings_deleted", + "sso_settings_updated", + "two_step_authentication_mandate_disabled", + "two_step_authentication_mandate_enabled", + "user_auth_challenge_failed", + "user_email_changed", + "user_email_verified", + "user_express_phone_number_changed", + "user_google_account_connected", + "user_google_account_disconnected", "user_invite_accepted", "user_invite_created", "user_invite_deleted", + "user_passkey_added", + "user_passkey_removed", + "user_passkey_updated", + "user_passkey_upgraded", + "user_password_changed", + "user_password_initialized", + "user_password_reset_failed", + "user_password_reset_requested", + "user_password_reset_succeeded", "user_roles_deleted", "user_roles_updated", + "user_two_step_authentication_backup_code_used", + "user_two_step_authentication_method_added", + "user_two_step_authentication_method_removed", + "user_two_step_authentication_method_reset", + "user_two_step_authentication_method_updated", + "user_two_step_authentication_reset_requested", ], str, ] diff --git a/stripe/params/v2/money_management/__init__.py b/stripe/params/v2/money_management/__init__.py index f50c9d098..214da7023 100644 --- a/stripe/params/v2/money_management/__init__.py +++ b/stripe/params/v2/money_management/__init__.py @@ -4,8 +4,10 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.v2.money_management import test_helpers as test_helpers from stripe.params.v2.money_management._adjustment_list_params import ( AdjustmentListParams as AdjustmentListParams, + AdjustmentListParamsCreated as AdjustmentListParamsCreated, ) from stripe.params.v2.money_management._adjustment_retrieve_params import ( AdjustmentRetrieveParams as AdjustmentRetrieveParams, @@ -17,6 +19,7 @@ from stripe.params.v2.money_management._financial_account_create_params import ( FinancialAccountCreateParams as FinancialAccountCreateParams, FinancialAccountCreateParamsStorage as FinancialAccountCreateParamsStorage, + FinancialAccountCreateParamsStorageDepositInsuranceEligibility as FinancialAccountCreateParamsStorageDepositInsuranceEligibility, ) from stripe.params.v2.money_management._financial_account_list_params import ( FinancialAccountListParams as FinancialAccountListParams, @@ -29,6 +32,7 @@ ) from stripe.params.v2.money_management._financial_address_create_params import ( FinancialAddressCreateParams as FinancialAddressCreateParams, + FinancialAddressCreateParamsBankAccount as FinancialAddressCreateParamsBankAccount, ) from stripe.params.v2.money_management._financial_address_list_params import ( FinancialAddressListParams as FinancialAddressListParams, @@ -43,6 +47,7 @@ ) from stripe.params.v2.money_management._inbound_transfer_list_params import ( InboundTransferListParams as InboundTransferListParams, + InboundTransferListParamsCreated as InboundTransferListParamsCreated, ) from stripe.params.v2.money_management._inbound_transfer_retrieve_params import ( InboundTransferRetrieveParams as InboundTransferRetrieveParams, @@ -129,6 +134,7 @@ ) from stripe.params.v2.money_management._received_credit_list_params import ( ReceivedCreditListParams as ReceivedCreditListParams, + ReceivedCreditListParamsCreated as ReceivedCreditListParamsCreated, ) from stripe.params.v2.money_management._received_credit_retrieve_params import ( ReceivedCreditRetrieveParams as ReceivedCreditRetrieveParams, @@ -141,12 +147,14 @@ ) from stripe.params.v2.money_management._transaction_entry_list_params import ( TransactionEntryListParams as TransactionEntryListParams, + TransactionEntryListParamsCreated as TransactionEntryListParamsCreated, ) from stripe.params.v2.money_management._transaction_entry_retrieve_params import ( TransactionEntryRetrieveParams as TransactionEntryRetrieveParams, ) from stripe.params.v2.money_management._transaction_list_params import ( TransactionListParams as TransactionListParams, + TransactionListParamsCreated as TransactionListParamsCreated, ) from stripe.params.v2.money_management._transaction_retrieve_params import ( TransactionRetrieveParams as TransactionRetrieveParams, @@ -154,10 +162,15 @@ # name -> (import_target, is_submodule) _import_map = { + "test_helpers": ("stripe.params.v2.money_management.test_helpers", True), "AdjustmentListParams": ( "stripe.params.v2.money_management._adjustment_list_params", False, ), + "AdjustmentListParamsCreated": ( + "stripe.params.v2.money_management._adjustment_list_params", + False, + ), "AdjustmentRetrieveParams": ( "stripe.params.v2.money_management._adjustment_retrieve_params", False, @@ -178,6 +191,10 @@ "stripe.params.v2.money_management._financial_account_create_params", False, ), + "FinancialAccountCreateParamsStorageDepositInsuranceEligibility": ( + "stripe.params.v2.money_management._financial_account_create_params", + False, + ), "FinancialAccountListParams": ( "stripe.params.v2.money_management._financial_account_list_params", False, @@ -194,6 +211,10 @@ "stripe.params.v2.money_management._financial_address_create_params", False, ), + "FinancialAddressCreateParamsBankAccount": ( + "stripe.params.v2.money_management._financial_address_create_params", + False, + ), "FinancialAddressListParams": ( "stripe.params.v2.money_management._financial_address_list_params", False, @@ -218,6 +239,10 @@ "stripe.params.v2.money_management._inbound_transfer_list_params", False, ), + "InboundTransferListParamsCreated": ( + "stripe.params.v2.money_management._inbound_transfer_list_params", + False, + ), "InboundTransferRetrieveParams": ( "stripe.params.v2.money_management._inbound_transfer_retrieve_params", False, @@ -378,6 +403,10 @@ "stripe.params.v2.money_management._received_credit_list_params", False, ), + "ReceivedCreditListParamsCreated": ( + "stripe.params.v2.money_management._received_credit_list_params", + False, + ), "ReceivedCreditRetrieveParams": ( "stripe.params.v2.money_management._received_credit_retrieve_params", False, @@ -394,6 +423,10 @@ "stripe.params.v2.money_management._transaction_entry_list_params", False, ), + "TransactionEntryListParamsCreated": ( + "stripe.params.v2.money_management._transaction_entry_list_params", + False, + ), "TransactionEntryRetrieveParams": ( "stripe.params.v2.money_management._transaction_entry_retrieve_params", False, @@ -402,6 +435,10 @@ "stripe.params.v2.money_management._transaction_list_params", False, ), + "TransactionListParamsCreated": ( + "stripe.params.v2.money_management._transaction_list_params", + False, + ), "TransactionRetrieveParams": ( "stripe.params.v2.money_management._transaction_retrieve_params", False, diff --git a/stripe/params/v2/money_management/_adjustment_list_params.py b/stripe/params/v2/money_management/_adjustment_list_params.py index 1a7715c28..65f32e3f2 100644 --- a/stripe/params/v2/money_management/_adjustment_list_params.py +++ b/stripe/params/v2/money_management/_adjustment_list_params.py @@ -8,32 +8,34 @@ class AdjustmentListParams(TypedDict): """ Filter for Adjustments linked to a Flow. """ - created: NotRequired[str] + created: NotRequired["AdjustmentListParamsCreated"] """ - Filter for objects created at the specified timestamp. - Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + Set of filters to query Adjustments within a range of `created` timestamps. + """ + limit: NotRequired[int] """ - created_gt: NotRequired[str] + The page limit. + """ + + +class AdjustmentListParamsCreated(TypedDict): + 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] + 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] + 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] + 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. """ - limit: NotRequired[int] - """ - The page limit. - """ diff --git a/stripe/params/v2/money_management/_financial_account_create_params.py b/stripe/params/v2/money_management/_financial_account_create_params.py index 3a21ec934..f689e55ec 100644 --- a/stripe/params/v2/money_management/_financial_account_create_params.py +++ b/stripe/params/v2/money_management/_financial_account_create_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, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -25,7 +25,30 @@ class FinancialAccountCreateParams(TypedDict): class FinancialAccountCreateParamsStorage(TypedDict): + deposit_insurance_eligibility: NotRequired[ + List["FinancialAccountCreateParamsStorageDepositInsuranceEligibility"] + ] + """ + Array of eligibility objects, segmented by bank name and deposit insurance scheme. + """ holds_currencies: List[str] """ The currencies that this FinancialAccount can hold. """ + + +class FinancialAccountCreateParamsStorageDepositInsuranceEligibility( + TypedDict +): + bank_name: Union[Literal["fifth_third"], str] + """ + The bank where funds are stored. + """ + currencies: List[str] + """ + Currencies eligible for deposit insurance at this bank under this scheme. + """ + type: Union[Literal["fdic", "fdic_passthrough"], str] + """ + The deposit insurance scheme. + """ 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 0048fea1e..fa9325643 100644 --- a/stripe/params/v2/money_management/_financial_account_list_params.py +++ b/stripe/params/v2/money_management/_financial_account_list_params.py @@ -5,6 +5,12 @@ class FinancialAccountListParams(TypedDict): + include: NotRequired[ + List[Literal["storage.deposit_insurance_eligibility"]] + ] + """ + Additional fields to include in the response. + """ limit: NotRequired[int] """ The page limit. diff --git a/stripe/params/v2/money_management/_financial_account_retrieve_params.py b/stripe/params/v2/money_management/_financial_account_retrieve_params.py index 40b1615fb..a478f7772 100644 --- a/stripe/params/v2/money_management/_financial_account_retrieve_params.py +++ b/stripe/params/v2/money_management/_financial_account_retrieve_params.py @@ -1,7 +1,13 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing_extensions import TypedDict +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict class FinancialAccountRetrieveParams(TypedDict): - pass + include: NotRequired[ + List[Literal["storage.deposit_insurance_eligibility"]] + ] + """ + Additional fields to include in the response. + """ 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 3abc93381..677fca453 100644 --- a/stripe/params/v2/money_management/_financial_address_create_params.py +++ b/stripe/params/v2/money_management/_financial_address_create_params.py @@ -1,15 +1,34 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing import Union -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class FinancialAddressCreateParams(TypedDict): + bank_account: NotRequired["FinancialAddressCreateParamsBankAccount"] + """ + Properties for creating a bank account FinancialAddress. + """ financial_account: str """ The ID of the FinancialAccount the new FinancialAddress should be associated with. """ - type: Union[Literal["gb_bank_account", "us_bank_account"], str] + settlement_currency: NotRequired[str] + """ + Open Enum. The currency the FinancialAddress settles into the FinancialAccount. + """ + type: Union[Literal["bank_account"], str] + """ + The type of FinancialAddress to create. Must agree with which branch of financial_address_type_properties is set. + """ + + +class FinancialAddressCreateParamsBankAccount(TypedDict): + country: NotRequired[str] + """ + The country for the bank account. Used to select the appropriate rails (e.g. for SEPA). + """ + currency: Union[Literal["gbp", "usd"], str] """ - The type of FinancialAddress details to provision. + The currency of the bank account 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 6e9ebd03d..f0599762b 100644 --- a/stripe/params/v2/money_management/_financial_address_list_params.py +++ b/stripe/params/v2/money_management/_financial_address_list_params.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List, Union -from typing_extensions import Literal, NotRequired, TypedDict +from typing_extensions import NotRequired, TypedDict class FinancialAddressListParams(TypedDict): @@ -9,20 +8,6 @@ class FinancialAddressListParams(TypedDict): """ The ID of the FinancialAccount for which FinancialAddresses are to be returned. """ - include: NotRequired[ - List[ - Union[ - Literal[ - "credentials.gb_bank_account.account_number", - "credentials.us_bank_account.account_number", - ], - str, - ] - ] - ] - """ - Open Enum. A list of fields to reveal in the FinancialAddresses returned. - """ limit: NotRequired[int] """ The page limit. 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 f1f4f4963..43f14693e 100644 --- a/stripe/params/v2/money_management/_financial_address_retrieve_params.py +++ b/stripe/params/v2/money_management/_financial_address_retrieve_params.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List, Union -from typing_extensions import Literal, NotRequired, TypedDict +from typing_extensions import TypedDict class FinancialAddressRetrieveParams(TypedDict): - include: NotRequired[ - List[ - Union[ - Literal[ - "credentials.gb_bank_account.account_number", - "credentials.us_bank_account.account_number", - ], - str, - ] - ] - ] - """ - Open Enum. A list of fields to reveal in the FinancialAddresses returned. - """ + pass diff --git a/stripe/params/v2/money_management/_inbound_transfer_list_params.py b/stripe/params/v2/money_management/_inbound_transfer_list_params.py index 5f1cf063f..42a4e77b9 100644 --- a/stripe/params/v2/money_management/_inbound_transfer_list_params.py +++ b/stripe/params/v2/money_management/_inbound_transfer_list_params.py @@ -4,32 +4,34 @@ class InboundTransferListParams(TypedDict): - created: NotRequired[str] + created: NotRequired["InboundTransferListParamsCreated"] """ - Filter for objects created at the specified timestamp. - Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + Hash of options for filtering on creation time. + """ + limit: NotRequired[int] """ - created_gt: NotRequired[str] + The page limit. + """ + + +class InboundTransferListParamsCreated(TypedDict): + 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] + 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] + 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] + 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. """ - limit: NotRequired[int] - """ - The page limit. - """ diff --git a/stripe/params/v2/money_management/_outbound_payment_create_params.py b/stripe/params/v2/money_management/_outbound_payment_create_params.py index 177953f7e..018963c5f 100644 --- a/stripe/params/v2/money_management/_outbound_payment_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_create_params.py @@ -32,7 +32,7 @@ class OutboundPaymentCreateParams(_OutboundPaymentCreateParamsBase): """ The quote for this OutboundPayment. Only required for countries with regulatory mandates to display fee estimates before OutboundPayment creation. """ - purpose: NotRequired[Literal["payroll"]] + purpose: NotRequired["Literal['payroll']|str"] """ The purpose of the OutboundPayment. """ diff --git a/stripe/params/v2/money_management/_payout_method_list_params.py b/stripe/params/v2/money_management/_payout_method_list_params.py index 7dbcf067e..693f83887 100644 --- a/stripe/params/v2/money_management/_payout_method_list_params.py +++ b/stripe/params/v2/money_management/_payout_method_list_params.py @@ -17,13 +17,29 @@ class PayoutMethodListParams(TypedDict): class PayoutMethodListParamsUsageStatus(TypedDict): payments: NotRequired[ - List[Literal["disabled", "eligible", "invalid", "requires_action"]] + List[ + Literal[ + "disabled", + "eligible", + "ineligible", + "invalid", + "requires_action", + ] + ] ] """ List of payments status to filter by. """ transfers: NotRequired[ - List[Literal["disabled", "eligible", "invalid", "requires_action"]] + List[ + Literal[ + "disabled", + "eligible", + "ineligible", + "invalid", + "requires_action", + ] + ] ] """ List of transfers status to filter by. diff --git a/stripe/params/v2/money_management/_received_credit_list_params.py b/stripe/params/v2/money_management/_received_credit_list_params.py index dc189bfce..5ffdc71cf 100644 --- a/stripe/params/v2/money_management/_received_credit_list_params.py +++ b/stripe/params/v2/money_management/_received_credit_list_params.py @@ -4,32 +4,34 @@ class ReceivedCreditListParams(TypedDict): - created: NotRequired[str] + created: NotRequired["ReceivedCreditListParamsCreated"] """ - Filter for objects created at the specified timestamp. - Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + Hash of options for filtering on creation time. + """ + limit: NotRequired[int] """ - created_gt: NotRequired[str] + The page limit. + """ + + +class ReceivedCreditListParamsCreated(TypedDict): + 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] + 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] + 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] + 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. """ - limit: NotRequired[int] - """ - The page limit. - """ diff --git a/stripe/params/v2/money_management/_transaction_entry_list_params.py b/stripe/params/v2/money_management/_transaction_entry_list_params.py index 4b1511b96..1da0085a6 100644 --- a/stripe/params/v2/money_management/_transaction_entry_list_params.py +++ b/stripe/params/v2/money_management/_transaction_entry_list_params.py @@ -4,31 +4,34 @@ class TransactionEntryListParams(TypedDict): - created: NotRequired[str] + created: NotRequired["TransactionEntryListParamsCreated"] """ - Filter for Transactions created at an exact time. + Set of filters to query TransactionEntries within a range of `created` timestamps. """ - created_gt: NotRequired[str] + limit: NotRequired[int] """ - Filter for Transactions created after the specified timestamp. + The page limit. """ - created_gte: NotRequired[str] + transaction: NotRequired[str] """ - Filter for Transactions created at or after the specified timestamp. + Filter for TransactionEntries belonging to a Transaction. """ - created_lt: NotRequired[str] + + +class TransactionEntryListParamsCreated(TypedDict): + gt: NotRequired[str] """ - Filter for Transactions created before the specified timestamp. + Filter for Transactions created after the specified timestamp. """ - created_lte: NotRequired[str] + gte: NotRequired[str] """ - Filter for Transactions created at or before the specified timestamp. + Filter for Transactions created at or after the specified timestamp. """ - limit: NotRequired[int] + lt: NotRequired[str] """ - The page limit. + Filter for Transactions created before the specified timestamp. """ - transaction: NotRequired[str] + lte: NotRequired[str] """ - Filter for TransactionEntries belonging to a Transaction. + Filter for Transactions created at or before the specified timestamp. """ diff --git a/stripe/params/v2/money_management/_transaction_list_params.py b/stripe/params/v2/money_management/_transaction_list_params.py index 1391fcfc3..d9a2a2d34 100644 --- a/stripe/params/v2/money_management/_transaction_list_params.py +++ b/stripe/params/v2/money_management/_transaction_list_params.py @@ -4,35 +4,38 @@ class TransactionListParams(TypedDict): - created: NotRequired[str] + created: NotRequired["TransactionListParamsCreated"] """ - Filter for Transactions created at an exact time. + Set of filters to query Transactions within a range of `created` timestamps. """ - created_gt: NotRequired[str] + financial_account: NotRequired[str] """ - Filter for Transactions created after the specified timestamp. + Filter for Transactions belonging to a FinancialAccount. """ - created_gte: NotRequired[str] + flow: NotRequired[str] """ - Filter for Transactions created at or after the specified timestamp. + Filter for Transactions corresponding to a Flow. """ - created_lt: NotRequired[str] + limit: NotRequired[int] """ - Filter for Transactions created before the specified timestamp. + The page limit. """ - created_lte: NotRequired[str] + + +class TransactionListParamsCreated(TypedDict): + gt: NotRequired[str] """ - Filter for Transactions created at or before the specified timestamp. + Filter for Transactions created after the specified timestamp. """ - financial_account: NotRequired[str] + gte: NotRequired[str] """ - Filter for Transactions belonging to a FinancialAccount. + Filter for Transactions created at or after the specified timestamp. """ - flow: NotRequired[str] + lt: NotRequired[str] """ - Filter for Transactions corresponding to a Flow. + Filter for Transactions created before the specified timestamp. """ - limit: NotRequired[int] + lte: NotRequired[str] """ - The page limit. + Filter for Transactions created at or before the specified timestamp. """ diff --git a/stripe/params/v2/test_helpers/__init__.py b/stripe/params/v2/money_management/test_helpers/__init__.py similarity index 68% rename from stripe/params/v2/test_helpers/__init__.py rename to stripe/params/v2/money_management/test_helpers/__init__.py index 07c7ea915..57d777c42 100644 --- a/stripe/params/v2/test_helpers/__init__.py +++ b/stripe/params/v2/money_management/test_helpers/__init__.py @@ -4,21 +4,21 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: - from stripe.params.v2.test_helpers._financial_address_credit_params import ( + from stripe.params.v2.money_management.test_helpers._financial_address_credit_params import ( FinancialAddressCreditParams as FinancialAddressCreditParams, ) - from stripe.params.v2.test_helpers._financial_address_generate_microdeposits_params import ( + from stripe.params.v2.money_management.test_helpers._financial_address_generate_microdeposits_params import ( FinancialAddressGenerateMicrodepositsParams as FinancialAddressGenerateMicrodepositsParams, ) # name -> (import_target, is_submodule) _import_map = { "FinancialAddressCreditParams": ( - "stripe.params.v2.test_helpers._financial_address_credit_params", + "stripe.params.v2.money_management.test_helpers._financial_address_credit_params", False, ), "FinancialAddressGenerateMicrodepositsParams": ( - "stripe.params.v2.test_helpers._financial_address_generate_microdeposits_params", + "stripe.params.v2.money_management.test_helpers._financial_address_generate_microdeposits_params", False, ), } diff --git a/stripe/params/v2/test_helpers/_financial_address_credit_params.py b/stripe/params/v2/money_management/test_helpers/_financial_address_credit_params.py similarity index 100% rename from stripe/params/v2/test_helpers/_financial_address_credit_params.py rename to stripe/params/v2/money_management/test_helpers/_financial_address_credit_params.py diff --git a/stripe/params/v2/test_helpers/_financial_address_generate_microdeposits_params.py b/stripe/params/v2/money_management/test_helpers/_financial_address_generate_microdeposits_params.py similarity index 100% rename from stripe/params/v2/test_helpers/_financial_address_generate_microdeposits_params.py rename to stripe/params/v2/money_management/test_helpers/_financial_address_generate_microdeposits_params.py diff --git a/stripe/params/v2/signals/__init__.py b/stripe/params/v2/signals/__init__.py index 7c90d0ad9..8e482869f 100644 --- a/stripe/params/v2/signals/__init__.py +++ b/stripe/params/v2/signals/__init__.py @@ -10,6 +10,8 @@ AccountActivityCreateParamsAccountDetailsData as AccountActivityCreateParamsAccountDetailsData, AccountActivityCreateParamsAccountDetailsDataDefaults as AccountActivityCreateParamsAccountDetailsDataDefaults, AccountActivityCreateParamsAccountDetailsDataDefaultsProfile as AccountActivityCreateParamsAccountDetailsDataDefaultsProfile, + AccountActivityCreateParamsAccountDetailsDataIdentity as AccountActivityCreateParamsAccountDetailsDataIdentity, + AccountActivityCreateParamsAccountDetailsDataIdentityBusinessDetails as AccountActivityCreateParamsAccountDetailsDataIdentityBusinessDetails, AccountActivityCreateParamsLoginAttempt as AccountActivityCreateParamsLoginAttempt, AccountActivityCreateParamsLoginAttemptClientDetails as AccountActivityCreateParamsLoginAttemptClientDetails, AccountActivityCreateParamsLoginAttemptClientDetailsData as AccountActivityCreateParamsLoginAttemptClientDetailsData, @@ -39,6 +41,8 @@ AccountEvaluationCreateParamsAccountDetailsData as AccountEvaluationCreateParamsAccountDetailsData, AccountEvaluationCreateParamsAccountDetailsDataDefaults as AccountEvaluationCreateParamsAccountDetailsDataDefaults, AccountEvaluationCreateParamsAccountDetailsDataDefaultsProfile as AccountEvaluationCreateParamsAccountDetailsDataDefaultsProfile, + AccountEvaluationCreateParamsAccountDetailsDataIdentity as AccountEvaluationCreateParamsAccountDetailsDataIdentity, + AccountEvaluationCreateParamsAccountDetailsDataIdentityBusinessDetails as AccountEvaluationCreateParamsAccountDetailsDataIdentityBusinessDetails, ) from stripe.params.v2.signals._account_evaluation_retrieve_params import ( AccountEvaluationRetrieveParams as AccountEvaluationRetrieveParams, @@ -73,6 +77,14 @@ "stripe.params.v2.signals._account_activity_create_params", False, ), + "AccountActivityCreateParamsAccountDetailsDataIdentity": ( + "stripe.params.v2.signals._account_activity_create_params", + False, + ), + "AccountActivityCreateParamsAccountDetailsDataIdentityBusinessDetails": ( + "stripe.params.v2.signals._account_activity_create_params", + False, + ), "AccountActivityCreateParamsLoginAttempt": ( "stripe.params.v2.signals._account_activity_create_params", False, @@ -165,6 +177,14 @@ "stripe.params.v2.signals._account_evaluation_create_params", False, ), + "AccountEvaluationCreateParamsAccountDetailsDataIdentity": ( + "stripe.params.v2.signals._account_evaluation_create_params", + False, + ), + "AccountEvaluationCreateParamsAccountDetailsDataIdentityBusinessDetails": ( + "stripe.params.v2.signals._account_evaluation_create_params", + False, + ), "AccountEvaluationRetrieveParams": ( "stripe.params.v2.signals._account_evaluation_retrieve_params", False, diff --git a/stripe/params/v2/signals/_account_activity_create_params.py b/stripe/params/v2/signals/_account_activity_create_params.py index b4021810c..25ad9709f 100644 --- a/stripe/params/v2/signals/_account_activity_create_params.py +++ b/stripe/params/v2/signals/_account_activity_create_params.py @@ -73,6 +73,12 @@ class AccountActivityCreateParamsAccountDetailsData(TypedDict): """ Default account settings. """ + identity: NotRequired[ + "AccountActivityCreateParamsAccountDetailsDataIdentity" + ] + """ + Identity data. + """ class AccountActivityCreateParamsAccountDetailsDataDefaults(TypedDict): @@ -97,6 +103,24 @@ class AccountActivityCreateParamsAccountDetailsDataDefaultsProfile(TypedDict): """ +class AccountActivityCreateParamsAccountDetailsDataIdentity(TypedDict): + business_details: ( + "AccountActivityCreateParamsAccountDetailsDataIdentityBusinessDetails" + ) + """ + Business details for identity data. + """ + + +class AccountActivityCreateParamsAccountDetailsDataIdentityBusinessDetails( + TypedDict, +): + registered_name: NotRequired[str] + """ + Registered business name. + """ + + class AccountActivityCreateParamsLoginAttempt(TypedDict): client_details: "AccountActivityCreateParamsLoginAttemptClientDetails" """ diff --git a/stripe/params/v2/signals/_account_evaluation_create_params.py b/stripe/params/v2/signals/_account_evaluation_create_params.py index 7277e1374..ba4533f93 100644 --- a/stripe/params/v2/signals/_account_evaluation_create_params.py +++ b/stripe/params/v2/signals/_account_evaluation_create_params.py @@ -16,7 +16,14 @@ class AccountEvaluationCreateParams(TypedDict): The account, customer, or inline account data to evaluate. """ requested_signals: List[ - Union[Literal["user_account_sharing", "user_multi_accounting"], str] + Union[ + Literal[ + "fraudulent_website", + "user_account_sharing", + "user_multi_accounting", + ], + str, + ] ] """ List of signals to evaluate. @@ -171,6 +178,12 @@ class AccountEvaluationCreateParamsAccountDetailsData(TypedDict): """ Default account settings. """ + identity: NotRequired[ + "AccountEvaluationCreateParamsAccountDetailsDataIdentity" + ] + """ + Identity data. + """ class AccountEvaluationCreateParamsAccountDetailsDataDefaults(TypedDict): @@ -195,3 +208,19 @@ class AccountEvaluationCreateParamsAccountDetailsDataDefaultsProfile( """ Description of the account's product or service. """ + + +class AccountEvaluationCreateParamsAccountDetailsDataIdentity(TypedDict): + business_details: "AccountEvaluationCreateParamsAccountDetailsDataIdentityBusinessDetails" + """ + Business details for identity data. + """ + + +class AccountEvaluationCreateParamsAccountDetailsDataIdentityBusinessDetails( + TypedDict, +): + registered_name: NotRequired[str] + """ + Registered business name. + """ diff --git a/stripe/params/v2/signals/_account_signal_list_params.py b/stripe/params/v2/signals/_account_signal_list_params.py index 67fe946ad..b43b8539f 100644 --- a/stripe/params/v2/signals/_account_signal_list_params.py +++ b/stripe/params/v2/signals/_account_signal_list_params.py @@ -15,7 +15,15 @@ class AccountSignalListParams(TypedDict): Maximum number of results to return per page. Defaults to 20. """ type: List[ - Union[Literal["user_account_sharing", "user_multi_accounting"], str] + Union[ + Literal[ + "fraudulent_merchant", + "fraudulent_website", + "user_account_sharing", + "user_multi_accounting", + ], + str, + ] ] """ Signal types to filter by. diff --git a/stripe/privacy/_redaction_job.py b/stripe/privacy/_redaction_job.py index c3804e7ef..61d18df91 100644 --- a/stripe/privacy/_redaction_job.py +++ b/stripe/privacy/_redaction_job.py @@ -142,7 +142,7 @@ class Objects(StripeObject): @classmethod def _cls_cancel( - cls, job: str, **params: Unpack["RedactionJobCancelParams"] + cls, job: str, /, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ You can cancel a redaction job when it's in one of these statuses: ready, failed. @@ -163,7 +163,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - job: str, **params: Unpack["RedactionJobCancelParams"] + job: str, /, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ You can cancel a redaction job when it's in one of these statuses: ready, failed. @@ -184,7 +184,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ @@ -205,7 +205,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, job: str, **params: Unpack["RedactionJobCancelParams"] + cls, job: str, /, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ You can cancel a redaction job when it's in one of these statuses: ready, failed. @@ -226,7 +226,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - job: str, **params: Unpack["RedactionJobCancelParams"] + job: str, /, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ You can cancel a redaction job when it's in one of these statuses: ready, failed. @@ -247,7 +247,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["RedactionJobCancelParams"] ) -> "RedactionJob": """ @@ -340,7 +340,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["RedactionJobModifyParams"] + cls, id: str, /, **params: Unpack["RedactionJobModifyParams"] ) -> "RedactionJob": """ Updates the properties of a redaction job without running or canceling the job. @@ -359,7 +359,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["RedactionJobModifyParams"] + cls, id: str, /, **params: Unpack["RedactionJobModifyParams"] ) -> "RedactionJob": """ Updates the properties of a redaction job without running or canceling the job. @@ -400,7 +400,7 @@ async def retrieve_async( @classmethod def _cls_run( - cls, job: str, **params: Unpack["RedactionJobRunParams"] + cls, job: str, /, **params: Unpack["RedactionJobRunParams"] ) -> "RedactionJob": """ Run a redaction job in a ready status. @@ -423,7 +423,7 @@ def _cls_run( @overload @staticmethod def run( - job: str, **params: Unpack["RedactionJobRunParams"] + job: str, /, **params: Unpack["RedactionJobRunParams"] ) -> "RedactionJob": """ Run a redaction job in a ready status. @@ -446,9 +446,7 @@ def run(self, **params: Unpack["RedactionJobRunParams"]) -> "RedactionJob": ... @class_method_variant("_cls_run") - def run( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["RedactionJobRunParams"] - ) -> "RedactionJob": + def run(self, **params: Unpack["RedactionJobRunParams"]) -> "RedactionJob": """ Run a redaction job in a ready status. @@ -469,7 +467,7 @@ def run( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_run_async( - cls, job: str, **params: Unpack["RedactionJobRunParams"] + cls, job: str, /, **params: Unpack["RedactionJobRunParams"] ) -> "RedactionJob": """ Run a redaction job in a ready status. @@ -492,7 +490,7 @@ async def _cls_run_async( @overload @staticmethod async def run_async( - job: str, **params: Unpack["RedactionJobRunParams"] + job: str, /, **params: Unpack["RedactionJobRunParams"] ) -> "RedactionJob": """ Run a redaction job in a ready status. @@ -517,7 +515,7 @@ async def run_async( ... @class_method_variant("_cls_run_async") - async def run_async( # pyright: ignore[reportGeneralTypeIssues] + async def run_async( self, **params: Unpack["RedactionJobRunParams"] ) -> "RedactionJob": """ @@ -540,7 +538,7 @@ async def run_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_validate( - cls, job: str, **params: Unpack["RedactionJobValidateParams"] + cls, job: str, /, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ Validate a redaction job when it is in a failed status. @@ -563,7 +561,7 @@ def _cls_validate( @overload @staticmethod def validate( - job: str, **params: Unpack["RedactionJobValidateParams"] + job: str, /, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ Validate a redaction job when it is in a failed status. @@ -588,7 +586,7 @@ def validate( ... @class_method_variant("_cls_validate") - def validate( # pyright: ignore[reportGeneralTypeIssues] + def validate( self, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ @@ -611,7 +609,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_validate_async( - cls, job: str, **params: Unpack["RedactionJobValidateParams"] + cls, job: str, /, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ Validate a redaction job when it is in a failed status. @@ -634,7 +632,7 @@ async def _cls_validate_async( @overload @staticmethod async def validate_async( - job: str, **params: Unpack["RedactionJobValidateParams"] + job: str, /, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ Validate a redaction job when it is in a failed status. @@ -659,7 +657,7 @@ async def validate_async( ... @class_method_variant("_cls_validate_async") - async def validate_async( # pyright: ignore[reportGeneralTypeIssues] + async def validate_async( self, **params: Unpack["RedactionJobValidateParams"] ) -> "RedactionJob": """ @@ -684,6 +682,7 @@ async def validate_async( # pyright: ignore[reportGeneralTypeIssues] def list_validation_errors( cls, job: str, + /, **params: Unpack["RedactionJobListValidationErrorsParams"], ) -> ListObject["RedactionJobValidationError"]: """ @@ -704,6 +703,7 @@ def list_validation_errors( async def list_validation_errors_async( cls, job: str, + /, **params: Unpack["RedactionJobListValidationErrorsParams"], ) -> ListObject["RedactionJobValidationError"]: """ diff --git a/stripe/privacy/_redaction_job_service.py b/stripe/privacy/_redaction_job_service.py index 561037fc0..b788a3759 100644 --- a/stripe/privacy/_redaction_job_service.py +++ b/stripe/privacy/_redaction_job_service.py @@ -144,6 +144,7 @@ async def create_async( def retrieve( self, job: str, + /, params: Optional["RedactionJobRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -166,6 +167,7 @@ def retrieve( async def retrieve_async( self, job: str, + /, params: Optional["RedactionJobRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -188,6 +190,7 @@ async def retrieve_async( def update( self, job: str, + /, params: Optional["RedactionJobUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -212,6 +215,7 @@ def update( async def update_async( self, job: str, + /, params: Optional["RedactionJobUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -236,6 +240,7 @@ async def update_async( def cancel( self, job: str, + /, params: Optional["RedactionJobCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -260,6 +265,7 @@ def cancel( async def cancel_async( self, job: str, + /, params: Optional["RedactionJobCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -284,6 +290,7 @@ async def cancel_async( def run( self, job: str, + /, params: Optional["RedactionJobRunParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -310,6 +317,7 @@ def run( async def run_async( self, job: str, + /, params: Optional["RedactionJobRunParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -336,6 +344,7 @@ async def run_async( def validate( self, job: str, + /, params: Optional["RedactionJobValidateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": @@ -362,6 +371,7 @@ def validate( async def validate_async( self, job: str, + /, params: Optional["RedactionJobValidateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "RedactionJob": diff --git a/stripe/privacy/_redaction_job_validation_error_service.py b/stripe/privacy/_redaction_job_validation_error_service.py index 1914542cb..23fe66069 100644 --- a/stripe/privacy/_redaction_job_validation_error_service.py +++ b/stripe/privacy/_redaction_job_validation_error_service.py @@ -20,6 +20,7 @@ class RedactionJobValidationErrorService(StripeService): def list( self, job: str, + /, params: Optional["RedactionJobValidationErrorListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[RedactionJobValidationError]": @@ -42,6 +43,7 @@ def list( async def list_async( self, job: str, + /, params: Optional["RedactionJobValidationErrorListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[RedactionJobValidationError]": diff --git a/stripe/product_catalog/_trial_offer.py b/stripe/product_catalog/_trial_offer.py index d9e9fcf3e..af07b56d1 100644 --- a/stripe/product_catalog/_trial_offer.py +++ b/stripe/product_catalog/_trial_offer.py @@ -5,6 +5,8 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import sanitize_id from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING @@ -16,6 +18,9 @@ from stripe.params.product_catalog._trial_offer_list_params import ( TrialOfferListParams, ) + from stripe.params.product_catalog._trial_offer_modify_params import ( + TrialOfferModifyParams, + ) from stripe.params.product_catalog._trial_offer_retrieve_params import ( TrialOfferRetrieveParams, ) @@ -24,12 +29,13 @@ class TrialOffer( CreateableAPIResource["TrialOffer"], ListableAPIResource["TrialOffer"], + UpdateableAPIResource["TrialOffer"], ): """ Trial offers let you define free or paid introductory pricing for a subscription item. - A TrialOffer specifies the price to charge during the trial, how long the trial lasts - (a fixed end timestamp or a number of billing intervals), and what price the subscription - item transitions to when the trial ends. You attach a TrialOffer to a subscription item + A TrialOffer specifies the price to charge during the trial, how many billing intervals + the trial lasts, and what price the subscription item transitions to when the trial ends. + You attach a TrialOffer to a subscription item using `items[current_trial][trial_offer]` when creating or updating a subscription. """ @@ -58,13 +64,17 @@ class Transition(StripeObject): The new price to use at the end of the trial offer period. """ - transition: Transition - type: Literal["transition"] + transition: Optional[Transition] + type: Union[Literal["transition"], str] """ The type of behavior when the trial offer ends. """ _inner_class_types = {"transition": Transition} + active: bool + """ + Whether the trial offer is active. Set to false to archive the trial offer. + """ duration: Duration end_behavior: EndBehavior id: str @@ -75,9 +85,9 @@ class Transition(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ - name: Optional[str] + nickname: Optional[str] """ - A brief, user-friendly name for the trial offer-for identification purposes. + A brief description of the trial offer, hidden from customers. """ object: Literal["product_catalog.trial_offer"] """ @@ -160,6 +170,40 @@ async def list_async( return result + @classmethod + def modify( + cls, id: str, /, **params: Unpack["TrialOfferModifyParams"] + ) -> "TrialOffer": + """ + Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "TrialOffer", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, /, **params: Unpack["TrialOfferModifyParams"] + ) -> "TrialOffer": + """ + Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "TrialOffer", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + @classmethod def retrieve( cls, id: str, **params: Unpack["TrialOfferRetrieveParams"] diff --git a/stripe/product_catalog/_trial_offer_service.py b/stripe/product_catalog/_trial_offer_service.py index 825d14c1b..448e9205e 100644 --- a/stripe/product_catalog/_trial_offer_service.py +++ b/stripe/product_catalog/_trial_offer_service.py @@ -17,6 +17,9 @@ from stripe.params.product_catalog._trial_offer_retrieve_params import ( TrialOfferRetrieveParams, ) + from stripe.params.product_catalog._trial_offer_update_params import ( + TrialOfferUpdateParams, + ) from stripe.product_catalog._trial_offer import TrialOffer @@ -100,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["TrialOfferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TrialOffer": @@ -122,6 +126,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TrialOfferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TrialOffer": @@ -140,3 +145,49 @@ async def retrieve_async( options=options, ), ) + + def update( + self, + id: str, + /, + params: Optional["TrialOfferUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "TrialOffer": + """ + Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + return cast( + "TrialOffer", + self._request( + "post", + "/v1/product_catalog/trial_offers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + /, + params: Optional["TrialOfferUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "TrialOffer": + """ + Updates the specified trial offer by setting the values of the parameters passed. Any parameters not provided are left unchanged. + """ + return cast( + "TrialOffer", + await self._request_async( + "post", + "/v1/product_catalog/trial_offers/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/__init__.py b/stripe/radar/__init__.py index 211d3988b..316badd90 100644 --- a/stripe/radar/__init__.py +++ b/stripe/radar/__init__.py @@ -4,6 +4,12 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.radar._billing_evaluation import ( + BillingEvaluation as BillingEvaluation, + ) + from stripe.radar._billing_evaluation_service import ( + BillingEvaluationService as BillingEvaluationService, + ) from stripe.radar._early_fraud_warning import ( EarlyFraudWarning as EarlyFraudWarning, ) @@ -27,6 +33,11 @@ # name -> (import_target, is_submodule) _import_map = { + "BillingEvaluation": ("stripe.radar._billing_evaluation", False), + "BillingEvaluationService": ( + "stripe.radar._billing_evaluation_service", + False, + ), "EarlyFraudWarning": ("stripe.radar._early_fraud_warning", False), "EarlyFraudWarningService": ( "stripe.radar._early_fraud_warning_service", diff --git a/stripe/radar/_billing_evaluation.py b/stripe/radar/_billing_evaluation.py new file mode 100644 index 000000000..0d646ab7f --- /dev/null +++ b/stripe/radar/_billing_evaluation.py @@ -0,0 +1,324 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, Optional, Union, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams, + ) + + +class BillingEvaluation(CreateableAPIResource["BillingEvaluation"]): + """ + Billing Evaluations represent Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge. Unlike a [Payment Evaluation](https://docs.stripe.com/api/radar/payment-evaluation), a billing evaluation is created before the payment is attempted and returns the `non_payment_abuse` signal only. + """ + + OBJECT_NAME: ClassVar[Literal["radar.billing_evaluation"]] = ( + "radar.billing_evaluation" + ) + + class ClientDeviceMetadataDetails(StripeObject): + radar_session: Optional[str] + """ + ID for the Radar Session associated with the billing evaluation. A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CustomerDetails(StripeObject): + class Data(StripeObject): + email: Optional[str] + """ + The customer's email address. + """ + name: Optional[str] + """ + The customer's full name or business name. + """ + phone: Optional[str] + """ + The customer's phone number. + """ + + customer: Optional[str] + """ + The ID of the customer whose upcoming payment was evaluated. + """ + customer_account: Optional[str] + """ + The ID of the Account representing the customer whose upcoming payment was evaluated. + """ + data: Optional[Data] + """ + Attributes of the customer being evaluated, as supplied on the request. Null when the customer was identified by `customer` or `customer_account`. + """ + _inner_class_types = {"data": Data} + + class PaymentDetails(StripeObject): + class MoneyMovementDetails(StripeObject): + class Card(StripeObject): + customer_presence: Optional[ + Union[Literal["off_session", "on_session"], str] + ] + """ + Describes the presence of the customer during the payment. + """ + payment_type: Optional[ + Union[ + Literal[ + "one_off", + "recurring", + "setup_one_off", + "setup_recurring", + ], + str, + ] + ] + """ + Describes the type of payment. + """ + + card: Optional[Card] + """ + Describes card money movement details. + """ + money_movement_type: Union[Literal["card"], str] + """ + Describes the type of money movement. Currently only `card` is supported. + """ + _inner_class_types = {"card": Card} + + class PaymentMethodDetails(StripeObject): + class BillingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + address: Address + """ + Address data. + """ + email: Optional[str] + """ + Email address. + """ + name: Optional[str] + """ + Full name. + """ + phone: Optional[str] + """ + Billing phone number (including extension). + """ + _inner_class_types = {"address": Address} + + billing_details: Optional[BillingDetails] + """ + Billing information associated with the billing evaluation. + """ + payment_method: Optional[str] + """ + The payment method that will be charged. + """ + _inner_class_types = {"billing_details": BillingDetails} + + class ShippingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + address: Address + """ + Address data. + """ + name: Optional[str] + """ + Shipping name. + """ + phone: Optional[str] + """ + Shipping phone number. + """ + _inner_class_types = {"address": Address} + + amount: int + """ + Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + 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). + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + money_movement_details: Optional[MoneyMovementDetails] + """ + Details about the payment's customer presence and type. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Details about the payment method that will be charged. + """ + shipping_details: Optional[ShippingDetails] + """ + Shipping details for the billing evaluation. + """ + statement_descriptor: Optional[str] + """ + Payment statement descriptor. + """ + _inner_class_types = { + "money_movement_details": MoneyMovementDetails, + "payment_method_details": PaymentMethodDetails, + "shipping_details": ShippingDetails, + } + + class Signals(StripeObject): + class NonPaymentAbuse(StripeObject): + evaluated_at: int + """ + The time when this signal was evaluated. + """ + risk_level: Union[ + Literal[ + "elevated", + "highest", + "low", + "normal", + "not_assessed", + "unknown", + ], + str, + ] + """ + Risk level. + """ + + non_payment_abuse: Optional[NonPaymentAbuse] + """ + Stripe Radar's assessment of the likelihood that the upcoming charge results in non-payment abuse. + """ + _inner_class_types = {"non_payment_abuse": NonPaymentAbuse} + + client_device_metadata_details: Optional[ClientDeviceMetadataDetails] + """ + Client device metadata attached to this billing evaluation. + """ + created_at: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer_details: Optional[CustomerDetails] + """ + Details of the customer this billing evaluation assesses. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["radar.billing_evaluation"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_details: Optional[PaymentDetails] + """ + Payment details for the upcoming charge this billing evaluation assesses. + """ + signals: Signals + """ + Stripe Radar's signals for the upcoming charge this billing evaluation assesses. + """ + + @classmethod + def create( + cls, **params: Unpack["BillingEvaluationCreateParams"] + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["BillingEvaluationCreateParams"] + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + _inner_class_types = { + "client_device_metadata_details": ClientDeviceMetadataDetails, + "customer_details": CustomerDetails, + "payment_details": PaymentDetails, + "signals": Signals, + } diff --git a/stripe/radar/_billing_evaluation_service.py b/stripe/radar/_billing_evaluation_service.py new file mode 100644 index 000000000..df8501c06 --- /dev/null +++ b/stripe/radar/_billing_evaluation_service.py @@ -0,0 +1,52 @@ +# -*- 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.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams, + ) + from stripe.radar._billing_evaluation import BillingEvaluation + + +class BillingEvaluationService(StripeService): + def create( + self, + params: "BillingEvaluationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + self._request( + "post", + "/v1/radar/billing_evaluations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "BillingEvaluationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + await self._request_async( + "post", + "/v1/radar/billing_evaluations", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_early_fraud_warning_service.py b/stripe/radar/_early_fraud_warning_service.py index b5f909c04..6e97dbb48 100644 --- a/stripe/radar/_early_fraud_warning_service.py +++ b/stripe/radar/_early_fraud_warning_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, early_fraud_warning: str, + /, params: Optional["EarlyFraudWarningRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EarlyFraudWarning": @@ -83,6 +84,7 @@ def retrieve( async def retrieve_async( self, early_fraud_warning: str, + /, params: Optional["EarlyFraudWarningRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EarlyFraudWarning": diff --git a/stripe/radar/_payment_evaluation.py b/stripe/radar/_payment_evaluation.py index cf63c25a0..6e0ea1ea9 100644 --- a/stripe/radar/_payment_evaluation.py +++ b/stripe/radar/_payment_evaluation.py @@ -298,7 +298,14 @@ class Card(StripeObject): Details of a succeeded outcome attached to this payment evaluation. """ type: Union[ - Literal["failed", "merchant_blocked", "rejected", "succeeded"], str + Literal[ + "failed", + "merchant_blocked", + "rejected", + "rerouted", + "succeeded", + ], + str, ] """ Indicates the outcome of the payment evaluation. @@ -335,11 +342,11 @@ class Card(StripeObject): card: Optional[Card] """ - Describes card money movement details for the payment evaluation. + Describes card money movement details. """ money_movement_type: Literal["card"] """ - Describes the type of money movement. Currently only `card` is supported. + Describes the type of money movement. """ _inner_class_types = {"card": Card} @@ -475,6 +482,54 @@ class Address(StripeObject): } class Signals(StripeObject): + class EarlyFraudWarning(StripeObject): + evaluated_at: int + """ + The time when this signal was evaluated. + """ + risk_level: Union[ + Literal[ + "elevated", + "highest", + "low", + "normal", + "not_assessed", + "unknown", + ], + str, + ] + """ + Risk level of this signal, based on the score. + """ + score: Optional[float] + """ + Numeric score for this signal, returned with two decimal places. Possible values for evaluated payments are between 0 and 100, where higher scores indicate a higher likelihood of the signal being true. + """ + + class FraudulentDispute(StripeObject): + evaluated_at: int + """ + The time when this signal was evaluated. + """ + risk_level: Union[ + Literal[ + "elevated", + "highest", + "low", + "normal", + "not_assessed", + "unknown", + ], + str, + ] + """ + Risk level of this signal, based on the score. + """ + score: Optional[float] + """ + Numeric score for this signal, returned with two decimal places. Possible values for evaluated payments are between 0 and 100, where higher scores indicate a higher likelihood of the signal being true. + """ + class FraudulentPayment(StripeObject): evaluated_at: int """ @@ -494,16 +549,28 @@ class FraudulentPayment(StripeObject): """ Risk level of this signal, based on the score. """ - score: float + score: Optional[float] """ - Score for this signal. Possible values for evaluated payments are between 0 and 100. The value is returned with two decimal places and higher scores indicate a higher likelihood of the signal being true. A score of -1 is returned when a model evaluation was not performed, such as requests from incomplete integrations. + Numeric score for this signal, returned with two decimal places. Possible values for evaluated payments are between 0 and 100, where higher scores indicate a higher likelihood of the signal being true. """ + early_fraud_warning: Optional[EarlyFraudWarning] + """ + The likelihood that this `PaymentEvaluation` results in an early fraud warning. + """ + fraudulent_dispute: Optional[FraudulentDispute] + """ + The likelihood that this `PaymentEvaluation` results in a dispute with reason code `fraudulent`. + """ fraudulent_payment: FraudulentPayment """ A payment evaluation signal with evaluated_at, risk_level, and score fields. """ - _inner_class_types = {"fraudulent_payment": FraudulentPayment} + _inner_class_types = { + "early_fraud_warning": EarlyFraudWarning, + "fraudulent_dispute": FraudulentDispute, + "fraudulent_payment": FraudulentPayment, + } client_device_metadata_details: Optional[ClientDeviceMetadataDetails] """ diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 956947e0f..0926f50a3 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -133,7 +133,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ValueListDeleteParams"] + cls, sid: str, /, **params: Unpack["ValueListDeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. @@ -151,7 +151,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["ValueListDeleteParams"] + sid: str, /, **params: Unpack["ValueListDeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. @@ -166,9 +166,7 @@ def delete(self, **params: Unpack["ValueListDeleteParams"]) -> "ValueList": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["ValueListDeleteParams"] - ) -> "ValueList": + def delete(self, **params: Unpack["ValueListDeleteParams"]) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ @@ -180,7 +178,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ValueListDeleteParams"] + cls, sid: str, /, **params: Unpack["ValueListDeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. @@ -198,7 +196,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ValueListDeleteParams"] + sid: str, /, **params: Unpack["ValueListDeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. @@ -215,7 +213,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ValueListDeleteParams"] ) -> "ValueList": """ @@ -269,7 +267,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ValueListModifyParams"] + cls, id: str, /, **params: Unpack["ValueListModifyParams"] ) -> "ValueList": """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. @@ -286,7 +284,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ValueListModifyParams"] + cls, id: str, /, **params: Unpack["ValueListModifyParams"] ) -> "ValueList": """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index 6426d7119..8785b1f0e 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -116,7 +116,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ValueListItemDeleteParams"] + cls, sid: str, /, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. @@ -134,7 +134,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["ValueListItemDeleteParams"] + sid: str, /, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. @@ -151,7 +151,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ @@ -165,7 +165,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ValueListItemDeleteParams"] + cls, sid: str, /, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. @@ -183,7 +183,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ValueListItemDeleteParams"] + sid: str, /, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. @@ -200,7 +200,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ValueListItemDeleteParams"] ) -> "ValueListItem": """ diff --git a/stripe/radar/_value_list_item_service.py b/stripe/radar/_value_list_item_service.py index 306372726..4f79962d3 100644 --- a/stripe/radar/_value_list_item_service.py +++ b/stripe/radar/_value_list_item_service.py @@ -27,6 +27,7 @@ class ValueListItemService(StripeService): def delete( self, item: str, + /, params: Optional["ValueListItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueListItem": @@ -49,6 +50,7 @@ def delete( async def delete_async( self, item: str, + /, params: Optional["ValueListItemDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueListItem": @@ -71,6 +73,7 @@ async def delete_async( def retrieve( self, item: str, + /, params: Optional["ValueListItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueListItem": @@ -93,6 +96,7 @@ def retrieve( async def retrieve_async( self, item: str, + /, params: Optional["ValueListItemRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueListItem": diff --git a/stripe/radar/_value_list_service.py b/stripe/radar/_value_list_service.py index 637cb2cad..57b48cf56 100644 --- a/stripe/radar/_value_list_service.py +++ b/stripe/radar/_value_list_service.py @@ -28,6 +28,7 @@ class ValueListService(StripeService): def delete( self, value_list: str, + /, params: Optional["ValueListDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": @@ -50,6 +51,7 @@ def delete( async def delete_async( self, value_list: str, + /, params: Optional["ValueListDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": @@ -72,6 +74,7 @@ async def delete_async( def retrieve( self, value_list: str, + /, params: Optional["ValueListRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": @@ -94,6 +97,7 @@ def retrieve( async def retrieve_async( self, value_list: str, + /, params: Optional["ValueListRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": @@ -116,6 +120,7 @@ async def retrieve_async( def update( self, value_list: str, + /, params: Optional["ValueListUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": @@ -138,6 +143,7 @@ def update( async def update_async( self, value_list: str, + /, params: Optional["ValueListUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ValueList": diff --git a/stripe/reporting/_report_run_service.py b/stripe/reporting/_report_run_service.py index 40ab869b4..c16b8ee78 100644 --- a/stripe/reporting/_report_run_service.py +++ b/stripe/reporting/_report_run_service.py @@ -100,6 +100,7 @@ async def create_async( def retrieve( self, report_run: str, + /, params: Optional["ReportRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReportRun": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, report_run: str, + /, params: Optional["ReportRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReportRun": diff --git a/stripe/reporting/_report_type_service.py b/stripe/reporting/_report_type_service.py index d3d93e13f..fc1f71717 100644 --- a/stripe/reporting/_report_type_service.py +++ b/stripe/reporting/_report_type_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, report_type: str, + /, params: Optional["ReportTypeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReportType": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, report_type: str, + /, params: Optional["ReportTypeRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReportType": diff --git a/stripe/reserve/_hold.py b/stripe/reserve/_hold.py index d8ca77852..878db9dbf 100644 --- a/stripe/reserve/_hold.py +++ b/stripe/reserve/_hold.py @@ -61,6 +61,10 @@ class ReleaseSchedule(StripeObject): """ 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). """ + destination: Literal["other", "risk_reserved", "settlement_reserved"] + """ + The balance destination to which the reserved funds are sent. + """ id: str """ Unique identifier for the object. diff --git a/stripe/reserve/_hold_service.py b/stripe/reserve/_hold_service.py index 16de9bc3e..552d912b0 100644 --- a/stripe/reserve/_hold_service.py +++ b/stripe/reserve/_hold_service.py @@ -55,6 +55,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["HoldRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Hold": @@ -75,6 +76,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["HoldRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Hold": diff --git a/stripe/reserve/_plan.py b/stripe/reserve/_plan.py index 3314d5cf6..25f54030d 100644 --- a/stripe/reserve/_plan.py +++ b/stripe/reserve/_plan.py @@ -1,15 +1,17 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._api_resource import APIResource +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject from typing import ClassVar, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: + from stripe.params.reserve._plan_list_params import PlanListParams from stripe.params.reserve._plan_retrieve_params import PlanRetrieveParams -class Plan(APIResource["Plan"]): +class Plan(ListableAPIResource["Plan"]): """ ReservePlans are used to automatically place holds on a merchant's funds until the plan expires. It takes a portion of each incoming Charge (including those resulting from a Transfer from a platform account). """ @@ -26,6 +28,9 @@ class FixedRelease(StripeObject): The time at which reserved funds are scheduled for release, automatically set to midnight UTC of the day after `release_after`. """ + class ManualRelease(StripeObject): + pass + class RollingRelease(StripeObject): days_after_charge: int """ @@ -48,6 +53,10 @@ class RollingRelease(StripeObject): """ 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). An unset currency indicates that the plan applies to all currencies. """ + destination: Literal["other", "risk_reserved", "settlement_reserved"] + """ + The balance destination to which the reserved funds are sent. + """ disabled_at: Optional[int] """ Time at which the ReservePlan was disabled. @@ -61,6 +70,7 @@ class RollingRelease(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ + manual_release: Optional[ManualRelease] metadata: Optional[UntypedStripeObject[str]] """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -74,15 +84,55 @@ class RollingRelease(StripeObject): The percent of each Charge to reserve. """ rolling_release: Optional[RollingRelease] - status: Union[Literal["active", "disabled", "expired"], str] + status: Literal["active", "disabled", "expired", "other"] """ The current status of the ReservePlan. The ReservePlan only affects charges if it is `active`. """ - type: Union[Literal["fixed_release", "rolling_release"], str] + type: Literal[ + "fixed_release", "manual_release", "other", "rolling_release" + ] """ The type of the ReservePlan. """ + @classmethod + def list(cls, **params: Unpack["PlanListParams"]) -> ListObject["Plan"]: + """ + Returns a list of ReservePlans previously created. The ReservePlans are returned in sorted order, with the most recent ReservePlans appearing first. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["PlanListParams"] + ) -> ListObject["Plan"]: + """ + Returns a list of ReservePlans previously created. The ReservePlans are returned in sorted order, with the most recent ReservePlans appearing first. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def retrieve( cls, id: str, **params: Unpack["PlanRetrieveParams"] @@ -107,5 +157,6 @@ async def retrieve_async( _inner_class_types = { "fixed_release": FixedRelease, + "manual_release": ManualRelease, "rolling_release": RollingRelease, } diff --git a/stripe/reserve/_plan_service.py b/stripe/reserve/_plan_service.py index c33d93a51..c987e6507 100644 --- a/stripe/reserve/_plan_service.py +++ b/stripe/reserve/_plan_service.py @@ -6,15 +6,56 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe._list_object import ListObject from stripe._request_options import RequestOptions + from stripe.params.reserve._plan_list_params import PlanListParams from stripe.params.reserve._plan_retrieve_params import PlanRetrieveParams from stripe.reserve._plan import Plan class PlanService(StripeService): + def list( + self, + params: Optional["PlanListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Plan]": + """ + Returns a list of ReservePlans previously created. The ReservePlans are returned in sorted order, with the most recent ReservePlans appearing first. + """ + return cast( + "ListObject[Plan]", + self._request( + "get", + "/v1/reserve/plans", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["PlanListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Plan]": + """ + Returns a list of ReservePlans previously created. The ReservePlans are returned in sorted order, with the most recent ReservePlans appearing first. + """ + return cast( + "ListObject[Plan]", + await self._request_async( + "get", + "/v1/reserve/plans", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, + /, params: Optional["PlanRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": @@ -35,6 +76,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["PlanRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Plan": diff --git a/stripe/reserve/_release.py b/stripe/reserve/_release.py index e7fdc2626..222f02ed9 100644 --- a/stripe/reserve/_release.py +++ b/stripe/reserve/_release.py @@ -55,6 +55,10 @@ class SourceTransaction(StripeObject): """ 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). """ + destination: Literal["other", "payments"] + """ + The balance destination to which the released funds are sent. + """ id: str """ Unique identifier for the object. @@ -73,7 +77,7 @@ class SourceTransaction(StripeObject): """ reason: Union[ Literal[ - "bulk_hold_expiry", + "hold_expired", "hold_released_early", "hold_reversed", "plan_disabled", diff --git a/stripe/reserve/_release_service.py b/stripe/reserve/_release_service.py index 20f8a9c0f..f453e927c 100644 --- a/stripe/reserve/_release_service.py +++ b/stripe/reserve/_release_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ReleaseRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Release": @@ -77,6 +78,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ReleaseRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Release": diff --git a/stripe/shared_payment/_granted_token.py b/stripe/shared_payment/_granted_token.py index 213cb184b..521194b2f 100644 --- a/stripe/shared_payment/_granted_token.py +++ b/stripe/shared_payment/_granted_token.py @@ -657,6 +657,7 @@ async def create_async( def _cls_revoke( cls, shared_payment_granted_token: str, + /, **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ @@ -679,6 +680,7 @@ def _cls_revoke( @staticmethod def revoke( shared_payment_granted_token: str, + /, **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ @@ -696,7 +698,7 @@ def revoke( ... @class_method_variant("_cls_revoke") - def revoke( # pyright: ignore[reportGeneralTypeIssues] + def revoke( self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ @@ -719,6 +721,7 @@ def revoke( # pyright: ignore[reportGeneralTypeIssues] async def _cls_revoke_async( cls, shared_payment_granted_token: str, + /, **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ @@ -741,6 +744,7 @@ async def _cls_revoke_async( @staticmethod async def revoke_async( shared_payment_granted_token: str, + /, **params: Unpack["GrantedTokenRevokeParams"], ) -> "GrantedToken": """ @@ -758,7 +762,7 @@ async def revoke_async( ... @class_method_variant("_cls_revoke_async") - async def revoke_async( # pyright: ignore[reportGeneralTypeIssues] + async def revoke_async( self, **params: Unpack["GrantedTokenRevokeParams"] ) -> "GrantedToken": """ diff --git a/stripe/shared_payment/_granted_token_service.py b/stripe/shared_payment/_granted_token_service.py index 686c89bc7..acbdffca1 100644 --- a/stripe/shared_payment/_granted_token_service.py +++ b/stripe/shared_payment/_granted_token_service.py @@ -17,6 +17,7 @@ class GrantedTokenService(StripeService): def retrieve( self, shared_payment_granted_token: str, + /, params: Optional["GrantedTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": @@ -41,6 +42,7 @@ def retrieve( async def retrieve_async( self, shared_payment_granted_token: str, + /, params: Optional["GrantedTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": diff --git a/stripe/shared_payment/_issued_token.py b/stripe/shared_payment/_issued_token.py index aaa4b1914..d6ea497b6 100644 --- a/stripe/shared_payment/_issued_token.py +++ b/stripe/shared_payment/_issued_token.py @@ -319,6 +319,7 @@ async def retrieve_async( def _cls_revoke( cls, shared_payment_issued_token: str, + /, **params: Unpack["IssuedTokenRevokeParams"], ) -> "IssuedToken": """ @@ -341,6 +342,7 @@ def _cls_revoke( @staticmethod def revoke( shared_payment_issued_token: str, + /, **params: Unpack["IssuedTokenRevokeParams"], ) -> "IssuedToken": """ @@ -358,7 +360,7 @@ def revoke( ... @class_method_variant("_cls_revoke") - def revoke( # pyright: ignore[reportGeneralTypeIssues] + def revoke( self, **params: Unpack["IssuedTokenRevokeParams"] ) -> "IssuedToken": """ @@ -381,6 +383,7 @@ def revoke( # pyright: ignore[reportGeneralTypeIssues] async def _cls_revoke_async( cls, shared_payment_issued_token: str, + /, **params: Unpack["IssuedTokenRevokeParams"], ) -> "IssuedToken": """ @@ -403,6 +406,7 @@ async def _cls_revoke_async( @staticmethod async def revoke_async( shared_payment_issued_token: str, + /, **params: Unpack["IssuedTokenRevokeParams"], ) -> "IssuedToken": """ @@ -420,7 +424,7 @@ async def revoke_async( ... @class_method_variant("_cls_revoke_async") - async def revoke_async( # pyright: ignore[reportGeneralTypeIssues] + async def revoke_async( self, **params: Unpack["IssuedTokenRevokeParams"] ) -> "IssuedToken": """ diff --git a/stripe/shared_payment/_issued_token_service.py b/stripe/shared_payment/_issued_token_service.py index 53d847f40..5827511ef 100644 --- a/stripe/shared_payment/_issued_token_service.py +++ b/stripe/shared_payment/_issued_token_service.py @@ -23,6 +23,7 @@ class IssuedTokenService(StripeService): def retrieve( self, shared_payment_issued_token: str, + /, params: Optional["IssuedTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "IssuedToken": @@ -47,6 +48,7 @@ def retrieve( async def retrieve_async( self, shared_payment_issued_token: str, + /, params: Optional["IssuedTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "IssuedToken": @@ -109,6 +111,7 @@ async def create_async( def revoke( self, shared_payment_issued_token: str, + /, params: Optional["IssuedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "IssuedToken": @@ -133,6 +136,7 @@ def revoke( async def revoke_async( self, shared_payment_issued_token: str, + /, params: Optional["IssuedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "IssuedToken": diff --git a/stripe/sigma/_scheduled_query_run.py b/stripe/sigma/_scheduled_query_run.py index 00e1460bd..06a874876 100644 --- a/stripe/sigma/_scheduled_query_run.py +++ b/stripe/sigma/_scheduled_query_run.py @@ -121,7 +121,7 @@ def retrieve( cls, id: str, **params: Unpack["ScheduledQueryRunRetrieveParams"] ) -> "ScheduledQueryRun": """ - Retrieves the details of an scheduled query run. + Retrieves the details of a scheduled query run. """ instance = cls(id, **params) instance.refresh() @@ -132,7 +132,7 @@ async def retrieve_async( cls, id: str, **params: Unpack["ScheduledQueryRunRetrieveParams"] ) -> "ScheduledQueryRun": """ - Retrieves the details of an scheduled query run. + Retrieves the details of a scheduled query run. """ instance = cls(id, **params) await instance.refresh_async() diff --git a/stripe/sigma/_scheduled_query_run_service.py b/stripe/sigma/_scheduled_query_run_service.py index 33d81725e..4a75f9190 100644 --- a/stripe/sigma/_scheduled_query_run_service.py +++ b/stripe/sigma/_scheduled_query_run_service.py @@ -59,11 +59,12 @@ async def list_async( def retrieve( self, scheduled_query_run: str, + /, params: Optional["ScheduledQueryRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ScheduledQueryRun": """ - Retrieves the details of an scheduled query run. + Retrieves the details of a scheduled query run. """ return cast( "ScheduledQueryRun", @@ -81,11 +82,12 @@ def retrieve( async def retrieve_async( self, scheduled_query_run: str, + /, params: Optional["ScheduledQueryRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ScheduledQueryRun": """ - Retrieves the details of an scheduled query run. + Retrieves the details of a scheduled query run. """ return cast( "ScheduledQueryRun", diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 418f35b5c..3ae2e6d53 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -280,6 +280,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -293,12 +294,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, @@ -421,6 +424,7 @@ class FlatAmount(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -434,12 +438,14 @@ class FlatAmount(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, @@ -582,6 +588,7 @@ async def create_async( def _cls_list_line_items( cls, calculation: str, + /, **params: Unpack["CalculationListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ @@ -601,7 +608,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - calculation: str, **params: Unpack["CalculationListLineItemsParams"] + calculation: str, /, **params: Unpack["CalculationListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. @@ -618,7 +625,7 @@ def list_line_items( ... @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_line_items( self, **params: Unpack["CalculationListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ @@ -639,6 +646,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, calculation: str, + /, **params: Unpack["CalculationListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ @@ -658,7 +666,7 @@ async def _cls_list_line_items_async( @overload @staticmethod async def list_line_items_async( - calculation: str, **params: Unpack["CalculationListLineItemsParams"] + calculation: str, /, **params: Unpack["CalculationListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. @@ -675,7 +683,7 @@ async def list_line_items_async( ... @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_line_items_async( self, **params: Unpack["CalculationListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 8d6dff355..6057ba080 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -6,6 +6,10 @@ class CalculationLineItem(StripeObject): + """ + A Tax Calculation Line Item represents a single item in a tax calculation. + """ + OBJECT_NAME: ClassVar[Literal["tax.calculation_line_item"]] = ( "tax.calculation_line_item" ) @@ -46,6 +50,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -59,12 +64,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, diff --git a/stripe/tax/_calculation_line_item_service.py b/stripe/tax/_calculation_line_item_service.py index 48c946c49..26aa8a0ad 100644 --- a/stripe/tax/_calculation_line_item_service.py +++ b/stripe/tax/_calculation_line_item_service.py @@ -18,6 +18,7 @@ class CalculationLineItemService(StripeService): def list( self, calculation: str, + /, params: Optional["CalculationLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CalculationLineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, calculation: str, + /, params: Optional["CalculationLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CalculationLineItem]": diff --git a/stripe/tax/_calculation_service.py b/stripe/tax/_calculation_service.py index cddd00669..4616b200a 100644 --- a/stripe/tax/_calculation_service.py +++ b/stripe/tax/_calculation_service.py @@ -52,6 +52,7 @@ def __getattr__(self, name): def retrieve( self, calculation: str, + /, params: Optional["CalculationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Calculation": @@ -74,6 +75,7 @@ def retrieve( async def retrieve_async( self, calculation: str, + /, params: Optional["CalculationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Calculation": diff --git a/stripe/tax/_form.py b/stripe/tax/_form.py index b7a90f9e4..9f1d59a3c 100644 --- a/stripe/tax/_form.py +++ b/stripe/tax/_form.py @@ -111,7 +111,7 @@ class Payee(StripeObject): """ type: Union[Literal["account", "external_reference"], str] """ - Either `account` or `external_reference`. + Specifies the payee type. """ class Us1099K(StripeObject): @@ -221,7 +221,7 @@ async def list_async( return result @classmethod - def _cls_pdf(cls, id: str, **params: Unpack["FormPdfParams"]) -> Any: + def _cls_pdf(cls, id: str, /, **params: Unpack["FormPdfParams"]) -> Any: """ Download the PDF for a tax form. """ @@ -237,7 +237,7 @@ def _cls_pdf(cls, id: str, **params: Unpack["FormPdfParams"]) -> Any: @overload @staticmethod - def pdf(id: str, **params: Unpack["FormPdfParams"]) -> Any: + def pdf(id: str, /, **params: Unpack["FormPdfParams"]) -> Any: """ Download the PDF for a tax form. """ @@ -251,9 +251,7 @@ def pdf(self, **params: Unpack["FormPdfParams"]) -> Any: ... @class_method_variant("_cls_pdf") - def pdf( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["FormPdfParams"] - ) -> Any: + def pdf(self, **params: Unpack["FormPdfParams"]) -> Any: """ Download the PDF for a tax form. """ @@ -271,7 +269,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_pdf_async( - cls, id: str, **params: Unpack["FormPdfParams"] + cls, id: str, /, **params: Unpack["FormPdfParams"] ) -> Any: """ Download the PDF for a tax form. @@ -288,7 +286,7 @@ async def _cls_pdf_async( @overload @staticmethod - async def pdf_async(id: str, **params: Unpack["FormPdfParams"]) -> Any: + async def pdf_async(id: str, /, **params: Unpack["FormPdfParams"]) -> Any: """ Download the PDF for a tax form. """ @@ -302,9 +300,7 @@ async def pdf_async(self, **params: Unpack["FormPdfParams"]) -> Any: ... @class_method_variant("_cls_pdf_async") - async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["FormPdfParams"] - ) -> Any: + async def pdf_async(self, **params: Unpack["FormPdfParams"]) -> Any: """ Download the PDF for a tax form. """ diff --git a/stripe/tax/_form_service.py b/stripe/tax/_form_service.py index 85633bc3c..68044398a 100644 --- a/stripe/tax/_form_service.py +++ b/stripe/tax/_form_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["FormRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Form": @@ -77,6 +78,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FormRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Form": @@ -97,6 +99,7 @@ async def retrieve_async( def pdf( self, id: str, + /, params: Optional["FormPdfParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Any": @@ -117,6 +120,7 @@ def pdf( async def pdf_async( self, id: str, + /, params: Optional["FormPdfParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Any": diff --git a/stripe/tax/_location.py b/stripe/tax/_location.py index c304111b3..e7820782b 100644 --- a/stripe/tax/_location.py +++ b/stripe/tax/_location.py @@ -54,7 +54,7 @@ class Address(StripeObject): address: Address description: Optional[str] """ - A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (e.g., "A spacious auditorium suitable for large concerts and events."). + A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (for example, "A spacious auditorium suitable for large concerts and events."). """ id: str """ @@ -76,7 +76,7 @@ class Address(StripeObject): @classmethod def create(cls, **params: Unpack["LocationCreateParams"]) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -92,7 +92,7 @@ async def create_async( cls, **params: Unpack["LocationCreateParams"] ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -110,7 +110,7 @@ def list( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -134,7 +134,7 @@ async def list_async( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ diff --git a/stripe/tax/_location_service.py b/stripe/tax/_location_service.py index 3d33322b7..bb52244f3 100644 --- a/stripe/tax/_location_service.py +++ b/stripe/tax/_location_service.py @@ -25,7 +25,7 @@ def list( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -48,7 +48,7 @@ async def list_async( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -69,7 +69,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -88,7 +88,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -104,6 +104,7 @@ async def create_async( def retrieve( self, location: str, + /, params: Optional["LocationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -126,6 +127,7 @@ def retrieve( async def retrieve_async( self, location: str, + /, params: Optional["LocationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index dd2d5d50c..51f62a83e 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -75,12 +75,6 @@ class Ao(StripeObject): """ class At(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -89,7 +83,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -97,7 +90,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Au(StripeObject): class Standard(StripeObject): @@ -146,12 +139,6 @@ class Bd(StripeObject): """ class Be(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -160,7 +147,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -168,7 +154,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Bf(StripeObject): type: Literal["standard"] @@ -177,12 +163,6 @@ class Bf(StripeObject): """ class Bg(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -191,7 +171,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -199,7 +178,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Bh(StripeObject): type: Literal["standard"] @@ -294,12 +273,6 @@ class Cv(StripeObject): """ class Cy(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -308,7 +281,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -316,15 +288,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Cz(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -333,7 +299,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -341,15 +306,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class De(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -358,7 +317,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -366,15 +324,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Dk(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -383,7 +335,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -391,7 +342,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Ec(StripeObject): type: Literal["simplified"] @@ -400,12 +351,6 @@ class Ec(StripeObject): """ class Ee(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -414,7 +359,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -422,7 +366,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Eg(StripeObject): type: Literal["simplified"] @@ -448,10 +392,13 @@ class Standard(StripeObject): igic: Optional[Igic] standard: Optional[Standard] type: Union[ - Literal["ioss", "oss_non_union", "oss_union", "standard"], str + Literal[ + "igic", "ioss", "oss_non_union", "oss_union", "standard" + ], + str, ] """ - Type of registration in an EU country. + Type of registration in ES. """ _inner_class_types = {"igic": Igic, "standard": Standard} @@ -462,12 +409,6 @@ class Et(StripeObject): """ class Fi(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -476,7 +417,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -484,15 +424,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Fr(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -501,7 +435,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -509,7 +442,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Gb(StripeObject): class Standard(StripeObject): @@ -540,12 +473,6 @@ class Gn(StripeObject): """ class Gr(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -554,7 +481,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -562,15 +488,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Hr(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -579,7 +499,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -587,15 +506,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Hu(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -604,7 +517,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -612,7 +524,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Id(StripeObject): type: Literal["simplified"] @@ -621,12 +533,6 @@ class Id(StripeObject): """ class Ie(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -635,7 +541,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -643,7 +548,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class In(StripeObject): type: Literal["simplified"] @@ -658,12 +563,6 @@ class Is(StripeObject): """ class It(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -672,7 +571,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -680,7 +578,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Jp(StripeObject): class Standard(StripeObject): @@ -741,12 +639,6 @@ class Lk(StripeObject): """ class Lt(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -755,7 +647,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -763,15 +654,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Lu(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -780,7 +665,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -788,15 +672,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Lv(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -805,7 +683,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -813,7 +690,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Ma(StripeObject): type: Literal["simplified"] @@ -846,12 +723,6 @@ class Mr(StripeObject): """ class Mt(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -860,7 +731,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -868,7 +738,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Mx(StripeObject): type: Literal["simplified"] @@ -889,12 +759,6 @@ class Ng(StripeObject): """ class Nl(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -903,7 +767,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -911,7 +774,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class No(StripeObject): class Standard(StripeObject): @@ -970,12 +833,6 @@ class Ph(StripeObject): """ class Pl(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -984,7 +841,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -992,15 +848,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Pt(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1009,7 +859,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -1017,15 +866,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Ro(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1034,7 +877,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -1042,7 +884,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Rs(StripeObject): type: Literal["standard"] @@ -1063,12 +905,6 @@ class Sa(StripeObject): """ class Se(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1077,7 +913,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -1085,7 +920,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Sg(StripeObject): class Standard(StripeObject): @@ -1104,12 +939,6 @@ class Standard(StripeObject): _inner_class_types = {"standard": Standard} class Si(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1118,7 +947,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -1126,15 +954,9 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Sk(StripeObject): - class Igic(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] - """ - Place of supply scheme used in an IGIC registration. - """ - class Standard(StripeObject): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1143,7 +965,6 @@ class Standard(StripeObject): Place of supply scheme used in an EU standard registration. """ - igic: Optional[Igic] standard: Optional[Standard] type: Union[ Literal["ioss", "oss_non_union", "oss_union", "standard"], str @@ -1151,7 +972,7 @@ class Standard(StripeObject): """ Type of registration in an EU country. """ - _inner_class_types = {"igic": Igic, "standard": Standard} + _inner_class_types = {"standard": Standard} class Sn(StripeObject): type: Literal["simplified"] @@ -1166,7 +987,7 @@ class Sr(StripeObject): """ class Th(StripeObject): - type: Literal["simplified"] + type: Union[Literal["simplified"], str] """ Type of registration in `country`. """ @@ -1710,7 +1531,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["RegistrationModifyParams"] + cls, id: str, /, **params: Unpack["RegistrationModifyParams"] ) -> "Registration": """ Updates an existing Tax Registration object. @@ -1729,7 +1550,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["RegistrationModifyParams"] + cls, id: str, /, **params: Unpack["RegistrationModifyParams"] ) -> "Registration": """ Updates an existing Tax Registration object. diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index a85fd5759..8e8814f84 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["RegistrationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Registration": @@ -123,6 +124,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["RegistrationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Registration": @@ -143,6 +145,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["RegistrationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Registration": @@ -165,6 +168,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["RegistrationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Registration": diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index c180373d6..c47640ca0 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -102,14 +102,14 @@ class Pending(StripeObject): """ status: Union[Literal["active", "pending"], str] """ - The status of the Tax `Settings`. + Whether these settings have the information Stripe Tax needs to calculate tax. It doesn't reflect whether your integration is ready to collect tax. """ status_details: StatusDetails @classmethod def modify(cls, **params: Unpack["SettingsModifyParams"]) -> "Settings": """ - Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. Check the returned Tax Settings object and validate that its status is active. """ return cast( "Settings", @@ -125,7 +125,7 @@ async def modify_async( cls, **params: Unpack["SettingsModifyParams"] ) -> "Settings": """ - Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. Check the returned Tax Settings object and validate that its status is active. """ return cast( "Settings", diff --git a/stripe/tax/_settings_service.py b/stripe/tax/_settings_service.py index fa998167b..746a2f861 100644 --- a/stripe/tax/_settings_service.py +++ b/stripe/tax/_settings_service.py @@ -58,7 +58,7 @@ def update( options: Optional["RequestOptions"] = None, ) -> "Settings": """ - Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. Check the returned Tax Settings object and validate that its status is active. """ return cast( "Settings", @@ -77,7 +77,7 @@ async def update_async( options: Optional["RequestOptions"] = None, ) -> "Settings": """ - Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. + Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. Check the returned Tax Settings object and validate that its status is active. """ return cast( "Settings", diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index d78af822e..46c0aa69e 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -289,6 +289,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -302,12 +303,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, @@ -519,6 +522,7 @@ async def create_reversal_async( def _cls_list_line_items( cls, transaction: str, + /, **params: Unpack["TransactionListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ @@ -538,7 +542,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - transaction: str, **params: Unpack["TransactionListLineItemsParams"] + transaction: str, /, **params: Unpack["TransactionListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -555,7 +559,7 @@ def list_line_items( ... @class_method_variant("_cls_list_line_items") - def list_line_items( # pyright: ignore[reportGeneralTypeIssues] + def list_line_items( self, **params: Unpack["TransactionListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ @@ -576,6 +580,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] async def _cls_list_line_items_async( cls, transaction: str, + /, **params: Unpack["TransactionListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ @@ -595,7 +600,7 @@ async def _cls_list_line_items_async( @overload @staticmethod async def list_line_items_async( - transaction: str, **params: Unpack["TransactionListLineItemsParams"] + transaction: str, /, **params: Unpack["TransactionListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -612,7 +617,7 @@ async def list_line_items_async( ... @class_method_variant("_cls_list_line_items_async") - async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] + async def list_line_items_async( self, **params: Unpack["TransactionListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ diff --git a/stripe/tax/_transaction_line_item.py b/stripe/tax/_transaction_line_item.py index 679492e18..c6f16221e 100644 --- a/stripe/tax/_transaction_line_item.py +++ b/stripe/tax/_transaction_line_item.py @@ -6,6 +6,10 @@ class TransactionLineItem(StripeObject): + """ + A Tax Transaction Line Item represents an individual item in a Tax Transaction. + """ + OBJECT_NAME: ClassVar[Literal["tax.transaction_line_item"]] = ( "tax.transaction_line_item" ) diff --git a/stripe/tax/_transaction_line_item_service.py b/stripe/tax/_transaction_line_item_service.py index 2393374b8..3190e6dac 100644 --- a/stripe/tax/_transaction_line_item_service.py +++ b/stripe/tax/_transaction_line_item_service.py @@ -18,6 +18,7 @@ class TransactionLineItemService(StripeService): def list( self, transaction: str, + /, params: Optional["TransactionLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[TransactionLineItem]": @@ -40,6 +41,7 @@ def list( async def list_async( self, transaction: str, + /, params: Optional["TransactionLineItemListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[TransactionLineItem]": diff --git a/stripe/tax/_transaction_service.py b/stripe/tax/_transaction_service.py index 83397d610..c89f3bc43 100644 --- a/stripe/tax/_transaction_service.py +++ b/stripe/tax/_transaction_service.py @@ -55,6 +55,7 @@ def __getattr__(self, name): def retrieve( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -77,6 +78,7 @@ def retrieve( async def retrieve_async( self, transaction: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index fd47c40b0..bbaf39987 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -610,7 +610,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ConfigurationDeleteParams"] + cls, sid: str, /, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. @@ -628,7 +628,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["ConfigurationDeleteParams"] + sid: str, /, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. @@ -645,7 +645,7 @@ def delete( ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] + def delete( self, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ @@ -659,7 +659,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ConfigurationDeleteParams"] + cls, sid: str, /, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. @@ -677,7 +677,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ConfigurationDeleteParams"] + sid: str, /, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. @@ -694,7 +694,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ConfigurationDeleteParams"] ) -> "Configuration": """ @@ -748,7 +748,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ConfigurationModifyParams"] + cls, id: str, /, **params: Unpack["ConfigurationModifyParams"] ) -> "Configuration": """ Updates a new Configuration object. @@ -765,7 +765,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ConfigurationModifyParams"] + cls, id: str, /, **params: Unpack["ConfigurationModifyParams"] ) -> "Configuration": """ Updates a new Configuration object. diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index 0d6f251ee..040a10834 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -30,6 +30,7 @@ class ConfigurationService(StripeService): def delete( self, configuration: str, + /, params: Optional["ConfigurationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -52,6 +53,7 @@ def delete( async def delete_async( self, configuration: str, + /, params: Optional["ConfigurationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -74,6 +76,7 @@ async def delete_async( def retrieve( self, configuration: str, + /, params: Optional["ConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -96,6 +99,7 @@ def retrieve( async def retrieve_async( self, configuration: str, + /, params: Optional["ConfigurationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -118,6 +122,7 @@ async def retrieve_async( def update( self, configuration: str, + /, params: Optional["ConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": @@ -140,6 +145,7 @@ def update( async def update_async( self, configuration: str, + /, params: Optional["ConfigurationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Configuration": diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 0c457d074..c27d58d06 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -204,7 +204,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["LocationDeleteParams"] + cls, sid: str, /, **params: Unpack["LocationDeleteParams"] ) -> "Location": """ Deletes a Location object. @@ -222,7 +222,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["LocationDeleteParams"] + sid: str, /, **params: Unpack["LocationDeleteParams"] ) -> "Location": """ Deletes a Location object. @@ -237,9 +237,7 @@ def delete(self, **params: Unpack["LocationDeleteParams"]) -> "Location": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["LocationDeleteParams"] - ) -> "Location": + def delete(self, **params: Unpack["LocationDeleteParams"]) -> "Location": """ Deletes a Location object. """ @@ -251,7 +249,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["LocationDeleteParams"] + cls, sid: str, /, **params: Unpack["LocationDeleteParams"] ) -> "Location": """ Deletes a Location object. @@ -269,7 +267,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["LocationDeleteParams"] + sid: str, /, **params: Unpack["LocationDeleteParams"] ) -> "Location": """ Deletes a Location object. @@ -286,7 +284,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["LocationDeleteParams"] ) -> "Location": """ @@ -340,7 +338,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["LocationModifyParams"] + cls, id: str, /, **params: Unpack["LocationModifyParams"] ) -> "Location": """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -357,7 +355,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["LocationModifyParams"] + cls, id: str, /, **params: Unpack["LocationModifyParams"] ) -> "Location": """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 9c0aaf36d..05589040e 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -28,6 +28,7 @@ class LocationService(StripeService): def delete( self, location: str, + /, params: Optional["LocationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -50,6 +51,7 @@ def delete( async def delete_async( self, location: str, + /, params: Optional["LocationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -72,6 +74,7 @@ async def delete_async( def retrieve( self, location: str, + /, params: Optional["LocationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -94,6 +97,7 @@ def retrieve( async def retrieve_async( self, location: str, + /, params: Optional["LocationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -116,6 +120,7 @@ async def retrieve_async( def update( self, location: str, + /, params: Optional["LocationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": @@ -138,6 +143,7 @@ def update( async def update_async( self, location: str, + /, params: Optional["LocationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Location": diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 79c1c999b..4b5ca69e6 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -83,7 +83,7 @@ class Action(StripeObject): class ApiError(StripeObject): advice_code: Optional[str] """ - For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines#retrying-issuer-declines) if they provide one. + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://docs.stripe.com/declines/card#retrying-issuer-declines) if they provide one. """ charge: Optional[str] """ @@ -144,6 +144,7 @@ class ApiError(StripeObject): "customer_session_expired", "customer_tax_location_invalid", "debit_not_authorized", + "dispute_evidence_page_limit_exceeded", "email_invalid", "expired_card", "expired_payment_method", @@ -154,6 +155,8 @@ class ApiError(StripeObject): "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", + "financial_connections_consent_locale_invalid", + "financial_connections_consent_locale_unsupported", "financial_connections_institution_unavailable", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", @@ -208,6 +211,7 @@ class ApiError(StripeObject): "parameter_missing", "parameter_unknown", "parameters_exclusive", + "payment_evaluation_on_api_version_not_supported", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", @@ -363,7 +367,7 @@ class ApiError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -374,9 +378,9 @@ class ApiError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -981,12 +985,12 @@ class LineItem(StripeObject): """ status: Optional[Union[Literal["offline", "online"], str]] """ - The networking status of the reader. We do not recommend using this field in flows that may block taking payments. + The networking status of the reader. This value is `null` for mobile readers. We do not recommend using this field in flows that may block taking payments. """ @classmethod def _cls_cancel_action( - cls, reader: str, **params: Unpack["ReaderCancelActionParams"] + cls, reader: str, /, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details. @@ -1005,7 +1009,7 @@ def _cls_cancel_action( @overload @staticmethod def cancel_action( - reader: str, **params: Unpack["ReaderCancelActionParams"] + reader: str, /, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details. @@ -1022,7 +1026,7 @@ def cancel_action( ... @class_method_variant("_cls_cancel_action") - def cancel_action( # pyright: ignore[reportGeneralTypeIssues] + def cancel_action( self, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ @@ -1041,7 +1045,7 @@ def cancel_action( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_action_async( - cls, reader: str, **params: Unpack["ReaderCancelActionParams"] + cls, reader: str, /, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details. @@ -1060,7 +1064,7 @@ async def _cls_cancel_action_async( @overload @staticmethod async def cancel_action_async( - reader: str, **params: Unpack["ReaderCancelActionParams"] + reader: str, /, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ Cancels the current reader action. See [Programmatic Cancellation](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#programmatic-cancellation) for more details. @@ -1077,7 +1081,7 @@ async def cancel_action_async( ... @class_method_variant("_cls_cancel_action_async") - async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_action_async( self, **params: Unpack["ReaderCancelActionParams"] ) -> "Reader": """ @@ -1096,7 +1100,7 @@ async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_collect_inputs( - cls, reader: str, **params: Unpack["ReaderCollectInputsParams"] + cls, reader: str, /, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers. @@ -1115,7 +1119,7 @@ def _cls_collect_inputs( @overload @staticmethod def collect_inputs( - reader: str, **params: Unpack["ReaderCollectInputsParams"] + reader: str, /, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers. @@ -1132,7 +1136,7 @@ def collect_inputs( ... @class_method_variant("_cls_collect_inputs") - def collect_inputs( # pyright: ignore[reportGeneralTypeIssues] + def collect_inputs( self, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ @@ -1151,7 +1155,7 @@ def collect_inputs( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_collect_inputs_async( - cls, reader: str, **params: Unpack["ReaderCollectInputsParams"] + cls, reader: str, /, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers. @@ -1170,7 +1174,7 @@ async def _cls_collect_inputs_async( @overload @staticmethod async def collect_inputs_async( - reader: str, **params: Unpack["ReaderCollectInputsParams"] + reader: str, /, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ Initiates an [input collection flow](https://docs.stripe.com/docs/terminal/features/collect-inputs) on a Reader to display input forms and collect information from your customers. @@ -1187,7 +1191,7 @@ async def collect_inputs_async( ... @class_method_variant("_cls_collect_inputs_async") - async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] + async def collect_inputs_async( self, **params: Unpack["ReaderCollectInputsParams"] ) -> "Reader": """ @@ -1206,7 +1210,10 @@ async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_collect_payment_method( - cls, reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderCollectPaymentMethodParams"], ) -> "Reader": """ Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details. @@ -1225,7 +1232,7 @@ def _cls_collect_payment_method( @overload @staticmethod def collect_payment_method( - reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"] + reader: str, /, **params: Unpack["ReaderCollectPaymentMethodParams"] ) -> "Reader": """ Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details. @@ -1242,7 +1249,7 @@ def collect_payment_method( ... @class_method_variant("_cls_collect_payment_method") - def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] + def collect_payment_method( self, **params: Unpack["ReaderCollectPaymentMethodParams"] ) -> "Reader": """ @@ -1261,7 +1268,10 @@ def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_collect_payment_method_async( - cls, reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderCollectPaymentMethodParams"], ) -> "Reader": """ Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details. @@ -1280,7 +1290,7 @@ async def _cls_collect_payment_method_async( @overload @staticmethod async def collect_payment_method_async( - reader: str, **params: Unpack["ReaderCollectPaymentMethodParams"] + reader: str, /, **params: Unpack["ReaderCollectPaymentMethodParams"] ) -> "Reader": """ Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. See [Collecting a Payment method](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#collect-a-paymentmethod) for more details. @@ -1297,7 +1307,7 @@ async def collect_payment_method_async( ... @class_method_variant("_cls_collect_payment_method_async") - async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + async def collect_payment_method_async( self, **params: Unpack["ReaderCollectPaymentMethodParams"] ) -> "Reader": """ @@ -1316,7 +1326,10 @@ async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssu @classmethod def _cls_confirm_payment_intent( - cls, reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderConfirmPaymentIntentParams"], ) -> "Reader": """ Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details. @@ -1335,7 +1348,7 @@ def _cls_confirm_payment_intent( @overload @staticmethod def confirm_payment_intent( - reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"] + reader: str, /, **params: Unpack["ReaderConfirmPaymentIntentParams"] ) -> "Reader": """ Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details. @@ -1352,7 +1365,7 @@ def confirm_payment_intent( ... @class_method_variant("_cls_confirm_payment_intent") - def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] + def confirm_payment_intent( self, **params: Unpack["ReaderConfirmPaymentIntentParams"] ) -> "Reader": """ @@ -1371,7 +1384,10 @@ def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_confirm_payment_intent_async( - cls, reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderConfirmPaymentIntentParams"], ) -> "Reader": """ Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details. @@ -1390,7 +1406,7 @@ async def _cls_confirm_payment_intent_async( @overload @staticmethod async def confirm_payment_intent_async( - reader: str, **params: Unpack["ReaderConfirmPaymentIntentParams"] + reader: str, /, **params: Unpack["ReaderConfirmPaymentIntentParams"] ) -> "Reader": """ Finalizes a payment on a Reader. See [Confirming a Payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=inspect#confirm-the-paymentintent) for more details. @@ -1407,7 +1423,7 @@ async def confirm_payment_intent_async( ... @class_method_variant("_cls_confirm_payment_intent_async") - async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + async def confirm_payment_intent_async( self, **params: Unpack["ReaderConfirmPaymentIntentParams"] ) -> "Reader": """ @@ -1456,7 +1472,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["ReaderDeleteParams"] + cls, sid: str, /, **params: Unpack["ReaderDeleteParams"] ) -> "Reader": """ Deletes a Reader object. @@ -1473,7 +1489,9 @@ def _cls_delete( @overload @staticmethod - def delete(sid: str, **params: Unpack["ReaderDeleteParams"]) -> "Reader": + def delete( + sid: str, /, **params: Unpack["ReaderDeleteParams"] + ) -> "Reader": """ Deletes a Reader object. """ @@ -1487,9 +1505,7 @@ def delete(self, **params: Unpack["ReaderDeleteParams"]) -> "Reader": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["ReaderDeleteParams"] - ) -> "Reader": + def delete(self, **params: Unpack["ReaderDeleteParams"]) -> "Reader": """ Deletes a Reader object. """ @@ -1501,7 +1517,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["ReaderDeleteParams"] + cls, sid: str, /, **params: Unpack["ReaderDeleteParams"] ) -> "Reader": """ Deletes a Reader object. @@ -1519,7 +1535,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["ReaderDeleteParams"] + sid: str, /, **params: Unpack["ReaderDeleteParams"] ) -> "Reader": """ Deletes a Reader object. @@ -1536,7 +1552,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["ReaderDeleteParams"] ) -> "Reader": """ @@ -1590,7 +1606,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["ReaderModifyParams"] + cls, id: str, /, **params: Unpack["ReaderModifyParams"] ) -> "Reader": """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1607,7 +1623,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["ReaderModifyParams"] + cls, id: str, /, **params: Unpack["ReaderModifyParams"] ) -> "Reader": """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. @@ -1624,7 +1640,10 @@ async def modify_async( @classmethod def _cls_process_payment_intent( - cls, reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderProcessPaymentIntentParams"], ) -> "Reader": """ Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details. @@ -1643,7 +1662,7 @@ def _cls_process_payment_intent( @overload @staticmethod def process_payment_intent( - reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"] + reader: str, /, **params: Unpack["ReaderProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details. @@ -1660,7 +1679,7 @@ def process_payment_intent( ... @class_method_variant("_cls_process_payment_intent") - def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] + def process_payment_intent( self, **params: Unpack["ReaderProcessPaymentIntentParams"] ) -> "Reader": """ @@ -1679,7 +1698,10 @@ def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_process_payment_intent_async( - cls, reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"] + cls, + reader: str, + /, + **params: Unpack["ReaderProcessPaymentIntentParams"], ) -> "Reader": """ Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details. @@ -1698,7 +1720,7 @@ async def _cls_process_payment_intent_async( @overload @staticmethod async def process_payment_intent_async( - reader: str, **params: Unpack["ReaderProcessPaymentIntentParams"] + reader: str, /, **params: Unpack["ReaderProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. See [process the payment](https://docs.stripe.com/docs/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment) for more details. @@ -1715,7 +1737,7 @@ async def process_payment_intent_async( ... @class_method_variant("_cls_process_payment_intent_async") - async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + async def process_payment_intent_async( self, **params: Unpack["ReaderProcessPaymentIntentParams"] ) -> "Reader": """ @@ -1734,7 +1756,7 @@ async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssu @classmethod def _cls_process_setup_intent( - cls, reader: str, **params: Unpack["ReaderProcessSetupIntentParams"] + cls, reader: str, /, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details. @@ -1753,7 +1775,7 @@ def _cls_process_setup_intent( @overload @staticmethod def process_setup_intent( - reader: str, **params: Unpack["ReaderProcessSetupIntentParams"] + reader: str, /, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details. @@ -1770,7 +1792,7 @@ def process_setup_intent( ... @class_method_variant("_cls_process_setup_intent") - def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] + def process_setup_intent( self, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ @@ -1789,7 +1811,7 @@ def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_process_setup_intent_async( - cls, reader: str, **params: Unpack["ReaderProcessSetupIntentParams"] + cls, reader: str, /, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details. @@ -1808,7 +1830,7 @@ async def _cls_process_setup_intent_async( @overload @staticmethod async def process_setup_intent_async( - reader: str, **params: Unpack["ReaderProcessSetupIntentParams"] + reader: str, /, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ Initiates a SetupIntent flow on a Reader. See [Save directly without charging](https://docs.stripe.com/docs/terminal/features/saving-payment-details/save-directly) for more details. @@ -1825,7 +1847,7 @@ async def process_setup_intent_async( ... @class_method_variant("_cls_process_setup_intent_async") - async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues] + async def process_setup_intent_async( self, **params: Unpack["ReaderProcessSetupIntentParams"] ) -> "Reader": """ @@ -1844,7 +1866,7 @@ async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues @classmethod def _cls_refund_payment( - cls, reader: str, **params: Unpack["ReaderRefundPaymentParams"] + cls, reader: str, /, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details. @@ -1863,7 +1885,7 @@ def _cls_refund_payment( @overload @staticmethod def refund_payment( - reader: str, **params: Unpack["ReaderRefundPaymentParams"] + reader: str, /, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details. @@ -1880,7 +1902,7 @@ def refund_payment( ... @class_method_variant("_cls_refund_payment") - def refund_payment( # pyright: ignore[reportGeneralTypeIssues] + def refund_payment( self, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ @@ -1899,7 +1921,7 @@ def refund_payment( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_refund_payment_async( - cls, reader: str, **params: Unpack["ReaderRefundPaymentParams"] + cls, reader: str, /, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details. @@ -1918,7 +1940,7 @@ async def _cls_refund_payment_async( @overload @staticmethod async def refund_payment_async( - reader: str, **params: Unpack["ReaderRefundPaymentParams"] + reader: str, /, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ Initiates an in-person refund on a Reader. See [Refund an Interac Payment](https://docs.stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment) for more details. @@ -1935,7 +1957,7 @@ async def refund_payment_async( ... @class_method_variant("_cls_refund_payment_async") - async def refund_payment_async( # pyright: ignore[reportGeneralTypeIssues] + async def refund_payment_async( self, **params: Unpack["ReaderRefundPaymentParams"] ) -> "Reader": """ @@ -1976,7 +1998,7 @@ async def retrieve_async( @classmethod def _cls_set_reader_display( - cls, reader: str, **params: Unpack["ReaderSetReaderDisplayParams"] + cls, reader: str, /, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display). @@ -1995,7 +2017,7 @@ def _cls_set_reader_display( @overload @staticmethod def set_reader_display( - reader: str, **params: Unpack["ReaderSetReaderDisplayParams"] + reader: str, /, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display). @@ -2012,7 +2034,7 @@ def set_reader_display( ... @class_method_variant("_cls_set_reader_display") - def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] + def set_reader_display( self, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ @@ -2031,7 +2053,7 @@ def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_set_reader_display_async( - cls, reader: str, **params: Unpack["ReaderSetReaderDisplayParams"] + cls, reader: str, /, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display). @@ -2050,7 +2072,7 @@ async def _cls_set_reader_display_async( @overload @staticmethod async def set_reader_display_async( - reader: str, **params: Unpack["ReaderSetReaderDisplayParams"] + reader: str, /, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ Sets the reader display to show [cart details](https://docs.stripe.com/docs/terminal/features/display). @@ -2067,7 +2089,7 @@ async def set_reader_display_async( ... @class_method_variant("_cls_set_reader_display_async") - async def set_reader_display_async( # pyright: ignore[reportGeneralTypeIssues] + async def set_reader_display_async( self, **params: Unpack["ReaderSetReaderDisplayParams"] ) -> "Reader": """ @@ -2091,6 +2113,7 @@ class TestHelpers(APIResourceTestHelpers["Reader"]): def _cls_present_payment_method( cls, reader: str, + /, **params: Unpack["ReaderPresentPaymentMethodParams"], ) -> "Reader": """ @@ -2110,7 +2133,9 @@ def _cls_present_payment_method( @overload @staticmethod def present_payment_method( - reader: str, **params: Unpack["ReaderPresentPaymentMethodParams"] + reader: str, + /, + **params: Unpack["ReaderPresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -2127,7 +2152,7 @@ def present_payment_method( ... @class_method_variant("_cls_present_payment_method") - def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] + def present_payment_method( self, **params: Unpack["ReaderPresentPaymentMethodParams"] ) -> "Reader": """ @@ -2148,6 +2173,7 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] async def _cls_present_payment_method_async( cls, reader: str, + /, **params: Unpack["ReaderPresentPaymentMethodParams"], ) -> "Reader": """ @@ -2167,7 +2193,9 @@ async def _cls_present_payment_method_async( @overload @staticmethod async def present_payment_method_async( - reader: str, **params: Unpack["ReaderPresentPaymentMethodParams"] + reader: str, + /, + **params: Unpack["ReaderPresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -2184,7 +2212,7 @@ async def present_payment_method_async( ... @class_method_variant("_cls_present_payment_method_async") - async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + async def present_payment_method_async( self, **params: Unpack["ReaderPresentPaymentMethodParams"] ) -> "Reader": """ @@ -2205,6 +2233,7 @@ async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssu def _cls_succeed_input_collection( cls, reader: str, + /, **params: Unpack["ReaderSucceedInputCollectionParams"], ) -> "Reader": """ @@ -2224,7 +2253,9 @@ def _cls_succeed_input_collection( @overload @staticmethod def succeed_input_collection( - reader: str, **params: Unpack["ReaderSucceedInputCollectionParams"] + reader: str, + /, + **params: Unpack["ReaderSucceedInputCollectionParams"], ) -> "Reader": """ Use this endpoint to trigger a successful input collection on a simulated reader. @@ -2241,7 +2272,7 @@ def succeed_input_collection( ... @class_method_variant("_cls_succeed_input_collection") - def succeed_input_collection( # pyright: ignore[reportGeneralTypeIssues] + def succeed_input_collection( self, **params: Unpack["ReaderSucceedInputCollectionParams"] ) -> "Reader": """ @@ -2262,6 +2293,7 @@ def succeed_input_collection( # pyright: ignore[reportGeneralTypeIssues] async def _cls_succeed_input_collection_async( cls, reader: str, + /, **params: Unpack["ReaderSucceedInputCollectionParams"], ) -> "Reader": """ @@ -2281,7 +2313,9 @@ async def _cls_succeed_input_collection_async( @overload @staticmethod async def succeed_input_collection_async( - reader: str, **params: Unpack["ReaderSucceedInputCollectionParams"] + reader: str, + /, + **params: Unpack["ReaderSucceedInputCollectionParams"], ) -> "Reader": """ Use this endpoint to trigger a successful input collection on a simulated reader. @@ -2298,7 +2332,7 @@ async def succeed_input_collection_async( ... @class_method_variant("_cls_succeed_input_collection_async") - async def succeed_input_collection_async( # pyright: ignore[reportGeneralTypeIssues] + async def succeed_input_collection_async( self, **params: Unpack["ReaderSucceedInputCollectionParams"] ) -> "Reader": """ @@ -2319,6 +2353,7 @@ async def succeed_input_collection_async( # pyright: ignore[reportGeneralTypeIs def _cls_timeout_input_collection( cls, reader: str, + /, **params: Unpack["ReaderTimeoutInputCollectionParams"], ) -> "Reader": """ @@ -2338,7 +2373,9 @@ def _cls_timeout_input_collection( @overload @staticmethod def timeout_input_collection( - reader: str, **params: Unpack["ReaderTimeoutInputCollectionParams"] + reader: str, + /, + **params: Unpack["ReaderTimeoutInputCollectionParams"], ) -> "Reader": """ Use this endpoint to complete an input collection with a timeout error on a simulated reader. @@ -2355,7 +2392,7 @@ def timeout_input_collection( ... @class_method_variant("_cls_timeout_input_collection") - def timeout_input_collection( # pyright: ignore[reportGeneralTypeIssues] + def timeout_input_collection( self, **params: Unpack["ReaderTimeoutInputCollectionParams"] ) -> "Reader": """ @@ -2376,6 +2413,7 @@ def timeout_input_collection( # pyright: ignore[reportGeneralTypeIssues] async def _cls_timeout_input_collection_async( cls, reader: str, + /, **params: Unpack["ReaderTimeoutInputCollectionParams"], ) -> "Reader": """ @@ -2395,7 +2433,9 @@ async def _cls_timeout_input_collection_async( @overload @staticmethod async def timeout_input_collection_async( - reader: str, **params: Unpack["ReaderTimeoutInputCollectionParams"] + reader: str, + /, + **params: Unpack["ReaderTimeoutInputCollectionParams"], ) -> "Reader": """ Use this endpoint to complete an input collection with a timeout error on a simulated reader. @@ -2412,7 +2452,7 @@ async def timeout_input_collection_async( ... @class_method_variant("_cls_timeout_input_collection_async") - async def timeout_input_collection_async( # pyright: ignore[reportGeneralTypeIssues] + async def timeout_input_collection_async( self, **params: Unpack["ReaderTimeoutInputCollectionParams"] ) -> "Reader": """ diff --git a/stripe/terminal/_reader_collected_data_service.py b/stripe/terminal/_reader_collected_data_service.py index 188a014c3..117e86d26 100644 --- a/stripe/terminal/_reader_collected_data_service.py +++ b/stripe/terminal/_reader_collected_data_service.py @@ -17,6 +17,7 @@ class ReaderCollectedDataService(StripeService): def retrieve( self, reader_collected_data: str, + /, params: Optional["ReaderCollectedDataRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReaderCollectedData": @@ -39,6 +40,7 @@ def retrieve( async def retrieve_async( self, reader_collected_data: str, + /, params: Optional["ReaderCollectedDataRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReaderCollectedData": diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 8cb36a77f..29c3a1ae3 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -46,6 +46,7 @@ class ReaderService(StripeService): def delete( self, reader: str, + /, params: Optional["ReaderDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -68,6 +69,7 @@ def delete( async def delete_async( self, reader: str, + /, params: Optional["ReaderDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -90,6 +92,7 @@ async def delete_async( def retrieve( self, reader: str, + /, params: Optional["ReaderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -112,6 +115,7 @@ def retrieve( async def retrieve_async( self, reader: str, + /, params: Optional["ReaderRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -134,6 +138,7 @@ async def retrieve_async( def update( self, reader: str, + /, params: Optional["ReaderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -156,6 +161,7 @@ def update( async def update_async( self, reader: str, + /, params: Optional["ReaderUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -254,6 +260,7 @@ async def create_async( def cancel_action( self, reader: str, + /, params: Optional["ReaderCancelActionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -276,6 +283,7 @@ def cancel_action( async def cancel_action_async( self, reader: str, + /, params: Optional["ReaderCancelActionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -298,6 +306,7 @@ async def cancel_action_async( def collect_inputs( self, reader: str, + /, params: "ReaderCollectInputsParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -320,6 +329,7 @@ def collect_inputs( async def collect_inputs_async( self, reader: str, + /, params: "ReaderCollectInputsParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -342,6 +352,7 @@ async def collect_inputs_async( def collect_payment_method( self, reader: str, + /, params: "ReaderCollectPaymentMethodParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -364,6 +375,7 @@ def collect_payment_method( async def collect_payment_method_async( self, reader: str, + /, params: "ReaderCollectPaymentMethodParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -386,6 +398,7 @@ async def collect_payment_method_async( def confirm_payment_intent( self, reader: str, + /, params: "ReaderConfirmPaymentIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -408,6 +421,7 @@ def confirm_payment_intent( async def confirm_payment_intent_async( self, reader: str, + /, params: "ReaderConfirmPaymentIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -430,6 +444,7 @@ async def confirm_payment_intent_async( def process_payment_intent( self, reader: str, + /, params: "ReaderProcessPaymentIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -452,6 +467,7 @@ def process_payment_intent( async def process_payment_intent_async( self, reader: str, + /, params: "ReaderProcessPaymentIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -474,6 +490,7 @@ async def process_payment_intent_async( def process_setup_intent( self, reader: str, + /, params: "ReaderProcessSetupIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -496,6 +513,7 @@ def process_setup_intent( async def process_setup_intent_async( self, reader: str, + /, params: "ReaderProcessSetupIntentParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -518,6 +536,7 @@ async def process_setup_intent_async( def refund_payment( self, reader: str, + /, params: Optional["ReaderRefundPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -540,6 +559,7 @@ def refund_payment( async def refund_payment_async( self, reader: str, + /, params: Optional["ReaderRefundPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -562,6 +582,7 @@ async def refund_payment_async( def set_reader_display( self, reader: str, + /, params: "ReaderSetReaderDisplayParams", options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -584,6 +605,7 @@ def set_reader_display( async def set_reader_display_async( self, reader: str, + /, params: "ReaderSetReaderDisplayParams", options: Optional["RequestOptions"] = None, ) -> "Reader": diff --git a/stripe/test_helpers/_customer_service.py b/stripe/test_helpers/_customer_service.py index a9da41ccd..e6b651ff3 100644 --- a/stripe/test_helpers/_customer_service.py +++ b/stripe/test_helpers/_customer_service.py @@ -19,6 +19,7 @@ class CustomerService(StripeService): def fund_cash_balance( self, customer: str, + /, params: "CustomerFundCashBalanceParams", options: Optional["RequestOptions"] = None, ) -> "CustomerCashBalanceTransaction": @@ -41,6 +42,7 @@ def fund_cash_balance( async def fund_cash_balance_async( self, customer: str, + /, params: "CustomerFundCashBalanceParams", options: Optional["RequestOptions"] = None, ) -> "CustomerCashBalanceTransaction": diff --git a/stripe/test_helpers/_refund_service.py b/stripe/test_helpers/_refund_service.py index 92969f298..893194706 100644 --- a/stripe/test_helpers/_refund_service.py +++ b/stripe/test_helpers/_refund_service.py @@ -17,6 +17,7 @@ class RefundService(StripeService): def expire( self, refund: str, + /, params: Optional["RefundExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": @@ -39,6 +40,7 @@ def expire( async def expire_async( self, refund: str, + /, params: Optional["RefundExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Refund": diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index e0aa91ed9..c653987db 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -92,7 +92,7 @@ class Advancing(StripeObject): @classmethod def _cls_advance( - cls, test_clock: str, **params: Unpack["TestClockAdvanceParams"] + cls, test_clock: str, /, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -111,7 +111,7 @@ def _cls_advance( @overload @staticmethod def advance( - test_clock: str, **params: Unpack["TestClockAdvanceParams"] + test_clock: str, /, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -128,7 +128,7 @@ def advance( ... @class_method_variant("_cls_advance") - def advance( # pyright: ignore[reportGeneralTypeIssues] + def advance( self, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ @@ -147,7 +147,7 @@ def advance( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_advance_async( - cls, test_clock: str, **params: Unpack["TestClockAdvanceParams"] + cls, test_clock: str, /, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -166,7 +166,7 @@ async def _cls_advance_async( @overload @staticmethod async def advance_async( - test_clock: str, **params: Unpack["TestClockAdvanceParams"] + test_clock: str, /, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -183,7 +183,7 @@ async def advance_async( ... @class_method_variant("_cls_advance_async") - async def advance_async( # pyright: ignore[reportGeneralTypeIssues] + async def advance_async( self, **params: Unpack["TestClockAdvanceParams"] ) -> "TestClock": """ @@ -232,7 +232,7 @@ async def create_async( @classmethod def _cls_delete( - cls, sid: str, **params: Unpack["TestClockDeleteParams"] + cls, sid: str, /, **params: Unpack["TestClockDeleteParams"] ) -> "TestClock": """ Deletes a test clock. @@ -250,7 +250,7 @@ def _cls_delete( @overload @staticmethod def delete( - sid: str, **params: Unpack["TestClockDeleteParams"] + sid: str, /, **params: Unpack["TestClockDeleteParams"] ) -> "TestClock": """ Deletes a test clock. @@ -265,9 +265,7 @@ def delete(self, **params: Unpack["TestClockDeleteParams"]) -> "TestClock": ... @class_method_variant("_cls_delete") - def delete( # pyright: ignore[reportGeneralTypeIssues] - self, **params: Unpack["TestClockDeleteParams"] - ) -> "TestClock": + def delete(self, **params: Unpack["TestClockDeleteParams"]) -> "TestClock": """ Deletes a test clock. """ @@ -279,7 +277,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_delete_async( - cls, sid: str, **params: Unpack["TestClockDeleteParams"] + cls, sid: str, /, **params: Unpack["TestClockDeleteParams"] ) -> "TestClock": """ Deletes a test clock. @@ -297,7 +295,7 @@ async def _cls_delete_async( @overload @staticmethod async def delete_async( - sid: str, **params: Unpack["TestClockDeleteParams"] + sid: str, /, **params: Unpack["TestClockDeleteParams"] ) -> "TestClock": """ Deletes a test clock. @@ -314,7 +312,7 @@ async def delete_async( ... @class_method_variant("_cls_delete_async") - async def delete_async( # pyright: ignore[reportGeneralTypeIssues] + async def delete_async( self, **params: Unpack["TestClockDeleteParams"] ) -> "TestClock": """ diff --git a/stripe/test_helpers/_test_clock_service.py b/stripe/test_helpers/_test_clock_service.py index 07f5af6f4..99b2ea2b2 100644 --- a/stripe/test_helpers/_test_clock_service.py +++ b/stripe/test_helpers/_test_clock_service.py @@ -30,6 +30,7 @@ class TestClockService(StripeService): def delete( self, test_clock: str, + /, params: Optional["TestClockDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TestClock": @@ -52,6 +53,7 @@ def delete( async def delete_async( self, test_clock: str, + /, params: Optional["TestClockDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TestClock": @@ -74,6 +76,7 @@ async def delete_async( def retrieve( self, test_clock: str, + /, params: Optional["TestClockRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TestClock": @@ -96,6 +99,7 @@ def retrieve( async def retrieve_async( self, test_clock: str, + /, params: Optional["TestClockRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TestClock": @@ -194,6 +198,7 @@ async def create_async( def advance( self, test_clock: str, + /, params: "TestClockAdvanceParams", options: Optional["RequestOptions"] = None, ) -> "TestClock": @@ -216,6 +221,7 @@ def advance( async def advance_async( self, test_clock: str, + /, params: "TestClockAdvanceParams", options: Optional["RequestOptions"] = None, ) -> "TestClock": diff --git a/stripe/test_helpers/issuing/_authorization_service.py b/stripe/test_helpers/issuing/_authorization_service.py index df546d3f9..23f40f7c9 100644 --- a/stripe/test_helpers/issuing/_authorization_service.py +++ b/stripe/test_helpers/issuing/_authorization_service.py @@ -73,6 +73,7 @@ async def create_async( def capture( self, authorization: str, + /, params: Optional["AuthorizationCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -95,6 +96,7 @@ def capture( async def capture_async( self, authorization: str, + /, params: Optional["AuthorizationCaptureParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -117,6 +119,7 @@ async def capture_async( def expire( self, authorization: str, + /, params: Optional["AuthorizationExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -139,6 +142,7 @@ def expire( async def expire_async( self, authorization: str, + /, params: Optional["AuthorizationExpireParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -161,6 +165,7 @@ async def expire_async( def finalize_amount( self, authorization: str, + /, params: "AuthorizationFinalizeAmountParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -183,6 +188,7 @@ def finalize_amount( async def finalize_amount_async( self, authorization: str, + /, params: "AuthorizationFinalizeAmountParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -205,6 +211,7 @@ async def finalize_amount_async( def respond( self, authorization: str, + /, params: "AuthorizationRespondParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -227,6 +234,7 @@ def respond( async def respond_async( self, authorization: str, + /, params: "AuthorizationRespondParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -249,6 +257,7 @@ async def respond_async( def increment( self, authorization: str, + /, params: "AuthorizationIncrementParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -271,6 +280,7 @@ def increment( async def increment_async( self, authorization: str, + /, params: "AuthorizationIncrementParams", options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -293,6 +303,7 @@ async def increment_async( def reverse( self, authorization: str, + /, params: Optional["AuthorizationReverseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": @@ -315,6 +326,7 @@ def reverse( async def reverse_async( self, authorization: str, + /, params: Optional["AuthorizationReverseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Authorization": diff --git a/stripe/test_helpers/issuing/_card_service.py b/stripe/test_helpers/issuing/_card_service.py index 8aaf8937b..ad0e1a573 100644 --- a/stripe/test_helpers/issuing/_card_service.py +++ b/stripe/test_helpers/issuing/_card_service.py @@ -29,6 +29,7 @@ class CardService(StripeService): def deliver_card( self, card: str, + /, params: Optional["CardDeliverCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -51,6 +52,7 @@ def deliver_card( async def deliver_card_async( self, card: str, + /, params: Optional["CardDeliverCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -73,6 +75,7 @@ async def deliver_card_async( def fail_card( self, card: str, + /, params: Optional["CardFailCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -95,6 +98,7 @@ def fail_card( async def fail_card_async( self, card: str, + /, params: Optional["CardFailCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -117,6 +121,7 @@ async def fail_card_async( def return_card( self, card: str, + /, params: Optional["CardReturnCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -139,6 +144,7 @@ def return_card( async def return_card_async( self, card: str, + /, params: Optional["CardReturnCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -161,6 +167,7 @@ async def return_card_async( def ship_card( self, card: str, + /, params: Optional["CardShipCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -183,6 +190,7 @@ def ship_card( async def ship_card_async( self, card: str, + /, params: Optional["CardShipCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -205,6 +213,7 @@ async def ship_card_async( def submit_card( self, card: str, + /, params: Optional["CardSubmitCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": @@ -227,6 +236,7 @@ def submit_card( async def submit_card_async( self, card: str, + /, params: Optional["CardSubmitCardParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Card": diff --git a/stripe/test_helpers/issuing/_personalization_design_service.py b/stripe/test_helpers/issuing/_personalization_design_service.py index 4079e8352..ca6adc3d7 100644 --- a/stripe/test_helpers/issuing/_personalization_design_service.py +++ b/stripe/test_helpers/issuing/_personalization_design_service.py @@ -23,6 +23,7 @@ class PersonalizationDesignService(StripeService): def activate( self, personalization_design: str, + /, params: Optional["PersonalizationDesignActivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -45,6 +46,7 @@ def activate( async def activate_async( self, personalization_design: str, + /, params: Optional["PersonalizationDesignActivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -67,6 +69,7 @@ async def activate_async( def deactivate( self, personalization_design: str, + /, params: Optional["PersonalizationDesignDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -89,6 +92,7 @@ def deactivate( async def deactivate_async( self, personalization_design: str, + /, params: Optional["PersonalizationDesignDeactivateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -111,6 +115,7 @@ async def deactivate_async( def reject( self, personalization_design: str, + /, params: "PersonalizationDesignRejectParams", options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": @@ -133,6 +138,7 @@ def reject( async def reject_async( self, personalization_design: str, + /, params: "PersonalizationDesignRejectParams", options: Optional["RequestOptions"] = None, ) -> "PersonalizationDesign": diff --git a/stripe/test_helpers/issuing/_transaction_service.py b/stripe/test_helpers/issuing/_transaction_service.py index fcd28302d..f2c60fa63 100644 --- a/stripe/test_helpers/issuing/_transaction_service.py +++ b/stripe/test_helpers/issuing/_transaction_service.py @@ -23,6 +23,7 @@ class TransactionService(StripeService): def refund( self, transaction: str, + /, params: Optional["TransactionRefundParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -45,6 +46,7 @@ def refund( async def refund_async( self, transaction: str, + /, params: Optional["TransactionRefundParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/test_helpers/shared_payment/_granted_token_service.py b/stripe/test_helpers/shared_payment/_granted_token_service.py index 66bfd21b2..a02a8bca7 100644 --- a/stripe/test_helpers/shared_payment/_granted_token_service.py +++ b/stripe/test_helpers/shared_payment/_granted_token_service.py @@ -58,6 +58,7 @@ async def create_async( def revoke( self, shared_payment_granted_token: str, + /, params: Optional["GrantedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": @@ -82,6 +83,7 @@ def revoke( async def revoke_async( self, shared_payment_granted_token: str, + /, params: Optional["GrantedTokenRevokeParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GrantedToken": diff --git a/stripe/test_helpers/terminal/_reader_service.py b/stripe/test_helpers/terminal/_reader_service.py index 307b8d19a..57d6aa575 100644 --- a/stripe/test_helpers/terminal/_reader_service.py +++ b/stripe/test_helpers/terminal/_reader_service.py @@ -23,6 +23,7 @@ class ReaderService(StripeService): def present_payment_method( self, reader: str, + /, params: Optional["ReaderPresentPaymentMethodParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -45,6 +46,7 @@ def present_payment_method( async def present_payment_method_async( self, reader: str, + /, params: Optional["ReaderPresentPaymentMethodParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -67,6 +69,7 @@ async def present_payment_method_async( def succeed_input_collection( self, reader: str, + /, params: Optional["ReaderSucceedInputCollectionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -89,6 +92,7 @@ def succeed_input_collection( async def succeed_input_collection_async( self, reader: str, + /, params: Optional["ReaderSucceedInputCollectionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -111,6 +115,7 @@ async def succeed_input_collection_async( def timeout_input_collection( self, reader: str, + /, params: Optional["ReaderTimeoutInputCollectionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": @@ -133,6 +138,7 @@ def timeout_input_collection( async def timeout_input_collection_async( self, reader: str, + /, params: Optional["ReaderTimeoutInputCollectionParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Reader": diff --git a/stripe/test_helpers/treasury/_inbound_transfer_service.py b/stripe/test_helpers/treasury/_inbound_transfer_service.py index c37255e54..13402c931 100644 --- a/stripe/test_helpers/treasury/_inbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_inbound_transfer_service.py @@ -23,6 +23,7 @@ class InboundTransferService(StripeService): def fail( self, id: str, + /, params: Optional["InboundTransferFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -45,6 +46,7 @@ def fail( async def fail_async( self, id: str, + /, params: Optional["InboundTransferFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -67,6 +69,7 @@ async def fail_async( def return_inbound_transfer( self, id: str, + /, params: Optional["InboundTransferReturnInboundTransferParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -89,6 +92,7 @@ def return_inbound_transfer( async def return_inbound_transfer_async( self, id: str, + /, params: Optional["InboundTransferReturnInboundTransferParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -111,6 +115,7 @@ async def return_inbound_transfer_async( def succeed( self, id: str, + /, params: Optional["InboundTransferSucceedParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -133,6 +138,7 @@ def succeed( async def succeed_async( self, id: str, + /, params: Optional["InboundTransferSucceedParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": diff --git a/stripe/test_helpers/treasury/_outbound_payment_service.py b/stripe/test_helpers/treasury/_outbound_payment_service.py index 42aff8495..e3c187e54 100644 --- a/stripe/test_helpers/treasury/_outbound_payment_service.py +++ b/stripe/test_helpers/treasury/_outbound_payment_service.py @@ -26,6 +26,7 @@ class OutboundPaymentService(StripeService): def update( self, id: str, + /, params: "OutboundPaymentUpdateParams", options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -48,6 +49,7 @@ def update( async def update_async( self, id: str, + /, params: "OutboundPaymentUpdateParams", options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -70,6 +72,7 @@ async def update_async( def fail( self, id: str, + /, params: Optional["OutboundPaymentFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -92,6 +95,7 @@ def fail( async def fail_async( self, id: str, + /, params: Optional["OutboundPaymentFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -114,6 +118,7 @@ async def fail_async( def post( self, id: str, + /, params: Optional["OutboundPaymentPostParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -136,6 +141,7 @@ def post( async def post_async( self, id: str, + /, params: Optional["OutboundPaymentPostParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -158,6 +164,7 @@ async def post_async( def return_outbound_payment( self, id: str, + /, params: Optional["OutboundPaymentReturnOutboundPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -180,6 +187,7 @@ def return_outbound_payment( async def return_outbound_payment_async( self, id: str, + /, params: Optional["OutboundPaymentReturnOutboundPaymentParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": diff --git a/stripe/test_helpers/treasury/_outbound_transfer_service.py b/stripe/test_helpers/treasury/_outbound_transfer_service.py index 68ffe4fba..eca1872cd 100644 --- a/stripe/test_helpers/treasury/_outbound_transfer_service.py +++ b/stripe/test_helpers/treasury/_outbound_transfer_service.py @@ -26,6 +26,7 @@ class OutboundTransferService(StripeService): def update( self, outbound_transfer: str, + /, params: "OutboundTransferUpdateParams", options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -48,6 +49,7 @@ def update( async def update_async( self, outbound_transfer: str, + /, params: "OutboundTransferUpdateParams", options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -70,6 +72,7 @@ async def update_async( def fail( self, outbound_transfer: str, + /, params: Optional["OutboundTransferFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -92,6 +95,7 @@ def fail( async def fail_async( self, outbound_transfer: str, + /, params: Optional["OutboundTransferFailParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -114,6 +118,7 @@ async def fail_async( def post( self, outbound_transfer: str, + /, params: Optional["OutboundTransferPostParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -136,6 +141,7 @@ def post( async def post_async( self, outbound_transfer: str, + /, params: Optional["OutboundTransferPostParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -158,6 +164,7 @@ async def post_async( def return_outbound_transfer( self, outbound_transfer: str, + /, params: Optional[ "OutboundTransferReturnOutboundTransferParams" ] = None, @@ -182,6 +189,7 @@ def return_outbound_transfer( async def return_outbound_transfer_async( self, outbound_transfer: str, + /, params: Optional[ "OutboundTransferReturnOutboundTransferParams" ] = None, diff --git a/stripe/three_d_secure/__init__.py b/stripe/three_d_secure/__init__.py new file mode 100644 index 000000000..bcc75aaae --- /dev/null +++ b/stripe/three_d_secure/__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.three_d_secure._authentication import ( + Authentication as Authentication, + ) + from stripe.three_d_secure._authentication_service import ( + AuthenticationService as AuthenticationService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Authentication": ("stripe.three_d_secure._authentication", False), + "AuthenticationService": ( + "stripe.three_d_secure._authentication_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/three_d_secure/_authentication.py b/stripe/three_d_secure/_authentication.py new file mode 100644 index 000000000..52a037291 --- /dev/null +++ b/stripe/three_d_secure/_authentication.py @@ -0,0 +1,829 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._stripe_object import StripeObject, UntypedStripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Optional, Union, cast, overload +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._payment_method import PaymentMethod + from stripe.params.three_d_secure._authentication_cancel_params import ( + AuthenticationCancelParams, + ) + from stripe.params.three_d_secure._authentication_create_params import ( + AuthenticationCreateParams, + ) + from stripe.params.three_d_secure._authentication_list_params import ( + AuthenticationListParams, + ) + from stripe.params.three_d_secure._authentication_retrieve_params import ( + AuthenticationRetrieveParams, + ) + from stripe.params.three_d_secure._authentication_submit_params import ( + AuthenticationSubmitParams, + ) + + +class Authentication( + CreateableAPIResource["Authentication"], + ListableAPIResource["Authentication"], +): + """ + The Standalone 3DS API allows you to run EMV 3D Secure (3DS) authentication using Stripe while authorizing the payment with any PSP. + + Related guide: [Standalone 3DS](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure) + """ + + OBJECT_NAME: ClassVar[Literal["three_d_secure.authentication"]] = ( + "three_d_secure.authentication" + ) + + class AcquirerDetails(StripeObject): + acquirer_bin: Optional[str] + """ + The Acquirer BIN (specific to the directory_server). + """ + acquirer_country: Optional[str] + """ + The two-letter country code of the acquirer ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + acquirer_merchant_id: Optional[str] + """ + The Merchant ID (or Card Acceptor ID) that your acquirer assigned you (specific to the directory_server). + """ + mcc: Optional[str] + """ + The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) as defined by each payment system or directory server. + """ + merchant_name: Optional[str] + """ + The merchant name assigned by the acquirer or payment system. Same name used in the authorization message as defined in [ISO 8583](https://en.wikipedia.org/wiki/ISO_8583). + """ + requestor_id: Optional[str] + """ + Requestor ID if you're enrolled in the card network's 3DS program. Otherwise, you can omit this field because Stripe assigns a Requestor ID with the card networks. + """ + + class Channel(StripeObject): + class Browser(StripeObject): + accept_header: str + """ + The HTTP accept headers from the cardholder's browser. + """ + color_depth: Optional[int] + """ + The color depth of the cardholder's screen. + """ + ip_address: str + """ + The IP address of the browser. + """ + java_enabled: Optional[bool] + """ + The cardholder browser's ability to execute Java. + """ + javascript_enabled: bool + """ + The cardholder browser's ability to execute JavaScript. + """ + language: str + """ + An IETF BCP 47 language tag representing the browser language. + """ + screen_height: Optional[int] + """ + The total height of the cardholder's screen in pixels. + """ + screen_width: Optional[int] + """ + The total width of the cardholder's screen in pixels. + """ + timezone_offset: Optional[int] + """ + The time difference between UTC time and the local time of the cardholder's browser, in minutes. + """ + user_agent: str + """ + The browser user agent. + """ + + class ThreeRI(StripeObject): + previous_authentication: str + """ + ID of the previous initial authenticated 3DS Authentication object. + """ + type: Union[ + Literal[ + "delayed_shipment", + "other_payment", + "recurring", + "split_shipment", + ], + str, + ] + """ + Type of the 3RI Authentication. + """ + + browser: Optional[Browser] + """ + Contains details on the browser for a standalone 3DS Authentication. + """ + three_r_i: Optional[ThreeRI] + """ + Contains details for a 3RI standalone 3DS Authentication. + """ + type: Union[Literal["browser", "three_r_i"], str] + """ + Type of channel you would prefer to use for this 3DS Authentication. Only browser. + """ + _inner_class_types = {"browser": Browser, "three_r_i": ThreeRI} + + class FlowPreference(StripeObject): + class Challenge(StripeObject): + type: Union[Literal["mandated", "preferred"], str] + """ + Type of challenge flow you requested for this 3DS Authentication. + """ + + class DataShare(StripeObject): + type: Union[Literal["ds_specific", "emv_standard"], str] + """ + Type of data share flow you requested for this 3DS Authentication. + """ + + class Frictionless(StripeObject): + type: Union[Literal["low_risk", "none"], str] + """ + Type of frictionless flow you requested for this 3DS Authentication. + """ + + challenge: Optional[Challenge] + data_share: Optional[DataShare] + frictionless: Optional[Frictionless] + type: Union[Literal["challenge", "data_share", "frictionless"], str] + """ + Type of flow you requested for this 3DS Authentication. + """ + _inner_class_types = { + "challenge": Challenge, + "data_share": DataShare, + "frictionless": Frictionless, + } + + class FutureUsage(StripeObject): + class Installment(StripeObject): + class Expiry(StripeObject): + date: Optional[str] + type: Union[Literal["date", "never"], str] + + amount: Optional[int] + """ + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + """ + expiry: Expiry + """ + Information about recurring payment expiry + """ + interval: Literal["day"] + """ + The unit of time for `interval_count`. + """ + interval_count: int + """ + The minimum number of time intervals between authorizations. + """ + number: int + """ + The maximum number of installments. + """ + _inner_class_types = {"expiry": Expiry} + + class Recurring(StripeObject): + class Expiry(StripeObject): + date: Optional[str] + type: Union[Literal["date", "never"], str] + + amount: Optional[int] + """ + A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + """ + expiry: Expiry + """ + Information about recurring payment expiry + """ + interval: Literal["day"] + """ + The unit of time for `interval_count`. + """ + interval_count: int + """ + The minimum number of time intervals between authorizations. + """ + _inner_class_types = {"expiry": Expiry} + + installment: Optional[Installment] + """ + Details about installment payments + """ + recurring: Optional[Recurring] + """ + Details about recurring payments + """ + type: Union[Literal["card_on_file", "installment", "recurring"], str] + """ + The type of future usage declared for this 3DS Authentication. + """ + _inner_class_types = { + "installment": Installment, + "recurring": Recurring, + } + + class OutcomeDetails(StripeObject): + class NetworkDetails(StripeObject): + class CartesBancaires(StripeObject): + avalgo: str + """ + The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as cavvAlgorithm. ARes/RReq messageExtension: `CB-AVALGO` + """ + cb_exemption: Optional[str] + """ + The exemption indicator returned from Cartes Bancaires in the ARes. This is a 3 byte bitmap (lowest significant byte first and most significant bit first) that has been Base64 encoded. String (4 characters). ARes message extension: `CB-EXEMPTION` + """ + cb_score: Optional[str] + """ + The risk score returned from Cartes Bancaires in the ARes. Numeric value 0-99. ARes/RReq message extension: `CB-SCORE` + """ + + cartes_bancaires: Optional[CartesBancaires] + """ + Contains details for Cartes Bancaires specific fields in the authentication outcomes. + """ + _inner_class_types = {"cartes_bancaires": CartesBancaires} + + acs_transaction_id: Optional[str] + """ + Universally unique transaction identifier assigned by the issuer to identify the transaction. + """ + ares: Optional[str] + """ + The Authentication Response Message (ARes) is the issuer's response to the AReq message. + """ + ares_trans_status: Optional[ + Union[Literal["A", "C", "D", "I", "N", "R", "S", "U", "Y"], str] + ] + """ + TransStatus field on the ARes + """ + cryptogram: Optional[str] + """ + A 28-character Base64 string proving that 3DS was completed. Store this value securely, and don't reuse it for multiple authorizations. + """ + ds_transaction_id: Optional[str] + """ + The 3DS2 Directory Server Transaction ID. + """ + eci: Optional[str] + """ + Electronic Commerce Indicator provided by the issuer to indicate the result of this 3DS Authentication. + """ + network_details: Optional[NetworkDetails] + """ + Contains details specific to the individual network. + """ + protocol_version: Union[Literal["2.1.0", "2.2.0", "2.3.1"], str] + """ + The 3DS protocol version used for this 3DS Authentication. + """ + requestor_challenge_indicator: Optional[ + Union[Literal["01", "02", "03", "04", "05", "06"], str] + ] + """ + The indicator provided to the issuer by Stripe in the AReq that indicates whether a challenge is requested for this Authentication. This indicator should match the flow_preference you specified but may be overridden (for compliance reasons for example). + """ + rreq: Optional[str] + """ + The Results Request Message (RReq) communicates the results of the authentication or verification. + """ + rreq_trans_status: Optional[ + Union[Literal["A", "C", "D", "I", "N", "R", "S", "U", "Y"], str] + ] + """ + TransStatus field on the RReq + """ + three_ds_server_transaction_id: str + """ + Universally unique transaction identifier assigned by Stripe to identify the transaction. + """ + _inner_class_types = {"network_details": NetworkDetails} + + class ShippingAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + acquirer_details: Optional[AcquirerDetails] + """ + Contains additional details about the acquirer for a 3DS Authentication. + """ + amount: Optional[int] + """ + The amount for this 3DS Authentication. + """ + challenge_url: Optional[str] + """ + The URL for presenting a challenge to your cardholder, present if status is requires_challenge. + """ + channel: Channel + """ + Contains details on the channel used (browser, 3RI) for a standalone 3DS Authentication. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + currency: Optional[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). + """ + directory_server: Union[ + Literal[ + "american_express", + "cartes_bancaires", + "discover", + "mastercard", + "visa", + ], + str, + ] + """ + The 3DS directory server with which this 3DS Authentication was processed. + """ + fingerprinting_url: Optional[str] + """ + The URL for performing issuer fingerprinting, present if fingerprinting is supported for the given payment method. + """ + flow_preference: Optional[FlowPreference] + """ + Contains details of the flow preference used for a standalone 3DS Authentication. + """ + future_usage: Optional[FutureUsage] + """ + Contains information about the future authorisations related to this authentication + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + message_category: Union[ + Literal["non_payment_authentication", "payment_authentication"], str + ] + """ + Indicates whether this 3DS Authentication is being performed for a payment or non-payment use case. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["three_d_secure.authentication"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + outcome: Optional[ + Union[ + Literal[ + "abandoned", + "attempt_acknowledged", + "authenticated", + "canceled", + "denied", + "informational", + "internal_error", + "not_supported", + "not_triggered", + "processing_error", + "rejected", + ], + str, + ] + ] + """ + The outcome of this 3DS Authentication. + """ + outcome_details: Optional[OutcomeDetails] + """ + Contains details on the result for a standalone 3DS Authentication. + """ + payment_method: ExpandableField["PaymentMethod"] + """ + ID of the payment method (a PaymentMethod object) to attach to this 3DS Authentication. + """ + reason: Optional[ + Union[ + Literal[ + "cardholder_authentication", + "issuer_requested", + "liability_shift", + "processing_costs", + "regulatory_compliance", + ], + str, + ] + ] + """ + The reason for invoking this 3DS Authentication. + """ + shipping_address: Optional[ShippingAddress] + """ + Contains details about the shipping address for a 3DS Authentication. + """ + status: Union[ + Literal[ + "canceled", + "error", + "failed", + "requires_challenge", + "requires_submission", + "succeeded", + ], + str, + ] + """ + Status of this Authentication. + """ + + @classmethod + def _cls_cancel( + cls, + authentication: str, + /, + **params: Unpack["AuthenticationCancelParams"], + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + cls._static_request( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(authentication) + ), + params=params, + ), + ) + + @overload + @staticmethod + def cancel( + authentication: str, /, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + ... + + @overload + def cancel( + self, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + ... + + @class_method_variant("_cls_cancel") + def cancel( + self, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + self._request( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_cancel_async( + cls, + authentication: str, + /, + **params: Unpack["AuthenticationCancelParams"], + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + await cls._static_request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(authentication) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def cancel_async( + authentication: str, /, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + ... + + @overload + async def cancel_async( + self, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + ... + + @class_method_variant("_cls_cancel_async") + async def cancel_async( + self, **params: Unpack["AuthenticationCancelParams"] + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + await self._request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create( + cls, **params: Unpack["AuthenticationCreateParams"] + ) -> "Authentication": + """ + This endpoint creates a 3DS Authentication. Refer to the [Create a 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#create-a-3ds-authentication-object) for more information. + + You can pass the submit parameter to automatically submit the 3DS Authentication object when you create it. Refer to the [Submit at creation section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-at-creation) for more information. + """ + return cast( + "Authentication", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["AuthenticationCreateParams"] + ) -> "Authentication": + """ + This endpoint creates a 3DS Authentication. Refer to the [Create a 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#create-a-3ds-authentication-object) for more information. + + You can pass the submit parameter to automatically submit the 3DS Authentication object when you create it. Refer to the [Submit at creation section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-at-creation) for more information. + """ + return cast( + "Authentication", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["AuthenticationListParams"] + ) -> ListObject["Authentication"]: + """ + Returns a list of 3D Secure Authentications. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["AuthenticationListParams"] + ) -> ListObject["Authentication"]: + """ + Returns a list of 3D Secure Authentications. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["AuthenticationRetrieveParams"] + ) -> "Authentication": + """ + This endpoint retrieves a 3DS Authentication. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["AuthenticationRetrieveParams"] + ) -> "Authentication": + """ + This endpoint retrieves a 3DS Authentication. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def _cls_submit( + cls, + authentication: str, + /, + **params: Unpack["AuthenticationSubmitParams"], + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + cls._static_request( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(authentication) + ), + params=params, + ), + ) + + @overload + @staticmethod + def submit( + authentication: str, /, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + ... + + @overload + def submit( + self, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + ... + + @class_method_variant("_cls_submit") + def submit( + self, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + self._request( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_submit_async( + cls, + authentication: str, + /, + **params: Unpack["AuthenticationSubmitParams"], + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + await cls._static_request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(authentication) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def submit_async( + authentication: str, /, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + ... + + @overload + async def submit_async( + self, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + ... + + @class_method_variant("_cls_submit_async") + async def submit_async( + self, **params: Unpack["AuthenticationSubmitParams"] + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + await self._request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + _inner_class_types = { + "acquirer_details": AcquirerDetails, + "channel": Channel, + "flow_preference": FlowPreference, + "future_usage": FutureUsage, + "outcome_details": OutcomeDetails, + "shipping_address": ShippingAddress, + } diff --git a/stripe/three_d_secure/_authentication_service.py b/stripe/three_d_secure/_authentication_service.py new file mode 100644 index 000000000..5b948b72d --- /dev/null +++ b/stripe/three_d_secure/_authentication_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._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.params.three_d_secure._authentication_cancel_params import ( + AuthenticationCancelParams, + ) + from stripe.params.three_d_secure._authentication_create_params import ( + AuthenticationCreateParams, + ) + from stripe.params.three_d_secure._authentication_list_params import ( + AuthenticationListParams, + ) + from stripe.params.three_d_secure._authentication_retrieve_params import ( + AuthenticationRetrieveParams, + ) + from stripe.params.three_d_secure._authentication_submit_params import ( + AuthenticationSubmitParams, + ) + from stripe.three_d_secure._authentication import Authentication + + +class AuthenticationService(StripeService): + def list( + self, + params: Optional["AuthenticationListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Authentication]": + """ + Returns a list of 3D Secure Authentications. + """ + return cast( + "ListObject[Authentication]", + self._request( + "get", + "/v1/three_d_secure/authentications", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["AuthenticationListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Authentication]": + """ + Returns a list of 3D Secure Authentications. + """ + return cast( + "ListObject[Authentication]", + await self._request_async( + "get", + "/v1/three_d_secure/authentications", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "AuthenticationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint creates a 3DS Authentication. Refer to the [Create a 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#create-a-3ds-authentication-object) for more information. + + You can pass the submit parameter to automatically submit the 3DS Authentication object when you create it. Refer to the [Submit at creation section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-at-creation) for more information. + """ + return cast( + "Authentication", + self._request( + "post", + "/v1/three_d_secure/authentications", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "AuthenticationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint creates a 3DS Authentication. Refer to the [Create a 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#create-a-3ds-authentication-object) for more information. + + You can pass the submit parameter to automatically submit the 3DS Authentication object when you create it. Refer to the [Submit at creation section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-at-creation) for more information. + """ + return cast( + "Authentication", + await self._request_async( + "post", + "/v1/three_d_secure/authentications", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + authentication: str, + /, + params: Optional["AuthenticationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint retrieves a 3DS Authentication. + """ + return cast( + "Authentication", + self._request( + "get", + "/v1/three_d_secure/authentications/{authentication}".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + authentication: str, + /, + params: Optional["AuthenticationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint retrieves a 3DS Authentication. + """ + return cast( + "Authentication", + await self._request_async( + "get", + "/v1/three_d_secure/authentications/{authentication}".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + authentication: str, + /, + params: Optional["AuthenticationCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + self._request( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + authentication: str, + /, + params: Optional["AuthenticationCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint cancels a 3DS Authentication. You can cancel a 3DS Authentication object when it's in a non-final status: + requires_submission or requires_challenge. + """ + return cast( + "Authentication", + await self._request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/cancel".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def submit( + self, + authentication: str, + /, + params: Optional["AuthenticationSubmitParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + self._request( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_async( + self, + authentication: str, + /, + params: Optional["AuthenticationSubmitParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Authentication": + """ + This endpoint submits a 3DS Authentication. You can submit a 3DS Authentication object when it has status requires_submission. Refer to the [Submit the 3DS Authentication object section of the Standalone 3DS guide](https://docs.stripe.com/payments/3d-secure/standalone-3d-secure#submit-the-3ds-authentication-object) for more information. + """ + return cast( + "Authentication", + await self._request_async( + "post", + "/v1/three_d_secure/authentications/{authentication}/submit".format( + authentication=sanitize_id(authentication), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 7e5076478..3fe46f7f1 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -26,7 +26,7 @@ class CreditReversal( ListableAPIResource["CreditReversal"], ): """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ OBJECT_NAME: ClassVar[Literal["treasury.credit_reversal"]] = ( diff --git a/stripe/treasury/_credit_reversal_service.py b/stripe/treasury/_credit_reversal_service.py index 1d4407f97..3b0942d6b 100644 --- a/stripe/treasury/_credit_reversal_service.py +++ b/stripe/treasury/_credit_reversal_service.py @@ -100,6 +100,7 @@ async def create_async( def retrieve( self, credit_reversal: str, + /, params: Optional["CreditReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditReversal": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, credit_reversal: str, + /, params: Optional["CreditReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CreditReversal": diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 39e149e11..379541f5e 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -26,7 +26,7 @@ class DebitReversal( ListableAPIResource["DebitReversal"], ): """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ OBJECT_NAME: ClassVar[Literal["treasury.debit_reversal"]] = ( diff --git a/stripe/treasury/_debit_reversal_service.py b/stripe/treasury/_debit_reversal_service.py index f39dd5435..e14134eef 100644 --- a/stripe/treasury/_debit_reversal_service.py +++ b/stripe/treasury/_debit_reversal_service.py @@ -100,6 +100,7 @@ async def create_async( def retrieve( self, debit_reversal: str, + /, params: Optional["DebitReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DebitReversal": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, debit_reversal: str, + /, params: Optional["DebitReversalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DebitReversal": diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index d0eeb343f..5311aaab0 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -92,7 +92,7 @@ class Aba(StripeObject): ABA Records contain U.S. bank account details per the ABA format. """ supported_networks: Optional[ - List[Union[Literal["ach", "us_domestic_wire"], str]] + List[Union[Literal["ach", "rtp", "us_domestic_wire"], str]] ] """ The list of networks that the address supports @@ -268,6 +268,7 @@ class Closed(StripeObject): def _cls_close( cls, financial_account: str, + /, **params: Unpack["FinancialAccountCloseParams"], ) -> "FinancialAccount": """ @@ -287,7 +288,9 @@ def _cls_close( @overload @staticmethod def close( - financial_account: str, **params: Unpack["FinancialAccountCloseParams"] + financial_account: str, + /, + **params: Unpack["FinancialAccountCloseParams"], ) -> "FinancialAccount": """ Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. @@ -304,7 +307,7 @@ def close( ... @class_method_variant("_cls_close") - def close( # pyright: ignore[reportGeneralTypeIssues] + def close( self, **params: Unpack["FinancialAccountCloseParams"] ) -> "FinancialAccount": """ @@ -325,6 +328,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] async def _cls_close_async( cls, financial_account: str, + /, **params: Unpack["FinancialAccountCloseParams"], ) -> "FinancialAccount": """ @@ -344,7 +348,9 @@ async def _cls_close_async( @overload @staticmethod async def close_async( - financial_account: str, **params: Unpack["FinancialAccountCloseParams"] + financial_account: str, + /, + **params: Unpack["FinancialAccountCloseParams"], ) -> "FinancialAccount": """ Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. @@ -361,7 +367,7 @@ async def close_async( ... @class_method_variant("_cls_close_async") - async def close_async( # pyright: ignore[reportGeneralTypeIssues] + async def close_async( self, **params: Unpack["FinancialAccountCloseParams"] ) -> "FinancialAccount": """ @@ -452,7 +458,7 @@ async def list_async( @classmethod def modify( - cls, id: str, **params: Unpack["FinancialAccountModifyParams"] + cls, id: str, /, **params: Unpack["FinancialAccountModifyParams"] ) -> "FinancialAccount": """ Updates the details of a FinancialAccount. @@ -469,7 +475,7 @@ def modify( @classmethod async def modify_async( - cls, id: str, **params: Unpack["FinancialAccountModifyParams"] + cls, id: str, /, **params: Unpack["FinancialAccountModifyParams"] ) -> "FinancialAccount": """ Updates the details of a FinancialAccount. @@ -510,6 +516,7 @@ async def retrieve_async( def _cls_retrieve_features( cls, financial_account: str, + /, **params: Unpack["FinancialAccountRetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -530,6 +537,7 @@ def _cls_retrieve_features( @staticmethod def retrieve_features( financial_account: str, + /, **params: Unpack["FinancialAccountRetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -547,7 +555,7 @@ def retrieve_features( ... @class_method_variant("_cls_retrieve_features") - def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] + def retrieve_features( self, **params: Unpack["FinancialAccountRetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -568,6 +576,7 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] async def _cls_retrieve_features_async( cls, financial_account: str, + /, **params: Unpack["FinancialAccountRetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -588,6 +597,7 @@ async def _cls_retrieve_features_async( @staticmethod async def retrieve_features_async( financial_account: str, + /, **params: Unpack["FinancialAccountRetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -605,7 +615,7 @@ async def retrieve_features_async( ... @class_method_variant("_cls_retrieve_features_async") - async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] + async def retrieve_features_async( self, **params: Unpack["FinancialAccountRetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -626,6 +636,7 @@ async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_update_features( cls, financial_account: str, + /, **params: Unpack["FinancialAccountUpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -646,6 +657,7 @@ def _cls_update_features( @staticmethod def update_features( financial_account: str, + /, **params: Unpack["FinancialAccountUpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -663,7 +675,7 @@ def update_features( ... @class_method_variant("_cls_update_features") - def update_features( # pyright: ignore[reportGeneralTypeIssues] + def update_features( self, **params: Unpack["FinancialAccountUpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -684,6 +696,7 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] async def _cls_update_features_async( cls, financial_account: str, + /, **params: Unpack["FinancialAccountUpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -704,6 +717,7 @@ async def _cls_update_features_async( @staticmethod async def update_features_async( financial_account: str, + /, **params: Unpack["FinancialAccountUpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ @@ -721,7 +735,7 @@ async def update_features_async( ... @class_method_variant("_cls_update_features_async") - async def update_features_async( # pyright: ignore[reportGeneralTypeIssues] + async def update_features_async( self, **params: Unpack["FinancialAccountUpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ diff --git a/stripe/treasury/_financial_account_features_service.py b/stripe/treasury/_financial_account_features_service.py index b89cec2d7..f526ea9c0 100644 --- a/stripe/treasury/_financial_account_features_service.py +++ b/stripe/treasury/_financial_account_features_service.py @@ -22,6 +22,7 @@ class FinancialAccountFeaturesService(StripeService): def update( self, financial_account: str, + /, params: Optional["FinancialAccountFeaturesUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccountFeatures": @@ -44,6 +45,7 @@ def update( async def update_async( self, financial_account: str, + /, params: Optional["FinancialAccountFeaturesUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccountFeatures": @@ -66,6 +68,7 @@ async def update_async( def retrieve( self, financial_account: str, + /, params: Optional["FinancialAccountFeaturesRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccountFeatures": @@ -88,6 +91,7 @@ def retrieve( async def retrieve_async( self, financial_account: str, + /, params: Optional["FinancialAccountFeaturesRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccountFeatures": diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 269b67ec4..9f3542c6f 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -138,6 +138,7 @@ async def create_async( def retrieve( self, financial_account: str, + /, params: Optional["FinancialAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -160,6 +161,7 @@ def retrieve( async def retrieve_async( self, financial_account: str, + /, params: Optional["FinancialAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -182,6 +184,7 @@ async def retrieve_async( def update( self, financial_account: str, + /, params: Optional["FinancialAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -204,6 +207,7 @@ def update( async def update_async( self, financial_account: str, + /, params: Optional["FinancialAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -226,6 +230,7 @@ async def update_async( def close( self, financial_account: str, + /, params: Optional["FinancialAccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -248,6 +253,7 @@ def close( async def close_async( self, financial_account: str, + /, params: Optional["FinancialAccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 1c3b31675..40f845dee 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -41,7 +41,7 @@ class InboundTransfer( ListableAPIResource["InboundTransfer"], ): """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -201,7 +201,7 @@ class StatusTransitions(StripeObject): """ failure_details: Optional[FailureDetails] """ - Details about this InboundTransfer's failure. Only set when status is `failed`. + Details about this InboundTransfer's failure. Will be set when `status=failed` or `returned=true`. """ financial_account: str """ @@ -260,6 +260,7 @@ class StatusTransitions(StripeObject): def _cls_cancel( cls, inbound_transfer: str, + /, **params: Unpack["InboundTransferCancelParams"], ) -> "InboundTransfer": """ @@ -279,7 +280,9 @@ def _cls_cancel( @overload @staticmethod def cancel( - inbound_transfer: str, **params: Unpack["InboundTransferCancelParams"] + inbound_transfer: str, + /, + **params: Unpack["InboundTransferCancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -296,7 +299,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["InboundTransferCancelParams"] ) -> "InboundTransfer": """ @@ -317,6 +320,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, inbound_transfer: str, + /, **params: Unpack["InboundTransferCancelParams"], ) -> "InboundTransfer": """ @@ -336,7 +340,9 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - inbound_transfer: str, **params: Unpack["InboundTransferCancelParams"] + inbound_transfer: str, + /, + **params: Unpack["InboundTransferCancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -353,7 +359,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["InboundTransferCancelParams"] ) -> "InboundTransfer": """ @@ -469,7 +475,7 @@ class TestHelpers(APIResourceTestHelpers["InboundTransfer"]): @classmethod def _cls_fail( - cls, id: str, **params: Unpack["InboundTransferFailParams"] + cls, id: str, /, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -488,7 +494,7 @@ def _cls_fail( @overload @staticmethod def fail( - id: str, **params: Unpack["InboundTransferFailParams"] + id: str, /, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -505,7 +511,7 @@ def fail( ... @class_method_variant("_cls_fail") - def fail( # pyright: ignore[reportGeneralTypeIssues] + def fail( self, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ @@ -524,7 +530,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_fail_async( - cls, id: str, **params: Unpack["InboundTransferFailParams"] + cls, id: str, /, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -543,7 +549,7 @@ async def _cls_fail_async( @overload @staticmethod async def fail_async( - id: str, **params: Unpack["InboundTransferFailParams"] + id: str, /, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -560,7 +566,7 @@ async def fail_async( ... @class_method_variant("_cls_fail_async") - async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + async def fail_async( self, **params: Unpack["InboundTransferFailParams"] ) -> "InboundTransfer": """ @@ -581,6 +587,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_inbound_transfer( cls, id: str, + /, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": """ @@ -601,6 +608,7 @@ def _cls_return_inbound_transfer( @staticmethod def return_inbound_transfer( id: str, + /, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": """ @@ -619,7 +627,7 @@ def return_inbound_transfer( ... @class_method_variant("_cls_return_inbound_transfer") - def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] + def return_inbound_transfer( self, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": @@ -641,6 +649,7 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_inbound_transfer_async( cls, id: str, + /, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": """ @@ -661,6 +670,7 @@ async def _cls_return_inbound_transfer_async( @staticmethod async def return_inbound_transfer_async( id: str, + /, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": """ @@ -679,7 +689,7 @@ async def return_inbound_transfer_async( ... @class_method_variant("_cls_return_inbound_transfer_async") - async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] + async def return_inbound_transfer_async( self, **params: Unpack["InboundTransferReturnInboundTransferParams"], ) -> "InboundTransfer": @@ -699,7 +709,7 @@ async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIss @classmethod def _cls_succeed( - cls, id: str, **params: Unpack["InboundTransferSucceedParams"] + cls, id: str, /, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -718,7 +728,7 @@ def _cls_succeed( @overload @staticmethod def succeed( - id: str, **params: Unpack["InboundTransferSucceedParams"] + id: str, /, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -735,7 +745,7 @@ def succeed( ... @class_method_variant("_cls_succeed") - def succeed( # pyright: ignore[reportGeneralTypeIssues] + def succeed( self, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ @@ -754,7 +764,7 @@ def succeed( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_succeed_async( - cls, id: str, **params: Unpack["InboundTransferSucceedParams"] + cls, id: str, /, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -773,7 +783,7 @@ async def _cls_succeed_async( @overload @staticmethod async def succeed_async( - id: str, **params: Unpack["InboundTransferSucceedParams"] + id: str, /, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -790,7 +800,7 @@ async def succeed_async( ... @class_method_variant("_cls_succeed_async") - async def succeed_async( # pyright: ignore[reportGeneralTypeIssues] + async def succeed_async( self, **params: Unpack["InboundTransferSucceedParams"] ) -> "InboundTransfer": """ diff --git a/stripe/treasury/_inbound_transfer_service.py b/stripe/treasury/_inbound_transfer_service.py index 7ce66d3e5..91a68a098 100644 --- a/stripe/treasury/_inbound_transfer_service.py +++ b/stripe/treasury/_inbound_transfer_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["InboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["InboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -147,6 +149,7 @@ async def retrieve_async( def cancel( self, inbound_transfer: str, + /, params: Optional["InboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -169,6 +172,7 @@ def cancel( async def cancel_async( self, inbound_transfer: str, + /, params: Optional["InboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 6cc41a812..c4fedcf36 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -44,7 +44,7 @@ class OutboundPayment( ListableAPIResource["OutboundPayment"], ): """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -300,7 +300,7 @@ class UsDomesticWire(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - purpose: Optional[Literal["payroll"]] + purpose: Optional[Union[Literal["payroll"], str]] """ The purpose of the OutboundPayment, if applicable. """ @@ -330,7 +330,7 @@ class UsDomesticWire(StripeObject): @classmethod def _cls_cancel( - cls, id: str, **params: Unpack["OutboundPaymentCancelParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -349,7 +349,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - id: str, **params: Unpack["OutboundPaymentCancelParams"] + id: str, /, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -366,7 +366,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ @@ -385,7 +385,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_cancel_async( - cls, id: str, **params: Unpack["OutboundPaymentCancelParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -404,7 +404,7 @@ async def _cls_cancel_async( @overload @staticmethod async def cancel_async( - id: str, **params: Unpack["OutboundPaymentCancelParams"] + id: str, /, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -421,7 +421,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["OutboundPaymentCancelParams"] ) -> "OutboundPayment": """ @@ -537,7 +537,7 @@ class TestHelpers(APIResourceTestHelpers["OutboundPayment"]): @classmethod def _cls_fail( - cls, id: str, **params: Unpack["OutboundPaymentFailParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -556,7 +556,7 @@ def _cls_fail( @overload @staticmethod def fail( - id: str, **params: Unpack["OutboundPaymentFailParams"] + id: str, /, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -573,7 +573,7 @@ def fail( ... @class_method_variant("_cls_fail") - def fail( # pyright: ignore[reportGeneralTypeIssues] + def fail( self, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ @@ -592,7 +592,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_fail_async( - cls, id: str, **params: Unpack["OutboundPaymentFailParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -611,7 +611,7 @@ async def _cls_fail_async( @overload @staticmethod async def fail_async( - id: str, **params: Unpack["OutboundPaymentFailParams"] + id: str, /, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -628,7 +628,7 @@ async def fail_async( ... @class_method_variant("_cls_fail_async") - async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + async def fail_async( self, **params: Unpack["OutboundPaymentFailParams"] ) -> "OutboundPayment": """ @@ -647,7 +647,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_post( - cls, id: str, **params: Unpack["OutboundPaymentPostParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -666,7 +666,7 @@ def _cls_post( @overload @staticmethod def post( - id: str, **params: Unpack["OutboundPaymentPostParams"] + id: str, /, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -683,7 +683,7 @@ def post( ... @class_method_variant("_cls_post") - def post( # pyright: ignore[reportGeneralTypeIssues] + def post( self, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ @@ -702,7 +702,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_post_async( - cls, id: str, **params: Unpack["OutboundPaymentPostParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -721,7 +721,7 @@ async def _cls_post_async( @overload @staticmethod async def post_async( - id: str, **params: Unpack["OutboundPaymentPostParams"] + id: str, /, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -738,7 +738,7 @@ async def post_async( ... @class_method_variant("_cls_post_async") - async def post_async( # pyright: ignore[reportGeneralTypeIssues] + async def post_async( self, **params: Unpack["OutboundPaymentPostParams"] ) -> "OutboundPayment": """ @@ -759,6 +759,7 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_payment( cls, id: str, + /, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ @@ -779,6 +780,7 @@ def _cls_return_outbound_payment( @staticmethod def return_outbound_payment( id: str, + /, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ @@ -797,7 +799,7 @@ def return_outbound_payment( ... @class_method_variant("_cls_return_outbound_payment") - def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] + def return_outbound_payment( self, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": @@ -819,6 +821,7 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_outbound_payment_async( cls, id: str, + /, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ @@ -839,6 +842,7 @@ async def _cls_return_outbound_payment_async( @staticmethod async def return_outbound_payment_async( id: str, + /, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ @@ -857,7 +861,7 @@ async def return_outbound_payment_async( ... @class_method_variant("_cls_return_outbound_payment_async") - async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIssues] + async def return_outbound_payment_async( self, **params: Unpack["OutboundPaymentReturnOutboundPaymentParams"], ) -> "OutboundPayment": @@ -877,7 +881,7 @@ async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIss @classmethod def _cls_update( - cls, id: str, **params: Unpack["OutboundPaymentUpdateParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. @@ -896,7 +900,7 @@ def _cls_update( @overload @staticmethod def update( - id: str, **params: Unpack["OutboundPaymentUpdateParams"] + id: str, /, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. @@ -913,7 +917,7 @@ def update( ... @class_method_variant("_cls_update") - def update( # pyright: ignore[reportGeneralTypeIssues] + def update( self, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ @@ -932,7 +936,7 @@ def update( # pyright: ignore[reportGeneralTypeIssues] @classmethod async def _cls_update_async( - cls, id: str, **params: Unpack["OutboundPaymentUpdateParams"] + cls, id: str, /, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. @@ -951,7 +955,7 @@ async def _cls_update_async( @overload @staticmethod async def update_async( - id: str, **params: Unpack["OutboundPaymentUpdateParams"] + id: str, /, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. @@ -968,7 +972,7 @@ async def update_async( ... @class_method_variant("_cls_update_async") - async def update_async( # pyright: ignore[reportGeneralTypeIssues] + async def update_async( self, **params: Unpack["OutboundPaymentUpdateParams"] ) -> "OutboundPayment": """ diff --git a/stripe/treasury/_outbound_payment_service.py b/stripe/treasury/_outbound_payment_service.py index 97a27c73a..9d7912efa 100644 --- a/stripe/treasury/_outbound_payment_service.py +++ b/stripe/treasury/_outbound_payment_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OutboundPaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OutboundPaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -147,6 +149,7 @@ async def retrieve_async( def cancel( self, id: str, + /, params: Optional["OutboundPaymentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -169,6 +172,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["OutboundPaymentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 414884ba1..f2d5990f2 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -44,7 +44,7 @@ class OutboundTransfer( ListableAPIResource["OutboundTransfer"], ): """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -326,6 +326,7 @@ class UsDomesticWire(StripeObject): def _cls_cancel( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferCancelParams"], ) -> "OutboundTransfer": """ @@ -346,6 +347,7 @@ def _cls_cancel( @staticmethod def cancel( outbound_transfer: str, + /, **params: Unpack["OutboundTransferCancelParams"], ) -> "OutboundTransfer": """ @@ -363,7 +365,7 @@ def cancel( ... @class_method_variant("_cls_cancel") - def cancel( # pyright: ignore[reportGeneralTypeIssues] + def cancel( self, **params: Unpack["OutboundTransferCancelParams"] ) -> "OutboundTransfer": """ @@ -384,6 +386,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] async def _cls_cancel_async( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferCancelParams"], ) -> "OutboundTransfer": """ @@ -404,6 +407,7 @@ async def _cls_cancel_async( @staticmethod async def cancel_async( outbound_transfer: str, + /, **params: Unpack["OutboundTransferCancelParams"], ) -> "OutboundTransfer": """ @@ -421,7 +425,7 @@ async def cancel_async( ... @class_method_variant("_cls_cancel_async") - async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] + async def cancel_async( self, **params: Unpack["OutboundTransferCancelParams"] ) -> "OutboundTransfer": """ @@ -539,6 +543,7 @@ class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): def _cls_fail( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferFailParams"], ) -> "OutboundTransfer": """ @@ -559,6 +564,7 @@ def _cls_fail( @staticmethod def fail( outbound_transfer: str, + /, **params: Unpack["OutboundTransferFailParams"], ) -> "OutboundTransfer": """ @@ -576,7 +582,7 @@ def fail( ... @class_method_variant("_cls_fail") - def fail( # pyright: ignore[reportGeneralTypeIssues] + def fail( self, **params: Unpack["OutboundTransferFailParams"] ) -> "OutboundTransfer": """ @@ -599,6 +605,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] async def _cls_fail_async( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferFailParams"], ) -> "OutboundTransfer": """ @@ -619,6 +626,7 @@ async def _cls_fail_async( @staticmethod async def fail_async( outbound_transfer: str, + /, **params: Unpack["OutboundTransferFailParams"], ) -> "OutboundTransfer": """ @@ -636,7 +644,7 @@ async def fail_async( ... @class_method_variant("_cls_fail_async") - async def fail_async( # pyright: ignore[reportGeneralTypeIssues] + async def fail_async( self, **params: Unpack["OutboundTransferFailParams"] ) -> "OutboundTransfer": """ @@ -659,6 +667,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_post( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferPostParams"], ) -> "OutboundTransfer": """ @@ -679,6 +688,7 @@ def _cls_post( @staticmethod def post( outbound_transfer: str, + /, **params: Unpack["OutboundTransferPostParams"], ) -> "OutboundTransfer": """ @@ -696,7 +706,7 @@ def post( ... @class_method_variant("_cls_post") - def post( # pyright: ignore[reportGeneralTypeIssues] + def post( self, **params: Unpack["OutboundTransferPostParams"] ) -> "OutboundTransfer": """ @@ -719,6 +729,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] async def _cls_post_async( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferPostParams"], ) -> "OutboundTransfer": """ @@ -739,6 +750,7 @@ async def _cls_post_async( @staticmethod async def post_async( outbound_transfer: str, + /, **params: Unpack["OutboundTransferPostParams"], ) -> "OutboundTransfer": """ @@ -756,7 +768,7 @@ async def post_async( ... @class_method_variant("_cls_post_async") - async def post_async( # pyright: ignore[reportGeneralTypeIssues] + async def post_async( self, **params: Unpack["OutboundTransferPostParams"] ) -> "OutboundTransfer": """ @@ -779,6 +791,7 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_transfer( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ @@ -799,6 +812,7 @@ def _cls_return_outbound_transfer( @staticmethod def return_outbound_transfer( outbound_transfer: str, + /, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ @@ -817,7 +831,7 @@ def return_outbound_transfer( ... @class_method_variant("_cls_return_outbound_transfer") - def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] + def return_outbound_transfer( self, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": @@ -841,6 +855,7 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] async def _cls_return_outbound_transfer_async( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ @@ -861,6 +876,7 @@ async def _cls_return_outbound_transfer_async( @staticmethod async def return_outbound_transfer_async( outbound_transfer: str, + /, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ @@ -879,7 +895,7 @@ async def return_outbound_transfer_async( ... @class_method_variant("_cls_return_outbound_transfer_async") - async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] + async def return_outbound_transfer_async( self, **params: Unpack["OutboundTransferReturnOutboundTransferParams"], ) -> "OutboundTransfer": @@ -903,6 +919,7 @@ async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIs def _cls_update( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferUpdateParams"], ) -> "OutboundTransfer": """ @@ -923,6 +940,7 @@ def _cls_update( @staticmethod def update( outbound_transfer: str, + /, **params: Unpack["OutboundTransferUpdateParams"], ) -> "OutboundTransfer": """ @@ -940,7 +958,7 @@ def update( ... @class_method_variant("_cls_update") - def update( # pyright: ignore[reportGeneralTypeIssues] + def update( self, **params: Unpack["OutboundTransferUpdateParams"] ) -> "OutboundTransfer": """ @@ -963,6 +981,7 @@ def update( # pyright: ignore[reportGeneralTypeIssues] async def _cls_update_async( cls, outbound_transfer: str, + /, **params: Unpack["OutboundTransferUpdateParams"], ) -> "OutboundTransfer": """ @@ -983,6 +1002,7 @@ async def _cls_update_async( @staticmethod async def update_async( outbound_transfer: str, + /, **params: Unpack["OutboundTransferUpdateParams"], ) -> "OutboundTransfer": """ @@ -1000,7 +1020,7 @@ async def update_async( ... @class_method_variant("_cls_update_async") - async def update_async( # pyright: ignore[reportGeneralTypeIssues] + async def update_async( self, **params: Unpack["OutboundTransferUpdateParams"] ) -> "OutboundTransfer": """ diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index b4783fb4b..87d77d1aa 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, outbound_transfer: str, + /, params: Optional["OutboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, outbound_transfer: str, + /, params: Optional["OutboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -147,6 +149,7 @@ async def retrieve_async( def cancel( self, outbound_transfer: str, + /, params: Optional["OutboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -169,6 +172,7 @@ def cancel( async def cancel_async( self, outbound_transfer: str, + /, params: Optional["OutboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 15978760f..d6572455c 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -27,7 +27,7 @@ class ReceivedCredit(ListableAPIResource["ReceivedCredit"]): """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ OBJECT_NAME: ClassVar[Literal["treasury.received_credit"]] = ( @@ -105,7 +105,7 @@ class UsBankAccount(StripeObject): financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ - Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. + Set when `type` is `issuing_card`. This is an [Issuing Card](https://docs.stripe.com/api#issuing_cards) ID. """ type: Union[ Literal[ @@ -131,11 +131,11 @@ class LinkedFlows(StripeObject): class SourceFlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -143,7 +143,7 @@ class SourceFlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -180,11 +180,11 @@ class SourceFlowDetails(StripeObject): """ issuing_authorization: Optional[str] """ - Set if the ReceivedCredit was created due to an [Issuing Authorization](https://api.stripe.com#issuing_authorizations) object. + Set if the ReceivedCredit was created due to an [Issuing Authorization](https://docs.stripe.com/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ - Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://api.stripe.com#issuing_transactions) object. + Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://docs.stripe.com/api#issuing_transactions) object. """ source_flow: Optional[str] """ @@ -286,7 +286,9 @@ class ReversalDetails(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ - network: Union[Literal["ach", "card", "stripe", "us_domestic_wire"], str] + network: Union[ + Literal["ach", "card", "rtp", "stripe", "us_domestic_wire"], str + ] """ The rails used to send the funds. """ diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 06baf6013..cc88b686a 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ReceivedCreditRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedCredit": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ReceivedCreditRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedCredit": diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index cceae3a07..4591dede1 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -23,7 +23,7 @@ class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ OBJECT_NAME: ClassVar[Literal["treasury.received_debit"]] = ( @@ -101,7 +101,7 @@ class UsBankAccount(StripeObject): financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ - Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. + Set when `type` is `issuing_card`. This is an [Issuing Card](https://docs.stripe.com/api#issuing_cards) ID. """ type: Union[ Literal[ @@ -134,15 +134,15 @@ class LinkedFlows(StripeObject): """ issuing_authorization: Optional[str] """ - Set if the ReceivedDebit was created due to an [Issuing Authorization](https://api.stripe.com#issuing_authorizations) object. + Set if the ReceivedDebit was created due to an [Issuing Authorization](https://docs.stripe.com/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ - Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://api.stripe.com#issuing_disputes) object. + Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://docs.stripe.com/api#issuing_disputes) object. """ payout: Optional[str] """ - Set if the ReceivedDebit was created due to a [Payout](https://api.stripe.com#payouts) object. + Set if the ReceivedDebit was created due to a [Payout](https://docs.stripe.com/api#payouts) object. """ received_credit_capital_withholding: Optional[str] """ @@ -150,7 +150,7 @@ class LinkedFlows(StripeObject): """ topup: Optional[str] """ - Set if the ReceivedDebit was created due to a [Topup](https://api.stripe.com#topups) object. + Set if the ReceivedDebit was created due to a [Topup](https://docs.stripe.com/api#topups) object. """ class NetworkDetails(StripeObject): diff --git a/stripe/treasury/_received_debit_service.py b/stripe/treasury/_received_debit_service.py index 678e51dbb..c2dc3df0b 100644 --- a/stripe/treasury/_received_debit_service.py +++ b/stripe/treasury/_received_debit_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ReceivedDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedDebit": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ReceivedDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedDebit": diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index baac71327..b6e0602f2 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -26,7 +26,7 @@ class Transaction(ListableAPIResource["Transaction"]): """ - Transactions represent changes to a [FinancialAccount's](https://api.stripe.com#financial_accounts) balance. + Transactions represent changes to a [FinancialAccount's](https://docs.stripe.com/api#financial_accounts) balance. """ OBJECT_NAME: ClassVar[Literal["treasury.transaction"]] = ( @@ -50,15 +50,15 @@ class BalanceImpact(StripeObject): class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ debit_reversal: Optional["DebitReversal"] """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -72,7 +72,7 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -80,7 +80,7 @@ class FlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -88,11 +88,11 @@ class FlowDetails(StripeObject): """ received_credit: Optional["ReceivedCredit"] """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ received_debit: Optional["ReceivedDebit"] """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Union[ Literal[ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index b52cd2f7b..11bef2a3a 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -27,7 +27,7 @@ class TransactionEntry(ListableAPIResource["TransactionEntry"]): """ - TransactionEntries represent individual units of money movements within a single [Transaction](https://api.stripe.com#transactions). + TransactionEntries represent individual units of money movements within a single [Transaction](https://docs.stripe.com/api#transactions). """ OBJECT_NAME: ClassVar[Literal["treasury.transaction_entry"]] = ( @@ -51,15 +51,15 @@ class BalanceImpact(StripeObject): class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ debit_reversal: Optional["DebitReversal"] """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -73,7 +73,7 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -81,7 +81,7 @@ class FlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -89,11 +89,11 @@ class FlowDetails(StripeObject): """ received_credit: Optional["ReceivedCredit"] """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ received_debit: Optional["ReceivedDebit"] """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Union[ Literal[ diff --git a/stripe/treasury/_transaction_entry_service.py b/stripe/treasury/_transaction_entry_service.py index 590fa1c06..2266c6d19 100644 --- a/stripe/treasury/_transaction_entry_service.py +++ b/stripe/treasury/_transaction_entry_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["TransactionEntryRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TransactionEntry": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TransactionEntryRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TransactionEntry": diff --git a/stripe/treasury/_transaction_service.py b/stripe/treasury/_transaction_service.py index c43c50687..10ec3d2d2 100644 --- a/stripe/treasury/_transaction_service.py +++ b/stripe/treasury/_transaction_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 78b319f4f..259781122 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -18,7 +18,6 @@ network as network, orchestrated_commerce as orchestrated_commerce, signals as signals, - test_helpers as test_helpers, ) from stripe.v2._billing_service import BillingService as BillingService from stripe.v2._commerce_service import CommerceService as CommerceService @@ -26,12 +25,6 @@ from stripe.v2._data_service import DataService as DataService 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, - ) - from stripe.v2._financial_address_generated_microdeposits import ( - FinancialAddressGeneratedMicrodeposits as FinancialAddressGeneratedMicrodeposits, - ) from stripe.v2._iam_service import IamService as IamService from stripe.v2._money_management_service import ( MoneyManagementService as MoneyManagementService, @@ -41,9 +34,6 @@ OrchestratedCommerceService as OrchestratedCommerceService, ) from stripe.v2._signals_service import SignalsService as SignalsService - from stripe.v2._test_helper_service import ( - TestHelperService as TestHelperService, - ) # name -> (import_target, is_submodule) _import_map = { @@ -57,21 +47,12 @@ "network": ("stripe.v2.network", True), "orchestrated_commerce": ("stripe.v2.orchestrated_commerce", True), "signals": ("stripe.v2.signals", 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), "DataService": ("stripe.v2._data_service", False), "DeletedObject": ("stripe.v2._deleted_object", False), "ExtendService": ("stripe.v2._extend_service", False), - "FinancialAddressCreditSimulation": ( - "stripe.v2._financial_address_credit_simulation", - False, - ), - "FinancialAddressGeneratedMicrodeposits": ( - "stripe.v2._financial_address_generated_microdeposits", - False, - ), "IamService": ("stripe.v2._iam_service", False), "MoneyManagementService": ("stripe.v2._money_management_service", False), "NetworkService": ("stripe.v2._network_service", False), @@ -80,7 +61,6 @@ False, ), "SignalsService": ("stripe.v2._signals_service", False), - "TestHelperService": ("stripe.v2._test_helper_service", False), } if not TYPE_CHECKING: diff --git a/stripe/v2/_money_management_service.py b/stripe/v2/_money_management_service.py index 56c49f87a..f82c44dd5 100644 --- a/stripe/v2/_money_management_service.py +++ b/stripe/v2/_money_management_service.py @@ -41,6 +41,9 @@ from stripe.v2.money_management._received_debit_service import ( ReceivedDebitService, ) + from stripe.v2.money_management._test_helpers_service import ( + TestHelpersService, + ) from stripe.v2.money_management._transaction_entry_service import ( TransactionEntryService, ) @@ -97,6 +100,10 @@ "stripe.v2.money_management._received_debit_service", "ReceivedDebitService", ], + "test_helpers": [ + "stripe.v2.money_management._test_helpers_service", + "TestHelpersService", + ], "transactions": [ "stripe.v2.money_management._transaction_service", "TransactionService", @@ -121,6 +128,7 @@ class MoneyManagementService(StripeService): payout_methods_bank_account_spec: "PayoutMethodsBankAccountSpecService" received_credits: "ReceivedCreditService" received_debits: "ReceivedDebitService" + test_helpers: "TestHelpersService" transactions: "TransactionService" transaction_entries: "TransactionEntryService" diff --git a/stripe/v2/_signals_service.py b/stripe/v2/_signals_service.py index e1da1c8e6..2545b5300 100644 --- a/stripe/v2/_signals_service.py +++ b/stripe/v2/_signals_service.py @@ -14,7 +14,7 @@ from stripe.v2.signals._account_signal_service import AccountSignalService _subservices = { - "account_activity": [ + "account_activities": [ "stripe.v2.signals._account_activity_service", "AccountActivityService", ], @@ -30,7 +30,7 @@ class SignalsService(StripeService): - account_activity: "AccountActivityService" + account_activities: "AccountActivityService" account_evaluations: "AccountEvaluationService" account_signals: "AccountSignalService" diff --git a/stripe/v2/billing/_bill_setting_service.py b/stripe/v2/billing/_bill_setting_service.py index 7fc004ae3..78edddc1b 100644 --- a/stripe/v2/billing/_bill_setting_service.py +++ b/stripe/v2/billing/_bill_setting_service.py @@ -133,6 +133,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["BillSettingRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSetting": @@ -153,6 +154,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["BillSettingRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSetting": @@ -173,6 +175,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["BillSettingUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSetting": @@ -193,6 +196,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["BillSettingUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSetting": diff --git a/stripe/v2/billing/_cadence.py b/stripe/v2/billing/_cadence.py index 5bf8081b9..87c25020a 100644 --- a/stripe/v2/billing/_cadence.py +++ b/stripe/v2/billing/_cadence.py @@ -179,7 +179,7 @@ class Payer(StripeObject): """ The ID of the Customer object. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ @@ -391,7 +391,9 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[ + Union[Literal["bank_transfer"], str] + ] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_cadence_service.py b/stripe/v2/billing/_cadence_service.py index 51b8d56e2..6669f0b1f 100644 --- a/stripe/v2/billing/_cadence_service.py +++ b/stripe/v2/billing/_cadence_service.py @@ -104,6 +104,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["CadenceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": @@ -124,6 +125,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["CadenceRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": @@ -144,6 +146,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["CadenceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": @@ -164,6 +167,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["CadenceUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": @@ -184,6 +188,7 @@ async def update_async( def cancel( self, id: str, + /, params: Optional["CadenceCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": @@ -204,6 +209,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["CadenceCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Cadence": diff --git a/stripe/v2/billing/_collection_setting.py b/stripe/v2/billing/_collection_setting.py index 910efe646..61dc994d9 100644 --- a/stripe/v2/billing/_collection_setting.py +++ b/stripe/v2/billing/_collection_setting.py @@ -131,7 +131,7 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[Union[Literal["bank_transfer"], str]] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_collection_setting_service.py b/stripe/v2/billing/_collection_setting_service.py index e546c5651..e9b62232b 100644 --- a/stripe/v2/billing/_collection_setting_service.py +++ b/stripe/v2/billing/_collection_setting_service.py @@ -154,6 +154,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["CollectionSettingRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSetting": @@ -176,6 +177,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["CollectionSettingRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSetting": @@ -198,6 +200,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["CollectionSettingUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSetting": @@ -229,6 +232,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["CollectionSettingUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSetting": diff --git a/stripe/v2/billing/_collection_setting_version.py b/stripe/v2/billing/_collection_setting_version.py index 9e7502b1c..85b248ebd 100644 --- a/stripe/v2/billing/_collection_setting_version.py +++ b/stripe/v2/billing/_collection_setting_version.py @@ -131,7 +131,7 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[Union[Literal["bank_transfer"], str]] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 741df9078..1a74d9bc3 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -48,7 +48,7 @@ class Cancel(StripeObject): """ Open Enum. The meter event adjustment's status. """ - type: Literal["cancel"] + type: Union[Literal["cancel"], str] """ Open Enum. Specifies the type of cancellation. Currently supports canceling a single event. """ diff --git a/stripe/v2/billing/_profile_service.py b/stripe/v2/billing/_profile_service.py index bb75385f5..eb5705dfc 100644 --- a/stripe/v2/billing/_profile_service.py +++ b/stripe/v2/billing/_profile_service.py @@ -101,6 +101,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["ProfileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Profile": @@ -121,6 +122,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ProfileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Profile": @@ -141,6 +143,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["ProfileUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Profile": @@ -161,6 +164,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["ProfileUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Profile": diff --git a/stripe/v2/billing/bill_settings/_version_service.py b/stripe/v2/billing/bill_settings/_version_service.py index 7b3cf7c99..35f907c8f 100644 --- a/stripe/v2/billing/bill_settings/_version_service.py +++ b/stripe/v2/billing/bill_settings/_version_service.py @@ -21,6 +21,7 @@ class VersionService(StripeService): def list( self, bill_setting_id: str, + /, params: Optional["VersionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[BillSettingVersion]": @@ -43,6 +44,7 @@ def list( async def list_async( self, bill_setting_id: str, + /, params: Optional["VersionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[BillSettingVersion]": @@ -66,6 +68,7 @@ def retrieve( self, bill_setting_id: str, id: str, + /, params: Optional["VersionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSettingVersion": @@ -90,6 +93,7 @@ async def retrieve_async( self, bill_setting_id: str, id: str, + /, params: Optional["VersionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BillSettingVersion": diff --git a/stripe/v2/billing/collection_settings/_version_service.py b/stripe/v2/billing/collection_settings/_version_service.py index c18f96932..ed3ffb1b5 100644 --- a/stripe/v2/billing/collection_settings/_version_service.py +++ b/stripe/v2/billing/collection_settings/_version_service.py @@ -23,6 +23,7 @@ class VersionService(StripeService): def list( self, collection_setting_id: str, + /, params: Optional["VersionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CollectionSettingVersion]": @@ -45,6 +46,7 @@ def list( async def list_async( self, collection_setting_id: str, + /, params: Optional["VersionListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[CollectionSettingVersion]": @@ -68,6 +70,7 @@ def retrieve( self, collection_setting_id: str, id: str, + /, params: Optional["VersionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSettingVersion": @@ -92,6 +95,7 @@ async def retrieve_async( self, collection_setting_id: str, id: str, + /, params: Optional["VersionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "CollectionSettingVersion": diff --git a/stripe/v2/commerce/product_catalog/_import_service.py b/stripe/v2/commerce/product_catalog/_import_service.py index cc5f28bcd..3e32a7f01 100644 --- a/stripe/v2/commerce/product_catalog/_import_service.py +++ b/stripe/v2/commerce/product_catalog/_import_service.py @@ -100,6 +100,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["ImportRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductCatalogImport": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ImportRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ProductCatalogImport": diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 04fd9c1bd..43acbfd67 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -117,6 +117,14 @@ class AutomaticIndirectTax(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -135,7 +143,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -260,6 +272,14 @@ class AchDebitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -278,7 +298,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -293,6 +317,14 @@ class AcssDebitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -311,7 +343,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -326,6 +362,14 @@ class AffirmPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -344,7 +388,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -359,6 +407,14 @@ class AfterpayClearpayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -377,7 +433,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -392,6 +452,14 @@ class AlmaPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -410,7 +478,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -425,6 +497,14 @@ class AmazonPayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -443,7 +523,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -458,6 +542,14 @@ class AuBecsDebitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -476,7 +568,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -491,6 +587,14 @@ class BacsDebitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -509,7 +613,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -524,6 +632,14 @@ class BancontactPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -542,7 +658,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -557,6 +677,14 @@ class BlikPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -575,7 +703,56 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details about the capability's status. This value is empty when `status` is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class BlikRecurringPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + "unsupported_entity_type", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + status: Literal[ + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -590,6 +767,14 @@ class BoletoPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -608,7 +793,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -623,6 +812,14 @@ class CardPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -641,7 +838,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -656,6 +857,14 @@ class CartesBancairesPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -674,7 +883,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -689,6 +902,14 @@ class CashappPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -707,7 +928,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -722,6 +947,14 @@ class EpsPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -740,7 +973,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -755,6 +992,14 @@ class FpxPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -773,7 +1018,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -788,6 +1037,14 @@ class GbBankTransferPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -806,7 +1063,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -821,6 +1082,14 @@ class GrabpayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -839,7 +1108,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -854,6 +1127,14 @@ class IdealPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -872,7 +1153,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -887,6 +1172,14 @@ class JcbPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -905,7 +1198,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -920,6 +1217,14 @@ class JpBankTransferPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -938,7 +1243,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -953,6 +1262,14 @@ class KakaoPayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -971,7 +1288,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -986,6 +1307,14 @@ class KlarnaPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1004,7 +1333,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1019,6 +1352,14 @@ class KonbiniPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1037,7 +1378,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1052,6 +1397,14 @@ class KrCardPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1070,7 +1423,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1085,6 +1442,14 @@ class LinkPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1103,7 +1468,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1118,6 +1487,14 @@ class MobilepayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1136,7 +1513,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1151,6 +1532,14 @@ class MultibancoPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1169,7 +1558,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1184,6 +1577,14 @@ class MxBankTransferPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1202,7 +1603,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1217,6 +1622,14 @@ class NaverPayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1235,7 +1648,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1250,6 +1667,14 @@ class OxxoPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1268,7 +1693,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1283,6 +1712,14 @@ class P24Payments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1301,7 +1738,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1316,6 +1757,14 @@ class PayByBankPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1334,7 +1783,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1349,6 +1802,14 @@ class PaycoPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1367,7 +1828,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1382,6 +1847,14 @@ class PaynowPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1400,7 +1873,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1415,6 +1892,14 @@ class PromptpayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1433,7 +1918,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1448,6 +1937,14 @@ class RevolutPayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1466,7 +1963,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1481,6 +1982,14 @@ class SamsungPayPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1499,7 +2008,56 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details about the capability's status. This value is empty when `status` is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class SatispayPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + "unsupported_entity_type", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + status: Literal[ + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1514,6 +2072,14 @@ class SepaBankTransferPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1532,7 +2098,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1547,6 +2117,14 @@ class SepaDebitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1565,7 +2143,56 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details about the capability's status. This value is empty when `status` is `active`. + """ + _inner_class_types = {"status_details": StatusDetail} + + class SequraPayments(StripeObject): + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + "unsupported_entity_type", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + status: Literal[ + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1581,6 +2208,14 @@ class Payouts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1601,7 +2236,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1622,6 +2261,14 @@ class SunbitPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1640,7 +2287,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1655,6 +2306,14 @@ class SwishPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1673,7 +2332,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1688,6 +2351,14 @@ class TwintPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1706,7 +2377,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1721,6 +2396,14 @@ class UsBankTransferPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1739,7 +2422,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1754,6 +2441,14 @@ class ZipPayments(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -1772,7 +2467,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -1823,6 +2522,10 @@ class StatusDetail(StripeObject): """ Allow the merchant to process BLIK payments. """ + blik_recurring_payments: Optional[BlikRecurringPayments] + """ + Allow the merchant to process recurring BLIK payments. + """ boleto_payments: Optional[BoletoPayments] """ Allow the merchant to process Boleto payments. @@ -1935,6 +2638,10 @@ class StatusDetail(StripeObject): """ Allow the merchant to process Samsung Pay payments. """ + satispay_payments: Optional[SatispayPayments] + """ + Allow the merchant to process Satispay payments. + """ sepa_bank_transfer_payments: Optional[SepaBankTransferPayments] """ Allow the merchant to process SEPA bank transfer payments. @@ -1943,6 +2650,10 @@ class StatusDetail(StripeObject): """ Allow the merchant to process SEPA Direct Debit payments. """ + sequra_payments: Optional[SequraPayments] + """ + Allow the merchant to process SeQura payments. + """ stripe_balance: Optional[StripeBalance] """ Capabilities that enable the merchant to manage their Stripe Balance (/v1/balance). @@ -1978,6 +2689,7 @@ class StatusDetail(StripeObject): "bacs_debit_payments": BacsDebitPayments, "bancontact_payments": BancontactPayments, "blik_payments": BlikPayments, + "blik_recurring_payments": BlikRecurringPayments, "boleto_payments": BoletoPayments, "card_payments": CardPayments, "cartes_bancaires_payments": CartesBancairesPayments, @@ -2006,8 +2718,10 @@ class StatusDetail(StripeObject): "promptpay_payments": PromptpayPayments, "revolut_pay_payments": RevolutPayPayments, "samsung_pay_payments": SamsungPayPayments, + "satispay_payments": SatispayPayments, "sepa_bank_transfer_payments": SepaBankTransferPayments, "sepa_debit_payments": SepaDebitPayments, + "sequra_payments": SequraPayments, "stripe_balance": StripeBalance, "sunbit_payments": SunbitPayments, "swish_payments": SwishPayments, @@ -2247,6 +2961,14 @@ class Aud(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2269,6 +2991,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2287,6 +3010,14 @@ class Cad(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2309,6 +3040,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2327,6 +3059,14 @@ class Eur(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2349,6 +3089,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2367,6 +3108,14 @@ class Gbp(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2389,6 +3138,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2407,6 +3157,14 @@ class Usd(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2429,6 +3187,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2476,6 +3235,14 @@ class Aud(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2498,6 +3265,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2516,6 +3284,14 @@ class Cad(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2538,6 +3314,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2556,6 +3333,14 @@ class Eur(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2578,6 +3363,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2596,6 +3382,14 @@ class Gbp(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2618,6 +3412,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2636,6 +3431,14 @@ class Usd(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2658,6 +3461,7 @@ class StatusDetail(StripeObject): status: Literal[ "active", "pending", + "rejected", "restricted", "unsupported", ] @@ -2718,6 +3522,14 @@ class BankAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2738,7 +3550,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2760,6 +3576,14 @@ class BankAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2780,7 +3604,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2795,6 +3623,14 @@ class Cards(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2815,7 +3651,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2830,6 +3670,14 @@ class FinancialAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2850,7 +3698,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2884,6 +3736,14 @@ class BankAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2904,7 +3764,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2919,6 +3783,14 @@ class FinancialAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2939,7 +3811,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -2968,6 +3844,14 @@ class BankAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -2988,7 +3872,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3010,6 +3898,14 @@ class BankAccounts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3030,7 +3926,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3097,6 +3997,14 @@ class Local(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3117,7 +4025,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3132,6 +4044,14 @@ class Wire(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3152,7 +4072,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3177,6 +4101,14 @@ class Cards(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3195,7 +4127,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3211,6 +4147,14 @@ class Payouts(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3231,7 +4175,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3246,6 +4194,14 @@ class StripeTransfers(StripeObject): class StatusDetail(StripeObject): code: Literal[ "determining_status", + "rejected_fraud", + "rejected_incomplete_verification", + "rejected_listed", + "rejected_other", + "rejected_platform_fraud", + "rejected_platform_other", + "rejected_platform_terms_of_service", + "rejected_terms_of_service", "requirements_past_due", "requirements_pending_verification", "restricted_other", @@ -3266,7 +4222,11 @@ class StatusDetail(StripeObject): """ status: Literal[ - "active", "pending", "restricted", "unsupported" + "active", + "pending", + "rejected", + "restricted", + "unsupported", ] """ The status of the Capability. @@ -3648,8 +4608,10 @@ class Error(StripeObject): code: Union[ Literal[ "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -3779,6 +4741,7 @@ class Deadline(StripeObject): "bank_accounts.local", "bank_accounts.wire", "blik_payments", + "blik_recurring_payments", "boleto_payments", "business_storage.inbound.eur", "business_storage.inbound.gbp", @@ -3826,6 +4789,7 @@ class Deadline(StripeObject): "received_debits.bank_accounts", "revolut_pay_payments", "samsung_pay_payments", + "satispay_payments", "sepa_bank_transfer_payments", "sepa_debit_payments", "stripe_balance.payouts", @@ -4183,7 +5147,7 @@ class BankAccountOwnershipVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4193,7 +5157,7 @@ class CompanyLicense(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4203,7 +5167,7 @@ class CompanyMemorandumOfAssociation(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4213,7 +5177,7 @@ class CompanyMinisterialDecree(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4223,7 +5187,7 @@ class CompanyRegistrationVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4233,7 +5197,7 @@ class CompanyTaxIdVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4253,7 +5217,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -4264,7 +5228,7 @@ class ProofOfAddress(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4284,7 +5248,7 @@ class Signer(StripeObject): """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4305,7 +5269,7 @@ class Signer(StripeObject): """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4836,7 +5800,7 @@ class CompanyAuthorization(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4846,7 +5810,7 @@ class Passport(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -4866,7 +5830,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -4887,7 +5851,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -4898,7 +5862,7 @@ class Visa(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -5301,8 +6265,10 @@ class Error(StripeObject): code: Union[ Literal[ "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -5432,6 +6398,7 @@ class Deadline(StripeObject): "bank_accounts.local", "bank_accounts.wire", "blik_payments", + "blik_recurring_payments", "boleto_payments", "business_storage.inbound.eur", "business_storage.inbound.gbp", @@ -5479,6 +6446,7 @@ class Deadline(StripeObject): "received_debits.bank_accounts", "revolut_pay_payments", "samsung_pay_payments", + "satispay_payments", "sepa_bank_transfer_payments", "sepa_debit_payments", "stripe_balance.payouts", diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py index 2313dd0b5..7c334216c 100644 --- a/stripe/v2/core/_account_link.py +++ b/stripe/v2/core/_account_link.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, Union +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -34,21 +34,6 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[ - Union[ - Literal[ - "customer", - "merchant", - "money_manager", - "recipient", - "storer", - ], - str, - ] - ] - """ - Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. - """ refresh_url: str """ The URL the user will be redirected to if the AccountLink is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new AccountLink with the same parameters used to create the original AccountLink, then redirect the user to the new AccountLink's URL so they can continue the flow. If a new AccountLink cannot be generated or the redirect fails you should display a useful error to the user. Please make sure to implement authentication before redirecting the user in case this URL is leaked to a third party. @@ -78,21 +63,6 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[ - Union[ - Literal[ - "customer", - "merchant", - "money_manager", - "recipient", - "storer", - ], - str, - ] - ] - """ - Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. - """ refresh_url: str """ The URL the user will be redirected to if the Account Link is expired, has been used, or is otherwise invalid. The URL you specify should attempt to generate a new Account Link with the same parameters used to create the original Account Link, then redirect the user to the new Account Link URL so they can continue the flow. Make sure to authenticate the user before redirecting to the new Account Link, in case the URL leaks to a third party. If a new Account Link can't be generated, or if the redirect fails, you should display a useful error to the user. @@ -146,6 +116,6 @@ class CollectionOptions(StripeObject): """ use_case: UseCase """ - Hash containing usage options. + Describes the Stripe-hosted flow for this Account Link, including its type and flow-specific configuration. """ _inner_class_types = {"use_case": UseCase} diff --git a/stripe/v2/core/_account_person.py b/stripe/v2/core/_account_person.py index f4f06045a..e1c4a1608 100644 --- a/stripe/v2/core/_account_person.py +++ b/stripe/v2/core/_account_person.py @@ -138,7 +138,7 @@ class CompanyAuthorization(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -148,7 +148,7 @@ class Passport(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -168,7 +168,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -189,7 +189,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -200,7 +200,7 @@ class Visa(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/v2/core/_account_service.py b/stripe/v2/core/_account_service.py index c10dd2364..6efe00e36 100644 --- a/stripe/v2/core/_account_service.py +++ b/stripe/v2/core/_account_service.py @@ -160,6 +160,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -180,6 +181,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -200,6 +202,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["AccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -231,6 +234,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["AccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -262,6 +266,7 @@ async def update_async( def close( self, id: str, + /, params: Optional["AccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": @@ -282,6 +287,7 @@ def close( async def close_async( self, id: str, + /, params: Optional["AccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Account": diff --git a/stripe/v2/core/_account_token_service.py b/stripe/v2/core/_account_token_service.py index 1278bb729..33d82d2c2 100644 --- a/stripe/v2/core/_account_token_service.py +++ b/stripe/v2/core/_account_token_service.py @@ -89,6 +89,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["AccountTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountToken": @@ -109,6 +110,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AccountTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountToken": diff --git a/stripe/v2/core/_approval_request_service.py b/stripe/v2/core/_approval_request_service.py index ecf0fb005..84d43e48c 100644 --- a/stripe/v2/core/_approval_request_service.py +++ b/stripe/v2/core/_approval_request_service.py @@ -67,6 +67,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ApprovalRequestRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": @@ -88,6 +89,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ApprovalRequestRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": @@ -109,6 +111,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["ApprovalRequestUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": @@ -130,6 +133,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["ApprovalRequestUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": @@ -151,6 +155,7 @@ async def update_async( def cancel( self, id: str, + /, params: Optional["ApprovalRequestCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": @@ -174,6 +179,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["ApprovalRequestCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ApprovalRequest": diff --git a/stripe/v2/core/_batch_job_service.py b/stripe/v2/core/_batch_job_service.py index 4028e4d7f..7d0cd989f 100644 --- a/stripe/v2/core/_batch_job_service.py +++ b/stripe/v2/core/_batch_job_service.py @@ -61,6 +61,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["BatchJobRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BatchJob": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["BatchJobRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BatchJob": @@ -101,6 +103,7 @@ async def retrieve_async( def cancel( self, id: str, + /, params: Optional["BatchJobCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BatchJob": @@ -121,6 +124,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["BatchJobCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BatchJob": diff --git a/stripe/v2/core/_event.py b/stripe/v2/core/_event.py index 2269391c3..442188370 100644 --- a/stripe/v2/core/_event.py +++ b/stripe/v2/core/_event.py @@ -42,7 +42,7 @@ class Request(StripeObject): """ Information on the API request that instigated the event. """ - type: Literal["request"] + type: Union[Literal["request"], str] """ Event reason type. """ @@ -76,6 +76,10 @@ class Request(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/_event_destination.py b/stripe/v2/core/_event_destination.py index c1ecbbcdd..7066be9e8 100644 --- a/stripe/v2/core/_event_destination.py +++ b/stripe/v2/core/_event_destination.py @@ -7,7 +7,7 @@ class EventDestination(StripeObject): """ - Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). + Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks), [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge), and [Azure Event Grid](https://docs.stripe.com/event-destinations/eventgrid). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). """ OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( @@ -17,41 +17,41 @@ class EventDestination(StripeObject): class AmazonEventbridge(StripeObject): aws_account_id: str """ - The AWS account ID. + The AWS account ID that owns the event bus receiving events. """ aws_event_source_arn: str """ - The ARN of the AWS event source. + The ARN of the Stripe-created partner event source in your AWS account. """ aws_event_source_status: Literal[ "active", "deleted", "pending", "unknown" ] """ - The state of the AWS event source. + The AWS-reported lifecycle state of the partner event source. """ class AzureEventGrid(StripeObject): azure_partner_topic_name: str """ - The name of the Azure partner topic. + The name of the Stripe-created partner topic that receives events. """ azure_partner_topic_status: Union[ Literal["activated", "deleted", "never_activated", "unknown"], str ] """ - The status of the Azure partner topic. + The Azure-reported lifecycle state of the partner topic. """ azure_region: str """ - The Azure region. + The Azure region where the partner topic is located. """ azure_resource_group_name: str """ - The name of the Azure resource group. + The Azure resource group containing the partner topic. """ azure_subscription_id: str """ - The Azure subscription ID. + The Azure subscription containing the resource group and partner topic. """ class StatusDetails(StripeObject): @@ -70,43 +70,43 @@ class Disabled(StripeObject): disabled: Optional[Disabled] """ - Details about why the event destination has been disabled. + Present when the destination was disabled; identifies the cause, time, and provider-side object involved when available. """ _inner_class_types = {"disabled": Disabled} class WebhookEndpoint(StripeObject): signing_secret: Optional[str] """ - The signing secret of the webhook endpoint, only includable on creation. + The secret used to verify Stripe signatures on delivered events. Returned only in the create response when explicitly included; public API clients cannot retrieve it later. """ url: Optional[str] """ - The URL of the webhook endpoint, includable. + The URL where Stripe sends matching events. Live mode requires HTTPS; sandbox mode also supports HTTP. Returned only when explicitly included. """ amazon_eventbridge: Optional[AmazonEventbridge] """ - Amazon EventBridge configuration. + Configuration for delivering events through an Amazon EventBridge partner event source. """ azure_event_grid: Optional[AzureEventGrid] """ - Azure Event Grid configuration. + Configuration for delivering events through an Azure Event Grid partner topic. """ created: str """ - Time at which the object was created. + The time when the destination was created. """ description: str """ - An optional description of what the event destination is used for. + An optional user-defined description of the destination's purpose. """ enabled_events: List[str] """ - The list of events to enable for this endpoint. + The list of event types enabled for delivery to this destination. """ event_payload: Literal["snapshot", "thin"] """ - Payload type of events being subscribed to. + Whether to deliver as snapshot or thin events. """ events_from: Optional[List[str]] """ @@ -126,11 +126,11 @@ class WebhookEndpoint(StripeObject): """ metadata: Optional[UntypedStripeObject[str]] """ - Metadata. + User-defined key/value data for the destination; it has no effect on event matching or delivery. """ name: str """ - Event destination name. + A user-defined label for identifying the destination in Stripe. """ object: Literal["v2.core.event_destination"] """ @@ -138,30 +138,30 @@ class WebhookEndpoint(StripeObject): """ snapshot_api_version: Optional[str] """ - If using the snapshot event payload, the API version events are rendered as. + For snapshot events only, the Stripe API version used to render event objects. Thin events are not pinned to an API version. """ status: Literal["disabled", "enabled"] """ - Status. It can be set to either enabled or disabled. + Whether Stripe currently attempts delivery. Stripe attempts delivery to enabled destinations when their provider configuration is active; disabled destinations do not receive delivery attempts. """ status_details: Optional[StatusDetails] """ - Additional information about event destination status. + Additional lifecycle context for the destination status, when available. """ type: Union[ Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"], str, ] """ - Event destination type. + The delivery transport. Chosen when the destination is created and cannot be changed by update. """ updated: str """ - Time at which the object was last updated. + The time when the destination object was last updated. """ webhook_endpoint: Optional[WebhookEndpoint] """ - Webhook endpoint configuration. + Configuration for delivering events to a webhook endpoint. Live mode requires HTTPS; sandbox mode also supports HTTP. """ _inner_class_types = { "amazon_eventbridge": AmazonEventbridge, diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py index a788a391d..7bac3937e 100644 --- a/stripe/v2/core/_event_destination_service.py +++ b/stripe/v2/core/_event_destination_service.py @@ -117,6 +117,7 @@ async def create_async( def delete( self, id: str, + /, params: Optional["EventDestinationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -137,6 +138,7 @@ def delete( async def delete_async( self, id: str, + /, params: Optional["EventDestinationDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -157,6 +159,7 @@ async def delete_async( def retrieve( self, id: str, + /, params: Optional["EventDestinationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -177,6 +180,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["EventDestinationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -197,6 +201,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["EventDestinationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -217,6 +222,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["EventDestinationUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -237,6 +243,7 @@ async def update_async( def disable( self, id: str, + /, params: Optional["EventDestinationDisableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -259,6 +266,7 @@ def disable( async def disable_async( self, id: str, + /, params: Optional["EventDestinationDisableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -281,6 +289,7 @@ async def disable_async( def enable( self, id: str, + /, params: Optional["EventDestinationEnableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -303,6 +312,7 @@ def enable( async def enable_async( self, id: str, + /, params: Optional["EventDestinationEnableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "EventDestination": @@ -325,6 +335,7 @@ async def enable_async( def ping( self, id: str, + /, params: Optional["EventDestinationPingParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": @@ -347,6 +358,7 @@ def ping( async def ping_async( self, id: str, + /, params: Optional["EventDestinationPingParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": diff --git a/stripe/v2/core/_event_service.py b/stripe/v2/core/_event_service.py index 7033683af..a33ba4f0a 100644 --- a/stripe/v2/core/_event_service.py +++ b/stripe/v2/core/_event_service.py @@ -57,6 +57,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["EventRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": @@ -78,6 +79,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["EventRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Event": diff --git a/stripe/v2/core/accounts/_person_service.py b/stripe/v2/core/accounts/_person_service.py index 60bd385d1..c3c5d6c80 100644 --- a/stripe/v2/core/accounts/_person_service.py +++ b/stripe/v2/core/accounts/_person_service.py @@ -32,6 +32,7 @@ class PersonService(StripeService): def list( self, account_id: str, + /, params: Optional["PersonListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountPerson]": @@ -54,6 +55,7 @@ def list( async def list_async( self, account_id: str, + /, params: Optional["PersonListParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ListObject[AccountPerson]": @@ -76,6 +78,7 @@ async def list_async( def create( self, account_id: str, + /, params: Optional["PersonCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": @@ -101,6 +104,7 @@ def create( async def create_async( self, account_id: str, + /, params: Optional["PersonCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": @@ -127,6 +131,7 @@ def delete( self, account_id: str, id: str, + /, params: Optional["PersonDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -151,6 +156,7 @@ async def delete_async( self, account_id: str, id: str, + /, params: Optional["PersonDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -175,6 +181,7 @@ def retrieve( self, account_id: str, id: str, + /, params: Optional["PersonRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": @@ -199,6 +206,7 @@ async def retrieve_async( self, account_id: str, id: str, + /, params: Optional["PersonRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": @@ -223,6 +231,7 @@ def update( self, account_id: str, id: str, + /, params: Optional["PersonUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": @@ -250,6 +259,7 @@ async def update_async( self, account_id: str, id: str, + /, params: Optional["PersonUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPerson": diff --git a/stripe/v2/core/accounts/_person_token_service.py b/stripe/v2/core/accounts/_person_token_service.py index a9f6ca4b2..0a40fb628 100644 --- a/stripe/v2/core/accounts/_person_token_service.py +++ b/stripe/v2/core/accounts/_person_token_service.py @@ -21,6 +21,7 @@ class PersonTokenService(StripeService): def create( self, account_id: str, + /, params: Optional["PersonTokenCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": @@ -47,6 +48,7 @@ def create( async def create_async( self, account_id: str, + /, params: Optional["PersonTokenCreateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": @@ -74,6 +76,7 @@ def retrieve( self, account_id: str, id: str, + /, params: Optional["PersonTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": @@ -98,6 +101,7 @@ async def retrieve_async( self, account_id: str, id: str, + /, params: Optional["PersonTokenRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": diff --git a/stripe/v2/core/vault/_gb_bank_account_service.py b/stripe/v2/core/vault/_gb_bank_account_service.py index 2ebaf2ff7..134e52ed5 100644 --- a/stripe/v2/core/vault/_gb_bank_account_service.py +++ b/stripe/v2/core/vault/_gb_bank_account_service.py @@ -109,6 +109,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["GbBankAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GbBankAccount": @@ -131,6 +132,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["GbBankAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GbBankAccount": @@ -153,6 +155,7 @@ async def retrieve_async( def acknowledge_confirmation_of_payee( self, id: str, + /, params: Optional[ "GbBankAccountAcknowledgeConfirmationOfPayeeParams" ] = None, @@ -180,6 +183,7 @@ def acknowledge_confirmation_of_payee( async def acknowledge_confirmation_of_payee_async( self, id: str, + /, params: Optional[ "GbBankAccountAcknowledgeConfirmationOfPayeeParams" ] = None, @@ -207,6 +211,7 @@ async def acknowledge_confirmation_of_payee_async( def archive( self, id: str, + /, params: Optional["GbBankAccountArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GbBankAccount": @@ -230,6 +235,7 @@ def archive( async def archive_async( self, id: str, + /, params: Optional["GbBankAccountArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "GbBankAccount": @@ -253,6 +259,7 @@ async def archive_async( def initiate_confirmation_of_payee( self, id: str, + /, params: Optional[ "GbBankAccountInitiateConfirmationOfPayeeParams" ] = None, @@ -280,6 +287,7 @@ def initiate_confirmation_of_payee( async def initiate_confirmation_of_payee_async( self, id: str, + /, params: Optional[ "GbBankAccountInitiateConfirmationOfPayeeParams" ] = None, diff --git a/stripe/v2/core/vault/_us_bank_account_service.py b/stripe/v2/core/vault/_us_bank_account_service.py index 3674515a6..d770bc3b7 100644 --- a/stripe/v2/core/vault/_us_bank_account_service.py +++ b/stripe/v2/core/vault/_us_bank_account_service.py @@ -112,6 +112,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["UsBankAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -134,6 +135,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["UsBankAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -156,6 +158,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["UsBankAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -178,6 +181,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["UsBankAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -200,6 +204,7 @@ async def update_async( def archive( self, id: str, + /, params: Optional["UsBankAccountArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -224,6 +229,7 @@ def archive( async def archive_async( self, id: str, + /, params: Optional["UsBankAccountArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -248,6 +254,7 @@ async def archive_async( def confirm_microdeposits( self, id: str, + /, params: Optional["UsBankAccountConfirmMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -270,6 +277,7 @@ def confirm_microdeposits( async def confirm_microdeposits_async( self, id: str, + /, params: Optional["UsBankAccountConfirmMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -292,6 +300,7 @@ async def confirm_microdeposits_async( def send_microdeposits( self, id: str, + /, params: Optional["UsBankAccountSendMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": @@ -314,6 +323,7 @@ def send_microdeposits( async def send_microdeposits_async( self, id: str, + /, params: Optional["UsBankAccountSendMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "UsBankAccount": diff --git a/stripe/v2/data/reporting/_query_run.py b/stripe/v2/data/reporting/_query_run.py index 2b217fa40..2fe5eee1d 100644 --- a/stripe/v2/data/reporting/_query_run.py +++ b/stripe/v2/data/reporting/_query_run.py @@ -47,7 +47,7 @@ class DownloadUrl(StripeObject): Contains metadata about the file produced by the `ReportRun` or `QueryRun`, including its content type, size, and a URL to download its contents. """ - type: Literal["file"] + type: Union[Literal["file"], str] """ The type of the `ReportRun` or `QueryRun` result. """ diff --git a/stripe/v2/data/reporting/_query_run_service.py b/stripe/v2/data/reporting/_query_run_service.py index 99149658c..3e4a44b6e 100644 --- a/stripe/v2/data/reporting/_query_run_service.py +++ b/stripe/v2/data/reporting/_query_run_service.py @@ -58,6 +58,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["QueryRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "QueryRun": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["QueryRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "QueryRun": diff --git a/stripe/v2/extend/_workflow_run_service.py b/stripe/v2/extend/_workflow_run_service.py index d636ea261..1ae39405f 100644 --- a/stripe/v2/extend/_workflow_run_service.py +++ b/stripe/v2/extend/_workflow_run_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["WorkflowRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WorkflowRun": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["WorkflowRunRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "WorkflowRun": diff --git a/stripe/v2/extend/_workflow_service.py b/stripe/v2/extend/_workflow_service.py index e95c51466..6222fd3e0 100644 --- a/stripe/v2/extend/_workflow_service.py +++ b/stripe/v2/extend/_workflow_service.py @@ -63,6 +63,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["WorkflowRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Workflow": @@ -83,6 +84,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["WorkflowRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Workflow": @@ -103,6 +105,7 @@ async def retrieve_async( def invoke( self, id: str, + /, params: "WorkflowInvokeParams", options: Optional["RequestOptions"] = None, ) -> "WorkflowRun": @@ -123,6 +126,7 @@ def invoke( async def invoke_async( self, id: str, + /, params: "WorkflowInvokeParams", options: Optional["RequestOptions"] = None, ) -> "WorkflowRun": diff --git a/stripe/v2/iam/_activity_log.py b/stripe/v2/iam/_activity_log.py index f400b6d85..86864c92c 100644 --- a/stripe/v2/iam/_activity_log.py +++ b/stripe/v2/iam/_activity_log.py @@ -31,7 +31,7 @@ class User(StripeObject): """ Set when the actor is an API key. """ - type: Literal["api_key", "user"] + type: Literal["api_key", "stripe_action", "user"] """ The type of actor. """ @@ -42,6 +42,48 @@ class User(StripeObject): _inner_class_types = {"api_key": ApiKey, "user": User} class Details(StripeObject): + class AccountSecurity(StripeObject): + class NewAnomalySettings(StripeObject): + dormant_api_key_protection_enabled: Optional[bool] + """ + Whether dormant API key protection is enabled. + """ + money_movement_anomaly_detection_enabled: Optional[bool] + """ + Whether money movement anomaly detection is enabled. + """ + request_level_anomaly_detection_enabled: Optional[bool] + """ + Whether request-level anomaly detection is enabled. + """ + + class OldAnomalySettings(StripeObject): + dormant_api_key_protection_enabled: Optional[bool] + """ + Whether dormant API key protection is enabled. + """ + money_movement_anomaly_detection_enabled: Optional[bool] + """ + Whether money movement anomaly detection is enabled. + """ + request_level_anomaly_detection_enabled: Optional[bool] + """ + Whether request-level anomaly detection is enabled. + """ + + new_anomaly_settings: Optional[NewAnomalySettings] + """ + Anomaly detection settings after the change. + """ + old_anomaly_settings: Optional[OldAnomalySettings] + """ + Anomaly detection settings before the change. + """ + _inner_class_types = { + "new_anomaly_settings": NewAnomalySettings, + "old_anomaly_settings": OldAnomalySettings, + } + class ApiKey(StripeObject): class ManagedBy(StripeObject): class Application(StripeObject): @@ -54,7 +96,7 @@ class Application(StripeObject): """ An application. """ - type: Literal["application"] + type: Union[Literal["application"], str] """ The type of entity. """ @@ -98,6 +140,66 @@ class Application(StripeObject): """ _inner_class_types = {"managed_by": ManagedBy} + class Authentication(StripeObject): + backup_email: Optional[str] + """ + Backup email address involved in the authentication. + """ + challenge_type: Optional[ + Union[ + Literal[ + "external_account_code", + "oauth", + "previous_account_number", + "reverse_sms", + "sms", + "stripe_identity", + "totp", + "webauthn", + ], + str, + ] + ] + """ + Type of challenge used for the authentication. + """ + surface: Optional[Union[Literal["dashboard", "express"], str]] + """ + Surface where the authentication occurred. + """ + target_email: Optional[str] + """ + Target email address involved in the authentication. + """ + + class Scim(StripeObject): + group_name: str + """ + Name of the SCIM group. + """ + new_roles: List[str] + """ + Group roles after the change; only set for the group roles-updated action (scim_group_roles_updated). + """ + old_roles: List[str] + """ + Group roles before the change; only set for the group roles-updated action (scim_group_roles_updated). + """ + role_assigned_context: Optional[str] + """ + The context the roles were assigned in. + """ + user_email: Optional[str] + """ + Email address of the affected member. + """ + + class Sso(StripeObject): + mandate: Optional[Literal["off", "optional", "required"]] + """ + SSO enforcement level. + """ + class UserInvite(StripeObject): invited_user_email: str """ @@ -108,6 +210,24 @@ class UserInvite(StripeObject): Roles assigned to the invited user. """ + class UserProfile(StripeObject): + new_email: Optional[str] + """ + Email address after the change. + """ + new_redacted_phone_number: Optional[str] + """ + Redacted phone number after the change. + """ + old_email: Optional[str] + """ + Email address before the change. + """ + old_redacted_phone_number: Optional[str] + """ + Redacted phone number before the change. + """ + class UserRoles(StripeObject): new_roles: List[str] """ @@ -126,11 +246,41 @@ class UserRoles(StripeObject): Email address of the user whose roles were changed. """ + account_security: Optional[AccountSecurity] + """ + Details of an account security action. + """ api_key: Optional[ApiKey] """ Details of an API key action. """ - type: Union[Literal["api_key", "user_invite", "user_roles"], str] + authentication: Optional[Authentication] + """ + Details of an authentication action. + """ + scim: Optional[Scim] + """ + Details of a SCIM action. + """ + sso: Optional[Sso] + """ + Details of an SSO action. + """ + type: Union[ + Literal[ + "account_security", + "api_key", + "authentication", + "issuing", + "payout", + "scim", + "sso", + "user_invite", + "user_profile", + "user_roles", + ], + str, + ] """ The action group type of the activity log entry. """ @@ -138,16 +288,52 @@ class UserRoles(StripeObject): """ Details of a user invite action. """ + user_profile: Optional[UserProfile] + """ + Details of a user profile action. + """ user_roles: Optional[UserRoles] """ Details of a user role change action. """ _inner_class_types = { + "account_security": AccountSecurity, "api_key": ApiKey, + "authentication": Authentication, + "scim": Scim, + "sso": Sso, "user_invite": UserInvite, + "user_profile": UserProfile, "user_roles": UserRoles, } + class RelatedObject(StripeObject): + id: str + """ + Unique identifier of the object. + """ + type: Union[ + Literal[ + "balance_transfer", + "bank_account", + "blockchain_address", + "card", + "issuing.card", + "issuing.cardholder", + "issuing.dispute", + ], + str, + ] + """ + Type of the object. + """ + + class Request(StripeObject): + id: str + """ + ID of the API request. + """ + actor: Actor """ The actor that performed the action. @@ -176,21 +362,84 @@ class UserRoles(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ + related_object: Optional[RelatedObject] + """ + The object related to the activity log entry. + """ + request: Optional[Request] + """ + The API request that instigated the action. + """ type: Union[ Literal[ + "anomaly_detection_settings_updated", "api_key_created", "api_key_deleted", "api_key_updated", "api_key_viewed", + "issuing_activated", + "issuing_balance_transfer_created", + "issuing_cardholder_created", + "issuing_cardholder_updated", + "issuing_card_created", + "issuing_card_sensitive_details_viewed", + "issuing_card_updated", + "issuing_dispute_created", + "issuing_dispute_submitted", + "issuing_dispute_updated", + "manual_payouts_disabled", + "manual_payouts_enabled", + "payout_destination_added", + "payout_destination_removed", + "payout_destination_updated", + "payout_schedule_edits_disabled", + "payout_schedule_edits_enabled", + "scim_group_deleted", + "scim_group_member_added", + "scim_group_member_removed", + "scim_group_roles_updated", + "scim_group_updated", + "sso_domain_verified", + "sso_settings_created", + "sso_settings_deleted", + "sso_settings_updated", + "two_step_authentication_mandate_disabled", + "two_step_authentication_mandate_enabled", + "user_auth_challenge_failed", + "user_email_changed", + "user_email_verified", + "user_express_phone_number_changed", + "user_google_account_connected", + "user_google_account_disconnected", "user_invite_accepted", "user_invite_created", "user_invite_deleted", + "user_passkey_added", + "user_passkey_removed", + "user_passkey_updated", + "user_passkey_upgraded", + "user_password_changed", + "user_password_initialized", + "user_password_reset_failed", + "user_password_reset_requested", + "user_password_reset_succeeded", "user_roles_deleted", "user_roles_updated", + "user_two_step_authentication_backup_code_used", + "user_two_step_authentication_method_added", + "user_two_step_authentication_method_removed", + "user_two_step_authentication_method_reset", + "user_two_step_authentication_method_updated", + "user_two_step_authentication_reset_requested", ], str, ] """ The type of action that was performed. """ - _inner_class_types = {"actor": Actor, "details": Details} + _inner_class_types = { + "actor": Actor, + "details": Details, + "related_object": RelatedObject, + "request": Request, + } diff --git a/stripe/v2/iam/_activity_log_service.py b/stripe/v2/iam/_activity_log_service.py index c1bba92a3..0e2a2b3b7 100644 --- a/stripe/v2/iam/_activity_log_service.py +++ b/stripe/v2/iam/_activity_log_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ActivityLogRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ActivityLog": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ActivityLogRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ActivityLog": diff --git a/stripe/v2/money_management/__init__.py b/stripe/v2/money_management/__init__.py index a6b188bae..9c3e6a8ee 100644 --- a/stripe/v2/money_management/__init__.py +++ b/stripe/v2/money_management/__init__.py @@ -4,6 +4,7 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe.v2.money_management import test_helpers as test_helpers from stripe.v2.money_management._adjustment import Adjustment as Adjustment from stripe.v2.money_management._adjustment_service import ( AdjustmentService as AdjustmentService, @@ -17,6 +18,12 @@ from stripe.v2.money_management._financial_address import ( FinancialAddress as FinancialAddress, ) + from stripe.v2.money_management._financial_address_credit_simulation import ( + FinancialAddressCreditSimulation as FinancialAddressCreditSimulation, + ) + from stripe.v2.money_management._financial_address_generated_microdeposits import ( + FinancialAddressGeneratedMicrodeposits as FinancialAddressGeneratedMicrodeposits, + ) from stripe.v2.money_management._financial_address_service import ( FinancialAddressService as FinancialAddressService, ) @@ -74,6 +81,9 @@ from stripe.v2.money_management._received_debit_service import ( ReceivedDebitService as ReceivedDebitService, ) + from stripe.v2.money_management._test_helpers_service import ( + TestHelpersService as TestHelpersService, + ) from stripe.v2.money_management._transaction import ( Transaction as Transaction, ) @@ -89,6 +99,7 @@ # name -> (import_target, is_submodule) _import_map = { + "test_helpers": ("stripe.v2.money_management.test_helpers", True), "Adjustment": ("stripe.v2.money_management._adjustment", False), "AdjustmentService": ( "stripe.v2.money_management._adjustment_service", @@ -106,6 +117,14 @@ "stripe.v2.money_management._financial_address", False, ), + "FinancialAddressCreditSimulation": ( + "stripe.v2.money_management._financial_address_credit_simulation", + False, + ), + "FinancialAddressGeneratedMicrodeposits": ( + "stripe.v2.money_management._financial_address_generated_microdeposits", + False, + ), "FinancialAddressService": ( "stripe.v2.money_management._financial_address_service", False, @@ -167,6 +186,10 @@ "stripe.v2.money_management._received_debit_service", False, ), + "TestHelpersService": ( + "stripe.v2.money_management._test_helpers_service", + False, + ), "Transaction": ("stripe.v2.money_management._transaction", False), "TransactionEntry": ( "stripe.v2.money_management._transaction_entry", diff --git a/stripe/v2/money_management/_adjustment.py b/stripe/v2/money_management/_adjustment.py index 6006e2db5..b534d00a4 100644 --- a/stripe/v2/money_management/_adjustment.py +++ b/stripe/v2/money_management/_adjustment.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, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -40,18 +40,21 @@ class AdjustedFlow(StripeObject): """ If applicable, the ID of the ReceivedDebit linked to this Adjustment. """ - type: Literal[ - "adjustment", - "balance_exchange", - "inbound_payment", - "inbound_transfer", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", + type: Union[ + Literal[ + "adjustment", + "balance_exchange", + "inbound_payment", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ], + str, ] """ - Closed Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. + Open Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. """ adjusted_flow: Optional[AdjustedFlow] diff --git a/stripe/v2/money_management/_adjustment_service.py b/stripe/v2/money_management/_adjustment_service.py index fcaa012a8..73bacd817 100644 --- a/stripe/v2/money_management/_adjustment_service.py +++ b/stripe/v2/money_management/_adjustment_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["AdjustmentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Adjustment": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AdjustmentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Adjustment": diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index a91792db7..33527e4de 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.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, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -64,10 +64,33 @@ class ForwardingSettings(StripeObject): _inner_class_types = {"closed": Closed} class Storage(StripeObject): + class DepositInsuranceEligibility(StripeObject): + bank_name: Union[Literal["fifth_third"], str] + """ + The bank where funds are stored. + """ + currencies: List[str] + """ + Currencies eligible for deposit insurance at this bank under this scheme. + """ + type: Union[Literal["fdic", "fdic_passthrough"], str] + """ + The deposit insurance scheme. + """ + + deposit_insurance_eligibility: Optional[ + List[DepositInsuranceEligibility] + ] + """ + Array of eligibility objects, segmented by bank name and deposit insurance scheme. + """ holds_currencies: List[str] """ The currencies that this FinancialAccount can hold. """ + _inner_class_types = { + "deposit_insurance_eligibility": DepositInsuranceEligibility, + } balance: Balance """ diff --git a/stripe/v2/money_management/_financial_account_service.py b/stripe/v2/money_management/_financial_account_service.py index c5a114c64..ae0ea735c 100644 --- a/stripe/v2/money_management/_financial_account_service.py +++ b/stripe/v2/money_management/_financial_account_service.py @@ -106,6 +106,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["FinancialAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -128,6 +129,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FinancialAccountRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -150,6 +152,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["FinancialAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -172,6 +175,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["FinancialAccountUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -194,6 +198,7 @@ async def update_async( def close( self, id: str, + /, params: Optional["FinancialAccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": @@ -216,6 +221,7 @@ def close( async def close_async( self, id: str, + /, params: Optional["FinancialAccountCloseParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAccount": diff --git a/stripe/v2/money_management/_financial_address.py b/stripe/v2/money_management/_financial_address.py index 8052c3b9f..80537aaed 100644 --- a/stripe/v2/money_management/_financial_address.py +++ b/stripe/v2/money_management/_financial_address.py @@ -7,89 +7,43 @@ class FinancialAddress(StripeObject): """ - A Financial Address contains information needed to transfer money to a Financial Account. A Financial Account can have more than one Financial Address. + A FinancialAddress contains information needed to transfer money to a Financial Account. A Financial Account can have more than one Financial Address. """ OBJECT_NAME: ClassVar[Literal["v2.money_management.financial_address"]] = ( "v2.money_management.financial_address" ) - class Credentials(StripeObject): - class GbBankAccount(StripeObject): - account_holder_name: str - """ - The account holder name to be used during bank transference. - """ - account_number: Optional[str] - """ - The account number of the UK Bank Account. - """ - last4: str - """ - The last four digits of the UK Bank Account number. This will always be returned. - To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. - """ - sort_code: str - """ - The sort code of the UK Bank Account. - """ - - class SepaBankAccount(StripeObject): - account_holder_name: str - """ - The account holder name to be used during bank transfers. - """ - bank_name: str - """ - The name of the Bank. - """ - bic: str - """ - The BIC of the SEPA Bank Account. - """ - country: str - """ - The originating country of the SEPA Bank account. - """ - iban: str - """ - The IBAN of the SEPA Bank Account. - """ - last4: str - """ - The last four digits of the SEPA Bank Account number. This will always be returned. - To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. - """ - - class UsBankAccount(StripeObject): + class BankAccount(StripeObject): + class Aba(StripeObject): class AccountHolderAddress(StripeObject): city: str """ - The city of the address. + City. """ country: str """ - The country of the address. + Country. """ line1: str """ - The first line of the address. + Address line 1. """ line2: str """ - The second line of the address. + Address line 2. """ postal_code: str """ - The postal / zip code of the address. + Postal code. """ state: str """ - The state of the address. + State or province. """ town: str """ - The town of the address. + Town or suburb. """ account_holder_address: Optional[AccountHolderAddress] @@ -102,72 +56,105 @@ class AccountHolderAddress(StripeObject): """ account_number: Optional[str] """ - The account number of the US Bank Account. + The full account number. """ bank_name: Optional[str] """ - The name of the Bank. - """ - bic: Optional[str] - """ - The BIC of the bank or financial institution. + The name of the bank. """ last4: str """ - The last four digits of the US Bank Account number. This will always be returned. - To view the full account number when retrieving or listing FinancialAddresses, use the `include` request parameter. + The last four digits of the account number. """ routing_number: str """ - The routing number of the US Bank Account. + The ABA routing number. """ _inner_class_types = { "account_holder_address": AccountHolderAddress, } - gb_bank_account: Optional[GbBankAccount] + class Iban(StripeObject): + account_holder_name: str + """ + The name of the account holder. + """ + bank_name: str + """ + The name of the bank. + """ + country: str + """ + The country of the bank account. + """ + iban: Optional[str] + """ + The full IBAN. + """ + last4: str + """ + The last four digits of the IBAN. + """ + + class SortCode(StripeObject): + account_holder_name: str + """ + The name of the account holder. + """ + account_number: Optional[str] + """ + The full account number. + """ + last4: str + """ + The last four digits of the account number. + """ + sort_code: str + """ + The sort code. + """ + + aba: Optional[Aba] + """ + ABA bank account details (US). + """ + country: Optional[str] + """ + The country of the bank account. """ - 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. + currency: str """ - sepa_bank_account: Optional[SepaBankAccount] + Open Enum. The currency of the bank account. """ - 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. + iban: Optional[Iban] """ - type: Union[Literal["gb_bank_account", "us_bank_account"], str] + IBAN bank account details. """ - Open Enum. The type of Credentials that are provisioned for the FinancialAddress. + sort_code: Optional[SortCode] """ - us_bank_account: Optional[UsBankAccount] + Sort code bank account details (UK). """ - 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. + type: Union[Literal["aba", "iban", "sort_code"], str] """ - _inner_class_types = { - "gb_bank_account": GbBankAccount, - "sepa_bank_account": SepaBankAccount, - "us_bank_account": UsBankAccount, - } + Open Enum. The type of bank account details. + """ + _inner_class_types = {"aba": Aba, "iban": Iban, "sort_code": SortCode} - created: str - """ - The creation timestamp of the FinancialAddress. - """ - credentials: Optional[Credentials] + bank_account: Optional[BankAccount] """ - Object indicates the type of credentials that have been allocated and attached to the FinancialAddress. - It contains all necessary banking details with which to perform money movements with the FinancialAddress. - This field is only available for FinancialAddresses with an active status. + Bank account details for this FinancialAddress. """ - currency: str + created: str """ - Open Enum. The currency the FinancialAddress supports. + The creation timestamp of the FinancialAddress. """ financial_account: str """ - A ID of the FinancialAccount this FinancialAddress corresponds to. + The ID of the FinancialAccount this FinancialAddress corresponds to. """ id: str """ - The ID of a FinancialAddress. + The ID of the FinancialAddress. """ livemode: bool """ @@ -183,6 +170,10 @@ class AccountHolderAddress(StripeObject): """ status: Literal["active", "archived", "failed", "pending"] """ - Closed Enum. An enum representing the status of the FinancialAddress. This indicates whether or not the FinancialAddress can be used for any money movement flows. + Closed Enum. The status of the FinancialAddress. + """ + type: Union[Literal["bank_account"], str] + """ + Open Enum. The type of FinancialAddress. """ - _inner_class_types = {"credentials": Credentials} + _inner_class_types = {"bank_account": BankAccount} diff --git a/stripe/v2/_financial_address_credit_simulation.py b/stripe/v2/money_management/_financial_address_credit_simulation.py similarity index 75% rename from stripe/v2/_financial_address_credit_simulation.py rename to stripe/v2/money_management/_financial_address_credit_simulation.py index 8c24a1ac5..06bd0c7d3 100644 --- a/stripe/v2/_financial_address_credit_simulation.py +++ b/stripe/v2/money_management/_financial_address_credit_simulation.py @@ -10,14 +10,14 @@ class FinancialAddressCreditSimulation(StripeObject): Credit Simulations represent simulated credit transactions applied to financial addresses for testing purposes. """ - OBJECT_NAME: ClassVar[Literal["financial_address_credit_simulation"]] = ( - "financial_address_credit_simulation" - ) + OBJECT_NAME: ClassVar[ + Literal["v2.money_management.financial_address_credit_simulation"] + ] = "v2.money_management.financial_address_credit_simulation" 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["financial_address_credit_simulation"] + object: Literal["v2.money_management.financial_address_credit_simulation"] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/stripe/v2/_financial_address_generated_microdeposits.py b/stripe/v2/money_management/_financial_address_generated_microdeposits.py similarity index 77% rename from stripe/v2/_financial_address_generated_microdeposits.py rename to stripe/v2/money_management/_financial_address_generated_microdeposits.py index f1c345be7..260a89109 100644 --- a/stripe/v2/_financial_address_generated_microdeposits.py +++ b/stripe/v2/money_management/_financial_address_generated_microdeposits.py @@ -12,8 +12,10 @@ class FinancialAddressGeneratedMicrodeposits(StripeObject): """ OBJECT_NAME: ClassVar[ - Literal["financial_address_generated_microdeposits"] - ] = "financial_address_generated_microdeposits" + Literal[ + "v2.money_management.financial_address_generated_microdeposits" + ] + ] = "v2.money_management.financial_address_generated_microdeposits" amounts: List[Amount] """ The amounts of the microdeposits that were generated. @@ -22,7 +24,9 @@ class FinancialAddressGeneratedMicrodeposits(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["financial_address_generated_microdeposits"] + object: Literal[ + "v2.money_management.financial_address_generated_microdeposits" + ] """ String representing the object's type. Objects of the same type share the same value of the object field. """ diff --git a/stripe/v2/money_management/_financial_address_service.py b/stripe/v2/money_management/_financial_address_service.py index 649160957..846e7e413 100644 --- a/stripe/v2/money_management/_financial_address_service.py +++ b/stripe/v2/money_management/_financial_address_service.py @@ -27,7 +27,7 @@ def list( options: Optional["RequestOptions"] = None, ) -> "ListObject[FinancialAddress]": """ - List all FinancialAddresses for a FinancialAccount. + List all FinancialAddresses for a FinancialAccount (V2 shape). """ return cast( "ListObject[FinancialAddress]", @@ -46,7 +46,7 @@ async def list_async( options: Optional["RequestOptions"] = None, ) -> "ListObject[FinancialAddress]": """ - List all FinancialAddresses for a FinancialAccount. + List all FinancialAddresses for a FinancialAccount (V2 shape). """ return cast( "ListObject[FinancialAddress]", @@ -65,7 +65,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "FinancialAddress": """ - Create a new FinancialAddress for a FinancialAccount. + Create a new FinancialAddress for a FinancialAccount (V2 shape). """ return cast( "FinancialAddress", @@ -84,7 +84,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "FinancialAddress": """ - Create a new FinancialAddress for a FinancialAccount. + Create a new FinancialAddress for a FinancialAccount (V2 shape). """ return cast( "FinancialAddress", @@ -100,11 +100,12 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["FinancialAddressRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAddress": """ - Retrieve a FinancialAddress. By default, the FinancialAddress will be returned in its unexpanded state, revealing only the last 4 digits of the account number. + Retrieve a FinancialAddress (V2 shape). """ return cast( "FinancialAddress", @@ -122,11 +123,12 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["FinancialAddressRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAddress": """ - Retrieve a FinancialAddress. By default, the FinancialAddress will be returned in its unexpanded state, revealing only the last 4 digits of the account number. + Retrieve a FinancialAddress (V2 shape). """ return cast( "FinancialAddress", diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py index 43678a62e..79506db24 100644 --- a/stripe/v2/money_management/_inbound_transfer.py +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -89,23 +89,23 @@ class BankDebitSucceeded(StripeObject): bank_debit_failed: Optional[BankDebitFailed] """ - The history entry for a failed InboundTransfer. + The InboundTransfer failed. See `failure_reason` for more details. """ bank_debit_processing: Optional[BankDebitProcessing] """ - The history entry for a processing InboundTransfer. + The InboundTransfer was submitted to the scheme for processing. The debit is still in progress and can later succeed or fail. """ bank_debit_queued: Optional[BankDebitQueued] """ - The history entry for a queued InboundTransfer. + The InboundTransfer was created and is waiting to be submitted to the scheme for processing. """ bank_debit_returned: Optional[BankDebitReturned] """ - The history entry for a returned InboundTransfer. + The InboundTransfer was returned. The original transaction has been reversed. """ bank_debit_succeeded: Optional[BankDebitSucceeded] """ - The history entry for a succeeded InboundTransfer. + The InboundTransfer succeeded. Funds might not yet be available; check the associated Transaction for availability. """ created: str """ @@ -119,10 +119,6 @@ class BankDebitSucceeded(StripeObject): """ A unique ID for the HistoryEntry. """ - level: Union[Literal["canonical", "debug"], str] - """ - Open Enum. The Level of the HistoryEntry. - """ type: Union[ Literal[ "bank_debit_failed", diff --git a/stripe/v2/money_management/_inbound_transfer_service.py b/stripe/v2/money_management/_inbound_transfer_service.py index 2c76f1231..8f0f7b720 100644 --- a/stripe/v2/money_management/_inbound_transfer_service.py +++ b/stripe/v2/money_management/_inbound_transfer_service.py @@ -100,6 +100,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["InboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": @@ -122,6 +123,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["InboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "InboundTransfer": diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index afeae7178..0f7d9b7c9 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -61,7 +61,7 @@ class Failed(StripeObject): """ class Processing(StripeObject): - reason: Literal["under_review"] + reason: Union[Literal["under_review"], str] """ Open Enum. The `processing` status reason. """ @@ -204,7 +204,7 @@ class TraceId(StripeObject): """ The quote for this OutboundPayment. Only required for countries with regulatory mandates to display fee estimates before OutboundPayment creation. """ - purpose: Optional[Literal["payroll"]] + purpose: Optional[Union[Literal["payroll"], str]] """ The purpose of the OutboundPayment. """ diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py index 506153407..64da0b56a 100644 --- a/stripe/v2/money_management/_outbound_payment_quote.py +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -24,15 +24,61 @@ class DeliveryOptions(StripeObject): """ class EstimatedFee(StripeObject): + class NetworkFeeDetails(StripeObject): + class NetworkOptions(StripeObject): + class Ach(StripeObject): + submission: Optional[ + Union[Literal["next_day", "same_day"], str] + ] + """ + Open Enum. ACH submission timing. + """ + + ach: Optional[Ach] + """ + ACH-specific network fee options. + """ + _inner_class_types = {"ach": Ach} + + network: Union[ + Literal[ + "ach", + "becs", + "eft", + "fedwire", + "fps", + "local", + "npp", + "rtp", + "sepa", + "sepa_instant", + "swift", + ], + str, + ] + """ + The network associated with the fee. + """ + network_options: NetworkOptions + """ + Per-network options that affect the fee. + """ + _inner_class_types = {"network_options": NetworkOptions} + amount: Amount """ The fee amount for corresponding fee type. """ + network_fee_details: Optional[NetworkFeeDetails] + """ + Details about the network and options associated with this fee. Present when type is network_fee. + """ type: Union[ Literal[ "cross_border_payout_fee", "foreign_exchange_fee", "instant_payout_fee", + "network_fee", "standard_payout_fee", "wire_payout_fee", ], @@ -41,6 +87,7 @@ class EstimatedFee(StripeObject): """ The fee type. """ + _inner_class_types = {"network_fee_details": NetworkFeeDetails} class From(StripeObject): debited: Amount diff --git a/stripe/v2/money_management/_outbound_payment_quote_service.py b/stripe/v2/money_management/_outbound_payment_quote_service.py index 8a54acb33..3173ff434 100644 --- a/stripe/v2/money_management/_outbound_payment_quote_service.py +++ b/stripe/v2/money_management/_outbound_payment_quote_service.py @@ -60,6 +60,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OutboundPaymentQuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPaymentQuote": @@ -82,6 +83,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OutboundPaymentQuoteRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPaymentQuote": diff --git a/stripe/v2/money_management/_outbound_payment_service.py b/stripe/v2/money_management/_outbound_payment_service.py index c26cf0169..bf850aed1 100644 --- a/stripe/v2/money_management/_outbound_payment_service.py +++ b/stripe/v2/money_management/_outbound_payment_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OutboundPaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OutboundPaymentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -147,6 +149,7 @@ async def retrieve_async( def cancel( self, id: str, + /, params: Optional["OutboundPaymentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": @@ -169,6 +172,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["OutboundPaymentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundPayment": diff --git a/stripe/v2/money_management/_outbound_setup_intent_service.py b/stripe/v2/money_management/_outbound_setup_intent_service.py index 45564cd30..0cf5ac81a 100644 --- a/stripe/v2/money_management/_outbound_setup_intent_service.py +++ b/stripe/v2/money_management/_outbound_setup_intent_service.py @@ -108,6 +108,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OutboundSetupIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": @@ -130,6 +131,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OutboundSetupIntentRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": @@ -152,6 +154,7 @@ async def retrieve_async( def update( self, id: str, + /, params: Optional["OutboundSetupIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": @@ -174,6 +177,7 @@ def update( async def update_async( self, id: str, + /, params: Optional["OutboundSetupIntentUpdateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": @@ -196,6 +200,7 @@ async def update_async( def cancel( self, id: str, + /, params: Optional["OutboundSetupIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": @@ -218,6 +223,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["OutboundSetupIntentCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundSetupIntent": diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index 461c5e5dd..81c7f34b7 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -54,7 +54,7 @@ class Failed(StripeObject): """ class Processing(StripeObject): - reason: Literal["under_review"] + reason: Union[Literal["under_review"], str] """ Open Enum. The `processing` status reason. """ diff --git a/stripe/v2/money_management/_outbound_transfer_service.py b/stripe/v2/money_management/_outbound_transfer_service.py index fe0a702ff..e1215f4c1 100644 --- a/stripe/v2/money_management/_outbound_transfer_service.py +++ b/stripe/v2/money_management/_outbound_transfer_service.py @@ -103,6 +103,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["OutboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -125,6 +126,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["OutboundTransferRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -147,6 +149,7 @@ async def retrieve_async( def cancel( self, id: str, + /, params: Optional["OutboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": @@ -169,6 +172,7 @@ def cancel( async def cancel_async( self, id: str, + /, params: Optional["OutboundTransferCancelParams"] = None, options: Optional["RequestOptions"] = None, ) -> "OutboundTransfer": diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index a564b629f..8a5b9fe76 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -25,12 +25,6 @@ class AlternativeReference(StripeObject): """ class BankAccount(StripeObject): - archived: bool - """ - Whether this PayoutMethodBankAccount object was archived. PayoutMethodBankAccount objects can be archived through - 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", "futsu", "savings", "toza"] """ The type of bank account (checking or savings). @@ -73,12 +67,6 @@ class BankAccount(StripeObject): """ class Card(StripeObject): - archived: bool - """ - Whether the PayoutMethodCard object was archived. PayoutMethodCard objects can be archived through - the /archive API, and they will not be automatically archived by Stripe. Archived PayoutMethodCard objects - cannot be used as payout methods and will not appear in the payout method list. - """ exp_month: str """ The month the card expires. @@ -102,13 +90,15 @@ class Card(StripeObject): """ class UsageStatus(StripeObject): - payments: Literal["disabled", "eligible", "invalid", "requires_action"] + payments: Literal[ + "disabled", "eligible", "ineligible", "invalid", "requires_action" + ] """ Payments status - used when sending OutboundPayments (sending funds to recipients). If disabled, enable the payout method by creating an OutboundSetupIntent using [`POST /v2/money_management/outbound_setup_intents`](https://docs.stripe.com/api/v2/money-management/outbound-setup-intents/create). """ transfers: Literal[ - "disabled", "eligible", "invalid", "requires_action" + "disabled", "eligible", "ineligible", "invalid", "requires_action" ] """ Transfers status - used when making an OutboundTransfer (sending funds to yourself). @@ -119,6 +109,12 @@ class UsageStatus(StripeObject): """ The alternative reference for this payout method, if it's a projected payout method. """ + archived: bool + """ + Whether the payout method was archived. Payout methods can be archived through the /archive API, + and they will not be automatically archived by Stripe. Archived payout methods cannot be used + for outbound money movement. + """ available_payout_speeds: List[Literal["instant", "standard"]] """ A set of available payout speeds for this payout method. diff --git a/stripe/v2/money_management/_payout_method_service.py b/stripe/v2/money_management/_payout_method_service.py index b39a540e5..9fc31b429 100644 --- a/stripe/v2/money_management/_payout_method_service.py +++ b/stripe/v2/money_management/_payout_method_service.py @@ -68,6 +68,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["PayoutMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -90,6 +91,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["PayoutMethodRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -112,6 +114,7 @@ async def retrieve_async( def archive( self, id: str, + /, params: Optional["PayoutMethodArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -135,6 +138,7 @@ def archive( async def archive_async( self, id: str, + /, params: Optional["PayoutMethodArchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -158,6 +162,7 @@ async def archive_async( def disable( self, id: str, + /, params: Optional["PayoutMethodDisableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -182,6 +187,7 @@ def disable( async def disable_async( self, id: str, + /, params: Optional["PayoutMethodDisableParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -206,6 +212,7 @@ async def disable_async( def unarchive( self, id: str, + /, params: Optional["PayoutMethodUnarchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": @@ -228,6 +235,7 @@ def unarchive( async def unarchive_async( self, id: str, + /, params: Optional["PayoutMethodUnarchiveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "PayoutMethod": diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index 7031faf79..0da97862d 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -73,6 +73,99 @@ class GbBankAccount(StripeObject): The sort code of the account that originated the transfer. """ + class OriginatingBankAccount(StripeObject): + class Aba(StripeObject): + account_holder_name: Optional[str] + """ + The name of the account holder that sent the payment. + """ + 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. + """ + network: Union[Literal["ach", "rtp", "us_domestic_wire"], str] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + routing_number: Optional[str] + """ + The routing number of the account that originated the transfer. + """ + + class Iban(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. + """ + bic: Optional[str] + """ + The BIC/SWIFT code of the account that originated the transfer. + """ + country: Optional[str] + """ + The origination country of the bank transfer. + """ + iban: Optional[str] + """ + The IBAN that originated the transfer. + """ + network: Union[Literal["sepa_credit_transfer"], str] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + + class SortCode(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. + """ + network: Union[Literal["chaps", "fps"], str] + """ + Open Enum. The money transmission network used to send funds for this ReceivedCredit. + """ + sort_code: Optional[str] + """ + The sort code of the account that originated the transfer. + """ + + aba: Optional[Aba] + """ + Hash containing the transaction bank details. Present if `type` field value is `aba`. + """ + iban: Optional[Iban] + """ + Hash containing the transaction bank details. Present if `type` field value is `iban`. + """ + sort_code: Optional[SortCode] + """ + Hash containing the transaction bank details. Present if `type` field value is `sort_code`. + """ + type: Union[Literal["aba", "iban", "sort_code"], str] + """ + Open Enum. The type of bank transfer that originated this ReceivedCredit. + """ + _inner_class_types = { + "aba": Aba, + "iban": Iban, + "sort_code": SortCode, + } + class SepaBankAccount(StripeObject): account_holder_name: Optional[str] """ @@ -94,7 +187,7 @@ class SepaBankAccount(StripeObject): """ The IBAN that originated the transfer. """ - network: Literal["sepa_credit_transfer"] + network: Union[Literal["sepa_credit_transfer"], str] """ The money transmission network used to send funds for this ReceivedCredit. """ @@ -127,18 +220,15 @@ class UsBankAccount(StripeObject): """ gb_bank_account: Optional[GbBankAccount] """ - Hash containing the transaction bank details. Present if `origin_type` field value is `gb_bank_account`. + Deprecated. Use `originating_bank_account.sort_code` instead. """ - origin_type: Union[ - Literal["gb_bank_account", "sepa_bank_account", "us_bank_account"], - str, - ] + originating_bank_account: OriginatingBankAccount """ - Open Enum. Indicates the origin of source from which external funds originated from. + Hash containing the originating bank account details and type for this bank transfer. """ sepa_bank_account: Optional[SepaBankAccount] """ - Hash containing the transaction bank details. Present if `origin_type` field value is `sepa_bank_account`. + Deprecated. Use `originating_bank_account.iban` instead. """ statement_descriptor: Optional[str] """ @@ -146,10 +236,11 @@ class UsBankAccount(StripeObject): """ us_bank_account: Optional[UsBankAccount] """ - Hash containing the transaction bank details. Present if `origin_type` field value is `us_bank_account`. + Deprecated. Use `originating_bank_account.aba` instead. """ _inner_class_types = { "gb_bank_account": GbBankAccount, + "originating_bank_account": OriginatingBankAccount, "sepa_bank_account": SepaBankAccount, "us_bank_account": UsBankAccount, } @@ -170,7 +261,7 @@ class Failed(StripeObject): """ class Returned(StripeObject): - reason: Literal["originator_initiated_reversal"] + reason: Union[Literal["originator_initiated_reversal"], str] """ Open Enum. The `returned` status reason. """ @@ -206,6 +297,10 @@ class StatusTransitions(StripeObject): """ The amount and currency of the ReceivedCredit. """ + amount_received: Amount + """ + The amount and currency of the ReceivedCredit that was received. + """ balance_transfer: Optional[BalanceTransfer] """ This object stores details about the originating Stripe transaction that resulted in the ReceivedCredit. Present if `type` field value is `balance_transfer`. diff --git a/stripe/v2/money_management/_received_credit_service.py b/stripe/v2/money_management/_received_credit_service.py index b3c8e1bca..3ecd4402b 100644 --- a/stripe/v2/money_management/_received_credit_service.py +++ b/stripe/v2/money_management/_received_credit_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ReceivedCreditRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedCredit": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ReceivedCreditRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedCredit": diff --git a/stripe/v2/money_management/_received_debit.py b/stripe/v2/money_management/_received_debit.py index 75ce02518..e875eb3e8 100644 --- a/stripe/v2/money_management/_received_debit.py +++ b/stripe/v2/money_management/_received_debit.py @@ -21,7 +21,7 @@ class UsBankAccount(StripeObject): """ The name of the bank the debit originated from. """ - network: Literal["ach"] + network: Union[Literal["ach"], str] """ Open Enum. The bank network the debit was originated on. """ @@ -34,7 +34,7 @@ class UsBankAccount(StripeObject): """ The Financial Address that was debited. """ - payment_method_type: Literal["us_bank_account"] + payment_method_type: Union[Literal["us_bank_account"], str] """ Open Enum. The type of the payment method used to originate the debit. """ diff --git a/stripe/v2/money_management/_received_debit_service.py b/stripe/v2/money_management/_received_debit_service.py index 15a73c603..9ea567a13 100644 --- a/stripe/v2/money_management/_received_debit_service.py +++ b/stripe/v2/money_management/_received_debit_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["ReceivedDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedDebit": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["ReceivedDebitRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "ReceivedDebit": diff --git a/stripe/v2/_test_helper_service.py b/stripe/v2/money_management/_test_helpers_service.py similarity index 81% rename from stripe/v2/_test_helper_service.py rename to stripe/v2/money_management/_test_helpers_service.py index c4109b399..d5fa4a9cb 100644 --- a/stripe/v2/_test_helper_service.py +++ b/stripe/v2/money_management/_test_helpers_service.py @@ -5,19 +5,19 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: - from stripe.v2.test_helpers._financial_address_service import ( + from stripe.v2.money_management.test_helpers._financial_address_service import ( FinancialAddressService, ) _subservices = { "financial_addresses": [ - "stripe.v2.test_helpers._financial_address_service", + "stripe.v2.money_management.test_helpers._financial_address_service", "FinancialAddressService", ], } -class TestHelperService(StripeService): +class TestHelpersService(StripeService): financial_addresses: "FinancialAddressService" def __init__(self, requestor): diff --git a/stripe/v2/money_management/_transaction_entry_service.py b/stripe/v2/money_management/_transaction_entry_service.py index 5222a8a21..f95b0e6ee 100644 --- a/stripe/v2/money_management/_transaction_entry_service.py +++ b/stripe/v2/money_management/_transaction_entry_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["TransactionEntryRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TransactionEntry": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TransactionEntryRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "TransactionEntry": diff --git a/stripe/v2/money_management/_transaction_service.py b/stripe/v2/money_management/_transaction_service.py index 24db288e4..08b1bb2b6 100644 --- a/stripe/v2/money_management/_transaction_service.py +++ b/stripe/v2/money_management/_transaction_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": @@ -81,6 +82,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["TransactionRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Transaction": diff --git a/stripe/v2/test_helpers/__init__.py b/stripe/v2/money_management/test_helpers/__init__.py similarity index 81% rename from stripe/v2/test_helpers/__init__.py rename to stripe/v2/money_management/test_helpers/__init__.py index 85fdb347a..c70164cfb 100644 --- a/stripe/v2/test_helpers/__init__.py +++ b/stripe/v2/money_management/test_helpers/__init__.py @@ -4,14 +4,14 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: - from stripe.v2.test_helpers._financial_address_service import ( + from stripe.v2.money_management.test_helpers._financial_address_service import ( FinancialAddressService as FinancialAddressService, ) # name -> (import_target, is_submodule) _import_map = { "FinancialAddressService": ( - "stripe.v2.test_helpers._financial_address_service", + "stripe.v2.money_management.test_helpers._financial_address_service", False, ), } diff --git a/stripe/v2/test_helpers/_financial_address_service.py b/stripe/v2/money_management/test_helpers/_financial_address_service.py similarity index 79% rename from stripe/v2/test_helpers/_financial_address_service.py rename to stripe/v2/money_management/test_helpers/_financial_address_service.py index a10633a89..adc1bad10 100644 --- a/stripe/v2/test_helpers/_financial_address_service.py +++ b/stripe/v2/money_management/test_helpers/_financial_address_service.py @@ -7,16 +7,16 @@ if TYPE_CHECKING: from stripe._request_options import RequestOptions - from stripe.params.v2.test_helpers._financial_address_credit_params import ( + from stripe.params.v2.money_management.test_helpers._financial_address_credit_params import ( FinancialAddressCreditParams, ) - from stripe.params.v2.test_helpers._financial_address_generate_microdeposits_params import ( + from stripe.params.v2.money_management.test_helpers._financial_address_generate_microdeposits_params import ( FinancialAddressGenerateMicrodepositsParams, ) - from stripe.v2._financial_address_credit_simulation import ( + from stripe.v2.money_management._financial_address_credit_simulation import ( FinancialAddressCreditSimulation, ) - from stripe.v2._financial_address_generated_microdeposits import ( + from stripe.v2.money_management._financial_address_generated_microdeposits import ( FinancialAddressGeneratedMicrodeposits, ) @@ -25,6 +25,7 @@ class FinancialAddressService(StripeService): def credit( self, id: str, + /, params: "FinancialAddressCreditParams", options: Optional["RequestOptions"] = None, ) -> "FinancialAddressCreditSimulation": @@ -35,7 +36,7 @@ def credit( "FinancialAddressCreditSimulation", self._request( "post", - "/v2/test_helpers/financial_addresses/{id}/credit".format( + "/v2/money_management/test_helpers/financial_addresses/{id}/credit".format( id=sanitize_id(id), ), base_address="api", @@ -47,6 +48,7 @@ def credit( async def credit_async( self, id: str, + /, params: "FinancialAddressCreditParams", options: Optional["RequestOptions"] = None, ) -> "FinancialAddressCreditSimulation": @@ -57,7 +59,7 @@ async def credit_async( "FinancialAddressCreditSimulation", await self._request_async( "post", - "/v2/test_helpers/financial_addresses/{id}/credit".format( + "/v2/money_management/test_helpers/financial_addresses/{id}/credit".format( id=sanitize_id(id), ), base_address="api", @@ -69,6 +71,7 @@ async def credit_async( def generate_microdeposits( self, id: str, + /, params: Optional["FinancialAddressGenerateMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAddressGeneratedMicrodeposits": @@ -79,7 +82,7 @@ def generate_microdeposits( "FinancialAddressGeneratedMicrodeposits", self._request( "post", - "/v2/test_helpers/financial_addresses/{id}/generate_microdeposits".format( + "/v2/money_management/test_helpers/financial_addresses/{id}/generate_microdeposits".format( id=sanitize_id(id), ), base_address="api", @@ -91,6 +94,7 @@ def generate_microdeposits( async def generate_microdeposits_async( self, id: str, + /, params: Optional["FinancialAddressGenerateMicrodepositsParams"] = None, options: Optional["RequestOptions"] = None, ) -> "FinancialAddressGeneratedMicrodeposits": @@ -101,7 +105,7 @@ async def generate_microdeposits_async( "FinancialAddressGeneratedMicrodeposits", await self._request_async( "post", - "/v2/test_helpers/financial_addresses/{id}/generate_microdeposits".format( + "/v2/money_management/test_helpers/financial_addresses/{id}/generate_microdeposits".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/network/_business_profile_service.py b/stripe/v2/network/_business_profile_service.py index 817ed59ef..139b19458 100644 --- a/stripe/v2/network/_business_profile_service.py +++ b/stripe/v2/network/_business_profile_service.py @@ -58,6 +58,7 @@ async def me_async( def retrieve( self, id: str, + /, params: Optional["BusinessProfileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BusinessProfile": @@ -80,6 +81,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["BusinessProfileRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "BusinessProfile": diff --git a/stripe/v2/orchestrated_commerce/_agreement_service.py b/stripe/v2/orchestrated_commerce/_agreement_service.py index f9d442497..eac175089 100644 --- a/stripe/v2/orchestrated_commerce/_agreement_service.py +++ b/stripe/v2/orchestrated_commerce/_agreement_service.py @@ -106,6 +106,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["AgreementRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": @@ -128,6 +129,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AgreementRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": @@ -150,6 +152,7 @@ async def retrieve_async( def confirm( self, id: str, + /, params: Optional["AgreementConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": @@ -172,6 +175,7 @@ def confirm( async def confirm_async( self, id: str, + /, params: Optional["AgreementConfirmParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": @@ -194,6 +198,7 @@ async def confirm_async( def terminate( self, id: str, + /, params: Optional["AgreementTerminateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": @@ -216,6 +221,7 @@ def terminate( async def terminate_async( self, id: str, + /, params: Optional["AgreementTerminateParams"] = None, options: Optional["RequestOptions"] = None, ) -> "Agreement": diff --git a/stripe/v2/signals/_account_activity.py b/stripe/v2/signals/_account_activity.py index a200c4a0b..98c04b942 100644 --- a/stripe/v2/signals/_account_activity.py +++ b/stripe/v2/signals/_account_activity.py @@ -37,11 +37,28 @@ class Profile(StripeObject): """ _inner_class_types = {"profile": Profile} + class Identity(StripeObject): + class BusinessDetails(StripeObject): + registered_name: Optional[str] + """ + Registered business name. + """ + + business_details: BusinessDetails + """ + Business details for identity data. + """ + _inner_class_types = {"business_details": BusinessDetails} + defaults: Optional[Defaults] """ Default account settings. """ - _inner_class_types = {"defaults": Defaults} + identity: Optional[Identity] + """ + Identity data. + """ + _inner_class_types = {"defaults": Defaults, "identity": Identity} account: Optional[str] """ diff --git a/stripe/v2/signals/_account_activity_service.py b/stripe/v2/signals/_account_activity_service.py index 29bd3fe13..b8cef0eec 100644 --- a/stripe/v2/signals/_account_activity_service.py +++ b/stripe/v2/signals/_account_activity_service.py @@ -33,7 +33,7 @@ def create( "AccountActivity", self._request( "post", - "/v2/signals/account_activity", + "/v2/signals/account_activities", base_address="api", params=params, options=options, @@ -52,7 +52,7 @@ async def create_async( "AccountActivity", await self._request_async( "post", - "/v2/signals/account_activity", + "/v2/signals/account_activities", base_address="api", params=params, options=options, @@ -62,6 +62,7 @@ async def create_async( def delete( self, id: str, + /, params: Optional["AccountActivityDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -72,7 +73,9 @@ def delete( "DeletedObject", self._request( "delete", - "/v2/signals/account_activity/{id}".format(id=sanitize_id(id)), + "/v2/signals/account_activities/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, @@ -82,6 +85,7 @@ def delete( async def delete_async( self, id: str, + /, params: Optional["AccountActivityDeleteParams"] = None, options: Optional["RequestOptions"] = None, ) -> "DeletedObject": @@ -92,7 +96,9 @@ async def delete_async( "DeletedObject", await self._request_async( "delete", - "/v2/signals/account_activity/{id}".format(id=sanitize_id(id)), + "/v2/signals/account_activities/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, @@ -102,6 +108,7 @@ async def delete_async( def retrieve( self, id: str, + /, params: Optional["AccountActivityRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountActivity": @@ -112,7 +119,9 @@ def retrieve( "AccountActivity", self._request( "get", - "/v2/signals/account_activity/{id}".format(id=sanitize_id(id)), + "/v2/signals/account_activities/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, @@ -122,6 +131,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AccountActivityRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountActivity": @@ -132,7 +142,9 @@ async def retrieve_async( "AccountActivity", await self._request_async( "get", - "/v2/signals/account_activity/{id}".format(id=sanitize_id(id)), + "/v2/signals/account_activities/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, diff --git a/stripe/v2/signals/_account_evaluation.py b/stripe/v2/signals/_account_evaluation.py index 46adf66f3..6ba2fd734 100644 --- a/stripe/v2/signals/_account_evaluation.py +++ b/stripe/v2/signals/_account_evaluation.py @@ -44,11 +44,28 @@ class Profile(StripeObject): """ _inner_class_types = {"profile": Profile} + class Identity(StripeObject): + class BusinessDetails(StripeObject): + registered_name: Optional[str] + """ + Registered business name. + """ + + business_details: BusinessDetails + """ + Business details for identity data. + """ + _inner_class_types = {"business_details": BusinessDetails} + defaults: Optional[Defaults] """ Default account settings. """ - _inner_class_types = {"defaults": Defaults} + identity: Optional[Identity] + """ + Identity data. + """ + _inner_class_types = {"defaults": Defaults, "identity": Identity} account: Optional[str] """ @@ -65,6 +82,26 @@ class Profile(StripeObject): _inner_class_types = {"data": Data} class EvaluatedSignals(StripeObject): + class FraudulentWebsite(StripeObject): + details: Optional[str] + """ + Human-readable details about the fraudulent website evaluation, when available. + """ + evaluated_at: Optional[str] + """ + Timestamp at which the signal was evaluated. + """ + risk_level: Literal[ + "elevated", "highest", "low", "normal", "unknown" + ] + """ + Categorical assessment of the fraudulent website risk. + """ + signal: Optional[str] + """ + The account signal ID containing the full fraudulent website signal result. + """ + class UserAccountSharing(StripeObject): evaluated_at: Optional[str] """ @@ -107,6 +144,10 @@ class UserMultiAccounting(StripeObject): """ _field_encodings = {"score": "decimal_string"} + fraudulent_website: Optional[FraudulentWebsite] + """ + Fraudulent website result for the evaluation, when available. + """ user_account_sharing: Optional[UserAccountSharing] """ User account-sharing result for the evaluation, when available. @@ -116,6 +157,7 @@ class UserMultiAccounting(StripeObject): User multi-accounting result for the evaluation, when available. """ _inner_class_types = { + "fraudulent_website": FraudulentWebsite, "user_account_sharing": UserAccountSharing, "user_multi_accounting": UserMultiAccounting, } @@ -149,13 +191,27 @@ class UserMultiAccounting(StripeObject): String representing the object's type. Objects of the same type share the same value of the object field. """ pending_signals: List[ - Union[Literal["user_account_sharing", "user_multi_accounting"], str] + Union[ + Literal[ + "fraudulent_website", + "user_account_sharing", + "user_multi_accounting", + ], + str, + ] ] """ List of signals still pending evaluation. """ requested_signals: List[ - Union[Literal["user_account_sharing", "user_multi_accounting"], str] + Union[ + Literal[ + "fraudulent_website", + "user_account_sharing", + "user_multi_accounting", + ], + str, + ] ] """ List of signals requested for evaluation. diff --git a/stripe/v2/signals/_account_evaluation_service.py b/stripe/v2/signals/_account_evaluation_service.py index adbb41c8b..83ad3a5c8 100644 --- a/stripe/v2/signals/_account_evaluation_service.py +++ b/stripe/v2/signals/_account_evaluation_service.py @@ -58,6 +58,7 @@ async def create_async( def retrieve( self, id: str, + /, params: Optional["AccountEvaluationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountEvaluation": @@ -80,6 +81,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AccountEvaluationRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountEvaluation": diff --git a/stripe/v2/signals/_account_signal.py b/stripe/v2/signals/_account_signal.py index 07fe2d913..6c3d40586 100644 --- a/stripe/v2/signals/_account_signal.py +++ b/stripe/v2/signals/_account_signal.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional, Union +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -28,6 +28,67 @@ class AccountDetails(StripeObject): The v1 customer ID of the account, for users not yet migrated to v2/accounts. """ + class FraudulentMerchant(StripeObject): + class AdditionalDetails(StripeObject): + class Indicator(StripeObject): + explanation: str + """ + A brief explanation of how this indicator contributed to the fraudulent merchant probability. + """ + impact: Literal[ + "decrease", "neutral", "slight_increase", "strong_increase" + ] + """ + The effect this indicator had on the overall risk level. + """ + indicator: Literal[ + "bank_account", + "business_information_and_account_activity", + "disputes", + "failures", + "geolocation", + "other", + "other_related_accounts", + "other_transaction_activity", + "owner_email", + ] + """ + The name of the specific indicator used in the risk assessment. + """ + + indicators: List[Indicator] + """ + Array of objects representing individual factors that contributed to the calculated probability. Absent when risk level is unknown, + or when the user is not on a product tier that includes indicators. + """ + _inner_class_types = {"indicators": Indicator} + + additional_details: Optional[AdditionalDetails] + """ + Supplementary contextual data for the signal, including indicators. + """ + probability: Optional[Decimal] + """ + The probability of the merchant being fraudulent. Can be between 0.00 and 100.00. Absent when risk level is unknown, + or when the user is not on a product tier that includes numeric scores. + """ + risk_level: Literal["elevated", "highest", "low", "normal", "unknown"] + """ + Categorical assessment of the fraudulent merchant risk based on probability. + """ + _inner_class_types = {"additional_details": AdditionalDetails} + _field_encodings = {"probability": "decimal_string"} + + class FraudulentWebsite(StripeObject): + details: Optional[str] + """ + Human-readable details about the fraudulent website evaluation. + """ + risk_level: Literal["elevated", "highest", "low", "normal", "unknown"] + """ + Categorical assessment of the fraudulent website risk. + """ + class UserAccountSharing(StripeObject): risk_level: Literal["elevated", "highest", "low", "normal", "unknown"] """ @@ -64,6 +125,14 @@ class UserMultiAccounting(StripeObject): """ Timestamp at which the signal was created. """ + fraudulent_merchant: Optional[FraudulentMerchant] + """ + Data for the fraudulent merchant signal. Present only when type is fraudulent_merchant. + """ + fraudulent_website: Optional[FraudulentWebsite] + """ + Data for the fraudulent website signal. Present only when type is fraudulent_website. + """ id: str """ Unique identifier for the account signal. @@ -76,7 +145,15 @@ class UserMultiAccounting(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ - type: Union[Literal["user_account_sharing", "user_multi_accounting"], str] + type: Union[ + Literal[ + "fraudulent_merchant", + "fraudulent_website", + "user_account_sharing", + "user_multi_accounting", + ], + str, + ] """ The type of signal. """ @@ -90,6 +167,8 @@ class UserMultiAccounting(StripeObject): """ _inner_class_types = { "account_details": AccountDetails, + "fraudulent_merchant": FraudulentMerchant, + "fraudulent_website": FraudulentWebsite, "user_account_sharing": UserAccountSharing, "user_multi_accounting": UserMultiAccounting, } diff --git a/stripe/v2/signals/_account_signal_service.py b/stripe/v2/signals/_account_signal_service.py index c453b115b..3a4bc2a8b 100644 --- a/stripe/v2/signals/_account_signal_service.py +++ b/stripe/v2/signals/_account_signal_service.py @@ -59,6 +59,7 @@ async def list_async( def retrieve( self, id: str, + /, params: Optional["AccountSignalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountSignal": @@ -79,6 +80,7 @@ def retrieve( async def retrieve_async( self, id: str, + /, params: Optional["AccountSignalRetrieveParams"] = None, options: Optional["RequestOptions"] = None, ) -> "AccountSignal": diff --git a/tests/api_resources/test_reversal.py b/tests/api_resources/test_transfer_reversal.py similarity index 72% rename from tests/api_resources/test_reversal.py rename to tests/api_resources/test_transfer_reversal.py index 0d96dc187..f4ebf110a 100644 --- a/tests/api_resources/test_reversal.py +++ b/tests/api_resources/test_transfer_reversal.py @@ -6,15 +6,17 @@ TEST_RESOURCE_ID = "trr_123" -class TestReversal(object): +class TestTransferReversal(object): def construct_resource(self): reversal_dict = { "id": TEST_RESOURCE_ID, - "object": "reversal", + "object": "transfer_reversal", "metadata": {}, "transfer": "tr_123", } - return stripe.Reversal.construct_from(reversal_dict, stripe.api_key) + return stripe.TransferReversal.construct_from( + reversal_dict, stripe.api_key + ) def test_has_instance_url(self): resource = self.construct_resource() @@ -25,11 +27,13 @@ def test_has_instance_url(self): def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): - stripe.Reversal.modify(TEST_RESOURCE_ID, metadata={"key": "value"}) + stripe.TransferReversal.modify( + TEST_RESOURCE_ID, metadata={"key": "value"} + ) def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): - stripe.Reversal.retrieve(TEST_RESOURCE_ID) + stripe.TransferReversal.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource() diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 926cffb19..6666a7264 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -12958,7 +12958,7 @@ def test_financial_connections_sessions_post_2_service_non_namespaced( "customer": "cus_xxxxxxxxxxxxx", }, "permissions": ["payment_method", "balances"], - "filters": {"countries": ["US"]}, + "filters": {"country": "US"}, } ) http_client_mock.assert_requested( @@ -12966,7 +12966,7 @@ def test_financial_connections_sessions_post_2_service_non_namespaced( path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[country]=US", ) def test_financial_connections_sessions_post_2( @@ -12978,13 +12978,13 @@ def test_financial_connections_sessions_post_2( "customer": "cus_xxxxxxxxxxxxx", }, permissions=["payment_method", "balances"], - filters={"countries": ["US"]}, + filters={"country": "US"}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[country]=US", ) def test_financial_connections_sessions_post_2_service( @@ -13006,7 +13006,7 @@ def test_financial_connections_sessions_post_2_service( "customer": "cus_xxxxxxxxxxxxx", }, "permissions": ["payment_method", "balances"], - "filters": {"countries": ["US"]}, + "filters": {"country": "US"}, } ) http_client_mock.assert_requested( @@ -13014,7 +13014,7 @@ def test_financial_connections_sessions_post_2_service( path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[country]=US", ) @pytest.mark.anyio @@ -13027,13 +13027,13 @@ async def test_financial_connections_sessions_post_2_async( "customer": "cus_xxxxxxxxxxxxx", }, permissions=["payment_method", "balances"], - filters={"countries": ["US"]}, + filters={"country": "US"}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[country]=US", ) @pytest.mark.anyio @@ -13056,7 +13056,7 @@ async def test_financial_connections_sessions_post_2_service_async( "customer": "cus_xxxxxxxxxxxxx", }, "permissions": ["payment_method", "balances"], - "filters": {"countries": ["US"]}, + "filters": {"country": "US"}, } ) http_client_mock.assert_requested( @@ -13064,7 +13064,7 @@ async def test_financial_connections_sessions_post_2_service_async( path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", - post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", + post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[country]=US", ) def test_financial_connections_transactions_get_service_non_namespaced( @@ -44600,7 +44600,6 @@ def test_v2_core_account_link_post_service( "fields": "eventually_due", "future_requirements": "include", }, - "configurations": ["merchant"], "refresh_url": "refresh_url", "return_url": "return_url", }, @@ -44609,7 +44608,6 @@ def test_v2_core_account_link_post_service( "fields": "eventually_due", "future_requirements": "include", }, - "configurations": ["merchant"], "refresh_url": "refresh_url", "return_url": "return_url", }, @@ -44622,7 +44620,7 @@ def test_v2_core_account_link_post_service( path="/v2/core/account_links", query_string="", api_base="https://api.stripe.com", - post_data='{"account":"account","use_case":{"account_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["merchant"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["merchant"],"refresh_url":"refresh_url","return_url":"return_url"},"type":"account_onboarding"}}', + post_data='{"account":"account","use_case":{"account_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"refresh_url":"refresh_url","return_url":"return_url"},"type":"account_onboarding"}}', is_json=True, ) @@ -45712,7 +45710,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": "bank_account", } ) http_client_mock.assert_requested( @@ -45720,7 +45718,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":"bank_account"}', is_json=True, ) @@ -46375,6 +46373,55 @@ def test_v2_money_management_received_debit_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_money_management_test_helpers_financial_address_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/test_helpers/financial_addresses/id_123/credit", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.test_helpers.financial_addresses.credit( + "id_123", + {"amount": {"currency": "USD", "value": 96}, "network": "ach"}, + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/test_helpers/financial_addresses/id_123/credit", + query_string="", + api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"network":"ach"}', + is_json=True, + ) + + def test_v2_money_management_test_helpers_financial_address_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/test_helpers/financial_addresses/id_123/generate_microdeposits", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.test_helpers.financial_addresses.generate_microdeposits( + "id_123" + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/test_helpers/financial_addresses/id_123/generate_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_money_management_transaction_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46610,21 +46657,21 @@ def test_v2_signals_account_activity_post_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/signals/account_activity", + "/v2/signals/account_activities", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.signals.account_activity.create( + client.v2.signals.account_activities.create( { "type": "registration_attempt", } ) http_client_mock.assert_requested( "post", - path="/v2/signals/account_activity", + path="/v2/signals/account_activities", query_string="", api_base="https://api.stripe.com", post_data='{"type":"registration_attempt"}', @@ -46636,17 +46683,17 @@ def test_v2_signals_account_activity_delete_service( ) -> None: http_client_mock.stub_request( "delete", - "/v2/signals/account_activity/id_123", + "/v2/signals/account_activities/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.signals.account_activity.delete("id_123") + client.v2.signals.account_activities.delete("id_123") http_client_mock.assert_requested( "delete", - path="/v2/signals/account_activity/id_123", + path="/v2/signals/account_activities/id_123", query_string="", api_base="https://api.stripe.com", ) @@ -46656,17 +46703,17 @@ def test_v2_signals_account_activity_get_service( ) -> None: http_client_mock.stub_request( "get", - "/v2/signals/account_activity/id_123", + "/v2/signals/account_activities/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.signals.account_activity.retrieve("id_123") + client.v2.signals.account_activities.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/signals/account_activity/id_123", + path="/v2/signals/account_activities/id_123", query_string="", api_base="https://api.stripe.com", ) @@ -46696,9 +46743,14 @@ def test_v2_signals_account_evaluation_post_service( "product_description": "product_description", }, }, + "identity": { + "business_details": { + "registered_name": "registered_name", + }, + }, }, }, - "requested_signals": ["user_account_sharing"], + "requested_signals": ["user_multi_accounting"], } ) http_client_mock.assert_requested( @@ -46706,7 +46758,7 @@ def test_v2_signals_account_evaluation_post_service( path="/v2/signals/account_evaluations", query_string="", api_base="https://api.stripe.com", - post_data='{"account_details":{"account":"account","customer":"customer","data":{"defaults":{"profile":{"business_url":"business_url","doing_business_as":"doing_business_as","product_description":"product_description"}}}},"requested_signals":["user_account_sharing"]}', + post_data='{"account_details":{"account":"account","customer":"customer","data":{"defaults":{"profile":{"business_url":"business_url","doing_business_as":"doing_business_as","product_description":"product_description"}},"identity":{"business_details":{"registered_name":"registered_name"}}}},"requested_signals":["user_multi_accounting"]}', is_json=True, ) @@ -46775,55 +46827,6 @@ def test_v2_signals_account_signal_get_2_service( api_base="https://api.stripe.com", ) - def test_v2_test_helpers_financial_address_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/test_helpers/financial_addresses/id_123/credit", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.test_helpers.financial_addresses.credit( - "id_123", - {"amount": {"currency": "USD", "value": 96}, "network": "ach"}, - ) - 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"}', - is_json=True, - ) - - def test_v2_test_helpers_financial_address_post_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.test_helpers.financial_addresses.generate_microdeposits( - "id_123", - ) - http_client_mock.assert_requested( - "post", - path="/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", - query_string="", - api_base="https://api.stripe.com", - post_data="{}", - is_json=True, - ) - def test_already_canceled_error_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46887,8 +46890,8 @@ def test_blocked_by_stripe_error_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/us_bank_accounts", - rbody='{"error":{"type":"blocked_by_stripe","code":"blocked_payout_method"}}', + "/v2/core/vault/gb_bank_accounts", + rbody='{"error":{"type":"blocked_by_stripe","code":"blocked_gb_bank_account"}}', rcode=400, ) client = StripeClient( @@ -46897,20 +46900,15 @@ def test_blocked_by_stripe_error_service( ) try: - client.v2.core.vault.us_bank_accounts.create( - { - "account_number": "account_number", - "currency": "usd", - } - ) + client.v2.core.vault.gb_bank_accounts.create({"currency": "usd"}) except _error.BlockedByStripeError: pass http_client_mock.assert_requested( "post", - path="/v2/core/vault/us_bank_accounts", + path="/v2/core/vault/gb_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number","currency":"usd"}', + post_data='{"currency":"usd"}', is_json=True, ) @@ -46919,8 +46917,8 @@ def test_cannot_proceed_error_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/us_bank_accounts/id_123/archive", - rbody='{"error":{"type":"cannot_proceed","code":"default_payout_method_cannot_be_archived"}}', + "/v2/core/vault/gb_bank_accounts", + rbody='{"error":{"type":"cannot_proceed","code":"default_gb_bank_account_cannot_be_archived"}}', rcode=400, ) client = StripeClient( @@ -46929,15 +46927,15 @@ def test_cannot_proceed_error_service( ) try: - client.v2.core.vault.us_bank_accounts.archive("id_123") + client.v2.core.vault.gb_bank_accounts.create({"currency": "usd"}) except _error.CannotProceedError: pass http_client_mock.assert_requested( "post", - path="/v2/core/vault/us_bank_accounts/id_123/archive", + path="/v2/core/vault/gb_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"currency":"usd"}', is_json=True, ) @@ -46946,8 +46944,8 @@ def test_controlled_by_alternate_resource_error_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", - rbody='{"error":{"type":"controlled_by_alternate_resource","code":"payout_method_cannot_be_archived"}}', + "/v2/core/vault/gb_bank_accounts/id_123/archive", + rbody='{"error":{"type":"controlled_by_alternate_resource","code":"gb_bank_account_cannot_be_archived"}}', rcode=400, ) client = StripeClient( @@ -46956,41 +46954,12 @@ def test_controlled_by_alternate_resource_error_service( ) try: - client.v2.core.vault.us_bank_accounts.confirm_microdeposits( - "id_123" - ) + client.v2.core.vault.gb_bank_accounts.archive("id_123") except _error.ControlledByAlternateResourceError: pass http_client_mock.assert_requested( "post", - path="/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", - query_string="", - api_base="https://api.stripe.com", - post_data="{}", - is_json=True, - ) - - def test_controlled_by_dashboard_error_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/core/vault/us_bank_accounts/id_123/archive", - rbody='{"error":{"type":"controlled_by_dashboard","code":"bank_account_cannot_be_archived"}}', - rcode=400, - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - try: - client.v2.core.vault.us_bank_accounts.archive("id_123") - except _error.ControlledByDashboardError: - pass - http_client_mock.assert_requested( - "post", - path="/v2/core/vault/us_bank_accounts/id_123/archive", + path="/v2/core/vault/gb_bank_accounts/id_123/archive", query_string="", api_base="https://api.stripe.com", post_data="{}", @@ -47046,7 +47015,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": "bank_account", } ) except _error.FinancialAccountNotOpenError: @@ -47056,7 +47025,7 @@ 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":"bank_account"}', is_json=True, ) @@ -47155,6 +47124,33 @@ def test_invalid_payout_method_error_service( is_json=True, ) + def test_invalid_vaulted_credential_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/gb_bank_accounts", + rbody='{"error":{"type":"invalid_vaulted_credential","code":"invalid_gb_bank_account"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.gb_bank_accounts.create({"currency": "usd"}) + except _error.InvalidVaultedCredentialError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/gb_bank_accounts", + query_string="", + api_base="https://api.stripe.com", + post_data='{"currency":"usd"}', + is_json=True, + ) + def test_non_zero_balance_error_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -47214,7 +47210,7 @@ def test_quota_exceeded_error_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/us_bank_accounts", + "/v2/core/vault/gb_bank_accounts", rbody='{"error":{"type":"quota_exceeded","code":"archived_payout_method_card"}}', rcode=400, ) @@ -47224,20 +47220,15 @@ def test_quota_exceeded_error_service( ) try: - client.v2.core.vault.us_bank_accounts.create( - { - "account_number": "account_number", - "currency": "usd", - } - ) + client.v2.core.vault.gb_bank_accounts.create({"currency": "usd"}) except _error.QuotaExceededError: pass http_client_mock.assert_requested( "post", - path="/v2/core/vault/us_bank_accounts", + path="/v2/core/vault/gb_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number","currency":"usd"}', + post_data='{"currency":"usd"}', is_json=True, ) @@ -47337,3 +47328,90 @@ def test_temporary_session_expired_error_service( post_data='{"events":[{"event_name":"event_name","payload":{"key":"payload"}}]}', is_json=True, ) + + def test_verification_attempt_failed_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + rbody='{"error":{"type":"verification_attempt_failed","code":"us_bank_account_confirm_microdeposits_failure"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.confirm_microdeposits( + "id_123" + ) + except _error.VerificationAttemptFailedError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_verification_expired_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + rbody='{"error":{"type":"verification_expired","code":"us_bank_account_microdeposits_timed_out"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.confirm_microdeposits( + "id_123" + ) + except _error.VerificationExpiredError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_verification_not_initiated_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + rbody='{"error":{"type":"verification_not_initiated","code":"us_bank_account_microdeposits_not_sent_before_confirming"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.core.vault.us_bank_accounts.confirm_microdeposits( + "id_123" + ) + except _error.VerificationNotInitiatedError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) diff --git a/tests/test_stripe_object.py b/tests/test_stripe_object.py index d73d79869..aecd64938 100644 --- a/tests/test_stripe_object.py +++ b/tests/test_stripe_object.py @@ -126,6 +126,13 @@ def test_access(self): with pytest.raises(ValueError): obj.foo = "" + def test_access_request_field(self): + obj = StripeObject.construct_from( + {"request": {"id": "req_123"}}, "mykey" + ) + + assert obj.request.id == "req_123" + def test_refresh_from(self, mocker): obj = StripeObject.construct_from( {"foo": "bar", "trans": "me"}, "mykey"