Skip to content

Commit 673b8fb

Browse files
Update generated code for v2150 and
1 parent a6ffe7a commit 673b8fb

File tree

6 files changed

+209
-2
lines changed

6 files changed

+209
-2
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
499f00588b1b41670a44a1e00598db81222ce169
1+
5abe0e44caedb3474ee672265284096ec89e0fa3

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2149
1+
v2150

stripe/_subscription.py

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
from stripe.params._subscription_modify_params import (
5959
SubscriptionModifyParams,
6060
)
61+
from stripe.params._subscription_pause_params import (
62+
SubscriptionPauseParams,
63+
)
6164
from stripe.params._subscription_resume_params import (
6265
SubscriptionResumeParams,
6366
)
@@ -1629,6 +1632,116 @@ async def modify_async(
16291632
),
16301633
)
16311634

1635+
@classmethod
1636+
def _cls_pause(
1637+
cls, subscription: str, **params: Unpack["SubscriptionPauseParams"]
1638+
) -> "Subscription":
1639+
"""
1640+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1641+
"""
1642+
return cast(
1643+
"Subscription",
1644+
cls._static_request(
1645+
"post",
1646+
"/v1/subscriptions/{subscription}/pause".format(
1647+
subscription=sanitize_id(subscription)
1648+
),
1649+
params=params,
1650+
),
1651+
)
1652+
1653+
@overload
1654+
@staticmethod
1655+
def pause(
1656+
subscription: str, **params: Unpack["SubscriptionPauseParams"]
1657+
) -> "Subscription":
1658+
"""
1659+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1660+
"""
1661+
...
1662+
1663+
@overload
1664+
def pause(
1665+
self, **params: Unpack["SubscriptionPauseParams"]
1666+
) -> "Subscription":
1667+
"""
1668+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1669+
"""
1670+
...
1671+
1672+
@class_method_variant("_cls_pause")
1673+
def pause( # pyright: ignore[reportGeneralTypeIssues]
1674+
self, **params: Unpack["SubscriptionPauseParams"]
1675+
) -> "Subscription":
1676+
"""
1677+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1678+
"""
1679+
return cast(
1680+
"Subscription",
1681+
self._request(
1682+
"post",
1683+
"/v1/subscriptions/{subscription}/pause".format(
1684+
subscription=sanitize_id(self.get("id"))
1685+
),
1686+
params=params,
1687+
),
1688+
)
1689+
1690+
@classmethod
1691+
async def _cls_pause_async(
1692+
cls, subscription: str, **params: Unpack["SubscriptionPauseParams"]
1693+
) -> "Subscription":
1694+
"""
1695+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1696+
"""
1697+
return cast(
1698+
"Subscription",
1699+
await cls._static_request_async(
1700+
"post",
1701+
"/v1/subscriptions/{subscription}/pause".format(
1702+
subscription=sanitize_id(subscription)
1703+
),
1704+
params=params,
1705+
),
1706+
)
1707+
1708+
@overload
1709+
@staticmethod
1710+
async def pause_async(
1711+
subscription: str, **params: Unpack["SubscriptionPauseParams"]
1712+
) -> "Subscription":
1713+
"""
1714+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1715+
"""
1716+
...
1717+
1718+
@overload
1719+
async def pause_async(
1720+
self, **params: Unpack["SubscriptionPauseParams"]
1721+
) -> "Subscription":
1722+
"""
1723+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1724+
"""
1725+
...
1726+
1727+
@class_method_variant("_cls_pause_async")
1728+
async def pause_async( # pyright: ignore[reportGeneralTypeIssues]
1729+
self, **params: Unpack["SubscriptionPauseParams"]
1730+
) -> "Subscription":
1731+
"""
1732+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
1733+
"""
1734+
return cast(
1735+
"Subscription",
1736+
await self._request_async(
1737+
"post",
1738+
"/v1/subscriptions/{subscription}/pause".format(
1739+
subscription=sanitize_id(self.get("id"))
1740+
),
1741+
params=params,
1742+
),
1743+
)
1744+
16321745
@classmethod
16331746
def _cls_resume(
16341747
cls, subscription: str, **params: Unpack["SubscriptionResumeParams"]

stripe/_subscription_service.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
from stripe.params._subscription_migrate_params import (
2828
SubscriptionMigrateParams,
2929
)
30+
from stripe.params._subscription_pause_params import (
31+
SubscriptionPauseParams,
32+
)
3033
from stripe.params._subscription_resume_params import (
3134
SubscriptionResumeParams,
3235
)
@@ -502,6 +505,50 @@ async def migrate_async(
502505
),
503506
)
504507

