Skip to content

Commit

Permalink
codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Dec 13, 2023
1 parent 1db8145 commit ac534f1
Show file tree
Hide file tree
Showing 114 changed files with 11,654 additions and 30 deletions.
549 changes: 549 additions & 0 deletions stripe/_account.py

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions stripe/_account_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,30 @@ def create(
params,
),
)

@classmethod
async def create_async(
cls,
api_key: Optional[str] = None,
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack[
"AccountLink.CreateParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "AccountLink":
"""
Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.
"""
return cast(
"AccountLink",
await cls._static_request_async(
"post",
cls.class_url(),
api_key,
idempotency_key,
stripe_version,
stripe_account,
params,
),
)
54 changes: 54 additions & 0 deletions stripe/_account_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,36 @@ def list(

return result

@classmethod
async def list_async(
cls,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack[
"AccountNotice.ListParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["AccountNotice"]:
"""
Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
"""
result = await cls._static_request_async(
"get",
cls.class_url(),
api_key=api_key,
stripe_version=stripe_version,
stripe_account=stripe_account,
params=params,
)
if not isinstance(result, ListObject):

raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)

return result

@classmethod
def modify(
cls, id: str, **params: Unpack["AccountNotice.ModifyParams"]
Expand All @@ -205,6 +235,19 @@ def modify(
cls._static_request("post", url, params=params),
)

@classmethod
async def modify_async(
cls, id: str, **params: Unpack["AccountNotice.ModifyParams"]
) -> "AccountNotice":
"""
Updates an AccountNotice object.
"""
url = "%s/%s" % (cls.class_url(), quote_plus(id))
return cast(
"AccountNotice",
await cls._static_request_async("post", url, params=params),
)

@classmethod
def retrieve(
cls, id: str, **params: Unpack["AccountNotice.RetrieveParams"]
Expand All @@ -216,4 +259,15 @@ def retrieve(
instance.refresh()
return instance

@classmethod
async def retrieve_async(
cls, id: str, **params: Unpack["AccountNotice.RetrieveParams"]
) -> "AccountNotice":
"""
Retrieves an AccountNotice object.
"""
instance = cls(id, **params)
await instance.refresh_async()
return instance

_inner_class_types = {"email": Email, "linked_objects": LinkedObjects}
27 changes: 27 additions & 0 deletions stripe/_account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,31 @@ def create(
),
)

@classmethod
async def create_async(
cls,
api_key: Optional[str] = None,
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack[
"AccountSession.CreateParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "AccountSession":
"""
Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access.
"""
return cast(
"AccountSession",
await cls._static_request_async(
"post",
cls.class_url(),
api_key,
idempotency_key,
stripe_version,
stripe_account,
params,
),
)

_inner_class_types = {"components": Components}
2 changes: 1 addition & 1 deletion stripe/_api_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

class _ApiVersion:
CURRENT = "2023-10-16"
PREVIEW = "2023-10-26.preview-v2"
PREVIEW = "2023-12-11.preview-v2"
81 changes: 81 additions & 0 deletions stripe/_apple_pay_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,46 @@ def create(
),
)

@classmethod
async def create_async(
cls,
api_key: Optional[str] = None,
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack[
"ApplePayDomain.CreateParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "ApplePayDomain":
"""
Create an apple pay domain.
"""
return cast(
"ApplePayDomain",
await cls._static_request_async(
"post",
cls.class_url(),
api_key,
idempotency_key,
stripe_version,
stripe_account,
params,
),
)

@classmethod
async def delete_async(
cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"]
) -> "ApplePayDomain":
"""
Delete an apple pay domain.
"""
url = "%s/%s" % (cls.class_url(), quote_plus(sid))
return cast(
"ApplePayDomain",
await cls._static_request_async("delete", url, params=params),
)

@classmethod
def _cls_delete(
cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"]
Expand Down Expand Up @@ -177,6 +217,36 @@ def list(

return result

@classmethod
async def list_async(
cls,
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack[
"ApplePayDomain.ListParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["ApplePayDomain"]:
"""
List apple pay domains.
"""
result = await cls._static_request_async(
"get",
cls.class_url(),
api_key=api_key,
stripe_version=stripe_version,
stripe_account=stripe_account,
params=params,
)
if not isinstance(result, ListObject):

raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)

return result

@classmethod
def retrieve(
cls, id: str, **params: Unpack["ApplePayDomain.RetrieveParams"]
Expand All @@ -188,6 +258,17 @@ def retrieve(
instance.refresh()
return instance

@classmethod
async def retrieve_async(
cls, id: str, **params: Unpack["ApplePayDomain.RetrieveParams"]
) -> "ApplePayDomain":
"""
Retrieve an apple pay domain.
"""
instance = cls(id, **params)
await instance.refresh_async()
return instance

@classmethod
def class_url(cls):
return "/v1/apple_pay/domains"
Loading

0 comments on commit ac534f1

Please sign in to comment.