Skip to content

Commit

Permalink
Update generated code for v510
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Sep 6, 2023
1 parent b9ad763 commit 6b01abb
Show file tree
Hide file tree
Showing 59 changed files with 489 additions and 205 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v507
v510
16 changes: 10 additions & 6 deletions stripe/api_resources/application_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
from stripe import util
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import nested_resource_class_methods
from stripe.api_resources.expandable_field import ExpandableField
from stripe.api_resources.list_object import ListObject
from typing import Any
from typing import Optional
from typing_extensions import Literal

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.account import Account
from stripe.api_resources.application import Application
from stripe.api_resources.balance_transaction import BalanceTransaction
from stripe.api_resources.charge import Charge
from stripe.api_resources.application_fee_refund import (
ApplicationFeeRefund,
)
Expand All @@ -24,18 +28,18 @@
)
class ApplicationFee(ListableAPIResource["ApplicationFee"]):
OBJECT_NAME = "application_fee"
account: Any
account: ExpandableField["Account"]
amount: int
amount_refunded: int
application: Any
balance_transaction: Optional[Any]
charge: Any
application: ExpandableField["Application"]
balance_transaction: Optional[ExpandableField["BalanceTransaction"]]
charge: ExpandableField["Charge"]
created: str
currency: str
id: str
livemode: bool
object: Literal["application_fee"]
originating_transaction: Optional[Any]
originating_transaction: Optional[ExpandableField["Charge"]]
refunded: bool
refunds: ListObject["ApplicationFeeRefund"]

Expand Down
13 changes: 9 additions & 4 deletions stripe/api_resources/application_fee_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
# File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function

from stripe.api_resources import ApplicationFee
from stripe.api_resources.abstract import UpdateableAPIResource
from typing import Any
from stripe.api_resources.application_fee import ApplicationFee
from stripe.api_resources.expandable_field import ExpandableField
from typing import Dict
from typing import Optional
from typing_extensions import Literal
from urllib.parse import quote_plus

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.balance_transaction import BalanceTransaction


class ApplicationFeeRefund(UpdateableAPIResource["ApplicationFeeRefund"]):
"""
Expand All @@ -22,10 +27,10 @@ class ApplicationFeeRefund(UpdateableAPIResource["ApplicationFeeRefund"]):

OBJECT_NAME = "fee_refund"
amount: int
balance_transaction: Optional[Any]
balance_transaction: Optional[ExpandableField["BalanceTransaction"]]
created: str
currency: str
fee: Any
fee: ExpandableField["ApplicationFee"]
id: str
metadata: Optional[Dict[str, str]]
object: Literal["fee_refund"]
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import absolute_import, division, print_function

from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.expandable_field import ExpandableField
from stripe.stripe_object import StripeObject
from typing import Any
from typing import List
Expand Down Expand Up @@ -31,6 +32,6 @@ class BalanceTransaction(ListableAPIResource["BalanceTransaction"]):
net: int
object: Literal["balance_transaction"]
reporting_category: str
source: Optional[Any]
source: Optional[ExpandableField[Any]]
status: str
type: str
7 changes: 5 additions & 2 deletions stripe/api_resources/bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from stripe.api_resources.abstract import VerifyMixin
from stripe.api_resources.account import Account
from stripe.api_resources.customer import Customer
from stripe.api_resources.expandable_field import ExpandableField
from stripe.stripe_object import StripeObject
from typing import Any
from typing import Dict
Expand All @@ -33,15 +34,15 @@ class BankAccount(
"""

OBJECT_NAME = "bank_account"
account: Optional[Any]
account: Optional[ExpandableField["Account"]]
account_holder_name: Optional[str]
account_holder_type: Optional[str]
account_type: Optional[str]
available_payout_methods: Optional[List[str]]
bank_name: Optional[str]
country: str
currency: str
customer: Optional[Any]
customer: Optional[ExpandableField[Any]]
default_for_currency: Optional[bool]
fingerprint: Optional[str]
future_requirements: Optional[StripeObject]
Expand Down Expand Up @@ -69,6 +70,8 @@ def instance_url(self):

