Skip to content

Commit

Permalink
Merge eac5ab6 into b795db5
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] authored Feb 1, 2024
2 parents b795db5 + eac5ab6 commit 98be696
Show file tree
Hide file tree
Showing 255 changed files with 8,347 additions and 6,758 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v796
v807
16 changes: 16 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def __getattr__(name):
capital as capital,
checkout as checkout,
climate as climate,
entitlements as entitlements,
financial_connections as financial_connections,
gift_cards as gift_cards,
identity as identity,
Expand Down Expand Up @@ -337,6 +338,18 @@ def __getattr__(name):
from stripe._customer_cash_balance_transaction_service import (
CustomerCashBalanceTransactionService as CustomerCashBalanceTransactionService,
)
from stripe._customer_entitlement import (
CustomerEntitlement as CustomerEntitlement,
)
from stripe._customer_entitlement_service import (
CustomerEntitlementService as CustomerEntitlementService,
)
from stripe._customer_entitlement_summary import (
CustomerEntitlementSummary as CustomerEntitlementSummary,
)
from stripe._customer_entitlement_summary_service import (
CustomerEntitlementSummaryService as CustomerEntitlementSummaryService,
)
from stripe._customer_funding_instructions_service import (
CustomerFundingInstructionsService as CustomerFundingInstructionsService,
)
Expand All @@ -357,6 +370,9 @@ def __getattr__(name):
from stripe._discount import Discount as Discount
from stripe._dispute import Dispute as Dispute
from stripe._dispute_service import DisputeService as DisputeService
from stripe._entitlements_service import (
EntitlementsService as EntitlementsService,
)
from stripe._ephemeral_key import EphemeralKey as EphemeralKey
from stripe._ephemeral_key_service import (
EphemeralKeyService as EphemeralKeyService,
Expand Down
108 changes: 72 additions & 36 deletions stripe/_account.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe import _util
from stripe._createable_api_resource import CreateableAPIResource
from stripe._deletable_api_resource import DeletableAPIResource
from stripe._expandable_field import ExpandableField
Expand All @@ -12,7 +11,7 @@
from stripe._request_options import RequestOptions
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import class_method_variant
from stripe._util import class_method_variant, sanitize_id
from typing import ClassVar, Dict, List, Optional, Union, cast, overload
from typing_extensions import (
Literal,
Expand All @@ -21,7 +20,6 @@
Unpack,
TYPE_CHECKING,
)
from urllib.parse import quote_plus

if TYPE_CHECKING:
from stripe._bank_account import BankAccount
Expand Down Expand Up @@ -292,6 +290,10 @@ class Capabilities(StripeObject):
"""
The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges.
"""
swish_payments: Optional[Literal["active", "inactive", "pending"]]
"""
The status of the Swish capability of the account, or whether the account can directly process Swish payments.
"""
tax_reporting_us_1099_k: Optional[
Literal["active", "inactive", "pending"]
]
Expand Down Expand Up @@ -1218,9 +1220,7 @@ 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.
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. After 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"]
"""
Expand Down Expand Up @@ -1565,6 +1565,12 @@ class CreateParamsCapabilities(TypedDict):
"""
The sofort_payments capability.
"""
swish_payments: NotRequired[
"Account.CreateParamsCapabilitiesSwishPayments"
]
"""
The swish_payments capability.
"""
tax_reporting_us_1099_k: NotRequired[
"Account.CreateParamsCapabilitiesTaxReportingUs1099K"
]
Expand Down Expand Up @@ -1790,6 +1796,12 @@ class CreateParamsCapabilitiesSofortPayments(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 CreateParamsCapabilitiesSwishPayments(TypedDict):
requested: NotRequired["bool"]
"""
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 CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict):
requested: NotRequired["bool"]
"""
Expand Down Expand Up @@ -2252,6 +2264,10 @@ class CreateParamsIndividual(TypedDict):
"""
The individual's registered address.
"""
relationship: NotRequired["Account.CreateParamsIndividualRelationship"]
"""
Describes the person's relationship to the account.
"""
ssn_last_4: NotRequired["str"]
"""
The last four digits of the individual's Social Security Number (U.S. only).
Expand Down Expand Up @@ -2387,6 +2403,28 @@ class CreateParamsIndividualRegisteredAddress(TypedDict):
State, county, province, or region.
"""

class CreateParamsIndividualRelationship(TypedDict):
director: NotRequired["bool"]
"""
Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.
"""
executive: NotRequired["bool"]
"""
Whether the person has significant responsibility to control, manage, or direct the organization.
"""
owner: NotRequired["bool"]
"""
Whether the person is an owner of the account's legal entity.
"""
percent_ownership: NotRequired["Literal['']|float"]
"""
The percent owned by the person of the account's legal entity.
"""
title: NotRequired["str"]
"""
The person's title (e.g., CEO, Support Engineer).
"""

class CreateParamsIndividualVerification(TypedDict):
additional_document: NotRequired[
"Account.CreateParamsIndividualVerificationAdditionalDocument"
Expand Down Expand Up @@ -3738,7 +3776,7 @@ def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account":
cls._static_request(
"post",
cls.class_url(),
params,
params=params,
),
)

Expand All @@ -3753,10 +3791,14 @@ def _cls_delete(
If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
"""
url = "%s/%s" % (cls.class_url(), quote_plus(sid))
url = "%s/%s" % (cls.class_url(), sanitize_id(sid))
return cast(
"Account",
cls._static_request("delete", url, params=params),
cls._static_request(
"delete",
url,
params=params,
),
)

