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 for beta #1059

Merged
merged 11 commits into from
Sep 29, 2023
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v545
v569
4 changes: 3 additions & 1 deletion stripe/api_resources/bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BankAccount(
bank_name: Optional[str]
country: str
currency: str
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
default_for_currency: Optional[bool]
fingerprint: Optional[str]
future_requirements: Optional[StripeObject]
Expand Down Expand Up @@ -78,6 +78,8 @@ def instance_url(self):

base = Customer.class_url()
assert customer is not None
if isinstance(customer, Customer):
customer = customer.id
owner_extn = quote_plus(customer)
class_base = "sources"

Expand Down
7 changes: 6 additions & 1 deletion stripe/api_resources/billing_portal/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
from typing_extensions import Literal
from urllib.parse import quote_plus

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.application import Application


class Configuration(
CreateableAPIResource["Configuration"],
Expand All @@ -26,7 +31,7 @@ class Configuration(

OBJECT_NAME = "billing_portal.configuration"
active: bool
application: Optional[ExpandableField[Any]]
application: Optional[ExpandableField["Application"]]
business_profile: StripeObject
created: int
default_return_url: Optional[str]
Expand Down
4 changes: 3 additions & 1 deletion stripe/api_resources/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]):
brand: str
country: Optional[str]
currency: Optional[str]
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
cvc_check: Optional[str]
default_for_currency: Optional[bool]
description: Optional[str]
Expand Down Expand Up @@ -82,6 +82,8 @@ def instance_url(self):

base = Customer.class_url()
assert customer is not None
if isinstance(customer, Customer):
customer = customer.id
owner_extn = quote_plus(customer)
class_base = "sources"

Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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.customer import Customer
from stripe.api_resources.invoice import Invoice
from stripe.api_resources.payment_intent import PaymentIntent
from stripe.api_resources.refund import Refund
Expand Down Expand Up @@ -57,7 +58,7 @@ class Charge(
captured: bool
created: int
currency: str
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
description: Optional[str]
disputed: bool
failure_balance_transaction: Optional[
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/checkout/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.customer import Customer
from stripe.api_resources.invoice import Invoice
from stripe.api_resources.line_item import LineItem
from stripe.api_resources.payment_intent import PaymentIntent
Expand Down Expand Up @@ -60,7 +61,7 @@ class Session(
currency_conversion: Optional[StripeObject]
custom_fields: List[StripeObject]
custom_text: StripeObject
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
customer_creation: Optional[Literal["always", "if_required"]]
customer_details: Optional[StripeObject]
customer_email: Optional[str]
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/credit_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

if TYPE_CHECKING:
from stripe.api_resources.credit_note_line_item import CreditNoteLineItem
from stripe.api_resources.customer import Customer
from stripe.api_resources.customer_balance_transaction import (
CustomerBalanceTransaction,
)
Expand All @@ -44,7 +45,7 @@ class CreditNote(
amount_shipping: int
created: int
currency: str
customer: ExpandableField[Any]
customer: ExpandableField["Customer"]
customer_balance_transaction: Optional[
ExpandableField["CustomerBalanceTransaction"]
]
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def modify(cls, id, **params: Any) -> "Customer":
@classmethod
def retrieve(
cls, id: str, api_key: Optional[str] = None, **params: Any
) -> Any:
) -> "Customer":
instance = cls(id, api_key, **params)
instance.refresh()
return instance
Expand Down
5 changes: 3 additions & 2 deletions stripe/api_resources/discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

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

from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.coupon import Coupon
from stripe.api_resources.customer import Customer
from stripe.api_resources.promotion_code import PromotionCode


Expand All @@ -25,7 +26,7 @@ class Discount(StripeObject):
OBJECT_NAME = "discount"
checkout_session: Optional[str]
coupon: "Coupon"
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
end: Optional[int]
id: str
invoice: Optional[str]
Expand Down
24 changes: 13 additions & 11 deletions stripe/api_resources/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Event(ListableAPIResource["Event"]):
livemode: bool
object: Literal["event"]
pending_webhooks: int
reason: Optional[StripeObject]
request: Optional[StripeObject]
type: Literal[
"account.application.authorized",
Expand Down Expand Up @@ -113,6 +114,7 @@ class Event(ListableAPIResource["Event"]):
"customer.subscription.collection_paused",
"customer.subscription.collection_resumed",
"customer.subscription.created",
"customer.subscription.custom_event",
"customer.subscription.deleted",
"customer.subscription.paused",
"customer.subscription.pending_update_applied",
Expand Down Expand Up @@ -161,21 +163,20 @@ class Event(ListableAPIResource["Event"]):
"issuing_authorization.updated",
"issuing_card.created",
"issuing_card.updated",
"issuing_card_design.activated",
"issuing_card_design.deactivated",
"issuing_card_design.rejected",
"issuing_card_design.updated",
"issuing_cardholder.created",
"issuing_cardholder.updated",
"issuing_dispute.closed",
"issuing_dispute.created",
"issuing_dispute.funds_reinstated",
"issuing_dispute.submitted",
"issuing_dispute.updated",
"issuing_personalization_design.activated",
"issuing_personalization_design.deactivated",
"issuing_personalization_design.rejected",
"issuing_personalization_design.updated",
"issuing_transaction.created",
"issuing_transaction.updated",
"mandate.updated",
"order.created",
"payment_intent.amount_capturable_updated",
"payment_intent.canceled",
"payment_intent.created",
Expand Down Expand Up @@ -221,9 +222,6 @@ class Event(ListableAPIResource["Event"]):
"quote.stale",
"radar.early_fraud_warning.created",
"radar.early_fraud_warning.updated",
"recipient.created",
"recipient.deleted",
"recipient.updated",
"refund.created",
"refund.updated",
"reporting.report_run.failed",
Expand All @@ -237,9 +235,6 @@ class Event(ListableAPIResource["Event"]):
"setup_intent.setup_failed",
"setup_intent.succeeded",
"sigma.scheduled_query_run.created",
"sku.created",
"sku.deleted",
"sku.updated",
"source.canceled",
"source.chargeable",
"source.failed",
Expand Down Expand Up @@ -303,6 +298,13 @@ class Event(ListableAPIResource["Event"]):
"treasury.received_credit.succeeded",
"treasury.received_debit.created",
"invoiceitem.updated",
"order.created",
"recipient.created",
"recipient.deleted",
"recipient.updated",
"sku.created",
"sku.deleted",
"sku.updated",
]

@classmethod
Expand Down
12 changes: 8 additions & 4 deletions stripe/api_resources/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@

if TYPE_CHECKING:
from stripe.api_resources.account import Account
from stripe.api_resources.application import Application
from stripe.api_resources.charge import Charge
from stripe.api_resources.customer import Customer
from stripe.api_resources.discount import Discount
from stripe.api_resources.invoice_line_item import InvoiceLineItem
from stripe.api_resources.payment_intent import PaymentIntent
from stripe.api_resources.payment_method import PaymentMethod
from stripe.api_resources.quote import Quote
from stripe.api_resources.subscription import Subscription
from stripe.api_resources.tax_id import TaxId
from stripe.api_resources.tax_rate import TaxRate
from stripe.api_resources.test_helpers.test_clock import TestClock

Expand Down Expand Up @@ -77,12 +80,12 @@ class Invoice(
OBJECT_NAME = "invoice"
account_country: Optional[str]
account_name: Optional[str]
account_tax_ids: Optional[List[ExpandableField[Any]]]
account_tax_ids: Optional[List[ExpandableField["TaxId"]]]
amount_due: int
amount_paid: int
amount_remaining: int
amount_shipping: int
application: Optional[ExpandableField[Any]]
application: Optional[ExpandableField["Application"]]
application_fee_amount: Optional[int]
attempt_count: int
attempted: bool
Expand All @@ -106,7 +109,7 @@ class Invoice(
created: int
currency: str
custom_fields: Optional[List[StripeObject]]
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
customer_address: Optional[StripeObject]
customer_email: Optional[str]
customer_name: Optional[str]
Expand All @@ -119,7 +122,7 @@ class Invoice(
default_tax_rates: List["TaxRate"]
description: Optional[str]
discount: Optional["Discount"]
discounts: Optional[List[ExpandableField[Any]]]
discounts: Optional[List[ExpandableField["Discount"]]]
due_date: Optional[int]
effective_at: Optional[int]
ending_balance: Optional[int]
Expand Down Expand Up @@ -148,6 +151,7 @@ class Invoice(
pre_payment_credit_notes_amount: int
quote: Optional[ExpandableField["Quote"]]
receipt_number: Optional[str]
rendering: Optional[StripeObject]
rendering_options: Optional[StripeObject]
shipping_cost: Optional[StripeObject]
shipping_details: Optional[StripeObject]
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/invoice_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.customer import Customer
from stripe.api_resources.discount import Discount
from stripe.api_resources.invoice import Invoice
from stripe.api_resources.plan import Plan
Expand Down Expand Up @@ -51,7 +52,7 @@ class InvoiceItem(
OBJECT_NAME = "invoiceitem"
amount: int
currency: str
customer: ExpandableField[Any]
customer: ExpandableField["Customer"]
date: int
description: Optional[str]
discountable: bool
Expand Down
6 changes: 4 additions & 2 deletions stripe/api_resources/issuing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

from stripe.api_resources.issuing.authorization import Authorization
from stripe.api_resources.issuing.card import Card
from stripe.api_resources.issuing.card_bundle import CardBundle
from stripe.api_resources.issuing.card_design import CardDesign
from stripe.api_resources.issuing.cardholder import Cardholder
from stripe.api_resources.issuing.dispute import Dispute
from stripe.api_resources.issuing.personalization_design import (
PersonalizationDesign,
)
from stripe.api_resources.issuing.physical_bundle import PhysicalBundle
from stripe.api_resources.issuing.transaction import Transaction
6 changes: 4 additions & 2 deletions stripe/api_resources/issuing/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe.api_resources.issuing.card_design import CardDesign
from stripe.api_resources.issuing.cardholder import Cardholder
from stripe.api_resources.issuing.personalization_design import (
PersonalizationDesign,
)


class Card(
Expand All @@ -35,7 +37,6 @@ class Card(
OBJECT_NAME = "issuing.card"
brand: str
cancellation_reason: Optional[Literal["design_rejected", "lost", "stolen"]]
card_design: Optional[ExpandableField["CardDesign"]]
cardholder: "Cardholder"
created: int
currency: str
Expand All @@ -49,6 +50,7 @@ class Card(
metadata: Dict[str, str]
number: Optional[str]
object: Literal["issuing.card"]
personalization_design: Optional[ExpandableField["PersonalizationDesign"]]
replaced_by: Optional[ExpandableField["Card"]]
replacement_for: Optional[ExpandableField["Card"]]
replacement_reason: Optional[
Expand Down
Loading