diff --git a/CHANGELOG.md b/CHANGELOG.md index 85f09753a..5dffbe4c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,50 @@ This release changes the pinned API version to 2026-04-22.private. * Add support for `purpose` on `Treasury.OutboundPayment` and `treasury.OutboundPaymentCreateParams` * Add support for error codes `action_blocked` and `approval_required` on `QuotePreviewInvoice.LastFinalizationError` +## 15.1.0 - 2026-04-23 +This release changes the pinned API version to 2026-04-22.dahlia. + +* [#1793](https://github.com/stripe/stripe-python/pull/1793) Update generated code + * Add support for `balance_report` and `payout_reconciliation_report` on `AccountSession.Component` and `AccountSessionCreateParamsComponent` + * Add support for `app_distribution` and `sunbit_payments` on `Account.Capability`, `AccountCreateParamsCapability`, and `AccountModifyParamsCapability` + * ⚠️ Add support for new values `fee_credit_funding`, `inbound_transfer_reversal`, and `inbound_transfer` on enum `BalanceTransaction.type` + * Add support for `sunbit` on `Charge.PaymentMethodDetail`, `ConfirmationToken.PaymentMethodPreview`, `ConfirmationTokenCreateParamsPaymentMethodDatum`, `PaymentAttemptRecord.PaymentMethodDetail`, `PaymentIntentConfirmParamsPaymentMethodDatum`, `PaymentIntentCreateParamsPaymentMethodDatum`, `PaymentIntentModifyParamsPaymentMethodDatum`, `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationModifyParams`, `PaymentMethodConfiguration`, `PaymentMethodCreateParams`, `PaymentMethod`, `PaymentRecord.PaymentMethodDetail`, `SetupIntentConfirmParamsPaymentMethodDatum`, `SetupIntentCreateParamsPaymentMethodDatum`, and `SetupIntentModifyParamsPaymentMethodDatum` + * ⚠️ Add support for new values `phantom_cash` and `usdt` on enums `Charge.PaymentMethodDetail.Crypto.token_currency`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.token_currency`, and `PaymentRecord.PaymentMethodDetail.Crypto.token_currency` + * Add support for `location` and `reader` on `Charge.PaymentMethodDetail.Klarna`, `PaymentAttemptRecord.PaymentMethodDetail.Klarna`, and `PaymentRecord.PaymentMethodDetail.Klarna` + * Add support for `mandate` on `Charge.PaymentMethodDetail.Pix`, `PaymentAttemptRecord.PaymentMethodDetail.Pix`, and `PaymentRecord.PaymentMethodDetail.Pix` + * Add support for `managed_payments` on `Checkout.Session`, `PaymentIntent`, `PaymentLinkCreateParams`, `PaymentLink`, `SetupIntent`, `Subscription`, and `checkout.SessionCreateParams` + * Add support for new value `sunbit` on enums `PaymentIntentConfirmParams.excluded_payment_method_types`, `PaymentIntentCreateParams.excluded_payment_method_types`, `PaymentIntentModifyParams.excluded_payment_method_types`, `SetupIntentCreateParams.excluded_payment_method_types`, `SetupIntentModifyParams.excluded_payment_method_types`, and `checkout.SessionCreateParams.excluded_payment_method_types` + * Add support for `mandate_options` on `Checkout.Session.PaymentMethodOption.Pix`, `PaymentIntent.PaymentMethodOption.Pix`, `PaymentIntentConfirmParamsPaymentMethodOptionPix`, `PaymentIntentCreateParamsPaymentMethodOptionPix`, `PaymentIntentModifyParamsPaymentMethodOptionPix`, and `checkout.SessionCreateParamsPaymentMethodOptionPix` + * Change type of `PaymentIntentConfirmParamsPaymentMethodOptionPix.setup_future_usage`, `PaymentIntentCreateParamsPaymentMethodOptionPix.setup_future_usage`, `PaymentIntentModifyParamsPaymentMethodOptionPix.setup_future_usage`, and `checkout.SessionCreateParamsPaymentMethodOptionPix.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')` + * Add support for new value `sunbit` on enum `checkout.SessionCreateParams.payment_method_types` + * ⚠️ Add support for new values `fo_vat`, `gi_tin`, `it_cf`, and `py_ruc` on enums `Checkout.Session.CustomerDetail.TaxId.type`, `Invoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetail.TaxId.type`, `Tax.Transaction.CustomerDetail.TaxId.type`, and `TaxId.type` + * ⚠️ Change type of `Checkout.Session.PaymentMethodOption.Pix.setup_future_usage` and `PaymentIntent.PaymentMethodOption.Pix.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')` + * Add support for new value `sunbit` on enums `ConfirmationTokenCreateParamsPaymentMethodDatum.type`, `PaymentIntentConfirmParamsPaymentMethodDatum.type`, `PaymentIntentCreateParamsPaymentMethodDatum.type`, `PaymentIntentModifyParamsPaymentMethodDatum.type`, `SetupIntentConfirmParamsPaymentMethodDatum.type`, `SetupIntentCreateParamsPaymentMethodDatum.type`, and `SetupIntentModifyParamsPaymentMethodDatum.type` + * ⚠️ Add support for new value `sunbit` on enums `ConfirmationToken.PaymentMethodPreview.type` and `PaymentMethod.type` + * Add support for new values `fo_vat`, `gi_tin`, `it_cf`, and `py_ruc` on enums `CustomerCreateParamsTaxIdDatum.type`, `CustomerCreateTaxIdParams.type`, `InvoiceCreatePreviewParamsCustomerDetailTaxId.type`, `TaxIdCreateParams.type`, and `tax.CalculationCreateParamsCustomerDetailTaxId.type` + * Add support for new value `sunbit` on enums `CustomerListPaymentMethodsParams.type`, `PaymentMethodCreateParams.type`, and `PaymentMethodListParams.type` + * Add support for `pix` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Mandate.PaymentMethodDetail`, `SetupAttempt.PaymentMethodDetail`, `SetupIntent.PaymentMethodOption`, `SetupIntentConfirmParamsPaymentMethodOption`, `SetupIntentCreateParamsPaymentMethodOption`, `SetupIntentModifyParamsPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption` + * Add support for `upi` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption` + * Add support for new values `pix` and `upi` on enums `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * ⚠️ Add support for new values `pix` and `upi` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types` + * Add support for `card_presence` on `Issuing.Authorization` + * Add support for `allowed_card_presences` and `blocked_card_presences` on `Issuing.Card.SpendingControl`, `Issuing.Cardholder.SpendingControl`, `issuing.CardCreateParamsSpendingControl`, `issuing.CardModifyParamsSpendingControl`, `issuing.CardholderCreateParamsSpendingControl`, and `issuing.CardholderModifyParamsSpendingControl` + * ⚠️ Add support for new value `fulfillment_error` on enum `Issuing.Card.cancellation_reason` + * ⚠️ Add support for new value `fulfillment_error` on enum `Issuing.Card.replacement_reason` + * Add support for `amount` and `currency` on `Mandate.MultiUse` + * Add support for `amount_to_confirm` on `PaymentIntentConfirmParams` + * ⚠️ Add support for new value `sunbit` on enums `PaymentIntent.excluded_payment_method_types` and `SetupIntent.excluded_payment_method_types` + * Add support for `klarna_display_qr_code` on `PaymentIntent.NextAction` + * Add support for new value `sunbit` on enums `PaymentLinkCreateParams.payment_method_types` and `PaymentLinkModifyParams.payment_method_types` + * ⚠️ Add support for new value `sunbit` on enum `PaymentLink.payment_method_types` + * ⚠️ Add support for new values `low`, `not_assessed`, and `unknown` on enum `Radar.PaymentEvaluation.Signal.FraudulentPayment.risk_level` + * Add support for new value `account` on enum `radar.ValueListCreateParams.item_type` + * ⚠️ Add support for new value `account` on enum `Radar.ValueList.item_type` + * Add support for `moto` on `SetupAttempt.PaymentMethodDetail.Card` + * Add support for `pix_display_qr_code` on `SetupIntent.NextAction` + * Add support for new value `2026-04-22.dahlia` on enum `WebhookEndpointCreateParams.api_version` + * Add support for error codes `action_blocked` and `approval_required` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError` + ## 15.1.0b2 - 2026-04-01 * Please refer to the changelog for [v15.0.1](https://github.com/stripe/stripe-python/blob/v15.0.1/CHANGELOG.md#1501---2026-04-01) diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 65009e232..4540bccf0 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -77db2d3a0cf933a87e318463e31419e60d76483b \ No newline at end of file +826bf48af8bcd391512daeaf283b8486347b14c8 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 048a4fc1a..97a293208 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2252 \ No newline at end of file +v2253 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index aab7c6eb2..e1f0e7670 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -325,6 +325,7 @@ def add_beta_version( AlreadyExistsError as AlreadyExistsError, AuthenticationError as AuthenticationError, BlockedByStripeError as BlockedByStripeError, + CannotProceedError as CannotProceedError, CardError as CardError, ControlledByAlternateResourceError as ControlledByAlternateResourceError, ControlledByDashboardError as ControlledByDashboardError, @@ -779,6 +780,7 @@ def add_beta_version( "AlreadyExistsError": ("stripe._error", False), "AuthenticationError": ("stripe._error", False), "BlockedByStripeError": ("stripe._error", False), + "CannotProceedError": ("stripe._error", False), "CardError": ("stripe._error", False), "ControlledByAlternateResourceError": ("stripe._error", False), "ControlledByDashboardError": ("stripe._error", False), diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 20c789100..ae057a867 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -389,6 +389,11 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.AlreadyExistsError(**error_args) elif type == "blocked_by_stripe": return error.BlockedByStripeError(**error_args) + elif type == "cannot_proceed": + return error.CannotProceedError( + **error_args, + reason=error_data.get("reason"), + ) elif type == "controlled_by_alternate_resource": return error.ControlledByAlternateResourceError(**error_args) elif type == "controlled_by_dashboard": diff --git a/stripe/_error.py b/stripe/_error.py index ecba79e36..c882414cd 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -200,6 +200,28 @@ class BlockedByStripeError(StripeError): pass +class CannotProceedError(StripeError): + def __init__( + self, + message=None, + http_body=None, + http_status=None, + json_body=None, + headers=None, + code=None, + reason=None, + ): + super().__init__( + message, + http_body, + http_status, + json_body, + headers, + code, + ) + self.reason = reason + + class ControlledByAlternateResourceError(StripeError): pass diff --git a/stripe/_event_notification_handler.py b/stripe/_event_notification_handler.py index 00fa531ae..9db0b9828 100644 --- a/stripe/_event_notification_handler.py +++ b/stripe/_event_notification_handler.py @@ -16,6 +16,18 @@ from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v2_commerce_product_catalog_imports_failed_event import ( + V2CommerceProductCatalogImportsFailedEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_processing_event import ( + V2CommerceProductCatalogImportsProcessingEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_event import ( + V2CommerceProductCatalogImportsSucceededEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event import ( + V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, + ) from stripe.events._v2_core_account_closed_event import ( V2CoreAccountClosedEventNotification, ) @@ -109,6 +121,27 @@ from stripe.events._v2_core_health_event_generation_failure_resolved_event import ( V2CoreHealthEventGenerationFailureResolvedEventNotification, ) + from stripe.events._v2_data_reporting_query_run_created_event import ( + V2DataReportingQueryRunCreatedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_failed_event import ( + V2DataReportingQueryRunFailedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_succeeded_event import ( + V2DataReportingQueryRunSucceededEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_updated_event import ( + V2DataReportingQueryRunUpdatedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_failed_event import ( + V2ExtendWorkflowRunFailedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_started_event import ( + V2ExtendWorkflowRunStartedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_succeeded_event import ( + V2ExtendWorkflowRunSucceededEventNotification, + ) from stripe.events._v2_money_management_adjustment_created_event import ( V2MoneyManagementAdjustmentCreatedEventNotification, ) @@ -217,6 +250,18 @@ from stripe.events._v2_money_management_transaction_updated_event import ( V2MoneyManagementTransactionUpdatedEventNotification, ) + from stripe.events._v2_orchestrated_commerce_agreement_confirmed_event import ( + V2OrchestratedCommerceAgreementConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_created_event import ( + V2OrchestratedCommerceAgreementCreatedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event import ( + V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_terminated_event import ( + V2OrchestratedCommerceAgreementTerminatedEventNotification, + ) # event-notification-types: The end of the section generated from our OpenAPI spec # internal type to represent any EventNotification subclass @@ -339,6 +384,58 @@ def on_v1_billing_meter_no_meter_found( ) return func + def on_v2_commerce_product_catalog_imports_failed( + self, + func: "Callable[[V2CommerceProductCatalogImportsFailedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CommerceProductCatalogImportsFailedEvent` (`v2.commerce.product_catalog.imports.failed`) event notification. + """ + self._register( + "v2.commerce.product_catalog.imports.failed", + func, + ) + return func + + def on_v2_commerce_product_catalog_imports_processing( + self, + func: "Callable[[V2CommerceProductCatalogImportsProcessingEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CommerceProductCatalogImportsProcessingEvent` (`v2.commerce.product_catalog.imports.processing`) event notification. + """ + self._register( + "v2.commerce.product_catalog.imports.processing", + func, + ) + return func + + def on_v2_commerce_product_catalog_imports_succeeded( + self, + func: "Callable[[V2CommerceProductCatalogImportsSucceededEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CommerceProductCatalogImportsSucceededEvent` (`v2.commerce.product_catalog.imports.succeeded`) event notification. + """ + self._register( + "v2.commerce.product_catalog.imports.succeeded", + func, + ) + return func + + def on_v2_commerce_product_catalog_imports_succeeded_with_errors( + self, + func: "Callable[[V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CommerceProductCatalogImportsSucceededWithErrorsEvent` (`v2.commerce.product_catalog.imports.succeeded_with_errors`) event notification. + """ + self._register( + "v2.commerce.product_catalog.imports.succeeded_with_errors", + func, + ) + return func + def on_v2_core_account_closed( self, func: "Callable[[V2CoreAccountClosedEventNotification, StripeClient], None]", @@ -742,6 +839,97 @@ def on_v2_core_health_event_generation_failure_resolved( ) return func + def on_v2_data_reporting_query_run_created( + self, + func: "Callable[[V2DataReportingQueryRunCreatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2DataReportingQueryRunCreatedEvent` (`v2.data.reporting.query_run.created`) event notification. + """ + self._register( + "v2.data.reporting.query_run.created", + func, + ) + return func + + def on_v2_data_reporting_query_run_failed( + self, + func: "Callable[[V2DataReportingQueryRunFailedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2DataReportingQueryRunFailedEvent` (`v2.data.reporting.query_run.failed`) event notification. + """ + self._register( + "v2.data.reporting.query_run.failed", + func, + ) + return func + + def on_v2_data_reporting_query_run_succeeded( + self, + func: "Callable[[V2DataReportingQueryRunSucceededEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2DataReportingQueryRunSucceededEvent` (`v2.data.reporting.query_run.succeeded`) event notification. + """ + self._register( + "v2.data.reporting.query_run.succeeded", + func, + ) + return func + + def on_v2_data_reporting_query_run_updated( + self, + func: "Callable[[V2DataReportingQueryRunUpdatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2DataReportingQueryRunUpdatedEvent` (`v2.data.reporting.query_run.updated`) event notification. + """ + self._register( + "v2.data.reporting.query_run.updated", + func, + ) + return func + + def on_v2_extend_workflow_run_failed( + self, + func: "Callable[[V2ExtendWorkflowRunFailedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2ExtendWorkflowRunFailedEvent` (`v2.extend.workflow_run.failed`) event notification. + """ + self._register( + "v2.extend.workflow_run.failed", + func, + ) + return func + + def on_v2_extend_workflow_run_started( + self, + func: "Callable[[V2ExtendWorkflowRunStartedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2ExtendWorkflowRunStartedEvent` (`v2.extend.workflow_run.started`) event notification. + """ + self._register( + "v2.extend.workflow_run.started", + func, + ) + return func + + def on_v2_extend_workflow_run_succeeded( + self, + func: "Callable[[V2ExtendWorkflowRunSucceededEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2ExtendWorkflowRunSucceededEvent` (`v2.extend.workflow_run.succeeded`) event notification. + """ + self._register( + "v2.extend.workflow_run.succeeded", + func, + ) + return func + def on_v2_money_management_adjustment_created( self, func: "Callable[[V2MoneyManagementAdjustmentCreatedEventNotification, StripeClient], None]", @@ -1210,4 +1398,56 @@ def on_v2_money_management_transaction_updated( ) return func + def on_v2_orchestrated_commerce_agreement_confirmed( + self, + func: "Callable[[V2OrchestratedCommerceAgreementConfirmedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2OrchestratedCommerceAgreementConfirmedEvent` (`v2.orchestrated_commerce.agreement.confirmed`) event notification. + """ + self._register( + "v2.orchestrated_commerce.agreement.confirmed", + func, + ) + return func + + def on_v2_orchestrated_commerce_agreement_created( + self, + func: "Callable[[V2OrchestratedCommerceAgreementCreatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2OrchestratedCommerceAgreementCreatedEvent` (`v2.orchestrated_commerce.agreement.created`) event notification. + """ + self._register( + "v2.orchestrated_commerce.agreement.created", + func, + ) + return func + + def on_v2_orchestrated_commerce_agreement_partially_confirmed( + self, + func: "Callable[[V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2OrchestratedCommerceAgreementPartiallyConfirmedEvent` (`v2.orchestrated_commerce.agreement.partially_confirmed`) event notification. + """ + self._register( + "v2.orchestrated_commerce.agreement.partially_confirmed", + func, + ) + return func + + def on_v2_orchestrated_commerce_agreement_terminated( + self, + func: "Callable[[V2OrchestratedCommerceAgreementTerminatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2OrchestratedCommerceAgreementTerminatedEvent` (`v2.orchestrated_commerce.agreement.terminated`) event notification. + """ + self._register( + "v2.orchestrated_commerce.agreement.terminated", + func, + ) + return func + # event-notification-registration-methods: The end of the section generated from our OpenAPI spec diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index cae37f31e..d8195bf6b 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -435,6 +435,10 @@ "MeterEventSession", ), "v2.billing.profile": ("stripe.v2.billing._profile", "Profile"), + "v2.commerce.product_catalog_import": ( + "stripe.v2.commerce._product_catalog_import", + "ProductCatalogImport", + ), "v2.core.account": ("stripe.v2.core._account", "Account"), "v2.core.account_link": ("stripe.v2.core._account_link", "AccountLink"), "v2.core.account_person": ( @@ -460,6 +464,15 @@ "stripe.v2.core.vault._us_bank_account", "UsBankAccount", ), + "v2.data.reporting.query_run": ( + "stripe.v2.data.reporting._query_run", + "QueryRun", + ), + "v2.extend.workflow": ("stripe.v2.extend._workflow", "Workflow"), + "v2.extend.workflow_run": ( + "stripe.v2.extend._workflow_run", + "WorkflowRun", + ), "financial_address_credit_simulation": ( "stripe.v2._financial_address_credit_simulation", "FinancialAddressCreditSimulation", @@ -468,6 +481,7 @@ "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", "Adjustment", @@ -524,6 +538,14 @@ "stripe.v2.money_management._transaction_entry", "TransactionEntry", ), + "v2.network.business_profile": ( + "stripe.v2.network._business_profile", + "BusinessProfile", + ), + "v2.orchestrated_commerce.agreement": ( + "stripe.v2.orchestrated_commerce._agreement", + "Agreement", + ), # V2 Object classes: The end of the section generated from our OpenAPI spec } diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index ed6b5e4c6..de23db423 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -6,25 +6,48 @@ if TYPE_CHECKING: from stripe.v2._billing_service import BillingService + from stripe.v2._commerce_service import CommerceService from stripe.v2._core_service import CoreService + from stripe.v2._datum_service import DatumService + from stripe.v2._extend_service import ExtendService + from stripe.v2._iam_service import IamService from stripe.v2._money_management_service import MoneyManagementService + from stripe.v2._network_service import NetworkService + from stripe.v2._orchestrated_commerce_service import ( + OrchestratedCommerceService, + ) from stripe.v2._test_helper_service import TestHelperService _subservices = { "billing": ["stripe.v2._billing_service", "BillingService"], + "commerce": ["stripe.v2._commerce_service", "CommerceService"], "core": ["stripe.v2._core_service", "CoreService"], + "data": ["stripe.v2._datum_service", "DatumService"], + "extend": ["stripe.v2._extend_service", "ExtendService"], + "iam": ["stripe.v2._iam_service", "IamService"], "money_management": [ "stripe.v2._money_management_service", "MoneyManagementService", ], + "network": ["stripe.v2._network_service", "NetworkService"], + "orchestrated_commerce": [ + "stripe.v2._orchestrated_commerce_service", + "OrchestratedCommerceService", + ], "test_helpers": ["stripe.v2._test_helper_service", "TestHelperService"], } class V2Services(StripeService): billing: "BillingService" + commerce: "CommerceService" core: "CoreService" + data: "DatumService" + extend: "ExtendService" + iam: "IamService" money_management: "MoneyManagementService" + network: "NetworkService" + orchestrated_commerce: "OrchestratedCommerceService" test_helpers: "TestHelperService" def __init__(self, requestor): diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index 021864e71..357157b38 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -21,6 +21,22 @@ V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, V1BillingMeterNoMeterFoundEventNotification as V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v2_commerce_product_catalog_imports_failed_event import ( + V2CommerceProductCatalogImportsFailedEvent as V2CommerceProductCatalogImportsFailedEvent, + V2CommerceProductCatalogImportsFailedEventNotification as V2CommerceProductCatalogImportsFailedEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_processing_event import ( + V2CommerceProductCatalogImportsProcessingEvent as V2CommerceProductCatalogImportsProcessingEvent, + V2CommerceProductCatalogImportsProcessingEventNotification as V2CommerceProductCatalogImportsProcessingEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_event import ( + V2CommerceProductCatalogImportsSucceededEvent as V2CommerceProductCatalogImportsSucceededEvent, + V2CommerceProductCatalogImportsSucceededEventNotification as V2CommerceProductCatalogImportsSucceededEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event import ( + V2CommerceProductCatalogImportsSucceededWithErrorsEvent as V2CommerceProductCatalogImportsSucceededWithErrorsEvent, + V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification as V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, + ) from stripe.events._v2_core_account_closed_event import ( V2CoreAccountClosedEvent as V2CoreAccountClosedEvent, V2CoreAccountClosedEventNotification as V2CoreAccountClosedEventNotification, @@ -145,6 +161,34 @@ V2CoreHealthEventGenerationFailureResolvedEvent as V2CoreHealthEventGenerationFailureResolvedEvent, V2CoreHealthEventGenerationFailureResolvedEventNotification as V2CoreHealthEventGenerationFailureResolvedEventNotification, ) + from stripe.events._v2_data_reporting_query_run_created_event import ( + V2DataReportingQueryRunCreatedEvent as V2DataReportingQueryRunCreatedEvent, + V2DataReportingQueryRunCreatedEventNotification as V2DataReportingQueryRunCreatedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_failed_event import ( + V2DataReportingQueryRunFailedEvent as V2DataReportingQueryRunFailedEvent, + V2DataReportingQueryRunFailedEventNotification as V2DataReportingQueryRunFailedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_succeeded_event import ( + V2DataReportingQueryRunSucceededEvent as V2DataReportingQueryRunSucceededEvent, + V2DataReportingQueryRunSucceededEventNotification as V2DataReportingQueryRunSucceededEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_updated_event import ( + V2DataReportingQueryRunUpdatedEvent as V2DataReportingQueryRunUpdatedEvent, + V2DataReportingQueryRunUpdatedEventNotification as V2DataReportingQueryRunUpdatedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_failed_event import ( + V2ExtendWorkflowRunFailedEvent as V2ExtendWorkflowRunFailedEvent, + V2ExtendWorkflowRunFailedEventNotification as V2ExtendWorkflowRunFailedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_started_event import ( + V2ExtendWorkflowRunStartedEvent as V2ExtendWorkflowRunStartedEvent, + V2ExtendWorkflowRunStartedEventNotification as V2ExtendWorkflowRunStartedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_succeeded_event import ( + V2ExtendWorkflowRunSucceededEvent as V2ExtendWorkflowRunSucceededEvent, + V2ExtendWorkflowRunSucceededEventNotification as V2ExtendWorkflowRunSucceededEventNotification, + ) from stripe.events._v2_money_management_adjustment_created_event import ( V2MoneyManagementAdjustmentCreatedEvent as V2MoneyManagementAdjustmentCreatedEvent, V2MoneyManagementAdjustmentCreatedEventNotification as V2MoneyManagementAdjustmentCreatedEventNotification, @@ -289,6 +333,22 @@ V2MoneyManagementTransactionUpdatedEvent as V2MoneyManagementTransactionUpdatedEvent, V2MoneyManagementTransactionUpdatedEventNotification as V2MoneyManagementTransactionUpdatedEventNotification, ) + from stripe.events._v2_orchestrated_commerce_agreement_confirmed_event import ( + V2OrchestratedCommerceAgreementConfirmedEvent as V2OrchestratedCommerceAgreementConfirmedEvent, + V2OrchestratedCommerceAgreementConfirmedEventNotification as V2OrchestratedCommerceAgreementConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_created_event import ( + V2OrchestratedCommerceAgreementCreatedEvent as V2OrchestratedCommerceAgreementCreatedEvent, + V2OrchestratedCommerceAgreementCreatedEventNotification as V2OrchestratedCommerceAgreementCreatedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event import ( + V2OrchestratedCommerceAgreementPartiallyConfirmedEvent as V2OrchestratedCommerceAgreementPartiallyConfirmedEvent, + V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification as V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_terminated_event import ( + V2OrchestratedCommerceAgreementTerminatedEvent as V2OrchestratedCommerceAgreementTerminatedEvent, + V2OrchestratedCommerceAgreementTerminatedEventNotification as V2OrchestratedCommerceAgreementTerminatedEventNotification, + ) # name -> (import_target, is_submodule) _import_map = { @@ -309,6 +369,38 @@ "stripe.events._v1_billing_meter_no_meter_found_event", False, ), + "V2CommerceProductCatalogImportsFailedEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + False, + ), + "V2CommerceProductCatalogImportsFailedEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + False, + ), + "V2CommerceProductCatalogImportsProcessingEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + False, + ), + "V2CommerceProductCatalogImportsProcessingEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + False, + ), + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + False, + ), "V2CoreAccountClosedEvent": ( "stripe.events._v2_core_account_closed_event", False, @@ -557,6 +649,62 @@ "stripe.events._v2_core_health_event_generation_failure_resolved_event", False, ), + "V2DataReportingQueryRunCreatedEvent": ( + "stripe.events._v2_data_reporting_query_run_created_event", + False, + ), + "V2DataReportingQueryRunCreatedEventNotification": ( + "stripe.events._v2_data_reporting_query_run_created_event", + False, + ), + "V2DataReportingQueryRunFailedEvent": ( + "stripe.events._v2_data_reporting_query_run_failed_event", + False, + ), + "V2DataReportingQueryRunFailedEventNotification": ( + "stripe.events._v2_data_reporting_query_run_failed_event", + False, + ), + "V2DataReportingQueryRunSucceededEvent": ( + "stripe.events._v2_data_reporting_query_run_succeeded_event", + False, + ), + "V2DataReportingQueryRunSucceededEventNotification": ( + "stripe.events._v2_data_reporting_query_run_succeeded_event", + False, + ), + "V2DataReportingQueryRunUpdatedEvent": ( + "stripe.events._v2_data_reporting_query_run_updated_event", + False, + ), + "V2DataReportingQueryRunUpdatedEventNotification": ( + "stripe.events._v2_data_reporting_query_run_updated_event", + False, + ), + "V2ExtendWorkflowRunFailedEvent": ( + "stripe.events._v2_extend_workflow_run_failed_event", + False, + ), + "V2ExtendWorkflowRunFailedEventNotification": ( + "stripe.events._v2_extend_workflow_run_failed_event", + False, + ), + "V2ExtendWorkflowRunStartedEvent": ( + "stripe.events._v2_extend_workflow_run_started_event", + False, + ), + "V2ExtendWorkflowRunStartedEventNotification": ( + "stripe.events._v2_extend_workflow_run_started_event", + False, + ), + "V2ExtendWorkflowRunSucceededEvent": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + False, + ), + "V2ExtendWorkflowRunSucceededEventNotification": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + False, + ), "V2MoneyManagementAdjustmentCreatedEvent": ( "stripe.events._v2_money_management_adjustment_created_event", False, @@ -845,6 +993,38 @@ "stripe.events._v2_money_management_transaction_updated_event", False, ), + "V2OrchestratedCommerceAgreementConfirmedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementConfirmedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementCreatedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + False, + ), + "V2OrchestratedCommerceAgreementCreatedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + False, + ), + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + False, + ), + "V2OrchestratedCommerceAgreementTerminatedEvent": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + False, + ), + "V2OrchestratedCommerceAgreementTerminatedEventNotification": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 58729a23a..f54d6ee4e 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -13,6 +13,18 @@ from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEventNotification, ) + from stripe.events._v2_commerce_product_catalog_imports_failed_event import ( + V2CommerceProductCatalogImportsFailedEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_processing_event import ( + V2CommerceProductCatalogImportsProcessingEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_event import ( + V2CommerceProductCatalogImportsSucceededEventNotification, + ) + from stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event import ( + V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification, + ) from stripe.events._v2_core_account_closed_event import ( V2CoreAccountClosedEventNotification, ) @@ -106,6 +118,27 @@ from stripe.events._v2_core_health_event_generation_failure_resolved_event import ( V2CoreHealthEventGenerationFailureResolvedEventNotification, ) + from stripe.events._v2_data_reporting_query_run_created_event import ( + V2DataReportingQueryRunCreatedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_failed_event import ( + V2DataReportingQueryRunFailedEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_succeeded_event import ( + V2DataReportingQueryRunSucceededEventNotification, + ) + from stripe.events._v2_data_reporting_query_run_updated_event import ( + V2DataReportingQueryRunUpdatedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_failed_event import ( + V2ExtendWorkflowRunFailedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_started_event import ( + V2ExtendWorkflowRunStartedEventNotification, + ) + from stripe.events._v2_extend_workflow_run_succeeded_event import ( + V2ExtendWorkflowRunSucceededEventNotification, + ) from stripe.events._v2_money_management_adjustment_created_event import ( V2MoneyManagementAdjustmentCreatedEventNotification, ) @@ -214,6 +247,18 @@ from stripe.events._v2_money_management_transaction_updated_event import ( V2MoneyManagementTransactionUpdatedEventNotification, ) + from stripe.events._v2_orchestrated_commerce_agreement_confirmed_event import ( + V2OrchestratedCommerceAgreementConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_created_event import ( + V2OrchestratedCommerceAgreementCreatedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event import ( + V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification, + ) + from stripe.events._v2_orchestrated_commerce_agreement_terminated_event import ( + V2OrchestratedCommerceAgreementTerminatedEventNotification, + ) _V2_EVENT_CLASS_LOOKUP = { @@ -225,6 +270,22 @@ "stripe.events._v1_billing_meter_no_meter_found_event", "V1BillingMeterNoMeterFoundEvent", ), + "v2.commerce.product_catalog.imports.failed": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + "V2CommerceProductCatalogImportsFailedEvent", + ), + "v2.commerce.product_catalog.imports.processing": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + "V2CommerceProductCatalogImportsProcessingEvent", + ), + "v2.commerce.product_catalog.imports.succeeded": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + "V2CommerceProductCatalogImportsSucceededEvent", + ), + "v2.commerce.product_catalog.imports.succeeded_with_errors": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + ), "v2.core.account.closed": ( "stripe.events._v2_core_account_closed_event", "V2CoreAccountClosedEvent", @@ -349,6 +410,34 @@ "stripe.events._v2_core_health_event_generation_failure_resolved_event", "V2CoreHealthEventGenerationFailureResolvedEvent", ), + "v2.data.reporting.query_run.created": ( + "stripe.events._v2_data_reporting_query_run_created_event", + "V2DataReportingQueryRunCreatedEvent", + ), + "v2.data.reporting.query_run.failed": ( + "stripe.events._v2_data_reporting_query_run_failed_event", + "V2DataReportingQueryRunFailedEvent", + ), + "v2.data.reporting.query_run.succeeded": ( + "stripe.events._v2_data_reporting_query_run_succeeded_event", + "V2DataReportingQueryRunSucceededEvent", + ), + "v2.data.reporting.query_run.updated": ( + "stripe.events._v2_data_reporting_query_run_updated_event", + "V2DataReportingQueryRunUpdatedEvent", + ), + "v2.extend.workflow_run.failed": ( + "stripe.events._v2_extend_workflow_run_failed_event", + "V2ExtendWorkflowRunFailedEvent", + ), + "v2.extend.workflow_run.started": ( + "stripe.events._v2_extend_workflow_run_started_event", + "V2ExtendWorkflowRunStartedEvent", + ), + "v2.extend.workflow_run.succeeded": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + "V2ExtendWorkflowRunSucceededEvent", + ), "v2.money_management.adjustment.created": ( "stripe.events._v2_money_management_adjustment_created_event", "V2MoneyManagementAdjustmentCreatedEvent", @@ -493,6 +582,22 @@ "stripe.events._v2_money_management_transaction_updated_event", "V2MoneyManagementTransactionUpdatedEvent", ), + "v2.orchestrated_commerce.agreement.confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + "V2OrchestratedCommerceAgreementConfirmedEvent", + ), + "v2.orchestrated_commerce.agreement.created": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + "V2OrchestratedCommerceAgreementCreatedEvent", + ), + "v2.orchestrated_commerce.agreement.partially_confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + ), + "v2.orchestrated_commerce.agreement.terminated": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + "V2OrchestratedCommerceAgreementTerminatedEvent", + ), } @@ -516,6 +621,22 @@ def get_v2_event_class(type_: str): "stripe.events._v1_billing_meter_no_meter_found_event", "V1BillingMeterNoMeterFoundEventNotification", ), + "v2.commerce.product_catalog.imports.failed": ( + "stripe.events._v2_commerce_product_catalog_imports_failed_event", + "V2CommerceProductCatalogImportsFailedEventNotification", + ), + "v2.commerce.product_catalog.imports.processing": ( + "stripe.events._v2_commerce_product_catalog_imports_processing_event", + "V2CommerceProductCatalogImportsProcessingEventNotification", + ), + "v2.commerce.product_catalog.imports.succeeded": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_event", + "V2CommerceProductCatalogImportsSucceededEventNotification", + ), + "v2.commerce.product_catalog.imports.succeeded_with_errors": ( + "stripe.events._v2_commerce_product_catalog_imports_succeeded_with_errors_event", + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification", + ), "v2.core.account.closed": ( "stripe.events._v2_core_account_closed_event", "V2CoreAccountClosedEventNotification", @@ -640,6 +761,34 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_health_event_generation_failure_resolved_event", "V2CoreHealthEventGenerationFailureResolvedEventNotification", ), + "v2.data.reporting.query_run.created": ( + "stripe.events._v2_data_reporting_query_run_created_event", + "V2DataReportingQueryRunCreatedEventNotification", + ), + "v2.data.reporting.query_run.failed": ( + "stripe.events._v2_data_reporting_query_run_failed_event", + "V2DataReportingQueryRunFailedEventNotification", + ), + "v2.data.reporting.query_run.succeeded": ( + "stripe.events._v2_data_reporting_query_run_succeeded_event", + "V2DataReportingQueryRunSucceededEventNotification", + ), + "v2.data.reporting.query_run.updated": ( + "stripe.events._v2_data_reporting_query_run_updated_event", + "V2DataReportingQueryRunUpdatedEventNotification", + ), + "v2.extend.workflow_run.failed": ( + "stripe.events._v2_extend_workflow_run_failed_event", + "V2ExtendWorkflowRunFailedEventNotification", + ), + "v2.extend.workflow_run.started": ( + "stripe.events._v2_extend_workflow_run_started_event", + "V2ExtendWorkflowRunStartedEventNotification", + ), + "v2.extend.workflow_run.succeeded": ( + "stripe.events._v2_extend_workflow_run_succeeded_event", + "V2ExtendWorkflowRunSucceededEventNotification", + ), "v2.money_management.adjustment.created": ( "stripe.events._v2_money_management_adjustment_created_event", "V2MoneyManagementAdjustmentCreatedEventNotification", @@ -784,6 +933,22 @@ def get_v2_event_class(type_: str): "stripe.events._v2_money_management_transaction_updated_event", "V2MoneyManagementTransactionUpdatedEventNotification", ), + "v2.orchestrated_commerce.agreement.confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_confirmed_event", + "V2OrchestratedCommerceAgreementConfirmedEventNotification", + ), + "v2.orchestrated_commerce.agreement.created": ( + "stripe.events._v2_orchestrated_commerce_agreement_created_event", + "V2OrchestratedCommerceAgreementCreatedEventNotification", + ), + "v2.orchestrated_commerce.agreement.partially_confirmed": ( + "stripe.events._v2_orchestrated_commerce_agreement_partially_confirmed_event", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification", + ), + "v2.orchestrated_commerce.agreement.terminated": ( + "stripe.events._v2_orchestrated_commerce_agreement_terminated_event", + "V2OrchestratedCommerceAgreementTerminatedEventNotification", + ), } @@ -801,6 +966,10 @@ def get_v2_event_notification_class(type_: str): ALL_EVENT_NOTIFICATIONS = Union[ "V1BillingMeterErrorReportTriggeredEventNotification", "V1BillingMeterNoMeterFoundEventNotification", + "V2CommerceProductCatalogImportsFailedEventNotification", + "V2CommerceProductCatalogImportsProcessingEventNotification", + "V2CommerceProductCatalogImportsSucceededEventNotification", + "V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification", "V2CoreAccountClosedEventNotification", "V2CoreAccountCreatedEventNotification", "V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification", @@ -832,6 +1001,13 @@ def get_v2_event_notification_class(type_: str): "V2CoreBatchJobValidationFailedEventNotification", "V2CoreEventDestinationPingEventNotification", "V2CoreHealthEventGenerationFailureResolvedEventNotification", + "V2DataReportingQueryRunCreatedEventNotification", + "V2DataReportingQueryRunFailedEventNotification", + "V2DataReportingQueryRunSucceededEventNotification", + "V2DataReportingQueryRunUpdatedEventNotification", + "V2ExtendWorkflowRunFailedEventNotification", + "V2ExtendWorkflowRunStartedEventNotification", + "V2ExtendWorkflowRunSucceededEventNotification", "V2MoneyManagementAdjustmentCreatedEventNotification", "V2MoneyManagementFinancialAccountCreatedEventNotification", "V2MoneyManagementFinancialAccountUpdatedEventNotification", @@ -868,4 +1044,8 @@ def get_v2_event_notification_class(type_: str): "V2MoneyManagementReceivedDebitUpdatedEventNotification", "V2MoneyManagementTransactionCreatedEventNotification", "V2MoneyManagementTransactionUpdatedEventNotification", + "V2OrchestratedCommerceAgreementConfirmedEventNotification", + "V2OrchestratedCommerceAgreementCreatedEventNotification", + "V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification", + "V2OrchestratedCommerceAgreementTerminatedEventNotification", ] diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index 4162d1af4..1005073d5 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -107,6 +107,7 @@ class Request(StripeObject): "meter_event_dimension_count_too_high", "meter_event_invalid_value", "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", "missing_dimension_payload_keys", "no_meter", "timestamp_in_future", diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index 32b79f0e6..9e4363394 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -60,6 +60,7 @@ class Request(StripeObject): "meter_event_dimension_count_too_high", "meter_event_invalid_value", "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", "missing_dimension_payload_keys", "no_meter", "timestamp_in_future", diff --git a/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py b/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py new file mode 100644 index 000000000..94c429c27 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_failed_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsFailedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.failed" + type: Literal["v2.commerce.product_catalog.imports.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsFailedEvent": + return cast( + "V2CommerceProductCatalogImportsFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsFailedEvent": + return cast( + "V2CommerceProductCatalogImportsFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsFailedEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.failed" + type: Literal["v2.commerce.product_catalog.imports.failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py b/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py new file mode 100644 index 000000000..195c2bad5 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_processing_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsProcessingEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.processing" + type: Literal["v2.commerce.product_catalog.imports.processing"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsProcessingEvent": + return cast( + "V2CommerceProductCatalogImportsProcessingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsProcessingEvent": + return cast( + "V2CommerceProductCatalogImportsProcessingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsProcessingEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.processing" + type: Literal["v2.commerce.product_catalog.imports.processing"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py new file mode 100644 index 000000000..ddafcdcdd --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsSucceededEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded" + type: Literal["v2.commerce.product_catalog.imports.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CommerceProductCatalogImportsSucceededEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsSucceededEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsSucceededEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded" + type: Literal["v2.commerce.product_catalog.imports.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py new file mode 100644 index 000000000..fb53a3833 --- /dev/null +++ b/stripe/events/_v2_commerce_product_catalog_imports_succeeded_with_errors_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class V2CommerceProductCatalogImportsSucceededWithErrorsEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded_with_errors" + type: Literal["v2.commerce.product_catalog.imports.succeeded_with_errors"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "ProductCatalogImport": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CommerceProductCatalogImportsSucceededWithErrorsEvent": + return cast( + "V2CommerceProductCatalogImportsSucceededWithErrorsEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "ProductCatalogImport": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "ProductCatalogImport", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CommerceProductCatalogImportsSucceededWithErrorsEvent(Event): + LOOKUP_TYPE = "v2.commerce.product_catalog.imports.succeeded_with_errors" + type: Literal["v2.commerce.product_catalog.imports.succeeded_with_errors"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "ProductCatalogImport": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "ProductCatalogImport", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_data_reporting_query_run_created_event.py b/stripe/events/_v2_data_reporting_query_run_created_event.py new file mode 100644 index 000000000..392e47573 --- /dev/null +++ b/stripe/events/_v2_data_reporting_query_run_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.v2.data.reporting._query_run import QueryRun + + +class V2DataReportingQueryRunCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.data.reporting.query_run.created" + type: Literal["v2.data.reporting.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) -> "V2DataReportingQueryRunCreatedEvent": + return cast( + "V2DataReportingQueryRunCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "QueryRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2DataReportingQueryRunCreatedEvent": + return cast( + "V2DataReportingQueryRunCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "QueryRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2DataReportingQueryRunCreatedEvent(Event): + LOOKUP_TYPE = "v2.data.reporting.query_run.created" + type: Literal["v2.data.reporting.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) -> "QueryRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "QueryRun", + self._requestor.request( + "get", + self.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_data_reporting_query_run_failed_event.py b/stripe/events/_v2_data_reporting_query_run_failed_event.py new file mode 100644 index 000000000..7b974d96f --- /dev/null +++ b/stripe/events/_v2_data_reporting_query_run_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.data.reporting._query_run import QueryRun + + +class V2DataReportingQueryRunFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.data.reporting.query_run.failed" + type: Literal["v2.data.reporting.query_run.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2DataReportingQueryRunFailedEvent": + return cast( + "V2DataReportingQueryRunFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "QueryRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2DataReportingQueryRunFailedEvent": + return cast( + "V2DataReportingQueryRunFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "QueryRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2DataReportingQueryRunFailedEvent(Event): + LOOKUP_TYPE = "v2.data.reporting.query_run.failed" + type: Literal["v2.data.reporting.query_run.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) -> "QueryRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "QueryRun", + self._requestor.request( + "get", + self.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_data_reporting_query_run_succeeded_event.py b/stripe/events/_v2_data_reporting_query_run_succeeded_event.py new file mode 100644 index 000000000..6416e8424 --- /dev/null +++ b/stripe/events/_v2_data_reporting_query_run_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.v2.data.reporting._query_run import QueryRun + + +class V2DataReportingQueryRunSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v2.data.reporting.query_run.succeeded" + type: Literal["v2.data.reporting.query_run.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2DataReportingQueryRunSucceededEvent": + return cast( + "V2DataReportingQueryRunSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "QueryRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2DataReportingQueryRunSucceededEvent": + return cast( + "V2DataReportingQueryRunSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "QueryRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2DataReportingQueryRunSucceededEvent(Event): + LOOKUP_TYPE = "v2.data.reporting.query_run.succeeded" + type: Literal["v2.data.reporting.query_run.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "QueryRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "QueryRun", + self._requestor.request( + "get", + self.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_data_reporting_query_run_updated_event.py b/stripe/events/_v2_data_reporting_query_run_updated_event.py new file mode 100644 index 000000000..a8b08a38c --- /dev/null +++ b/stripe/events/_v2_data_reporting_query_run_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.v2.data.reporting._query_run import QueryRun + + +class V2DataReportingQueryRunUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.data.reporting.query_run.updated" + type: Literal["v2.data.reporting.query_run.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) -> "V2DataReportingQueryRunUpdatedEvent": + return cast( + "V2DataReportingQueryRunUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "QueryRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2DataReportingQueryRunUpdatedEvent": + return cast( + "V2DataReportingQueryRunUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "QueryRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "QueryRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2DataReportingQueryRunUpdatedEvent(Event): + LOOKUP_TYPE = "v2.data.reporting.query_run.updated" + type: Literal["v2.data.reporting.query_run.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) -> "QueryRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "QueryRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_extend_workflow_run_failed_event.py b/stripe/events/_v2_extend_workflow_run_failed_event.py new file mode 100644 index 000000000..f3da7af8f --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_failed_event.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.failed" + type: Literal["v2.extend.workflow_run.failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunFailedEvent": + return cast( + "V2ExtendWorkflowRunFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunFailedEvent": + return cast( + "V2ExtendWorkflowRunFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunFailedEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.failed" + type: Literal["v2.extend.workflow_run.failed"] + + class V2ExtendWorkflowRunFailedEventData(StripeObject): + class FailureDetails(StripeObject): + error_message: Optional[str] + """ + Optional details about the failure result. + """ + + dashboard_url: str + """ + A Stripe dashboard URL with more information about the Workflow Run failure. + """ + failure_details: FailureDetails + """ + Details about the Workflow Run's transition into the FAILED state. + """ + _inner_class_types = {"failure_details": FailureDetails} + + data: V2ExtendWorkflowRunFailedEventData + """ + Data for the v2.extend.workflow_run.failed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2ExtendWorkflowRunFailedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2ExtendWorkflowRunFailedEvent.V2ExtendWorkflowRunFailedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_extend_workflow_run_started_event.py b/stripe/events/_v2_extend_workflow_run_started_event.py new file mode 100644 index 000000000..7bd0ea3f7 --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_started_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunStartedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.started" + type: Literal["v2.extend.workflow_run.started"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunStartedEvent": + return cast( + "V2ExtendWorkflowRunStartedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunStartedEvent": + return cast( + "V2ExtendWorkflowRunStartedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunStartedEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.started" + type: Literal["v2.extend.workflow_run.started"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_extend_workflow_run_succeeded_event.py b/stripe/events/_v2_extend_workflow_run_succeeded_event.py new file mode 100644 index 000000000..27be0e345 --- /dev/null +++ b/stripe/events/_v2_extend_workflow_run_succeeded_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.extend._workflow_run import WorkflowRun + + +class V2ExtendWorkflowRunSucceededEventNotification(EventNotification): + LOOKUP_TYPE = "v2.extend.workflow_run.succeeded" + type: Literal["v2.extend.workflow_run.succeeded"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2ExtendWorkflowRunSucceededEvent": + return cast( + "V2ExtendWorkflowRunSucceededEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "WorkflowRun": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2ExtendWorkflowRunSucceededEvent": + return cast( + "V2ExtendWorkflowRunSucceededEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "WorkflowRun": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "WorkflowRun", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2ExtendWorkflowRunSucceededEvent(Event): + LOOKUP_TYPE = "v2.extend.workflow_run.succeeded" + type: Literal["v2.extend.workflow_run.succeeded"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "WorkflowRun": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "WorkflowRun", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_transaction_created_event.py b/stripe/events/_v2_money_management_transaction_created_event.py index 45ff9b3c1..dac212315 100644 --- a/stripe/events/_v2_money_management_transaction_created_event.py +++ b/stripe/events/_v2_money_management_transaction_created_event.py @@ -82,6 +82,10 @@ class V2MoneyManagementTransactionCreatedEvent(Event): type: Literal["v2.money_management.transaction.created"] class V2MoneyManagementTransactionCreatedEventData(StripeObject): + treasury_transaction: Optional[str] + """ + Id of the v1 Treasury Transaction corresponding to this Transaction. + """ v1_id: Optional[str] """ Id of the v1 Transaction corresponding to this Transaction. diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py new file mode 100644 index 000000000..22baf95bf --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_confirmed_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementConfirmedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.confirmed" + type: Literal["v2.orchestrated_commerce.agreement.confirmed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementConfirmedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementConfirmedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementConfirmedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.confirmed" + type: Literal["v2.orchestrated_commerce.agreement.confirmed"] + + class V2OrchestratedCommerceAgreementConfirmedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_confirmed_at: str + """ + The time at which the orchestrator confirmed the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_confirmed_at: str + """ + The time at which the seller confirmed the agreement. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementConfirmedEventData + """ + Data for the v2.orchestrated_commerce.agreement.confirmed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementConfirmedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementConfirmedEvent.V2OrchestratedCommerceAgreementConfirmedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py new file mode 100644 index 000000000..754e220ea --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_created_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementCreatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.created" + type: Literal["v2.orchestrated_commerce.agreement.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementCreatedEvent": + return cast( + "V2OrchestratedCommerceAgreementCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementCreatedEvent": + return cast( + "V2OrchestratedCommerceAgreementCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementCreatedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.created" + type: Literal["v2.orchestrated_commerce.agreement.created"] + + class V2OrchestratedCommerceAgreementCreatedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + created: str + """ + The time at which the agreement was created. + """ + initiated_by: Literal["orchestrator", "seller"] + """ + The party that initiated the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementCreatedEventData + """ + Data for the v2.orchestrated_commerce.agreement.created event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementCreatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementCreatedEvent.V2OrchestratedCommerceAgreementCreatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py new file mode 100644 index 000000000..01664bd41 --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_partially_confirmed_event.py @@ -0,0 +1,191 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementPartiallyConfirmedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.partially_confirmed" + type: Literal["v2.orchestrated_commerce.agreement.partially_confirmed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + return cast( + "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementPartiallyConfirmedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.partially_confirmed" + type: Literal["v2.orchestrated_commerce.agreement.partially_confirmed"] + + class V2OrchestratedCommerceAgreementPartiallyConfirmedEventData( + StripeObject, + ): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_confirmed_at: str + """ + The time at which the orchestrator confirmed the agreement. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_confirmed_at: str + """ + The time at which the seller confirmed the agreement. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementPartiallyConfirmedEventData + """ + Data for the v2.orchestrated_commerce.agreement.partially_confirmed event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementPartiallyConfirmedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementPartiallyConfirmedEvent.V2OrchestratedCommerceAgreementPartiallyConfirmedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py b/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py new file mode 100644 index 000000000..ac0382dce --- /dev/null +++ b/stripe/events/_v2_orchestrated_commerce_agreement_terminated_event.py @@ -0,0 +1,187 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + from stripe._stripe_client import StripeClient + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class V2OrchestratedCommerceAgreementTerminatedEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.terminated" + type: Literal["v2.orchestrated_commerce.agreement.terminated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + return cast( + "V2OrchestratedCommerceAgreementTerminatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Agreement": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + return cast( + "V2OrchestratedCommerceAgreementTerminatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Agreement": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Agreement", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2OrchestratedCommerceAgreementTerminatedEvent(Event): + LOOKUP_TYPE = "v2.orchestrated_commerce.agreement.terminated" + type: Literal["v2.orchestrated_commerce.agreement.terminated"] + + class V2OrchestratedCommerceAgreementTerminatedEventData(StripeObject): + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + terminated_at: str + """ + The time at which the agreement was terminated. + """ + terminated_by: Literal["orchestrator", "seller"] + """ + The party that terminated the agreement. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + } + + data: V2OrchestratedCommerceAgreementTerminatedEventData + """ + Data for the v2.orchestrated_commerce.agreement.terminated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2OrchestratedCommerceAgreementTerminatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2OrchestratedCommerceAgreementTerminatedEvent.V2OrchestratedCommerceAgreementTerminatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Agreement": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Agreement", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/params/v2/__init__.py b/stripe/params/v2/__init__.py index e7d4a7938..4043decab 100644 --- a/stripe/params/v2/__init__.py +++ b/stripe/params/v2/__init__.py @@ -7,7 +7,11 @@ from stripe.params.v2 import ( billing as billing, core as core, + extend as extend, + iam as iam, money_management as money_management, + network as network, + orchestrated_commerce as orchestrated_commerce, test_helpers as test_helpers, ) @@ -15,7 +19,11 @@ _import_map = { "billing": ("stripe.params.v2.billing", True), "core": ("stripe.params.v2.core", True), + "extend": ("stripe.params.v2.extend", True), + "iam": ("stripe.params.v2.iam", True), "money_management": ("stripe.params.v2.money_management", True), + "network": ("stripe.params.v2.network", True), + "orchestrated_commerce": ("stripe.params.v2.orchestrated_commerce", True), "test_helpers": ("stripe.params.v2.test_helpers", True), } if not TYPE_CHECKING: diff --git a/stripe/params/v2/billing/__init__.py b/stripe/params/v2/billing/__init__.py index 548db152e..e62691214 100644 --- a/stripe/params/v2/billing/__init__.py +++ b/stripe/params/v2/billing/__init__.py @@ -74,6 +74,8 @@ CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalance as CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalance, CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer as CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer, CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer as CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer, + CollectionSettingCreateParamsPaymentMethodOptionsKonbini as CollectionSettingCreateParamsPaymentMethodOptionsKonbini, + CollectionSettingCreateParamsPaymentMethodOptionsSepaDebit as CollectionSettingCreateParamsPaymentMethodOptionsSepaDebit, CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccount as CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccount, CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -97,6 +99,8 @@ CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalance as CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalance, CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer as CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer, CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer as CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer, + CollectionSettingUpdateParamsPaymentMethodOptionsKonbini as CollectionSettingUpdateParamsPaymentMethodOptionsKonbini, + CollectionSettingUpdateParamsPaymentMethodOptionsSepaDebit as CollectionSettingUpdateParamsPaymentMethodOptionsSepaDebit, CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccount as CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccount, CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -323,6 +327,14 @@ "stripe.params.v2.billing._collection_setting_create_params", False, ), + "CollectionSettingCreateParamsPaymentMethodOptionsKonbini": ( + "stripe.params.v2.billing._collection_setting_create_params", + False, + ), + "CollectionSettingCreateParamsPaymentMethodOptionsSepaDebit": ( + "stripe.params.v2.billing._collection_setting_create_params", + False, + ), "CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params.v2.billing._collection_setting_create_params", False, @@ -391,6 +403,14 @@ "stripe.params.v2.billing._collection_setting_update_params", False, ), + "CollectionSettingUpdateParamsPaymentMethodOptionsKonbini": ( + "stripe.params.v2.billing._collection_setting_update_params", + False, + ), + "CollectionSettingUpdateParamsPaymentMethodOptionsSepaDebit": ( + "stripe.params.v2.billing._collection_setting_update_params", + False, + ), "CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params.v2.billing._collection_setting_update_params", False, diff --git a/stripe/params/v2/billing/_bill_setting_create_params.py b/stripe/params/v2/billing/_bill_setting_create_params.py index 809fee5b1..b6f1a4c7d 100644 --- a/stripe/params/v2/billing/_bill_setting_create_params.py +++ b/stripe/params/v2/billing/_bill_setting_create_params.py @@ -38,14 +38,14 @@ class BillSettingCreateParamsCalculation(TypedDict): class BillSettingCreateParamsCalculationTax(TypedDict): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ class BillSettingCreateParamsInvoice(TypedDict): time_until_due: NotRequired["BillSettingCreateParamsInvoiceTimeUntilDue"] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ @@ -57,5 +57,5 @@ class BillSettingCreateParamsInvoiceTimeUntilDue(TypedDict): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ diff --git a/stripe/params/v2/billing/_bill_setting_update_params.py b/stripe/params/v2/billing/_bill_setting_update_params.py index 60a6cd9aa..ac65afc99 100644 --- a/stripe/params/v2/billing/_bill_setting_update_params.py +++ b/stripe/params/v2/billing/_bill_setting_update_params.py @@ -24,7 +24,7 @@ class BillSettingUpdateParams(TypedDict): """ live_version: NotRequired[str] """ - Optionally change the live version of the BillSetting. Providing `live_version = "latest"` will set the + Optionally change the live version of the BillSetting. Providing `live_version = "latest"` sets the BillSetting' `live_version` to its latest version. """ lookup_key: NotRequired[str] @@ -44,14 +44,14 @@ class BillSettingUpdateParamsCalculation(TypedDict): class BillSettingUpdateParamsCalculationTax(TypedDict): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ class BillSettingUpdateParamsInvoice(TypedDict): time_until_due: NotRequired["BillSettingUpdateParamsInvoiceTimeUntilDue"] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ @@ -63,5 +63,5 @@ class BillSettingUpdateParamsInvoiceTimeUntilDue(TypedDict): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ diff --git a/stripe/params/v2/billing/_cadence_create_params.py b/stripe/params/v2/billing/_cadence_create_params.py index 8a0038501..da28dd617 100644 --- a/stripe/params/v2/billing/_cadence_create_params.py +++ b/stripe/params/v2/billing/_cadence_create_params.py @@ -37,7 +37,7 @@ class CadenceCreateParamsBillingCycle(TypedDict): """ The number of intervals (specified in the interval attribute) between cadence billings. For example, type=month and interval_count=3 bills every - 3 months. If this is not provided, it will default to 1. + 3 months. If not provided, this defaults to 1. """ month: NotRequired["CadenceCreateParamsBillingCycleMonth"] """ @@ -61,7 +61,7 @@ class CadenceCreateParamsBillingCycleDay(TypedDict): time: NotRequired["CadenceCreateParamsBillingCycleDayTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -90,20 +90,20 @@ class CadenceCreateParamsBillingCycleMonth(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ The month to anchor the billing on for a type="month" billing cycle from - 1-12. If not provided, this will default to the month the cadence was created. + 1-12. If not provided, this defaults to the month the cadence was created. This setting can only be used for monthly billing cycles with `interval_count` of 2, 3, 4 or 6. - All occurrences will be calculated from month provided. + All occurrences are calculated from the month provided. """ time: NotRequired["CadenceCreateParamsBillingCycleMonthTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -132,13 +132,13 @@ class CadenceCreateParamsBillingCycleWeek(TypedDict): """ The day of the week to bill the type=week billing cycle on. Numbered from 1-7 for Monday to Sunday respectively, based on the ISO-8601 - week day numbering. If not provided, this will default to the day the + week day numbering. If not provided, this defaults to the day the cadence was created. """ time: NotRequired["CadenceCreateParamsBillingCycleWeekTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -167,18 +167,18 @@ class CadenceCreateParamsBillingCycleYear(TypedDict): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being - billed, this will anchor to the last day of the month. If not provided, - this will default to the day the cadence was created. + billed, this anchors to the last day of the month. If not provided, + this defaults to the day the cadence was created. """ month_of_year: NotRequired[int] """ - The month to bill on from 1-12. If not provided, this will default to the + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: NotRequired["CadenceCreateParamsBillingCycleYearTime"] """ The time at which the billing cycle ends. - This field is optional, and if not provided, it will default to + This field is optional, and if not provided, it defaults to the time at which the cadence was created in UTC timezone. """ @@ -205,7 +205,7 @@ class CadenceCreateParamsBillingCycleYearTime(TypedDict): class CadenceCreateParamsPayer(TypedDict): billing_profile: str """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ @@ -232,7 +232,7 @@ class CadenceCreateParamsSettingsBill(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ @@ -244,5 +244,5 @@ class CadenceCreateParamsSettingsCollection(TypedDict): version: NotRequired[str] """ An optional field to specify the version of the Settings to use. - If not provided, this will always default to the live version any time the settings are used. + If not provided, this defaults to the live version any time the settings are used. """ diff --git a/stripe/params/v2/billing/_cadence_update_params.py b/stripe/params/v2/billing/_cadence_update_params.py index 291c36542..e4c91722f 100644 --- a/stripe/params/v2/billing/_cadence_update_params.py +++ b/stripe/params/v2/billing/_cadence_update_params.py @@ -29,7 +29,7 @@ class CadenceUpdateParams(TypedDict): class CadenceUpdateParamsPayer(TypedDict): billing_profile: NotRequired[str] """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ @@ -52,8 +52,8 @@ class CadenceUpdateParamsSettingsBill(TypedDict): version: NotRequired[str] """ An optional field to specify the version of Settings to use. - If not provided, this will always default to the `live_version` specified on the setting, any time the settings are used. - Using a specific version here will prevent the settings from updating, and is discouraged for cadences. + If not provided, this defaults to the `live_version` specified on the setting, any time the settings are used. + Using a specific version here prevents the settings from updating, and is discouraged for cadences. To clear a pinned version, set the version to null. """ @@ -66,7 +66,7 @@ class CadenceUpdateParamsSettingsCollection(TypedDict): version: NotRequired[str] """ An optional field to specify the version of Settings to use. - If not provided, this will always default to the `live_version` specified on the setting, any time the settings are used. - Using a specific version here will prevent the settings from updating, and is discouraged for cadences. + If not provided, this defaults to the `live_version` specified on the setting, any time the settings are used. + Using a specific version here prevents the settings from updating, and is discouraged for cadences. To clear a pinned version, set the version to null. """ diff --git a/stripe/params/v2/billing/_collection_setting_create_params.py b/stripe/params/v2/billing/_collection_setting_create_params.py index acb05913c..9ce026b00 100644 --- a/stripe/params/v2/billing/_collection_setting_create_params.py +++ b/stripe/params/v2/billing/_collection_setting_create_params.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._stripe_object import UntypedStripeObject -from typing import Any, Dict, List +from typing import List from typing_extensions import Literal, NotRequired, TypedDict class CollectionSettingCreateParams(TypedDict): collection_method: NotRequired[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ display_name: NotRequired[str] @@ -82,11 +81,15 @@ class CollectionSettingCreateParamsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options. """ - konbini: NotRequired["Dict[str, Any]|UntypedStripeObject[Any]"] + konbini: NotRequired[ + "CollectionSettingCreateParamsPaymentMethodOptionsKonbini" + ] """ This sub-hash contains details about the Konbini payment method options. """ - sepa_debit: NotRequired["Dict[str, Any]|UntypedStripeObject[Any]"] + sepa_debit: NotRequired[ + "CollectionSettingCreateParamsPaymentMethodOptionsSepaDebit" + ] """ This sub-hash contains details about the SEPA Direct Debit payment method options. """ @@ -215,6 +218,14 @@ class CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalanceBankTransf """ +class CollectionSettingCreateParamsPaymentMethodOptionsKonbini(TypedDict): + pass + + +class CollectionSettingCreateParamsPaymentMethodOptionsSepaDebit(TypedDict): + pass + + class CollectionSettingCreateParamsPaymentMethodOptionsUsBankAccount( TypedDict ): diff --git a/stripe/params/v2/billing/_collection_setting_update_params.py b/stripe/params/v2/billing/_collection_setting_update_params.py index 2486c3e6a..cce3b132a 100644 --- a/stripe/params/v2/billing/_collection_setting_update_params.py +++ b/stripe/params/v2/billing/_collection_setting_update_params.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._stripe_object import UntypedStripeObject -from typing import Any, Dict, List +from typing import List from typing_extensions import Literal, NotRequired, TypedDict class CollectionSettingUpdateParams(TypedDict): collection_method: NotRequired[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. """ display_name: NotRequired[str] """ @@ -25,7 +24,7 @@ class CollectionSettingUpdateParams(TypedDict): live_version: NotRequired[str] """ Optionally change the live version of the CollectionSetting. Billing Cadences and other objects that refer to this - CollectionSetting will use this version when no overrides are set. Providing `live_version = "latest"` will set the + CollectionSetting uses this version when no overrides are set. Providing `live_version = "latest"` sets the CollectionSetting's `live_version` to its latest version. """ lookup_key: NotRequired[str] @@ -88,11 +87,15 @@ class CollectionSettingUpdateParamsPaymentMethodOptions(TypedDict): """ This sub-hash contains details about the Bank transfer payment method options. """ - konbini: NotRequired["Dict[str, Any]|UntypedStripeObject[Any]"] + konbini: NotRequired[ + "CollectionSettingUpdateParamsPaymentMethodOptionsKonbini" + ] """ This sub-hash contains details about the Konbini payment method options. """ - sepa_debit: NotRequired["Dict[str, Any]|UntypedStripeObject[Any]"] + sepa_debit: NotRequired[ + "CollectionSettingUpdateParamsPaymentMethodOptionsSepaDebit" + ] """ This sub-hash contains details about the SEPA Direct Debit payment method options. """ @@ -221,6 +224,14 @@ class CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransf """ +class CollectionSettingUpdateParamsPaymentMethodOptionsKonbini(TypedDict): + pass + + +class CollectionSettingUpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): + pass + + class CollectionSettingUpdateParamsPaymentMethodOptionsUsBankAccount( TypedDict ): diff --git a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py index ee1dd55e6..b39cc81f2 100644 --- a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py +++ b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py @@ -14,12 +14,12 @@ class MeterEventAdjustmentCreateParams(TypedDict): """ type: Literal["cancel"] """ - Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + Specifies the type of cancellation. Currently supports canceling a single event. """ class MeterEventAdjustmentCreateParamsCancel(TypedDict): identifier: str """ - Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them. """ diff --git a/stripe/params/v2/billing/_profile_list_params.py b/stripe/params/v2/billing/_profile_list_params.py index 56d9c6222..3c69dad24 100644 --- a/stripe/params/v2/billing/_profile_list_params.py +++ b/stripe/params/v2/billing/_profile_list_params.py @@ -28,5 +28,5 @@ class ProfileListParams(TypedDict): status: NotRequired[Literal["active", "inactive"]] """ Filter billing profiles by status. Can be combined - with all other filters. If not provided, all billing profiles will be returned. + with all other filters. If not provided, all billing profiles are returned. """ diff --git a/stripe/params/v2/commerce/__init__.py b/stripe/params/v2/commerce/__init__.py new file mode 100644 index 000000000..69b7a23f3 --- /dev/null +++ b/stripe/params/v2/commerce/__init__.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.commerce import product_catalog as product_catalog + +# name -> (import_target, is_submodule) +_import_map = { + "product_catalog": ("stripe.params.v2.commerce.product_catalog", True), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/commerce/product_catalog/__init__.py b/stripe/params/v2/commerce/product_catalog/__init__.py new file mode 100644 index 000000000..6f1e2545d --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/__init__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.commerce.product_catalog._import_create_params import ( + ImportCreateParams as ImportCreateParams, + ) + from stripe.params.v2.commerce.product_catalog._import_list_params import ( + ImportListParams as ImportListParams, + ) + from stripe.params.v2.commerce.product_catalog._import_retrieve_params import ( + ImportRetrieveParams as ImportRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ImportCreateParams": ( + "stripe.params.v2.commerce.product_catalog._import_create_params", + False, + ), + "ImportListParams": ( + "stripe.params.v2.commerce.product_catalog._import_list_params", + False, + ), + "ImportRetrieveParams": ( + "stripe.params.v2.commerce.product_catalog._import_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/commerce/product_catalog/_import_create_params.py b/stripe/params/v2/commerce/product_catalog/_import_create_params.py new file mode 100644 index 000000000..8549de060 --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_create_params.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Dict +from typing_extensions import Literal, TypedDict + + +class ImportCreateParams(TypedDict): + feed_type: Literal["inventory", "pricing", "product"] + """ + The type of catalog data to import. + """ + metadata: "Dict[str, str]|UntypedStripeObject[str]" + """ + Additional information about the import in a structured format. + """ + mode: Literal["replace", "upsert"] + """ + The strategy for handling existing catalog data during import. + """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_list_params.py b/stripe/params/v2/commerce/product_catalog/_import_list_params.py new file mode 100644 index 000000000..fecbc23da --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_list_params.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ImportListParams(TypedDict): + created: NotRequired[str] + """ + Filter for objects created at the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gt: NotRequired[str] + """ + Filter for objects created after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_gte: NotRequired[str] + """ + Filter for objects created on or after the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lt: NotRequired[str] + """ + Filter for objects created before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + created_lte: NotRequired[str] + """ + Filter for objects created on or before the specified timestamp. + Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. + """ + feed_type: NotRequired[Literal["inventory", "pricing", "product"]] + """ + Filter by the type of feed data being imported. + """ + limit: NotRequired[int] + """ + The maximum number of results per page. + """ + status: NotRequired[ + Literal[ + "awaiting_upload", + "failed", + "processing", + "succeeded", + "succeeded_with_errors", + ] + ] + """ + Filter by import status. + """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py b/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py new file mode 100644 index 000000000..d49d1d1f8 --- /dev/null +++ b/stripe/params/v2/commerce/product_catalog/_import_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ImportRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_batch_job_create_params.py b/stripe/params/v2/core/_batch_job_create_params.py index 0afc053d7..6b642227a 100644 --- a/stripe/params/v2/core/_batch_job_create_params.py +++ b/stripe/params/v2/core/_batch_job_create_params.py @@ -17,7 +17,7 @@ class BatchJobCreateParams(TypedDict): """ metadata: "Dict[str, str]|UntypedStripeObject[str]" """ - The metadata of the `BatchJob` object. + The metadata of the `batch_job`. """ notification_suppression: NotRequired[ "BatchJobCreateParamsNotificationSuppression" @@ -32,7 +32,7 @@ class BatchJobCreateParams(TypedDict): class BatchJobCreateParamsEndpoint(TypedDict): - http_method: Literal["post"] + http_method: Literal["delete", "post"] """ The HTTP method to use when calling the endpoint. """ diff --git a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py index da013f908..943faf0a9 100644 --- a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py +++ b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py @@ -8,7 +8,9 @@ class GbBankAccountCreateParams(TypedDict): """ The Account Number of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/params/v2/data/__init__.py b/stripe/params/v2/data/__init__.py new file mode 100644 index 000000000..622c49d3c --- /dev/null +++ b/stripe/params/v2/data/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.data import reporting as reporting + +# name -> (import_target, is_submodule) +_import_map = {"reporting": ("stripe.params.v2.data.reporting", True)} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/data/reporting/__init__.py b/stripe/params/v2/data/reporting/__init__.py new file mode 100644 index 000000000..bdbed9507 --- /dev/null +++ b/stripe/params/v2/data/reporting/__init__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.data.reporting._query_run_create_params import ( + QueryRunCreateParams as QueryRunCreateParams, + QueryRunCreateParamsResultOptions as QueryRunCreateParamsResultOptions, + ) + from stripe.params.v2.data.reporting._query_run_retrieve_params import ( + QueryRunRetrieveParams as QueryRunRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "QueryRunCreateParams": ( + "stripe.params.v2.data.reporting._query_run_create_params", + False, + ), + "QueryRunCreateParamsResultOptions": ( + "stripe.params.v2.data.reporting._query_run_create_params", + False, + ), + "QueryRunRetrieveParams": ( + "stripe.params.v2.data.reporting._query_run_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/data/reporting/_query_run_create_params.py b/stripe/params/v2/data/reporting/_query_run_create_params.py new file mode 100644 index 000000000..75d2319f8 --- /dev/null +++ b/stripe/params/v2/data/reporting/_query_run_create_params.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class QueryRunCreateParams(TypedDict): + result_options: NotRequired["QueryRunCreateParamsResultOptions"] + """ + Optional settings to customize the results of the `QueryRun`. + """ + sql: str + """ + The SQL to execute. + """ + + +class QueryRunCreateParamsResultOptions(TypedDict): + compress_file: NotRequired[bool] + """ + If set, the generated results file will be compressed into a ZIP folder. + This is useful for reducing file size and download time for large results. + """ diff --git a/stripe/params/v2/data/reporting/_query_run_retrieve_params.py b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py new file mode 100644 index 000000000..663751e2b --- /dev/null +++ b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class QueryRunRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/extend/__init__.py b/stripe/params/v2/extend/__init__.py new file mode 100644 index 000000000..767d9f05e --- /dev/null +++ b/stripe/params/v2/extend/__init__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.extend._workflow_invoke_params import ( + WorkflowInvokeParams as WorkflowInvokeParams, + ) + from stripe.params.v2.extend._workflow_list_params import ( + WorkflowListParams as WorkflowListParams, + ) + from stripe.params.v2.extend._workflow_retrieve_params import ( + WorkflowRetrieveParams as WorkflowRetrieveParams, + ) + from stripe.params.v2.extend._workflow_run_list_params import ( + WorkflowRunListParams as WorkflowRunListParams, + ) + from stripe.params.v2.extend._workflow_run_retrieve_params import ( + WorkflowRunRetrieveParams as WorkflowRunRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "WorkflowInvokeParams": ( + "stripe.params.v2.extend._workflow_invoke_params", + False, + ), + "WorkflowListParams": ( + "stripe.params.v2.extend._workflow_list_params", + False, + ), + "WorkflowRetrieveParams": ( + "stripe.params.v2.extend._workflow_retrieve_params", + False, + ), + "WorkflowRunListParams": ( + "stripe.params.v2.extend._workflow_run_list_params", + False, + ), + "WorkflowRunRetrieveParams": ( + "stripe.params.v2.extend._workflow_run_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/extend/_workflow_invoke_params.py b/stripe/params/v2/extend/_workflow_invoke_params.py new file mode 100644 index 000000000..678dac4c1 --- /dev/null +++ b/stripe/params/v2/extend/_workflow_invoke_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import TypedDict + + +class WorkflowInvokeParams(TypedDict): + input_parameters: "Dict[str, Any]|UntypedStripeObject[Any]" + """ + Parameters used to invoke the Workflow Run. + """ diff --git a/stripe/params/v2/extend/_workflow_list_params.py b/stripe/params/v2/extend/_workflow_list_params.py new file mode 100644 index 000000000..2bfaad998 --- /dev/null +++ b/stripe/params/v2/extend/_workflow_list_params.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class WorkflowListParams(TypedDict): + limit: NotRequired[int] + """ + Restrict page size to no more than this number. + """ + status: NotRequired[ + List[Literal["active", "archived", "draft", "inactive"]] + ] + """ + When retrieving Workflows, include only those with the specified status values. + If not specified, all Workflows in active and inactive status are returned. + """ diff --git a/stripe/params/v2/extend/_workflow_retrieve_params.py b/stripe/params/v2/extend/_workflow_retrieve_params.py new file mode 100644 index 000000000..0d4b7887a --- /dev/null +++ b/stripe/params/v2/extend/_workflow_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class WorkflowRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/extend/_workflow_run_list_params.py b/stripe/params/v2/extend/_workflow_run_list_params.py new file mode 100644 index 000000000..61a6afd17 --- /dev/null +++ b/stripe/params/v2/extend/_workflow_run_list_params.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class WorkflowRunListParams(TypedDict): + limit: NotRequired[int] + """ + Restrict page size to no more than this number. + """ + status: NotRequired[List[Literal["failed", "started", "succeeded"]]] + """ + When retrieving Workflow Runs, include only those with the specified status values. If not specified, all Runs are returned. + """ + workflow: NotRequired[List[str]] + """ + When retrieving Workflow Runs, include only those associated with the Workflows specified. If not specified, all Runs are returned. + """ diff --git a/stripe/params/v2/extend/_workflow_run_retrieve_params.py b/stripe/params/v2/extend/_workflow_run_retrieve_params.py new file mode 100644 index 000000000..3d531350e --- /dev/null +++ b/stripe/params/v2/extend/_workflow_run_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class WorkflowRunRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/iam/__init__.py b/stripe/params/v2/iam/__init__.py new file mode 100644 index 000000000..2d9912b4f --- /dev/null +++ b/stripe/params/v2/iam/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.iam._activity_log_list_params import ( + ActivityLogListParams as ActivityLogListParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ActivityLogListParams": ( + "stripe.params.v2.iam._activity_log_list_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/iam/_activity_log_list_params.py b/stripe/params/v2/iam/_activity_log_list_params.py new file mode 100644 index 000000000..92128a2ea --- /dev/null +++ b/stripe/params/v2/iam/_activity_log_list_params.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class ActivityLogListParams(TypedDict): + action_groups: NotRequired[ + List[Literal["api_key", "user_invite", "user_roles"]] + ] + """ + Filter results to only include activity logs for the specified action group types. + """ + actions: NotRequired[ + List[ + Literal[ + "api_key_created", + "api_key_deleted", + "api_key_updated", + "api_key_viewed", + "user_invite_accepted", + "user_invite_created", + "user_invite_deleted", + "user_roles_deleted", + "user_roles_updated", + ] + ] + ] + """ + Filter results to only include activity logs for the specified action types. + """ + limit: NotRequired[int] + """ + Maximum number of results to return per page. + """ diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py index 2535e2cc1..f5178ae85 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py @@ -45,7 +45,9 @@ class OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount(TypedDict): """ The account number or IBAN of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py index 860c21abf..2fa84d36f 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py @@ -39,7 +39,9 @@ class OutboundSetupIntentUpdateParamsPayoutMethodDataBankAccount(TypedDict): """ The account number or IBAN of the bank account. """ - bank_account_type: NotRequired[Literal["checking", "savings"]] + bank_account_type: NotRequired[ + Literal["checking", "futsu", "savings", "toza"] + ] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/params/v2/network/__init__.py b/stripe/params/v2/network/__init__.py new file mode 100644 index 000000000..d8b3e6772 --- /dev/null +++ b/stripe/params/v2/network/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.network._business_profile_me_params import ( + BusinessProfileMeParams as BusinessProfileMeParams, + ) + from stripe.params.v2.network._business_profile_retrieve_params import ( + BusinessProfileRetrieveParams as BusinessProfileRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "BusinessProfileMeParams": ( + "stripe.params.v2.network._business_profile_me_params", + False, + ), + "BusinessProfileRetrieveParams": ( + "stripe.params.v2.network._business_profile_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/network/_business_profile_me_params.py b/stripe/params/v2/network/_business_profile_me_params.py new file mode 100644 index 000000000..5c77fd60e --- /dev/null +++ b/stripe/params/v2/network/_business_profile_me_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BusinessProfileMeParams(TypedDict): + pass diff --git a/stripe/params/v2/network/_business_profile_retrieve_params.py b/stripe/params/v2/network/_business_profile_retrieve_params.py new file mode 100644 index 000000000..5698bf63b --- /dev/null +++ b/stripe/params/v2/network/_business_profile_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BusinessProfileRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/__init__.py b/stripe/params/v2/orchestrated_commerce/__init__.py new file mode 100644 index 000000000..9a35ce8d0 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/__init__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.orchestrated_commerce._agreement_confirm_params import ( + AgreementConfirmParams as AgreementConfirmParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_create_params import ( + AgreementCreateParams as AgreementCreateParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_list_params import ( + AgreementListParams as AgreementListParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_retrieve_params import ( + AgreementRetrieveParams as AgreementRetrieveParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_terminate_params import ( + AgreementTerminateParams as AgreementTerminateParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "AgreementConfirmParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_confirm_params", + False, + ), + "AgreementCreateParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_create_params", + False, + ), + "AgreementListParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_list_params", + False, + ), + "AgreementRetrieveParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_retrieve_params", + False, + ), + "AgreementTerminateParams": ( + "stripe.params.v2.orchestrated_commerce._agreement_terminate_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py new file mode 100644 index 000000000..9a5118f6d --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_confirm_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementConfirmParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py new file mode 100644 index 000000000..7a6e93b74 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_create_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementCreateParams(TypedDict): + orchestrator: str + """ + The Network ID of the orchestrator to create an agreement with. + """ diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py new file mode 100644 index 000000000..167d153a8 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_list_params.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class AgreementListParams(TypedDict): + limit: NotRequired[int] + """ + The limit for the number of results per page. + """ + network_business_profile: NotRequired[str] + """ + Filter list to Orchestrated Commerce Agreements with a specific counterparty. + """ diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py new file mode 100644 index 000000000..dc2818f65 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py b/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py new file mode 100644 index 000000000..85ebcc249 --- /dev/null +++ b/stripe/params/v2/orchestrated_commerce/_agreement_terminate_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class AgreementTerminateParams(TypedDict): + pass diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 7db5e2fda..fe5cdea9c 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -9,22 +9,36 @@ if TYPE_CHECKING: from stripe.v2 import ( billing as billing, + commerce as commerce, core as core, + data as data, + extend as extend, + iam as iam, money_management as money_management, + network as network, + orchestrated_commerce as orchestrated_commerce, test_helpers as test_helpers, ) from stripe.v2._billing_service import BillingService as BillingService + from stripe.v2._commerce_service import CommerceService as CommerceService from stripe.v2._core_service import CoreService as CoreService + from stripe.v2._datum_service import DatumService as DatumService from stripe.v2._deleted_object import DeletedObject as DeletedObject + from stripe.v2._extend_service import ExtendService as ExtendService from stripe.v2._financial_address_credit_simulation import ( FinancialAddressCreditSimulation as FinancialAddressCreditSimulation, ) 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, ) + from stripe.v2._network_service import NetworkService as NetworkService + from stripe.v2._orchestrated_commerce_service import ( + OrchestratedCommerceService as OrchestratedCommerceService, + ) from stripe.v2._test_helper_service import ( TestHelperService as TestHelperService, ) @@ -32,12 +46,21 @@ # name -> (import_target, is_submodule) _import_map = { "billing": ("stripe.v2.billing", True), + "commerce": ("stripe.v2.commerce", True), "core": ("stripe.v2.core", True), + "data": ("stripe.v2.data", True), + "extend": ("stripe.v2.extend", True), + "iam": ("stripe.v2.iam", True), "money_management": ("stripe.v2.money_management", True), + "network": ("stripe.v2.network", True), + "orchestrated_commerce": ("stripe.v2.orchestrated_commerce", True), "test_helpers": ("stripe.v2.test_helpers", True), "BillingService": ("stripe.v2._billing_service", False), + "CommerceService": ("stripe.v2._commerce_service", False), "CoreService": ("stripe.v2._core_service", False), + "DatumService": ("stripe.v2._datum_service", False), "DeletedObject": ("stripe.v2._deleted_object", False), + "ExtendService": ("stripe.v2._extend_service", False), "FinancialAddressCreditSimulation": ( "stripe.v2._financial_address_credit_simulation", False, @@ -46,7 +69,13 @@ "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), + "OrchestratedCommerceService": ( + "stripe.v2._orchestrated_commerce_service", + False, + ), "TestHelperService": ("stripe.v2._test_helper_service", False), } if not TYPE_CHECKING: diff --git a/stripe/v2/_commerce_service.py b/stripe/v2/_commerce_service.py new file mode 100644 index 000000000..cc40db470 --- /dev/null +++ b/stripe/v2/_commerce_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce._product_catalog_service import ( + ProductCatalogService, + ) + +_subservices = { + "product_catalog": [ + "stripe.v2.commerce._product_catalog_service", + "ProductCatalogService", + ], +} + + +class CommerceService(StripeService): + product_catalog: "ProductCatalogService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_datum_service.py b/stripe/v2/_datum_service.py new file mode 100644 index 000000000..e654d27ed --- /dev/null +++ b/stripe/v2/_datum_service.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.data._reporting_service import ReportingService + +_subservices = { + "reporting": ["stripe.v2.data._reporting_service", "ReportingService"], +} + + +class DatumService(StripeService): + reporting: "ReportingService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_extend_service.py b/stripe/v2/_extend_service.py new file mode 100644 index 000000000..40811697b --- /dev/null +++ b/stripe/v2/_extend_service.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.extend._workflow_run_service import WorkflowRunService + from stripe.v2.extend._workflow_service import WorkflowService + +_subservices = { + "workflows": ["stripe.v2.extend._workflow_service", "WorkflowService"], + "workflow_runs": [ + "stripe.v2.extend._workflow_run_service", + "WorkflowRunService", + ], +} + + +class ExtendService(StripeService): + workflows: "WorkflowService" + workflow_runs: "WorkflowRunService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_iam_service.py b/stripe/v2/_iam_service.py new file mode 100644 index 000000000..9272865a0 --- /dev/null +++ b/stripe/v2/_iam_service.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.iam._activity_log_service import ActivityLogService + +_subservices = { + "activity_logs": [ + "stripe.v2.iam._activity_log_service", + "ActivityLogService", + ], +} + + +class IamService(StripeService): + activity_logs: "ActivityLogService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_network_service.py b/stripe/v2/_network_service.py new file mode 100644 index 000000000..f36d3336b --- /dev/null +++ b/stripe/v2/_network_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.network._business_profile_service import ( + BusinessProfileService, + ) + +_subservices = { + "business_profiles": [ + "stripe.v2.network._business_profile_service", + "BusinessProfileService", + ], +} + + +class NetworkService(StripeService): + business_profiles: "BusinessProfileService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/_orchestrated_commerce_service.py b/stripe/v2/_orchestrated_commerce_service.py new file mode 100644 index 000000000..fb845ba6a --- /dev/null +++ b/stripe/v2/_orchestrated_commerce_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.orchestrated_commerce._agreement_service import ( + AgreementService, + ) + +_subservices = { + "agreements": [ + "stripe.v2.orchestrated_commerce._agreement_service", + "AgreementService", + ], +} + + +class OrchestratedCommerceService(StripeService): + agreements: "AgreementService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/_bill_setting.py b/stripe/v2/billing/_bill_setting.py index c48dda04e..0f3921468 100644 --- a/stripe/v2/billing/_bill_setting.py +++ b/stripe/v2/billing/_bill_setting.py @@ -18,7 +18,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -36,12 +36,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} @@ -71,8 +71,8 @@ class TimeUntilDue(StripeObject): """ latest_version: str """ - The latest version of the current settings object. This will be - Updated every time an attribute of the settings is updated. + The latest version of the current settings object. This is + updated every time an attribute of the settings is updated. """ live_version: str """ diff --git a/stripe/v2/billing/_bill_setting_version.py b/stripe/v2/billing/_bill_setting_version.py index e0a1c3d4a..602aaf9fa 100644 --- a/stripe/v2/billing/_bill_setting_version.py +++ b/stripe/v2/billing/_bill_setting_version.py @@ -18,7 +18,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -36,12 +36,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} diff --git a/stripe/v2/billing/_cadence.py b/stripe/v2/billing/_cadence.py index a4b90e197..743c29222 100644 --- a/stripe/v2/billing/_cadence.py +++ b/stripe/v2/billing/_cadence.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import Any, ClassVar, List, Optional +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -61,7 +61,7 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: Optional[int] """ @@ -127,11 +127,11 @@ class Time(StripeObject): """ The day to anchor the billing on for a type="month" billing cycle from 1-31. If this number is greater than the number of days in the month being billed, - this will anchor to the last day of the month. + this anchors to the last day of the month. """ month_of_year: int """ - The month to bill on from 1-12. If not provided, this will default to the month the cadence was created. + The month to bill on from 1-12. If not provided, this defaults to the month the cadence was created. """ time: Time """ @@ -173,7 +173,7 @@ class Time(StripeObject): class Payer(StripeObject): billing_profile: str """ - The ID of the Billing Profile object which determines how a bill will be paid. + The ID of the Billing Profile object which determines how a bill is paid. """ customer: Optional[str] """ @@ -221,7 +221,7 @@ class Calculation(StripeObject): class Tax(StripeObject): type: Literal["automatic", "manual"] """ - Determines if tax will be calculated automatically based on a PTC or manually based on rules defined by the merchant. Defaults to "manual". + Determines if tax is calculated automatically based on a PTC or manually based on rules defined by the business. Defaults to "manual". """ tax: Optional[Tax] @@ -239,12 +239,12 @@ class TimeUntilDue(StripeObject): interval_count: int """ The number of interval units. For example, if interval=day and interval_count=30, - the invoice will be due in 30 days. + the invoice is due in 30 days. """ time_until_due: Optional[TimeUntilDue] """ - The amount of time until the invoice will be overdue for payment. + The amount of time until the invoice is overdue for payment. """ _inner_class_types = {"time_until_due": TimeUntilDue} @@ -388,6 +388,12 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class Konbini(StripeObject): + pass + + class SepaDebit(StripeObject): + pass + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -451,11 +457,11 @@ class Filters(StripeObject): """ This sub-hash contains details about the Bank transfer payment method options. """ - konbini: Optional[UntypedStripeObject[Any]] + konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options. """ - sepa_debit: Optional[UntypedStripeObject[Any]] + sepa_debit: Optional[SepaDebit] """ This sub-hash contains details about the SEPA Direct Debit payment method options. """ @@ -468,14 +474,16 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "konbini": Konbini, + "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } collection_method: Literal["automatic", "send_invoice"] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ email_delivery: EmailDelivery diff --git a/stripe/v2/billing/_collection_setting.py b/stripe/v2/billing/_collection_setting.py index 39dfb26ba..74b8fd9f9 100644 --- a/stripe/v2/billing/_collection_setting.py +++ b/stripe/v2/billing/_collection_setting.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import Any, ClassVar, List, Optional +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -128,6 +128,12 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class Konbini(StripeObject): + pass + + class SepaDebit(StripeObject): + pass + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -189,11 +195,11 @@ class Filters(StripeObject): """ This sub-hash contains details about the Bank transfer payment method options. """ - konbini: Optional[UntypedStripeObject[Any]] + konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options. """ - sepa_debit: Optional[UntypedStripeObject[Any]] + sepa_debit: Optional[SepaDebit] """ This sub-hash contains details about the SEPA Direct Debit payment method options. """ @@ -206,14 +212,16 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "konbini": Konbini, + "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } collection_method: Optional[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ created: str @@ -234,8 +242,8 @@ class Filters(StripeObject): """ latest_version: str """ - The latest version of the current settings object. This will be - Updated every time an attribute of the settings is updated. + The latest version of the current settings object. This is + updated every time an attribute of the settings is updated. """ live_version: str """ diff --git a/stripe/v2/billing/_collection_setting_version.py b/stripe/v2/billing/_collection_setting_version.py index 194a54b94..1b9e9efe2 100644 --- a/stripe/v2/billing/_collection_setting_version.py +++ b/stripe/v2/billing/_collection_setting_version.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import Any, ClassVar, List, Optional +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -128,6 +128,12 @@ class EuBankTransfer(StripeObject): """ _inner_class_types = {"bank_transfer": BankTransfer} + class Konbini(StripeObject): + pass + + class SepaDebit(StripeObject): + pass + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -189,11 +195,11 @@ class Filters(StripeObject): """ This sub-hash contains details about the Bank transfer payment method options. """ - konbini: Optional[UntypedStripeObject[Any]] + konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options. """ - sepa_debit: Optional[UntypedStripeObject[Any]] + sepa_debit: Optional[SepaDebit] """ This sub-hash contains details about the SEPA Direct Debit payment method options. """ @@ -206,14 +212,16 @@ class Filters(StripeObject): "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, + "konbini": Konbini, + "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } collection_method: Optional[Literal["automatic", "send_invoice"]] """ - Either automatic, or send_invoice. When charging automatically, Stripe will attempt to pay this - bill at the end of the period using the payment method attached to the payer profile. When sending an invoice, - Stripe will email your payer profile an invoice with payment instructions. + Either automatic, or send_invoice. When charging automatically, Stripe attempts to pay this + bill at the end of the period using the payment method attached to the billing profile. When sending an invoice, + Stripe emails your billing profile an invoice with payment instructions. Defaults to automatic. """ created: str diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 603e75d50..a8bdf3068 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -17,7 +17,7 @@ class MeterEventAdjustment(StripeObject): class Cancel(StripeObject): identifier: str """ - Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + The identifier that was originally assigned to the meter event. You can only cancel events within 24 hours of Stripe receiving them. """ cancel: Cancel @@ -34,7 +34,7 @@ class Cancel(StripeObject): """ id: str """ - The unique id of this meter event adjustment. + The unique ID of this meter event adjustment. """ livemode: bool """ @@ -50,6 +50,6 @@ class Cancel(StripeObject): """ type: Literal["cancel"] """ - Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + Open Enum. Specifies the type of cancellation. Currently supports canceling a single event. """ _inner_class_types = {"cancel": Cancel} diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py index 90364bb1a..86fb237f1 100644 --- a/stripe/v2/billing/_meter_event_session.py +++ b/stripe/v2/billing/_meter_event_session.py @@ -15,7 +15,7 @@ class MeterEventSession(StripeObject): ) authentication_token: str """ - The authentication token for this session. Use this token when calling the + The authentication token for this session. Use this token when calling the high-throughput meter event API. """ created: str @@ -24,11 +24,11 @@ class MeterEventSession(StripeObject): """ expires_at: str """ - The time at which this session will expire. + The time at which this session expires. """ id: str """ - The unique id of this auth session. + The unique ID of this auth session. """ livemode: bool """ diff --git a/stripe/v2/billing/_meter_event_session_service.py b/stripe/v2/billing/_meter_event_session_service.py index 5bf06cd0b..348939f69 100644 --- a/stripe/v2/billing/_meter_event_session_service.py +++ b/stripe/v2/billing/_meter_event_session_service.py @@ -19,7 +19,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "MeterEventSession": """ - Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires. """ return cast( "MeterEventSession", @@ -38,7 +38,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "MeterEventSession": """ - Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you will need to create a new meter event session when your token expires. + Creates a meter event session to send usage on the high-throughput meter event stream. Authentication tokens are only valid for 15 minutes, so you need to create a new meter event session when your token expires. """ return cast( "MeterEventSession", diff --git a/stripe/v2/commerce/__init__.py b/stripe/v2/commerce/__init__.py new file mode 100644 index 000000000..fc4dea39e --- /dev/null +++ b/stripe/v2/commerce/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce import product_catalog as product_catalog + from stripe.v2.commerce._product_catalog_import import ( + ProductCatalogImport as ProductCatalogImport, + ) + from stripe.v2.commerce._product_catalog_service import ( + ProductCatalogService as ProductCatalogService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "product_catalog": ("stripe.v2.commerce.product_catalog", True), + "ProductCatalogImport": ( + "stripe.v2.commerce._product_catalog_import", + False, + ), + "ProductCatalogService": ( + "stripe.v2.commerce._product_catalog_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/_product_catalog_import.py b/stripe/v2/commerce/_product_catalog_import.py new file mode 100644 index 000000000..e5562955f --- /dev/null +++ b/stripe/v2/commerce/_product_catalog_import.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class ProductCatalogImport(StripeObject): + """ + The product catalog import object tracks the long-running background process that handles uploading, processing and validation. + """ + + OBJECT_NAME: ClassVar[Literal["v2.commerce.product_catalog_import"]] = ( + "v2.commerce.product_catalog_import" + ) + + class StatusDetails(StripeObject): + class AwaitingUpload(StripeObject): + class UploadUrl(StripeObject): + expires_at: str + """ + The timestamp when the upload URL expires. + """ + url: str + """ + The pre-signed URL for uploading the catalog file. + """ + + upload_url: UploadUrl + """ + The pre-signed URL information for uploading the catalog file. + """ + _inner_class_types = {"upload_url": UploadUrl} + + class Failed(StripeObject): + code: Literal["file_not_found", "internal_error", "invalid_file"] + """ + The error code for this product catalog processing failure. + """ + failure_message: str + """ + A message explaining why the import failed. + """ + type: Literal["cannot_proceed", "transient_failure"] + """ + The error type for this product catalog processing failure. + """ + + class Processing(StripeObject): + error_count: int + """ + The number of records that failed to process so far. + """ + success_count: int + """ + The number of records processed so far. + """ + _field_encodings = { + "error_count": "int64_string", + "success_count": "int64_string", + } + + class Succeeded(StripeObject): + success_count: int + """ + The total number of records processed. + """ + _field_encodings = {"success_count": "int64_string"} + + class SucceededWithErrors(StripeObject): + class ErrorFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: str + """ + The timestamp when the download URL expires. + """ + url: str + """ + The pre-signed URL for downloading the error file. + """ + + content_type: str + """ + The MIME type of the error file. + """ + download_url: DownloadUrl + """ + The pre-signed URL information for downloading the error file. + """ + size: int + """ + The size of the error file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + _field_encodings = {"size": "int64_string"} + + class Sample(StripeObject): + error_message: str + """ + A description of what went wrong with this record. + """ + field: str + """ + The name of the field that caused the error. + """ + id: str + """ + The identifier of the record that failed to process. + """ + row: int + """ + The row number in the import file where the error occurred. + """ + _field_encodings = {"row": "int64_string"} + + error_count: int + """ + The total number of records that failed to process. + """ + error_file: ErrorFile + """ + A file containing details about all errors that occurred. + """ + samples: List[Sample] + """ + A sample of errors that occurred during processing. + """ + success_count: int + """ + The total number of records processed. + """ + _inner_class_types = {"error_file": ErrorFile, "samples": Sample} + _field_encodings = { + "error_count": "int64_string", + "success_count": "int64_string", + } + + awaiting_upload: Optional[AwaitingUpload] + """ + Details when the import is awaiting file upload. + """ + failed: Optional[Failed] + """ + Details when the import didn't complete. + """ + processing: Optional[Processing] + """ + Details when the import is processing. + """ + succeeded: Optional[Succeeded] + """ + Details when the import has succeeded. + """ + succeeded_with_errors: Optional[SucceededWithErrors] + """ + Details when the import completed but some records failed to process. + """ + _inner_class_types = { + "awaiting_upload": AwaitingUpload, + "failed": Failed, + "processing": Processing, + "succeeded": Succeeded, + "succeeded_with_errors": SucceededWithErrors, + } + + created: str + """ + The time this ProductCatalogImport was created. + """ + feed_type: Literal["inventory", "pricing", "product"] + """ + The type of feed data being imported into the product catalog. + """ + id: str + """ + The unique identifier for this ProductCatalogImport. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: UntypedStripeObject[str] + """ + Additional information about the object in a structured format. + """ + object: Literal["v2.commerce.product_catalog_import"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal[ + "awaiting_upload", + "failed", + "processing", + "succeeded", + "succeeded_with_errors", + ] + """ + The current status of this ProductCatalogImport. + """ + status_details: Optional[StatusDetails] + """ + Details about the current import status. + """ + _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/v2/commerce/_product_catalog_service.py b/stripe/v2/commerce/_product_catalog_service.py new file mode 100644 index 000000000..9c9c4e0b9 --- /dev/null +++ b/stripe/v2/commerce/_product_catalog_service.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce.product_catalog._import_service import ( + ImportService, + ) + +_subservices = { + "imports": [ + "stripe.v2.commerce.product_catalog._import_service", + "ImportService", + ], +} + + +class ProductCatalogService(StripeService): + imports: "ImportService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/product_catalog/__init__.py b/stripe/v2/commerce/product_catalog/__init__.py new file mode 100644 index 000000000..bad6e9107 --- /dev/null +++ b/stripe/v2/commerce/product_catalog/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.commerce.product_catalog._import_service import ( + ImportService as ImportService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ImportService": ( + "stripe.v2.commerce.product_catalog._import_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/commerce/product_catalog/_import_service.py b/stripe/v2/commerce/product_catalog/_import_service.py new file mode 100644 index 000000000..cc5f28bcd --- /dev/null +++ b/stripe/v2/commerce/product_catalog/_import_service.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.commerce.product_catalog._import_create_params import ( + ImportCreateParams, + ) + from stripe.params.v2.commerce.product_catalog._import_list_params import ( + ImportListParams, + ) + from stripe.params.v2.commerce.product_catalog._import_retrieve_params import ( + ImportRetrieveParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.commerce._product_catalog_import import ProductCatalogImport + + +class ImportService(StripeService): + def list( + self, + params: Optional["ImportListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProductCatalogImport]": + """ + Returns a list of ProductCatalogImport objects. + """ + return cast( + "ListObject[ProductCatalogImport]", + self._request( + "get", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ImportListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProductCatalogImport]": + """ + Returns a list of ProductCatalogImport objects. + """ + return cast( + "ListObject[ProductCatalogImport]", + await self._request_async( + "get", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "ImportCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Creates a ProductCatalogImport. + """ + return cast( + "ProductCatalogImport", + self._request( + "post", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ImportCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Creates a ProductCatalogImport. + """ + return cast( + "ProductCatalogImport", + await self._request_async( + "post", + "/v2/commerce/product_catalog/imports", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["ImportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Retrieves a ProductCatalogImport by ID. + """ + return cast( + "ProductCatalogImport", + self._request( + "get", + "/v2/commerce/product_catalog/imports/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["ImportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProductCatalogImport": + """ + Retrieves a ProductCatalogImport by ID. + """ + return cast( + "ProductCatalogImport", + await self._request_async( + "get", + "/v2/commerce/product_catalog/imports/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index eae17fd07..5ffbc2f45 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -2446,6 +2446,7 @@ class DefaultOutboundDestination(StripeObject): "ca_bank_account", "ch_bank_account", "ci_bank_account", + "cn_bank_account", "co_bank_account", "crypto_wallet", "cr_bank_account", @@ -2478,6 +2479,7 @@ class DefaultOutboundDestination(StripeObject): "it_bank_account", "jm_bank_account", "jo_bank_account", + "jp_bank_account", "ke_bank_account", "kh_bank_account", "kw_bank_account", diff --git a/stripe/v2/core/_batch_job.py b/stripe/v2/core/_batch_job.py index b1c71dd8f..5ad626ad4 100644 --- a/stripe/v2/core/_batch_job.py +++ b/stripe/v2/core/_batch_job.py @@ -7,7 +7,7 @@ class BatchJob(StripeObject): """ - BatchJob resource. + A batch job allows you to perform an API operation on a large set of records asynchronously. """ OBJECT_NAME: ClassVar[Literal["v2.core.batch_job"]] = "v2.core.batch_job" @@ -16,7 +16,7 @@ class StatusDetails(StripeObject): class BatchFailed(StripeObject): error: str """ - Details about the `BatchJob` failure. + Details about the `batch_job` failure. """ class Canceled(StripeObject): @@ -52,7 +52,7 @@ class DownloadUrl(StripeObject): """ output_file: OutputFile """ - The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + The output file details. If the `batch_job` is canceled, this is provided only if there is already output at this point. """ success_count: int """ @@ -97,7 +97,7 @@ class DownloadUrl(StripeObject): """ output_file: OutputFile """ - The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + The output file details. If the `batch_job` is canceled, this is provided only if there is already output at this point. """ success_count: int """ @@ -173,7 +173,7 @@ class DownloadUrl(StripeObject): """ output_file: OutputFile """ - The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + The output file details. If the `batch_job` is canceled, this is provided only if there is already output at this point. """ success_count: int """ @@ -226,7 +226,7 @@ class DownloadUrl(StripeObject): """ output_file: OutputFile """ - The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + The output file details. If the `batch_job` is canceled, this is provided only if there is already output at this point. """ success_count: int """ @@ -240,35 +240,35 @@ class DownloadUrl(StripeObject): batch_failed: Optional[BatchFailed] """ - Additional details for the `BATCH_FAILED` status of the `BatchJob`. + Additional details for the `BATCH_FAILED` status of the `batch_job`. """ canceled: Optional[Canceled] """ - Additional details for the `CANCELED` status of the `BatchJob`. + Additional details for the `CANCELED` status of the `batch_job`. """ complete: Optional[Complete] """ - Additional details for the `COMPLETE` status of the `BatchJob`. + Additional details for the `COMPLETE` status of the `batch_job`. """ in_progress: Optional[InProgress] """ - Additional details for the `IN_PROGRESS` status of the `BatchJob`. + Additional details for the `IN_PROGRESS` status of the `batch_job`. """ ready_for_upload: Optional[ReadyForUpload] """ - Additional details for the `READY_FOR_UPLOAD` status of the `BatchJob`. + Additional details for the `READY_FOR_UPLOAD` status of the `batch_job`. """ timeout: Optional[Timeout] """ - Additional details for the `TIMEOUT` status of the `BatchJob`. + Additional details for the `TIMEOUT` status of the `batch_job`. """ validating: Optional[Validating] """ - Additional details for the `VALIDATING` status of the `BatchJob`. + Additional details for the `VALIDATING` status of the `batch_job`. """ validation_failed: Optional[ValidationFailed] """ - Additional details for the `VALIDATION_FAILED` status of the `BatchJob`. + Additional details for the `VALIDATION_FAILED` status of the `batch_job`. """ _inner_class_types = { "batch_failed": BatchFailed, @@ -283,11 +283,11 @@ class DownloadUrl(StripeObject): created: str """ - Timestamp at which BatchJob was created. + Timestamp at which the `batch_job` was created. """ id: str """ - Unique identifier for the BatchJob. + Unique identifier for the `batch_job`. """ livemode: bool """ @@ -295,11 +295,11 @@ class DownloadUrl(StripeObject): """ maximum_rps: int """ - The maximum rps defined for the `BatchJob`. + The maximum requests per second defined for the `batch_job`. """ metadata: UntypedStripeObject[str] """ - The metadata of the `BatchJob` object. + The metadata of the `batch_job`. """ object: Literal["v2.core.batch_job"] """ @@ -307,7 +307,7 @@ class DownloadUrl(StripeObject): """ skip_validation: bool """ - If the validation will be run previous to the execution of the `BatchJob`. + Whether validation runs before executing the `batch_job`. """ status: Literal[ "batch_failed", @@ -322,10 +322,10 @@ class DownloadUrl(StripeObject): "validation_failed", ] """ - The current status of the `BatchJob`. + The current status of the `batch_job`. """ status_details: Optional[StatusDetails] """ - Additional details about the current state of the `BatchJob`. + Additional details about the current state of the `batch_job`. """ _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/v2/core/accounts/_person_token_service.py b/stripe/v2/core/accounts/_person_token_service.py index 0868da342..66d9498e8 100644 --- a/stripe/v2/core/accounts/_person_token_service.py +++ b/stripe/v2/core/accounts/_person_token_service.py @@ -24,7 +24,8 @@ def create( options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": """ - Creates a Person Token associated with an Account. + Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens). + You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode. """ return cast( "AccountPersonToken", @@ -46,7 +47,8 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "AccountPersonToken": """ - Creates a Person Token associated with an Account. + Creates a single-use token that represents the details for a person. Use this when you create or update persons associated with an Account v2. Learn more about [account tokens](https://docs.stripe.com/connect/account-tokens). + You can only create person tokens with your application's publishable key and in live mode. You can use your application's secret key to create person tokens only in test mode. """ return cast( "AccountPersonToken", diff --git a/stripe/v2/core/vault/_gb_bank_account.py b/stripe/v2/core/vault/_gb_bank_account.py index 36545b39d..ae69da68b 100644 --- a/stripe/v2/core/vault/_gb_bank_account.py +++ b/stripe/v2/core/vault/_gb_bank_account.py @@ -91,7 +91,7 @@ class Provided(StripeObject): the /archive API, and they will not be automatically archived by Stripe. Archived bank account objects cannot be used as outbound destinations and will not appear in the outbound destination list. """ - bank_account_type: Literal["checking", "savings"] + bank_account_type: Literal["checking", "futsu", "savings", "toza"] """ Closed Enum. The type of the bank account (checking or savings). """ diff --git a/stripe/v2/data/__init__.py b/stripe/v2/data/__init__.py new file mode 100644 index 000000000..6adc76009 --- /dev/null +++ b/stripe/v2/data/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.data import reporting as reporting + from stripe.v2.data._reporting_service import ( + ReportingService as ReportingService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "reporting": ("stripe.v2.data.reporting", True), + "ReportingService": ("stripe.v2.data._reporting_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/data/_reporting_service.py b/stripe/v2/data/_reporting_service.py new file mode 100644 index 000000000..3dcf06c1e --- /dev/null +++ b/stripe/v2/data/_reporting_service.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.data.reporting._query_run_service import QueryRunService + +_subservices = { + "query_runs": [ + "stripe.v2.data.reporting._query_run_service", + "QueryRunService", + ], +} + + +class ReportingService(StripeService): + query_runs: "QueryRunService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/data/reporting/__init__.py b/stripe/v2/data/reporting/__init__.py new file mode 100644 index 000000000..684b5c556 --- /dev/null +++ b/stripe/v2/data/reporting/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.data.reporting._query_run import QueryRun as QueryRun + from stripe.v2.data.reporting._query_run_service import ( + QueryRunService as QueryRunService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "QueryRun": ("stripe.v2.data.reporting._query_run", False), + "QueryRunService": ("stripe.v2.data.reporting._query_run_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/data/reporting/_query_run.py b/stripe/v2/data/reporting/_query_run.py new file mode 100644 index 000000000..859da3711 --- /dev/null +++ b/stripe/v2/data/reporting/_query_run.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class QueryRun(StripeObject): + """ + The `QueryRun` object represents an ad-hoc SQL execution. Once created, Stripe processes the query. When + the query has finished running, the object provides a reference to the results. + """ + + OBJECT_NAME: ClassVar[Literal["v2.data.reporting.query_run"]] = ( + "v2.data.reporting.query_run" + ) + + class Result(StripeObject): + class File(StripeObject): + class DownloadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + content_type: Literal["csv", "zip"] + """ + The content type of the file. + """ + download_url: DownloadUrl + """ + A pre-signed URL that allows secure, time-limited access to download the file. + """ + size: int + """ + The total size of the file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + _field_encodings = {"size": "int64_string"} + + file: Optional[File] + """ + 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"] + """ + The type of the `ReportRun` or `QueryRun` result. + """ + _inner_class_types = {"file": File} + + class ResultOptions(StripeObject): + compress_file: Optional[bool] + """ + If set, the generated results file will be compressed into a ZIP folder. + This is useful for reducing file size and download time for large results. + """ + + class StatusDetails(StripeObject): + error_code: Optional[ + Literal["file_size_above_limit", "internal_error"] + ] + """ + Error code categorizing the reason the `QueryRun` failed. + """ + error_message: Optional[str] + """ + Error message with additional details about the failure. + """ + + created: str + """ + Time at which the object was created. + """ + id: str + """ + The unique identifier of the `QueryRun` object. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.data.reporting.query_run"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + result: Optional[Result] + """ + Details how to retrieve the results of a successfully completed `QueryRun`. + """ + result_options: Optional[ResultOptions] + """ + The options specified for customizing the output of the `QueryRun`. + """ + sql: str + """ + The SQL that was executed. + """ + status: Literal["failed", "running", "succeeded"] + """ + The current status of the `QueryRun`. + """ + status_details: UntypedStripeObject[StatusDetails] + """ + Additional details about the current state of the `QueryRun`. Populated when the `QueryRun` + is in the `failed` state, providing more information about why the query failed. + """ + _inner_class_types = { + "result": Result, + "result_options": ResultOptions, + "status_details": StatusDetails, + } diff --git a/stripe/v2/data/reporting/_query_run_service.py b/stripe/v2/data/reporting/_query_run_service.py new file mode 100644 index 000000000..99149658c --- /dev/null +++ b/stripe/v2/data/reporting/_query_run_service.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.data.reporting._query_run_create_params import ( + QueryRunCreateParams, + ) + from stripe.params.v2.data.reporting._query_run_retrieve_params import ( + QueryRunRetrieveParams, + ) + from stripe.v2.data.reporting._query_run import QueryRun + + +class QueryRunService(StripeService): + def create( + self, + params: "QueryRunCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "QueryRun": + """ + Creates a query run to execute ad-hoc SQL and returns a `QueryRun` object to track progress and retrieve results. + """ + return cast( + "QueryRun", + self._request( + "post", + "/v2/data/reporting/query_runs", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "QueryRunCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "QueryRun": + """ + Creates a query run to execute ad-hoc SQL and returns a `QueryRun` object to track progress and retrieve results. + """ + return cast( + "QueryRun", + await self._request_async( + "post", + "/v2/data/reporting/query_runs", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["QueryRunRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "QueryRun": + """ + Fetches the current state and details of a previously created `QueryRun`. If the `QueryRun` + has succeeded, the endpoint will provide details for how to retrieve the results. + """ + return cast( + "QueryRun", + self._request( + "get", + "/v2/data/reporting/query_runs/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["QueryRunRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "QueryRun": + """ + Fetches the current state and details of a previously created `QueryRun`. If the `QueryRun` + has succeeded, the endpoint will provide details for how to retrieve the results. + """ + return cast( + "QueryRun", + await self._request_async( + "get", + "/v2/data/reporting/query_runs/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/extend/__init__.py b/stripe/v2/extend/__init__.py new file mode 100644 index 000000000..ccf21fc05 --- /dev/null +++ b/stripe/v2/extend/__init__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.extend._workflow import Workflow as Workflow + from stripe.v2.extend._workflow_run import WorkflowRun as WorkflowRun + from stripe.v2.extend._workflow_run_service import ( + WorkflowRunService as WorkflowRunService, + ) + from stripe.v2.extend._workflow_service import ( + WorkflowService as WorkflowService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Workflow": ("stripe.v2.extend._workflow", False), + "WorkflowRun": ("stripe.v2.extend._workflow_run", False), + "WorkflowRunService": ("stripe.v2.extend._workflow_run_service", False), + "WorkflowService": ("stripe.v2.extend._workflow_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/extend/_workflow.py b/stripe/v2/extend/_workflow.py new file mode 100644 index 000000000..ad325b2ff --- /dev/null +++ b/stripe/v2/extend/_workflow.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class Workflow(StripeObject): + """ + A Stripe Workflow is a sequence of actions, like Stripe API calls, that are taken in response to an initiating trigger. + A trigger can be a Stripe API event, or a manual invocation. + """ + + OBJECT_NAME: ClassVar[Literal["v2.extend.workflow"]] = "v2.extend.workflow" + + class Trigger(StripeObject): + class EventTrigger(StripeObject): + events_from: List[str] + """ + Specifies which accounts' events will trigger this Workflow. + """ + type: str + """ + The Stripe event type that will trigger this Workflow. + """ + + class Manual(StripeObject): + pass + + event_trigger: Optional[EventTrigger] + """ + The Workflow can be launched when Stripe emits a certain event. + """ + manual: Optional[Manual] + """ + The Workflow can be launched through a direct call, using either the Dashboard or the Stripe API. + """ + type: Literal["event_trigger", "manual"] + """ + Which type of trigger this is. + """ + _inner_class_types = {"event_trigger": EventTrigger, "manual": Manual} + + created: str + """ + When the Workflow was created. + """ + id: str + """ + The unique ID of the Workflow. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.extend.workflow"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["active", "archived", "draft", "inactive"] + """ + Whether this Workflow is active, inactive, or in some other state. Only active Workflows may be invoked. + """ + title: str + """ + Workflow title. + """ + triggers: List[Trigger] + """ + Under what conditions will this Workflow launch. + """ + _inner_class_types = {"triggers": Trigger} diff --git a/stripe/v2/extend/_workflow_run.py b/stripe/v2/extend/_workflow_run.py new file mode 100644 index 000000000..c2e377b4d --- /dev/null +++ b/stripe/v2/extend/_workflow_run.py @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import Any, ClassVar, Optional +from typing_extensions import Literal + + +class WorkflowRun(StripeObject): + """ + An execution of a Workflow in response to a triggering event. + """ + + OBJECT_NAME: ClassVar[Literal["v2.extend.workflow_run"]] = ( + "v2.extend.workflow_run" + ) + + class StatusDetails(StripeObject): + class Failed(StripeObject): + error_message: Optional[str] + """ + Optional details about the failure result. + """ + + class Started(StripeObject): + pass + + class Succeeded(StripeObject): + pass + + failed: Optional[Failed] + """ + Details about the Workflow Run's transition into the FAILED state. + """ + started: Optional[Started] + """ + Details about the Workflow Run's transition in to the STARTED state. + """ + succeeded: Optional[Succeeded] + """ + Details about the Workflow Run's transition into the SUCCEEDED state. + """ + _inner_class_types = { + "failed": Failed, + "started": Started, + "succeeded": Succeeded, + } + + class StatusTransitions(StripeObject): + failed_at: Optional[str] + """ + When the Workflow Run failed. + """ + started_at: Optional[str] + """ + When the Workflow Run was started. + """ + succeeded_at: Optional[str] + """ + When the Workflow Run succeeded. + """ + + class Trigger(StripeObject): + class EventTrigger(StripeObject): + context: str + """ + The account that generated the triggering event. + """ + id: str + """ + The Stripe event that triggered this Run. + """ + type: str + """ + The Stripe event type triggered this Run. + """ + + class Manual(StripeObject): + input_parameters: UntypedStripeObject[Any] + """ + The input parameters used when launching the Run. + """ + + event_trigger: Optional[EventTrigger] + """ + The Workflow Run was launched when Stripe emitted a certain event. + """ + manual: Optional[Manual] + """ + The Workflow Run was launched through a direct call, using either the Dashboard or the Stripe API. + """ + type: Literal["event_trigger", "manual"] + """ + Which type of trigger this is. + """ + _inner_class_types = {"event_trigger": EventTrigger, "manual": Manual} + + created: str + """ + When the Workflow Run was created. + """ + id: str + """ + The unique ID of the Workflow Run. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.extend.workflow_run"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["failed", "started", "succeeded"] + """ + The current Workflow Run execution status. + """ + status_details: Optional[StatusDetails] + """ + Details about the Workflow Run's status transitions. + """ + status_transitions: StatusTransitions + """ + Summary information about the Workflow Run's status transitions. + """ + trigger: Trigger + """ + A record of the trigger that launched this Workflow Run. + """ + workflow: str + """ + The Workflow this Run belongs to. + """ + _inner_class_types = { + "status_details": StatusDetails, + "status_transitions": StatusTransitions, + "trigger": Trigger, + } diff --git a/stripe/v2/extend/_workflow_run_service.py b/stripe/v2/extend/_workflow_run_service.py new file mode 100644 index 000000000..d636ea261 --- /dev/null +++ b/stripe/v2/extend/_workflow_run_service.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.extend._workflow_run_list_params import ( + WorkflowRunListParams, + ) + from stripe.params.v2.extend._workflow_run_retrieve_params import ( + WorkflowRunRetrieveParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.extend._workflow_run import WorkflowRun + + +class WorkflowRunService(StripeService): + def list( + self, + params: Optional["WorkflowRunListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[WorkflowRun]": + """ + List all Workflow Runs. + """ + return cast( + "ListObject[WorkflowRun]", + self._request( + "get", + "/v2/extend/workflow_runs", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["WorkflowRunListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[WorkflowRun]": + """ + List all Workflow Runs. + """ + return cast( + "ListObject[WorkflowRun]", + await self._request_async( + "get", + "/v2/extend/workflow_runs", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["WorkflowRunRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "WorkflowRun": + """ + Retrieves the details of a Workflow Run by ID. + """ + return cast( + "WorkflowRun", + self._request( + "get", + "/v2/extend/workflow_runs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["WorkflowRunRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "WorkflowRun": + """ + Retrieves the details of a Workflow Run by ID. + """ + return cast( + "WorkflowRun", + await self._request_async( + "get", + "/v2/extend/workflow_runs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/extend/_workflow_service.py b/stripe/v2/extend/_workflow_service.py new file mode 100644 index 000000000..e95c51466 --- /dev/null +++ b/stripe/v2/extend/_workflow_service.py @@ -0,0 +1,141 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.extend._workflow_invoke_params import ( + WorkflowInvokeParams, + ) + from stripe.params.v2.extend._workflow_list_params import ( + WorkflowListParams, + ) + from stripe.params.v2.extend._workflow_retrieve_params import ( + WorkflowRetrieveParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.extend._workflow import Workflow + from stripe.v2.extend._workflow_run import WorkflowRun + + +class WorkflowService(StripeService): + def list( + self, + params: Optional["WorkflowListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Workflow]": + """ + List all Workflows. + """ + return cast( + "ListObject[Workflow]", + self._request( + "get", + "/v2/extend/workflows", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["WorkflowListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Workflow]": + """ + List all Workflows. + """ + return cast( + "ListObject[Workflow]", + await self._request_async( + "get", + "/v2/extend/workflows", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["WorkflowRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Workflow": + """ + Retrieves the details of a Workflow by ID. + """ + return cast( + "Workflow", + self._request( + "get", + "/v2/extend/workflows/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["WorkflowRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Workflow": + """ + Retrieves the details of a Workflow by ID. + """ + return cast( + "Workflow", + await self._request_async( + "get", + "/v2/extend/workflows/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def invoke( + self, + id: str, + params: "WorkflowInvokeParams", + options: Optional["RequestOptions"] = None, + ) -> "WorkflowRun": + """ + Invokes an on-demand Workflow with parameters, to launch a new Workflow Run. + """ + return cast( + "WorkflowRun", + self._request( + "post", + "/v2/extend/workflows/{id}/invoke".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def invoke_async( + self, + id: str, + params: "WorkflowInvokeParams", + options: Optional["RequestOptions"] = None, + ) -> "WorkflowRun": + """ + Invokes an on-demand Workflow with parameters, to launch a new Workflow Run. + """ + return cast( + "WorkflowRun", + await self._request_async( + "post", + "/v2/extend/workflows/{id}/invoke".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/iam/__init__.py b/stripe/v2/iam/__init__.py new file mode 100644 index 000000000..a7df58928 --- /dev/null +++ b/stripe/v2/iam/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.iam._activity_log import ActivityLog as ActivityLog + from stripe.v2.iam._activity_log_service import ( + ActivityLogService as ActivityLogService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ActivityLog": ("stripe.v2.iam._activity_log", False), + "ActivityLogService": ("stripe.v2.iam._activity_log_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/iam/_activity_log.py b/stripe/v2/iam/_activity_log.py new file mode 100644 index 000000000..b136cd457 --- /dev/null +++ b/stripe/v2/iam/_activity_log.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class ActivityLog(StripeObject): + """ + An activity log records a single action performed on an account. + """ + + OBJECT_NAME: ClassVar[Literal["v2.iam.activity_log"]] = ( + "v2.iam.activity_log" + ) + + class Actor(StripeObject): + class ApiKey(StripeObject): + id: str + """ + Unique identifier of the API key. + """ + + class User(StripeObject): + email: str + """ + Email address of the user. + """ + + api_key: Optional[ApiKey] + """ + Set when the actor is an API key. + """ + type: Literal["api_key", "user"] + """ + The type of actor. + """ + user: Optional[User] + """ + Set when the actor is a user. + """ + _inner_class_types = {"api_key": ApiKey, "user": User} + + class Details(StripeObject): + class ApiKey(StripeObject): + class ManagedBy(StripeObject): + class Application(StripeObject): + id: str + """ + Identifier of the application. + """ + + application: Optional[Application] + """ + An application. + """ + type: Literal["application"] + """ + The type of entity. + """ + _inner_class_types = {"application": Application} + + created: str + """ + Timestamp when the API key was created. + """ + expires_at: Optional[str] + """ + Timestamp when the API key expires. + """ + id: str + """ + Unique identifier of the API key. + """ + ip_allowlist: List[str] + """ + List of IP addresses allowed to use this API key. + """ + managed_by: Optional[ManagedBy] + """ + Information about the entity managing this API key. + """ + name: Optional[str] + """ + Name of the API key. + """ + new_key: Optional[str] + """ + Unique identifier of the new API key, set when this key was rotated. + """ + note: Optional[str] + """ + Note or description for the API key. + """ + type: Literal["publishable_key", "secret_key"] + """ + Type of the API key. + """ + _inner_class_types = {"managed_by": ManagedBy} + + class UserInvite(StripeObject): + invited_user_email: str + """ + Email address of the invited user. + """ + roles: List[str] + """ + Roles assigned to the invited user. + """ + + class UserRoles(StripeObject): + new_roles: List[str] + """ + Roles the user has after the change. + """ + old_roles: List[str] + """ + Roles the user had before the change. + """ + user_email: str + """ + Email address of the user whose roles were changed. + """ + + api_key: Optional[ApiKey] + """ + Details of an API key action. + """ + type: Literal["api_key", "user_invite", "user_roles"] + """ + The action group type of the activity log entry. + """ + user_invite: Optional[UserInvite] + """ + Details of a user invite action. + """ + user_roles: Optional[UserRoles] + """ + Details of a user role change action. + """ + _inner_class_types = { + "api_key": ApiKey, + "user_invite": UserInvite, + "user_roles": UserRoles, + } + + actor: Actor + """ + The actor that performed the action. + """ + context: str + """ + The account on which the action was performed. + """ + created: str + """ + Timestamp when the activity log entry was created. + """ + details: Details + """ + Action-specific details of the activity log entry. + """ + id: str + """ + Unique identifier of the activity log entry. + """ + livemode: bool + """ + Whether the action was performed in live mode. + """ + object: Literal["v2.iam.activity_log"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + type: Literal[ + "api_key_created", + "api_key_deleted", + "api_key_updated", + "api_key_viewed", + "user_invite_accepted", + "user_invite_created", + "user_invite_deleted", + "user_roles_deleted", + "user_roles_updated", + ] + """ + The type of action that was performed. + """ + _inner_class_types = {"actor": Actor, "details": Details} diff --git a/stripe/v2/iam/_activity_log_service.py b/stripe/v2/iam/_activity_log_service.py new file mode 100644 index 000000000..67ab2c604 --- /dev/null +++ b/stripe/v2/iam/_activity_log_service.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.iam._activity_log_list_params import ( + ActivityLogListParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.iam._activity_log import ActivityLog + + +class ActivityLogService(StripeService): + def list( + self, + params: Optional["ActivityLogListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ActivityLog]": + """ + List activity logs of an account. + """ + return cast( + "ListObject[ActivityLog]", + self._request( + "get", + "/v2/iam/activity_logs", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ActivityLogListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ActivityLog]": + """ + List activity logs of an account. + """ + return cast( + "ListObject[ActivityLog]", + await self._request_async( + "get", + "/v2/iam/activity_logs", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py index db2e8db8a..f1e3b62bf 100644 --- a/stripe/v2/money_management/_inbound_transfer.py +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._stripe_object import StripeObject, UntypedStripeObject +from stripe._stripe_object import StripeObject from stripe.v2._amount import Amount -from typing import Any, ClassVar, List, Optional +from typing import ClassVar, List, Optional from typing_extensions import Literal @@ -60,6 +60,12 @@ class BankDebitFailed(StripeObject): Open Enum. The return reason for the failed InboundTransfer. """ + class BankDebitProcessing(StripeObject): + pass + + class BankDebitQueued(StripeObject): + pass + class BankDebitReturned(StripeObject): return_reason: Literal[ "bank_account_closed", @@ -72,15 +78,18 @@ class BankDebitReturned(StripeObject): Open Enum. The return reason for the returned InboundTransfer. """ + class BankDebitSucceeded(StripeObject): + pass + bank_debit_failed: Optional[BankDebitFailed] """ The history entry for a failed InboundTransfer. """ - bank_debit_processing: Optional[UntypedStripeObject[Any]] + bank_debit_processing: Optional[BankDebitProcessing] """ The history entry for a processing InboundTransfer. """ - bank_debit_queued: Optional[UntypedStripeObject[Any]] + bank_debit_queued: Optional[BankDebitQueued] """ The history entry for a queued InboundTransfer. """ @@ -88,7 +97,7 @@ class BankDebitReturned(StripeObject): """ The history entry for a returned InboundTransfer. """ - bank_debit_succeeded: Optional[UntypedStripeObject[Any]] + bank_debit_succeeded: Optional[BankDebitSucceeded] """ The history entry for a succeeded InboundTransfer. """ @@ -120,7 +129,10 @@ class BankDebitReturned(StripeObject): """ _inner_class_types = { "bank_debit_failed": BankDebitFailed, + "bank_debit_processing": BankDebitProcessing, + "bank_debit_queued": BankDebitQueued, "bank_debit_returned": BankDebitReturned, + "bank_debit_succeeded": BankDebitSucceeded, } amount: Amount diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index 748fdb95f..9164b7bcc 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -34,6 +34,7 @@ class From(StripeObject): class StatusDetails(StripeObject): class Failed(StripeObject): reason: Literal[ + "payout_method_amount_limit_exceeded", "payout_method_declined", "payout_method_does_not_exist", "payout_method_expired", diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index baf4381b3..336b31fb5 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -31,7 +31,7 @@ class BankAccount(StripeObject): the /archive API, and they will not be automatically archived by Stripe. Archived PayoutMethodBankAccount objects cannot be used as payout methods and will not appear in the payout method list. """ - bank_account_type: Literal["checking", "savings"] + bank_account_type: Literal["checking", "futsu", "savings", "toza"] """ The type of bank account (checking or savings). """ diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index abcd7e4ee..5005d8fd6 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -105,12 +105,17 @@ class StatusTransitions(StripeObject): "adjustment", "currency_conversion", "inbound_transfer", + "inbound_transfer_reversal", "outbound_payment", + "outbound_payment_reversal", "outbound_transfer", + "outbound_transfer_reversal", "received_credit", + "received_credit_reversal", "received_debit", - "return", + "received_debit_reversal", "stripe_fee", + "stripe_fee_tax", ] """ Open Enum. A descriptive category used to classify the Transaction. diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index 9ddf572ce..5f7532fe0 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -81,12 +81,17 @@ class Flow(StripeObject): "adjustment", "currency_conversion", "inbound_transfer", + "inbound_transfer_reversal", "outbound_payment", + "outbound_payment_reversal", "outbound_transfer", + "outbound_transfer_reversal", "received_credit", + "received_credit_reversal", "received_debit", - "return", + "received_debit_reversal", "stripe_fee", + "stripe_fee_tax", ] """ Closed Enum for now, and will be turned into an Open Enum soon. A descriptive category used to classify the Transaction. diff --git a/stripe/v2/network/__init__.py b/stripe/v2/network/__init__.py new file mode 100644 index 000000000..4ac4b5d31 --- /dev/null +++ b/stripe/v2/network/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.network._business_profile import ( + BusinessProfile as BusinessProfile, + ) + from stripe.v2.network._business_profile_service import ( + BusinessProfileService as BusinessProfileService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "BusinessProfile": ("stripe.v2.network._business_profile", False), + "BusinessProfileService": ( + "stripe.v2.network._business_profile_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/network/_business_profile.py b/stripe/v2/network/_business_profile.py new file mode 100644 index 000000000..e4fdaf557 --- /dev/null +++ b/stripe/v2/network/_business_profile.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class BusinessProfile(StripeObject): + """ + The Stripe profile represents a business' public identity on the Stripe network. + """ + + OBJECT_NAME: ClassVar[Literal["v2.network.business_profile"]] = ( + "v2.network.business_profile" + ) + + class Branding(StripeObject): + class Icon(StripeObject): + original: str + """ + The URL of the image in its original size. + """ + + class Logo(StripeObject): + original: str + """ + The URL of the image in its original size. + """ + + icon: Optional[Icon] + """ + URL of the icon for the business. The image will be square and at least 128px x 128px. + """ + logo: Optional[Logo] + """ + URL of the logo for the business. The image will be at least 128px x 128px. + """ + primary_color: Optional[str] + """ + A CSS hex color value representing the primary branding color for this business. + """ + secondary_color: Optional[str] + """ + A CSS hex color value representing the secondary branding color for this business. + """ + _inner_class_types = {"icon": Icon, "logo": Logo} + + branding: Optional[Branding] + """ + Branding data for the business. + """ + description: Optional[str] + """ + The description of the business. + """ + display_name: str + """ + The display name of the Stripe profile. + """ + id: str + """ + The ID of the Stripe business profile; also known as the Network ID. This is the ID used to identify the business on the Stripe network. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.network.business_profile"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + url: Optional[str] + """ + The URL of the business. + """ + username: str + """ + The username of the Stripe profile. + """ + _inner_class_types = {"branding": Branding} diff --git a/stripe/v2/network/_business_profile_service.py b/stripe/v2/network/_business_profile_service.py new file mode 100644 index 000000000..50b7f7f57 --- /dev/null +++ b/stripe/v2/network/_business_profile_service.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.network._business_profile_me_params import ( + BusinessProfileMeParams, + ) + from stripe.params.v2.network._business_profile_retrieve_params import ( + BusinessProfileRetrieveParams, + ) + from stripe.v2.network._business_profile import BusinessProfile + + +class BusinessProfileService(StripeService): + def me( + self, + params: Optional["BusinessProfileMeParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve the Stripe profile associated with the requesting merchant and livemode. + """ + return cast( + "BusinessProfile", + self._request( + "get", + "/v2/network/business_profiles/me", + base_address="api", + params=params, + options=options, + ), + ) + + async def me_async( + self, + params: Optional["BusinessProfileMeParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve the Stripe profile associated with the requesting merchant and livemode. + """ + return cast( + "BusinessProfile", + await self._request_async( + "get", + "/v2/network/business_profiles/me", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["BusinessProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve a Stripe profile by its Network ID. + """ + return cast( + "BusinessProfile", + self._request( + "get", + "/v2/network/business_profiles/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["BusinessProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BusinessProfile": + """ + Retrieve a Stripe profile by its Network ID. + """ + return cast( + "BusinessProfile", + await self._request_async( + "get", + "/v2/network/business_profiles/{id}".format( + id=sanitize_id(id) + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/orchestrated_commerce/__init__.py b/stripe/v2/orchestrated_commerce/__init__.py new file mode 100644 index 000000000..12a9ea3f1 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.orchestrated_commerce._agreement import ( + Agreement as Agreement, + ) + from stripe.v2.orchestrated_commerce._agreement_service import ( + AgreementService as AgreementService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Agreement": ("stripe.v2.orchestrated_commerce._agreement", False), + "AgreementService": ( + "stripe.v2.orchestrated_commerce._agreement_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/orchestrated_commerce/_agreement.py b/stripe/v2/orchestrated_commerce/_agreement.py new file mode 100644 index 000000000..56f073d40 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/_agreement.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional +from typing_extensions import Literal + + +class Agreement(StripeObject): + """ + An Orchestrated Commerce Agreement represents a mutual agreement between a seller and an orchestrator/agent on the Stripe network. + """ + + OBJECT_NAME: ClassVar[Literal["v2.orchestrated_commerce.agreement"]] = ( + "v2.orchestrated_commerce.agreement" + ) + + class OrchestratorDetails(StripeObject): + name: str + """ + The name of the orchestrator. This can be the name of the agent or the name of the business. + """ + network_business_profile: str + """ + The Network ID of the orchestrator. + """ + + class SellerDetails(StripeObject): + network_business_profile: str + """ + The Network ID of the seller. + """ + + class StatusTransitions(StripeObject): + orchestrator_confirmed_at: Optional[str] + """ + The time at which the orchestrator confirmed the agreement. + """ + seller_confirmed_at: Optional[str] + """ + The time at which the seller confirmed the agreement. + """ + terminated_at: Optional[str] + """ + The time at which the agreement was terminated. + """ + + created: str + """ + The time at which the agreement was created. + """ + id: str + """ + The unique identifier for the agreement. + """ + initiated_by: Literal["orchestrator", "seller"] + """ + The party that initiated the agreement. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.orchestrated_commerce.agreement"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + orchestrator_details: OrchestratorDetails + """ + Details about the orchestrator. + """ + seller_details: SellerDetails + """ + Details about the seller. + """ + status: Literal[ + "confirmed", "initiated", "partially_confirmed", "terminated" + ] + """ + The current status of the agreement. + """ + status_transitions: StatusTransitions + """ + Timestamps of key status transitions for the agreement. + """ + terminated_by: Optional[Literal["orchestrator", "seller"]] + """ + The party that terminated the agreement, if applicable. + """ + _inner_class_types = { + "orchestrator_details": OrchestratorDetails, + "seller_details": SellerDetails, + "status_transitions": StatusTransitions, + } diff --git a/stripe/v2/orchestrated_commerce/_agreement_service.py b/stripe/v2/orchestrated_commerce/_agreement_service.py new file mode 100644 index 000000000..f9d442497 --- /dev/null +++ b/stripe/v2/orchestrated_commerce/_agreement_service.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.orchestrated_commerce._agreement_confirm_params import ( + AgreementConfirmParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_create_params import ( + AgreementCreateParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_list_params import ( + AgreementListParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_retrieve_params import ( + AgreementRetrieveParams, + ) + from stripe.params.v2.orchestrated_commerce._agreement_terminate_params import ( + AgreementTerminateParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.orchestrated_commerce._agreement import Agreement + + +class AgreementService(StripeService): + def list( + self, + params: Optional["AgreementListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Agreement]": + """ + List Agreements for the profile associated with the authenticated merchant. + """ + return cast( + "ListObject[Agreement]", + self._request( + "get", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["AgreementListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Agreement]": + """ + List Agreements for the profile associated with the authenticated merchant. + """ + return cast( + "ListObject[Agreement]", + await self._request_async( + "get", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "AgreementCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Create a new Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "AgreementCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Create a new Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["AgreementRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Retrieve an Agreement by ID. + """ + return cast( + "Agreement", + self._request( + "get", + "/v2/orchestrated_commerce/agreements/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["AgreementRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Retrieve an Agreement by ID. + """ + return cast( + "Agreement", + await self._request_async( + "get", + "/v2/orchestrated_commerce/agreements/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def confirm( + self, + id: str, + params: Optional["AgreementConfirmParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Confirm an Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements/{id}/confirm".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_async( + self, + id: str, + params: Optional["AgreementConfirmParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Confirm an Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements/{id}/confirm".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def terminate( + self, + id: str, + params: Optional["AgreementTerminateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Terminate an Agreement. + """ + return cast( + "Agreement", + self._request( + "post", + "/v2/orchestrated_commerce/agreements/{id}/terminate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def terminate_async( + self, + id: str, + params: Optional["AgreementTerminateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Agreement": + """ + Terminate an Agreement. + """ + return cast( + "Agreement", + await self._request_async( + "post", + "/v2/orchestrated_commerce/agreements/{id}/terminate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 760159d7e..6096f08f1 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -44241,6 +44241,74 @@ def test_v2_billing_profile_post_2_service( is_json=True, ) + def test_v2_commerce_product_catalog_import_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/commerce/product_catalog/imports", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.list() + http_client_mock.assert_requested( + "get", + path="/v2/commerce/product_catalog/imports", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_commerce_product_catalog_import_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/commerce/product_catalog/imports", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.create( + { + "feed_type": "pricing", + "metadata": {"key": "metadata"}, + "mode": "upsert", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/commerce/product_catalog/imports", + query_string="", + api_base="https://api.stripe.com", + post_data='{"feed_type":"pricing","metadata":{"key":"metadata"},"mode":"upsert"}', + is_json=True, + ) + + def test_v2_commerce_product_catalog_import_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/commerce/product_catalog/imports/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.commerce.product_catalog.imports.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/commerce/product_catalog/imports/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_account_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -44609,7 +44677,7 @@ def test_v2_core_batch_job_post_service( client.v2.core.batch_jobs.create( { "endpoint": { - "http_method": "post", + "http_method": "delete", "path": "/v1/subscription_schedules", }, "metadata": {"key": "metadata"}, @@ -44621,7 +44689,7 @@ def test_v2_core_batch_job_post_service( path="/v2/core/batch_jobs", query_string="", api_base="https://api.stripe.com", - post_data='{"endpoint":{"http_method":"post","path":"/v1/subscription_schedules"},"metadata":{"key":"metadata"},"skip_validation":true}', + post_data='{"endpoint":{"http_method":"delete","path":"/v1/subscription_schedules"},"metadata":{"key":"metadata"},"skip_validation":true}', is_json=True, ) @@ -45171,6 +45239,185 @@ def test_v2_core_vault_us_bank_account_post_5_service( is_json=True, ) + def test_v2_data_reporting_query_run_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/data/reporting/query_runs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.data.reporting.query_runs.create({"sql": "sql"}) + http_client_mock.assert_requested( + "post", + path="/v2/data/reporting/query_runs", + query_string="", + api_base="https://api.stripe.com", + post_data='{"sql":"sql"}', + is_json=True, + ) + + def test_v2_data_reporting_query_run_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/data/reporting/query_runs/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.data.reporting.query_runs.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/data/reporting/query_runs/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_extend_workflow_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/extend/workflows", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflows.list() + http_client_mock.assert_requested( + "get", + path="/v2/extend/workflows", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_extend_workflow_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/extend/workflows/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflows.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/extend/workflows/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_extend_workflow_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/extend/workflows/id_123/invoke", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflows.invoke( + "id_123", + { + "input_parameters": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v2/extend/workflows/id_123/invoke", + query_string="", + api_base="https://api.stripe.com", + post_data='{"input_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', + is_json=True, + ) + + def test_v2_extend_workflow_run_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/extend/workflow_runs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflow_runs.list() + http_client_mock.assert_requested( + "get", + path="/v2/extend/workflow_runs", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_extend_workflow_run_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/extend/workflow_runs/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.extend.workflow_runs.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/extend/workflow_runs/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_iam_activity_log_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/iam/activity_logs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.iam.activity_logs.list() + http_client_mock.assert_requested( + "get", + path="/v2/iam/activity_logs", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_money_management_adjustment_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46077,6 +46324,156 @@ def test_v2_money_management_transaction_entry_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_network_business_profile_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/network/business_profiles/me", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.network.business_profiles.me() + http_client_mock.assert_requested( + "get", + path="/v2/network/business_profiles/me", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_network_business_profile_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/network/business_profiles/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.network.business_profiles.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/network/business_profiles/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/orchestrated_commerce/agreements", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.list() + http_client_mock.assert_requested( + "get", + path="/v2/orchestrated_commerce/agreements", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.create( + { + "orchestrator": "orchestrator", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements", + query_string="", + api_base="https://api.stripe.com", + post_data='{"orchestrator":"orchestrator"}', + is_json=True, + ) + + def test_v2_orchestrated_commerce_agreement_get_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/orchestrated_commerce/agreements/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/orchestrated_commerce/agreements/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_orchestrated_commerce_agreement_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements/id_123/confirm", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.confirm("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements/id_123/confirm", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_orchestrated_commerce_agreement_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/orchestrated_commerce/agreements/id_123/terminate", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.orchestrated_commerce.agreements.terminate("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/orchestrated_commerce/agreements/id_123/terminate", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_test_helpers_financial_address_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -46216,6 +46613,48 @@ def test_blocked_by_stripe_error_service( is_json=True, ) + def test_cannot_proceed_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/extend/workflows/id_123/invoke", + rbody='{"error":{"type":"cannot_proceed","code":"default_payout_method_cannot_be_archived"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.extend.workflows.invoke( + "id_123", + { + "input_parameters": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + }, + ) + except _error.CannotProceedError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/extend/workflows/id_123/invoke", + query_string="", + api_base="https://api.stripe.com", + post_data='{"input_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', + is_json=True, + ) + def test_controlled_by_alternate_resource_error_service( self, http_client_mock: HTTPClientMock ) -> None: