diff options
author | Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> | 2025-04-02 09:56:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-02 09:56:00 -0700 |
commit | 201a84290891b7f6c5567e1ef2495b25853328e0 (patch) | |
tree | 5e2ecde3e17f2662939fd129798cb39829e33b48 | |
parent | 95624863e1f9d18dc5dd8e80000bb3692c7ab8fc (diff) |
Fix event names and related objects (#1483)
19 files changed, 443 insertions, 190 deletions
diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 3537394c..05cb2beb 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -5620,7 +5620,6 @@ class Invoice( The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ status_transitions: StatusTransitions - subscription: Optional[ExpandableField["Subscription"]] subtotal: int """ Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 4d727140..98202dd6 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -2363,7 +2363,7 @@ class Subscription( """ A date in the future at which the subscription will automatically get canceled """ - cancel_at_period_end: Optional[bool] + cancel_at_period_end: bool """ Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index 3b43ecbf..973bc3b3 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -6,26 +6,29 @@ from stripe.events._v1_billing_meter_error_report_triggered_event import ( from stripe.events._v1_billing_meter_no_meter_found_event import ( V1BillingMeterNoMeterFoundEvent as V1BillingMeterNoMeterFoundEvent, ) -from stripe.events._v2_core_account_configuration_customer_capability_status_updated_event import ( - V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent as V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_customer_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_customer_updated_event import ( - V2CoreAccountConfigurationCustomerUpdatedEvent as V2CoreAccountConfigurationCustomerUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_customer_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent as V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_merchant_capability_status_updated_event import ( - V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent as V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_merchant_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_merchant_updated_event import ( - V2CoreAccountConfigurationMerchantUpdatedEvent as V2CoreAccountConfigurationMerchantUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_merchant_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent as V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_recipient_capability_status_updated_event import ( - V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent as V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_recipient_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent as V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_recipient_updated_event import ( - V2CoreAccountConfigurationRecipientUpdatedEvent as V2CoreAccountConfigurationRecipientUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_recipient_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent as V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, ) -from stripe.events._v2_core_account_identity_updated_event import ( - V2CoreAccountIdentityUpdatedEvent as V2CoreAccountIdentityUpdatedEvent, +from stripe.events._v2_core_account_including_identity_updated_event import ( + V2CoreAccountIncludingIdentityUpdatedEvent as V2CoreAccountIncludingIdentityUpdatedEvent, +) +from stripe.events._v2_core_account_including_requirements_updated_event import ( + V2CoreAccountIncludingRequirementsUpdatedEvent as V2CoreAccountIncludingRequirementsUpdatedEvent, ) from stripe.events._v2_core_account_link_completed_event import ( V2CoreAccountLinkCompletedEvent as V2CoreAccountLinkCompletedEvent, @@ -39,9 +42,6 @@ from stripe.events._v2_core_account_person_deleted_event import ( from stripe.events._v2_core_account_person_updated_event import ( V2CoreAccountPersonUpdatedEvent as V2CoreAccountPersonUpdatedEvent, ) -from stripe.events._v2_core_account_requirements_updated_event import ( - V2CoreAccountRequirementsUpdatedEvent as V2CoreAccountRequirementsUpdatedEvent, -) from stripe.events._v2_money_management_financial_account_created_event import ( V2MoneyManagementFinancialAccountCreatedEvent as V2MoneyManagementFinancialAccountCreatedEvent, ) diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index d50ebc26..3f5868ff 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -1,19 +1,19 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe.events._v2_core_account_requirements_updated_event import ( - V2CoreAccountRequirementsUpdatedEvent, +from stripe.events._v2_core_account_including_requirements_updated_event import ( + V2CoreAccountIncludingRequirementsUpdatedEvent, ) from stripe.events._v2_core_account_link_completed_event import ( V2CoreAccountLinkCompletedEvent, ) -from stripe.events._v2_core_account_configuration_customer_capability_status_updated_event import ( - V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_customer_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_customer_updated_event import ( - V2CoreAccountConfigurationCustomerUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_customer_updated_event import ( + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, ) -from stripe.events._v2_core_account_identity_updated_event import ( - V2CoreAccountIdentityUpdatedEvent, +from stripe.events._v2_core_account_including_identity_updated_event import ( + V2CoreAccountIncludingIdentityUpdatedEvent, ) from stripe.events._v2_core_account_person_created_event import ( V2CoreAccountPersonCreatedEvent, @@ -24,17 +24,17 @@ from stripe.events._v2_core_account_person_deleted_event import ( from stripe.events._v2_core_account_person_updated_event import ( V2CoreAccountPersonUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_merchant_capability_status_updated_event import ( - V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_merchant_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_merchant_updated_event import ( - V2CoreAccountConfigurationMerchantUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_merchant_updated_event import ( + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_recipient_capability_status_updated_event import ( - V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_recipient_capability_status_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, ) -from stripe.events._v2_core_account_configuration_recipient_updated_event import ( - V2CoreAccountConfigurationRecipientUpdatedEvent, +from stripe.events._v2_core_account_including_configuration_recipient_updated_event import ( + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, ) from stripe.events._v1_billing_meter_error_report_triggered_event import ( V1BillingMeterErrorReportTriggeredEvent, @@ -131,18 +131,18 @@ from stripe.events._v2_money_management_received_debit_updated_event import ( THIN_EVENT_CLASSES = { V1BillingMeterErrorReportTriggeredEvent.LOOKUP_TYPE: V1BillingMeterErrorReportTriggeredEvent, V1BillingMeterNoMeterFoundEvent.LOOKUP_TYPE: V1BillingMeterNoMeterFoundEvent, - V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent, - V2CoreAccountConfigurationCustomerUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationCustomerUpdatedEvent, - V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent, - V2CoreAccountConfigurationMerchantUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationMerchantUpdatedEvent, - V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent, - V2CoreAccountConfigurationRecipientUpdatedEvent.LOOKUP_TYPE: V2CoreAccountConfigurationRecipientUpdatedEvent, - V2CoreAccountIdentityUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIdentityUpdatedEvent, + V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationCustomerUpdatedEvent, + V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationMerchantUpdatedEvent, + V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent, + V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingConfigurationRecipientUpdatedEvent, + V2CoreAccountIncludingIdentityUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingIdentityUpdatedEvent, + V2CoreAccountIncludingRequirementsUpdatedEvent.LOOKUP_TYPE: V2CoreAccountIncludingRequirementsUpdatedEvent, V2CoreAccountLinkCompletedEvent.LOOKUP_TYPE: V2CoreAccountLinkCompletedEvent, V2CoreAccountPersonCreatedEvent.LOOKUP_TYPE: V2CoreAccountPersonCreatedEvent, V2CoreAccountPersonDeletedEvent.LOOKUP_TYPE: V2CoreAccountPersonDeletedEvent, V2CoreAccountPersonUpdatedEvent.LOOKUP_TYPE: V2CoreAccountPersonUpdatedEvent, - V2CoreAccountRequirementsUpdatedEvent.LOOKUP_TYPE: V2CoreAccountRequirementsUpdatedEvent, V2MoneyManagementFinancialAccountCreatedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAccountCreatedEvent, V2MoneyManagementFinancialAddressActivatedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAddressActivatedEvent, V2MoneyManagementFinancialAddressFailedEvent.LOOKUP_TYPE: V2MoneyManagementFinancialAddressFailedEvent, diff --git a/stripe/events/_v2_core_account_configuration_customer_capability_status_updated_event.py b/stripe/events/_v2_core_account_configuration_customer_capability_status_updated_event.py deleted file mode 100644 index 331575c0..00000000 --- a/stripe/events/_v2_core_account_configuration_customer_capability_status_updated_event.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._api_mode import ApiMode -from stripe._api_requestor import _APIRequestor -from stripe._stripe_object import StripeObject -from stripe._stripe_response import StripeResponse -from stripe.v2._event import Event -from typing import Any, Dict, Optional -from typing_extensions import Literal - - -class V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent(Event): - LOOKUP_TYPE = ( - "v2.core.account[configuration.customer].capability_status_updated" - ) - type: Literal[ - "v2.core.account[configuration.customer].capability_status_updated" - ] - - class V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEventData( - StripeObject, - ): - updated_capability: Literal["automatic_indirect_tax"] - """ - Open Enum. The capability which had its status updated. - """ - - data: V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEventData - """ - Data for the v2.core.account[configuration.customer].capability_status_updated event - """ - - @classmethod - def _construct_from( - cls, - *, - values: Dict[str, Any], - last_response: Optional[StripeResponse] = None, - requestor: "_APIRequestor", - api_mode: ApiMode, - ) -> "V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent": - evt = super()._construct_from( - values=values, - last_response=last_response, - requestor=requestor, - api_mode=api_mode, - ) - if hasattr(evt, "data"): - evt.data = V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEvent.V2CoreAccountConfigurationCustomerCapabilityStatusUpdatedEventData._construct_from( - values=evt.data, - last_response=last_response, - requestor=requestor, - api_mode=api_mode, - ) - return evt diff --git a/stripe/events/_v2_core_account_configuration_customer_updated_event.py b/stripe/events/_v2_core_account_configuration_customer_updated_event.py deleted file mode 100644 index 8a61ea36..00000000 --- a/stripe/events/_v2_core_account_configuration_customer_updated_event.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe.v2._event import Event -from typing_extensions import Literal - - -class V2CoreAccountConfigurationCustomerUpdatedEvent(Event): - LOOKUP_TYPE = "v2.core.account[configuration.customer].updated" - type: Literal["v2.core.account[configuration.customer].updated"] diff --git a/stripe/events/_v2_core_account_configuration_merchant_updated_event.py b/stripe/events/_v2_core_account_configuration_merchant_updated_event.py deleted file mode 100644 index f223d3c2..00000000 --- a/stripe/events/_v2_core_account_configuration_merchant_updated_event.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe.v2._event import Event -from typing_extensions import Literal - - -class V2CoreAccountConfigurationMerchantUpdatedEvent(Event): - LOOKUP_TYPE = "v2.core.account[configuration.merchant].updated" - type: Literal["v2.core.account[configuration.merchant].updated"] diff --git a/stripe/events/_v2_core_account_configuration_recipient_updated_event.py b/stripe/events/_v2_core_account_configuration_recipient_updated_event.py deleted file mode 100644 index 102238a4..00000000 --- a/stripe/events/_v2_core_account_configuration_recipient_updated_event.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe.v2._event import Event -from typing_extensions import Literal - - -class V2CoreAccountConfigurationRecipientUpdatedEvent(Event): - LOOKUP_TYPE = "v2.core.account[configuration.recipient].updated" - type: Literal["v2.core.account[configuration.recipient].updated"] diff --git a/stripe/events/_v2_core_account_identity_updated_event.py b/stripe/events/_v2_core_account_identity_updated_event.py deleted file mode 100644 index a8d1205f..00000000 --- a/stripe/events/_v2_core_account_identity_updated_event.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe.v2._event import Event -from typing_extensions import Literal - - -class V2CoreAccountIdentityUpdatedEvent(Event): - LOOKUP_TYPE = "v2.core.account[identity].updated" - type: Literal["v2.core.account[identity].updated"] diff --git a/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py new file mode 100644 index 00000000..ef5b703f --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._api_requestor import _APIRequestor +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent( + Event, +): + LOOKUP_TYPE = ( + "v2.core.account[configuration.customer].capability_status_updated" + ) + type: Literal[ + "v2.core.account[configuration.customer].capability_status_updated" + ] + + class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData( + StripeObject, + ): + updated_capability: Literal["automatic_indirect_tax"] + """ + Open Enum. The capability which had its status updated. + """ + + data: V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData + """ + Data for the v2.core.account[configuration.customer].capability_status_updated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData._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) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py new file mode 100644 index 00000000..be57e9f9 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_customer_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.customer].updated" + type: Literal["v2.core.account[configuration.customer].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_configuration_merchant_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py index 765bc47c..ad68322f 100644 --- a/stripe/events/_v2_core_account_configuration_merchant_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py @@ -5,11 +5,14 @@ from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2._event import Event -from typing import Any, Dict, Optional +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast from typing_extensions import Literal -class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent(Event): +class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent( + Event, +): LOOKUP_TYPE = ( "v2.core.account[configuration.merchant].capability_status_updated" ) @@ -17,7 +20,7 @@ class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent(Event): "v2.core.account[configuration.merchant].capability_status_updated" ] - class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEventData( + class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData( StripeObject, ): updated_capability: Literal[ @@ -70,7 +73,7 @@ class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent(Event): Open Enum. The capability which had its status updated. """ - data: V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEventData + data: V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData """ Data for the v2.core.account[configuration.merchant].capability_status_updated event """ @@ -83,7 +86,7 @@ class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent(Event): last_response: Optional[StripeResponse] = None, requestor: "_APIRequestor", api_mode: ApiMode, - ) -> "V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent": + ) -> "V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent": evt = super()._construct_from( values=values, last_response=last_response, @@ -91,10 +94,43 @@ class V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent(Event): api_mode=api_mode, ) if hasattr(evt, "data"): - evt.data = V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEvent.V2CoreAccountConfigurationMerchantCapabilityStatusUpdatedEventData._construct_from( + evt.data = V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData._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) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py new file mode 100644 index 00000000..368b5d25 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_merchant_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.merchant].updated" + type: Literal["v2.core.account[configuration.merchant].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_configuration_recipient_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py index ecd6a68d..f5d47dfa 100644 --- a/stripe/events/_v2_core_account_configuration_recipient_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py @@ -5,11 +5,14 @@ from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2._event import Event -from typing import Any, Dict, Optional +from stripe.v2.core._account import Account +from typing import Any, Dict, Optional, cast from typing_extensions import Literal -class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent(Event): +class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent( + Event, +): LOOKUP_TYPE = ( "v2.core.account[configuration.recipient].capability_status_updated" ) @@ -17,7 +20,7 @@ class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent(Event): "v2.core.account[configuration.recipient].capability_status_updated" ] - class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEventData( + class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData( StripeObject, ): updated_capability: Literal[ @@ -35,7 +38,7 @@ class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent(Event): Open Enum. The capability which had its status updated. """ - data: V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEventData + data: V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData """ Data for the v2.core.account[configuration.recipient].capability_status_updated event """ @@ -48,7 +51,7 @@ class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent(Event): last_response: Optional[StripeResponse] = None, requestor: "_APIRequestor", api_mode: ApiMode, - ) -> "V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent": + ) -> "V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent": evt = super()._construct_from( values=values, last_response=last_response, @@ -56,10 +59,43 @@ class V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent(Event): api_mode=api_mode, ) if hasattr(evt, "data"): - evt.data = V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEvent.V2CoreAccountConfigurationRecipientCapabilityStatusUpdatedEventData._construct_from( + evt.data = V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData._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) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py b/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py new file mode 100644 index 00000000..faa56540 --- /dev/null +++ b/stripe/events/_v2_core_account_including_configuration_recipient_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[configuration.recipient].updated" + type: Literal["v2.core.account[configuration.recipient].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_identity_updated_event.py b/stripe/events/_v2_core_account_including_identity_updated_event.py new file mode 100644 index 00000000..dc9b4966 --- /dev/null +++ b/stripe/events/_v2_core_account_including_identity_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingIdentityUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[identity].updated" + type: Literal["v2.core.account[identity].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_including_requirements_updated_event.py b/stripe/events/_v2_core_account_including_requirements_updated_event.py new file mode 100644 index 00000000..c4517141 --- /dev/null +++ b/stripe/events/_v2_core_account_including_requirements_updated_event.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe.v2._event import Event +from stripe.v2.core._account import Account +from typing import cast +from typing_extensions import Literal + + +class V2CoreAccountIncludingRequirementsUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.account[requirements].updated" + type: Literal["v2.core.account[requirements].updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> Account: + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + Account, + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={"stripe_account": self.context}, + ), + ) diff --git a/stripe/events/_v2_core_account_link_completed_event.py b/stripe/events/_v2_core_account_link_completed_event.py index da57e35c..f03013c9 100644 --- a/stripe/events/_v2_core_account_link_completed_event.py +++ b/stripe/events/_v2_core_account_link_completed_event.py @@ -5,8 +5,7 @@ from stripe._api_requestor import _APIRequestor from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2._event import Event -from stripe.v2.core._account_link import AccountLink -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, Optional from typing_extensions import Literal @@ -56,36 +55,3 @@ class V2CoreAccountLinkCompletedEvent(Event): 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) -> AccountLink: - """ - Retrieves the related object from the API. Makes an API request on every call. - """ - return cast( - AccountLink, - self._requestor.request( - "get", - self.related_object.url, - base_address="api", - options={"stripe_account": self.context}, - ), - ) diff --git a/stripe/events/_v2_core_account_requirements_updated_event.py b/stripe/events/_v2_core_account_requirements_updated_event.py deleted file mode 100644 index 1bba7da0..00000000 --- a/stripe/events/_v2_core_account_requirements_updated_event.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe.v2._event import Event -from typing_extensions import Literal - - -class V2CoreAccountRequirementsUpdatedEvent(Event): - LOOKUP_TYPE = "v2.core.account[requirements].updated" - type: Literal["v2.core.account[requirements].updated"] |