Skip to content

Commit

Permalink
Update generated code (#1060)
Browse files Browse the repository at this point in the history
* Update generated code for v546

* Update generated code for v548

* Update generated code for v549

* Update generated code for v550

* Update generated code for v550

* Update generated code for v551

* Update generated code for v556

* Update generated code for v557

* Update generated code for v562

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and richardm-stripe committed Sep 28, 2023
1 parent b3d7f23 commit 79a57bc
Show file tree
Hide file tree
Showing 29 changed files with 98 additions and 51 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v545
v562
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
14 changes: 7 additions & 7 deletions stripe/api_resources/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class Event(ListableAPIResource["Event"]):
"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 @@ -197,9 +196,6 @@ class Event(ListableAPIResource["Event"]):
"quote.finalized",
"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 @@ -213,9 +209,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 @@ -277,6 +270,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 @@ -147,6 +150,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
2 changes: 1 addition & 1 deletion stripe/api_resources/mandate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Mandate(APIResource["Mandate"]):
"""
A Mandate is a record of the permission a customer has given you to debit their payment method.
A Mandate is a record of the permission that your customer gives you to debit their payment method.
"""

OBJECT_NAME = "mandate"
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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.invoice import Invoice
from stripe.api_resources.payment_method import PaymentMethod
from stripe.api_resources.review import Review
Expand Down Expand Up @@ -72,7 +73,7 @@ class PaymentIntent(
confirmation_method: Literal["automatic", "manual"]
created: int
currency: str
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
description: Optional[str]
id: str
invoice: Optional[ExpandableField["Invoice"]]
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/payment_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

if TYPE_CHECKING:
from stripe.api_resources.account import Account
from stripe.api_resources.application import Application
from stripe.api_resources.line_item import LineItem


Expand All @@ -39,7 +40,7 @@ class PaymentLink(
active: bool
after_completion: StripeObject
allow_promotion_codes: bool
application: Optional[ExpandableField[Any]]
application: Optional[ExpandableField["Application"]]
application_fee_amount: Optional[int]
application_fee_percent: Optional[float]
automatic_tax: StripeObject
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/payout.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Payout(
A `Payout` object is created when you receive funds from Stripe, or when you
initiate a payout to either a bank account or debit card of a [connected
Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,
as well as list all payouts. Payouts are made on [varying
and list all payouts. Payouts are made on [varying
schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
industry.
Expand Down
7 changes: 6 additions & 1 deletion stripe/api_resources/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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.product import Product


class Plan(
CreateableAPIResource["Plan"],
Expand Down Expand Up @@ -51,7 +56,7 @@ class Plan(
metadata: Optional[Dict[str, str]]
nickname: Optional[str]
object: Literal["plan"]
product: Optional[ExpandableField[Any]]
product: Optional[ExpandableField["Product"]]
tiers: Optional[List[StripeObject]]
tiers_mode: Optional[Literal["graduated", "volume"]]
transform_usage: Optional[StripeObject]
Expand Down
7 changes: 6 additions & 1 deletion stripe/api_resources/price.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,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.product import Product


class Price(
CreateableAPIResource["Price"],
Expand Down Expand Up @@ -44,7 +49,7 @@ class Price(
metadata: Dict[str, str]
nickname: Optional[str]
object: Literal["price"]
product: ExpandableField[Any]
product: ExpandableField["Product"]
recurring: Optional[StripeObject]
tax_behavior: Optional[Literal["exclusive", "inclusive", "unspecified"]]
tiers: Optional[List[StripeObject]]
Expand Down
3 changes: 2 additions & 1 deletion stripe/api_resources/promotion_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

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


class PromotionCode(
Expand All @@ -35,7 +36,7 @@ class PromotionCode(
code: str
coupon: "Coupon"
created: int
customer: Optional[ExpandableField[Any]]
customer: Optional[ExpandableField["Customer"]]
expires_at: Optional[int]
id: str
livemode: bool
Expand Down
Loading

0 comments on commit 79a57bc

Please sign in to comment.