From 41d449da0fb6dcbf34b848ad8e71798a13d75804 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:40:30 +0000 Subject: [PATCH 1/2] Update generated code for v545 --- OPENAPI_VERSION | 2 +- stripe/api_resources/account.py | 200 ++++++------ stripe/api_resources/account_link.py | 12 +- stripe/api_resources/account_session.py | 12 +- stripe/api_resources/apple_pay_domain.py | 26 +- stripe/api_resources/application_fee.py | 70 +++-- .../api_resources/application_fee_refund.py | 6 +- stripe/api_resources/apps/secret.py | 30 +- stripe/api_resources/balance.py | 4 +- stripe/api_resources/balance_transaction.py | 13 +- stripe/api_resources/bank_account.py | 6 +- .../billing_portal/configuration.py | 24 +- .../api_resources/billing_portal/session.py | 18 +- stripe/api_resources/capability.py | 6 +- stripe/api_resources/card.py | 6 +- stripe/api_resources/charge.py | 36 ++- stripe/api_resources/checkout/session.py | 48 +-- .../connect_collection_transfer.py | 2 +- stripe/api_resources/country_spec.py | 12 +- stripe/api_resources/coupon.py | 28 +- stripe/api_resources/credit_note.py | 60 ++-- stripe/api_resources/credit_note_line_item.py | 8 +- stripe/api_resources/customer.py | 287 ++++++++++-------- .../customer_balance_transaction.py | 3 +- .../customer_cash_balance_transaction.py | 13 +- stripe/api_resources/discount.py | 2 +- stripe/api_resources/dispute.py | 28 +- stripe/api_resources/ephemeral_key.py | 6 +- stripe/api_resources/event.py | 12 +- stripe/api_resources/exchange_rate.py | 12 +- stripe/api_resources/file.py | 20 +- stripe/api_resources/file_link.py | 28 +- .../financial_connections/account.py | 55 ++-- .../financial_connections/session.py | 16 +- .../identity/verification_report.py | 12 +- .../identity/verification_session.py | 50 +-- stripe/api_resources/invoice.py | 108 ++++--- stripe/api_resources/invoice_item.py | 28 +- stripe/api_resources/invoice_line_item.py | 2 +- stripe/api_resources/issuing/authorization.py | 102 ++++--- stripe/api_resources/issuing/card.py | 82 ++--- stripe/api_resources/issuing/cardholder.py | 24 +- stripe/api_resources/issuing/dispute.py | 38 ++- stripe/api_resources/issuing/transaction.py | 44 +-- stripe/api_resources/mandate.py | 9 +- stripe/api_resources/payment_intent.py | 102 ++++--- stripe/api_resources/payment_link.py | 38 ++- stripe/api_resources/payment_method.py | 50 +-- .../payment_method_configuration.py | 22 +- stripe/api_resources/payment_method_domain.py | 36 ++- stripe/api_resources/payout.py | 48 +-- stripe/api_resources/person.py | 2 +- stripe/api_resources/plan.py | 28 +- stripe/api_resources/price.py | 24 +- stripe/api_resources/product.py | 28 +- stripe/api_resources/promotion_code.py | 24 +- stripe/api_resources/quote.py | 90 +++--- .../radar/early_fraud_warning.py | 15 +- stripe/api_resources/radar/value_list.py | 28 +- stripe/api_resources/radar/value_list_item.py | 26 +- stripe/api_resources/refund.py | 50 +-- stripe/api_resources/reporting/report_run.py | 22 +- stripe/api_resources/reporting/report_type.py | 12 +- stripe/api_resources/reversal.py | 6 +- stripe/api_resources/review.py | 27 +- stripe/api_resources/setup_attempt.py | 9 +- stripe/api_resources/setup_intent.py | 62 ++-- stripe/api_resources/shipping_rate.py | 26 +- .../sigma/scheduled_query_run.py | 12 +- stripe/api_resources/source.py | 44 +-- stripe/api_resources/subscription.py | 62 ++-- stripe/api_resources/subscription_item.py | 48 +-- stripe/api_resources/subscription_schedule.py | 48 +-- stripe/api_resources/tax/calculation.py | 26 +- stripe/api_resources/tax/settings.py | 6 +- stripe/api_resources/tax/transaction.py | 32 +- stripe/api_resources/tax_code.py | 11 +- stripe/api_resources/tax_id.py | 9 +- stripe/api_resources/tax_rate.py | 24 +- .../api_resources/terminal/configuration.py | 26 +- .../terminal/connection_token.py | 12 +- stripe/api_resources/terminal/location.py | 26 +- stripe/api_resources/terminal/reader.py | 112 ++++--- .../api_resources/test_helpers/test_clock.py | 38 ++- stripe/api_resources/token.py | 16 +- stripe/api_resources/topup.py | 38 ++- stripe/api_resources/transfer.py | 70 +++-- .../api_resources/treasury/credit_reversal.py | 24 +- .../api_resources/treasury/debit_reversal.py | 24 +- .../treasury/financial_account.py | 52 ++-- .../treasury/inbound_transfer.py | 76 +++-- .../treasury/outbound_payment.py | 74 +++-- .../treasury/outbound_transfer.py | 74 +++-- .../api_resources/treasury/received_credit.py | 22 +- .../api_resources/treasury/received_debit.py | 22 +- stripe/api_resources/treasury/transaction.py | 12 +- .../treasury/transaction_entry.py | 15 +- stripe/api_resources/webhook_endpoint.py | 28 +- 98 files changed, 2012 insertions(+), 1456 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e9281bf5d..688708d73 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v532 \ No newline at end of file +v545 \ No newline at end of file diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index 76c364b30..c2efc524c 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -73,11 +73,11 @@ class Account( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Account": return cast( "Account", @@ -93,7 +93,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Account": + def _cls_delete(cls, sid: str, **params: Any) -> "Account": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Account", @@ -101,7 +101,7 @@ def _cls_delete(cls, sid, **params) -> "Account": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Account": + def delete(self, **params: Any) -> "Account": return self._request_and_refresh( "delete", self.instance_url(), @@ -110,7 +110,11 @@ def delete(self, **params) -> "Account": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Account"]: result = cls._static_request( "get", @@ -132,11 +136,11 @@ def list( @classmethod def _cls_persons( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -150,7 +154,7 @@ def _cls_persons( ) @util.class_method_variant("_cls_persons") - def persons(self, idempotency_key=None, **params): + def persons(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "get", "/v1/accounts/{account}/persons".format( @@ -163,11 +167,11 @@ def persons(self, idempotency_key=None, **params): @classmethod def _cls_reject( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -181,7 +185,7 @@ def _cls_reject( ) @util.class_method_variant("_cls_reject") - def reject(self, idempotency_key=None, **params): + def reject(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/accounts/{account}/reject".format( @@ -237,12 +241,12 @@ def serialize(self, previous): @classmethod def retrieve_capability( cls, - account, - capability, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + capability: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -259,12 +263,12 @@ def retrieve_capability( @classmethod def modify_capability( cls, - account, - capability, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + capability: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -281,11 +285,11 @@ def modify_capability( @classmethod def list_capabilities( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -301,11 +305,11 @@ def list_capabilities( @classmethod def create_external_account( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -321,12 +325,12 @@ def create_external_account( @classmethod def retrieve_external_account( cls, - account, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -342,12 +346,12 @@ def retrieve_external_account( @classmethod def modify_external_account( cls, - account, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -363,12 +367,12 @@ def modify_external_account( @classmethod def delete_external_account( cls, - account, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -384,11 +388,11 @@ def delete_external_account( @classmethod def list_external_accounts( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -404,11 +408,11 @@ def list_external_accounts( @classmethod def create_login_link( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -424,11 +428,11 @@ def create_login_link( @classmethod def create_person( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -444,12 +448,12 @@ def create_person( @classmethod def retrieve_person( cls, - account, - person, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + person: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -466,12 +470,12 @@ def retrieve_person( @classmethod def modify_person( cls, - account, - person, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + person: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -488,12 +492,12 @@ def modify_person( @classmethod def delete_person( cls, - account, - person, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + person: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -510,11 +514,11 @@ def delete_person( @classmethod def list_persons( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", diff --git a/stripe/api_resources/account_link.py b/stripe/api_resources/account_link.py index db2734611..a06052e29 100644 --- a/stripe/api_resources/account_link.py +++ b/stripe/api_resources/account_link.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 Any, Optional, cast from typing_extensions import Literal @@ -24,11 +24,11 @@ class AccountLink(CreateableAPIResource["AccountLink"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "AccountLink": return cast( "AccountLink", diff --git a/stripe/api_resources/account_session.py b/stripe/api_resources/account_session.py index 6efd50b38..fc7d15231 100644 --- a/stripe/api_resources/account_session.py +++ b/stripe/api_resources/account_session.py @@ -4,7 +4,7 @@ from stripe.api_resources.abstract import CreateableAPIResource from stripe.stripe_object import StripeObject -from typing import cast +from typing import Any, Optional, cast from typing_extensions import Literal @@ -30,11 +30,11 @@ class AccountSession(CreateableAPIResource["AccountSession"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "AccountSession": return cast( "AccountSession", diff --git a/stripe/api_resources/apple_pay_domain.py b/stripe/api_resources/apple_pay_domain.py index 4890d91d6..765a62d42 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 Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -30,11 +30,11 @@ class ApplePayDomain( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ApplePayDomain": return cast( "ApplePayDomain", @@ -50,7 +50,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "ApplePayDomain": + def _cls_delete(cls, sid: str, **params: Any) -> "ApplePayDomain": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "ApplePayDomain", @@ -58,7 +58,7 @@ def _cls_delete(cls, sid, **params) -> "ApplePayDomain": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "ApplePayDomain": + def delete(self, **params: Any) -> "ApplePayDomain": return self._request_and_refresh( "delete", self.instance_url(), @@ -67,7 +67,11 @@ def delete(self, **params) -> "ApplePayDomain": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ApplePayDomain"]: result = cls._static_request( "get", @@ -87,7 +91,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ApplePayDomain": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ApplePayDomain": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/application_fee.py b/stripe/api_resources/application_fee.py index 1aa60b446..8d3613a0f 100644 --- a/stripe/api_resources/application_fee.py +++ b/stripe/api_resources/application_fee.py @@ -4,12 +4,12 @@ from stripe import util from stripe.api_resources.abstract import ( + ExpandableField, ListableAPIResource, nested_resource_class_methods, ) -from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -44,7 +44,11 @@ class ApplicationFee(ListableAPIResource["ApplicationFee"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ApplicationFee"]: result = cls._static_request( "get", @@ -66,11 +70,11 @@ def list( @classmethod def _cls_refund( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -84,7 +88,7 @@ def _cls_refund( ) @util.class_method_variant("_cls_refund") - def refund(self, idempotency_key=None, **params): + def refund(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/application_fees/{id}/refunds".format( @@ -95,7 +99,9 @@ def refund(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ApplicationFee": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ApplicationFee": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -103,11 +109,11 @@ def retrieve(cls, id, api_key=None, **params) -> "ApplicationFee": @classmethod def create_refund( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -123,12 +129,12 @@ def create_refund( @classmethod def retrieve_refund( cls, - fee, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + fee: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -144,12 +150,12 @@ def retrieve_refund( @classmethod def modify_refund( cls, - fee, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + fee: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -165,11 +171,11 @@ def modify_refund( @classmethod def list_refunds( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", diff --git a/stripe/api_resources/application_fee_refund.py b/stripe/api_resources/application_fee_refund.py index 0f578fcc0..ed1835877 100644 --- a/stripe/api_resources/application_fee_refund.py +++ b/stripe/api_resources/application_fee_refund.py @@ -2,9 +2,11 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import UpdateableAPIResource +from stripe.api_resources.abstract import ( + ExpandableField, + UpdateableAPIResource, +) from stripe.api_resources.application_fee import ApplicationFee -from stripe.api_resources.expandable_field import ExpandableField from typing import Dict, Optional from typing_extensions import Literal from urllib.parse import quote_plus diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index 7be8ddb30..39d130d89 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -8,7 +8,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal @@ -39,11 +39,11 @@ class Secret(CreateableAPIResource["Secret"], ListableAPIResource["Secret"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Secret": return cast( "Secret", @@ -60,7 +60,11 @@ def create( @classmethod def delete_where( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -73,7 +77,11 @@ def delete_where( @classmethod def find( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -86,7 +94,11 @@ def find( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Secret"]: result = cls._static_request( "get", diff --git a/stripe/api_resources/balance.py b/stripe/api_resources/balance.py index 9a156329f..c528862ff 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, Optional +from typing import Any, List, Optional from typing_extensions import Literal @@ -33,7 +33,7 @@ class Balance(SingletonAPIResource["Balance"]): pending: List[StripeObject] @classmethod - def retrieve(cls, **params) -> "Balance": + def retrieve(cls, **params: Any) -> "Balance": instance = cls(None, **params) instance.refresh() return instance diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index 7f7814338..f12b39c99 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -2,8 +2,7 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject from typing import Any, List, Optional @@ -77,7 +76,11 @@ class BalanceTransaction(ListableAPIResource["BalanceTransaction"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["BalanceTransaction"]: result = cls._static_request( "get", @@ -97,7 +100,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "BalanceTransaction": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "BalanceTransaction": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/bank_account.py b/stripe/api_resources/bank_account.py index 1d8b25ca7..b347670e7 100644 --- a/stripe/api_resources/bank_account.py +++ b/stripe/api_resources/bank_account.py @@ -5,12 +5,12 @@ from stripe import error, util from stripe.api_resources.abstract import ( DeletableAPIResource, + ExpandableField, UpdateableAPIResource, 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, Dict, List, Optional, cast from typing_extensions import Literal @@ -55,7 +55,7 @@ class BankAccount( deleted: Optional[Literal[True]] @classmethod - def _cls_delete(cls, sid, **params) -> Any: + def _cls_delete(cls, sid: str, **params: Any) -> Any: url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( Any, @@ -63,7 +63,7 @@ def _cls_delete(cls, sid, **params) -> Any: ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> Any: + def delete(self, **params: Any) -> Any: return self._request_and_refresh( "delete", self.instance_url(), diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index 69927fa01..4f552f8dc 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, Optional, cast @@ -42,11 +42,11 @@ class Configuration( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Configuration": return cast( "Configuration", @@ -63,7 +63,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Configuration"]: result = cls._static_request( "get", @@ -83,7 +87,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Configuration": + def modify(cls, id, **params: Any) -> "Configuration": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Configuration", @@ -91,7 +95,9 @@ def modify(cls, id, **params) -> "Configuration": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Configuration": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Configuration": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/billing_portal/session.py b/stripe/api_resources/billing_portal/session.py index 80b0e3874..b4aa449aa 100644 --- a/stripe/api_resources/billing_portal/session.py +++ b/stripe/api_resources/billing_portal/session.py @@ -2,10 +2,12 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ( + CreateableAPIResource, + ExpandableField, +) from stripe.stripe_object import StripeObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -98,11 +100,11 @@ class Session(CreateableAPIResource["Session"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Session": return cast( "Session", diff --git a/stripe/api_resources/capability.py b/stripe/api_resources/capability.py index c31e906a0..802988e88 100644 --- a/stripe/api_resources/capability.py +++ b/stripe/api_resources/capability.py @@ -2,9 +2,11 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import UpdateableAPIResource +from stripe.api_resources.abstract import ( + ExpandableField, + 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 Optional from typing_extensions import Literal diff --git a/stripe/api_resources/card.py b/stripe/api_resources/card.py index c198ddf58..1583acb73 100644 --- a/stripe/api_resources/card.py +++ b/stripe/api_resources/card.py @@ -5,11 +5,11 @@ from stripe import error, util from stripe.api_resources.abstract import ( DeletableAPIResource, + ExpandableField, 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, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -59,7 +59,7 @@ class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]): deleted: Optional[Literal[True]] @classmethod - def _cls_delete(cls, sid, **params) -> Any: + def _cls_delete(cls, sid: str, **params: Any) -> Any: url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( Any, @@ -67,7 +67,7 @@ def _cls_delete(cls, sid, **params) -> Any: ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> Any: + def delete(self, **params: Any) -> Any: return self._request_and_refresh( "delete", self.instance_url(), diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 14ba02c5f..95ce2f588 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, Optional, cast @@ -98,11 +98,11 @@ class Charge( @classmethod def _cls_capture( cls, - charge, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + charge: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -116,7 +116,7 @@ def _cls_capture( ) @util.class_method_variant("_cls_capture") - def capture(self, idempotency_key=None, **params): + def capture(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/charges/{charge}/capture".format( @@ -129,11 +129,11 @@ def capture(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Charge": return cast( "Charge", @@ -150,7 +150,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Charge"]: result = cls._static_request( "get", @@ -170,7 +174,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Charge": + def modify(cls, id, **params: Any) -> "Charge": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Charge", @@ -178,7 +182,9 @@ def modify(cls, id, **params) -> "Charge": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Charge": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Charge": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index 5c0343812..d1b416653 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -5,9 +5,9 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, 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, Dict, List, Optional, cast @@ -143,11 +143,11 @@ class Session( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Session": return cast( "Session", @@ -165,11 +165,11 @@ def create( @classmethod def _cls_expire( cls, - session, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + session: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -183,7 +183,7 @@ def _cls_expire( ) @util.class_method_variant("_cls_expire") - def expire(self, idempotency_key=None, **params): + def expire(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/checkout/sessions/{session}/expire".format( @@ -195,7 +195,11 @@ def expire(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Session"]: result = cls._static_request( "get", @@ -217,11 +221,11 @@ def list( @classmethod def _cls_list_line_items( cls, - session, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + session: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -235,7 +239,9 @@ def _cls_list_line_items( ) @util.class_method_variant("_cls_list_line_items") - def list_line_items(self, idempotency_key=None, **params): + def list_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( @@ -246,7 +252,9 @@ def list_line_items(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Session": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Session": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/connect_collection_transfer.py b/stripe/api_resources/connect_collection_transfer.py index ffe14e3b4..f70f1b637 100644 --- a/stripe/api_resources/connect_collection_transfer.py +++ b/stripe/api_resources/connect_collection_transfer.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ExpandableField from stripe.stripe_object import StripeObject from typing_extensions import Literal diff --git a/stripe/api_resources/country_spec.py b/stripe/api_resources/country_spec.py index fe4f6e14a..ac24bcf85 100644 --- a/stripe/api_resources/country_spec.py +++ b/stripe/api_resources/country_spec.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, List +from typing import Any, Dict, List, Optional from typing_extensions import Literal @@ -31,7 +31,11 @@ class CountrySpec(ListableAPIResource["CountrySpec"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["CountrySpec"]: result = cls._static_request( "get", @@ -51,7 +55,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "CountrySpec": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "CountrySpec": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index 2e291e0d5..33406c610 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -11,7 +11,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -51,11 +51,11 @@ class Coupon( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Coupon": return cast( "Coupon", @@ -71,7 +71,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Coupon": + def _cls_delete(cls, sid: str, **params: Any) -> "Coupon": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Coupon", @@ -79,7 +79,7 @@ def _cls_delete(cls, sid, **params) -> "Coupon": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Coupon": + def delete(self, **params: Any) -> "Coupon": return self._request_and_refresh( "delete", self.instance_url(), @@ -88,7 +88,11 @@ def delete(self, **params) -> "Coupon": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Coupon"]: result = cls._static_request( "get", @@ -108,7 +112,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Coupon": + def modify(cls, id, **params: Any) -> "Coupon": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Coupon", @@ -116,7 +120,9 @@ def modify(cls, id, **params) -> "Coupon": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Coupon": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Coupon": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index 544f758eb..a639b5f7a 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) -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, Dict, List, Optional, cast @@ -80,11 +80,11 @@ class CreditNote( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "CreditNote": return cast( "CreditNote", @@ -101,7 +101,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["CreditNote"]: result = cls._static_request( "get", @@ -121,7 +125,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "CreditNote": + def modify(cls, id, **params: Any) -> "CreditNote": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "CreditNote", @@ -130,7 +134,11 @@ def modify(cls, id, **params) -> "CreditNote": @classmethod def preview( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -143,7 +151,11 @@ def preview( @classmethod def preview_lines( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -155,7 +167,9 @@ def preview_lines( ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "CreditNote": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "CreditNote": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -163,11 +177,11 @@ def retrieve(cls, id, api_key=None, **params) -> "CreditNote": @classmethod def _cls_void_credit_note( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -179,7 +193,9 @@ def _cls_void_credit_note( ) @util.class_method_variant("_cls_void_credit_note") - def void_credit_note(self, idempotency_key=None, **params): + def void_credit_note( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/credit_notes/{id}/void".format( @@ -192,11 +208,11 @@ def void_credit_note(self, idempotency_key=None, **params): @classmethod def list_lines( cls, - credit_note, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + credit_note: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", diff --git a/stripe/api_resources/credit_note_line_item.py b/stripe/api_resources/credit_note_line_item.py index e6259d11b..24fc50629 100644 --- a/stripe/api_resources/credit_note_line_item.py +++ b/stripe/api_resources/credit_note_line_item.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import List, Optional +from typing import Any, List, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -39,7 +39,11 @@ class CreditNoteLineItem(ListableAPIResource["CreditNoteLineItem"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["CreditNoteLineItem"]: result = cls._static_request( "get", diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index f28002333..2cf8e4542 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -7,12 +7,12 @@ APIResourceTestHelpers, CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) -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, Dict, List, Optional, cast @@ -80,11 +80,11 @@ class Customer( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Customer": return cast( "Customer", @@ -102,11 +102,11 @@ def create( @classmethod def _cls_create_funding_instructions( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -120,7 +120,9 @@ def _cls_create_funding_instructions( ) @util.class_method_variant("_cls_create_funding_instructions") - def create_funding_instructions(self, idempotency_key=None, **params): + def create_funding_instructions( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/customers/{customer}/funding_instructions".format( @@ -131,7 +133,7 @@ def create_funding_instructions(self, idempotency_key=None, **params): ) @classmethod - def _cls_delete(cls, sid, **params) -> "Customer": + def _cls_delete(cls, sid: str, **params: Any) -> "Customer": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Customer", @@ -139,7 +141,7 @@ def _cls_delete(cls, sid, **params) -> "Customer": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Customer": + def delete(self, **params: Any) -> "Customer": return self._request_and_refresh( "delete", self.instance_url(), @@ -149,11 +151,11 @@ def delete(self, **params) -> "Customer": @classmethod def _cls_delete_discount( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -167,7 +169,9 @@ def _cls_delete_discount( ) @util.class_method_variant("_cls_delete_discount") - def delete_discount(self, idempotency_key=None, **params): + def delete_discount( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "delete", "/v1/customers/{customer}/discount".format( @@ -179,7 +183,11 @@ def delete_discount(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Customer"]: result = cls._static_request( "get", @@ -201,11 +209,11 @@ def list( @classmethod def _cls_list_payment_methods( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -219,7 +227,9 @@ def _cls_list_payment_methods( ) @util.class_method_variant("_cls_list_payment_methods") - def list_payment_methods(self, idempotency_key=None, **params): + def list_payment_methods( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/customers/{customer}/payment_methods".format( @@ -230,7 +240,7 @@ def list_payment_methods(self, idempotency_key=None, **params): ) @classmethod - def modify(cls, id, **params) -> "Customer": + def modify(cls, id, **params: Any) -> "Customer": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Customer", @@ -238,7 +248,9 @@ def modify(cls, id, **params) -> "Customer": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> Any: + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> Any: instance = cls(id, api_key, **params) instance.refresh() return instance @@ -246,12 +258,12 @@ def retrieve(cls, id, api_key=None, **params) -> Any: @classmethod def _cls_retrieve_payment_method( cls, - customer, - payment_method, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + payment_method: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -267,7 +279,10 @@ def _cls_retrieve_payment_method( @util.class_method_variant("_cls_retrieve_payment_method") def retrieve_payment_method( - self, payment_method, idempotency_key=None, **params + self, + payment_method: str, + idempotency_key: Optional[str] = None, + **params: Any ): return self._request( "get", @@ -290,11 +305,11 @@ def search_auto_paging_iter(cls, *args, **kwargs) -> Any: @classmethod def create_balance_transaction( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -310,12 +325,12 @@ def create_balance_transaction( @classmethod def retrieve_balance_transaction( cls, - customer, - transaction, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + transaction: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -332,12 +347,12 @@ def retrieve_balance_transaction( @classmethod def modify_balance_transaction( cls, - customer, - transaction, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + transaction: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -354,11 +369,11 @@ def modify_balance_transaction( @classmethod def list_balance_transactions( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -374,12 +389,12 @@ def list_balance_transactions( @classmethod def retrieve_cash_balance_transaction( cls, - customer, - transaction, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + transaction: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -396,11 +411,11 @@ def retrieve_cash_balance_transaction( @classmethod def list_cash_balance_transactions( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -416,11 +431,11 @@ def list_cash_balance_transactions( @classmethod def create_source( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -436,12 +451,12 @@ def create_source( @classmethod def retrieve_source( cls, - customer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -457,12 +472,12 @@ def retrieve_source( @classmethod def modify_source( cls, - customer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -478,12 +493,12 @@ def modify_source( @classmethod def delete_source( cls, - customer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -499,11 +514,11 @@ def delete_source( @classmethod def list_sources( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -519,11 +534,11 @@ def list_sources( @classmethod def create_tax_id( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -539,12 +554,12 @@ def create_tax_id( @classmethod def retrieve_tax_id( cls, - customer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -560,12 +575,12 @@ def retrieve_tax_id( @classmethod def delete_tax_id( cls, - customer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -581,11 +596,11 @@ def delete_tax_id( @classmethod def list_tax_ids( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -601,11 +616,11 @@ def list_tax_ids( @classmethod def modify_cash_balance( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -621,11 +636,11 @@ def modify_cash_balance( @classmethod def retrieve_cash_balance( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -644,11 +659,11 @@ class TestHelpers(APIResourceTestHelpers["Customer"]): @classmethod def _cls_fund_cash_balance( cls, - customer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + customer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -662,7 +677,9 @@ def _cls_fund_cash_balance( ) @util.class_method_variant("_cls_fund_cash_balance") - def fund_cash_balance(self, idempotency_key=None, **params): + def fund_cash_balance( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( diff --git a/stripe/api_resources/customer_balance_transaction.py b/stripe/api_resources/customer_balance_transaction.py index 7a1a2f0c6..d357e37d5 100644 --- a/stripe/api_resources/customer_balance_transaction.py +++ b/stripe/api_resources/customer_balance_transaction.py @@ -2,9 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource +from stripe.api_resources.abstract import APIResource, ExpandableField from stripe.api_resources.customer import Customer -from stripe.api_resources.expandable_field import ExpandableField from typing import Dict, Optional from typing_extensions import Literal from urllib.parse import quote_plus diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index 1827c9f26..1aa7b666f 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -2,11 +2,10 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -52,7 +51,11 @@ class CustomerCashBalanceTransaction( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["CustomerCashBalanceTransaction"]: result = cls._static_request( "get", @@ -73,7 +76,7 @@ def list( @classmethod def retrieve( - cls, id, api_key=None, **params + cls, id: str, api_key: Optional[str] = None, **params: Any ) -> "CustomerCashBalanceTransaction": instance = cls(id, api_key, **params) instance.refresh() diff --git a/stripe/api_resources/discount.py b/stripe/api_resources/discount.py index 8f20e85ff..2801297d4 100644 --- a/stripe/api_resources/discount.py +++ b/stripe/api_resources/discount.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ExpandableField from stripe.stripe_object import StripeObject from typing import Any, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 06d1948dd..adae8c597 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -4,13 +4,13 @@ from stripe import util from stripe.api_resources.abstract import ( + ExpandableField, ListableAPIResource, 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 Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -63,11 +63,11 @@ class Dispute( @classmethod def _cls_close( cls, - dispute, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + dispute: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -81,7 +81,7 @@ def _cls_close( ) @util.class_method_variant("_cls_close") - def close(self, idempotency_key=None, **params): + def close(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/disputes/{dispute}/close".format( @@ -93,7 +93,11 @@ def close(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Dispute"]: result = cls._static_request( "get", @@ -113,7 +117,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Dispute": + def modify(cls, id, **params: Any) -> "Dispute": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Dispute", @@ -121,7 +125,9 @@ def modify(cls, id, **params) -> "Dispute": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Dispute": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Dispute": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/ephemeral_key.py b/stripe/api_resources/ephemeral_key.py index 484af9bb6..f9ee9c115 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 Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -19,7 +19,7 @@ class EphemeralKey(DeletableAPIResource["EphemeralKey"]): secret: Optional[str] @classmethod - def _cls_delete(cls, sid, **params) -> "EphemeralKey": + def _cls_delete(cls, sid: str, **params: Any) -> "EphemeralKey": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "EphemeralKey", @@ -27,7 +27,7 @@ def _cls_delete(cls, sid, **params) -> "EphemeralKey": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "EphemeralKey": + def delete(self, **params: Any) -> "EphemeralKey": return self._request_and_refresh( "delete", self.instance_url(), diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index 4c30e3c0a..0ce8426c1 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal @@ -281,7 +281,11 @@ class Event(ListableAPIResource["Event"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Event"]: result = cls._static_request( "get", @@ -301,7 +305,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Event": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Event": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/exchange_rate.py b/stripe/api_resources/exchange_rate.py index 800fda1b8..f20ccbc8e 100644 --- a/stripe/api_resources/exchange_rate.py +++ b/stripe/api_resources/exchange_rate.py @@ -4,7 +4,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject -from typing import Dict +from typing import Any, Dict, Optional from typing_extensions import Literal @@ -30,7 +30,11 @@ class ExchangeRate(ListableAPIResource["ExchangeRate"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ExchangeRate"]: result = cls._static_request( "get", @@ -50,7 +54,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ExchangeRate": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ExchangeRate": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/file.py b/stripe/api_resources/file.py index 4b30ed9fa..0a1ce419c 100644 --- a/stripe/api_resources/file.py +++ b/stripe/api_resources/file.py @@ -6,7 +6,7 @@ from stripe import api_requestor, util from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -17,10 +17,10 @@ class File(ListableAPIResource["File"]): """ - This is an object representing a file hosted on Stripe's servers. The - file may have been uploaded by yourself using the [create file](https://stripe.com/docs/api#create_file) - request (for example, when uploading dispute evidence) or it may have - been created by Stripe (for example, the results of a [Sigma scheduled + This object represents files hosted on Stripe's servers. You can upload + files with the [create file](https://stripe.com/docs/api#create_file) request + (for example, when uploading dispute evidence). Stripe also + creates files independetly (for example, the results of a [Sigma scheduled query](https://stripe.com/docs/api#scheduled_queries)). Related guide: [File upload guide](https://stripe.com/docs/file-upload) @@ -57,7 +57,11 @@ class File(ListableAPIResource["File"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["File"]: result = cls._static_request( "get", @@ -77,7 +81,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "File": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "File": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index c10028f4b..5412a17f7 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -4,12 +4,12 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, UpdateableAPIResource, ) -from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -26,7 +26,7 @@ class FileLink( ): """ To share the contents of a `File` object with non-Stripe users, you can - create a `FileLink`. `FileLink`s contain a URL that can be used to + create a `FileLink`. `FileLink`s contain a URL that you can use to retrieve the contents of the file without authentication. """ @@ -44,11 +44,11 @@ class FileLink( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "FileLink": return cast( "FileLink", @@ -65,7 +65,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["FileLink"]: result = cls._static_request( "get", @@ -85,7 +89,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "FileLink": + def modify(cls, id, **params: Any) -> "FileLink": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "FileLink", @@ -93,7 +97,9 @@ def modify(cls, id, **params) -> "FileLink": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "FileLink": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "FileLink": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index 1f566dcf3..9b2951b6d 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -3,11 +3,10 @@ from __future__ import absolute_import, division, print_function from stripe import util -from stripe.api_resources.abstract import ListableAPIResource -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import List, Optional +from typing import Any, List, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -56,11 +55,11 @@ class Account(ListableAPIResource["Account"]): @classmethod def _cls_disconnect( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -74,7 +73,7 @@ def _cls_disconnect( ) @util.class_method_variant("_cls_disconnect") - def disconnect(self, idempotency_key=None, **params): + def disconnect(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( @@ -86,7 +85,11 @@ def disconnect(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Account"]: result = cls._static_request( "get", @@ -108,11 +111,11 @@ def list( @classmethod def _cls_list_owners( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -126,7 +129,9 @@ def _cls_list_owners( ) @util.class_method_variant("_cls_list_owners") - def list_owners(self, idempotency_key=None, **params): + def list_owners( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( @@ -139,11 +144,11 @@ def list_owners(self, idempotency_key=None, **params): @classmethod def _cls_refresh_account( cls, - account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -157,7 +162,9 @@ def _cls_refresh_account( ) @util.class_method_variant("_cls_refresh_account") - def refresh_account(self, idempotency_key=None, **params): + def refresh_account( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( @@ -168,7 +175,9 @@ def refresh_account(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Account": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Account": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/financial_connections/session.py b/stripe/api_resources/financial_connections/session.py index 2ec566a11..07282108c 100644 --- a/stripe/api_resources/financial_connections/session.py +++ b/stripe/api_resources/financial_connections/session.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import CreateableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import List, Optional, cast +from typing import Any, List, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -36,11 +36,11 @@ class Session(CreateableAPIResource["Session"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Session": return cast( "Session", @@ -56,7 +56,9 @@ def create( ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Session": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Session": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index adcd82d65..b3b6bb4ef 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal @@ -38,7 +38,11 @@ class VerificationReport(ListableAPIResource["VerificationReport"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["VerificationReport"]: result = cls._static_request( "get", @@ -58,7 +62,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "VerificationReport": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "VerificationReport": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index ff0d78a73..094d3119b 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -61,11 +61,11 @@ class VerificationSession( @classmethod def _cls_cancel( cls, - session, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + session: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -79,7 +79,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( @@ -92,11 +92,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "VerificationSession": return cast( "VerificationSession", @@ -113,7 +113,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["VerificationSession"]: result = cls._static_request( "get", @@ -133,7 +137,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "VerificationSession": + def modify(cls, id, **params: Any) -> "VerificationSession": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "VerificationSession", @@ -143,11 +147,11 @@ def modify(cls, id, **params) -> "VerificationSession": @classmethod def _cls_redact( cls, - session, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + session: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -161,7 +165,7 @@ def _cls_redact( ) @util.class_method_variant("_cls_redact") - def redact(self, idempotency_key=None, **params): + def redact(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( @@ -172,7 +176,9 @@ def redact(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "VerificationSession": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "VerificationSession": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index d56bb4bfd..c96c1cdb1 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast @@ -173,11 +173,11 @@ class Invoice( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Invoice": return cast( "Invoice", @@ -193,7 +193,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Invoice": + def _cls_delete(cls, sid: str, **params: Any) -> "Invoice": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Invoice", @@ -201,7 +201,7 @@ def _cls_delete(cls, sid, **params) -> "Invoice": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Invoice": + def delete(self, **params: Any) -> "Invoice": return self._request_and_refresh( "delete", self.instance_url(), @@ -211,11 +211,11 @@ def delete(self, **params) -> "Invoice": @classmethod def _cls_finalize_invoice( cls, - invoice, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + invoice: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -229,7 +229,9 @@ def _cls_finalize_invoice( ) @util.class_method_variant("_cls_finalize_invoice") - def finalize_invoice(self, idempotency_key=None, **params): + def finalize_invoice( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/invoices/{invoice}/finalize".format( @@ -241,7 +243,11 @@ def finalize_invoice(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Invoice"]: result = cls._static_request( "get", @@ -263,11 +269,11 @@ def list( @classmethod def _cls_mark_uncollectible( cls, - invoice, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + invoice: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -281,7 +287,9 @@ def _cls_mark_uncollectible( ) @util.class_method_variant("_cls_mark_uncollectible") - def mark_uncollectible(self, idempotency_key=None, **params): + def mark_uncollectible( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( @@ -292,7 +300,7 @@ def mark_uncollectible(self, idempotency_key=None, **params): ) @classmethod - def modify(cls, id, **params) -> "Invoice": + def modify(cls, id, **params: Any) -> "Invoice": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Invoice", @@ -302,11 +310,11 @@ def modify(cls, id, **params) -> "Invoice": @classmethod def _cls_pay( cls, - invoice, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + invoice: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -320,7 +328,7 @@ def _cls_pay( ) @util.class_method_variant("_cls_pay") - def pay(self, idempotency_key=None, **params): + def pay(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/invoices/{invoice}/pay".format( @@ -331,7 +339,9 @@ def pay(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Invoice": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Invoice": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -339,11 +349,11 @@ def retrieve(cls, id, api_key=None, **params) -> "Invoice": @classmethod def _cls_send_invoice( cls, - invoice, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + invoice: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -357,7 +367,9 @@ def _cls_send_invoice( ) @util.class_method_variant("_cls_send_invoice") - def send_invoice(self, idempotency_key=None, **params): + def send_invoice( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/invoices/{invoice}/send".format( @@ -369,7 +381,11 @@ def send_invoice(self, idempotency_key=None, **params): @classmethod def upcoming( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -382,7 +398,11 @@ def upcoming( @classmethod def upcoming_lines( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -396,11 +416,11 @@ def upcoming_lines( @classmethod def _cls_void_invoice( cls, - invoice, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + invoice: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -414,7 +434,9 @@ def _cls_void_invoice( ) @util.class_method_variant("_cls_void_invoice") - def void_invoice(self, idempotency_key=None, **params): + def void_invoice( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/invoices/{invoice}/void".format( diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 6ca810fae..9588157b7 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -77,11 +77,11 @@ class InvoiceItem( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "InvoiceItem": return cast( "InvoiceItem", @@ -97,7 +97,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "InvoiceItem": + def _cls_delete(cls, sid: str, **params: Any) -> "InvoiceItem": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "InvoiceItem", @@ -105,7 +105,7 @@ def _cls_delete(cls, sid, **params) -> "InvoiceItem": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "InvoiceItem": + def delete(self, **params: Any) -> "InvoiceItem": return self._request_and_refresh( "delete", self.instance_url(), @@ -114,7 +114,11 @@ def delete(self, **params) -> "InvoiceItem": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["InvoiceItem"]: result = cls._static_request( "get", @@ -134,7 +138,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "InvoiceItem": + def modify(cls, id, **params: Any) -> "InvoiceItem": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "InvoiceItem", @@ -142,7 +146,9 @@ def modify(cls, id, **params) -> "InvoiceItem": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "InvoiceItem": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "InvoiceItem": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/invoice_line_item.py b/stripe/api_resources/invoice_line_item.py index 44213351a..283242a82 100644 --- a/stripe/api_resources/invoice_line_item.py +++ b/stripe/api_resources/invoice_line_item.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ExpandableField from stripe.stripe_object import StripeObject from typing import Dict, List, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 0817fe8e2..40fd841a5 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( APIResourceTestHelpers, + ExpandableField, ListableAPIResource, 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 Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal, Type from urllib.parse import quote_plus @@ -67,11 +67,11 @@ class Authorization( @classmethod def _cls_approve( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -85,7 +85,7 @@ def _cls_approve( ) @util.class_method_variant("_cls_approve") - def approve(self, idempotency_key=None, **params): + def approve(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( @@ -98,11 +98,11 @@ def approve(self, idempotency_key=None, **params): @classmethod def _cls_decline( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -116,7 +116,7 @@ def _cls_decline( ) @util.class_method_variant("_cls_decline") - def decline(self, idempotency_key=None, **params): + def decline(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( @@ -128,7 +128,11 @@ def decline(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Authorization"]: result = cls._static_request( "get", @@ -148,7 +152,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Authorization": + def modify(cls, id, **params: Any) -> "Authorization": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Authorization", @@ -156,7 +160,9 @@ def modify(cls, id, **params) -> "Authorization": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Authorization": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Authorization": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -167,11 +173,11 @@ class TestHelpers(APIResourceTestHelpers["Authorization"]): @classmethod def _cls_capture( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -185,7 +191,9 @@ def _cls_capture( ) @util.class_method_variant("_cls_capture") - def capture(self, idempotency_key=None, **params): + def capture( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( @@ -198,10 +206,10 @@ def capture(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -215,11 +223,11 @@ def create( @classmethod def _cls_expire( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -233,7 +241,7 @@ def _cls_expire( ) @util.class_method_variant("_cls_expire") - def expire(self, idempotency_key=None, **params): + def expire(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( @@ -246,11 +254,11 @@ def expire(self, idempotency_key=None, **params): @classmethod def _cls_increment( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -264,7 +272,9 @@ def _cls_increment( ) @util.class_method_variant("_cls_increment") - def increment(self, idempotency_key=None, **params): + def increment( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( @@ -277,11 +287,11 @@ def increment(self, idempotency_key=None, **params): @classmethod def _cls_reverse( cls, - authorization, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + authorization: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -295,7 +305,9 @@ def _cls_reverse( ) @util.class_method_variant("_cls_reverse") - def reverse(self, idempotency_key=None, **params): + def reverse( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index a17cd3f62..8f2286d57 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -6,13 +6,13 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from urllib.parse import quote_plus @@ -61,11 +61,11 @@ class Card( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Card": return cast( "Card", @@ -82,7 +82,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Card"]: result = cls._static_request( "get", @@ -102,7 +106,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Card": + def modify(cls, id, **params: Any) -> "Card": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Card", @@ -110,7 +114,9 @@ def modify(cls, id, **params) -> "Card": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Card": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Card": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -121,11 +127,11 @@ class TestHelpers(APIResourceTestHelpers["Card"]): @classmethod def _cls_deliver_card( cls, - card, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + card: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -139,7 +145,9 @@ def _cls_deliver_card( ) @util.class_method_variant("_cls_deliver_card") - def deliver_card(self, idempotency_key=None, **params): + def deliver_card( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( @@ -152,11 +160,11 @@ def deliver_card(self, idempotency_key=None, **params): @classmethod def _cls_fail_card( cls, - card, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + card: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -170,7 +178,9 @@ def _cls_fail_card( ) @util.class_method_variant("_cls_fail_card") - def fail_card(self, idempotency_key=None, **params): + def fail_card( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( @@ -183,11 +193,11 @@ def fail_card(self, idempotency_key=None, **params): @classmethod def _cls_return_card( cls, - card, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + card: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -201,7 +211,9 @@ def _cls_return_card( ) @util.class_method_variant("_cls_return_card") - def return_card(self, idempotency_key=None, **params): + def return_card( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( @@ -214,11 +226,11 @@ def return_card(self, idempotency_key=None, **params): @classmethod def _cls_ship_card( cls, - card, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + card: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -232,7 +244,9 @@ def _cls_ship_card( ) @util.class_method_variant("_cls_ship_card") - def ship_card(self, idempotency_key=None, **params): + def ship_card( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( diff --git a/stripe/api_resources/issuing/cardholder.py b/stripe/api_resources/issuing/cardholder.py index 2e18a7659..d66997f72 100644 --- a/stripe/api_resources/issuing/cardholder.py +++ b/stripe/api_resources/issuing/cardholder.py @@ -9,7 +9,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -46,11 +46,11 @@ class Cardholder( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Cardholder": return cast( "Cardholder", @@ -67,7 +67,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Cardholder"]: result = cls._static_request( "get", @@ -87,7 +91,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Cardholder": + def modify(cls, id, **params: Any) -> "Cardholder": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Cardholder", @@ -95,7 +99,9 @@ def modify(cls, id, **params) -> "Cardholder": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Cardholder": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Cardholder": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index 207928815..9fddd7323 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -50,11 +50,11 @@ class Dispute( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Dispute": return cast( "Dispute", @@ -71,7 +71,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Dispute"]: result = cls._static_request( "get", @@ -91,7 +95,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Dispute": + def modify(cls, id, **params: Any) -> "Dispute": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Dispute", @@ -99,7 +103,9 @@ def modify(cls, id, **params) -> "Dispute": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Dispute": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Dispute": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -107,11 +113,11 @@ def retrieve(cls, id, api_key=None, **params) -> "Dispute": @classmethod def _cls_submit( cls, - dispute, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + dispute: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -125,7 +131,7 @@ def _cls_submit( ) @util.class_method_variant("_cls_submit") - def submit(self, idempotency_key=None, **params): + def submit(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index ed5baf6ad..1e77532e6 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( APIResourceTestHelpers, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from urllib.parse import quote_plus @@ -61,7 +61,11 @@ class Transaction( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Transaction"]: result = cls._static_request( "get", @@ -81,7 +85,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Transaction": + def modify(cls, id, **params: Any) -> "Transaction": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Transaction", @@ -89,7 +93,9 @@ def modify(cls, id, **params) -> "Transaction": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Transaction": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Transaction": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -100,10 +106,10 @@ class TestHelpers(APIResourceTestHelpers["Transaction"]): @classmethod def create_force_capture( cls, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -117,10 +123,10 @@ def create_force_capture( @classmethod def create_unlinked_refund( cls, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -134,11 +140,11 @@ def create_unlinked_refund( @classmethod def _cls_refund( cls, - transaction, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + transaction: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -152,7 +158,7 @@ def _cls_refund( ) @util.class_method_variant("_cls_refund") - def refund(self, idempotency_key=None, **params): + def refund(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( diff --git a/stripe/api_resources/mandate.py b/stripe/api_resources/mandate.py index 70b751628..b22ec7bb1 100644 --- a/stripe/api_resources/mandate.py +++ b/stripe/api_resources/mandate.py @@ -2,10 +2,9 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import APIResource, ExpandableField from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -33,7 +32,9 @@ class Mandate(APIResource["Mandate"]): type: Literal["multi_use", "single_use"] @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Mandate": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Mandate": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index fe4200a64..b93f37041 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast @@ -110,11 +110,11 @@ class PaymentIntent( @classmethod def _cls_apply_customer_balance( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -128,7 +128,9 @@ def _cls_apply_customer_balance( ) @util.class_method_variant("_cls_apply_customer_balance") - def apply_customer_balance(self, idempotency_key=None, **params): + def apply_customer_balance( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( @@ -141,11 +143,11 @@ def apply_customer_balance(self, idempotency_key=None, **params): @classmethod def _cls_cancel( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -159,7 +161,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_intents/{intent}/cancel".format( @@ -172,11 +174,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def _cls_capture( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -190,7 +192,7 @@ def _cls_capture( ) @util.class_method_variant("_cls_capture") - def capture(self, idempotency_key=None, **params): + def capture(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_intents/{intent}/capture".format( @@ -203,11 +205,11 @@ def capture(self, idempotency_key=None, **params): @classmethod def _cls_confirm( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -221,7 +223,7 @@ def _cls_confirm( ) @util.class_method_variant("_cls_confirm") - def confirm(self, idempotency_key=None, **params): + def confirm(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_intents/{intent}/confirm".format( @@ -234,11 +236,11 @@ def confirm(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PaymentIntent": return cast( "PaymentIntent", @@ -256,11 +258,11 @@ def create( @classmethod def _cls_increment_authorization( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -274,7 +276,9 @@ def _cls_increment_authorization( ) @util.class_method_variant("_cls_increment_authorization") - def increment_authorization(self, idempotency_key=None, **params): + def increment_authorization( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( @@ -286,7 +290,11 @@ def increment_authorization(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PaymentIntent"]: result = cls._static_request( "get", @@ -306,7 +314,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "PaymentIntent": + def modify(cls, id, **params: Any) -> "PaymentIntent": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PaymentIntent", @@ -314,7 +322,9 @@ def modify(cls, id, **params) -> "PaymentIntent": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "PaymentIntent": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "PaymentIntent": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -322,11 +332,11 @@ def retrieve(cls, id, api_key=None, **params) -> "PaymentIntent": @classmethod def _cls_verify_microdeposits( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -340,7 +350,9 @@ def _cls_verify_microdeposits( ) @util.class_method_variant("_cls_verify_microdeposits") - def verify_microdeposits(self, idempotency_key=None, **params): + def verify_microdeposits( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index 02057d429..fe61da067 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -104,11 +104,11 @@ class PaymentLink( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PaymentLink": return cast( "PaymentLink", @@ -125,7 +125,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PaymentLink"]: result = cls._static_request( "get", @@ -147,11 +151,11 @@ def list( @classmethod def _cls_list_line_items( cls, - payment_link, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payment_link: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -165,7 +169,9 @@ def _cls_list_line_items( ) @util.class_method_variant("_cls_list_line_items") - def list_line_items(self, idempotency_key=None, **params): + def list_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( @@ -176,7 +182,7 @@ def list_line_items(self, idempotency_key=None, **params): ) @classmethod - def modify(cls, id, **params) -> "PaymentLink": + def modify(cls, id, **params: Any) -> "PaymentLink": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PaymentLink", @@ -184,7 +190,9 @@ def modify(cls, id, **params) -> "PaymentLink": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "PaymentLink": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "PaymentLink": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index 973e6144c..e33019b53 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -115,11 +115,11 @@ class PaymentMethod( @classmethod def _cls_attach( cls, - payment_method, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payment_method: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -133,7 +133,7 @@ def _cls_attach( ) @util.class_method_variant("_cls_attach") - def attach(self, idempotency_key=None, **params): + def attach(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( @@ -146,11 +146,11 @@ def attach(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PaymentMethod": return cast( "PaymentMethod", @@ -168,11 +168,11 @@ def create( @classmethod def _cls_detach( cls, - payment_method, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payment_method: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -186,7 +186,7 @@ def _cls_detach( ) @util.class_method_variant("_cls_detach") - def detach(self, idempotency_key=None, **params): + def detach(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( @@ -198,7 +198,11 @@ def detach(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PaymentMethod"]: result = cls._static_request( "get", @@ -218,7 +222,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "PaymentMethod": + def modify(cls, id, **params: Any) -> "PaymentMethod": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PaymentMethod", @@ -226,7 +230,9 @@ def modify(cls, id, **params) -> "PaymentMethod": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "PaymentMethod": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "PaymentMethod": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/payment_method_configuration.py b/stripe/api_resources/payment_method_configuration.py index ae93769b9..26005ff2a 100644 --- a/stripe/api_resources/payment_method_configuration.py +++ b/stripe/api_resources/payment_method_configuration.py @@ -9,7 +9,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -73,11 +73,11 @@ class PaymentMethodConfiguration( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PaymentMethodConfiguration": return cast( "PaymentMethodConfiguration", @@ -94,7 +94,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PaymentMethodConfiguration"]: result = cls._static_request( "get", @@ -114,7 +118,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "PaymentMethodConfiguration": + def modify(cls, id, **params: Any) -> "PaymentMethodConfiguration": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PaymentMethodConfiguration", @@ -123,7 +127,7 @@ def modify(cls, id, **params) -> "PaymentMethodConfiguration": @classmethod def retrieve( - cls, id, api_key=None, **params + cls, id: str, api_key: Optional[str] = None, **params: Any ) -> "PaymentMethodConfiguration": instance = cls(id, api_key, **params) instance.refresh() diff --git a/stripe/api_resources/payment_method_domain.py b/stripe/api_resources/payment_method_domain.py index 6bc618498..067d34203 100644 --- a/stripe/api_resources/payment_method_domain.py +++ b/stripe/api_resources/payment_method_domain.py @@ -10,7 +10,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -42,11 +42,11 @@ class PaymentMethodDomain( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PaymentMethodDomain": return cast( "PaymentMethodDomain", @@ -63,7 +63,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PaymentMethodDomain"]: result = cls._static_request( "get", @@ -83,7 +87,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "PaymentMethodDomain": + def modify(cls, id, **params: Any) -> "PaymentMethodDomain": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PaymentMethodDomain", @@ -91,7 +95,9 @@ def modify(cls, id, **params) -> "PaymentMethodDomain": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "PaymentMethodDomain": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "PaymentMethodDomain": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -99,11 +105,11 @@ def retrieve(cls, id, api_key=None, **params) -> "PaymentMethodDomain": @classmethod def _cls_validate( cls, - payment_method_domain, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payment_method_domain: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -117,7 +123,7 @@ def _cls_validate( ) @util.class_method_variant("_cls_validate") - def validate(self, idempotency_key=None, **params): + def validate(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index 0cc6d047d..791da26e9 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, UpdateableAPIResource, ) -from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Dict, Optional, cast from typing_extensions import Literal @@ -68,11 +68,11 @@ class Payout( @classmethod def _cls_cancel( cls, - payout, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payout: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -86,7 +86,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payouts/{payout}/cancel".format( @@ -99,11 +99,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Payout": return cast( "Payout", @@ -120,7 +120,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Payout"]: result = cls._static_request( "get", @@ -140,7 +144,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Payout": + def modify(cls, id, **params: Any) -> "Payout": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Payout", @@ -148,7 +152,9 @@ def modify(cls, id, **params) -> "Payout": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Payout": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Payout": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -156,11 +162,11 @@ def retrieve(cls, id, api_key=None, **params) -> "Payout": @classmethod def _cls_reverse( cls, - payout, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + payout: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -174,7 +180,7 @@ def _cls_reverse( ) @util.class_method_variant("_cls_reverse") - def reverse(self, idempotency_key=None, **params): + def reverse(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/payouts/{payout}/reverse".format( diff --git a/stripe/api_resources/person.py b/stripe/api_resources/person.py index 11d78739c..92cde8710 100644 --- a/stripe/api_resources/person.py +++ b/stripe/api_resources/person.py @@ -17,7 +17,7 @@ class Person(UpdateableAPIResource["Person"]): A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. - Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information) + Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information) """ OBJECT_NAME = "person" diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index 9064cfa6f..c6b2c8355 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -62,11 +62,11 @@ class Plan( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Plan": return cast( "Plan", @@ -82,7 +82,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Plan": + def _cls_delete(cls, sid: str, **params: Any) -> "Plan": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Plan", @@ -90,7 +90,7 @@ def _cls_delete(cls, sid, **params) -> "Plan": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Plan": + def delete(self, **params: Any) -> "Plan": return self._request_and_refresh( "delete", self.instance_url(), @@ -99,7 +99,11 @@ def delete(self, **params) -> "Plan": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Plan"]: result = cls._static_request( "get", @@ -119,7 +123,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Plan": + def modify(cls, id, **params: Any) -> "Plan": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Plan", @@ -127,7 +131,9 @@ def modify(cls, id, **params) -> "Plan": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Plan": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Plan": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index b94bf7013..a1672aa6a 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -4,11 +4,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast @@ -58,11 +58,11 @@ class Price( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Price": return cast( "Price", @@ -79,7 +79,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Price"]: result = cls._static_request( "get", @@ -99,7 +103,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Price": + def modify(cls, id, **params: Any) -> "Price": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Price", @@ -107,7 +111,9 @@ def modify(cls, id, **params) -> "Price": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Price": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Price": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index 3520b46b3..61f34c4af 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast @@ -67,11 +67,11 @@ class Product( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Product": return cast( "Product", @@ -87,7 +87,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Product": + def _cls_delete(cls, sid: str, **params: Any) -> "Product": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Product", @@ -95,7 +95,7 @@ def _cls_delete(cls, sid, **params) -> "Product": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Product": + def delete(self, **params: Any) -> "Product": return self._request_and_refresh( "delete", self.instance_url(), @@ -104,7 +104,11 @@ def delete(self, **params) -> "Product": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Product"]: result = cls._static_request( "get", @@ -124,7 +128,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Product": + def modify(cls, id, **params: Any) -> "Product": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Product", @@ -132,7 +136,9 @@ def modify(cls, id, **params) -> "Product": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Product": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Product": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index c09885a82..50b5d1aed 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, Optional, cast @@ -48,11 +48,11 @@ class PromotionCode( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "PromotionCode": return cast( "PromotionCode", @@ -69,7 +69,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["PromotionCode"]: result = cls._static_request( "get", @@ -89,7 +93,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "PromotionCode": + def modify(cls, id, **params: Any) -> "PromotionCode": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "PromotionCode", @@ -97,7 +101,9 @@ def modify(cls, id, **params) -> "PromotionCode": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "PromotionCode": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "PromotionCode": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index 511dd6f1f..9b955a2d1 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -6,10 +6,10 @@ from stripe import api_requestor, util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -78,11 +78,11 @@ class Quote( @classmethod def _cls_accept( cls, - quote, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + quote: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -94,7 +94,7 @@ def _cls_accept( ) @util.class_method_variant("_cls_accept") - def accept(self, idempotency_key=None, **params): + def accept(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/quotes/{quote}/accept".format( @@ -107,11 +107,11 @@ def accept(self, idempotency_key=None, **params): @classmethod def _cls_cancel( cls, - quote, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + quote: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -123,7 +123,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/quotes/{quote}/cancel".format( @@ -136,11 +136,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Quote": return cast( "Quote", @@ -158,11 +158,11 @@ def create( @classmethod def _cls_finalize_quote( cls, - quote, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + quote: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -176,7 +176,9 @@ def _cls_finalize_quote( ) @util.class_method_variant("_cls_finalize_quote") - def finalize_quote(self, idempotency_key=None, **params): + def finalize_quote( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/quotes/{quote}/finalize".format( @@ -188,7 +190,11 @@ def finalize_quote(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Quote"]: result = cls._static_request( "get", @@ -210,11 +216,11 @@ def list( @classmethod def _cls_list_computed_upfront_line_items( cls, - quote, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + quote: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -228,7 +234,9 @@ def _cls_list_computed_upfront_line_items( ) @util.class_method_variant("_cls_list_computed_upfront_line_items") - def list_computed_upfront_line_items(self, idempotency_key=None, **params): + def list_computed_upfront_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( @@ -241,11 +249,11 @@ def list_computed_upfront_line_items(self, idempotency_key=None, **params): @classmethod def _cls_list_line_items( cls, - quote, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + quote: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -259,7 +267,9 @@ def _cls_list_line_items( ) @util.class_method_variant("_cls_list_line_items") - def list_line_items(self, idempotency_key=None, **params): + def list_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/quotes/{quote}/line_items".format( @@ -270,7 +280,7 @@ def list_line_items(self, idempotency_key=None, **params): ) @classmethod - def modify(cls, id, **params) -> "Quote": + def modify(cls, id, **params: Any) -> "Quote": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Quote", @@ -278,7 +288,9 @@ def modify(cls, id, **params) -> "Quote": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Quote": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Quote": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index b2acc682d..04e712460 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -2,10 +2,9 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -35,7 +34,11 @@ class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["EarlyFraudWarning"]: result = cls._static_request( "get", @@ -55,7 +58,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "EarlyFraudWarning": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "EarlyFraudWarning": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index ffdfdb796..5b510f222 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, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -59,11 +59,11 @@ class ValueList( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ValueList": return cast( "ValueList", @@ -79,7 +79,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "ValueList": + def _cls_delete(cls, sid: str, **params: Any) -> "ValueList": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "ValueList", @@ -87,7 +87,7 @@ def _cls_delete(cls, sid, **params) -> "ValueList": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "ValueList": + def delete(self, **params: Any) -> "ValueList": return self._request_and_refresh( "delete", self.instance_url(), @@ -96,7 +96,11 @@ def delete(self, **params) -> "ValueList": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ValueList"]: result = cls._static_request( "get", @@ -116,7 +120,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "ValueList": + def modify(cls, id, **params: Any) -> "ValueList": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "ValueList", @@ -124,7 +128,9 @@ def modify(cls, id, **params) -> "ValueList": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ValueList": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ValueList": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index ba01dd7c6..481f63e33 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 Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -38,11 +38,11 @@ class ValueListItem( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ValueListItem": return cast( "ValueListItem", @@ -58,7 +58,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "ValueListItem": + def _cls_delete(cls, sid: str, **params: Any) -> "ValueListItem": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "ValueListItem", @@ -66,7 +66,7 @@ def _cls_delete(cls, sid, **params) -> "ValueListItem": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "ValueListItem": + def delete(self, **params: Any) -> "ValueListItem": return self._request_and_refresh( "delete", self.instance_url(), @@ -75,7 +75,11 @@ def delete(self, **params) -> "ValueListItem": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ValueListItem"]: result = cls._static_request( "get", @@ -95,7 +99,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ValueListItem": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ValueListItem": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index 24d7ded0c..7c3914217 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -6,13 +6,13 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from urllib.parse import quote_plus @@ -71,11 +71,11 @@ class Refund( @classmethod def _cls_cancel( cls, - refund, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + refund: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -89,7 +89,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/refunds/{refund}/cancel".format( @@ -102,11 +102,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Refund": return cast( "Refund", @@ -123,7 +123,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Refund"]: result = cls._static_request( "get", @@ -143,7 +147,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Refund": + def modify(cls, id, **params: Any) -> "Refund": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Refund", @@ -151,7 +155,9 @@ def modify(cls, id, **params) -> "Refund": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Refund": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Refund": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -162,11 +168,11 @@ class TestHelpers(APIResourceTestHelpers["Refund"]): @classmethod def _cls_expire( cls, - refund, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + refund: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -180,7 +186,7 @@ def _cls_expire( ) @util.class_method_variant("_cls_expire") - def expire(self, idempotency_key=None, **params): + def expire(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( diff --git a/stripe/api_resources/reporting/report_run.py b/stripe/api_resources/reporting/report_run.py index 991f395f7..9043842cd 100644 --- a/stripe/api_resources/reporting/report_run.py +++ b/stripe/api_resources/reporting/report_run.py @@ -8,7 +8,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -47,11 +47,11 @@ class ReportRun( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ReportRun": return cast( "ReportRun", @@ -68,7 +68,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ReportRun"]: result = cls._static_request( "get", @@ -88,7 +92,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ReportRun": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ReportRun": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/reporting/report_type.py b/stripe/api_resources/reporting/report_type.py index d2d5220f3..fb63945a7 100644 --- a/stripe/api_resources/reporting/report_type.py +++ b/stripe/api_resources/reporting/report_type.py @@ -4,7 +4,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject -from typing import List, Optional +from typing import Any, List, Optional from typing_extensions import Literal @@ -33,7 +33,11 @@ class ReportType(ListableAPIResource["ReportType"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ReportType"]: result = cls._static_request( "get", @@ -53,7 +57,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ReportType": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ReportType": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/reversal.py b/stripe/api_resources/reversal.py index 7428a62b3..dafdee5ea 100644 --- a/stripe/api_resources/reversal.py +++ b/stripe/api_resources/reversal.py @@ -2,8 +2,10 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import UpdateableAPIResource -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ( + ExpandableField, + UpdateableAPIResource, +) from stripe.api_resources.transfer import Transfer from typing import Dict, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index 68cc59535..dc84181b6 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -3,11 +3,10 @@ from __future__ import absolute_import, division, print_function from stripe import util -from stripe.api_resources.abstract import ListableAPIResource -from stripe.api_resources.expandable_field import ExpandableField +from stripe.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -48,11 +47,11 @@ class Review(ListableAPIResource["Review"]): @classmethod def _cls_approve( cls, - review, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + review: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -66,7 +65,7 @@ def _cls_approve( ) @util.class_method_variant("_cls_approve") - def approve(self, idempotency_key=None, **params): + def approve(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/reviews/{review}/approve".format( @@ -78,7 +77,11 @@ def approve(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Review"]: result = cls._static_request( "get", @@ -98,7 +101,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Review": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Review": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 97485a359..083e03606 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -2,8 +2,7 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject from typing import Any, List, Optional @@ -45,7 +44,11 @@ class SetupAttempt(ListableAPIResource["SetupAttempt"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["SetupAttempt"]: result = cls._static_request( "get", diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index 89a128f8a..af5e71242 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -94,11 +94,11 @@ class SetupIntent( @classmethod def _cls_cancel( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -112,7 +112,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/setup_intents/{intent}/cancel".format( @@ -125,11 +125,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def _cls_confirm( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -143,7 +143,7 @@ def _cls_confirm( ) @util.class_method_variant("_cls_confirm") - def confirm(self, idempotency_key=None, **params): + def confirm(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/setup_intents/{intent}/confirm".format( @@ -156,11 +156,11 @@ def confirm(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "SetupIntent": return cast( "SetupIntent", @@ -177,7 +177,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["SetupIntent"]: result = cls._static_request( "get", @@ -197,7 +201,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "SetupIntent": + def modify(cls, id, **params: Any) -> "SetupIntent": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "SetupIntent", @@ -205,7 +209,9 @@ def modify(cls, id, **params) -> "SetupIntent": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "SetupIntent": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "SetupIntent": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -213,11 +219,11 @@ def retrieve(cls, id, api_key=None, **params) -> "SetupIntent": @classmethod def _cls_verify_microdeposits( cls, - intent, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + intent: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -231,7 +237,9 @@ def _cls_verify_microdeposits( ) @util.class_method_variant("_cls_verify_microdeposits") - def verify_microdeposits(self, idempotency_key=None, **params): + def verify_microdeposits( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index 9440d1838..069359841 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -4,13 +4,13 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -47,11 +47,11 @@ class ShippingRate( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ShippingRate": return cast( "ShippingRate", @@ -68,7 +68,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ShippingRate"]: result = cls._static_request( "get", @@ -88,7 +92,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "ShippingRate": + def modify(cls, id, **params: Any) -> "ShippingRate": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "ShippingRate", @@ -96,7 +100,9 @@ def modify(cls, id, **params) -> "ShippingRate": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ShippingRate": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ShippingRate": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index 6db06036e..b87ce5108 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -37,7 +37,11 @@ class ScheduledQueryRun(ListableAPIResource["ScheduledQueryRun"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ScheduledQueryRun"]: result = cls._static_request( "get", @@ -57,7 +61,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ScheduledQueryRun": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ScheduledQueryRun": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/source.py b/stripe/api_resources/source.py index 54fc6dc7e..10c96c757 100644 --- a/stripe/api_resources/source.py +++ b/stripe/api_resources/source.py @@ -9,7 +9,7 @@ UpdateableAPIResource, ) from stripe.stripe_object import StripeObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -91,11 +91,11 @@ class Source(CreateableAPIResource["Source"], UpdateableAPIResource["Source"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Source": return cast( "Source", @@ -113,11 +113,11 @@ def create( @classmethod def _cls_list_source_transactions( cls, - source, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + source: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -131,7 +131,9 @@ def _cls_list_source_transactions( ) @util.class_method_variant("_cls_list_source_transactions") - def list_source_transactions(self, idempotency_key=None, **params): + def list_source_transactions( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/sources/{source}/source_transactions".format( @@ -142,7 +144,7 @@ def list_source_transactions(self, idempotency_key=None, **params): ) @classmethod - def modify(cls, id, **params) -> "Source": + def modify(cls, id, **params: Any) -> "Source": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Source", @@ -150,7 +152,9 @@ def modify(cls, id, **params) -> "Source": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Source": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Source": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -158,11 +162,11 @@ def retrieve(cls, id, api_key=None, **params) -> "Source": @classmethod def _cls_verify( cls, - source, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + source: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -176,7 +180,7 @@ def _cls_verify( ) @util.class_method_variant("_cls_verify") - def verify(self, idempotency_key=None, **params): + def verify(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/sources/{source}/verify".format( diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 378cfcdad..02e33db5a 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast @@ -101,11 +101,11 @@ class Subscription( @classmethod def _cls_cancel( cls, - subscription_exposed_id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + subscription_exposed_id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -121,7 +121,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( @@ -134,11 +134,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Subscription": return cast( "Subscription", @@ -156,11 +156,11 @@ def create( @classmethod def _cls_delete_discount( cls, - subscription_exposed_id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + subscription_exposed_id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "delete", @@ -176,7 +176,9 @@ def _cls_delete_discount( ) @util.class_method_variant("_cls_delete_discount") - def delete_discount(self, idempotency_key=None, **params): + def delete_discount( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( @@ -188,7 +190,11 @@ def delete_discount(self, idempotency_key=None, **params): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Subscription"]: result = cls._static_request( "get", @@ -208,7 +214,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Subscription": + def modify(cls, id, **params: Any) -> "Subscription": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Subscription", @@ -218,11 +224,11 @@ def modify(cls, id, **params) -> "Subscription": @classmethod def _cls_resume( cls, - subscription, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + subscription: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -236,7 +242,7 @@ def _cls_resume( ) @util.class_method_variant("_cls_resume") - def resume(self, idempotency_key=None, **params): + def resume(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/subscriptions/{subscription}/resume".format( @@ -247,7 +253,9 @@ def resume(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Subscription": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Subscription": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index 66fa479c2..6ab744628 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -12,7 +12,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -53,11 +53,11 @@ class SubscriptionItem( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "SubscriptionItem": return cast( "SubscriptionItem", @@ -73,7 +73,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "SubscriptionItem": + def _cls_delete(cls, sid: str, **params: Any) -> "SubscriptionItem": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "SubscriptionItem", @@ -81,7 +81,7 @@ def _cls_delete(cls, sid, **params) -> "SubscriptionItem": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "SubscriptionItem": + def delete(self, **params: Any) -> "SubscriptionItem": return self._request_and_refresh( "delete", self.instance_url(), @@ -90,7 +90,11 @@ def delete(self, **params) -> "SubscriptionItem": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["SubscriptionItem"]: result = cls._static_request( "get", @@ -110,7 +114,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "SubscriptionItem": + def modify(cls, id, **params: Any) -> "SubscriptionItem": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "SubscriptionItem", @@ -118,7 +122,9 @@ def modify(cls, id, **params) -> "SubscriptionItem": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "SubscriptionItem": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "SubscriptionItem": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -126,11 +132,11 @@ def retrieve(cls, id, api_key=None, **params) -> "SubscriptionItem": @classmethod def create_usage_record( cls, - subscription_item, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + subscription_item: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -146,11 +152,11 @@ def create_usage_record( @classmethod def list_usage_record_summaries( cls, - subscription_item, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + subscription_item: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index 53e3b659b..dd0ae494c 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast @@ -58,11 +58,11 @@ class SubscriptionSchedule( @classmethod def _cls_cancel( cls, - schedule, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + schedule: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -76,7 +76,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( @@ -89,11 +89,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "SubscriptionSchedule": return cast( "SubscriptionSchedule", @@ -110,7 +110,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["SubscriptionSchedule"]: result = cls._static_request( "get", @@ -130,7 +134,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "SubscriptionSchedule": + def modify(cls, id, **params: Any) -> "SubscriptionSchedule": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "SubscriptionSchedule", @@ -140,11 +144,11 @@ def modify(cls, id, **params) -> "SubscriptionSchedule": @classmethod def _cls_release( cls, - schedule, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + schedule: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -158,7 +162,7 @@ def _cls_release( ) @util.class_method_variant("_cls_release") - def release(self, idempotency_key=None, **params): + def release(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( @@ -169,7 +173,9 @@ def release(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "SubscriptionSchedule": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "SubscriptionSchedule": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/tax/calculation.py b/stripe/api_resources/tax/calculation.py index d3b658552..b687ae496 100644 --- a/stripe/api_resources/tax/calculation.py +++ b/stripe/api_resources/tax/calculation.py @@ -6,7 +6,7 @@ from stripe.api_resources.abstract import CreateableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import List, Optional, cast +from typing import Any, List, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -43,11 +43,11 @@ class Calculation(CreateableAPIResource["Calculation"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Calculation": return cast( "Calculation", @@ -65,11 +65,11 @@ def create( @classmethod def _cls_list_line_items( cls, - calculation, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + calculation: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -83,7 +83,9 @@ def _cls_list_line_items( ) @util.class_method_variant("_cls_list_line_items") - def list_line_items(self, idempotency_key=None, **params): + def list_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( diff --git a/stripe/api_resources/tax/settings.py b/stripe/api_resources/tax/settings.py index 4bf0359c7..39ca2a637 100644 --- a/stripe/api_resources/tax/settings.py +++ b/stripe/api_resources/tax/settings.py @@ -7,7 +7,7 @@ UpdateableAPIResource, ) from stripe.stripe_object import StripeObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -31,7 +31,7 @@ class Settings( status_details: StripeObject @classmethod - def modify(cls, id, **params) -> "Settings": + def modify(cls, id, **params: Any) -> "Settings": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Settings", @@ -39,7 +39,7 @@ def modify(cls, id, **params) -> "Settings": ) @classmethod - def retrieve(cls, **params) -> "Settings": + def retrieve(cls, **params: Any) -> "Settings": instance = cls(None, **params) instance.refresh() return instance diff --git a/stripe/api_resources/tax/transaction.py b/stripe/api_resources/tax/transaction.py index 4226d5995..6f087ba9c 100644 --- a/stripe/api_resources/tax/transaction.py +++ b/stripe/api_resources/tax/transaction.py @@ -6,7 +6,7 @@ from stripe.api_resources.abstract import APIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, Optional +from typing import Any, Dict, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -42,7 +42,11 @@ class Transaction(APIResource["Transaction"]): @classmethod def create_from_calculation( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -55,7 +59,11 @@ def create_from_calculation( @classmethod def create_reversal( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -69,11 +77,11 @@ def create_reversal( @classmethod def _cls_list_line_items( cls, - transaction, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + transaction: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -87,7 +95,9 @@ def _cls_list_line_items( ) @util.class_method_variant("_cls_list_line_items") - def list_line_items(self, idempotency_key=None, **params): + def list_line_items( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( @@ -98,7 +108,9 @@ def list_line_items(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Transaction": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Transaction": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/tax_code.py b/stripe/api_resources/tax_code.py index 2a1ead862..cbbec00e4 100644 --- a/stripe/api_resources/tax_code.py +++ b/stripe/api_resources/tax_code.py @@ -4,6 +4,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject +from typing import Any, Optional from typing_extensions import Literal @@ -20,7 +21,11 @@ class TaxCode(ListableAPIResource["TaxCode"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["TaxCode"]: result = cls._static_request( "get", @@ -40,7 +45,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "TaxCode": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "TaxCode": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/tax_id.py b/stripe/api_resources/tax_id.py index b44e4aaac..c937d566e 100644 --- a/stripe/api_resources/tax_id.py +++ b/stripe/api_resources/tax_id.py @@ -2,9 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource +from stripe.api_resources.abstract import APIResource, ExpandableField from stripe.api_resources.customer import Customer -from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing import Optional from typing_extensions import Literal @@ -13,10 +12,10 @@ class TaxId(APIResource["TaxId"]): """ - You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers). - A customer's tax IDs are displayed on invoices and credit notes issued for the customer. + You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. + Customer and account tax IDs get displayed on related invoices and credit notes. - Related guide: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids) + Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) """ OBJECT_NAME = "tax_id" diff --git a/stripe/api_resources/tax_rate.py b/stripe/api_resources/tax_rate.py index ada8c45f2..3c76bbf3c 100644 --- a/stripe/api_resources/tax_rate.py +++ b/stripe/api_resources/tax_rate.py @@ -8,7 +8,7 @@ UpdateableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -60,11 +60,11 @@ class TaxRate( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "TaxRate": return cast( "TaxRate", @@ -81,7 +81,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["TaxRate"]: result = cls._static_request( "get", @@ -101,7 +105,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "TaxRate": + def modify(cls, id, **params: Any) -> "TaxRate": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "TaxRate", @@ -109,7 +113,9 @@ def modify(cls, id, **params) -> "TaxRate": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "TaxRate": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "TaxRate": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index f02aef39c..89773f3f1 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -39,11 +39,11 @@ class Configuration( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Configuration": return cast( "Configuration", @@ -59,7 +59,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Configuration": + def _cls_delete(cls, sid: str, **params: Any) -> "Configuration": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Configuration", @@ -67,7 +67,7 @@ def _cls_delete(cls, sid, **params) -> "Configuration": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Configuration": + def delete(self, **params: Any) -> "Configuration": return self._request_and_refresh( "delete", self.instance_url(), @@ -76,7 +76,11 @@ def delete(self, **params) -> "Configuration": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Configuration"]: result = cls._static_request( "get", @@ -96,7 +100,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> Any: + def modify(cls, id, **params: Any) -> Any: url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( Any, @@ -104,7 +108,9 @@ def modify(cls, id, **params) -> Any: ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> Any: + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> Any: instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/terminal/connection_token.py b/stripe/api_resources/terminal/connection_token.py index d4b0b9ec2..501085af9 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 Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal @@ -22,11 +22,11 @@ class ConnectionToken(CreateableAPIResource["ConnectionToken"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "ConnectionToken": return cast( "ConnectionToken", diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index d3ea113b7..377545d93 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -41,11 +41,11 @@ class Location( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Location": return cast( "Location", @@ -61,7 +61,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Location": + def _cls_delete(cls, sid: str, **params: Any) -> "Location": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Location", @@ -69,7 +69,7 @@ def _cls_delete(cls, sid, **params) -> "Location": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Location": + def delete(self, **params: Any) -> "Location": return self._request_and_refresh( "delete", self.instance_url(), @@ -78,7 +78,11 @@ def delete(self, **params) -> "Location": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Location"]: result = cls._static_request( "get", @@ -98,7 +102,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> Any: + def modify(cls, id, **params: Any) -> Any: url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( Any, @@ -106,7 +110,9 @@ def modify(cls, id, **params) -> Any: ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> Any: + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> Any: instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index f32c7620b..d43e4251b 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -7,10 +7,10 @@ APIResourceTestHelpers, CreateableAPIResource, DeletableAPIResource, + ExpandableField, ListableAPIResource, 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, Dict, Optional, cast @@ -60,11 +60,11 @@ class Reader( @classmethod def _cls_cancel_action( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -78,7 +78,9 @@ def _cls_cancel_action( ) @util.class_method_variant("_cls_cancel_action") - def cancel_action(self, idempotency_key=None, **params): + def cancel_action( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( @@ -91,11 +93,11 @@ def cancel_action(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Reader": return cast( "Reader", @@ -111,7 +113,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "Reader": + def _cls_delete(cls, sid: str, **params: Any) -> "Reader": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "Reader", @@ -119,7 +121,7 @@ def _cls_delete(cls, sid, **params) -> "Reader": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "Reader": + def delete(self, **params: Any) -> "Reader": return self._request_and_refresh( "delete", self.instance_url(), @@ -128,7 +130,11 @@ def delete(self, **params) -> "Reader": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Reader"]: result = cls._static_request( "get", @@ -148,7 +154,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> Any: + def modify(cls, id, **params: Any) -> Any: url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( Any, @@ -158,11 +164,11 @@ def modify(cls, id, **params) -> Any: @classmethod def _cls_process_payment_intent( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -176,7 +182,9 @@ def _cls_process_payment_intent( ) @util.class_method_variant("_cls_process_payment_intent") - def process_payment_intent(self, idempotency_key=None, **params): + def process_payment_intent( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( @@ -189,11 +197,11 @@ def process_payment_intent(self, idempotency_key=None, **params): @classmethod def _cls_process_setup_intent( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -207,7 +215,9 @@ def _cls_process_setup_intent( ) @util.class_method_variant("_cls_process_setup_intent") - def process_setup_intent(self, idempotency_key=None, **params): + def process_setup_intent( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( @@ -220,11 +230,11 @@ def process_setup_intent(self, idempotency_key=None, **params): @classmethod def _cls_refund_payment( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -238,7 +248,9 @@ def _cls_refund_payment( ) @util.class_method_variant("_cls_refund_payment") - def refund_payment(self, idempotency_key=None, **params): + def refund_payment( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( @@ -249,7 +261,9 @@ def refund_payment(self, idempotency_key=None, **params): ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> Any: + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> Any: instance = cls(id, api_key, **params) instance.refresh() return instance @@ -257,11 +271,11 @@ def retrieve(cls, id, api_key=None, **params) -> Any: @classmethod def _cls_set_reader_display( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -275,7 +289,9 @@ def _cls_set_reader_display( ) @util.class_method_variant("_cls_set_reader_display") - def set_reader_display(self, idempotency_key=None, **params): + def set_reader_display( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( @@ -291,11 +307,11 @@ class TestHelpers(APIResourceTestHelpers["Reader"]): @classmethod def _cls_present_payment_method( cls, - reader, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + reader: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -309,7 +325,9 @@ def _cls_present_payment_method( ) @util.class_method_variant("_cls_present_payment_method") - def present_payment_method(self, idempotency_key=None, **params): + def present_payment_method( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index c8fcaae1f..7ddb51649 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -9,7 +9,7 @@ ListableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -39,11 +39,11 @@ class TestClock( @classmethod def _cls_advance( cls, - test_clock, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + test_clock: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -57,7 +57,7 @@ def _cls_advance( ) @util.class_method_variant("_cls_advance") - def advance(self, idempotency_key=None, **params): + def advance(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( @@ -70,11 +70,11 @@ def advance(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "TestClock": return cast( "TestClock", @@ -90,7 +90,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "TestClock": + def _cls_delete(cls, sid: str, **params: Any) -> "TestClock": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "TestClock", @@ -98,7 +98,7 @@ def _cls_delete(cls, sid, **params) -> "TestClock": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "TestClock": + def delete(self, **params: Any) -> "TestClock": return self._request_and_refresh( "delete", self.instance_url(), @@ -107,7 +107,11 @@ def delete(self, **params) -> "TestClock": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["TestClock"]: result = cls._static_request( "get", @@ -127,7 +131,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "TestClock": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "TestClock": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/token.py b/stripe/api_resources/token.py index 00f124d51..509e05eba 100644 --- a/stripe/api_resources/token.py +++ b/stripe/api_resources/token.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function from stripe.api_resources.abstract import CreateableAPIResource -from typing import Optional, cast +from typing import Any, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -51,11 +51,11 @@ class Token(CreateableAPIResource["Token"]): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Token": return cast( "Token", @@ -71,7 +71,9 @@ def create( ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Token": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Token": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index 2c9140444..a19aea0be 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -5,12 +5,12 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, UpdateableAPIResource, ) -from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -55,11 +55,11 @@ class Topup( @classmethod def _cls_cancel( cls, - topup, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + topup: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -71,7 +71,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/topups/{topup}/cancel".format( @@ -84,11 +84,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Topup": return cast( "Topup", @@ -105,7 +105,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Topup"]: result = cls._static_request( "get", @@ -125,7 +129,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Topup": + def modify(cls, id, **params: Any) -> "Topup": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Topup", @@ -133,7 +137,9 @@ def modify(cls, id, **params) -> "Topup": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Topup": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Topup": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index be2b5f00a..b3aec7f97 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -5,13 +5,13 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, ListableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) -from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject -from typing import Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -65,11 +65,11 @@ class Transfer( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "Transfer": return cast( "Transfer", @@ -86,7 +86,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Transfer"]: result = cls._static_request( "get", @@ -106,7 +110,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "Transfer": + def modify(cls, id, **params: Any) -> "Transfer": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "Transfer", @@ -114,7 +118,9 @@ def modify(cls, id, **params) -> "Transfer": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Transfer": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Transfer": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -122,11 +128,11 @@ def retrieve(cls, id, api_key=None, **params) -> "Transfer": @classmethod def create_reversal( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -140,12 +146,12 @@ def create_reversal( @classmethod def retrieve_reversal( cls, - transfer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + transfer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -161,12 +167,12 @@ def retrieve_reversal( @classmethod def modify_reversal( cls, - transfer, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + transfer: str, + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -182,11 +188,11 @@ def modify_reversal( @classmethod def list_reversals( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index 2e2974156..17320c4d2 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -4,12 +4,12 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -45,11 +45,11 @@ class CreditReversal( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "CreditReversal": return cast( "CreditReversal", @@ -66,7 +66,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["CreditReversal"]: result = cls._static_request( "get", @@ -86,7 +90,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "CreditReversal": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "CreditReversal": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index c4f9a535a..d4d04bc1c 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -4,12 +4,12 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, + ExpandableField, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -46,11 +46,11 @@ class DebitReversal( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "DebitReversal": return cast( "DebitReversal", @@ -67,7 +67,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["DebitReversal"]: result = cls._static_request( "get", @@ -87,7 +91,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "DebitReversal": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "DebitReversal": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index a8529b450..22150d44d 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -10,7 +10,7 @@ ) from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -98,11 +98,11 @@ class FinancialAccount( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "FinancialAccount": return cast( "FinancialAccount", @@ -119,7 +119,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["FinancialAccount"]: result = cls._static_request( "get", @@ -139,7 +143,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "FinancialAccount": + def modify(cls, id, **params: Any) -> "FinancialAccount": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "FinancialAccount", @@ -147,7 +151,9 @@ def modify(cls, id, **params) -> "FinancialAccount": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "FinancialAccount": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "FinancialAccount": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -155,11 +161,11 @@ def retrieve(cls, id, api_key=None, **params) -> "FinancialAccount": @classmethod def _cls_retrieve_features( cls, - financial_account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + financial_account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "get", @@ -173,7 +179,9 @@ def _cls_retrieve_features( ) @util.class_method_variant("_cls_retrieve_features") - def retrieve_features(self, idempotency_key=None, **params): + def retrieve_features( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( @@ -186,11 +194,11 @@ def retrieve_features(self, idempotency_key=None, **params): @classmethod def _cls_update_features( cls, - financial_account, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + financial_account: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -204,7 +212,9 @@ def _cls_update_features( ) @util.class_method_variant("_cls_update_features") - def update_features(self, idempotency_key=None, **params): + def update_features( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 23ffcf29c..2f98c87e8 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -6,12 +6,12 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, + ExpandableField, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from typing_extensions import TYPE_CHECKING @@ -53,11 +53,11 @@ class InboundTransfer( @classmethod def _cls_cancel( cls, - inbound_transfer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + inbound_transfer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -71,7 +71,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( @@ -84,11 +84,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "InboundTransfer": return cast( "InboundTransfer", @@ -105,7 +105,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["InboundTransfer"]: result = cls._static_request( "get", @@ -125,7 +129,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "InboundTransfer": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "InboundTransfer": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -136,11 +142,11 @@ class TestHelpers(APIResourceTestHelpers["InboundTransfer"]): @classmethod def _cls_fail( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -154,7 +160,7 @@ def _cls_fail( ) @util.class_method_variant("_cls_fail") - def fail(self, idempotency_key=None, **params): + def fail(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( @@ -167,11 +173,11 @@ def fail(self, idempotency_key=None, **params): @classmethod def _cls_return_inbound_transfer( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -185,7 +191,9 @@ def _cls_return_inbound_transfer( ) @util.class_method_variant("_cls_return_inbound_transfer") - def return_inbound_transfer(self, idempotency_key=None, **params): + def return_inbound_transfer( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( @@ -198,11 +206,11 @@ def return_inbound_transfer(self, idempotency_key=None, **params): @classmethod def _cls_succeed( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -216,7 +224,9 @@ def _cls_succeed( ) @util.class_method_variant("_cls_succeed") - def succeed(self, idempotency_key=None, **params): + def succeed( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index afb374dd0..4bb4a3b03 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -6,12 +6,12 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, + ExpandableField, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from typing_extensions import TYPE_CHECKING @@ -56,11 +56,11 @@ class OutboundPayment( @classmethod def _cls_cancel( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -74,7 +74,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( @@ -87,11 +87,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "OutboundPayment": return cast( "OutboundPayment", @@ -108,7 +108,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["OutboundPayment"]: result = cls._static_request( "get", @@ -128,7 +132,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "OutboundPayment": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "OutboundPayment": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -139,11 +145,11 @@ class TestHelpers(APIResourceTestHelpers["OutboundPayment"]): @classmethod def _cls_fail( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -157,7 +163,7 @@ def _cls_fail( ) @util.class_method_variant("_cls_fail") - def fail(self, idempotency_key=None, **params): + def fail(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( @@ -170,11 +176,11 @@ def fail(self, idempotency_key=None, **params): @classmethod def _cls_post( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -188,7 +194,7 @@ def _cls_post( ) @util.class_method_variant("_cls_post") - def post(self, idempotency_key=None, **params): + def post(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( @@ -201,11 +207,11 @@ def post(self, idempotency_key=None, **params): @classmethod def _cls_return_outbound_payment( cls, - id, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + id: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -219,7 +225,9 @@ def _cls_return_outbound_payment( ) @util.class_method_variant("_cls_return_outbound_payment") - def return_outbound_payment(self, idempotency_key=None, **params): + def return_outbound_payment( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index e3c76a5e0..0a9d6a1e0 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -6,12 +6,12 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, + ExpandableField, 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 Dict, Optional, cast +from typing import Any, Dict, Optional, cast from typing_extensions import Literal, Type from typing_extensions import TYPE_CHECKING @@ -54,11 +54,11 @@ class OutboundTransfer( @classmethod def _cls_cancel( cls, - outbound_transfer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + outbound_transfer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -72,7 +72,7 @@ def _cls_cancel( ) @util.class_method_variant("_cls_cancel") - def cancel(self, idempotency_key=None, **params): + def cancel(self, idempotency_key: Optional[str] = None, **params: Any): return self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( @@ -85,11 +85,11 @@ def cancel(self, idempotency_key=None, **params): @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "OutboundTransfer": return cast( "OutboundTransfer", @@ -106,7 +106,11 @@ def create( @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["OutboundTransfer"]: result = cls._static_request( "get", @@ -126,7 +130,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "OutboundTransfer": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "OutboundTransfer": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -137,11 +143,11 @@ class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): @classmethod def _cls_fail( cls, - outbound_transfer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + outbound_transfer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -155,7 +161,7 @@ def _cls_fail( ) @util.class_method_variant("_cls_fail") - def fail(self, idempotency_key=None, **params): + def fail(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( @@ -168,11 +174,11 @@ def fail(self, idempotency_key=None, **params): @classmethod def _cls_post( cls, - outbound_transfer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + outbound_transfer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -186,7 +192,7 @@ def _cls_post( ) @util.class_method_variant("_cls_post") - def post(self, idempotency_key=None, **params): + def post(self, idempotency_key: Optional[str] = None, **params: Any): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( @@ -199,11 +205,11 @@ def post(self, idempotency_key=None, **params): @classmethod def _cls_return_outbound_transfer( cls, - outbound_transfer, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + outbound_transfer: str, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", @@ -217,7 +223,9 @@ def _cls_return_outbound_transfer( ) @util.class_method_variant("_cls_return_outbound_transfer") - def return_outbound_transfer(self, idempotency_key=None, **params): + def return_outbound_transfer( + self, idempotency_key: Optional[str] = None, **params: Any + ): return self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index 6b7029011..9c4d284ce 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -4,12 +4,12 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, + ExpandableField, 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 Optional +from typing import Any, Optional from typing_extensions import Literal, Type from typing_extensions import TYPE_CHECKING @@ -45,7 +45,11 @@ class ReceivedCredit(ListableAPIResource["ReceivedCredit"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ReceivedCredit"]: result = cls._static_request( "get", @@ -65,7 +69,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ReceivedCredit": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ReceivedCredit": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -76,10 +82,10 @@ class TestHelpers(APIResourceTestHelpers["ReceivedCredit"]): @classmethod def create( cls, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index 109017f0e..1ca7efa9d 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -4,12 +4,12 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, + ExpandableField, 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 Optional +from typing import Any, Optional from typing_extensions import Literal, Type from typing_extensions import TYPE_CHECKING @@ -47,7 +47,11 @@ class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["ReceivedDebit"]: result = cls._static_request( "get", @@ -67,7 +71,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "ReceivedDebit": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "ReceivedDebit": instance = cls(id, api_key, **params) instance.refresh() return instance @@ -78,10 +84,10 @@ class TestHelpers(APIResourceTestHelpers["ReceivedDebit"]): @classmethod def create( cls, - api_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ): return cls._static_request( "post", diff --git a/stripe/api_resources/treasury/transaction.py b/stripe/api_resources/treasury/transaction.py index b87e92139..57dbf773e 100644 --- a/stripe/api_resources/treasury/transaction.py +++ b/stripe/api_resources/treasury/transaction.py @@ -5,7 +5,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -50,7 +50,11 @@ class Transaction(ListableAPIResource["Transaction"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["Transaction"]: result = cls._static_request( "get", @@ -70,7 +74,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "Transaction": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "Transaction": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index 5868d7712..4251b2f8c 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -2,11 +2,10 @@ # File generated from our OpenAPI spec 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.api_resources.abstract import ExpandableField, ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.stripe_object import StripeObject -from typing import Optional +from typing import Any, Optional from typing_extensions import Literal from typing_extensions import TYPE_CHECKING @@ -68,7 +67,11 @@ class TransactionEntry(ListableAPIResource["TransactionEntry"]): @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["TransactionEntry"]: result = cls._static_request( "get", @@ -88,7 +91,9 @@ def list( return result @classmethod - def retrieve(cls, id, api_key=None, **params) -> "TransactionEntry": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "TransactionEntry": instance = cls(id, api_key, **params) instance.refresh() return instance diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 6df62a674..c9a450fef 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -10,7 +10,7 @@ UpdateableAPIResource, ) from stripe.api_resources.list_object import ListObject -from typing import Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus @@ -49,11 +49,11 @@ class WebhookEndpoint( @classmethod def create( cls, - api_key=None, - idempotency_key=None, - stripe_version=None, - stripe_account=None, - **params + api_key: Optional[str] = None, + idempotency_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> "WebhookEndpoint": return cast( "WebhookEndpoint", @@ -69,7 +69,7 @@ def create( ) @classmethod - def _cls_delete(cls, sid, **params) -> "WebhookEndpoint": + def _cls_delete(cls, sid: str, **params: Any) -> "WebhookEndpoint": url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast( "WebhookEndpoint", @@ -77,7 +77,7 @@ def _cls_delete(cls, sid, **params) -> "WebhookEndpoint": ) @util.class_method_variant("_cls_delete") - def delete(self, **params) -> "WebhookEndpoint": + def delete(self, **params: Any) -> "WebhookEndpoint": return self._request_and_refresh( "delete", self.instance_url(), @@ -86,7 +86,11 @@ def delete(self, **params) -> "WebhookEndpoint": @classmethod def list( - cls, api_key=None, stripe_version=None, stripe_account=None, **params + cls, + api_key: Optional[str] = None, + stripe_version: Optional[str] = None, + stripe_account: Optional[str] = None, + **params: Any ) -> ListObject["WebhookEndpoint"]: result = cls._static_request( "get", @@ -106,7 +110,7 @@ def list( return result @classmethod - def modify(cls, id, **params) -> "WebhookEndpoint": + def modify(cls, id, **params: Any) -> "WebhookEndpoint": url = "%s/%s" % (cls.class_url(), quote_plus(id)) return cast( "WebhookEndpoint", @@ -114,7 +118,9 @@ def modify(cls, id, **params) -> "WebhookEndpoint": ) @classmethod - def retrieve(cls, id, api_key=None, **params) -> "WebhookEndpoint": + def retrieve( + cls, id: str, api_key: Optional[str] = None, **params: Any + ) -> "WebhookEndpoint": instance = cls(id, api_key, **params) instance.refresh() return instance From c64399229085dcbaa0cb73c70b14afb6ad562c41 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 22:16:28 +0000 Subject: [PATCH 2/2] Update generated code for v545 --- stripe/api_resources/application_fee.py | 2 +- stripe/api_resources/application_fee_refund.py | 6 ++---- stripe/api_resources/balance_transaction.py | 3 ++- stripe/api_resources/bank_account.py | 2 +- stripe/api_resources/billing_portal/configuration.py | 2 +- stripe/api_resources/billing_portal/session.py | 6 ++---- stripe/api_resources/capability.py | 6 ++---- stripe/api_resources/card.py | 2 +- stripe/api_resources/charge.py | 2 +- stripe/api_resources/checkout/session.py | 2 +- stripe/api_resources/connect_collection_transfer.py | 2 +- stripe/api_resources/credit_note.py | 2 +- stripe/api_resources/customer.py | 2 +- stripe/api_resources/customer_balance_transaction.py | 3 ++- stripe/api_resources/customer_cash_balance_transaction.py | 3 ++- stripe/api_resources/discount.py | 2 +- stripe/api_resources/dispute.py | 2 +- stripe/api_resources/file_link.py | 2 +- stripe/api_resources/financial_connections/account.py | 3 ++- stripe/api_resources/identity/verification_session.py | 2 +- stripe/api_resources/invoice.py | 2 +- stripe/api_resources/invoice_item.py | 2 +- stripe/api_resources/invoice_line_item.py | 2 +- stripe/api_resources/issuing/authorization.py | 2 +- stripe/api_resources/issuing/card.py | 2 +- stripe/api_resources/issuing/dispute.py | 2 +- stripe/api_resources/issuing/transaction.py | 2 +- stripe/api_resources/mandate.py | 3 ++- stripe/api_resources/payment_intent.py | 2 +- stripe/api_resources/payment_link.py | 2 +- stripe/api_resources/payment_method.py | 2 +- stripe/api_resources/payout.py | 2 +- stripe/api_resources/plan.py | 2 +- stripe/api_resources/price.py | 2 +- stripe/api_resources/product.py | 2 +- stripe/api_resources/promotion_code.py | 2 +- stripe/api_resources/quote.py | 2 +- stripe/api_resources/radar/early_fraud_warning.py | 3 ++- stripe/api_resources/refund.py | 2 +- stripe/api_resources/reversal.py | 6 ++---- stripe/api_resources/review.py | 3 ++- stripe/api_resources/setup_attempt.py | 3 ++- stripe/api_resources/setup_intent.py | 2 +- stripe/api_resources/shipping_rate.py | 2 +- stripe/api_resources/subscription.py | 2 +- stripe/api_resources/subscription_schedule.py | 2 +- stripe/api_resources/tax_id.py | 3 ++- stripe/api_resources/terminal/reader.py | 2 +- stripe/api_resources/topup.py | 2 +- stripe/api_resources/transfer.py | 2 +- stripe/api_resources/treasury/credit_reversal.py | 2 +- stripe/api_resources/treasury/debit_reversal.py | 2 +- stripe/api_resources/treasury/inbound_transfer.py | 2 +- stripe/api_resources/treasury/outbound_payment.py | 2 +- stripe/api_resources/treasury/outbound_transfer.py | 2 +- stripe/api_resources/treasury/received_credit.py | 2 +- stripe/api_resources/treasury/received_debit.py | 2 +- stripe/api_resources/treasury/transaction_entry.py | 3 ++- 58 files changed, 72 insertions(+), 70 deletions(-) diff --git a/stripe/api_resources/application_fee.py b/stripe/api_resources/application_fee.py index 8d3613a0f..ee7aa86d4 100644 --- a/stripe/api_resources/application_fee.py +++ b/stripe/api_resources/application_fee.py @@ -4,10 +4,10 @@ from stripe import util from stripe.api_resources.abstract import ( - ExpandableField, ListableAPIResource, nested_resource_class_methods, ) +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/application_fee_refund.py b/stripe/api_resources/application_fee_refund.py index ed1835877..0f578fcc0 100644 --- a/stripe/api_resources/application_fee_refund.py +++ b/stripe/api_resources/application_fee_refund.py @@ -2,11 +2,9 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ( - ExpandableField, - UpdateableAPIResource, -) +from stripe.api_resources.abstract import UpdateableAPIResource from stripe.api_resources.application_fee import ApplicationFee +from stripe.api_resources.expandable_field import ExpandableField from typing import Dict, Optional from typing_extensions import Literal from urllib.parse import quote_plus diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index f12b39c99..3d28db343 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, List, Optional diff --git a/stripe/api_resources/bank_account.py b/stripe/api_resources/bank_account.py index b347670e7..d00e52c73 100644 --- a/stripe/api_resources/bank_account.py +++ b/stripe/api_resources/bank_account.py @@ -5,12 +5,12 @@ from stripe import error, util from stripe.api_resources.abstract import ( DeletableAPIResource, - ExpandableField, UpdateableAPIResource, 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, Dict, List, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index 4f552f8dc..242c17f90 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/billing_portal/session.py b/stripe/api_resources/billing_portal/session.py index b4aa449aa..30659715d 100644 --- a/stripe/api_resources/billing_portal/session.py +++ b/stripe/api_resources/billing_portal/session.py @@ -2,10 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ( - CreateableAPIResource, - ExpandableField, -) +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, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/capability.py b/stripe/api_resources/capability.py index 802988e88..c31e906a0 100644 --- a/stripe/api_resources/capability.py +++ b/stripe/api_resources/capability.py @@ -2,11 +2,9 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ( - ExpandableField, - UpdateableAPIResource, -) +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 Optional from typing_extensions import Literal diff --git a/stripe/api_resources/card.py b/stripe/api_resources/card.py index 1583acb73..5d3767c48 100644 --- a/stripe/api_resources/card.py +++ b/stripe/api_resources/card.py @@ -5,11 +5,11 @@ from stripe import error, util from stripe.api_resources.abstract import ( DeletableAPIResource, - ExpandableField, 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, Dict, List, Optional, cast from typing_extensions import Literal from urllib.parse import quote_plus diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 95ce2f588..5e5b1a537 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index d1b416653..7b922c240 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -5,9 +5,9 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/connect_collection_transfer.py b/stripe/api_resources/connect_collection_transfer.py index f70f1b637..ffe14e3b4 100644 --- a/stripe/api_resources/connect_collection_transfer.py +++ b/stripe/api_resources/connect_collection_transfer.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField +from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing_extensions import Literal diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index a639b5f7a..e33468357 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) +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, Dict, List, Optional, cast diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index 2cf8e4542..d0e0ae8ff 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -7,12 +7,12 @@ APIResourceTestHelpers, CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) +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, Dict, List, Optional, cast diff --git a/stripe/api_resources/customer_balance_transaction.py b/stripe/api_resources/customer_balance_transaction.py index d357e37d5..7a1a2f0c6 100644 --- a/stripe/api_resources/customer_balance_transaction.py +++ b/stripe/api_resources/customer_balance_transaction.py @@ -2,8 +2,9 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource, ExpandableField +from stripe.api_resources.abstract import APIResource from stripe.api_resources.customer import Customer +from stripe.api_resources.expandable_field import ExpandableField from typing import Dict, Optional from typing_extensions import Literal from urllib.parse import quote_plus diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index 1aa7b666f..d5101a86a 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, Optional diff --git a/stripe/api_resources/discount.py b/stripe/api_resources/discount.py index 2801297d4..8f20e85ff 100644 --- a/stripe/api_resources/discount.py +++ b/stripe/api_resources/discount.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField +from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing import Any, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index adae8c597..5f9a3c04e 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -4,10 +4,10 @@ from stripe import util from stripe.api_resources.abstract import ( - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index 5412a17f7..52e95739a 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, UpdateableAPIResource, ) +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Dict, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index 9b2951b6d..37d60c308 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -3,7 +3,8 @@ from __future__ import absolute_import, division, print_function from stripe import util -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, List, Optional diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index 094d3119b..0d04b3eea 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index c96c1cdb1..2b2cd862c 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 9588157b7..d7dc3f72e 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/invoice_line_item.py b/stripe/api_resources/invoice_line_item.py index 283242a82..44213351a 100644 --- a/stripe/api_resources/invoice_line_item.py +++ b/stripe/api_resources/invoice_line_item.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField +from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing import Dict, List, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 40fd841a5..e366ceeaa 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( APIResourceTestHelpers, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index 8f2286d57..6f7b929f2 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index 9fddd7323..5173257eb 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index 1e77532e6..ae629b3ff 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( APIResourceTestHelpers, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/mandate.py b/stripe/api_resources/mandate.py index b22ec7bb1..a05177b44 100644 --- a/stripe/api_resources/mandate.py +++ b/stripe/api_resources/mandate.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource, ExpandableField +from stripe.api_resources.abstract import APIResource +from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing import Any, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index b93f37041..f6364ff54 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index fe61da067..446110f0d 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index e33019b53..d0b7bc10c 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index 791da26e9..5ff8e2773 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, UpdateableAPIResource, ) +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Dict, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index c6b2c8355..902d0b01b 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index a1672aa6a..6c10e4395 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -4,11 +4,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index 61f34c4af..7eee8b070 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index 50b5d1aed..9a0280dcc 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index 9b955a2d1..068fcf767 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -6,10 +6,10 @@ from stripe import api_requestor, util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index 04e712460..8e1ee4469 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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 Any, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index 7c3914217..d434124d6 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -6,10 +6,10 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/reversal.py b/stripe/api_resources/reversal.py index dafdee5ea..7428a62b3 100644 --- a/stripe/api_resources/reversal.py +++ b/stripe/api_resources/reversal.py @@ -2,10 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ( - ExpandableField, - UpdateableAPIResource, -) +from stripe.api_resources.abstract import UpdateableAPIResource +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.transfer import Transfer from typing import Dict, Optional from typing_extensions import Literal diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index dc84181b6..4dae81f76 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -3,7 +3,8 @@ from __future__ import absolute_import, division, print_function from stripe import util -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, Optional diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 083e03606..45047a2fb 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, List, Optional diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index af5e71242..c18802f4f 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index 069359841..62cb19fd3 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -4,10 +4,10 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 02e33db5a..91785f851 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -6,11 +6,11 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, SearchableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index dd0ae494c..3896c70f8 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, List, Optional, cast diff --git a/stripe/api_resources/tax_id.py b/stripe/api_resources/tax_id.py index c937d566e..44c9730e9 100644 --- a/stripe/api_resources/tax_id.py +++ b/stripe/api_resources/tax_id.py @@ -2,8 +2,9 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import APIResource, ExpandableField +from stripe.api_resources.abstract import APIResource from stripe.api_resources.customer import Customer +from stripe.api_resources.expandable_field import ExpandableField from stripe.stripe_object import StripeObject from typing import Optional from typing_extensions import Literal diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index d43e4251b..6f03521b1 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -7,10 +7,10 @@ APIResourceTestHelpers, CreateableAPIResource, DeletableAPIResource, - ExpandableField, ListableAPIResource, 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, Dict, Optional, cast diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index a19aea0be..5cf94a776 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -5,10 +5,10 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, UpdateableAPIResource, ) +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Dict, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index b3aec7f97..ffd8beb69 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -5,11 +5,11 @@ from stripe import util from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, ListableAPIResource, UpdateableAPIResource, nested_resource_class_methods, ) +from stripe.api_resources.expandable_field import ExpandableField from stripe.api_resources.list_object import ListObject from typing import Any, Dict, Optional, cast from typing_extensions import Literal diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index 17320c4d2..610b899d6 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -4,9 +4,9 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, 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, Dict, Optional, cast diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index d4d04bc1c..368296522 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -4,9 +4,9 @@ from stripe.api_resources.abstract import ( CreateableAPIResource, - ExpandableField, 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, Dict, Optional, cast diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 2f98c87e8..4a53e169e 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -6,9 +6,9 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, - ExpandableField, 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, Dict, Optional, cast diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 4bb4a3b03..4699e08bc 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -6,9 +6,9 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, - ExpandableField, 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, Dict, Optional, cast diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index 0a9d6a1e0..498d6debd 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -6,9 +6,9 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, CreateableAPIResource, - ExpandableField, 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, Dict, Optional, cast diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index 9c4d284ce..4a91b2da4 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -4,9 +4,9 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, - ExpandableField, 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, Optional diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index 1ca7efa9d..f5300e632 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -4,9 +4,9 @@ from stripe.api_resources.abstract import ( APIResourceTestHelpers, - ExpandableField, 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, Optional diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index 4251b2f8c..3b402688b 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function -from stripe.api_resources.abstract import ExpandableField, ListableAPIResource +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, Optional