@overload
Expand Down Expand Up @@ -3834,7 +3876,7 @@ def _cls_persons(
cls._static_request(
"get",
"/v1/accounts/{account}/persons".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand Down Expand Up @@ -3871,7 +3913,7 @@ def persons( # pyright: ignore[reportGeneralTypeIssues]
self._request(
"get",
"/v1/accounts/{account}/persons".format(
account=_util.sanitize_id(self.get("id"))
account=sanitize_id(self.get("id"))
),
params=params,
),
Expand All @@ -3891,7 +3933,7 @@ def _cls_reject(
cls._static_request(
"post",
"/v1/accounts/{account}/reject".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand Down Expand Up @@ -3932,7 +3974,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues]
self._request(
"post",
"/v1/accounts/{account}/reject".format(
account=_util.sanitize_id(self.get("id"))
account=sanitize_id(self.get("id"))
),
params=params,
),
Expand All @@ -3957,7 +3999,7 @@ def _build_instance_url(cls, sid):
if not sid:
return "/v1/account"
base = cls.class_url()
extn = quote_plus(sid)
extn = sanitize_id(sid)
return "%s/%s" % (base, extn)

def instance_url(self):
Expand Down Expand Up @@ -3992,8 +4034,8 @@ def retrieve_capability(
cls._static_request(
"get",
"/v1/accounts/{account}/capabilities/{capability}".format(
account=_util.sanitize_id(account),
capability=_util.sanitize_id(capability),
account=sanitize_id(account),
capability=sanitize_id(capability),
),
params=params,
),
Expand All @@ -4014,8 +4056,8 @@ def modify_capability(
cls._static_request(
"post",
"/v1/accounts/{account}/capabilities/{capability}".format(
account=_util.sanitize_id(account),
capability=_util.sanitize_id(capability),
account=sanitize_id(account),
capability=sanitize_id(capability),
),
params=params,
),
Expand All @@ -4033,7 +4075,7 @@ def list_capabilities(
cls._static_request(
"get",
"/v1/accounts/{account}/capabilities".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand All @@ -4053,7 +4095,7 @@ def create_external_account(
cls._static_request(
"post",
"/v1/accounts/{account}/external_accounts".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand All @@ -4074,8 +4116,7 @@ def retrieve_external_account(
cls._static_request(
"get",
"/v1/accounts/{account}/external_accounts/{id}".format(
account=_util.sanitize_id(account),
id=_util.sanitize_id(id),
account=sanitize_id(account), id=sanitize_id(id)
),
params=params,
),
Expand All @@ -4098,8 +4139,7 @@ def modify_external_account(
cls._static_request(
"post",
"/v1/accounts/{account}/external_accounts/{id}".format(
account=_util.sanitize_id(account),
id=_util.sanitize_id(id),
account=sanitize_id(account), id=sanitize_id(id)
),
params=params,
),
Expand All @@ -4120,8 +4160,7 @@ def delete_external_account(
cls._static_request(
"delete",
"/v1/accounts/{account}/external_accounts/{id}".format(
account=_util.sanitize_id(account),
id=_util.sanitize_id(id),
account=sanitize_id(account), id=sanitize_id(id)
),
params=params,
),
Expand All @@ -4141,7 +4180,7 @@ def list_external_accounts(
cls._static_request(
"get",
"/v1/accounts/{account}/external_accounts".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand All @@ -4161,7 +4200,7 @@ def create_login_link(
cls._static_request(
"post",
"/v1/accounts/{account}/login_links".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand All @@ -4179,7 +4218,7 @@ def create_person(
cls._static_request(
"post",
"/v1/accounts/{account}/persons".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand All @@ -4200,8 +4239,7 @@ def retrieve_person(
cls._static_request(
"get",
"/v1/accounts/{account}/persons/{person}".format(
account=_util.sanitize_id(account),
person=_util.sanitize_id(person),
account=sanitize_id(account), person=sanitize_id(person)
),
params=params,
),
Expand All @@ -4222,8 +4260,7 @@ def modify_person(
cls._static_request(
"post",
"/v1/accounts/{account}/persons/{person}".format(
account=_util.sanitize_id(account),
person=_util.sanitize_id(person),
account=sanitize_id(account), person=sanitize_id(person)
),
params=params,
),
Expand All @@ -4244,8 +4281,7 @@ def delete_person(
cls._static_request(
"delete",
"/v1/accounts/{account}/persons/{person}".format(
account=_util.sanitize_id(account),
person=_util.sanitize_id(person),
account=sanitize_id(account), person=sanitize_id(person)
),
params=params,
),
Expand All @@ -4263,7 +4299,7 @@ def list_persons(
cls._static_request(
"get",
"/v1/accounts/{account}/persons".format(
account=_util.sanitize_id(account)
account=sanitize_id(account)
),
params=params,
),
Expand Down
Loading

0 comments on commit 98be696

Please sign in to comment.