From c264fd9a709067166d6ac2baf99bd47940db2b9c Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:30:24 -0700 Subject: [PATCH] Add optional types to non-required fields (#1057) * Deleted fields * Optional[...] for non-required properties --- stripe/api_resources/account.py | 34 ++++---- stripe/api_resources/apple_pay_domain.py | 4 +- stripe/api_resources/application.py | 2 +- stripe/api_resources/apps/secret.py | 2 +- stripe/api_resources/balance.py | 8 +- stripe/api_resources/bank_account.py | 2 +- stripe/api_resources/capability.py | 4 +- stripe/api_resources/card.py | 8 +- stripe/api_resources/charge.py | 8 +- stripe/api_resources/checkout/session.py | 6 +- stripe/api_resources/coupon.py | 6 +- stripe/api_resources/credit_note_line_item.py | 2 +- stripe/api_resources/customer.py | 20 ++--- .../customer_cash_balance_transaction.py | 11 +-- stripe/api_resources/discount.py | 2 +- stripe/api_resources/dispute.py | 2 +- stripe/api_resources/ephemeral_key.py | 4 +- stripe/api_resources/event.py | 2 +- .../financial_connections/session.py | 4 +- .../identity/verification_report.py | 10 +-- stripe/api_resources/invoice.py | 10 +-- stripe/api_resources/invoice_item.py | 4 +- stripe/api_resources/invoice_line_item.py | 8 +- stripe/api_resources/issuing/card.py | 4 +- stripe/api_resources/line_item.py | 4 +- stripe/api_resources/mandate.py | 7 +- stripe/api_resources/payment_intent.py | 2 +- stripe/api_resources/payment_link.py | 2 +- stripe/api_resources/payment_method.py | 68 ++++++++-------- .../payment_method_configuration.py | 74 ++++++++--------- stripe/api_resources/person.py | 27 ++++--- stripe/api_resources/plan.py | 4 +- stripe/api_resources/price.py | 6 +- stripe/api_resources/product.py | 2 +- stripe/api_resources/quote.py | 4 +- .../radar/early_fraud_warning.py | 3 +- stripe/api_resources/radar/value_list.py | 4 +- stripe/api_resources/radar/value_list_item.py | 4 +- stripe/api_resources/refund.py | 12 +-- stripe/api_resources/review.py | 2 +- stripe/api_resources/setup_attempt.py | 2 +- stripe/api_resources/setup_intent.py | 2 +- stripe/api_resources/shipping_rate.py | 2 +- .../sigma/scheduled_query_run.py | 2 +- stripe/api_resources/source.py | 48 +++++------ .../source_mandate_notification.py | 6 +- stripe/api_resources/source_transaction.py | 11 +-- stripe/api_resources/subscription_item.py | 4 +- stripe/api_resources/tax_id.py | 2 +- .../api_resources/terminal/configuration.py | 8 +- .../terminal/connection_token.py | 4 +- stripe/api_resources/terminal/location.py | 6 +- stripe/api_resources/terminal/reader.py | 2 +- .../api_resources/test_helpers/test_clock.py | 2 +- stripe/api_resources/token.py | 4 +- stripe/api_resources/transfer.py | 4 +- .../treasury/financial_account.py | 80 ++++++++++--------- .../treasury/financial_account_features.py | 15 ++-- .../api_resources/treasury/received_debit.py | 2 +- stripe/api_resources/webhook_endpoint.py | 4 +- 60 files changed, 308 insertions(+), 294 deletions(-) diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index 101d7022b..76c364b30 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -44,31 +44,31 @@ class Account( """ OBJECT_NAME = "account" - deleted: bool business_profile: Optional[StripeObject] business_type: Optional[ Literal["company", "government_entity", "individual", "non_profit"] ] - capabilities: StripeObject - charges_enabled: bool - company: StripeObject - controller: StripeObject - country: str - created: int - default_currency: str - details_submitted: bool + capabilities: Optional[StripeObject] + charges_enabled: Optional[bool] + company: Optional[StripeObject] + controller: Optional[StripeObject] + country: Optional[str] + created: Optional[int] + default_currency: Optional[str] + details_submitted: Optional[bool] email: Optional[str] - external_accounts: ListObject[Any] - future_requirements: StripeObject + external_accounts: Optional[ListObject[Any]] + future_requirements: Optional[StripeObject] id: str - individual: "Person" - metadata: Dict[str, str] + individual: Optional["Person"] + metadata: Optional[Dict[str, str]] object: Literal["account"] - payouts_enabled: bool - requirements: StripeObject + payouts_enabled: Optional[bool] + requirements: Optional[StripeObject] settings: Optional[StripeObject] - tos_acceptance: StripeObject - type: Literal["custom", "express", "standard"] + tos_acceptance: Optional[StripeObject] + type: Optional[Literal["custom", "express", "standard"]] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/apple_pay_domain.py b/stripe/api_resources/apple_pay_domain.py index 9e0ab6946..4890d91d6 100644 --- a/stripe/api_resources/apple_pay_domain.py +++ b/stripe/api_resources/apple_pay_domain.py @@ -9,7 +9,7 @@ ListableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import cast +from typing import Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -20,12 +20,12 @@ class ApplePayDomain( ListableAPIResource["ApplePayDomain"], ): OBJECT_NAME = "apple_pay_domain" - deleted: bool created: int domain_name: str id: str livemode: bool object: Literal["apple_pay_domain"] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/application.py b/stripe/api_resources/application.py index 8b212d344..3d39dd43e 100644 --- a/stripe/api_resources/application.py +++ b/stripe/api_resources/application.py @@ -9,7 +9,7 @@ class Application(StripeObject): OBJECT_NAME = "application" - deleted: bool id: str name: Optional[str] object: Literal["application"] + deleted: Optional[Literal[True]] diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index 1d05674cb..7be8ddb30 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -27,7 +27,7 @@ class Secret(CreateableAPIResource["Secret"], ListableAPIResource["Secret"]): OBJECT_NAME = "apps.secret" created: int - deleted: bool + deleted: Optional[bool] expires_at: Optional[int] id: str livemode: bool diff --git a/stripe/api_resources/balance.py b/stripe/api_resources/balance.py index ab335c5ec..9a156329f 100644 --- a/stripe/api_resources/balance.py +++ b/stripe/api_resources/balance.py @@ -4,7 +4,7 @@ from stripe.api_resources.abstract import SingletonAPIResource from stripe.stripe_object import StripeObject -from typing import List +from typing import List, Optional from typing_extensions import Literal @@ -25,9 +25,9 @@ class Balance(SingletonAPIResource["Balance"]): OBJECT_NAME = "balance" available: List[StripeObject] - connect_reserved: List[StripeObject] - instant_available: List[StripeObject] - issuing: StripeObject + connect_reserved: Optional[List[StripeObject]] + instant_available: Optional[List[StripeObject]] + issuing: Optional[StripeObject] livemode: bool object: Literal["balance"] pending: List[StripeObject] diff --git a/stripe/api_resources/bank_account.py b/stripe/api_resources/bank_account.py index f492a2303..1d8b25ca7 100644 --- a/stripe/api_resources/bank_account.py +++ b/stripe/api_resources/bank_account.py @@ -33,7 +33,6 @@ class BankAccount( """ OBJECT_NAME = "bank_account" - deleted: bool account: Optional[ExpandableField["Account"]] account_holder_name: Optional[str] account_holder_type: Optional[str] @@ -53,6 +52,7 @@ class BankAccount( requirements: Optional[StripeObject] routing_number: Optional[str] status: str + deleted: Optional[Literal[True]] @classmethod def _cls_delete(cls, sid, **params) -> Any: diff --git a/stripe/api_resources/capability.py b/stripe/api_resources/capability.py index ba780bff9..c31e906a0 100644 --- a/stripe/api_resources/capability.py +++ b/stripe/api_resources/capability.py @@ -20,12 +20,12 @@ class Capability(UpdateableAPIResource["Capability"]): OBJECT_NAME = "capability" account: ExpandableField["Account"] - future_requirements: StripeObject + future_requirements: Optional[StripeObject] id: str object: Literal["capability"] requested: bool requested_at: Optional[int] - requirements: StripeObject + requirements: Optional[StripeObject] status: Literal["active", "disabled", "inactive", "pending", "unrequested"] def instance_url(self): diff --git a/stripe/api_resources/card.py b/stripe/api_resources/card.py index 30d70445a..c198ddf58 100644 --- a/stripe/api_resources/card.py +++ b/stripe/api_resources/card.py @@ -25,7 +25,6 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]): """ OBJECT_NAME = "card" - deleted: bool account: Optional[ExpandableField["Account"]] address_city: Optional[str] address_country: Optional[str] @@ -42,21 +41,22 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]): customer: Optional[ExpandableField[Any]] cvc_check: Optional[str] default_for_currency: Optional[bool] - description: str + description: Optional[str] dynamic_last4: Optional[str] exp_month: int exp_year: int fingerprint: Optional[str] funding: str id: str - iin: str - issuer: str + iin: Optional[str] + issuer: Optional[str] last4: str metadata: Optional[Dict[str, str]] name: Optional[str] object: Literal["card"] status: Optional[str] tokenization_method: Optional[str] + deleted: Optional[Literal[True]] @classmethod def _cls_delete(cls, sid, **params) -> Any: diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index b8965307c..14ba02c5f 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -50,7 +50,7 @@ class Charge( application: Optional[ExpandableField["Application"]] application_fee: Optional[ExpandableField["ApplicationFee"]] application_fee_amount: Optional[int] - authorization_code: str + authorization_code: Optional[str] balance_transaction: Optional[ExpandableField["BalanceTransaction"]] billing_details: StripeObject calculated_statement_descriptor: Optional[str] @@ -68,7 +68,7 @@ class Charge( fraud_details: Optional[StripeObject] id: str invoice: Optional[ExpandableField["Invoice"]] - level3: StripeObject + level3: Optional[StripeObject] livemode: bool metadata: Dict[str, str] object: Literal["charge"] @@ -78,7 +78,7 @@ class Charge( payment_intent: Optional[ExpandableField["PaymentIntent"]] payment_method: Optional[str] payment_method_details: Optional[StripeObject] - radar_options: StripeObject + radar_options: Optional[StripeObject] receipt_email: Optional[str] receipt_number: Optional[str] receipt_url: Optional[str] @@ -91,7 +91,7 @@ class Charge( statement_descriptor: Optional[str] statement_descriptor_suffix: Optional[str] status: Literal["failed", "pending", "succeeded"] - transfer: ExpandableField["Transfer"] + transfer: Optional[ExpandableField["Transfer"]] transfer_data: Optional[StripeObject] transfer_group: Optional[str] diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index b13b10fc0..5c0343812 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -68,7 +68,7 @@ class Session( id: str invoice: Optional[ExpandableField["Invoice"]] invoice_creation: Optional[StripeObject] - line_items: ListObject["LineItem"] + line_items: Optional[ListObject["LineItem"]] livemode: bool locale: Optional[ Literal[ @@ -125,7 +125,7 @@ class Session( payment_method_options: Optional[StripeObject] payment_method_types: List[str] payment_status: Literal["no_payment_required", "paid", "unpaid"] - phone_number_collection: StripeObject + phone_number_collection: Optional[StripeObject] recovered_from: Optional[str] setup_intent: Optional[ExpandableField["SetupIntent"]] shipping_address_collection: Optional[StripeObject] @@ -136,7 +136,7 @@ class Session( submit_type: Optional[Literal["auto", "book", "donate", "pay"]] subscription: Optional[ExpandableField["Subscription"]] success_url: Optional[str] - tax_id_collection: StripeObject + tax_id_collection: Optional[StripeObject] total_details: Optional[StripeObject] url: Optional[str] diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index fe0901ee6..2e291e0d5 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -29,12 +29,11 @@ class Coupon( """ OBJECT_NAME = "coupon" - deleted: bool amount_off: Optional[int] - applies_to: StripeObject + applies_to: Optional[StripeObject] created: int currency: Optional[str] - currency_options: Dict[str, StripeObject] + currency_options: Optional[Dict[str, StripeObject]] duration: Literal["forever", "once", "repeating"] duration_in_months: Optional[int] id: str @@ -47,6 +46,7 @@ class Coupon( redeem_by: Optional[int] times_redeemed: int valid: bool + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/credit_note_line_item.py b/stripe/api_resources/credit_note_line_item.py index 9862ad008..e6259d11b 100644 --- a/stripe/api_resources/credit_note_line_item.py +++ b/stripe/api_resources/credit_note_line_item.py @@ -26,7 +26,7 @@ class CreditNoteLineItem(ListableAPIResource["CreditNoteLineItem"]): discount_amount: int discount_amounts: List[StripeObject] id: str - invoice_line_item: str + invoice_line_item: Optional[str] livemode: bool object: Literal["credit_note_line_item"] quantity: Optional[int] diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index 00c757000..f28002333 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -47,9 +47,8 @@ class Customer( """ OBJECT_NAME = "customer" - deleted: bool address: Optional[StripeObject] - balance: int + balance: Optional[int] cash_balance: Optional["CashBalance"] created: int currency: Optional[str] @@ -59,23 +58,24 @@ class Customer( discount: Optional["Discount"] email: Optional[str] id: str - invoice_credit_balance: Dict[str, int] + invoice_credit_balance: Optional[Dict[str, int]] invoice_prefix: Optional[str] - invoice_settings: StripeObject + invoice_settings: Optional[StripeObject] livemode: bool - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] name: Optional[str] - next_invoice_sequence: int + next_invoice_sequence: Optional[int] object: Literal["customer"] phone: Optional[str] preferred_locales: Optional[List[str]] shipping: Optional[StripeObject] - sources: ListObject[Any] - subscriptions: ListObject["Subscription"] - tax: StripeObject + sources: Optional[ListObject[Any]] + subscriptions: Optional[ListObject["Subscription"]] + tax: Optional[StripeObject] tax_exempt: Optional[Literal["exempt", "none", "reverse"]] - tax_ids: ListObject["TaxId"] + tax_ids: Optional[ListObject["TaxId"]] test_clock: Optional[ExpandableField["TestClock"]] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index 902e9a5a5..1827c9f26 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -6,6 +6,7 @@ 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 Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -25,18 +26,18 @@ class CustomerCashBalanceTransaction( """ OBJECT_NAME = "customer_cash_balance_transaction" - adjusted_for_overdraft: StripeObject - applied_to_payment: StripeObject + adjusted_for_overdraft: Optional[StripeObject] + applied_to_payment: Optional[StripeObject] created: int currency: str customer: ExpandableField["Customer"] ending_balance: int - funded: StripeObject + funded: Optional[StripeObject] id: str livemode: bool net_amount: int object: Literal["customer_cash_balance_transaction"] - refunded_from_payment: StripeObject + refunded_from_payment: Optional[StripeObject] type: Literal[ "adjusted_for_overdraft", "applied_to_payment", @@ -47,7 +48,7 @@ class CustomerCashBalanceTransaction( "return_initiated", "unapplied_from_payment", ] - unapplied_from_payment: StripeObject + unapplied_from_payment: Optional[StripeObject] @classmethod def list( diff --git a/stripe/api_resources/discount.py b/stripe/api_resources/discount.py index a43ea931a..8f20e85ff 100644 --- a/stripe/api_resources/discount.py +++ b/stripe/api_resources/discount.py @@ -23,7 +23,6 @@ class Discount(StripeObject): """ OBJECT_NAME = "discount" - deleted: bool checkout_session: Optional[str] coupon: "Coupon" customer: Optional[ExpandableField[Any]] @@ -35,3 +34,4 @@ class Discount(StripeObject): promotion_code: Optional[ExpandableField["PromotionCode"]] start: int subscription: Optional[str] + deleted: Optional[Literal[True]] diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 1b83025a5..06d1948dd 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -48,7 +48,7 @@ class Dispute( network_reason_code: Optional[str] object: Literal["dispute"] payment_intent: Optional[ExpandableField["PaymentIntent"]] - payment_method_details: StripeObject + payment_method_details: Optional[StripeObject] reason: str status: Literal[ "lost", diff --git a/stripe/api_resources/ephemeral_key.py b/stripe/api_resources/ephemeral_key.py index 3886ba739..484af9bb6 100644 --- a/stripe/api_resources/ephemeral_key.py +++ b/stripe/api_resources/ephemeral_key.py @@ -4,7 +4,7 @@ from stripe import api_requestor, util from stripe.api_resources.abstract import DeletableAPIResource -from typing import cast +from typing import Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -16,7 +16,7 @@ class EphemeralKey(DeletableAPIResource["EphemeralKey"]): id: str livemode: bool object: Literal["ephemeral_key"] - secret: str + secret: Optional[str] @classmethod def _cls_delete(cls, sid, **params) -> "EphemeralKey": diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index 35ffc9a96..4c30e3c0a 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -44,7 +44,7 @@ class Event(ListableAPIResource["Event"]): """ OBJECT_NAME = "event" - account: str + account: Optional[str] api_version: Optional[str] created: int data: StripeObject diff --git a/stripe/api_resources/financial_connections/session.py b/stripe/api_resources/financial_connections/session.py index 8e0832fab..2ec566a11 100644 --- a/stripe/api_resources/financial_connections/session.py +++ b/stripe/api_resources/financial_connections/session.py @@ -23,7 +23,7 @@ class Session(CreateableAPIResource["Session"]): account_holder: Optional[StripeObject] accounts: ListObject["Account"] client_secret: str - filters: StripeObject + filters: Optional[StripeObject] id: str livemode: bool object: Literal["financial_connections.session"] @@ -31,7 +31,7 @@ class Session(CreateableAPIResource["Session"]): Literal["balances", "ownership", "payment_method", "transactions"] ] prefetch: Optional[List[Literal["balances", "ownership"]]] - return_url: str + return_url: Optional[str] @classmethod def create( diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index 4bcf26df4..adcd82d65 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -26,14 +26,14 @@ class VerificationReport(ListableAPIResource["VerificationReport"]): OBJECT_NAME = "identity.verification_report" created: int - document: StripeObject + document: Optional[StripeObject] id: str - id_number: StripeObject + id_number: Optional[StripeObject] livemode: bool object: Literal["identity.verification_report"] - options: StripeObject - selfie: StripeObject - type: Literal["document", "id_number"] + options: Optional[StripeObject] + selfie: Optional[StripeObject] + type: Optional[Literal["document", "id_number"]] verification_session: Optional[str] @classmethod diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index e95902e3b..d56bb4bfd 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -75,7 +75,6 @@ class Invoice( """ OBJECT_NAME = "invoice" - deleted: bool account_country: Optional[str] account_name: Optional[str] account_tax_ids: Optional[List[ExpandableField[Any]]] @@ -87,7 +86,7 @@ class Invoice( application_fee_amount: Optional[int] attempt_count: int attempted: bool - auto_advance: bool + auto_advance: Optional[bool] automatic_tax: StripeObject billing_reason: Optional[ Literal[ @@ -127,7 +126,7 @@ class Invoice( footer: Optional[str] from_invoice: Optional[StripeObject] hosted_invoice_url: Optional[str] - id: str + id: Optional[str] invoice_pdf: Optional[str] last_finalization_error: Optional[StripeObject] latest_revision: Optional[ExpandableField["Invoice"]] @@ -157,18 +156,19 @@ class Invoice( status_transitions: StripeObject subscription: Optional[ExpandableField["Subscription"]] subscription_details: Optional[StripeObject] - subscription_proration_date: int + subscription_proration_date: Optional[int] subtotal: int subtotal_excluding_tax: Optional[int] tax: Optional[int] test_clock: Optional[ExpandableField["TestClock"]] - threshold_reason: StripeObject + threshold_reason: Optional[StripeObject] total: int total_discount_amounts: Optional[List[StripeObject]] total_excluding_tax: Optional[int] total_tax_amounts: List[StripeObject] transfer_data: Optional[StripeObject] webhooks_delivered_at: Optional[int] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index d88c7d2bc..6ca810fae 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -49,7 +49,6 @@ class InvoiceItem( """ OBJECT_NAME = "invoiceitem" - deleted: bool amount: int currency: str customer: ExpandableField[Any] @@ -68,11 +67,12 @@ class InvoiceItem( proration: bool quantity: int subscription: Optional[ExpandableField["Subscription"]] - subscription_item: str + subscription_item: Optional[str] tax_rates: Optional[List["TaxRate"]] test_clock: Optional[ExpandableField["TestClock"]] unit_amount: Optional[int] unit_amount_decimal: Optional[float] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/invoice_line_item.py b/stripe/api_resources/invoice_line_item.py index e24d65aaf..44213351a 100644 --- a/stripe/api_resources/invoice_line_item.py +++ b/stripe/api_resources/invoice_line_item.py @@ -29,7 +29,7 @@ class InvoiceLineItem(StripeObject): discountable: bool discounts: Optional[List[ExpandableField["Discount"]]] id: str - invoice_item: ExpandableField["InvoiceItem"] + invoice_item: Optional[ExpandableField["InvoiceItem"]] livemode: bool metadata: Dict[str, str] object: Literal["line_item"] @@ -40,8 +40,8 @@ class InvoiceLineItem(StripeObject): proration_details: Optional[StripeObject] quantity: Optional[int] subscription: Optional[ExpandableField["Subscription"]] - subscription_item: ExpandableField["SubscriptionItem"] - tax_amounts: List[StripeObject] - tax_rates: List["TaxRate"] + subscription_item: Optional[ExpandableField["SubscriptionItem"]] + tax_amounts: Optional[List[StripeObject]] + tax_rates: Optional[List["TaxRate"]] type: Literal["invoiceitem", "subscription"] unit_amount_excluding_tax: Optional[float] diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index bc1049314..a17cd3f62 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -37,7 +37,7 @@ class Card( cardholder: "Cardholder" created: int currency: str - cvc: str + cvc: Optional[str] exp_month: int exp_year: int financial_account: Optional[str] @@ -45,7 +45,7 @@ class Card( last4: str livemode: bool metadata: Dict[str, str] - number: str + number: Optional[str] object: Literal["issuing.card"] replaced_by: Optional[ExpandableField["Card"]] replacement_for: Optional[ExpandableField["Card"]] diff --git a/stripe/api_resources/line_item.py b/stripe/api_resources/line_item.py index 20271185e..6c9f5b733 100644 --- a/stripe/api_resources/line_item.py +++ b/stripe/api_resources/line_item.py @@ -24,9 +24,9 @@ class LineItem(StripeObject): amount_total: int currency: str description: str - discounts: List[StripeObject] + discounts: Optional[List[StripeObject]] id: str object: Literal["item"] price: Optional["Price"] quantity: Optional[int] - taxes: List[StripeObject] + taxes: Optional[List[StripeObject]] diff --git a/stripe/api_resources/mandate.py b/stripe/api_resources/mandate.py index fded23dc3..70b751628 100644 --- a/stripe/api_resources/mandate.py +++ b/stripe/api_resources/mandate.py @@ -5,6 +5,7 @@ from stripe.api_resources.abstract import APIResource from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject +from typing import Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -22,12 +23,12 @@ class Mandate(APIResource["Mandate"]): customer_acceptance: StripeObject id: str livemode: bool - multi_use: StripeObject + multi_use: Optional[StripeObject] object: Literal["mandate"] - on_behalf_of: str + on_behalf_of: Optional[str] payment_method: ExpandableField["PaymentMethod"] payment_method_details: StripeObject - single_use: StripeObject + single_use: Optional[StripeObject] status: Literal["active", "inactive", "pending"] type: Literal["multi_use", "single_use"] diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index 8deca7018..fe4200a64 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -50,7 +50,7 @@ class PaymentIntent( OBJECT_NAME = "payment_intent" amount: int amount_capturable: int - amount_details: StripeObject + amount_details: Optional[StripeObject] amount_received: int application: Optional[ExpandableField["Application"]] application_fee_amount: Optional[int] diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index 3c421f231..02057d429 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -51,7 +51,7 @@ class PaymentLink( customer_creation: Literal["always", "if_required"] id: str invoice_creation: Optional[StripeObject] - line_items: ListObject["LineItem"] + line_items: Optional[ListObject["LineItem"]] livemode: bool metadata: Dict[str, str] object: Literal["payment_link"] diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index 4f64e8cb1..973e6144c 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -35,44 +35,44 @@ class PaymentMethod( """ OBJECT_NAME = "payment_method" - acss_debit: StripeObject - affirm: StripeObject - afterpay_clearpay: StripeObject - alipay: StripeObject - au_becs_debit: StripeObject - bacs_debit: StripeObject - bancontact: StripeObject + acss_debit: Optional[StripeObject] + affirm: Optional[StripeObject] + afterpay_clearpay: Optional[StripeObject] + alipay: Optional[StripeObject] + au_becs_debit: Optional[StripeObject] + bacs_debit: Optional[StripeObject] + bancontact: Optional[StripeObject] billing_details: StripeObject - blik: StripeObject - boleto: StripeObject - card: StripeObject - card_present: StripeObject - cashapp: StripeObject + blik: Optional[StripeObject] + boleto: Optional[StripeObject] + card: Optional[StripeObject] + card_present: Optional[StripeObject] + cashapp: Optional[StripeObject] created: int customer: Optional[ExpandableField["Customer"]] - customer_balance: StripeObject - eps: StripeObject - fpx: StripeObject - giropay: StripeObject - grabpay: StripeObject + customer_balance: Optional[StripeObject] + eps: Optional[StripeObject] + fpx: Optional[StripeObject] + giropay: Optional[StripeObject] + grabpay: Optional[StripeObject] id: str - ideal: StripeObject - interac_present: StripeObject - klarna: StripeObject - konbini: StripeObject - link: StripeObject + ideal: Optional[StripeObject] + interac_present: Optional[StripeObject] + klarna: Optional[StripeObject] + konbini: Optional[StripeObject] + link: Optional[StripeObject] livemode: bool metadata: Optional[Dict[str, str]] object: Literal["payment_method"] - oxxo: StripeObject - p24: StripeObject - paynow: StripeObject - paypal: StripeObject - pix: StripeObject - promptpay: StripeObject - radar_options: StripeObject - sepa_debit: StripeObject - sofort: StripeObject + oxxo: Optional[StripeObject] + p24: Optional[StripeObject] + paynow: Optional[StripeObject] + paypal: Optional[StripeObject] + pix: Optional[StripeObject] + promptpay: Optional[StripeObject] + radar_options: Optional[StripeObject] + sepa_debit: Optional[StripeObject] + sofort: Optional[StripeObject] type: Literal[ "acss_debit", "affirm", @@ -108,9 +108,9 @@ class PaymentMethod( "wechat_pay", "zip", ] - us_bank_account: StripeObject - wechat_pay: StripeObject - zip: StripeObject + us_bank_account: Optional[StripeObject] + wechat_pay: Optional[StripeObject] + zip: Optional[StripeObject] @classmethod def _cls_attach( diff --git a/stripe/api_resources/payment_method_configuration.py b/stripe/api_resources/payment_method_configuration.py index 747f01627..ae93769b9 100644 --- a/stripe/api_resources/payment_method_configuration.py +++ b/stripe/api_resources/payment_method_configuration.py @@ -24,51 +24,51 @@ class PaymentMethodConfiguration( """ OBJECT_NAME = "payment_method_configuration" - acss_debit: StripeObject + acss_debit: Optional[StripeObject] active: bool - affirm: StripeObject - afterpay_clearpay: StripeObject - alipay: StripeObject - apple_pay: StripeObject + affirm: Optional[StripeObject] + afterpay_clearpay: Optional[StripeObject] + alipay: Optional[StripeObject] + apple_pay: Optional[StripeObject] application: Optional[str] - au_becs_debit: StripeObject - bacs_debit: StripeObject - bancontact: StripeObject - blik: StripeObject - boleto: StripeObject - card: StripeObject - cartes_bancaires: StripeObject - cashapp: StripeObject - eps: StripeObject - fpx: StripeObject - giropay: StripeObject - google_pay: StripeObject - grabpay: StripeObject + au_becs_debit: Optional[StripeObject] + bacs_debit: Optional[StripeObject] + bancontact: Optional[StripeObject] + blik: Optional[StripeObject] + boleto: Optional[StripeObject] + card: Optional[StripeObject] + cartes_bancaires: Optional[StripeObject] + cashapp: Optional[StripeObject] + eps: Optional[StripeObject] + fpx: Optional[StripeObject] + giropay: Optional[StripeObject] + google_pay: Optional[StripeObject] + grabpay: Optional[StripeObject] id: str - id_bank_transfer: StripeObject - ideal: StripeObject + id_bank_transfer: Optional[StripeObject] + ideal: Optional[StripeObject] is_default: bool - jcb: StripeObject - klarna: StripeObject - konbini: StripeObject - link: StripeObject + jcb: Optional[StripeObject] + klarna: Optional[StripeObject] + konbini: Optional[StripeObject] + link: Optional[StripeObject] livemode: bool - multibanco: StripeObject + multibanco: Optional[StripeObject] name: str - netbanking: StripeObject + netbanking: Optional[StripeObject] object: Literal["payment_method_configuration"] - oxxo: StripeObject - p24: StripeObject + oxxo: Optional[StripeObject] + p24: Optional[StripeObject] parent: Optional[str] - pay_by_bank: StripeObject - paynow: StripeObject - paypal: StripeObject - promptpay: StripeObject - sepa_debit: StripeObject - sofort: StripeObject - upi: StripeObject - us_bank_account: StripeObject - wechat_pay: StripeObject + pay_by_bank: Optional[StripeObject] + paynow: Optional[StripeObject] + paypal: Optional[StripeObject] + promptpay: Optional[StripeObject] + sepa_debit: Optional[StripeObject] + sofort: Optional[StripeObject] + upi: Optional[StripeObject] + us_bank_account: Optional[StripeObject] + wechat_pay: Optional[StripeObject] @classmethod def create( diff --git a/stripe/api_resources/person.py b/stripe/api_resources/person.py index 17778bcea..11d78739c 100644 --- a/stripe/api_resources/person.py +++ b/stripe/api_resources/person.py @@ -21,42 +21,43 @@ class Person(UpdateableAPIResource["Person"]): """ OBJECT_NAME = "person" - deleted: bool - account: str - address: StripeObject + account: Optional[str] + address: Optional[StripeObject] address_kana: Optional[StripeObject] address_kanji: Optional[StripeObject] created: int - dob: StripeObject + dob: Optional[StripeObject] email: Optional[str] first_name: Optional[str] first_name_kana: Optional[str] first_name_kanji: Optional[str] - full_name_aliases: List[str] + full_name_aliases: Optional[List[str]] future_requirements: Optional[StripeObject] gender: Optional[str] id: str - id_number_provided: bool - id_number_secondary_provided: bool + id_number_provided: Optional[bool] + id_number_secondary_provided: Optional[bool] last_name: Optional[str] last_name_kana: Optional[str] last_name_kanji: Optional[str] maiden_name: Optional[str] - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] nationality: Optional[str] object: Literal["person"] phone: Optional[str] - political_exposure: Literal["existing", "none"] - registered_address: StripeObject - relationship: StripeObject + political_exposure: Optional[Literal["existing", "none"]] + registered_address: Optional[StripeObject] + relationship: Optional[StripeObject] requirements: Optional[StripeObject] - ssn_last_4_provided: bool - verification: StripeObject + ssn_last_4_provided: Optional[bool] + verification: Optional[StripeObject] + deleted: Optional[Literal[True]] def instance_url(self): token = self.id account = self.account base = Account.class_url() + assert account is not None acct_extn = quote_plus(account) extn = quote_plus(token) return "%s/%s/persons/%s" % (base, acct_extn, extn) diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index 65c95d45c..9064cfa6f 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -35,7 +35,6 @@ class Plan( """ OBJECT_NAME = "plan" - deleted: bool active: bool aggregate_usage: Optional[ Literal["last_during_period", "last_ever", "max", "sum"] @@ -53,11 +52,12 @@ class Plan( nickname: Optional[str] object: Literal["plan"] product: Optional[ExpandableField[Any]] - tiers: List[StripeObject] + tiers: Optional[List[StripeObject]] tiers_mode: Optional[Literal["graduated", "volume"]] transform_usage: Optional[StripeObject] trial_period_days: Optional[int] usage_type: Literal["licensed", "metered"] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index f19718333..b94bf7013 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -32,12 +32,11 @@ class Price( """ OBJECT_NAME = "price" - deleted: bool active: bool billing_scheme: Literal["per_unit", "tiered"] created: int currency: str - currency_options: Dict[str, StripeObject] + currency_options: Optional[Dict[str, StripeObject]] custom_unit_amount: Optional[StripeObject] id: str livemode: bool @@ -48,12 +47,13 @@ class Price( product: ExpandableField[Any] recurring: Optional[StripeObject] tax_behavior: Optional[Literal["exclusive", "inclusive", "unspecified"]] - tiers: List[StripeObject] + tiers: Optional[List[StripeObject]] tiers_mode: Optional[Literal["graduated", "volume"]] transform_quantity: Optional[StripeObject] type: Literal["one_time", "recurring"] unit_amount: Optional[int] unit_amount_decimal: Optional[float] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index ebd656a08..3520b46b3 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -43,7 +43,6 @@ class Product( """ OBJECT_NAME = "product" - deleted: bool active: bool created: int default_price: Optional[ExpandableField["Price"]] @@ -63,6 +62,7 @@ class Product( unit_label: Optional[str] updated: int url: Optional[str] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index 5119192ed..511dd6f1f 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -50,7 +50,7 @@ class Quote( created: int currency: Optional[str] customer: Optional[ExpandableField[Any]] - default_tax_rates: List[ExpandableField["TaxRate"]] + default_tax_rates: Optional[List[ExpandableField["TaxRate"]]] description: Optional[str] discounts: List[ExpandableField["Discount"]] expires_at: int @@ -60,7 +60,7 @@ class Quote( id: str invoice: Optional[ExpandableField[Any]] invoice_settings: Optional[StripeObject] - line_items: ListObject["LineItem"] + line_items: Optional[ListObject["LineItem"]] livemode: bool metadata: Dict[str, str] number: Optional[str] diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index 2b4e2540e..b2acc682d 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -5,6 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject +from typing import Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -30,7 +31,7 @@ class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): id: str livemode: bool object: Literal["radar.early_fraud_warning"] - payment_intent: ExpandableField["PaymentIntent"] + payment_intent: Optional[ExpandableField["PaymentIntent"]] @classmethod def list( diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index a1e0ff00e..ffdfdb796 100644 --- a/stripe/api_resources/radar/value_list.py +++ b/stripe/api_resources/radar/value_list.py @@ -10,7 +10,7 @@ UpdateableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import Dict, cast +from typing import Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -33,7 +33,6 @@ class ValueList( """ OBJECT_NAME = "radar.value_list" - deleted: bool alias: str created: int created_by: str @@ -55,6 +54,7 @@ class ValueList( metadata: Dict[str, str] name: str object: Literal["radar.value_list"] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index 4889c94d9..ba01dd7c6 100644 --- a/stripe/api_resources/radar/value_list_item.py +++ b/stripe/api_resources/radar/value_list_item.py @@ -9,7 +9,7 @@ ListableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import cast +from typing import Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -26,7 +26,6 @@ class ValueListItem( """ OBJECT_NAME = "radar.value_list_item" - deleted: bool created: int created_by: str id: str @@ -34,6 +33,7 @@ class ValueListItem( object: Literal["radar.value_list_item"] value: str value_list: str + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index d968adeb1..24d7ded0c 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -44,13 +44,15 @@ class Refund( charge: Optional[ExpandableField["Charge"]] created: int currency: str - description: str - failure_balance_transaction: ExpandableField["BalanceTransaction"] - failure_reason: str + description: Optional[str] + failure_balance_transaction: Optional[ + ExpandableField["BalanceTransaction"] + ] + failure_reason: Optional[str] id: str - instructions_email: str + instructions_email: Optional[str] metadata: Optional[Dict[str, str]] - next_action: StripeObject + next_action: Optional[StripeObject] object: Literal["refund"] payment_intent: Optional[ExpandableField["PaymentIntent"]] reason: Optional[ diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index 5bebf8ff8..68cc59535 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -41,7 +41,7 @@ class Review(ListableAPIResource["Review"]): object: Literal["review"] open: bool opened_reason: Literal["manual", "rule"] - payment_intent: ExpandableField["PaymentIntent"] + payment_intent: Optional[ExpandableField["PaymentIntent"]] reason: str session: Optional[StripeObject] diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index cf44855c1..97485a359 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -28,7 +28,7 @@ class SetupAttempt(ListableAPIResource["SetupAttempt"]): OBJECT_NAME = "setup_attempt" application: Optional[ExpandableField["Application"]] - attach_to_self: bool + attach_to_self: Optional[bool] created: int customer: Optional[ExpandableField[Any]] flow_directions: Optional[List[Literal["inbound", "outbound"]]] diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index 995a6fb34..89a128f8a 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -57,7 +57,7 @@ class SetupIntent( OBJECT_NAME = "setup_intent" application: Optional[ExpandableField["Application"]] - attach_to_self: bool + attach_to_self: Optional[bool] automatic_payment_methods: Optional[StripeObject] cancellation_reason: Optional[ Literal["abandoned", "duplicate", "requested_by_customer"] diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index 305dd5210..9440d1838 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -35,7 +35,7 @@ class ShippingRate( created: int delivery_estimate: Optional[StripeObject] display_name: Optional[str] - fixed_amount: StripeObject + fixed_amount: Optional[StripeObject] id: str livemode: bool metadata: Dict[str, str] diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index c3a4ed6e4..6db06036e 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -25,7 +25,7 @@ class ScheduledQueryRun(ListableAPIResource["ScheduledQueryRun"]): OBJECT_NAME = "scheduled_query_run" created: int data_load_time: int - error: StripeObject + error: Optional[StripeObject] file: Optional["File"] id: str livemode: bool diff --git a/stripe/api_resources/source.py b/stripe/api_resources/source.py index 7990e1186..54fc6dc7e 100644 --- a/stripe/api_resources/source.py +++ b/stripe/api_resources/source.py @@ -29,41 +29,41 @@ class Source(CreateableAPIResource["Source"], UpdateableAPIResource["Source"]): """ OBJECT_NAME = "source" - ach_credit_transfer: StripeObject - ach_debit: StripeObject - acss_debit: StripeObject - alipay: StripeObject + ach_credit_transfer: Optional[StripeObject] + ach_debit: Optional[StripeObject] + acss_debit: Optional[StripeObject] + alipay: Optional[StripeObject] amount: Optional[int] - au_becs_debit: StripeObject - bancontact: StripeObject - card: StripeObject - card_present: StripeObject + au_becs_debit: Optional[StripeObject] + bancontact: Optional[StripeObject] + card: Optional[StripeObject] + card_present: Optional[StripeObject] client_secret: str - code_verification: StripeObject + code_verification: Optional[StripeObject] created: int currency: Optional[str] - customer: str - eps: StripeObject + customer: Optional[str] + eps: Optional[StripeObject] flow: str - giropay: StripeObject + giropay: Optional[StripeObject] id: str - ideal: StripeObject - klarna: StripeObject + ideal: Optional[StripeObject] + klarna: Optional[StripeObject] livemode: bool metadata: Optional[Dict[str, str]] - multibanco: StripeObject + multibanco: Optional[StripeObject] object: Literal["source"] owner: Optional[StripeObject] - p24: StripeObject - receiver: StripeObject - redirect: StripeObject - sepa_credit_transfer: StripeObject - sepa_debit: StripeObject - sofort: StripeObject - source_order: StripeObject + p24: Optional[StripeObject] + receiver: Optional[StripeObject] + redirect: Optional[StripeObject] + sepa_credit_transfer: Optional[StripeObject] + sepa_debit: Optional[StripeObject] + sofort: Optional[StripeObject] + source_order: Optional[StripeObject] statement_descriptor: Optional[str] status: str - three_d_secure: StripeObject + three_d_secure: Optional[StripeObject] type: Literal[ "ach_credit_transfer", "ach_debit", @@ -86,7 +86,7 @@ class Source(CreateableAPIResource["Source"], UpdateableAPIResource["Source"]): "wechat", ] usage: Optional[str] - wechat: StripeObject + wechat: Optional[StripeObject] @classmethod def create( diff --git a/stripe/api_resources/source_mandate_notification.py b/stripe/api_resources/source_mandate_notification.py index 0fcc56581..7bdb62d14 100644 --- a/stripe/api_resources/source_mandate_notification.py +++ b/stripe/api_resources/source_mandate_notification.py @@ -20,15 +20,15 @@ class SourceMandateNotification(StripeObject): """ OBJECT_NAME = "source_mandate_notification" - acss_debit: StripeObject + acss_debit: Optional[StripeObject] amount: Optional[int] - bacs_debit: StripeObject + bacs_debit: Optional[StripeObject] created: int id: str livemode: bool object: Literal["source_mandate_notification"] reason: str - sepa_debit: StripeObject + sepa_debit: Optional[StripeObject] source: "Source" status: str type: str diff --git a/stripe/api_resources/source_transaction.py b/stripe/api_resources/source_transaction.py index 9b888d335..d74db7c8d 100644 --- a/stripe/api_resources/source_transaction.py +++ b/stripe/api_resources/source_transaction.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function from stripe.stripe_object import StripeObject +from typing import Optional from typing_extensions import Literal @@ -15,17 +16,17 @@ class SourceTransaction(StripeObject): """ OBJECT_NAME = "source_transaction" - ach_credit_transfer: StripeObject + ach_credit_transfer: Optional[StripeObject] amount: int - chf_credit_transfer: StripeObject + chf_credit_transfer: Optional[StripeObject] created: int currency: str - gbp_credit_transfer: StripeObject + gbp_credit_transfer: Optional[StripeObject] id: str livemode: bool object: Literal["source_transaction"] - paper_check: StripeObject - sepa_credit_transfer: StripeObject + paper_check: Optional[StripeObject] + sepa_credit_transfer: Optional[StripeObject] source: str status: str type: Literal[ diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index af2c5b208..66fa479c2 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -38,7 +38,6 @@ class SubscriptionItem( """ OBJECT_NAME = "subscription_item" - deleted: bool billing_thresholds: Optional[StripeObject] created: int id: str @@ -46,9 +45,10 @@ class SubscriptionItem( object: Literal["subscription_item"] plan: "Plan" price: "Price" - quantity: int + quantity: Optional[int] subscription: str tax_rates: Optional[List["TaxRate"]] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/tax_id.py b/stripe/api_resources/tax_id.py index 0c2bf6c8c..b44e4aaac 100644 --- a/stripe/api_resources/tax_id.py +++ b/stripe/api_resources/tax_id.py @@ -20,7 +20,6 @@ class TaxId(APIResource["TaxId"]): """ OBJECT_NAME = "tax_id" - deleted: bool country: Optional[str] created: int customer: Optional[ExpandableField["Customer"]] @@ -98,6 +97,7 @@ class TaxId(APIResource["TaxId"]): ] value: str verification: Optional[StripeObject] + deleted: Optional[Literal[True]] def instance_url(self): token = self.id diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index d4c4e39f8..f02aef39c 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -27,14 +27,14 @@ class Configuration( """ OBJECT_NAME = "terminal.configuration" - deleted: bool - bbpos_wisepos_e: StripeObject + bbpos_wisepos_e: Optional[StripeObject] id: str is_account_default: Optional[bool] livemode: bool object: Literal["terminal.configuration"] - tipping: StripeObject - verifone_p400: StripeObject + tipping: Optional[StripeObject] + verifone_p400: Optional[StripeObject] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/terminal/connection_token.py b/stripe/api_resources/terminal/connection_token.py index 8f9a9b08f..d4b0b9ec2 100644 --- a/stripe/api_resources/terminal/connection_token.py +++ b/stripe/api_resources/terminal/connection_token.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract import CreateableAPIResource -from typing import cast +from typing import Optional, cast from typing_extensions import Literal @@ -15,7 +15,7 @@ class ConnectionToken(CreateableAPIResource["ConnectionToken"]): """ OBJECT_NAME = "terminal.connection_token" - location: str + location: Optional[str] object: Literal["terminal.connection_token"] secret: str diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index 77e3bd814..d3ea113b7 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -11,7 +11,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Any, Dict, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -29,14 +29,14 @@ class Location( """ OBJECT_NAME = "terminal.location" - deleted: bool address: StripeObject - configuration_overrides: str + configuration_overrides: Optional[str] display_name: str id: str livemode: bool metadata: Dict[str, str] object: Literal["terminal.location"] + deleted: Optional[Literal[True]] @classmethod def create( diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index 1ec9e96a6..f32c7620b 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -36,7 +36,6 @@ class Reader( """ OBJECT_NAME = "terminal.reader" - deleted: bool action: Optional[StripeObject] device_sw_version: Optional[str] device_type: Literal[ @@ -56,6 +55,7 @@ class Reader( object: Literal["terminal.reader"] serial_number: str status: Optional[str] + deleted: Optional[Literal[True]] @classmethod def _cls_cancel_action( diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index 5b5654e38..c8fcaae1f 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -26,7 +26,6 @@ class TestClock( """ OBJECT_NAME = "test_helpers.test_clock" - deleted: bool created: int deletes_after: int frozen_time: int @@ -35,6 +34,7 @@ class TestClock( name: Optional[str] object: Literal["test_helpers.test_clock"] status: Literal["advancing", "internal_failure", "ready"] + deleted: Optional[Literal[True]] @classmethod def _cls_advance( diff --git a/stripe/api_resources/token.py b/stripe/api_resources/token.py index 7144c53ff..00f124d51 100644 --- a/stripe/api_resources/token.py +++ b/stripe/api_resources/token.py @@ -38,8 +38,8 @@ class Token(CreateableAPIResource["Token"]): """ OBJECT_NAME = "token" - bank_account: "BankAccount" - card: "Card" + bank_account: Optional["BankAccount"] + card: Optional["Card"] client_ip: Optional[str] created: int id: str diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index 7c51734ce..be2b5f00a 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -51,7 +51,7 @@ class Transfer( currency: str description: Optional[str] destination: Optional[ExpandableField["Account"]] - destination_payment: ExpandableField["Charge"] + destination_payment: Optional[ExpandableField["Charge"]] id: str livemode: bool metadata: Dict[str, str] @@ -59,7 +59,7 @@ class Transfer( reversals: ListObject["Reversal"] reversed: bool source_transaction: Optional[ExpandableField["Charge"]] - source_type: str + source_type: Optional[str] transfer_group: Optional[str] @classmethod diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index 1d70e375a..a8529b450 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -33,56 +33,62 @@ class FinancialAccount( """ OBJECT_NAME = "treasury.financial_account" - active_features: List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + active_features: Optional[ + List[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ] ] ] balance: StripeObject country: str created: int - features: "FinancialAccountFeatures" + features: Optional["FinancialAccountFeatures"] financial_addresses: List[StripeObject] id: str livemode: bool metadata: Optional[Dict[str, str]] object: Literal["treasury.financial_account"] - pending_features: List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + pending_features: Optional[ + List[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ] ] ] platform_restrictions: Optional[StripeObject] - restricted_features: List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + restricted_features: Optional[ + List[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ] ] ] status: Literal["closed", "open"] diff --git a/stripe/api_resources/treasury/financial_account_features.py b/stripe/api_resources/treasury/financial_account_features.py index f5b411822..e1aec1888 100644 --- a/stripe/api_resources/treasury/financial_account_features.py +++ b/stripe/api_resources/treasury/financial_account_features.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function from stripe.stripe_object import StripeObject +from typing import Optional from typing_extensions import Literal @@ -13,11 +14,11 @@ class FinancialAccountFeatures(StripeObject): """ OBJECT_NAME = "treasury.financial_account_features" - card_issuing: StripeObject - deposit_insurance: StripeObject - financial_addresses: StripeObject - inbound_transfers: StripeObject - intra_stripe_flows: StripeObject + card_issuing: Optional[StripeObject] + deposit_insurance: Optional[StripeObject] + financial_addresses: Optional[StripeObject] + inbound_transfers: Optional[StripeObject] + intra_stripe_flows: Optional[StripeObject] object: Literal["treasury.financial_account_features"] - outbound_payments: StripeObject - outbound_transfers: StripeObject + outbound_payments: Optional[StripeObject] + outbound_transfers: Optional[StripeObject] diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index 81403f041..109017f0e 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -36,7 +36,7 @@ class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): financial_account: Optional[str] hosted_regulatory_receipt_url: Optional[str] id: str - initiating_payment_method_details: StripeObject + initiating_payment_method_details: Optional[StripeObject] linked_flows: StripeObject livemode: bool network: Literal["ach", "card", "stripe"] diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 0c8287463..6df62a674 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -32,7 +32,6 @@ class WebhookEndpoint( """ OBJECT_NAME = "webhook_endpoint" - deleted: bool api_version: Optional[str] application: Optional[str] created: int @@ -42,9 +41,10 @@ class WebhookEndpoint( livemode: bool metadata: Dict[str, str] object: Literal["webhook_endpoint"] - secret: str + secret: Optional[str] status: str url: str + deleted: Optional[Literal[True]] @classmethod def create(