Skip to content

Commit e10c120

Browse files
⚠️ Unify resource and service method parameters into one class (#1596)
* Unify resource and service method parameters into one class * rename param to params * gen --------- Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Co-authored-by: David Brownman <xavdid@stripe.com>
1 parent 1e2641b commit e10c120

File tree

978 files changed

+96169
-124432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

978 files changed

+96169
-124432
lines changed

stripe/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def set_app_info(
222222
forwarding as forwarding,
223223
identity as identity,
224224
issuing as issuing,
225+
params as params,
225226
radar as radar,
226227
reporting as reporting,
227228
sigma as sigma,

stripe/_account.py

Lines changed: 104 additions & 3224 deletions
Large diffs are not rendered by default.

stripe/_account_capability_service.py

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,26 @@
55
from stripe._request_options import RequestOptions
66
from stripe._stripe_service import StripeService
77
from stripe._util import sanitize_id
8-
from typing import List, Optional, cast
9-
from typing_extensions import NotRequired, TypedDict
8+
from typing import Optional, cast
9+
from typing_extensions import TYPE_CHECKING
1010

11+
if TYPE_CHECKING:
12+
from stripe.params._account_capability_list_params import (
13+
AccountCapabilityListParams,
14+
)
15+
from stripe.params._account_capability_retrieve_params import (
16+
AccountCapabilityRetrieveParams,
17+
)
18+
from stripe.params._account_capability_update_params import (
19+
AccountCapabilityUpdateParams,
20+
)
1121

12-
class AccountCapabilityService(StripeService):
13-
class ListParams(TypedDict):
14-
expand: NotRequired[List[str]]
15-
"""
16-
Specifies which fields in the response should be expanded.
17-
"""
18-
19-
class RetrieveParams(TypedDict):
20-
expand: NotRequired[List[str]]
21-
"""
22-
Specifies which fields in the response should be expanded.
23-
"""
24-
25-
class UpdateParams(TypedDict):
26-
expand: NotRequired[List[str]]
27-
"""
28-
Specifies which fields in the response should be expanded.
29-
"""
30-
requested: NotRequired[bool]
31-
"""
32-
To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays.
33-
34-
If a capability isn't permanent, you can remove it from the account by passing false. Some capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error.
35-
"""
3622

23+
class AccountCapabilityService(StripeService):
3724
def list(
3825
self,
3926
account: str,
40-
params: Optional["AccountCapabilityService.ListParams"] = None,
27+
params: Optional["AccountCapabilityListParams"] = None,
4128
options: Optional[RequestOptions] = None,
4229
) -> ListObject[Capability]:
4330
"""
@@ -59,7 +46,7 @@ def list(
5946
async def list_async(
6047
self,
6148
account: str,
62-
params: Optional["AccountCapabilityService.ListParams"] = None,
49+
params: Optional["AccountCapabilityListParams"] = None,
6350
options: Optional[RequestOptions] = None,
6451
) -> ListObject[Capability]:
6552
"""
@@ -82,7 +69,7 @@ def retrieve(
8269
self,
8370
account: str,
8471
capability: str,
85-
params: Optional["AccountCapabilityService.RetrieveParams"] = None,
72+
params: Optional["AccountCapabilityRetrieveParams"] = None,
8673
options: Optional[RequestOptions] = None,
8774
) -> Capability:
8875
"""
@@ -106,7 +93,7 @@ async def retrieve_async(
10693
self,
10794
account: str,
10895
capability: str,
109-
params: Optional["AccountCapabilityService.RetrieveParams"] = None,
96+
params: Optional["AccountCapabilityRetrieveParams"] = None,
11097
options: Optional[RequestOptions] = None,
11198
) -> Capability:
11299
"""
@@ -130,7 +117,7 @@ def update(
130117
self,
131118
account: str,
132119
capability: str,
133-
params: Optional["AccountCapabilityService.UpdateParams"] = None,
120+
params: Optional["AccountCapabilityUpdateParams"] = None,
134121
options: Optional[RequestOptions] = None,
135122
) -> Capability:
136123
"""
@@ -154,7 +141,7 @@ async def update_async(
154141
self,
155142
account: str,
156143
capability: str,
157-
params: Optional["AccountCapabilityService.UpdateParams"] = None,
144+
params: Optional["AccountCapabilityUpdateParams"] = None,
158145
options: Optional[RequestOptions] = None,
159146
) -> Capability:
160147
"""

0 commit comments

Comments
 (0)