base = Account.class_url()
assert account is not None
if isinstance(account, Account):
account = account.id
owner_extn = quote_plus(account)
class_base = "external_accounts"

Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/billing_portal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.expandable_field import ExpandableField
from stripe.stripe_object import StripeObject
from typing import Any
from typing import Dict
Expand All @@ -23,7 +24,7 @@ class Configuration(

OBJECT_NAME = "billing_portal.configuration"
active: bool
application: Optional[Any]
application: Optional[ExpandableField[Any]]
business_profile: StripeObject
created: str
default_return_url: Optional[str]
Expand Down
9 changes: 7 additions & 2 deletions stripe/api_resources/billing_portal/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
from __future__ import absolute_import, division, print_function

from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.expandable_field import ExpandableField
from stripe.stripe_object import StripeObject
from typing import Any
from typing import Optional
from typing_extensions import Literal

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.billing_portal.configuration import Configuration


class Session(CreateableAPIResource["Session"]):
"""
Expand All @@ -28,7 +33,7 @@ class Session(CreateableAPIResource["Session"]):
"""

OBJECT_NAME = "billing_portal.session"
configuration: Any
configuration: ExpandableField["Configuration"]
created: str
customer: str
flow: Optional[StripeObject]
Expand Down
6 changes: 4 additions & 2 deletions stripe/api_resources/capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.account import Account
from stripe.api_resources.expandable_field import ExpandableField
from stripe.stripe_object import StripeObject
from typing import Any
from typing import Optional
from typing_extensions import Literal
from urllib.parse import quote_plus
Expand All @@ -19,7 +19,7 @@ class Capability(UpdateableAPIResource["Capability"]):
"""

OBJECT_NAME = "capability"
account: Any
account: ExpandableField["Account"]
future_requirements: StripeObject
id: str
object: Literal["capability"]
Expand All @@ -32,6 +32,8 @@ def instance_url(self):
token = self.id
account = self.account
base = Account.class_url()
if isinstance(account, Account):
account = account.id
acct_extn = quote_plus(account)
extn = quote_plus(token)
return "%s/%s/capabilities/%s" % (base, acct_extn, extn)
Expand Down
7 changes: 5 additions & 2 deletions stripe/api_resources/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.account import Account
from stripe.api_resources.customer import Customer
from stripe.api_resources.expandable_field import ExpandableField
from typing import Any
from typing import Dict
from typing import List
Expand All @@ -25,7 +26,7 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]):
"""

OBJECT_NAME = "card"
account: Optional[Any]
account: Optional[ExpandableField["Account"]]
address_city: Optional[str]
address_country: Optional[str]
address_line1: Optional[str]
Expand All @@ -38,7 +39,7 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]):
brand: str
country: Optional[str]
currency: Optional[str]
customer: Optional[Any]
customer: Optional[ExpandableField[Any]]
cvc_check: Optional[str]
default_for_currency: Optional[bool]
description: str
Expand Down Expand Up @@ -73,6 +74,8 @@ def instance_url(self):

base = Account.class_url()
assert account is not None
if isinstance(account, Account):
account = account.id
owner_extn = quote_plus(account)
class_base = "external_accounts"

Expand Down
33 changes: 22 additions & 11 deletions stripe/api_resources/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import SearchableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.expandable_field import ExpandableField
from stripe.api_resources.list_object import ListObject
from stripe.stripe_object import StripeObject
from typing import Any
Expand All @@ -17,7 +18,15 @@
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.application import Application
from stripe.api_resources.application_fee import ApplicationFee
from stripe.api_resources.balance_transaction import BalanceTransaction
from stripe.api_resources.invoice import Invoice
from stripe.api_resources.account import Account
from stripe.api_resources.payment_intent import PaymentIntent
from stripe.api_resources.refund import Refund
from stripe.api_resources.review import Review
from stripe.api_resources.transfer import Transfer


