-
Notifications
You must be signed in to change notification settings - Fork 458
⚠️ Unify resource and service method parameters into one class #1596
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
Open
helenye-stripe
wants to merge
1
commit into
master
Choose a base branch
from
helenye-params
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+116,664
−124,740
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
""" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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