From 1082ed3ef89c404f55892f7a1cb44380395c1dca Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:17:41 +0000 Subject: [PATCH] Update generated code for v2132 and --- API_VERSION | 2 +- stripe/events/__init__.py | 72 +++++++++++++++++++ stripe/events/_event_classes.py | 72 +++++++++++++++++++ .../events/_v2_iam_api_key_created_event.py | 29 ++++++++ ...m_api_key_default_secret_revealed_event.py | 31 ++++++++ .../events/_v2_iam_api_key_expired_event.py | 29 ++++++++ ...2_iam_api_key_permissions_updated_event.py | 29 ++++++++ .../events/_v2_iam_api_key_rotated_event.py | 70 ++++++++++++++++++ .../events/_v2_iam_api_key_updated_event.py | 29 ++++++++ 9 files changed, 362 insertions(+), 1 deletion(-) create mode 100644 stripe/events/_v2_iam_api_key_created_event.py create mode 100644 stripe/events/_v2_iam_api_key_default_secret_revealed_event.py create mode 100644 stripe/events/_v2_iam_api_key_expired_event.py create mode 100644 stripe/events/_v2_iam_api_key_permissions_updated_event.py create mode 100644 stripe/events/_v2_iam_api_key_rotated_event.py create mode 100644 stripe/events/_v2_iam_api_key_updated_event.py diff --git a/API_VERSION b/API_VERSION index 0d5c06d24..33ba69815 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -1307ab81356642fb1bf890524815d5cb6997a34d \ No newline at end of file +ffe4efab9b5dec59fea6b69a94f4b024fa7cf992 \ No newline at end of file diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index a18a80621..0978cd87c 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -345,6 +345,30 @@ V2CoreHealthWebhookLatencyResolvedEvent as V2CoreHealthWebhookLatencyResolvedEvent, V2CoreHealthWebhookLatencyResolvedEventNotification as V2CoreHealthWebhookLatencyResolvedEventNotification, ) + from stripe.events._v2_iam_api_key_created_event import ( + V2IamApiKeyCreatedEvent as V2IamApiKeyCreatedEvent, + V2IamApiKeyCreatedEventNotification as V2IamApiKeyCreatedEventNotification, + ) + from stripe.events._v2_iam_api_key_default_secret_revealed_event import ( + V2IamApiKeyDefaultSecretRevealedEvent as V2IamApiKeyDefaultSecretRevealedEvent, + V2IamApiKeyDefaultSecretRevealedEventNotification as V2IamApiKeyDefaultSecretRevealedEventNotification, + ) + from stripe.events._v2_iam_api_key_expired_event import ( + V2IamApiKeyExpiredEvent as V2IamApiKeyExpiredEvent, + V2IamApiKeyExpiredEventNotification as V2IamApiKeyExpiredEventNotification, + ) + from stripe.events._v2_iam_api_key_permissions_updated_event import ( + V2IamApiKeyPermissionsUpdatedEvent as V2IamApiKeyPermissionsUpdatedEvent, + V2IamApiKeyPermissionsUpdatedEventNotification as V2IamApiKeyPermissionsUpdatedEventNotification, + ) + from stripe.events._v2_iam_api_key_rotated_event import ( + V2IamApiKeyRotatedEvent as V2IamApiKeyRotatedEvent, + V2IamApiKeyRotatedEventNotification as V2IamApiKeyRotatedEventNotification, + ) + from stripe.events._v2_iam_api_key_updated_event import ( + V2IamApiKeyUpdatedEvent as V2IamApiKeyUpdatedEvent, + V2IamApiKeyUpdatedEventNotification as V2IamApiKeyUpdatedEventNotification, + ) from stripe.events._v2_money_management_adjustment_created_event import ( V2MoneyManagementAdjustmentCreatedEvent as V2MoneyManagementAdjustmentCreatedEvent, V2MoneyManagementAdjustmentCreatedEventNotification as V2MoneyManagementAdjustmentCreatedEventNotification, @@ -1213,6 +1237,54 @@ "stripe.events._v2_core_health_webhook_latency_resolved_event", False, ), + "V2IamApiKeyCreatedEvent": ( + "stripe.events._v2_iam_api_key_created_event", + False, + ), + "V2IamApiKeyCreatedEventNotification": ( + "stripe.events._v2_iam_api_key_created_event", + False, + ), + "V2IamApiKeyDefaultSecretRevealedEvent": ( + "stripe.events._v2_iam_api_key_default_secret_revealed_event", + False, + ), + "V2IamApiKeyDefaultSecretRevealedEventNotification": ( + "stripe.events._v2_iam_api_key_default_secret_revealed_event", + False, + ), + "V2IamApiKeyExpiredEvent": ( + "stripe.events._v2_iam_api_key_expired_event", + False, + ), + "V2IamApiKeyExpiredEventNotification": ( + "stripe.events._v2_iam_api_key_expired_event", + False, + ), + "V2IamApiKeyPermissionsUpdatedEvent": ( + "stripe.events._v2_iam_api_key_permissions_updated_event", + False, + ), + "V2IamApiKeyPermissionsUpdatedEventNotification": ( + "stripe.events._v2_iam_api_key_permissions_updated_event", + False, + ), + "V2IamApiKeyRotatedEvent": ( + "stripe.events._v2_iam_api_key_rotated_event", + False, + ), + "V2IamApiKeyRotatedEventNotification": ( + "stripe.events._v2_iam_api_key_rotated_event", + False, + ), + "V2IamApiKeyUpdatedEvent": ( + "stripe.events._v2_iam_api_key_updated_event", + False, + ), + "V2IamApiKeyUpdatedEventNotification": ( + "stripe.events._v2_iam_api_key_updated_event", + False, + ), "V2MoneyManagementAdjustmentCreatedEvent": ( "stripe.events._v2_money_management_adjustment_created_event", False, diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 830235043..1a34cdb5f 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -256,6 +256,24 @@ from stripe.events._v2_core_health_webhook_latency_resolved_event import ( V2CoreHealthWebhookLatencyResolvedEventNotification, ) + from stripe.events._v2_iam_api_key_created_event import ( + V2IamApiKeyCreatedEventNotification, + ) + from stripe.events._v2_iam_api_key_default_secret_revealed_event import ( + V2IamApiKeyDefaultSecretRevealedEventNotification, + ) + from stripe.events._v2_iam_api_key_expired_event import ( + V2IamApiKeyExpiredEventNotification, + ) + from stripe.events._v2_iam_api_key_permissions_updated_event import ( + V2IamApiKeyPermissionsUpdatedEventNotification, + ) + from stripe.events._v2_iam_api_key_rotated_event import ( + V2IamApiKeyRotatedEventNotification, + ) + from stripe.events._v2_iam_api_key_updated_event import ( + V2IamApiKeyUpdatedEventNotification, + ) from stripe.events._v2_money_management_adjustment_created_event import ( V2MoneyManagementAdjustmentCreatedEventNotification, ) @@ -741,6 +759,30 @@ "stripe.events._v2_core_health_webhook_latency_resolved_event", "V2CoreHealthWebhookLatencyResolvedEvent", ), + "v2.iam.api_key.created": ( + "stripe.events._v2_iam_api_key_created_event", + "V2IamApiKeyCreatedEvent", + ), + "v2.iam.api_key.default_secret_revealed": ( + "stripe.events._v2_iam_api_key_default_secret_revealed_event", + "V2IamApiKeyDefaultSecretRevealedEvent", + ), + "v2.iam.api_key.expired": ( + "stripe.events._v2_iam_api_key_expired_event", + "V2IamApiKeyExpiredEvent", + ), + "v2.iam.api_key.permissions_updated": ( + "stripe.events._v2_iam_api_key_permissions_updated_event", + "V2IamApiKeyPermissionsUpdatedEvent", + ), + "v2.iam.api_key.rotated": ( + "stripe.events._v2_iam_api_key_rotated_event", + "V2IamApiKeyRotatedEvent", + ), + "v2.iam.api_key.updated": ( + "stripe.events._v2_iam_api_key_updated_event", + "V2IamApiKeyUpdatedEvent", + ), "v2.money_management.adjustment.created": ( "stripe.events._v2_money_management_adjustment_created_event", "V2MoneyManagementAdjustmentCreatedEvent", @@ -1288,6 +1330,30 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_health_webhook_latency_resolved_event", "V2CoreHealthWebhookLatencyResolvedEventNotification", ), + "v2.iam.api_key.created": ( + "stripe.events._v2_iam_api_key_created_event", + "V2IamApiKeyCreatedEventNotification", + ), + "v2.iam.api_key.default_secret_revealed": ( + "stripe.events._v2_iam_api_key_default_secret_revealed_event", + "V2IamApiKeyDefaultSecretRevealedEventNotification", + ), + "v2.iam.api_key.expired": ( + "stripe.events._v2_iam_api_key_expired_event", + "V2IamApiKeyExpiredEventNotification", + ), + "v2.iam.api_key.permissions_updated": ( + "stripe.events._v2_iam_api_key_permissions_updated_event", + "V2IamApiKeyPermissionsUpdatedEventNotification", + ), + "v2.iam.api_key.rotated": ( + "stripe.events._v2_iam_api_key_rotated_event", + "V2IamApiKeyRotatedEventNotification", + ), + "v2.iam.api_key.updated": ( + "stripe.events._v2_iam_api_key_updated_event", + "V2IamApiKeyUpdatedEventNotification", + ), "v2.money_management.adjustment.created": ( "stripe.events._v2_money_management_adjustment_created_event", "V2MoneyManagementAdjustmentCreatedEventNotification", @@ -1586,6 +1652,12 @@ def get_v2_event_notification_class(type_: str): "V2CoreHealthTrafficVolumeDropResolvedEventNotification", "V2CoreHealthWebhookLatencyFiringEventNotification", "V2CoreHealthWebhookLatencyResolvedEventNotification", + "V2IamApiKeyCreatedEventNotification", + "V2IamApiKeyDefaultSecretRevealedEventNotification", + "V2IamApiKeyExpiredEventNotification", + "V2IamApiKeyPermissionsUpdatedEventNotification", + "V2IamApiKeyRotatedEventNotification", + "V2IamApiKeyUpdatedEventNotification", "V2MoneyManagementAdjustmentCreatedEventNotification", "V2MoneyManagementFinancialAccountCreatedEventNotification", "V2MoneyManagementFinancialAccountUpdatedEventNotification", diff --git a/stripe/events/_v2_iam_api_key_created_event.py b/stripe/events/_v2_iam_api_key_created_event.py new file mode 100644 index 000000000..70fe7aa14 --- /dev/null +++ b/stripe/events/_v2_iam_api_key_created_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V2IamApiKeyCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.created" + type: Literal["v2.iam.api_key.created"] + + @override + def fetch_event(self) -> "V2IamApiKeyCreatedEvent": + return cast( + "V2IamApiKeyCreatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V2IamApiKeyCreatedEvent": + return cast( + "V2IamApiKeyCreatedEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyCreatedEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.created" + type: Literal["v2.iam.api_key.created"] diff --git a/stripe/events/_v2_iam_api_key_default_secret_revealed_event.py b/stripe/events/_v2_iam_api_key_default_secret_revealed_event.py new file mode 100644 index 000000000..bdf9f07ff --- /dev/null +++ b/stripe/events/_v2_iam_api_key_default_secret_revealed_event.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V2IamApiKeyDefaultSecretRevealedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.default_secret_revealed" + type: Literal["v2.iam.api_key.default_secret_revealed"] + + @override + def fetch_event(self) -> "V2IamApiKeyDefaultSecretRevealedEvent": + return cast( + "V2IamApiKeyDefaultSecretRevealedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2IamApiKeyDefaultSecretRevealedEvent": + return cast( + "V2IamApiKeyDefaultSecretRevealedEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyDefaultSecretRevealedEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.default_secret_revealed" + type: Literal["v2.iam.api_key.default_secret_revealed"] diff --git a/stripe/events/_v2_iam_api_key_expired_event.py b/stripe/events/_v2_iam_api_key_expired_event.py new file mode 100644 index 000000000..a45e99a9b --- /dev/null +++ b/stripe/events/_v2_iam_api_key_expired_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V2IamApiKeyExpiredEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.expired" + type: Literal["v2.iam.api_key.expired"] + + @override + def fetch_event(self) -> "V2IamApiKeyExpiredEvent": + return cast( + "V2IamApiKeyExpiredEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V2IamApiKeyExpiredEvent": + return cast( + "V2IamApiKeyExpiredEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyExpiredEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.expired" + type: Literal["v2.iam.api_key.expired"] diff --git a/stripe/events/_v2_iam_api_key_permissions_updated_event.py b/stripe/events/_v2_iam_api_key_permissions_updated_event.py new file mode 100644 index 000000000..352b10052 --- /dev/null +++ b/stripe/events/_v2_iam_api_key_permissions_updated_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V2IamApiKeyPermissionsUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.permissions_updated" + type: Literal["v2.iam.api_key.permissions_updated"] + + @override + def fetch_event(self) -> "V2IamApiKeyPermissionsUpdatedEvent": + return cast( + "V2IamApiKeyPermissionsUpdatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V2IamApiKeyPermissionsUpdatedEvent": + return cast( + "V2IamApiKeyPermissionsUpdatedEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyPermissionsUpdatedEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.permissions_updated" + type: Literal["v2.iam.api_key.permissions_updated"] diff --git a/stripe/events/_v2_iam_api_key_rotated_event.py b/stripe/events/_v2_iam_api_key_rotated_event.py new file mode 100644 index 000000000..1b96f6745 --- /dev/null +++ b/stripe/events/_v2_iam_api_key_rotated_event.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_mode import ApiMode +from stripe._stripe_object import StripeObject +from stripe._stripe_response import StripeResponse +from stripe.v2.core._event import Event, EventNotification +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._api_requestor import _APIRequestor + + +class V2IamApiKeyRotatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.rotated" + type: Literal["v2.iam.api_key.rotated"] + + @override + def fetch_event(self) -> "V2IamApiKeyRotatedEvent": + return cast( + "V2IamApiKeyRotatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V2IamApiKeyRotatedEvent": + return cast( + "V2IamApiKeyRotatedEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyRotatedEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.rotated" + type: Literal["v2.iam.api_key.rotated"] + + class V2IamApiKeyRotatedEventData(StripeObject): + new_api_key: str + """ + ID of the new key that was created due to rotation. + """ + + data: V2IamApiKeyRotatedEventData + """ + Data for the v2.iam.api_key.rotated event + """ + + @classmethod + def _construct_from( + cls, + *, + values: Dict[str, Any], + last_response: Optional[StripeResponse] = None, + requestor: "_APIRequestor", + api_mode: ApiMode, + ) -> "V2IamApiKeyRotatedEvent": + evt = super()._construct_from( + values=values, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + if hasattr(evt, "data"): + evt.data = V2IamApiKeyRotatedEvent.V2IamApiKeyRotatedEventData._construct_from( + values=evt.data, + last_response=last_response, + requestor=requestor, + api_mode=api_mode, + ) + return evt diff --git a/stripe/events/_v2_iam_api_key_updated_event.py b/stripe/events/_v2_iam_api_key_updated_event.py new file mode 100644 index 000000000..e435df1cf --- /dev/null +++ b/stripe/events/_v2_iam_api_key_updated_event.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe.v2.core._event import Event, EventNotification +from typing import cast +from typing_extensions import Literal, override + + +class V2IamApiKeyUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.iam.api_key.updated" + type: Literal["v2.iam.api_key.updated"] + + @override + def fetch_event(self) -> "V2IamApiKeyUpdatedEvent": + return cast( + "V2IamApiKeyUpdatedEvent", + super().fetch_event(), + ) + + @override + async def fetch_event_async(self) -> "V2IamApiKeyUpdatedEvent": + return cast( + "V2IamApiKeyUpdatedEvent", + await super().fetch_event_async(), + ) + + +class V2IamApiKeyUpdatedEvent(Event): + LOOKUP_TYPE = "v2.iam.api_key.updated" + type: Literal["v2.iam.api_key.updated"]