Skip to content

Commit 8bd0862

Browse files
generate private-preview SDK w/ mid Sept changes (#1571)
* generate * remove extra error * generate w/ mid-sept spec * Remove extra rate limit error
1 parent a0572b0 commit 8bd0862

21 files changed

+411
-49
lines changed

stripe/_api_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
# File generated from our OpenAPI spec
33
class _ApiVersion:
4-
CURRENT = "2025-08-27.preview"
4+
CURRENT = "2025-08-04.private"

stripe/events/__init__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
from stripe.events._v2_billing_cadence_created_event import (
1616
V2BillingCadenceCreatedEvent as V2BillingCadenceCreatedEvent,
1717
)
18-
from stripe.events._v2_billing_cadence_errored_event import (
19-
V2BillingCadenceErroredEvent as V2BillingCadenceErroredEvent,
20-
)
2118
from stripe.events._v2_billing_license_fee_created_event import (
2219
V2BillingLicenseFeeCreatedEvent as V2BillingLicenseFeeCreatedEvent,
2320
)
@@ -174,6 +171,18 @@
174171
from stripe.events._v2_core_account_updated_event import (
175172
V2CoreAccountUpdatedEvent as V2CoreAccountUpdatedEvent,
176173
)
174+
from stripe.events._v2_core_claimable_sandbox_claimed_event import (
175+
V2CoreClaimableSandboxClaimedEvent as V2CoreClaimableSandboxClaimedEvent,
176+
)
177+
from stripe.events._v2_core_claimable_sandbox_expired_event import (
178+
V2CoreClaimableSandboxExpiredEvent as V2CoreClaimableSandboxExpiredEvent,
179+
)
180+
from stripe.events._v2_core_claimable_sandbox_expiring_event import (
181+
V2CoreClaimableSandboxExpiringEvent as V2CoreClaimableSandboxExpiringEvent,
182+
)
183+
from stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event import (
184+
V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent as V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent,
185+
)
177186
from stripe.events._v2_core_event_destination_ping_event import (
178187
V2CoreEventDestinationPingEvent as V2CoreEventDestinationPingEvent,
179188
)

stripe/events/_event_classes.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
from stripe.events._v2_billing_cadence_created_event import (
1616
V2BillingCadenceCreatedEvent,
1717
)
18-
from stripe.events._v2_billing_cadence_errored_event import (
19-
V2BillingCadenceErroredEvent,
20-
)
2118
from stripe.events._v2_billing_license_fee_created_event import (
2219
V2BillingLicenseFeeCreatedEvent,
2320
)
@@ -174,6 +171,18 @@
174171
from stripe.events._v2_core_account_person_updated_event import (
175172
V2CoreAccountPersonUpdatedEvent,
176173
)
174+
from stripe.events._v2_core_claimable_sandbox_claimed_event import (
175+
V2CoreClaimableSandboxClaimedEvent,
176+
)
177+
from stripe.events._v2_core_claimable_sandbox_expired_event import (
178+
V2CoreClaimableSandboxExpiredEvent,
179+
)
180+
from stripe.events._v2_core_claimable_sandbox_expiring_event import (
181+
V2CoreClaimableSandboxExpiringEvent,
182+
)
183+
from stripe.events._v2_core_claimable_sandbox_sandbox_details_owner_account_updated_event import (
184+
V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent,
185+
)
177186
from stripe.events._v2_core_event_destination_ping_event import (
178187
V2CoreEventDestinationPingEvent,
179188
)
@@ -368,7 +377,6 @@
368377
V2BillingCadenceBilledEvent.LOOKUP_TYPE: V2BillingCadenceBilledEvent,
369378
V2BillingCadenceCanceledEvent.LOOKUP_TYPE: V2BillingCadenceCanceledEvent,
370379
V2BillingCadenceCreatedEvent.LOOKUP_TYPE: V2BillingCadenceCreatedEvent,
371-
V2BillingCadenceErroredEvent.LOOKUP_TYPE: V2BillingCadenceErroredEvent,
372380
V2BillingLicensedItemCreatedEvent.LOOKUP_TYPE: V2BillingLicensedItemCreatedEvent,
373381
V2BillingLicensedItemUpdatedEvent.LOOKUP_TYPE: V2BillingLicensedItemUpdatedEvent,
374382
V2BillingLicenseFeeCreatedEvent.LOOKUP_TYPE: V2BillingLicenseFeeCreatedEvent,
@@ -421,6 +429,10 @@
421429
V2CoreAccountPersonDeletedEvent.LOOKUP_TYPE: V2CoreAccountPersonDeletedEvent,
422430
V2CoreAccountPersonUpdatedEvent.LOOKUP_TYPE: V2CoreAccountPersonUpdatedEvent,
423431
V2CoreAccountUpdatedEvent.LOOKUP_TYPE: V2CoreAccountUpdatedEvent,
432+
V2CoreClaimableSandboxClaimedEvent.LOOKUP_TYPE: V2CoreClaimableSandboxClaimedEvent,
433+
V2CoreClaimableSandboxExpiredEvent.LOOKUP_TYPE: V2CoreClaimableSandboxExpiredEvent,
434+
V2CoreClaimableSandboxExpiringEvent.LOOKUP_TYPE: V2CoreClaimableSandboxExpiringEvent,
435+
V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent.LOOKUP_TYPE: V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent,
424436
V2CoreEventDestinationPingEvent.LOOKUP_TYPE: V2CoreEventDestinationPingEvent,
425437
V2CoreHealthApiErrorFiringEvent.LOOKUP_TYPE: V2CoreHealthApiErrorFiringEvent,
426438
V2CoreHealthApiErrorResolvedEvent.LOOKUP_TYPE: V2CoreHealthApiErrorResolvedEvent,

stripe/events/_v2_billing_cadence_billed_event.py

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,54 @@
11
# -*- coding: utf-8 -*-
22
# File generated from our OpenAPI spec
3+
from stripe._api_mode import ApiMode
4+
from stripe._api_requestor import _APIRequestor
35
from stripe._stripe_object import StripeObject
6+
from stripe._stripe_response import StripeResponse
47
from stripe.v2._event import Event
58
from stripe.v2.billing._cadence import Cadence
6-
from typing import cast
9+
from typing import Any, Dict, List, Optional, cast
710
from typing_extensions import Literal
811

912

1013
class V2BillingCadenceBilledEvent(Event):
1114
LOOKUP_TYPE = "v2.billing.cadence.billed"
1215
type: Literal["v2.billing.cadence.billed"]
1316

17+
class V2BillingCadenceBilledEventData(StripeObject):
18+
invoices: List[str]
19+
"""
20+
The IDs of the invoices that were generated by the tick for this Cadence.
21+
"""
22+
23+
data: V2BillingCadenceBilledEventData
24+
"""
25+
Data for the v2.billing.cadence.billed event
26+
"""
27+
28+
@classmethod
29+
def _construct_from(
30+
cls,
31+
*,
32+
values: Dict[str, Any],
33+
last_response: Optional[StripeResponse] = None,
34+
requestor: "_APIRequestor",
35+
api_mode: ApiMode,
36+
) -> "V2BillingCadenceBilledEvent":
37+
evt = super()._construct_from(
38+
values=values,
39+
last_response=last_response,
40+
requestor=requestor,
41+
api_mode=api_mode,
42+
)
43+
if hasattr(evt, "data"):
44+
evt.data = V2BillingCadenceBilledEvent.V2BillingCadenceBilledEventData._construct_from(
45+
values=evt.data,
46+
last_response=last_response,
47+
requestor=requestor,
48+
api_mode=api_mode,
49+
)
50+
return evt
51+
1452
class RelatedObject(StripeObject):
1553
id: str
1654
"""

stripe/events/_v2_billing_cadence_errored_event.py renamed to stripe/events/_v2_core_claimable_sandbox_claimed_event.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# File generated from our OpenAPI spec
33
from stripe._stripe_object import StripeObject
44
from stripe.v2._event import Event
5-
from stripe.v2.billing._cadence import Cadence
5+
from stripe.v2.core._claimable_sandbox import ClaimableSandbox
66
from typing import cast
77
from typing_extensions import Literal
88

99

10-
class V2BillingCadenceErroredEvent(Event):
11-
LOOKUP_TYPE = "v2.billing.cadence.errored"
12-
type: Literal["v2.billing.cadence.errored"]
10+
class V2CoreClaimableSandboxClaimedEvent(Event):
11+
LOOKUP_TYPE = "v2.core.claimable_sandbox.claimed"
12+
type: Literal["v2.core.claimable_sandbox.claimed"]
1313

1414
class RelatedObject(StripeObject):
1515
id: str
@@ -30,12 +30,12 @@ class RelatedObject(StripeObject):
3030
Object containing the reference to API resource relevant to the event
3131
"""
3232

33-
def fetch_related_object(self) -> Cadence:
33+
def fetch_related_object(self) -> ClaimableSandbox:
3434
"""
3535
Retrieves the related object from the API. Makes an API request on every call.
3636
"""
3737
return cast(
38-
Cadence,
38+
ClaimableSandbox,
3939
self._requestor.request(
4040
"get",
4141
self.related_object.url,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe._stripe_object import StripeObject
4+
from stripe.v2._event import Event
5+
from stripe.v2.core._claimable_sandbox import ClaimableSandbox
6+
from typing import cast
7+
from typing_extensions import Literal
8+
9+
10+
class V2CoreClaimableSandboxExpiredEvent(Event):
11+
LOOKUP_TYPE = "v2.core.claimable_sandbox.expired"
12+
type: Literal["v2.core.claimable_sandbox.expired"]
13+
14+
class RelatedObject(StripeObject):
15+
id: str
16+
"""
17+
Unique identifier for the object relevant to the event.
18+
"""
19+
type: str
20+
"""
21+
Type of the object relevant to the event.
22+
"""
23+
url: str
24+
"""
25+
URL to retrieve the resource.
26+
"""
27+
28+
related_object: RelatedObject
29+
"""
30+
Object containing the reference to API resource relevant to the event
31+
"""
32+
33+
def fetch_related_object(self) -> ClaimableSandbox:
34+
"""
35+
Retrieves the related object from the API. Makes an API request on every call.
36+
"""
37+
return cast(
38+
ClaimableSandbox,
39+
self._requestor.request(
40+
"get",
41+
self.related_object.url,
42+
base_address="api",
43+
options={"stripe_account": self.context},
44+
),
45+
)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe._stripe_object import StripeObject
4+
from stripe.v2._event import Event
5+
from stripe.v2.core._claimable_sandbox import ClaimableSandbox
6+
from typing import cast
7+
from typing_extensions import Literal
8+
9+
10+
class V2CoreClaimableSandboxExpiringEvent(Event):
11+
LOOKUP_TYPE = "v2.core.claimable_sandbox.expiring"
12+
type: Literal["v2.core.claimable_sandbox.expiring"]
13+
14+
class RelatedObject(StripeObject):
15+
id: str
16+
"""
17+
Unique identifier for the object relevant to the event.
18+
"""
19+
type: str
20+
"""
21+
Type of the object relevant to the event.
22+
"""
23+
url: str
24+
"""
25+
URL to retrieve the resource.
26+
"""
27+
28+
related_object: RelatedObject
29+
"""
30+
Object containing the reference to API resource relevant to the event
31+
"""
32+
33+
def fetch_related_object(self) -> ClaimableSandbox:
34+
"""
35+
Retrieves the related object from the API. Makes an API request on every call.
36+
"""
37+
return cast(
38+
ClaimableSandbox,
39+
self._requestor.request(
40+
"get",
41+
self.related_object.url,
42+
base_address="api",
43+
options={"stripe_account": self.context},
44+
),
45+
)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe._stripe_object import StripeObject
4+
from stripe.v2._event import Event
5+
from stripe.v2.core._claimable_sandbox import ClaimableSandbox
6+
from typing import cast
7+
from typing_extensions import Literal
8+
9+
10+
class V2CoreClaimableSandboxSandboxDetailsOwnerAccountUpdatedEvent(Event):
11+
LOOKUP_TYPE = (
12+
"v2.core.claimable_sandbox.sandbox_details_owner_account_updated"
13+
)
14+
type: Literal[
15+
"v2.core.claimable_sandbox.sandbox_details_owner_account_updated"
16+
]
17+
18+
class RelatedObject(StripeObject):
19+
id: str
20+
"""
21+
Unique identifier for the object relevant to the event.
22+
"""
23+
type: str
24+
"""
25+
Type of the object relevant to the event.
26+
"""
27+
url: str
28+
"""
29+
URL to retrieve the resource.
30+
"""
31+
32+
related_object: RelatedObject
33+
"""
34+
Object containing the reference to API resource relevant to the event
35+
"""
36+
37+
def fetch_related_object(self) -> ClaimableSandbox:
38+
"""
39+
Retrieves the related object from the API. Makes an API request on every call.
40+
"""
41+
return cast(
42+
ClaimableSandbox,
43+
self._requestor.request(
44+
"get",
45+
self.related_object.url,
46+
base_address="api",
47+
options={"stripe_account": self.context},
48+
),
49+
)

stripe/v2/billing/_cadence.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ class Time(StripeObject):
5959
If this number is greater than the number of days in the month being billed,
6060
this will anchor to the last day of the month.
6161
"""
62+
month_of_year: Optional[int]
63+
"""
64+
The month to anchor the billing on for a type="month" billing cycle from
65+
1-12. Occurrences are calculated from the month anchor.
66+
"""
6267
time: Time
6368
"""
6469
The time at which the billing cycle ends.

stripe/v2/billing/_cadence_service.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ class CreateParamsBillingCycleMonth(TypedDict):
100100
billed, this will anchor to the last day of the month. If not provided,
101101
this will default to the day the cadence was created.
102102
"""
103+
month_of_year: NotRequired[int]
104+
"""
105+
The month to anchor the billing on for a type="month" billing cycle from
106+
1-12. If not provided, this will default to the month the cadence was created.
107+
This setting can only be used for monthly billing cycles with `interval_count` of 2, 3, 4 or 6.
108+
All occurrences will be calculated from month provided.
109+
"""
103110
time: NotRequired["CadenceService.CreateParamsBillingCycleMonthTime"]
104111
"""
105112
The time at which the billing cycle ends.

0 commit comments

Comments
 (0)