Skip to content

Commit

Permalink
Codegen inner resource classes
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Oct 26, 2023
1 parent 56bd44f commit beb6fa6
Show file tree
Hide file tree
Showing 115 changed files with 24,946 additions and 452 deletions.
1,526 changes: 1,517 additions & 9 deletions stripe/api_resources/account.py

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions stripe/api_resources/account_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,48 @@ class AccountLink(CreateableAPIResource["AccountLink"]):

class CreateParams(RequestOptions):
account: str
"""
The identifier of the account to create an account link for.
"""
collect: NotRequired[
"Literal['currently_due', 'eventually_due']|None"
]
"""
Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
refresh_url: NotRequired["str|None"]
"""
The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.
"""
return_url: NotRequired["str|None"]
"""
The URL that the user will be redirected to upon leaving or completing the linked flow.
"""
type: Literal["account_onboarding", "account_update"]
"""
The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`.
"""

created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
expires_at: int
"""
The timestamp at which this account link will expire.
"""
object: Literal["account_link"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
url: str
"""
The URL for the account link.
"""

@classmethod
def create(
Expand Down
37 changes: 35 additions & 2 deletions stripe/api_resources/account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# File generated from our OpenAPI spec
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.request_options import RequestOptions
from stripe.stripe_object import StripeObject
from typing import ClassVar, List, Optional, cast
from typing_extensions import (
Literal,
Expand All @@ -29,23 +28,57 @@ class AccountSession(CreateableAPIResource["AccountSession"]):

class CreateParams(RequestOptions):
account: str
"""
The identifier of the account to create an Account Session for.
"""
components: "AccountSession.CreateParamsComponents"
"""
Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not).
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""

class CreateParamsComponents(TypedDict):
account_onboarding: NotRequired[
"AccountSession.CreateParamsComponentsAccountOnboarding|None"
]
"""
Configuration for the account onboarding embedded component.
"""

class CreateParamsComponentsAccountOnboarding(TypedDict):
enabled: bool
"""
Whether the embedded component is enabled.
"""

account: str
"""
The ID of the account the AccountSession was created for
"""
client_secret: str
components: StripeObject
"""
The client secret of this AccountSession. Used on the client to set up secure access to the given `account`.
The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret.
Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled.
"""
components: Components
expires_at: int
"""
The timestamp at which this AccountSession will expire.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
object: Literal["account_session"]
"""
String representing the object's type. Objects of the same type share the same value.
"""

@classmethod
def create(
Expand Down
33 changes: 33 additions & 0 deletions stripe/api_resources/apple_pay_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,59 @@ class ApplePayDomain(
class CreateParams(RequestOptions):
domain_name: str
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""

class DeleteParams(RequestOptions):
pass

class ListParams(RequestOptions):
domain_name: NotRequired["str|None"]
ending_before: NotRequired["str|None"]
"""
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
limit: NotRequired["int|None"]
"""
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
"""
starting_after: NotRequired["str|None"]
"""
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
"""

class RetrieveParams(RequestOptions):
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""

created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
domain_name: str
id: str
"""
Unique identifier for the object.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
object: Literal["apple_pay_domain"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
deleted: Optional[Literal[True]]
"""
Always true for a deleted object
"""

@classmethod
def create(
Expand Down
12 changes: 12 additions & 0 deletions stripe/api_resources/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
class Application(StripeObject):
OBJECT_NAME: ClassVar[Literal["application"]] = "application"
id: str
"""
Unique identifier for the object.
"""
name: Optional[str]
"""
The name of the application.
"""
object: Literal["application"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
deleted: Optional[Literal[True]]
"""
Always true for a deleted object
"""
111 changes: 111 additions & 0 deletions stripe/api_resources/application_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,58 +35,169 @@ class ApplicationFee(ListableAPIResource["ApplicationFee"]):

class ListParams(RequestOptions):
charge: NotRequired["str|None"]
"""
Only return application fees for the charge specified by this charge ID.
"""
created: NotRequired["ApplicationFee.ListParamsCreated|int|None"]
ending_before: NotRequired["str|None"]
"""
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
limit: NotRequired["int|None"]
"""
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
"""
starting_after: NotRequired["str|None"]
"""
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
"""

class ListParamsCreated(TypedDict):
gt: NotRequired["int|None"]
"""
Minimum value to filter by (exclusive)
"""
gte: NotRequired["int|None"]
"""
Minimum value to filter by (inclusive)
"""
lt: NotRequired["int|None"]
"""
Maximum value to filter by (exclusive)
"""
lte: NotRequired["int|None"]
"""
Maximum value to filter by (inclusive)
"""

class RefundParams(RequestOptions):
amount: NotRequired["int|None"]
"""
A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired["Dict[str, str]|None"]
"""
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 RetrieveParams(RequestOptions):
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""

class CreateRefundParams(RequestOptions):
amount: NotRequired["int|None"]
"""
A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired["Dict[str, str]|None"]
"""
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 RetrieveRefundParams(RequestOptions):
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""

class ModifyRefundParams(RequestOptions):
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
metadata: NotRequired["Literal['']|Dict[str, str]|None"]
"""
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 ListRefundsParams(RequestOptions):
ending_before: NotRequired["str|None"]
"""
A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
"""
expand: NotRequired["List[str]|None"]
"""
Specifies which fields in the response should be expanded.
"""
limit: NotRequired["int|None"]
"""
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
"""
starting_after: NotRequired["str|None"]
"""
A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
"""

account: ExpandableField["Account"]
"""
ID of the Stripe account this fee was taken from.
"""
amount: int
"""
Amount earned, in cents (or local equivalent).
"""
amount_refunded: int
"""
Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)
"""
application: ExpandableField["Application"]
"""
ID of the Connect application that earned the fee.
"""
balance_transaction: Optional[ExpandableField["BalanceTransaction"]]
"""
Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
"""
charge: ExpandableField["Charge"]
"""
ID of the charge that the application fee was taken from.
"""
created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
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).
"""
id: str
"""
Unique identifier for the object.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
object: Literal["application_fee"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
originating_transaction: Optional[ExpandableField["Charge"]]
"""
ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter.
"""
refunded: bool
"""
Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
"""
refunds: ListObject["ApplicationFeeRefund"]
"""
A list of refunds that have been applied to the fee.
"""

@classmethod
def list(
Expand Down
Loading

0 comments on commit beb6fa6

Please sign in to comment.