Skip to content

Commit a6a82c9

Browse files
Merge pull request #1691 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents 9e16a73 + 1082ed3 commit a6a82c9

9 files changed

+362
-1
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1307ab81356642fb1bf890524815d5cb6997a34d
1+
ffe4efab9b5dec59fea6b69a94f4b024fa7cf992

stripe/events/__init__.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,30 @@
345345
V2CoreHealthWebhookLatencyResolvedEvent as V2CoreHealthWebhookLatencyResolvedEvent,
346346
V2CoreHealthWebhookLatencyResolvedEventNotification as V2CoreHealthWebhookLatencyResolvedEventNotification,
347347
)
348+
from stripe.events._v2_iam_api_key_created_event import (
349+
V2IamApiKeyCreatedEvent as V2IamApiKeyCreatedEvent,
350+
V2IamApiKeyCreatedEventNotification as V2IamApiKeyCreatedEventNotification,
351+
)
352+
from stripe.events._v2_iam_api_key_default_secret_revealed_event import (
353+
V2IamApiKeyDefaultSecretRevealedEvent as V2IamApiKeyDefaultSecretRevealedEvent,
354+
V2IamApiKeyDefaultSecretRevealedEventNotification as V2IamApiKeyDefaultSecretRevealedEventNotification,
355+
)
356+
from stripe.events._v2_iam_api_key_expired_event import (
357+
V2IamApiKeyExpiredEvent as V2IamApiKeyExpiredEvent,
358+
V2IamApiKeyExpiredEventNotification as V2IamApiKeyExpiredEventNotification,
359+
)
360+
from stripe.events._v2_iam_api_key_permissions_updated_event import (
361+
V2IamApiKeyPermissionsUpdatedEvent as V2IamApiKeyPermissionsUpdatedEvent,
362+
V2IamApiKeyPermissionsUpdatedEventNotification as V2IamApiKeyPermissionsUpdatedEventNotification,
363+
)
364+
from stripe.events._v2_iam_api_key_rotated_event import (
365+
V2IamApiKeyRotatedEvent as V2IamApiKeyRotatedEvent,
366+
V2IamApiKeyRotatedEventNotification as V2IamApiKeyRotatedEventNotification,
367+
)
368+
from stripe.events._v2_iam_api_key_updated_event import (
369+
V2IamApiKeyUpdatedEvent as V2IamApiKeyUpdatedEvent,
370+
V2IamApiKeyUpdatedEventNotification as V2IamApiKeyUpdatedEventNotification,
371+
)
348372
from stripe.events._v2_money_management_adjustment_created_event import (
349373
V2MoneyManagementAdjustmentCreatedEvent as V2MoneyManagementAdjustmentCreatedEvent,
350374
V2MoneyManagementAdjustmentCreatedEventNotification as V2MoneyManagementAdjustmentCreatedEventNotification,
@@ -1213,6 +1237,54 @@
12131237
"stripe.events._v2_core_health_webhook_latency_resolved_event",
12141238
False,
12151239
),
1240+
"V2IamApiKeyCreatedEvent": (
1241+
"stripe.events._v2_iam_api_key_created_event",
1242+
False,
1243+
),
1244+
"V2IamApiKeyCreatedEventNotification": (
1245+
"stripe.events._v2_iam_api_key_created_event",
1246+
False,
1247+
),
1248+
"V2IamApiKeyDefaultSecretRevealedEvent": (
1249+
"stripe.events._v2_iam_api_key_default_secret_revealed_event",
1250+
False,
1251+
),
1252+
"V2IamApiKeyDefaultSecretRevealedEventNotification": (
1253+
"stripe.events._v2_iam_api_key_default_secret_revealed_event",
1254+
False,
1255+
),
1256+
"V2IamApiKeyExpiredEvent": (
1257+
"stripe.events._v2_iam_api_key_expired_event",
1258+
False,
1259+
),
1260+
"V2IamApiKeyExpiredEventNotification": (
1261+
"stripe.events._v2_iam_api_key_expired_event",
1262+
False,
1263+
),
1264+
"V2IamApiKeyPermissionsUpdatedEvent": (
1265+
"stripe.events._v2_iam_api_key_permissions_updated_event",
1266+
False,
1267+
),
1268+
"V2IamApiKeyPermissionsUpdatedEventNotification": (
1269+
"stripe.events._v2_iam_api_key_permissions_updated_event",
1270+
False,
1271+
),
1272+
"V2IamApiKeyRotatedEvent": (
1273+
"stripe.events._v2_iam_api_key_rotated_event",
1274+
False,
1275+
),
1276+
"V2IamApiKeyRotatedEventNotification": (
1277+
"stripe.events._v2_iam_api_key_rotated_event",
1278+
False,
1279+
),
1280+
"V2IamApiKeyUpdatedEvent": (
1281+
"stripe.events._v2_iam_api_key_updated_event",
1282+
False,
1283+
),
1284+
"V2IamApiKeyUpdatedEventNotification": (
1285+
"stripe.events._v2_iam_api_key_updated_event",
1286+
False,
1287+
),
12161288
"V2MoneyManagementAdjustmentCreatedEvent": (
12171289
"stripe.events._v2_money_management_adjustment_created_event",
12181290
False,

stripe/events/_event_classes.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,24 @@
256256
from stripe.events._v2_core_health_webhook_latency_resolved_event import (
257257
V2CoreHealthWebhookLatencyResolvedEventNotification,
258258
)
259+
from stripe.events._v2_iam_api_key_created_event import (
260+
V2IamApiKeyCreatedEventNotification,
261+
)
262+
from stripe.events._v2_iam_api_key_default_secret_revealed_event import (
263+
V2IamApiKeyDefaultSecretRevealedEventNotification,
264+
)
265+
from stripe.events._v2_iam_api_key_expired_event import (
266+
V2IamApiKeyExpiredEventNotification,
267+
)
268+
from stripe.events._v2_iam_api_key_permissions_updated_event import (
269+
V2IamApiKeyPermissionsUpdatedEventNotification,
270+
)
271+
from stripe.events._v2_iam_api_key_rotated_event import (
272+
V2IamApiKeyRotatedEventNotification,
273+
)
274+
from stripe.events._v2_iam_api_key_updated_event import (
275+
V2IamApiKeyUpdatedEventNotification,
276+
)
259277
from stripe.events._v2_money_management_adjustment_created_event import (
260278
V2MoneyManagementAdjustmentCreatedEventNotification,
261279
)
@@ -741,6 +759,30 @@
741759
"stripe.events._v2_core_health_webhook_latency_resolved_event",
742760
"V2CoreHealthWebhookLatencyResolvedEvent",
743761
),
762+
"v2.iam.api_key.created": (
763+
"stripe.events._v2_iam_api_key_created_event",
764+
"V2IamApiKeyCreatedEvent",
765+
),
766+
"v2.iam.api_key.default_secret_revealed": (
767+
"stripe.events._v2_iam_api_key_default_secret_revealed_event",
768+
"V2IamApiKeyDefaultSecretRevealedEvent",
769+
),
770+
"v2.iam.api_key.expired": (
771+
"stripe.events._v2_iam_api_key_expired_event",
772+
"V2IamApiKeyExpiredEvent",
773+
),
774+
"v2.iam.api_key.permissions_updated": (
775+
"stripe.events._v2_iam_api_key_permissions_updated_event",
776+
"V2IamApiKeyPermissionsUpdatedEvent",
777+
),
778+
"v2.iam.api_key.rotated": (
779+
"stripe.events._v2_iam_api_key_rotated_event",
780+
"V2IamApiKeyRotatedEvent",
781+
),
782+
"v2.iam.api_key.updated": (
783+
"stripe.events._v2_iam_api_key_updated_event",
784+
"V2IamApiKeyUpdatedEvent",
785+
),
744786
"v2.money_management.adjustment.created": (
745787
"stripe.events._v2_money_management_adjustment_created_event",
746788
"V2MoneyManagementAdjustmentCreatedEvent",
@@ -1288,6 +1330,30 @@ def get_v2_event_class(type_: str):
12881330
"stripe.events._v2_core_health_webhook_latency_resolved_event",
12891331
"V2CoreHealthWebhookLatencyResolvedEventNotification",
12901332
),
1333+
"v2.iam.api_key.created": (
1334+
"stripe.events._v2_iam_api_key_created_event",
1335+
"V2IamApiKeyCreatedEventNotification",
1336+
),
1337+
"v2.iam.api_key.default_secret_revealed": (
1338+
"stripe.events._v2_iam_api_key_default_secret_revealed_event",
1339+
"V2IamApiKeyDefaultSecretRevealedEventNotification",
1340+
),
1341+
"v2.iam.api_key.expired": (
1342+
"stripe.events._v2_iam_api_key_expired_event",
1343+
"V2IamApiKeyExpiredEventNotification",
1344+
),
1345+
"v2.iam.api_key.permissions_updated": (
1346+
"stripe.events._v2_iam_api_key_permissions_updated_event",
1347+
"V2IamApiKeyPermissionsUpdatedEventNotification",
1348+
),
1349+
"v2.iam.api_key.rotated": (
1350+
"stripe.events._v2_iam_api_key_rotated_event",
1351+
"V2IamApiKeyRotatedEventNotification",
1352+
),
1353+
"v2.iam.api_key.updated": (
1354+
"stripe.events._v2_iam_api_key_updated_event",
1355+
"V2IamApiKeyUpdatedEventNotification",
1356+
),
12911357
"v2.money_management.adjustment.created": (
12921358
"stripe.events._v2_money_management_adjustment_created_event",
12931359
"V2MoneyManagementAdjustmentCreatedEventNotification",
@@ -1586,6 +1652,12 @@ def get_v2_event_notification_class(type_: str):
15861652
"V2CoreHealthTrafficVolumeDropResolvedEventNotification",
15871653
"V2CoreHealthWebhookLatencyFiringEventNotification",
15881654
"V2CoreHealthWebhookLatencyResolvedEventNotification",
1655+
"V2IamApiKeyCreatedEventNotification",
1656+
"V2IamApiKeyDefaultSecretRevealedEventNotification",
1657+
"V2IamApiKeyExpiredEventNotification",
1658+
"V2IamApiKeyPermissionsUpdatedEventNotification",
1659+
"V2IamApiKeyRotatedEventNotification",
1660+
"V2IamApiKeyUpdatedEventNotification",
15891661
"V2MoneyManagementAdjustmentCreatedEventNotification",
15901662
"V2MoneyManagementFinancialAccountCreatedEventNotification",
15911663
"V2MoneyManagementFinancialAccountUpdatedEventNotification",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe.v2.core._event import Event, EventNotification
4+
from typing import cast
5+
from typing_extensions import Literal, override
6+
7+
8+
class V2IamApiKeyCreatedEventNotification(EventNotification):
9+
LOOKUP_TYPE = "v2.iam.api_key.created"
10+
type: Literal["v2.iam.api_key.created"]
11+
12+
@override
13+
def fetch_event(self) -> "V2IamApiKeyCreatedEvent":
14+
return cast(
15+
"V2IamApiKeyCreatedEvent",
16+
super().fetch_event(),
17+
)
18+
19+
@override
20+
async def fetch_event_async(self) -> "V2IamApiKeyCreatedEvent":
21+
return cast(
22+
"V2IamApiKeyCreatedEvent",
23+
await super().fetch_event_async(),
24+
)
25+
26+
27+
class V2IamApiKeyCreatedEvent(Event):
28+
LOOKUP_TYPE = "v2.iam.api_key.created"
29+
type: Literal["v2.iam.api_key.created"]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe.v2.core._event import Event, EventNotification
4+
from typing import cast
5+
from typing_extensions import Literal, override
6+
7+
8+
class V2IamApiKeyDefaultSecretRevealedEventNotification(EventNotification):
9+
LOOKUP_TYPE = "v2.iam.api_key.default_secret_revealed"
10+
type: Literal["v2.iam.api_key.default_secret_revealed"]
11+
12+
@override
13+
def fetch_event(self) -> "V2IamApiKeyDefaultSecretRevealedEvent":
14+
return cast(
15+
"V2IamApiKeyDefaultSecretRevealedEvent",
16+
super().fetch_event(),
17+
)
18+
19+
@override
20+
async def fetch_event_async(
21+
self,
22+
) -> "V2IamApiKeyDefaultSecretRevealedEvent":
23+
return cast(
24+
"V2IamApiKeyDefaultSecretRevealedEvent",
25+
await super().fetch_event_async(),
26+
)
27+
28+
29+
class V2IamApiKeyDefaultSecretRevealedEvent(Event):
30+
LOOKUP_TYPE = "v2.iam.api_key.default_secret_revealed"
31+
type: Literal["v2.iam.api_key.default_secret_revealed"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe.v2.core._event import Event, EventNotification
4+
from typing import cast
5+
from typing_extensions import Literal, override
6+
7+
8+
class V2IamApiKeyExpiredEventNotification(EventNotification):
9+
LOOKUP_TYPE = "v2.iam.api_key.expired"
10+
type: Literal["v2.iam.api_key.expired"]
11+
12+
@override
13+
def fetch_event(self) -> "V2IamApiKeyExpiredEvent":
14+
return cast(
15+
"V2IamApiKeyExpiredEvent",
16+
super().fetch_event(),
17+
)
18+
19+
@override
20+
async def fetch_event_async(self) -> "V2IamApiKeyExpiredEvent":
21+
return cast(
22+
"V2IamApiKeyExpiredEvent",
23+
await super().fetch_event_async(),
24+
)
25+
26+
27+
class V2IamApiKeyExpiredEvent(Event):
28+
LOOKUP_TYPE = "v2.iam.api_key.expired"
29+
type: Literal["v2.iam.api_key.expired"]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe.v2.core._event import Event, EventNotification
4+
from typing import cast
5+
from typing_extensions import Literal, override
6+
7+
8+
class V2IamApiKeyPermissionsUpdatedEventNotification(EventNotification):
9+
LOOKUP_TYPE = "v2.iam.api_key.permissions_updated"
10+
type: Literal["v2.iam.api_key.permissions_updated"]
11+
12+
@override
13+
def fetch_event(self) -> "V2IamApiKeyPermissionsUpdatedEvent":
14+
return cast(
15+
"V2IamApiKeyPermissionsUpdatedEvent",
16+
super().fetch_event(),
17+
)
18+
19+
@override
20+
async def fetch_event_async(self) -> "V2IamApiKeyPermissionsUpdatedEvent":
21+
return cast(
22+
"V2IamApiKeyPermissionsUpdatedEvent",
23+
await super().fetch_event_async(),
24+
)
25+
26+
27+
class V2IamApiKeyPermissionsUpdatedEvent(Event):
28+
LOOKUP_TYPE = "v2.iam.api_key.permissions_updated"
29+
type: Literal["v2.iam.api_key.permissions_updated"]
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe._api_mode import ApiMode
4+
from stripe._stripe_object import StripeObject
5+
from stripe._stripe_response import StripeResponse
6+
from stripe.v2.core._event import Event, EventNotification
7+
from typing import Any, Dict, Optional, cast
8+
from typing_extensions import Literal, TYPE_CHECKING, override
9+
10+
if TYPE_CHECKING:
11+
from stripe._api_requestor import _APIRequestor
12+
13+
14+
class V2IamApiKeyRotatedEventNotification(EventNotification):
15+
LOOKUP_TYPE = "v2.iam.api_key.rotated"
16+
type: Literal["v2.iam.api_key.rotated"]
17+
18+
@override
19+
def fetch_event(self) -> "V2IamApiKeyRotatedEvent":
20+
return cast(
21+
"V2IamApiKeyRotatedEvent",
22+
super().fetch_event(),
23+
)
24+
25+
@override
26+
async def fetch_event_async(self) -> "V2IamApiKeyRotatedEvent":
27+
return cast(
28+
"V2IamApiKeyRotatedEvent",
29+
await super().fetch_event_async(),
30+
)
31+
32+
33+
class V2IamApiKeyRotatedEvent(Event):
34+
LOOKUP_TYPE = "v2.iam.api_key.rotated"
35+
type: Literal["v2.iam.api_key.rotated"]
36+
37+
class V2IamApiKeyRotatedEventData(StripeObject):
38+
new_api_key: str
39+
"""
40+
ID of the new key that was created due to rotation.
41+
"""
42+
43+
data: V2IamApiKeyRotatedEventData
44+
"""
45+
Data for the v2.iam.api_key.rotated event
46+
"""
47+
48+
@classmethod
49+
def _construct_from(
50+
cls,
51+
*,
52+
values: Dict[str, Any],
53+
last_response: Optional[StripeResponse] = None,
54+
requestor: "_APIRequestor",
55+
api_mode: ApiMode,
56+
) -> "V2IamApiKeyRotatedEvent":
57+
evt = super()._construct_from(
58+
values=values,
59+
last_response=last_response,
60+
requestor=requestor,
61+
api_mode=api_mode,
62+
)
63+
if hasattr(evt, "data"):
64+
evt.data = V2IamApiKeyRotatedEvent.V2IamApiKeyRotatedEventData._construct_from(
65+
values=evt.data,
66+
last_response=last_response,
67+
requestor=requestor,
68+
api_mode=api_mode,
69+
)
70+
return evt

0 commit comments

Comments
 (0)