Skip to content

Commit

Permalink
Update generated code (#1193)
Browse files Browse the repository at this point in the history
* Update generated code for v756

* Update generated code for v757

* Update generated code for v758

* Update generated code for v760

* Update generated code for v761

* Update generated code for v761

* Update generated code for v762

* Update generated code for v763

* Update generated code for v763

* Update generated code for v764

* Update generated code for v766

* Update generated code for v767

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and anniel-stripe authored Jan 18, 2024
1 parent c1a7c80 commit ad1d0aa
Show file tree
Hide file tree
Showing 15 changed files with 469 additions and 27 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v755
v767
116 changes: 113 additions & 3 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,12 @@ class CreateExternalAccountParams(RequestOptions):
"""
Specifies which fields in the response should be expanded.
"""
external_account: str
external_account: Union[
str,
"Account.CreateExternalAccountParamsCard",
"Account.CreateExternalAccountParamsBankAccount",
"Account.CreateExternalAccountParamsCardToken",
]
"""
Please refer to full [documentation](https://stripe.com/docs/api) instead.
"""
Expand All @@ -1042,6 +1047,57 @@ class CreateExternalAccountParams(RequestOptions):
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 CreateExternalAccountParamsBankAccount(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-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.
"""

class CreateExternalAccountParamsCard(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 CreateExternalAccountParamsCardToken(TypedDict):
object: Literal["card"]
currency: NotRequired["str"]
token: str

class CreateLoginLinkParams(RequestOptions):
expand: NotRequired["List[str]"]
"""
Expand Down Expand Up @@ -1091,7 +1147,9 @@ class CreateParams(RequestOptions):
"""
Specifies which fields in the response should be expanded.
"""
external_account: NotRequired["str"]
external_account: NotRequired[
"str|Account.CreateParamsBankAccount|Account.CreateParamsCard|Account.CreateParamsCardToken"
]
"""
A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
Expand All @@ -1118,6 +1176,33 @@ class CreateParams(RequestOptions):
The type of Stripe account to create. May be one of `custom`, `express` or `standard`.
"""

class CreateParamsBankAccount(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-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.
"""

class CreateParamsBusinessProfile(TypedDict):
mcc: NotRequired["str"]
"""
Expand Down Expand Up @@ -1638,6 +1723,31 @@ class CreateParamsCapabilitiesZipPayments(TypedDict):
Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
"""

class CreateParamsCard(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.
"""
default_for_currency: NotRequired["bool"]

class CreateParamsCardToken(TypedDict):
object: Literal["card"]
currency: NotRequired["str"]
token: str

class CreateParamsCompany(TypedDict):
address: NotRequired["Account.CreateParamsCompanyAddress"]
"""
Expand Down Expand Up @@ -1701,7 +1811,7 @@ class CreateParamsCompany(TypedDict):
"Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']"
]
"""
The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value.
"""
tax_id: NotRequired["str"]
"""
Expand Down
4 changes: 3 additions & 1 deletion stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ class Ideal(StripeObject):
"knab",
"moneyou",
"n26",
"nn",
"rabobank",
"regiobank",
"revolut",
Expand All @@ -1072,7 +1073,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -1085,6 +1086,7 @@ class Ideal(StripeObject):
"INGBNL2A",
"KNABNL2H",
"MOYONL21",
"NNBANL2G",
"NTSBDEB1",
"RABONL2U",
"RBRBNL21",
Expand Down
4 changes: 2 additions & 2 deletions stripe/_customer_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class PricingTable(StripeObject):
Whether the pricing table is enabled.
"""

buy_button: Optional[BuyButton]
buy_button: BuyButton
"""
This hash contains whether the buy button is enabled.
"""
pricing_table: Optional[PricingTable]
pricing_table: PricingTable
"""
This hash contains whether the pricing table is enabled.
"""
Expand Down
20 changes: 10 additions & 10 deletions stripe/_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,6 @@ def retrieve(
instance.refresh()
return instance

# This resource can have two different object names. In latter API
# versions, only `file` is used, but since stripe-python may be used with
# any API version, we need to support deserializing the older
# `file_upload` object into the same class.
OBJECT_NAME_ALT = "file_upload"

@classmethod
def class_url(cls):
return "/v1/files"

@classmethod
def create(
# 'api_version' is deprecated, please use 'stripe_version'
Expand Down Expand Up @@ -222,6 +212,16 @@ def create(
),
)

# This resource can have two different object names. In latter API
# versions, only `file` is used, but since stripe-python may be used with
# any API version, we need to support deserializing the older
# `file_upload` object into the same class.
OBJECT_NAME_ALT = "file_upload"

@classmethod
def class_url(cls):
return "/v1/files"


# For backwards compatibility, the `File` class is aliased to `FileUpload`.
FileUpload = File
Loading

0 comments on commit ad1d0aa

Please sign in to comment.