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

Update generated code #1199

Merged
merged 20 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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 OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v767
v793
69 changes: 59 additions & 10 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,27 @@ class Account(
enabled to make live charges or receive payouts.

For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that
account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links)
for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express**
below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions),
some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts).
"""

OBJECT_NAME: ClassVar[Literal["account"]] = "account"

class BusinessProfile(StripeObject):
class AnnualRevenue(StripeObject):
amount: Optional[int]
"""
A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
"""
currency: Optional[str]
"""
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
"""
fiscal_year_end: Optional[str]
"""
The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023.
"""

class MonthlyEstimatedRevenue(StripeObject):
amount: int
"""
Expand Down Expand Up @@ -91,6 +104,14 @@ class SupportAddress(StripeObject):
State, county, province, or region.
"""

annual_revenue: Optional[AnnualRevenue]
"""
The applicant's gross annual revenue for its preceding fiscal year.
"""
estimated_worker_count: Optional[int]
"""
An estimated upper bound of employees, contractors, vendors, etc. currently working for the business.
"""
mcc: Optional[str]
"""
[The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
Expand Down Expand Up @@ -125,6 +146,7 @@ class SupportAddress(StripeObject):
The business's publicly available website.
"""
_inner_class_types = {
"annual_revenue": AnnualRevenue,
"monthly_estimated_revenue": MonthlyEstimatedRevenue,
"support_address": SupportAddress,
}
Expand Down Expand Up @@ -486,6 +508,7 @@ class Document(StripeObject):
"public_company",
"public_corporation",
"public_partnership",
"registered_charity",
"single_member_llc",
"sole_establishment",
"sole_proprietorship",
Expand Down Expand Up @@ -1117,15 +1140,15 @@ class CreateParams(RequestOptions):
"Literal['company', 'government_entity', 'individual', 'non_profit']"
]
"""
The business type.
The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
"""
capabilities: NotRequired["Account.CreateParamsCapabilities"]
"""
Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. whether it has been requested or not). Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. An account may have some of its requested capabilities be active and some be inactive.
"""
company: NotRequired["Account.CreateParamsCompany"]
"""
Information about the company or business. This field is available for any `business_type`.
Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
"""
country: NotRequired["str"]
"""
Expand Down Expand Up @@ -1154,10 +1177,12 @@ class CreateParams(RequestOptions):
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.

By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.

Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
"""
individual: NotRequired["Account.CreateParamsIndividual"]
"""
Information about the person represented by the account. This field is null unless `business_type` is set to `individual`.
Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts.
"""
metadata: NotRequired["Literal['']|Dict[str, str]"]
"""
Expand All @@ -1169,7 +1194,7 @@ class CreateParams(RequestOptions):
"""
tos_acceptance: NotRequired["Account.CreateParamsTosAcceptance"]
"""
Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance).
Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts.
"""
type: NotRequired["Literal['custom', 'express', 'standard']"]
"""
Expand Down Expand Up @@ -1204,6 +1229,16 @@ class CreateParamsBankAccount(TypedDict):
"""

class CreateParamsBusinessProfile(TypedDict):
annual_revenue: NotRequired[
"Account.CreateParamsBusinessProfileAnnualRevenue"
]
"""
The applicant's gross annual revenue for its preceding fiscal year.
"""
estimated_worker_count: NotRequired["int"]
"""
An estimated upper bound of employees, contractors, vendors, etc. currently working for the business.
"""
mcc: NotRequired["str"]
"""
[The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.
Expand Down Expand Up @@ -1245,6 +1280,20 @@ class CreateParamsBusinessProfile(TypedDict):
The business's publicly available website.
"""

class CreateParamsBusinessProfileAnnualRevenue(TypedDict):
amount: int
"""
A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
"""
currency: str
"""
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
"""
fiscal_year_end: str
"""
The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023.
"""

class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict):
amount: int
"""
Expand Down Expand Up @@ -1808,7 +1857,7 @@ class CreateParamsCompany(TypedDict):
The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).
"""
structure: NotRequired[
"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']"
"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', 'registered_charity', '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. Pass an empty string to unset this value.
Expand Down Expand Up @@ -3506,7 +3555,7 @@ class RetrievePersonParams(RequestOptions):
Literal["company", "government_entity", "individual", "non_profit"]
]
"""
The business type.
The business type. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts.
"""
capabilities: Optional[Capabilities]
charges_enabled: Optional[bool]
Expand Down Expand Up @@ -3537,7 +3586,7 @@ class RetrievePersonParams(RequestOptions):
"""
external_accounts: Optional[ListObject[Union["BankAccount", "Card"]]]
"""
External accounts (bank accounts and debit cards) currently attached to this account
External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true.
"""
future_requirements: Optional[FutureRequirements]
id: str
Expand Down
20 changes: 18 additions & 2 deletions stripe/_account_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from stripe._createable_api_resource import CreateableAPIResource
from stripe._request_options import RequestOptions
from typing import ClassVar, List, Optional, cast
from typing_extensions import Literal, NotRequired, Unpack
from typing_extensions import Literal, NotRequired, TypedDict, Unpack


