Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,047 changes: 1,047 additions & 0 deletions stripe/__init__.py

Large diffs are not rendered by default.

3,320 changes: 96 additions & 3,224 deletions stripe/_account.py

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions stripe/_account_capability_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from typing import List
from typing_extensions import NotRequired, TypedDict


class AccountCapabilityListParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
11 changes: 11 additions & 0 deletions stripe/_account_capability_retrieve_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from typing import List
from typing_extensions import NotRequired, TypedDict


class AccountCapabilityRetrieveParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
46 changes: 14 additions & 32 deletions stripe/_account_capability_service.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,25 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._account_capability_list_params import AccountCapabilityListParams
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should all probably go in an if TYPE_CHECKING block. Won't need changes to the main body of the service, since the types are already in a string

from stripe._account_capability_retrieve_params import (
AccountCapabilityRetrieveParams,
)
from stripe._account_capability_update_params import (
AccountCapabilityUpdateParams,
)
from stripe._capability import Capability
from stripe._list_object import ListObject
from stripe._request_options import RequestOptions
from stripe._stripe_service import StripeService
from stripe._util import sanitize_id
from typing import List, Optional, cast
from typing_extensions import NotRequired, TypedDict
from typing import Optional, cast


class AccountCapabilityService(StripeService):
class ListParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""

class RetrieveParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""

class UpdateParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
requested: NotRequired[bool]
"""
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.

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.
"""

def list(
self,
account: str,
params: Optional["AccountCapabilityService.ListParams"] = None,
params: Optional["AccountCapabilityListParams"] = None,
options: Optional[RequestOptions] = None,
) -> ListObject[Capability]:
"""
Expand All @@ -59,7 +41,7 @@ def list(
async def list_async(
self,
account: str,
params: Optional["AccountCapabilityService.ListParams"] = None,
params: Optional["AccountCapabilityListParams"] = None,
options: Optional[RequestOptions] = None,
) -> ListObject[Capability]:
"""
Expand All @@ -82,7 +64,7 @@ def retrieve(
self,
account: str,
capability: str,
params: Optional["AccountCapabilityService.RetrieveParams"] = None,
params: Optional["AccountCapabilityRetrieveParams"] = None,
options: Optional[RequestOptions] = None,
) -> Capability:
"""
Expand All @@ -106,7 +88,7 @@ async def retrieve_async(
self,
account: str,
capability: str,
params: Optional["AccountCapabilityService.RetrieveParams"] = None,
params: Optional["AccountCapabilityRetrieveParams"] = None,
options: Optional[RequestOptions] = None,
) -> Capability:
"""
Expand All @@ -130,7 +112,7 @@ def update(
self,
account: str,
capability: str,
params: Optional["AccountCapabilityService.UpdateParams"] = None,
params: Optional["AccountCapabilityUpdateParams"] = None,
options: Optional[RequestOptions] = None,
) -> Capability:
"""
Expand All @@ -154,7 +136,7 @@ async def update_async(
self,
account: str,
capability: str,
params: Optional["AccountCapabilityService.UpdateParams"] = None,
params: Optional["AccountCapabilityUpdateParams"] = None,
options: Optional[RequestOptions] = None,
) -> Capability:
"""
Expand Down
17 changes: 17 additions & 0 deletions stripe/_account_capability_update_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from typing import List
from typing_extensions import NotRequired, TypedDict


class AccountCapabilityUpdateParams(TypedDict):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
requested: NotRequired[bool]
"""
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.

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.
"""
83 changes: 83 additions & 0 deletions stripe/_account_create_external_account_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._request_options import RequestOptions
from typing import Dict, List, Union
from typing_extensions import Literal, NotRequired, TypedDict


class AccountCreateExternalAccountParams(RequestOptions):
default_for_currency: NotRequired[bool]
"""
When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.
"""
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
external_account: Union[
str,
"AccountCreateExternalAccountParamsCard",
"AccountCreateExternalAccountParamsBankAccount",
"AccountCreateExternalAccountParamsCardToken",
]
"""
A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js) or a dictionary containing a user's external account details (with the options shown below). Please refer to full [documentation](https://stripe.com/docs/api/external_accounts) instead.
"""
metadata: NotRequired[Dict[str, str]]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
"""


class AccountCreateExternalAccountParamsCard(TypedDict):
object: Literal["card"]
address_city: NotRequired[str]
address_country: NotRequired[str]
address_line1: NotRequired[str]
address_line2: NotRequired[str]
address_state: NotRequired[str]
address_zip: NotRequired[str]
currency: NotRequired[str]
cvc: NotRequired[str]
exp_month: int
exp_year: int
name: NotRequired[str]
number: str
metadata: NotRequired[Dict[str, str]]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
"""


class AccountCreateExternalAccountParamsBankAccount(TypedDict):
object: Literal["bank_account"]
account_holder_name: NotRequired[str]
"""
The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object.
"""
account_holder_type: NotRequired[Literal["company", "individual"]]
"""
The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object.
"""
account_number: str
"""
The account number for the bank account, in string form. Must be a checking account.
"""
country: str
"""
The country in which the bank account is located.
"""
currency: NotRequired[str]
"""
The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts)
"""
routing_number: NotRequired[str]
"""
The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required.
"""


class AccountCreateExternalAccountParamsCardToken(TypedDict):
object: Literal["card"]
currency: NotRequired[str]
token: str
12 changes: 12 additions & 0 deletions stripe/_account_create_login_link_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._request_options import RequestOptions
from typing import List
from typing_extensions import NotRequired


class AccountCreateLoginLinkParams(RequestOptions):
expand: NotRequired[List[str]]
"""
Specifies which fields in the response should be expanded.
"""
Loading
Loading