508+
def pause(
509+
self,
510+
subscription: str,
511+
params: "SubscriptionPauseParams",
512+
options: Optional["RequestOptions"] = None,
513+
) -> "Subscription":
514+
"""
515+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
516+
"""
517+
return cast(
518+
"Subscription",
519+
self._request(
520+
"post",
521+
"/v1/subscriptions/{subscription}/pause".format(
522+
subscription=sanitize_id(subscription),
523+
),
524+
base_address="api",
525+
params=params,
526+
options=options,
527+
),
528+
)
529+
530+
async def pause_async(
531+
self,
532+
subscription: str,
533+
params: "SubscriptionPauseParams",
534+
options: Optional["RequestOptions"] = None,
535+
) -> "Subscription":
536+
"""
537+
Pauses a subscription by transitioning it to the paused status. A paused subscription does not generate invoices and will not advance to new billing periods. The subscription can be resumed later using the resume endpoint. Cannot pause subscriptions with attached schedules.
538+
"""
539+
return cast(
540+
"Subscription",
541+
await self._request_async(
542+
"post",
543+
"/v1/subscriptions/{subscription}/pause".format(
544+
subscription=sanitize_id(subscription),
545+
),
546+
base_address="api",
547+
params=params,
548+
options=options,
549+
),
550+
)
551+
505552
def resume(
506553
self,
507554
subscription: str,

stripe/params/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5233,6 +5233,10 @@
52335233
SubscriptionModifyParamsTrialSettings as SubscriptionModifyParamsTrialSettings,
52345234
SubscriptionModifyParamsTrialSettingsEndBehavior as SubscriptionModifyParamsTrialSettingsEndBehavior,
52355235
)
5236+
from stripe.params._subscription_pause_params import (
5237+
SubscriptionPauseParams as SubscriptionPauseParams,
5238+
SubscriptionPauseParamsBillFor as SubscriptionPauseParamsBillFor,
5239+
)
52365240
from stripe.params._subscription_resume_params import (
52375241
SubscriptionResumeParams as SubscriptionResumeParams,
52385242
)
@@ -22959,6 +22963,14 @@
2295922963
"stripe.params._subscription_modify_params",
2296022964
False,
2296122965
),
22966+
"SubscriptionPauseParams": (
22967+
"stripe.params._subscription_pause_params",
22968+
False,
22969+
),
22970+
"SubscriptionPauseParamsBillFor": (
22971+
"stripe.params._subscription_pause_params",
22972+
False,
22973+
),
2296222974
"SubscriptionResumeParams": (
2296322975
"stripe.params._subscription_resume_params",
2296422976
False,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# -*- coding: utf-8 -*-
2+
# File generated from our OpenAPI spec
3+
from stripe._request_options import RequestOptions
4+
from typing import List
5+
from typing_extensions import Literal, NotRequired, TypedDict
6+
7+
8+
class SubscriptionPauseParams(RequestOptions):
9+
bill_for: NotRequired["SubscriptionPauseParamsBillFor"]
10+
"""
11+
Controls what to bill for when pausing the subscription.
12+
"""
13+
expand: NotRequired[List[str]]
14+
"""
15+
Specifies which fields in the response should be expanded.
16+
"""
17+
invoicing_behavior: NotRequired[Literal["invoice", "pending_invoice_item"]]
18+
"""
19+
Determines how to handle debits and credits when pausing. The default is `pending_invoice_item`.
20+
"""
21+
type: Literal["subscription"]
22+
"""
23+
The type of pause to apply.
24+
"""
25+
26+
27+
class SubscriptionPauseParamsBillFor(TypedDict):
28+
outstanding_usage: NotRequired[bool]
29+
"""
30+
Controls whether to debit for accrued metered usage in the current billing period. The default is `false`.
31+
"""
32+
unused_time: NotRequired[bool]
33+
"""
34+
Controls whether to credit for licensed items in the current billing period. The default is `false`.
35+
"""

0 commit comments

Comments
 (0)