Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress type errors from latest pyright #1126

Merged
merged 3 commits into from
Nov 10, 2023
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cryptography<40
tox
twine
pyright <= 1.1.334
pyright
pytest-cov >= 2.8.1, < 2.11.0
pytest-mock >= 2.0.0
pytest-xdist >= 1.31.0
Expand Down
96 changes: 72 additions & 24 deletions stripe/api_resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -3494,7 +3494,9 @@ def create(
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.CreateParams"]
**params: Unpack[
"Account.CreateParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Account":
"""
With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users.
Expand Down Expand Up @@ -3582,7 +3584,9 @@ def list(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ListParams"]
**params: Unpack[
"Account.ListParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Account"]:
"""
Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty.
Expand Down Expand Up @@ -3611,7 +3615,9 @@ def _cls_persons(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.PersonsParams"]
**params: Unpack[
"Account.PersonsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Person"]:
"""
Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
Expand All @@ -3637,7 +3643,9 @@ def persons(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.PersonsParams"]
**params: Unpack[
"Account.PersonsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Person"]:
"""
Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
Expand All @@ -3648,7 +3656,9 @@ def persons(
def persons(
self,
idempotency_key: Optional[str] = None,
**params: Unpack["Account.PersonsParams"]
**params: Unpack[
"Account.PersonsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Person"]:
"""
Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
Expand All @@ -3659,7 +3669,9 @@ def persons(
def persons( # pyright: ignore[reportGeneralTypeIssues]
self,
idempotency_key: Optional[str] = None,
**params: Unpack["Account.PersonsParams"]
**params: Unpack[
"Account.PersonsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Person"]:
"""
Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
Expand All @@ -3683,7 +3695,9 @@ def _cls_reject(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.RejectParams"]
**params: Unpack[
"Account.RejectParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Account":
"""
With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
Expand Down Expand Up @@ -3711,7 +3725,9 @@ def reject(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.RejectParams"]
**params: Unpack[
"Account.RejectParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Account":
"""
With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
Expand All @@ -3724,7 +3740,9 @@ def reject(
def reject(
self,
idempotency_key: Optional[str] = None,
**params: Unpack["Account.RejectParams"]
**params: Unpack[
"Account.RejectParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Account":
"""
With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
Expand All @@ -3737,7 +3755,9 @@ def reject(
def reject( # pyright: ignore[reportGeneralTypeIssues]
self,
idempotency_key: Optional[str] = None,
**params: Unpack["Account.RejectParams"]
**params: Unpack[
"Account.RejectParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Account":
"""
With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
Expand Down Expand Up @@ -3807,7 +3827,9 @@ def retrieve_capability(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.RetrieveCapabilityParams"]
**params: Unpack[
"Account.RetrieveCapabilityParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Capability":
"""
Retrieves information about the specified Account Capability.
Expand Down Expand Up @@ -3835,7 +3857,9 @@ def modify_capability(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ModifyCapabilityParams"]
**params: Unpack[
"Account.ModifyCapabilityParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Capability":
"""
Updates an existing Account Capability. Request or remove a capability by updating its requested parameter.
Expand All @@ -3862,7 +3886,9 @@ def list_capabilities(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ListCapabilitiesParams"]
**params: Unpack[
"Account.ListCapabilitiesParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Capability"]:
"""
Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.
Expand All @@ -3888,7 +3914,9 @@ def create_external_account(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.CreateExternalAccountParams"]
**params: Unpack[
"Account.CreateExternalAccountParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> Union["BankAccount", "Card"]:
"""
Create an external account for a given account.
Expand All @@ -3915,7 +3943,9 @@ def retrieve_external_account(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.RetrieveExternalAccountParams"]
**params: Unpack[
"Account.RetrieveExternalAccountParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> Union["BankAccount", "Card"]:
"""
Retrieve a specified external account for a given account.
Expand All @@ -3942,7 +3972,9 @@ def modify_external_account(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ModifyExternalAccountParams"]
**params: Unpack[
"Account.ModifyExternalAccountParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> Union["BankAccount", "Card"]:
"""
Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. Other bank account details are not editable by design.
Expand Down Expand Up @@ -3971,7 +4003,9 @@ def delete_external_account(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.DeleteExternalAccountParams"]
**params: Unpack[
"Account.DeleteExternalAccountParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> Union["BankAccount", "Card"]:
"""
Delete a specified external account for a given account.
Expand All @@ -3997,7 +4031,9 @@ def list_external_accounts(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ListExternalAccountsParams"]
**params: Unpack[
"Account.ListExternalAccountsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject[Union["BankAccount", "Card"]]:
"""
List external accounts for an account.
Expand All @@ -4023,7 +4059,9 @@ def create_login_link(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.CreateLoginLinkParams"]
**params: Unpack[
"Account.CreateLoginLinkParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "LoginLink":
"""
Creates a single-use login link for an Express account to access their Stripe dashboard.
Expand Down Expand Up @@ -4051,7 +4089,9 @@ def create_person(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.CreatePersonParams"]
**params: Unpack[
"Account.CreatePersonParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Person":
"""
Creates a new person.
Expand All @@ -4078,7 +4118,9 @@ def retrieve_person(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.RetrievePersonParams"]
**params: Unpack[
"Account.RetrievePersonParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Person":
"""
Retrieves an existing person.
Expand Down Expand Up @@ -4106,7 +4148,9 @@ def modify_person(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ModifyPersonParams"]
**params: Unpack[
"Account.ModifyPersonParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Person":
"""
Updates an existing person.
Expand Down Expand Up @@ -4134,7 +4178,9 @@ def delete_person(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.DeletePersonParams"]
**params: Unpack[
"Account.DeletePersonParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Person":
"""
Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file.
Expand All @@ -4161,7 +4207,9 @@ def list_persons(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["Account.ListPersonsParams"]
**params: Unpack[
"Account.ListPersonsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["Person"]:
"""
Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/account_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def create(
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["AccountLink.CreateParams"]
**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.
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def create(
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["AccountSession.CreateParams"]
**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.
Expand Down
8 changes: 6 additions & 2 deletions stripe/api_resources/apple_pay_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def create(
idempotency_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["ApplePayDomain.CreateParams"]
**params: Unpack[
"ApplePayDomain.CreateParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> "ApplePayDomain":
"""
Create an apple pay domain.
Expand Down Expand Up @@ -154,7 +156,9 @@ def list(
api_key: Optional[str] = None,
stripe_version: Optional[str] = None,
stripe_account: Optional[str] = None,
**params: Unpack["ApplePayDomain.ListParams"]
**params: Unpack[
"ApplePayDomain.ListParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["ApplePayDomain"]:
"""
List apple pay domains.
Expand Down
Loading