class Charge(
Expand All @@ -37,33 +46,35 @@ class Charge(
amount: int
amount_captured: int
amount_refunded: int
application: Optional[Any]
application_fee: Optional[Any]
application: Optional[ExpandableField["Application"]]
application_fee: Optional[ExpandableField["ApplicationFee"]]
application_fee_amount: Optional[int]
authorization_code: str
balance_transaction: Optional[Any]
balance_transaction: Optional[ExpandableField["BalanceTransaction"]]
billing_details: StripeObject
calculated_statement_descriptor: Optional[str]
captured: bool
created: str
currency: str
customer: Optional[Any]
customer: Optional[ExpandableField[Any]]
description: Optional[str]
disputed: bool
failure_balance_transaction: Optional[Any]
failure_balance_transaction: Optional[
ExpandableField["BalanceTransaction"]
]
failure_code: Optional[str]
failure_message: Optional[str]
fraud_details: Optional[StripeObject]
id: str
invoice: Optional[Any]
invoice: Optional[ExpandableField["Invoice"]]
level3: StripeObject
livemode: bool
metadata: Dict[str, str]
object: Literal["charge"]
on_behalf_of: Optional[Any]
on_behalf_of: Optional[ExpandableField["Account"]]
outcome: Optional[StripeObject]
paid: bool
payment_intent: Optional[Any]
payment_intent: Optional[ExpandableField["PaymentIntent"]]
payment_method: Optional[str]
payment_method_details: Optional[StripeObject]
radar_options: StripeObject
Expand All @@ -72,14 +83,14 @@ class Charge(
receipt_url: Optional[str]
refunded: bool
refunds: Optional[ListObject["Refund"]]
review: Optional[Any]
review: Optional[ExpandableField["Review"]]
shipping: Optional[StripeObject]
source: Optional[Any]
source_transfer: Optional[Any]
source_transfer: Optional[ExpandableField["Transfer"]]
statement_descriptor: Optional[str]
statement_descriptor_suffix: Optional[str]
status: str
transfer: Any
transfer: ExpandableField["Transfer"]
transfer_data: Optional[StripeObject]
transfer_group: Optional[str]

Expand Down
18 changes: 12 additions & 6 deletions stripe/api_resources/checkout/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from stripe import util
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.expandable_field import ExpandableField
from stripe.api_resources.list_object import ListObject
from stripe.stripe_object import StripeObject
from typing import Any
Expand All @@ -16,7 +17,12 @@
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.invoice import Invoice
from stripe.api_resources.line_item import LineItem
from stripe.api_resources.payment_intent import PaymentIntent
from stripe.api_resources.payment_link import PaymentLink
from stripe.api_resources.setup_intent import SetupIntent
from stripe.api_resources.subscription import Subscription


class Session(
Expand Down Expand Up @@ -55,36 +61,36 @@ class Session(
currency_conversion: Optional[StripeObject]
custom_fields: List[StripeObject]
custom_text: StripeObject
customer: Optional[Any]
customer: Optional[ExpandableField[Any]]
customer_creation: Optional[str]
customer_details: Optional[StripeObject]
customer_email: Optional[str]
expires_at: str
id: str
invoice: Optional[Any]
invoice: Optional[ExpandableField["Invoice"]]
invoice_creation: Optional[StripeObject]
line_items: ListObject["LineItem"]
livemode: bool
locale: Optional[str]
metadata: Optional[Dict[str, str]]
mode: str
object: Literal["checkout.session"]
payment_intent: Optional[Any]
payment_link: Optional[Any]
payment_intent: Optional[ExpandableField["PaymentIntent"]]
payment_link: Optional[ExpandableField["PaymentLink"]]
payment_method_collection: Optional[str]
payment_method_options: Optional[StripeObject]
payment_method_types: List[str]
payment_status: str
phone_number_collection: StripeObject
recovered_from: Optional[str]
setup_intent: Optional[Any]
setup_intent: Optional[ExpandableField["SetupIntent"]]
shipping_address_collection: Optional[StripeObject]
shipping_cost: Optional[StripeObject]
shipping_details: Optional[StripeObject]
shipping_options: List[StripeObject]
status: Optional[str]
submit_type: Optional[str]
subscription: Optional[Any]
subscription: Optional[ExpandableField["Subscription"]]
success_url: Optional[str]
tax_id_collection: StripeObject
total_details: Optional[StripeObject]
Expand Down
Loading

0 comments on commit 6b01abb

Please sign in to comment.