class AccountLink(CreateableAPIResource["AccountLink"]):
Expand All @@ -23,7 +23,13 @@ class CreateParams(RequestOptions):
"""
collect: NotRequired["Literal['currently_due', 'eventually_due']"]
"""
Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.
The collect parameter is deprecated. Use `collection_options` instead.
"""
collection_options: NotRequired[
"AccountLink.CreateParamsCollectionOptions"
]
"""
Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow.
"""
expand: NotRequired["List[str]"]
"""
Expand All @@ -42,6 +48,16 @@ class CreateParams(RequestOptions):
The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`.
"""

class CreateParamsCollectionOptions(TypedDict):
fields: Literal["currently_due", "eventually_due"]
"""
Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`.
"""
future_requirements: NotRequired["Literal['include', 'omit']"]
"""
Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`.
"""

created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
Expand Down
6 changes: 3 additions & 3 deletions stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2318,9 +2318,9 @@ def create(
] # pyright: ignore[reportGeneralTypeIssues]
) -> "Charge":
"""
Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead
of using this method. Confirmation of the PaymentIntent creates the Charge
object used to request payment, so this method is limited to legacy integrations.
This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents)
to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge
object used to request payment.
"""
return cast(
"Charge",
Expand Down
2 changes: 1 addition & 1 deletion stripe/_customer_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PricingTable(StripeObject):
class CreateParams(RequestOptions):
components: "CustomerSession.CreateParamsComponents"
"""
Configuration for each component. 1 component must be enabled.
Configuration for each component. Exactly 1 component must be enabled.
"""
customer: str
"""
Expand Down
32 changes: 27 additions & 5 deletions stripe/_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,9 @@ class Installments(StripeObject):
"""

installments: Optional[Installments]
request_three_d_secure: Optional[Literal["any", "automatic"]]
request_three_d_secure: Optional[
Literal["any", "automatic", "challenge"]
]
"""
We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
"""
Expand Down Expand Up @@ -1256,7 +1258,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict):

For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
"""
request_three_d_secure: NotRequired["Literal['any', 'automatic']"]
request_three_d_secure: NotRequired[
"Literal['any', 'automatic', 'challenge']"
]
"""
We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
"""
Expand Down Expand Up @@ -1914,7 +1918,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict):

For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
"""
request_three_d_secure: NotRequired["Literal['any', 'automatic']"]
request_three_d_secure: NotRequired[
"Literal['any', 'automatic', 'challenge']"
]
"""
We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
"""
Expand Down Expand Up @@ -2608,6 +2614,10 @@ class UpcomingLinesParamsDiscount(TypedDict):
"""
ID of an existing discount on the object (or one of its ancestors) to reuse.
"""
promotion_code: NotRequired["str"]
"""
ID of the promotion code to create a new discount for.
"""

class UpcomingLinesParamsInvoiceItem(TypedDict):
amount: NotRequired["int"]
Expand Down Expand Up @@ -2690,6 +2700,10 @@ class UpcomingLinesParamsInvoiceItemDiscount(TypedDict):
"""
ID of an existing discount on the object (or one of its ancestors) to reuse.
"""
promotion_code: NotRequired["str"]
"""
ID of the promotion code to create a new discount for.
"""

class UpcomingLinesParamsInvoiceItemPeriod(TypedDict):
end: int
Expand Down Expand Up @@ -2822,7 +2836,7 @@ class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict):
"""
interval_count: NotRequired["int"]
"""
The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
"""

class UpcomingParams(RequestOptions):
Expand Down Expand Up @@ -3139,6 +3153,10 @@ class UpcomingParamsDiscount(TypedDict):
"""
ID of an existing discount on the object (or one of its ancestors) to reuse.
"""
promotion_code: NotRequired["str"]
"""
ID of the promotion code to create a new discount for.
"""

class UpcomingParamsInvoiceItem(TypedDict):
amount: NotRequired["int"]
Expand Down Expand Up @@ -3219,6 +3237,10 @@ class UpcomingParamsInvoiceItemDiscount(TypedDict):
"""
ID of an existing discount on the object (or one of its ancestors) to reuse.
"""
promotion_code: NotRequired["str"]
"""
ID of the promotion code to create a new discount for.
"""

class UpcomingParamsInvoiceItemPeriod(TypedDict):
end: int
Expand Down Expand Up @@ -3351,7 +3373,7 @@ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict):
"""
interval_count: NotRequired["int"]
"""
The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).
The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
"""

class VoidInvoiceParams(RequestOptions):
Expand Down
Loading