Skip to content

Commit

Permalink
Optional[...] for non-required properties
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Sep 21, 2023
1 parent 687ae22 commit de0d765
Show file tree
Hide file tree
Showing 98 changed files with 1,671 additions and 2,111 deletions.
233 changes: 115 additions & 118 deletions stripe/api_resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,35 +48,36 @@ class Account(
business_type: Optional[
Literal["company", "government_entity", "individual", "non_profit"]
]
capabilities: StripeObject
charges_enabled: bool
company: StripeObject
controller: StripeObject
country: str
created: int
default_currency: str
details_submitted: bool
capabilities: Optional[StripeObject]
charges_enabled: Optional[bool]
company: Optional[StripeObject]
controller: Optional[StripeObject]
country: Optional[str]
created: Optional[int]
default_currency: Optional[str]
details_submitted: Optional[bool]
email: Optional[str]
external_accounts: ListObject[Any]
future_requirements: StripeObject
external_accounts: Optional[ListObject[Any]]
future_requirements: Optional[StripeObject]
id: str
individual: "Person"
metadata: Dict[str, str]
individual: Optional["Person"]
metadata: Optional[Dict[str, str]]
object: Literal["account"]
payouts_enabled: bool
requirements: StripeObject
payouts_enabled: Optional[bool]
requirements: Optional[StripeObject]
settings: Optional[StripeObject]
tos_acceptance: StripeObject
type: Literal["custom", "express", "standard"]
tos_acceptance: Optional[StripeObject]
type: Optional[Literal["custom", "express", "standard"]]
deleted: Optional[Literal[True]]

@classmethod
def create(
cls,
api_key: Optional[str] = None,
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
api_key=None,
idempotency_key=None,
stripe_version=None,
stripe_account=None,
**params
) -> "Account":
return cast(
"Account",
Expand All @@ -92,15 +93,15 @@ def create(
)

@classmethod
def _cls_delete(cls, sid, **params: Any) -> "Account":
def _cls_delete(cls, sid, **params) -> "Account":
url = "%s/%s" % (cls.class_url(), quote_plus(sid))
return cast(
"Account",
cls._static_request("delete", url, params=params),
)

@util.class_method_variant("_cls_delete")
def delete(self, **params: Any) -> "Account":
def delete(self, **params) -> "Account":
return self._request_and_refresh(
"delete",
self.instance_url(),
Expand All @@ -109,11 +110,7 @@ def delete(self, **params: Any) -> "Account":

@classmethod
def list(
cls,
api_key=None,
stripe_version=None,
stripe_account=None,
**params: Any
cls, api_key=None, stripe_version=None, stripe_account=None, **params
) -> ListObject["Account"]:
result = cls._static_request(
"get",
Expand All @@ -135,11 +132,11 @@ def list(
@classmethod
def _cls_persons(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -153,7 +150,7 @@ def _cls_persons(
)

@util.class_method_variant("_cls_persons")
def persons(self, idempotency_key=None, **params: Any):
def persons(self, idempotency_key=None, **params):
return self._request(
"get",
"/v1/accounts/{account}/persons".format(
Expand All @@ -166,11 +163,11 @@ def persons(self, idempotency_key=None, **params: Any):
@classmethod
def _cls_reject(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -184,7 +181,7 @@ def _cls_reject(
)

@util.class_method_variant("_cls_reject")
def reject(self, idempotency_key=None, **params: Any):
def reject(self, idempotency_key=None, **params):
return self._request(
"post",
"/v1/accounts/{account}/reject".format(
Expand Down Expand Up @@ -240,12 +237,12 @@ def serialize(self, previous):
@classmethod
def retrieve_capability(
cls,
account: str,
capability: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
capability,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -262,12 +259,12 @@ def retrieve_capability(
@classmethod
def modify_capability(
cls,
account: str,
capability: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
capability,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -284,11 +281,11 @@ def modify_capability(
@classmethod
def list_capabilities(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -304,11 +301,11 @@ def list_capabilities(
@classmethod
def create_external_account(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -324,12 +321,12 @@ def create_external_account(
@classmethod
def retrieve_external_account(
cls,
account: str,
id: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
id,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -345,12 +342,12 @@ def retrieve_external_account(
@classmethod
def modify_external_account(
cls,
account: str,
id: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
id,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -366,12 +363,12 @@ def modify_external_account(
@classmethod
def delete_external_account(
cls,
account: str,
id: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
id,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"delete",
Expand All @@ -387,11 +384,11 @@ def delete_external_account(
@classmethod
def list_external_accounts(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -407,11 +404,11 @@ def list_external_accounts(
@classmethod
def create_login_link(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -427,11 +424,11 @@ def create_login_link(
@classmethod
def create_person(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -447,12 +444,12 @@ def create_person(
@classmethod
def retrieve_person(
cls,
account: str,
person: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
person,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand All @@ -469,12 +466,12 @@ def retrieve_person(
@classmethod
def modify_person(
cls,
account: str,
person: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
person,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
Expand All @@ -491,12 +488,12 @@ def modify_person(
@classmethod
def delete_person(
cls,
account: str,
person: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
person,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"delete",
Expand All @@ -513,11 +510,11 @@ def delete_person(
@classmethod
def list_persons(
cls,
account: str,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Any
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"get",
Expand Down
Loading

0 comments on commit de0d765

Please sign in to comment.