diff --git a/requirements.txt b/requirements.txt index b94f2a788..05f5feee8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ cryptography<40 tox twine -pyright <= 1.1.334 +pyright pytest-cov >= 2.8.1, < 2.11.0 pytest-mock >= 2.0.0 pytest-xdist >= 1.31.0 diff --git a/stripe/api_resources/account.py b/stripe/api_resources/account.py index a126b41ac..e62e13e56 100644 --- a/stripe/api_resources/account.py +++ b/stripe/api_resources/account.py @@ -3488,14 +3488,7 @@ class ListPersonsParamsRelationship(TypedDict): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.CreateParams"] - ) -> "Account": + def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). @@ -3509,10 +3502,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -3578,11 +3567,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListParams"] + cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. @@ -3590,9 +3575,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -3606,12 +3588,7 @@ def list( @classmethod def _cls_persons( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.PersonsParams"] + cls, account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3623,9 +3600,6 @@ def _cls_persons( "/v1/accounts/{account}/persons".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3633,11 +3607,7 @@ def _cls_persons( @overload @staticmethod def persons( - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.PersonsParams"] + account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3646,9 +3616,7 @@ def persons( @overload def persons( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.PersonsParams"] + self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3657,9 +3625,7 @@ def persons( @class_method_variant("_cls_persons") def persons( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.PersonsParams"] + self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -3671,19 +3637,13 @@ def persons( # pyright: ignore[reportGeneralTypeIssues] "/v1/accounts/{account}/persons".format( account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_reject( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.RejectParams"] + cls, account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. @@ -3697,9 +3657,6 @@ def _cls_reject( "/v1/accounts/{account}/reject".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3707,11 +3664,7 @@ def _cls_reject( @overload @staticmethod def reject( - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.RejectParams"] + account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. @@ -3721,11 +3674,7 @@ def reject( ... @overload - def reject( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.RejectParams"] - ) -> "Account": + def reject(self, **params: Unpack["Account.RejectParams"]) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. @@ -3735,9 +3684,7 @@ def reject( @class_method_variant("_cls_reject") def reject( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.RejectParams"] + self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. @@ -3751,7 +3698,6 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] "/v1/accounts/{account}/reject".format( account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -3804,9 +3750,6 @@ def retrieve_capability( cls, account: str, capability: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.RetrieveCapabilityParams"] ) -> "Capability": """ @@ -3820,9 +3763,6 @@ def retrieve_capability( account=util.sanitize_id(account), capability=util.sanitize_id(capability), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3832,9 +3772,6 @@ def modify_capability( cls, account: str, capability: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.ModifyCapabilityParams"] ) -> "Capability": """ @@ -3848,21 +3785,13 @@ def modify_capability( account=util.sanitize_id(account), capability=util.sanitize_id(capability), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_capabilities( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListCapabilitiesParams"] + cls, account: str, **params: Unpack["Account.ListCapabilitiesParams"] ) -> ListObject["Capability"]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. @@ -3874,9 +3803,6 @@ def list_capabilities( "/v1/accounts/{account}/capabilities".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3885,9 +3811,6 @@ def list_capabilities( def create_external_account( cls, account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.CreateExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ @@ -3900,9 +3823,6 @@ def create_external_account( "/v1/accounts/{account}/external_accounts".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3912,9 +3832,6 @@ def retrieve_external_account( cls, account: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.RetrieveExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ @@ -3927,9 +3844,6 @@ def retrieve_external_account( "/v1/accounts/{account}/external_accounts/{id}".format( account=util.sanitize_id(account), id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3939,9 +3853,6 @@ def modify_external_account( cls, account: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.ModifyExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ @@ -3956,9 +3867,6 @@ def modify_external_account( "/v1/accounts/{account}/external_accounts/{id}".format( account=util.sanitize_id(account), id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3968,9 +3876,6 @@ def delete_external_account( cls, account: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.DeleteExternalAccountParams"] ) -> Union["BankAccount", "Card"]: """ @@ -3983,9 +3888,6 @@ def delete_external_account( "/v1/accounts/{account}/external_accounts/{id}".format( account=util.sanitize_id(account), id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3994,9 +3896,6 @@ def delete_external_account( def list_external_accounts( cls, account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.ListExternalAccountsParams"] ) -> ListObject[Union["BankAccount", "Card"]]: """ @@ -4009,21 +3908,13 @@ def list_external_accounts( "/v1/accounts/{account}/external_accounts".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_login_link( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.CreateLoginLinkParams"] + cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ Creates a single-use login link for an Express account to access their Stripe dashboard. @@ -4037,21 +3928,13 @@ def create_login_link( "/v1/accounts/{account}/login_links".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_person( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.CreatePersonParams"] + cls, account: str, **params: Unpack["Account.CreatePersonParams"] ) -> "Person": """ Creates a new person. @@ -4063,9 +3946,6 @@ def create_person( "/v1/accounts/{account}/persons".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -4075,9 +3955,6 @@ def retrieve_person( cls, account: str, person: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.RetrievePersonParams"] ) -> "Person": """ @@ -4091,9 +3968,6 @@ def retrieve_person( account=util.sanitize_id(account), person=util.sanitize_id(person), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -4103,9 +3977,6 @@ def modify_person( cls, account: str, person: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.ModifyPersonParams"] ) -> "Person": """ @@ -4119,9 +3990,6 @@ def modify_person( account=util.sanitize_id(account), person=util.sanitize_id(person), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -4131,9 +3999,6 @@ def delete_person( cls, account: str, person: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Account.DeletePersonParams"] ) -> "Person": """ @@ -4147,21 +4012,13 @@ def delete_person( account=util.sanitize_id(account), person=util.sanitize_id(person), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_persons( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListPersonsParams"] + cls, account: str, **params: Unpack["Account.ListPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. @@ -4173,9 +4030,6 @@ def list_persons( "/v1/accounts/{account}/persons".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/account_link.py b/stripe/api_resources/account_link.py index 17caa5e91..d0d4aed13 100644 --- a/stripe/api_resources/account_link.py +++ b/stripe/api_resources/account_link.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe.api_resources.abstract import CreateableAPIResource from stripe.request_options import RequestOptions -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING @@ -62,12 +62,7 @@ class CreateParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["AccountLink.CreateParams"] + cls, **params: Unpack["AccountLink.CreateParams"] ) -> "AccountLink": """ Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. @@ -77,10 +72,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/account_session.py b/stripe/api_resources/account_session.py index c6844e3a7..78422f4f0 100644 --- a/stripe/api_resources/account_session.py +++ b/stripe/api_resources/account_session.py @@ -3,7 +3,7 @@ from stripe.api_resources.abstract import CreateableAPIResource from stripe.request_options import RequestOptions from stripe.stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, cast from typing_extensions import ( Literal, NotRequired, @@ -94,12 +94,7 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["AccountSession.CreateParams"] + cls, **params: Unpack["AccountSession.CreateParams"] ) -> "AccountSession": """ Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. @@ -109,10 +104,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/apple_pay_domain.py b/stripe/api_resources/apple_pay_domain.py index 3d371ea6e..3ecbbee32 100644 --- a/stripe/api_resources/apple_pay_domain.py +++ b/stripe/api_resources/apple_pay_domain.py @@ -80,12 +80,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplePayDomain.CreateParams"] + cls, **params: Unpack["ApplePayDomain.CreateParams"] ) -> "ApplePayDomain": """ Create an apple pay domain. @@ -95,10 +90,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -150,11 +141,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplePayDomain.ListParams"] + cls, **params: Unpack["ApplePayDomain.ListParams"] ) -> ListObject["ApplePayDomain"]: """ List apple pay domains. @@ -162,9 +149,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/application_fee.py b/stripe/api_resources/application_fee.py index 05cb704b2..1d6b6539e 100644 --- a/stripe/api_resources/application_fee.py +++ b/stripe/api_resources/application_fee.py @@ -201,11 +201,7 @@ class ListRefundsParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplicationFee.ListParams"] + cls, **params: Unpack["ApplicationFee.ListParams"] ) -> ListObject["ApplicationFee"]: """ Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. @@ -213,9 +209,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -229,12 +222,7 @@ def list( @classmethod def _cls_refund( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplicationFee.RefundParams"] + cls, id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -254,9 +242,6 @@ def _cls_refund( "/v1/application_fees/{id}/refunds".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -264,11 +249,7 @@ def _cls_refund( @overload @staticmethod def refund( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplicationFee.RefundParams"] + id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -285,9 +266,7 @@ def refund( @overload def refund( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["ApplicationFee.RefundParams"] + self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -304,9 +283,7 @@ def refund( @class_method_variant("_cls_refund") def refund( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["ApplicationFee.RefundParams"] + self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -326,7 +303,6 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] "/v1/application_fees/{id}/refunds".format( id=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -344,12 +320,7 @@ def retrieve( @classmethod def create_refund( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplicationFee.CreateRefundParams"] + cls, id: str, **params: Unpack["ApplicationFee.CreateRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. @@ -369,9 +340,6 @@ def create_refund( "/v1/application_fees/{id}/refunds".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -381,9 +349,6 @@ def retrieve_refund( cls, fee: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["ApplicationFee.RetrieveRefundParams"] ) -> "ApplicationFeeRefund": """ @@ -396,9 +361,6 @@ def retrieve_refund( "/v1/application_fees/{fee}/refunds/{id}".format( fee=util.sanitize_id(fee), id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -408,9 +370,6 @@ def modify_refund( cls, fee: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["ApplicationFee.ModifyRefundParams"] ) -> "ApplicationFeeRefund": """ @@ -425,21 +384,13 @@ def modify_refund( "/v1/application_fees/{fee}/refunds/{id}".format( fee=util.sanitize_id(fee), id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_refunds( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ApplicationFee.ListRefundsParams"] + cls, id: str, **params: Unpack["ApplicationFee.ListRefundsParams"] ) -> ListObject["ApplicationFeeRefund"]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. @@ -451,9 +402,6 @@ def list_refunds( "/v1/application_fees/{id}/refunds".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/apps/secret.py b/stripe/api_resources/apps/secret.py index e1aa5b2c6..3e829e34b 100644 --- a/stripe/api_resources/apps/secret.py +++ b/stripe/api_resources/apps/secret.py @@ -191,14 +191,7 @@ class ListParamsScope(TypedDict): scope: Scope @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Secret.CreateParams"] - ) -> "Secret": + def create(cls, **params: Unpack["Secret.CreateParams"]) -> "Secret": """ Create or replace a secret in the secret store. """ @@ -207,21 +200,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def delete_where( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Secret.DeleteWhereParams"] + cls, **params: Unpack["Secret.DeleteWhereParams"] ) -> "Secret": """ Deletes a secret from the secret store by name and scope. @@ -231,21 +216,12 @@ def delete_where( cls._static_request( "post", "/v1/apps/secrets/delete", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod - def find( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Secret.FindParams"] - ) -> "Secret": + def find(cls, **params: Unpack["Secret.FindParams"]) -> "Secret": """ Finds a secret in the secret store by name and scope. """ @@ -254,20 +230,13 @@ def find( cls._static_request( "get", "/v1/apps/secrets/find", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Secret.ListParams"] + cls, **params: Unpack["Secret.ListParams"] ) -> ListObject["Secret"]: """ List all secrets stored on the given scope. @@ -275,9 +244,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/balance_transaction.py b/stripe/api_resources/balance_transaction.py index e1477e0f7..bcf701cf7 100644 --- a/stripe/api_resources/balance_transaction.py +++ b/stripe/api_resources/balance_transaction.py @@ -263,11 +263,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["BalanceTransaction.ListParams"] + cls, **params: Unpack["BalanceTransaction.ListParams"] ) -> ListObject["BalanceTransaction"]: """ Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. @@ -277,9 +273,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/billing_portal/configuration.py b/stripe/api_resources/billing_portal/configuration.py index bf6e7d382..79fcf8438 100644 --- a/stripe/api_resources/billing_portal/configuration.py +++ b/stripe/api_resources/billing_portal/configuration.py @@ -654,12 +654,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Configuration.CreateParams"] + cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a configuration that describes the functionality and behavior of a PortalSession @@ -669,21 +664,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Configuration.ListParams"] + cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of configurations that describe the functionality of the customer portal. @@ -691,9 +678,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/billing_portal/session.py b/stripe/api_resources/billing_portal/session.py index aef01102b..9a8f65a4d 100644 --- a/stripe/api_resources/billing_portal/session.py +++ b/stripe/api_resources/billing_portal/session.py @@ -445,14 +445,7 @@ class CreateParamsFlowDataAfterCompletionHostedConfirmation(TypedDict): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.CreateParams"] - ) -> "Session": + def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ Creates a session of the customer portal. """ @@ -461,10 +454,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/charge.py b/stripe/api_resources/charge.py index 7fec9cf1f..0cd861c57 100644 --- a/stripe/api_resources/charge.py +++ b/stripe/api_resources/charge.py @@ -2179,12 +2179,7 @@ class SearchParams(RequestOptions): @classmethod def _cls_capture( - cls, - charge: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Charge.CaptureParams"] + cls, charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. @@ -2200,9 +2195,6 @@ def _cls_capture( "/v1/charges/{charge}/capture".format( charge=util.sanitize_id(charge) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2210,11 +2202,7 @@ def _cls_capture( @overload @staticmethod def capture( - charge: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Charge.CaptureParams"] + charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. @@ -2226,11 +2214,7 @@ def capture( ... @overload - def capture( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Charge.CaptureParams"] - ) -> "Charge": + def capture(self, **params: Unpack["Charge.CaptureParams"]) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. @@ -2242,9 +2226,7 @@ def capture( @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Charge.CaptureParams"] + self, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. @@ -2260,20 +2242,12 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] "/v1/charges/{charge}/capture".format( charge=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Charge.CreateParams"] - ) -> "Charge": + def create(cls, **params: Unpack["Charge.CreateParams"]) -> "Charge": """ Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead of using this method. Confirmation of the PaymentIntent creates the Charge @@ -2284,21 +2258,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Charge.ListParams"] + cls, **params: Unpack["Charge.ListParams"] ) -> ListObject["Charge"]: """ Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. @@ -2306,9 +2272,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/checkout/session.py b/stripe/api_resources/checkout/session.py index ec3f544af..0fb8e9064 100644 --- a/stripe/api_resources/checkout/session.py +++ b/stripe/api_resources/checkout/session.py @@ -3577,14 +3577,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.CreateParams"] - ) -> "Session": + def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ Creates a Session object. """ @@ -3593,22 +3586,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def _cls_expire( - cls, - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.ExpireParams"] + cls, session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open @@ -3622,9 +3606,6 @@ def _cls_expire( "/v1/checkout/sessions/{session}/expire".format( session=util.sanitize_id(session) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3632,11 +3613,7 @@ def _cls_expire( @overload @staticmethod def expire( - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.ExpireParams"] + session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open @@ -3646,11 +3623,7 @@ def expire( ... @overload - def expire( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Session.ExpireParams"] - ) -> "Session": + def expire(self, **params: Unpack["Session.ExpireParams"]) -> "Session": """ A Session can be expired when it is in one of these statuses: open @@ -3660,9 +3633,7 @@ def expire( @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Session.ExpireParams"] + self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open @@ -3676,18 +3647,13 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] "/v1/checkout/sessions/{session}/expire".format( session=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.ListParams"] + cls, **params: Unpack["Session.ListParams"] ) -> ListObject["Session"]: """ Returns a list of Checkout Sessions. @@ -3695,9 +3661,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -3711,12 +3674,7 @@ def list( @classmethod def _cls_list_line_items( - cls, - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.ListLineItemsParams"] + cls, session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3728,9 +3686,6 @@ def _cls_list_line_items( "/v1/checkout/sessions/{session}/line_items".format( session=util.sanitize_id(session) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3738,11 +3693,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.ListLineItemsParams"] + session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3751,9 +3702,7 @@ def list_line_items( @overload def list_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Session.ListLineItemsParams"] + self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3762,9 +3711,7 @@ def list_line_items( @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Session.ListLineItemsParams"] + self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -3776,7 +3723,6 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] "/v1/checkout/sessions/{session}/line_items".format( session=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/country_spec.py b/stripe/api_resources/country_spec.py index 576be0626..fa9caa04e 100644 --- a/stripe/api_resources/country_spec.py +++ b/stripe/api_resources/country_spec.py @@ -4,7 +4,7 @@ from stripe.api_resources.list_object import ListObject from stripe.request_options import RequestOptions from stripe.stripe_object import StripeObject -from typing import ClassVar, Dict, List, Optional +from typing import ClassVar, Dict, List from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING @@ -103,11 +103,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CountrySpec.ListParams"] + cls, **params: Unpack["CountrySpec.ListParams"] ) -> ListObject["CountrySpec"]: """ Lists all Country Spec objects available in the API. @@ -115,9 +111,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/coupon.py b/stripe/api_resources/coupon.py index 31c88b320..31327e118 100644 --- a/stripe/api_resources/coupon.py +++ b/stripe/api_resources/coupon.py @@ -263,14 +263,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Coupon.CreateParams"] - ) -> "Coupon": + def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": """ You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. @@ -281,10 +274,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -332,11 +321,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Coupon.ListParams"] + cls, **params: Unpack["Coupon.ListParams"] ) -> ListObject["Coupon"]: """ Returns a list of your coupons. @@ -344,9 +329,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/credit_note.py b/stripe/api_resources/credit_note.py index a65271d64..68f2ebdac 100644 --- a/stripe/api_resources/credit_note.py +++ b/stripe/api_resources/credit_note.py @@ -663,12 +663,7 @@ class ListLinesParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.CreateParams"] + cls, **params: Unpack["CreditNote.CreateParams"] ) -> "CreditNote": """ Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces @@ -691,21 +686,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.ListParams"] + cls, **params: Unpack["CreditNote.ListParams"] ) -> ListObject["CreditNote"]: """ Returns a list of credit notes. @@ -713,9 +700,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -742,11 +726,7 @@ def modify( @classmethod def preview( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.PreviewParams"] + cls, **params: Unpack["CreditNote.PreviewParams"] ) -> "CreditNote": """ Get a preview of a credit note without creating it. @@ -756,20 +736,13 @@ def preview( cls._static_request( "get", "/v1/credit_notes/preview", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def preview_lines( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.PreviewLinesParams"] + cls, **params: Unpack["CreditNote.PreviewLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. @@ -779,9 +752,6 @@ def preview_lines( cls._static_request( "get", "/v1/credit_notes/preview/lines", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -799,12 +769,7 @@ def retrieve( @classmethod def _cls_void_credit_note( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.VoidCreditNoteParams"] + cls, id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -814,9 +779,6 @@ def _cls_void_credit_note( cls._static_request( "post", "/v1/credit_notes/{id}/void".format(id=util.sanitize_id(id)), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -824,11 +786,7 @@ def _cls_void_credit_note( @overload @staticmethod def void_credit_note( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.VoidCreditNoteParams"] + id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -837,9 +795,7 @@ def void_credit_note( @overload def void_credit_note( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["CreditNote.VoidCreditNoteParams"] + self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -848,9 +804,7 @@ def void_credit_note( @class_method_variant("_cls_void_credit_note") def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["CreditNote.VoidCreditNoteParams"] + self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). @@ -862,19 +816,13 @@ def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] "/v1/credit_notes/{id}/void".format( id=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list_lines( - cls, - credit_note: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNote.ListLinesParams"] + cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -886,9 +834,6 @@ def list_lines( "/v1/credit_notes/{credit_note}/lines".format( credit_note=util.sanitize_id(credit_note) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/credit_note_line_item.py b/stripe/api_resources/credit_note_line_item.py index 3efd9bed5..2e17839bc 100644 --- a/stripe/api_resources/credit_note_line_item.py +++ b/stripe/api_resources/credit_note_line_item.py @@ -159,11 +159,7 @@ class ListParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditNoteLineItem.ListParams"] + cls, **params: Unpack["CreditNoteLineItem.ListParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -171,9 +167,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/customer.py b/stripe/api_resources/customer.py index 2b6155de0..15c5a4370 100644 --- a/stripe/api_resources/customer.py +++ b/stripe/api_resources/customer.py @@ -1388,14 +1388,7 @@ class ListTaxIdsParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.CreateParams"] - ) -> "Customer": + def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": """ Creates a new customer object. """ @@ -1404,10 +1397,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -1416,9 +1405,6 @@ def create( def _cls_create_funding_instructions( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ @@ -1433,9 +1419,6 @@ def _cls_create_funding_instructions( "/v1/customers/{customer}/funding_instructions".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1444,9 +1427,6 @@ def _cls_create_funding_instructions( @staticmethod def create_funding_instructions( customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ @@ -1458,9 +1438,7 @@ def create_funding_instructions( @overload def create_funding_instructions( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1471,9 +1449,7 @@ def create_funding_instructions( @class_method_variant("_cls_create_funding_instructions") def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.CreateFundingInstructionsParams"] + self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new @@ -1487,7 +1463,6 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] "/v1/customers/{customer}/funding_instructions".format( customer=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1537,12 +1512,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_delete_discount( - cls, - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.DeleteDiscountParams"] + cls, customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -1554,9 +1524,6 @@ def _cls_delete_discount( "/v1/customers/{customer}/discount".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1564,11 +1531,7 @@ def _cls_delete_discount( @overload @staticmethod def delete_discount( - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.DeleteDiscountParams"] + customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -1577,9 +1540,7 @@ def delete_discount( @overload def delete_discount( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.DeleteDiscountParams"] + self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -1588,9 +1549,7 @@ def delete_discount( @class_method_variant("_cls_delete_discount") def delete_discount( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.DeleteDiscountParams"] + self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. @@ -1602,18 +1561,13 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] "/v1/customers/{customer}/discount".format( customer=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.ListParams"] + cls, **params: Unpack["Customer.ListParams"] ) -> ListObject["Customer"]: """ Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. @@ -1621,9 +1575,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -1639,9 +1590,6 @@ def list( def _cls_list_payment_methods( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ @@ -1654,9 +1602,6 @@ def _cls_list_payment_methods( "/v1/customers/{customer}/payment_methods".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1664,11 +1609,7 @@ def _cls_list_payment_methods( @overload @staticmethod def list_payment_methods( - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.ListPaymentMethodsParams"] + customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -1677,9 +1618,7 @@ def list_payment_methods( @overload def list_payment_methods( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.ListPaymentMethodsParams"] + self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -1688,9 +1627,7 @@ def list_payment_methods( @class_method_variant("_cls_list_payment_methods") def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.ListPaymentMethodsParams"] + self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer @@ -1702,7 +1639,6 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] "/v1/customers/{customer}/payment_methods".format( customer=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1738,9 +1674,6 @@ def _cls_retrieve_payment_method( cls, customer: str, payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrievePaymentMethodParams"] ) -> "PaymentMethod": """ @@ -1754,9 +1687,6 @@ def _cls_retrieve_payment_method( customer=util.sanitize_id(customer), payment_method=util.sanitize_id(payment_method), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1766,9 +1696,6 @@ def _cls_retrieve_payment_method( def retrieve_payment_method( customer: str, payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrievePaymentMethodParams"] ) -> "PaymentMethod": """ @@ -1780,7 +1707,6 @@ def retrieve_payment_method( def retrieve_payment_method( self, payment_method: str, - idempotency_key: Optional[str] = None, **params: Unpack["Customer.RetrievePaymentMethodParams"] ) -> "PaymentMethod": """ @@ -1792,7 +1718,6 @@ def retrieve_payment_method( def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] self, payment_method: str, - idempotency_key: Optional[str] = None, **params: Unpack["Customer.RetrievePaymentMethodParams"] ) -> "PaymentMethod": """ @@ -1806,7 +1731,6 @@ def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] customer=util.sanitize_id(self.get("id")), payment_method=util.sanitize_id(payment_method), ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1833,9 +1757,6 @@ def search_auto_paging_iter( def create_balance_transaction( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.CreateBalanceTransactionParams"] ) -> "CustomerBalanceTransaction": """ @@ -1848,9 +1769,6 @@ def create_balance_transaction( "/v1/customers/{customer}/balance_transactions".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1860,9 +1778,6 @@ def retrieve_balance_transaction( cls, customer: str, transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrieveBalanceTransactionParams"] ) -> "CustomerBalanceTransaction": """ @@ -1876,9 +1791,6 @@ def retrieve_balance_transaction( customer=util.sanitize_id(customer), transaction=util.sanitize_id(transaction), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1888,9 +1800,6 @@ def modify_balance_transaction( cls, customer: str, transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ModifyBalanceTransactionParams"] ) -> "CustomerBalanceTransaction": """ @@ -1904,9 +1813,6 @@ def modify_balance_transaction( customer=util.sanitize_id(customer), transaction=util.sanitize_id(transaction), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1915,9 +1821,6 @@ def modify_balance_transaction( def list_balance_transactions( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ListBalanceTransactionsParams"] ) -> ListObject["CustomerBalanceTransaction"]: """ @@ -1930,9 +1833,6 @@ def list_balance_transactions( "/v1/customers/{customer}/balance_transactions".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1942,9 +1842,6 @@ def retrieve_cash_balance_transaction( cls, customer: str, transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"] ) -> "CustomerCashBalanceTransaction": """ @@ -1958,9 +1855,6 @@ def retrieve_cash_balance_transaction( customer=util.sanitize_id(customer), transaction=util.sanitize_id(transaction), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1969,9 +1863,6 @@ def retrieve_cash_balance_transaction( def list_cash_balance_transactions( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ListCashBalanceTransactionsParams"] ) -> ListObject["CustomerCashBalanceTransaction"]: """ @@ -1984,21 +1875,13 @@ def list_cash_balance_transactions( "/v1/customers/{customer}/cash_balance_transactions".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_source( - cls, - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.CreateSourceParams"] + cls, customer: str, **params: Unpack["Customer.CreateSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. @@ -2014,9 +1897,6 @@ def create_source( "/v1/customers/{customer}/sources".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2026,9 +1906,6 @@ def retrieve_source( cls, customer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrieveSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -2042,9 +1919,6 @@ def retrieve_source( customer=util.sanitize_id(customer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2054,9 +1928,6 @@ def modify_source( cls, customer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ModifySourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -2070,9 +1941,6 @@ def modify_source( customer=util.sanitize_id(customer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2082,9 +1950,6 @@ def delete_source( cls, customer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.DeleteSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ @@ -2098,21 +1963,13 @@ def delete_source( customer=util.sanitize_id(customer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_sources( - cls, - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.ListSourcesParams"] + cls, customer: str, **params: Unpack["Customer.ListSourcesParams"] ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: """ List sources for a specified customer. @@ -2124,21 +1981,13 @@ def list_sources( "/v1/customers/{customer}/sources".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_tax_id( - cls, - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.CreateTaxIdParams"] + cls, customer: str, **params: Unpack["Customer.CreateTaxIdParams"] ) -> "TaxId": """ Creates a new tax_id object for a customer. @@ -2150,9 +1999,6 @@ def create_tax_id( "/v1/customers/{customer}/tax_ids".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2162,9 +2008,6 @@ def retrieve_tax_id( cls, customer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrieveTaxIdParams"] ) -> "TaxId": """ @@ -2178,9 +2021,6 @@ def retrieve_tax_id( customer=util.sanitize_id(customer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2190,9 +2030,6 @@ def delete_tax_id( cls, customer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.DeleteTaxIdParams"] ) -> "TaxId": """ @@ -2206,21 +2043,13 @@ def delete_tax_id( customer=util.sanitize_id(customer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_tax_ids( - cls, - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.ListTaxIdsParams"] + cls, customer: str, **params: Unpack["Customer.ListTaxIdsParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs for a customer. @@ -2232,9 +2061,6 @@ def list_tax_ids( "/v1/customers/{customer}/tax_ids".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2243,9 +2069,6 @@ def list_tax_ids( def modify_cash_balance( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.ModifyCashBalanceParams"] ) -> "CashBalance": """ @@ -2258,9 +2081,6 @@ def modify_cash_balance( "/v1/customers/{customer}/cash_balance".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2269,9 +2089,6 @@ def modify_cash_balance( def retrieve_cash_balance( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.RetrieveCashBalanceParams"] ) -> "CashBalance": """ @@ -2284,9 +2101,6 @@ def retrieve_cash_balance( "/v1/customers/{customer}/cash_balance".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2298,9 +2112,6 @@ class TestHelpers(APIResourceTestHelpers["Customer"]): def _cls_fund_cash_balance( cls, customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ @@ -2313,9 +2124,6 @@ def _cls_fund_cash_balance( "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=util.sanitize_id(customer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2323,11 +2131,7 @@ def _cls_fund_cash_balance( @overload @staticmethod def fund_cash_balance( - customer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Customer.FundCashBalanceParams"] + customer: str, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -2336,9 +2140,7 @@ def fund_cash_balance( @overload def fund_cash_balance( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.FundCashBalanceParams"] + self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -2347,9 +2149,7 @@ def fund_cash_balance( @class_method_variant("_cls_fund_cash_balance") def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Customer.FundCashBalanceParams"] + self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer @@ -2361,7 +2161,6 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/customer_cash_balance_transaction.py b/stripe/api_resources/customer_cash_balance_transaction.py index 35d0353a2..daaea0241 100644 --- a/stripe/api_resources/customer_cash_balance_transaction.py +++ b/stripe/api_resources/customer_cash_balance_transaction.py @@ -219,11 +219,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CustomerCashBalanceTransaction.ListParams"] + cls, **params: Unpack["CustomerCashBalanceTransaction.ListParams"] ) -> ListObject["CustomerCashBalanceTransaction"]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). @@ -231,9 +227,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/dispute.py b/stripe/api_resources/dispute.py index 6b22c7f2b..75aac8e73 100644 --- a/stripe/api_resources/dispute.py +++ b/stripe/api_resources/dispute.py @@ -446,12 +446,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_close( - cls, - dispute: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.CloseParams"] + cls, dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. @@ -465,9 +460,6 @@ def _cls_close( "/v1/disputes/{dispute}/close".format( dispute=util.sanitize_id(dispute) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -475,11 +467,7 @@ def _cls_close( @overload @staticmethod def close( - dispute: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.CloseParams"] + dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. @@ -489,11 +477,7 @@ def close( ... @overload - def close( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Dispute.CloseParams"] - ) -> "Dispute": + def close(self, **params: Unpack["Dispute.CloseParams"]) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. @@ -503,9 +487,7 @@ def close( @class_method_variant("_cls_close") def close( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Dispute.CloseParams"] + self, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. @@ -519,18 +501,13 @@ def close( # pyright: ignore[reportGeneralTypeIssues] "/v1/disputes/{dispute}/close".format( dispute=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.ListParams"] + cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of your disputes. @@ -538,9 +515,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/event.py b/stripe/api_resources/event.py index f142f0fed..7f0ad7bf8 100644 --- a/stripe/api_resources/event.py +++ b/stripe/api_resources/event.py @@ -392,22 +392,13 @@ class RetrieveParams(RequestOptions): """ @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Event.ListParams"] - ) -> ListObject["Event"]: + def list(cls, **params: Unpack["Event.ListParams"]) -> ListObject["Event"]: """ List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/exchange_rate.py b/stripe/api_resources/exchange_rate.py index ed1a4e1f8..17e1277d4 100644 --- a/stripe/api_resources/exchange_rate.py +++ b/stripe/api_resources/exchange_rate.py @@ -3,7 +3,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.request_options import RequestOptions -from typing import ClassVar, Dict, List, Optional +from typing import ClassVar, Dict, List from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING @@ -79,11 +79,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ExchangeRate.ListParams"] + cls, **params: Unpack["ExchangeRate.ListParams"] ) -> ListObject["ExchangeRate"]: """ Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. @@ -91,9 +87,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/file.py b/stripe/api_resources/file.py index 29693bed0..21730b0ac 100644 --- a/stripe/api_resources/file.py +++ b/stripe/api_resources/file.py @@ -143,22 +143,13 @@ class RetrieveParams(RequestOptions): """ @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["File.ListParams"] - ) -> ListObject["File"]: + def list(cls, **params: Unpack["File.ListParams"]) -> ListObject["File"]: """ Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/file_link.py b/stripe/api_resources/file_link.py index 4c705faca..bdda22b29 100644 --- a/stripe/api_resources/file_link.py +++ b/stripe/api_resources/file_link.py @@ -157,14 +157,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["FileLink.CreateParams"] - ) -> "FileLink": + def create(cls, **params: Unpack["FileLink.CreateParams"]) -> "FileLink": """ Creates a new file link object. """ @@ -173,21 +166,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["FileLink.ListParams"] + cls, **params: Unpack["FileLink.ListParams"] ) -> ListObject["FileLink"]: """ Returns a list of file links. @@ -195,9 +180,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/financial_connections/account.py b/stripe/api_resources/financial_connections/account.py index 546d3e555..851752490 100644 --- a/stripe/api_resources/financial_connections/account.py +++ b/stripe/api_resources/financial_connections/account.py @@ -288,12 +288,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_disconnect( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.DisconnectParams"] + cls, account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -305,9 +300,6 @@ def _cls_disconnect( "/v1/financial_connections/accounts/{account}/disconnect".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -315,11 +307,7 @@ def _cls_disconnect( @overload @staticmethod def disconnect( - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.DisconnectParams"] + account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -328,9 +316,7 @@ def disconnect( @overload def disconnect( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.DisconnectParams"] + self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -339,9 +325,7 @@ def disconnect( @class_method_variant("_cls_disconnect") def disconnect( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.DisconnectParams"] + self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). @@ -353,18 +337,13 @@ def disconnect( # pyright: ignore[reportGeneralTypeIssues] "/v1/financial_connections/accounts/{account}/disconnect".format( account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListParams"] + cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of Financial Connections Account objects. @@ -372,9 +351,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -388,12 +364,7 @@ def list( @classmethod def _cls_list_owners( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListOwnersParams"] + cls, account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -405,9 +376,6 @@ def _cls_list_owners( "/v1/financial_connections/accounts/{account}/owners".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -415,11 +383,7 @@ def _cls_list_owners( @overload @staticmethod def list_owners( - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.ListOwnersParams"] + account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -428,9 +392,7 @@ def list_owners( @overload def list_owners( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.ListOwnersParams"] + self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -439,9 +401,7 @@ def list_owners( @class_method_variant("_cls_list_owners") def list_owners( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.ListOwnersParams"] + self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account @@ -453,19 +413,13 @@ def list_owners( # pyright: ignore[reportGeneralTypeIssues] "/v1/financial_connections/accounts/{account}/owners".format( account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_refresh_account( - cls, - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.RefreshAccountParams"] + cls, account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -477,9 +431,6 @@ def _cls_refresh_account( "/v1/financial_connections/accounts/{account}/refresh".format( account=util.sanitize_id(account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -487,11 +438,7 @@ def _cls_refresh_account( @overload @staticmethod def refresh_account( - account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Account.RefreshAccountParams"] + account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -500,9 +447,7 @@ def refresh_account( @overload def refresh_account( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.RefreshAccountParams"] + self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -511,9 +456,7 @@ def refresh_account( @class_method_variant("_cls_refresh_account") def refresh_account( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Account.RefreshAccountParams"] + self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. @@ -525,7 +468,6 @@ def refresh_account( # pyright: ignore[reportGeneralTypeIssues] "/v1/financial_connections/accounts/{account}/refresh".format( account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/financial_connections/session.py b/stripe/api_resources/financial_connections/session.py index a919577bf..47970b868 100644 --- a/stripe/api_resources/financial_connections/session.py +++ b/stripe/api_resources/financial_connections/session.py @@ -152,14 +152,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Session.CreateParams"] - ) -> "Session": + def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. """ @@ -168,10 +161,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/identity/verification_report.py b/stripe/api_resources/identity/verification_report.py index 1b990f477..91d233c72 100644 --- a/stripe/api_resources/identity/verification_report.py +++ b/stripe/api_resources/identity/verification_report.py @@ -392,11 +392,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationReport.ListParams"] + cls, **params: Unpack["VerificationReport.ListParams"] ) -> ListObject["VerificationReport"]: """ List all verification reports. @@ -404,9 +400,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/identity/verification_session.py b/stripe/api_resources/identity/verification_session.py index 9c34ba39e..7d94c8131 100644 --- a/stripe/api_resources/identity/verification_session.py +++ b/stripe/api_resources/identity/verification_session.py @@ -397,12 +397,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_cancel( - cls, - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.CancelParams"] + cls, session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). @@ -416,9 +411,6 @@ def _cls_cancel( "/v1/identity/verification_sessions/{session}/cancel".format( session=util.sanitize_id(session) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -426,11 +418,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.CancelParams"] + session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). @@ -441,9 +429,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["VerificationSession.CancelParams"] + self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). @@ -454,9 +440,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["VerificationSession.CancelParams"] + self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). @@ -470,19 +454,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/identity/verification_sessions/{session}/cancel".format( session=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.CreateParams"] + cls, **params: Unpack["VerificationSession.CreateParams"] ) -> "VerificationSession": """ Creates a VerificationSession object. @@ -498,21 +476,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.ListParams"] + cls, **params: Unpack["VerificationSession.ListParams"] ) -> ListObject["VerificationSession"]: """ Returns a list of VerificationSessions @@ -520,9 +490,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -552,12 +519,7 @@ def modify( @classmethod def _cls_redact( - cls, - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.RedactParams"] + cls, session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -587,9 +549,6 @@ def _cls_redact( "/v1/identity/verification_sessions/{session}/redact".format( session=util.sanitize_id(session) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -597,11 +556,7 @@ def _cls_redact( @overload @staticmethod def redact( - session: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["VerificationSession.RedactParams"] + session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -628,9 +583,7 @@ def redact( @overload def redact( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["VerificationSession.RedactParams"] + self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -657,9 +610,7 @@ def redact( @class_method_variant("_cls_redact") def redact( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["VerificationSession.RedactParams"] + self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact @@ -689,7 +640,6 @@ def redact( # pyright: ignore[reportGeneralTypeIssues] "/v1/identity/verification_sessions/{session}/redact".format( session=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/invoice.py b/stripe/api_resources/invoice.py index 8f42f6707..78f9d23d3 100644 --- a/stripe/api_resources/invoice.py +++ b/stripe/api_resources/invoice.py @@ -3590,14 +3590,7 @@ class SearchParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.CreateParams"] - ) -> "Invoice": + def create(cls, **params: Unpack["Invoice.CreateParams"]) -> "Invoice": """ This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. """ @@ -3606,10 +3599,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -3659,12 +3648,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def _cls_finalize_invoice( - cls, - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.FinalizeInvoiceParams"] + cls, invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -3676,9 +3660,6 @@ def _cls_finalize_invoice( "/v1/invoices/{invoice}/finalize".format( invoice=util.sanitize_id(invoice) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3686,11 +3667,7 @@ def _cls_finalize_invoice( @overload @staticmethod def finalize_invoice( - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.FinalizeInvoiceParams"] + invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -3699,9 +3676,7 @@ def finalize_invoice( @overload def finalize_invoice( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.FinalizeInvoiceParams"] + self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -3710,9 +3685,7 @@ def finalize_invoice( @class_method_variant("_cls_finalize_invoice") def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.FinalizeInvoiceParams"] + self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. @@ -3724,18 +3697,13 @@ def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] "/v1/invoices/{invoice}/finalize".format( invoice=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.ListParams"] + cls, **params: Unpack["Invoice.ListParams"] ) -> ListObject["Invoice"]: """ You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. @@ -3743,9 +3711,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -3759,12 +3724,7 @@ def list( @classmethod def _cls_mark_uncollectible( - cls, - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.MarkUncollectibleParams"] + cls, invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -3776,9 +3736,6 @@ def _cls_mark_uncollectible( "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=util.sanitize_id(invoice) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3786,11 +3743,7 @@ def _cls_mark_uncollectible( @overload @staticmethod def mark_uncollectible( - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.MarkUncollectibleParams"] + invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -3799,9 +3752,7 @@ def mark_uncollectible( @overload def mark_uncollectible( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.MarkUncollectibleParams"] + self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -3810,9 +3761,7 @@ def mark_uncollectible( @class_method_variant("_cls_mark_uncollectible") def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.MarkUncollectibleParams"] + self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. @@ -3824,7 +3773,6 @@ def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -3849,12 +3797,7 @@ def modify( @classmethod def _cls_pay( - cls, - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.PayParams"] + cls, invoice: str, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. @@ -3866,33 +3809,20 @@ def _cls_pay( "/v1/invoices/{invoice}/pay".format( invoice=util.sanitize_id(invoice) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @overload @staticmethod - def pay( - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.PayParams"] - ) -> "Invoice": + def pay(invoice: str, **params: Unpack["Invoice.PayParams"]) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ ... @overload - def pay( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.PayParams"] - ) -> "Invoice": + def pay(self, **params: Unpack["Invoice.PayParams"]) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ @@ -3900,9 +3830,7 @@ def pay( @class_method_variant("_cls_pay") def pay( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.PayParams"] + self, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. @@ -3914,7 +3842,6 @@ def pay( # pyright: ignore[reportGeneralTypeIssues] "/v1/invoices/{invoice}/pay".format( invoice=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -3932,12 +3859,7 @@ def retrieve( @classmethod def _cls_send_invoice( - cls, - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.SendInvoiceParams"] + cls, invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -3951,9 +3873,6 @@ def _cls_send_invoice( "/v1/invoices/{invoice}/send".format( invoice=util.sanitize_id(invoice) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3961,11 +3880,7 @@ def _cls_send_invoice( @overload @staticmethod def send_invoice( - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.SendInvoiceParams"] + invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -3976,9 +3891,7 @@ def send_invoice( @overload def send_invoice( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.SendInvoiceParams"] + self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -3989,9 +3902,7 @@ def send_invoice( @class_method_variant("_cls_send_invoice") def send_invoice( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.SendInvoiceParams"] + self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. @@ -4005,19 +3916,12 @@ def send_invoice( # pyright: ignore[reportGeneralTypeIssues] "/v1/invoices/{invoice}/send".format( invoice=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def upcoming( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.UpcomingParams"] - ) -> "Invoice": + def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. @@ -4030,20 +3934,13 @@ def upcoming( cls._static_request( "get", "/v1/invoices/upcoming", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def upcoming_lines( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.UpcomingLinesParams"] + cls, **params: Unpack["Invoice.UpcomingLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -4053,21 +3950,13 @@ def upcoming_lines( cls._static_request( "get", "/v1/invoices/upcoming/lines", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def _cls_void_invoice( - cls, - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.VoidInvoiceParams"] + cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -4079,9 +3968,6 @@ def _cls_void_invoice( "/v1/invoices/{invoice}/void".format( invoice=util.sanitize_id(invoice) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -4089,11 +3975,7 @@ def _cls_void_invoice( @overload @staticmethod def void_invoice( - invoice: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Invoice.VoidInvoiceParams"] + invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -4102,9 +3984,7 @@ def void_invoice( @overload def void_invoice( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.VoidInvoiceParams"] + self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -4113,9 +3993,7 @@ def void_invoice( @class_method_variant("_cls_void_invoice") def void_invoice( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Invoice.VoidInvoiceParams"] + self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. @@ -4127,7 +4005,6 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] "/v1/invoices/{invoice}/void".format( invoice=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/invoice_item.py b/stripe/api_resources/invoice_item.py index 55f58bbf6..0c8dbd4c9 100644 --- a/stripe/api_resources/invoice_item.py +++ b/stripe/api_resources/invoice_item.py @@ -456,12 +456,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InvoiceItem.CreateParams"] + cls, **params: Unpack["InvoiceItem.CreateParams"] ) -> "InvoiceItem": """ Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. @@ -471,10 +466,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -526,11 +517,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InvoiceItem.ListParams"] + cls, **params: Unpack["InvoiceItem.ListParams"] ) -> ListObject["InvoiceItem"]: """ Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. @@ -538,9 +525,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/issuing/authorization.py b/stripe/api_resources/issuing/authorization.py index 3844a59c0..e742bf0fb 100644 --- a/stripe/api_resources/issuing/authorization.py +++ b/stripe/api_resources/issuing/authorization.py @@ -802,9 +802,6 @@ class ReverseParams(RequestOptions): def _cls_approve( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ @@ -818,9 +815,6 @@ def _cls_approve( "/v1/issuing/authorizations/{authorization}/approve".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -828,11 +822,7 @@ def _cls_approve( @overload @staticmethod def approve( - authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.ApproveParams"] + authorization: str, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -842,9 +832,7 @@ def approve( @overload def approve( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ApproveParams"] + self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -854,9 +842,7 @@ def approve( @class_method_variant("_cls_approve") def approve( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ApproveParams"] + self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -869,7 +855,6 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] "/v1/issuing/authorizations/{authorization}/approve".format( authorization=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -878,9 +863,6 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] def _cls_decline( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ @@ -894,9 +876,6 @@ def _cls_decline( "/v1/issuing/authorizations/{authorization}/decline".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -904,11 +883,7 @@ def _cls_decline( @overload @staticmethod def decline( - authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.DeclineParams"] + authorization: str, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -918,9 +893,7 @@ def decline( @overload def decline( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.DeclineParams"] + self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -930,9 +903,7 @@ def decline( @class_method_variant("_cls_decline") def decline( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.DeclineParams"] + self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. @@ -945,18 +916,13 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] "/v1/issuing/authorizations/{authorization}/decline".format( authorization=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.ListParams"] + cls, **params: Unpack["Authorization.ListParams"] ) -> ListObject["Authorization"]: """ Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -964,9 +930,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -1009,9 +972,6 @@ class TestHelpers(APIResourceTestHelpers["Authorization"]): def _cls_capture( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ @@ -1024,9 +984,6 @@ def _cls_capture( "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1034,11 +991,7 @@ def _cls_capture( @overload @staticmethod def capture( - authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.CaptureParams"] + authorization: str, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. @@ -1047,9 +1000,7 @@ def capture( @overload def capture( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.CaptureParams"] + self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. @@ -1058,9 +1009,7 @@ def capture( @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.CaptureParams"] + self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. @@ -1072,18 +1021,13 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.CreateParams"] + cls, **params: Unpack["Authorization.CreateParams"] ) -> "Authorization": """ Create a test-mode authorization. @@ -1093,9 +1037,6 @@ def create( cls._static_request( "post", "/v1/test_helpers/issuing/authorizations", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1104,9 +1045,6 @@ def create( def _cls_expire( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ @@ -1119,9 +1057,6 @@ def _cls_expire( "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1129,11 +1064,7 @@ def _cls_expire( @overload @staticmethod def expire( - authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.ExpireParams"] + authorization: str, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1142,9 +1073,7 @@ def expire( @overload def expire( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ExpireParams"] + self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1153,9 +1082,7 @@ def expire( @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ExpireParams"] + self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. @@ -1167,7 +1094,6 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1176,9 +1102,6 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] def _cls_increment( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ @@ -1191,9 +1114,6 @@ def _cls_increment( "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1202,9 +1122,6 @@ def _cls_increment( @staticmethod def increment( authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ @@ -1214,9 +1131,7 @@ def increment( @overload def increment( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.IncrementParams"] + self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1225,9 +1140,7 @@ def increment( @class_method_variant("_cls_increment") def increment( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.IncrementParams"] + self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. @@ -1239,7 +1152,6 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1248,9 +1160,6 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] def _cls_reverse( cls, authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ @@ -1263,9 +1172,6 @@ def _cls_reverse( "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=util.sanitize_id(authorization) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1273,11 +1179,7 @@ def _cls_reverse( @overload @staticmethod def reverse( - authorization: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Authorization.ReverseParams"] + authorization: str, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1286,9 +1188,7 @@ def reverse( @overload def reverse( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ReverseParams"] + self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1297,9 +1197,7 @@ def reverse( @class_method_variant("_cls_reverse") def reverse( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Authorization.ReverseParams"] + self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. @@ -1311,7 +1209,6 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/issuing/card.py b/stripe/api_resources/issuing/card.py index 9591d22fc..b1082d963 100644 --- a/stripe/api_resources/issuing/card.py +++ b/stripe/api_resources/issuing/card.py @@ -1524,14 +1524,7 @@ class ShipCardParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.CreateParams"] - ) -> "Card": + def create(cls, **params: Unpack["Card.CreateParams"]) -> "Card": """ Creates an Issuing Card object. """ @@ -1540,31 +1533,18 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.ListParams"] - ) -> ListObject["Card"]: + def list(cls, **params: Unpack["Card.ListParams"]) -> ListObject["Card"]: """ Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -1603,12 +1583,7 @@ class TestHelpers(APIResourceTestHelpers["Card"]): @classmethod def _cls_deliver_card( - cls, - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.DeliverCardParams"] + cls, card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1620,9 +1595,6 @@ def _cls_deliver_card( "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=util.sanitize_id(card) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1630,11 +1602,7 @@ def _cls_deliver_card( @overload @staticmethod def deliver_card( - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.DeliverCardParams"] + card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1643,9 +1611,7 @@ def deliver_card( @overload def deliver_card( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.DeliverCardParams"] + self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1654,9 +1620,7 @@ def deliver_card( @class_method_variant("_cls_deliver_card") def deliver_card( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.DeliverCardParams"] + self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. @@ -1668,19 +1632,13 @@ def deliver_card( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_fail_card( - cls, - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.FailCardParams"] + cls, card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1692,9 +1650,6 @@ def _cls_fail_card( "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=util.sanitize_id(card) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1702,11 +1657,7 @@ def _cls_fail_card( @overload @staticmethod def fail_card( - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.FailCardParams"] + card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1714,11 +1665,7 @@ def fail_card( ... @overload - def fail_card( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.FailCardParams"] - ) -> "Card": + def fail_card(self, **params: Unpack["Card.FailCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ @@ -1726,9 +1673,7 @@ def fail_card( @class_method_variant("_cls_fail_card") def fail_card( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.FailCardParams"] + self, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. @@ -1740,19 +1685,13 @@ def fail_card( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_return_card( - cls, - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.ReturnCardParams"] + cls, card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1764,9 +1703,6 @@ def _cls_return_card( "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=util.sanitize_id(card) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1774,11 +1710,7 @@ def _cls_return_card( @overload @staticmethod def return_card( - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.ReturnCardParams"] + card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1787,9 +1719,7 @@ def return_card( @overload def return_card( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.ReturnCardParams"] + self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1798,9 +1728,7 @@ def return_card( @class_method_variant("_cls_return_card") def return_card( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.ReturnCardParams"] + self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. @@ -1812,19 +1740,13 @@ def return_card( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_ship_card( - cls, - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.ShipCardParams"] + cls, card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1836,9 +1758,6 @@ def _cls_ship_card( "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=util.sanitize_id(card) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1846,11 +1765,7 @@ def _cls_ship_card( @overload @staticmethod def ship_card( - card: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Card.ShipCardParams"] + card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1858,11 +1773,7 @@ def ship_card( ... @overload - def ship_card( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.ShipCardParams"] - ) -> "Card": + def ship_card(self, **params: Unpack["Card.ShipCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ @@ -1870,9 +1781,7 @@ def ship_card( @class_method_variant("_cls_ship_card") def ship_card( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Card.ShipCardParams"] + self, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. @@ -1884,7 +1793,6 @@ def ship_card( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/issuing/cardholder.py b/stripe/api_resources/issuing/cardholder.py index a3458b865..8d5a326de 100644 --- a/stripe/api_resources/issuing/cardholder.py +++ b/stripe/api_resources/issuing/cardholder.py @@ -1680,12 +1680,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Cardholder.CreateParams"] + cls, **params: Unpack["Cardholder.CreateParams"] ) -> "Cardholder": """ Creates a new Issuing Cardholder object that can be issued cards. @@ -1695,21 +1690,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Cardholder.ListParams"] + cls, **params: Unpack["Cardholder.ListParams"] ) -> ListObject["Cardholder"]: """ Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -1717,9 +1704,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/issuing/dispute.py b/stripe/api_resources/issuing/dispute.py index 2ef515a39..abf90440d 100644 --- a/stripe/api_resources/issuing/dispute.py +++ b/stripe/api_resources/issuing/dispute.py @@ -859,14 +859,7 @@ class SubmitParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.CreateParams"] - ) -> "Dispute": + def create(cls, **params: Unpack["Dispute.CreateParams"]) -> "Dispute": """ Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. """ @@ -875,21 +868,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.ListParams"] + cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -897,9 +882,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -937,12 +919,7 @@ def retrieve( @classmethod def _cls_submit( - cls, - dispute: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.SubmitParams"] + cls, dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -954,9 +931,6 @@ def _cls_submit( "/v1/issuing/disputes/{dispute}/submit".format( dispute=util.sanitize_id(dispute) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -964,11 +938,7 @@ def _cls_submit( @overload @staticmethod def submit( - dispute: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Dispute.SubmitParams"] + dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -976,11 +946,7 @@ def submit( ... @overload - def submit( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Dispute.SubmitParams"] - ) -> "Dispute": + def submit(self, **params: Unpack["Dispute.SubmitParams"]) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ @@ -988,9 +954,7 @@ def submit( @class_method_variant("_cls_submit") def submit( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Dispute.SubmitParams"] + self, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). @@ -1002,7 +966,6 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] "/v1/issuing/disputes/{dispute}/submit".format( dispute=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/issuing/token.py b/stripe/api_resources/issuing/token.py index 5408ac01c..1bfcb0ee1 100644 --- a/stripe/api_resources/issuing/token.py +++ b/stripe/api_resources/issuing/token.py @@ -311,22 +311,13 @@ class RetrieveParams(RequestOptions): """ @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Token.ListParams"] - ) -> ListObject["Token"]: + def list(cls, **params: Unpack["Token.ListParams"]) -> ListObject["Token"]: """ Lists all Issuing Token objects for a given card. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/issuing/transaction.py b/stripe/api_resources/issuing/transaction.py index cb319f250..749bbb818 100644 --- a/stripe/api_resources/issuing/transaction.py +++ b/stripe/api_resources/issuing/transaction.py @@ -770,11 +770,7 @@ class RefundParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.ListParams"] + cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -782,9 +778,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -825,11 +818,7 @@ class TestHelpers(APIResourceTestHelpers["Transaction"]): @classmethod def create_force_capture( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.CreateForceCaptureParams"] + cls, **params: Unpack["Transaction.CreateForceCaptureParams"] ) -> "Transaction": """ Allows the user to capture an arbitrary amount, also known as a forced capture. @@ -839,20 +828,13 @@ def create_force_capture( cls._static_request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_unlinked_refund( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.CreateUnlinkedRefundParams"] + cls, **params: Unpack["Transaction.CreateUnlinkedRefundParams"] ) -> "Transaction": """ Allows the user to refund an arbitrary amount, also known as a unlinked refund. @@ -862,21 +844,13 @@ def create_unlinked_refund( cls._static_request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def _cls_refund( - cls, - transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.RefundParams"] + cls, transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -888,9 +862,6 @@ def _cls_refund( "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=util.sanitize_id(transaction) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -898,11 +869,7 @@ def _cls_refund( @overload @staticmethod def refund( - transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.RefundParams"] + transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -911,9 +878,7 @@ def refund( @overload def refund( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Transaction.RefundParams"] + self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -922,9 +887,7 @@ def refund( @class_method_variant("_cls_refund") def refund( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Transaction.RefundParams"] + self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. @@ -936,7 +899,6 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/payment_intent.py b/stripe/api_resources/payment_intent.py index 9063e6b3b..994d82453 100644 --- a/stripe/api_resources/payment_intent.py +++ b/stripe/api_resources/payment_intent.py @@ -7453,9 +7453,6 @@ class SearchParams(RequestOptions): def _cls_apply_customer_balance( cls, intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ @@ -7468,9 +7465,6 @@ def _cls_apply_customer_balance( "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -7479,9 +7473,6 @@ def _cls_apply_customer_balance( @staticmethod def apply_customer_balance( intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ @@ -7491,9 +7482,7 @@ def apply_customer_balance( @overload def apply_customer_balance( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -7502,9 +7491,7 @@ def apply_customer_balance( @class_method_variant("_cls_apply_customer_balance") def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] + self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. @@ -7516,19 +7503,13 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_cancel( - cls, - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.CancelParams"] + cls, intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. @@ -7544,9 +7525,6 @@ def _cls_cancel( "/v1/payment_intents/{intent}/cancel".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -7554,11 +7532,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.CancelParams"] + intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. @@ -7571,9 +7545,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.CancelParams"] + self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. @@ -7586,9 +7558,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.CancelParams"] + self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. @@ -7604,19 +7574,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/cancel".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_capture( - cls, - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.CaptureParams"] + cls, intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -7632,9 +7596,6 @@ def _cls_capture( "/v1/payment_intents/{intent}/capture".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -7642,11 +7603,7 @@ def _cls_capture( @overload @staticmethod def capture( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.CaptureParams"] + intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -7659,9 +7616,7 @@ def capture( @overload def capture( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.CaptureParams"] + self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -7674,9 +7629,7 @@ def capture( @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.CaptureParams"] + self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. @@ -7692,19 +7645,13 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/capture".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_confirm( - cls, - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.ConfirmParams"] + cls, intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -7738,9 +7685,6 @@ def _cls_confirm( "/v1/payment_intents/{intent}/confirm".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -7748,11 +7692,7 @@ def _cls_confirm( @overload @staticmethod def confirm( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.ConfirmParams"] + intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -7783,9 +7723,7 @@ def confirm( @overload def confirm( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.ConfirmParams"] + self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -7816,9 +7754,7 @@ def confirm( @class_method_variant("_cls_confirm") def confirm( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.ConfirmParams"] + self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided @@ -7852,19 +7788,13 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/confirm".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.CreateParams"] + cls, **params: Unpack["PaymentIntent.CreateParams"] ) -> "PaymentIntent": """ Creates a PaymentIntent object. @@ -7883,10 +7813,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -7895,9 +7821,6 @@ def create( def _cls_increment_authorization( cls, intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -7933,9 +7856,6 @@ def _cls_increment_authorization( "/v1/payment_intents/{intent}/increment_authorization".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -7944,9 +7864,6 @@ def _cls_increment_authorization( @staticmethod def increment_authorization( intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ @@ -7979,9 +7896,7 @@ def increment_authorization( @overload def increment_authorization( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -8013,9 +7928,7 @@ def increment_authorization( @class_method_variant("_cls_increment_authorization") def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] + self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible @@ -8050,18 +7963,13 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/increment_authorization".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentIntent.ListParams"] + cls, **params: Unpack["PaymentIntent.ListParams"] ) -> ListObject["PaymentIntent"]: """ Returns a list of PaymentIntents. @@ -8069,9 +7977,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -8121,9 +8026,6 @@ def retrieve( def _cls_verify_microdeposits( cls, intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ @@ -8136,9 +8038,6 @@ def _cls_verify_microdeposits( "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -8147,9 +8046,6 @@ def _cls_verify_microdeposits( @staticmethod def verify_microdeposits( intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ @@ -8159,9 +8055,7 @@ def verify_microdeposits( @overload def verify_microdeposits( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -8170,9 +8064,7 @@ def verify_microdeposits( @class_method_variant("_cls_verify_microdeposits") def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] + self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. @@ -8184,7 +8076,6 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/payment_link.py b/stripe/api_resources/payment_link.py index 85f233cb1..2759b85f8 100644 --- a/stripe/api_resources/payment_link.py +++ b/stripe/api_resources/payment_link.py @@ -2098,12 +2098,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentLink.CreateParams"] + cls, **params: Unpack["PaymentLink.CreateParams"] ) -> "PaymentLink": """ Creates a payment link. @@ -2113,21 +2108,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentLink.ListParams"] + cls, **params: Unpack["PaymentLink.ListParams"] ) -> ListObject["PaymentLink"]: """ Returns a list of your payment links. @@ -2135,9 +2122,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -2153,9 +2137,6 @@ def list( def _cls_list_line_items( cls, payment_link: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -2168,9 +2149,6 @@ def _cls_list_line_items( "/v1/payment_links/{payment_link}/line_items".format( payment_link=util.sanitize_id(payment_link) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2178,11 +2156,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - payment_link: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentLink.ListLineItemsParams"] + payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -2191,9 +2165,7 @@ def list_line_items( @overload def list_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentLink.ListLineItemsParams"] + self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -2202,9 +2174,7 @@ def list_line_items( @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentLink.ListLineItemsParams"] + self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -2216,7 +2186,6 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_links/{payment_link}/line_items".format( payment_link=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/payment_method.py b/stripe/api_resources/payment_method.py index c15f63bbc..a1126d9ad 100644 --- a/stripe/api_resources/payment_method.py +++ b/stripe/api_resources/payment_method.py @@ -1705,9 +1705,6 @@ class RetrieveParams(RequestOptions): def _cls_attach( cls, payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ @@ -1732,9 +1729,6 @@ def _cls_attach( "/v1/payment_methods/{payment_method}/attach".format( payment_method=util.sanitize_id(payment_method) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1742,11 +1736,7 @@ def _cls_attach( @overload @staticmethod def attach( - payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethod.AttachParams"] + payment_method: str, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1767,9 +1757,7 @@ def attach( @overload def attach( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethod.AttachParams"] + self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1790,9 +1778,7 @@ def attach( @class_method_variant("_cls_attach") def attach( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethod.AttachParams"] + self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. @@ -1816,19 +1802,13 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_methods/{payment_method}/attach".format( payment_method=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethod.CreateParams"] + cls, **params: Unpack["PaymentMethod.CreateParams"] ) -> "PaymentMethod": """ Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. @@ -1840,10 +1820,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -1852,9 +1828,6 @@ def create( def _cls_detach( cls, payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ @@ -1867,9 +1840,6 @@ def _cls_detach( "/v1/payment_methods/{payment_method}/detach".format( payment_method=util.sanitize_id(payment_method) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1877,11 +1847,7 @@ def _cls_detach( @overload @staticmethod def detach( - payment_method: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethod.DetachParams"] + payment_method: str, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. @@ -1890,9 +1856,7 @@ def detach( @overload def detach( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethod.DetachParams"] + self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. @@ -1901,9 +1865,7 @@ def detach( @class_method_variant("_cls_detach") def detach( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethod.DetachParams"] + self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. @@ -1915,18 +1877,13 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_methods/{payment_method}/detach".format( payment_method=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethod.ListParams"] + cls, **params: Unpack["PaymentMethod.ListParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. @@ -1934,9 +1891,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/payment_method_configuration.py b/stripe/api_resources/payment_method_configuration.py index 10c1e2fcf..2fe967c53 100644 --- a/stripe/api_resources/payment_method_configuration.py +++ b/stripe/api_resources/payment_method_configuration.py @@ -2261,12 +2261,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethodConfiguration.CreateParams"] + cls, **params: Unpack["PaymentMethodConfiguration.CreateParams"] ) -> "PaymentMethodConfiguration": """ Creates a payment method configuration @@ -2276,21 +2271,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethodConfiguration.ListParams"] + cls, **params: Unpack["PaymentMethodConfiguration.ListParams"] ) -> ListObject["PaymentMethodConfiguration"]: """ List payment method configurations @@ -2298,9 +2285,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/payment_method_domain.py b/stripe/api_resources/payment_method_domain.py index e07895d8a..e9d1d94e5 100644 --- a/stripe/api_resources/payment_method_domain.py +++ b/stripe/api_resources/payment_method_domain.py @@ -206,12 +206,7 @@ class ValidateParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethodDomain.CreateParams"] + cls, **params: Unpack["PaymentMethodDomain.CreateParams"] ) -> "PaymentMethodDomain": """ Creates a payment method domain. @@ -221,21 +216,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PaymentMethodDomain.ListParams"] + cls, **params: Unpack["PaymentMethodDomain.ListParams"] ) -> ListObject["PaymentMethodDomain"]: """ Lists the details of existing payment method domains. @@ -243,9 +230,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -285,9 +269,6 @@ def retrieve( def _cls_validate( cls, payment_method_domain: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ @@ -307,9 +288,6 @@ def _cls_validate( payment_method_domain ) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -318,9 +296,6 @@ def _cls_validate( @staticmethod def validate( payment_method_domain: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ @@ -335,9 +310,7 @@ def validate( @overload def validate( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. @@ -351,9 +324,7 @@ def validate( @class_method_variant("_cls_validate") def validate( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["PaymentMethodDomain.ValidateParams"] + self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. @@ -370,7 +341,6 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/payout.py b/stripe/api_resources/payout.py index 8b5c9c00e..3b8c6e436 100644 --- a/stripe/api_resources/payout.py +++ b/stripe/api_resources/payout.py @@ -278,12 +278,7 @@ class ReverseParams(RequestOptions): @classmethod def _cls_cancel( - cls, - payout: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.CancelParams"] + cls, payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -295,9 +290,6 @@ def _cls_cancel( "/v1/payouts/{payout}/cancel".format( payout=util.sanitize_id(payout) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -305,11 +297,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - payout: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.CancelParams"] + payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -317,11 +305,7 @@ def cancel( ... @overload - def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Payout.CancelParams"] - ) -> "Payout": + def cancel(self, **params: Unpack["Payout.CancelParams"]) -> "Payout": """ You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ @@ -329,9 +313,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Payout.CancelParams"] + self, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. @@ -343,20 +325,12 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/payouts/{payout}/cancel".format( payout=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.CreateParams"] - ) -> "Payout": + def create(cls, **params: Unpack["Payout.CreateParams"]) -> "Payout": """ To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. @@ -369,21 +343,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.ListParams"] + cls, **params: Unpack["Payout.ListParams"] ) -> ListObject["Payout"]: """ Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. @@ -391,9 +357,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -431,12 +394,7 @@ def retrieve( @classmethod def _cls_reverse( - cls, - payout: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.ReverseParams"] + cls, payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. @@ -450,9 +408,6 @@ def _cls_reverse( "/v1/payouts/{payout}/reverse".format( payout=util.sanitize_id(payout) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -460,11 +415,7 @@ def _cls_reverse( @overload @staticmethod def reverse( - payout: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Payout.ReverseParams"] + payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. @@ -474,11 +425,7 @@ def reverse( ... @overload - def reverse( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Payout.ReverseParams"] - ) -> "Payout": + def reverse(self, **params: Unpack["Payout.ReverseParams"]) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. @@ -488,9 +435,7 @@ def reverse( @class_method_variant("_cls_reverse") def reverse( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Payout.ReverseParams"] + self, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. @@ -504,7 +449,6 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] "/v1/payouts/{payout}/reverse".format( payout=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/plan.py b/stripe/api_resources/plan.py index 8f4134fe1..122ca1922 100644 --- a/stripe/api_resources/plan.py +++ b/stripe/api_resources/plan.py @@ -386,14 +386,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Plan.CreateParams"] - ) -> "Plan": + def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. """ @@ -402,10 +395,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -452,22 +441,13 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] ) @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Plan.ListParams"] - ) -> ListObject["Plan"]: + def list(cls, **params: Unpack["Plan.ListParams"]) -> ListObject["Plan"]: """ Returns a list of your plans. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/price.py b/stripe/api_resources/price.py index 981a53e50..d2fb3f912 100644 --- a/stripe/api_resources/price.py +++ b/stripe/api_resources/price.py @@ -728,14 +728,7 @@ class SearchParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Price.CreateParams"] - ) -> "Price": + def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": """ Creates a new price for an existing product. The price can be recurring or one-time. """ @@ -744,31 +737,18 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Price.ListParams"] - ) -> ListObject["Price"]: + def list(cls, **params: Unpack["Price.ListParams"]) -> ListObject["Price"]: """ Returns a list of your prices. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/product.py b/stripe/api_resources/product.py index ef7b3d1c4..623c4fa34 100644 --- a/stripe/api_resources/product.py +++ b/stripe/api_resources/product.py @@ -550,14 +550,7 @@ class SearchParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Product.CreateParams"] - ) -> "Product": + def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": """ Creates a new product object. """ @@ -566,10 +559,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -619,11 +608,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Product.ListParams"] + cls, **params: Unpack["Product.ListParams"] ) -> ListObject["Product"]: """ Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. @@ -631,9 +616,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/promotion_code.py b/stripe/api_resources/promotion_code.py index cd1ae4f85..531115589 100644 --- a/stripe/api_resources/promotion_code.py +++ b/stripe/api_resources/promotion_code.py @@ -276,12 +276,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PromotionCode.CreateParams"] + cls, **params: Unpack["PromotionCode.CreateParams"] ) -> "PromotionCode": """ A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. @@ -291,21 +286,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["PromotionCode.ListParams"] + cls, **params: Unpack["PromotionCode.ListParams"] ) -> ListObject["PromotionCode"]: """ Returns a list of your promotion codes. @@ -313,9 +300,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/quote.py b/stripe/api_resources/quote.py index 35191d5e5..5b7d6e948 100644 --- a/stripe/api_resources/quote.py +++ b/stripe/api_resources/quote.py @@ -1039,12 +1039,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_accept( - cls, - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.AcceptParams"] + cls, quote: str, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. @@ -1056,33 +1051,20 @@ def _cls_accept( "/v1/quotes/{quote}/accept".format( quote=util.sanitize_id(quote) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @overload @staticmethod - def accept( - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + def accept(quote: str, **params: Unpack["Quote.AcceptParams"]) -> "Quote": """ Accepts the specified quote. """ ... @overload - def accept( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.AcceptParams"] - ) -> "Quote": + def accept(self, **params: Unpack["Quote.AcceptParams"]) -> "Quote": """ Accepts the specified quote. """ @@ -1090,9 +1072,7 @@ def accept( @class_method_variant("_cls_accept") def accept( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.AcceptParams"] + self, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. @@ -1104,19 +1084,13 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] "/v1/quotes/{quote}/accept".format( quote=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_cancel( - cls, - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.CancelParams"] + cls, quote: str, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. @@ -1128,33 +1102,20 @@ def _cls_cancel( "/v1/quotes/{quote}/cancel".format( quote=util.sanitize_id(quote) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @overload @staticmethod - def cancel( - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + def cancel(quote: str, **params: Unpack["Quote.CancelParams"]) -> "Quote": """ Cancels the quote. """ ... @overload - def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.CancelParams"] - ) -> "Quote": + def cancel(self, **params: Unpack["Quote.CancelParams"]) -> "Quote": """ Cancels the quote. """ @@ -1162,9 +1123,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.CancelParams"] + self, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. @@ -1176,20 +1135,12 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/quotes/{quote}/cancel".format( quote=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.CreateParams"] - ) -> "Quote": + def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": """ A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). """ @@ -1198,22 +1149,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def _cls_finalize_quote( - cls, - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.FinalizeQuoteParams"] + cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1225,9 +1167,6 @@ def _cls_finalize_quote( "/v1/quotes/{quote}/finalize".format( quote=util.sanitize_id(quote) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1235,11 +1174,7 @@ def _cls_finalize_quote( @overload @staticmethod def finalize_quote( - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.FinalizeQuoteParams"] + quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1248,9 +1183,7 @@ def finalize_quote( @overload def finalize_quote( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.FinalizeQuoteParams"] + self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1259,9 +1192,7 @@ def finalize_quote( @class_method_variant("_cls_finalize_quote") def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.FinalizeQuoteParams"] + self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. @@ -1273,28 +1204,18 @@ def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] "/v1/quotes/{quote}/finalize".format( quote=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.ListParams"] - ) -> ListObject["Quote"]: + def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: """ Returns a list of your quotes. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -1310,9 +1231,6 @@ def list( def _cls_list_computed_upfront_line_items( cls, quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1325,9 +1243,6 @@ def _cls_list_computed_upfront_line_items( "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=util.sanitize_id(quote) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1336,9 +1251,6 @@ def _cls_list_computed_upfront_line_items( @staticmethod def list_computed_upfront_line_items( quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ @@ -1348,9 +1260,7 @@ def list_computed_upfront_line_items( @overload def list_computed_upfront_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1359,9 +1269,7 @@ def list_computed_upfront_line_items( @class_method_variant("_cls_list_computed_upfront_line_items") def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] + self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. @@ -1373,19 +1281,13 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_list_line_items( - cls, - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.ListLineItemsParams"] + cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1397,9 +1299,6 @@ def _cls_list_line_items( "/v1/quotes/{quote}/line_items".format( quote=util.sanitize_id(quote) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1407,11 +1306,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - quote: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Quote.ListLineItemsParams"] + quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1420,9 +1315,7 @@ def list_line_items( @overload def list_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.ListLineItemsParams"] + self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1431,9 +1324,7 @@ def list_line_items( @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Quote.ListLineItemsParams"] + self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. @@ -1445,7 +1336,6 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] "/v1/quotes/{quote}/line_items".format( quote=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/radar/early_fraud_warning.py b/stripe/api_resources/radar/early_fraud_warning.py index ab027ba1b..26497b9b7 100644 --- a/stripe/api_resources/radar/early_fraud_warning.py +++ b/stripe/api_resources/radar/early_fraud_warning.py @@ -92,11 +92,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["EarlyFraudWarning.ListParams"] + cls, **params: Unpack["EarlyFraudWarning.ListParams"] ) -> ListObject["EarlyFraudWarning"]: """ Returns a list of early fraud warnings. @@ -104,9 +100,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/radar/value_list.py b/stripe/api_resources/radar/value_list.py index 88e33b150..a431c4a8e 100644 --- a/stripe/api_resources/radar/value_list.py +++ b/stripe/api_resources/radar/value_list.py @@ -191,14 +191,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ValueList.CreateParams"] - ) -> "ValueList": + def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": """ Creates a new ValueList object, which can then be referenced in rules. """ @@ -207,10 +200,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -262,11 +251,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ValueList.ListParams"] + cls, **params: Unpack["ValueList.ListParams"] ) -> ListObject["ValueList"]: """ Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -274,9 +259,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/radar/value_list_item.py b/stripe/api_resources/radar/value_list_item.py index e413aa9a0..516e6a321 100644 --- a/stripe/api_resources/radar/value_list_item.py +++ b/stripe/api_resources/radar/value_list_item.py @@ -138,12 +138,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ValueListItem.CreateParams"] + cls, **params: Unpack["ValueListItem.CreateParams"] ) -> "ValueListItem": """ Creates a new ValueListItem object, which is added to the specified parent value list. @@ -153,10 +148,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -208,11 +199,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ValueListItem.ListParams"] + cls, **params: Unpack["ValueListItem.ListParams"] ) -> ListObject["ValueListItem"]: """ Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -220,9 +207,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/refund.py b/stripe/api_resources/refund.py index f97b7f0cd..a26c2378b 100644 --- a/stripe/api_resources/refund.py +++ b/stripe/api_resources/refund.py @@ -251,12 +251,7 @@ class ExpireParams(RequestOptions): @classmethod def _cls_cancel( - cls, - refund: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.CancelParams"] + cls, refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -270,9 +265,6 @@ def _cls_cancel( "/v1/refunds/{refund}/cancel".format( refund=util.sanitize_id(refund) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -280,11 +272,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - refund: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.CancelParams"] + refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -294,11 +282,7 @@ def cancel( ... @overload - def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Refund.CancelParams"] - ) -> "Refund": + def cancel(self, **params: Unpack["Refund.CancelParams"]) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -308,9 +292,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Refund.CancelParams"] + self, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. @@ -324,20 +306,12 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/refunds/{refund}/cancel".format( refund=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.CreateParams"] - ) -> "Refund": + def create(cls, **params: Unpack["Refund.CreateParams"]) -> "Refund": """ When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. @@ -356,21 +330,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.ListParams"] + cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. @@ -378,9 +344,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -423,12 +386,7 @@ class TestHelpers(APIResourceTestHelpers["Refund"]): @classmethod def _cls_expire( - cls, - refund: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.ExpireParams"] + cls, refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -440,9 +398,6 @@ def _cls_expire( "/v1/test_helpers/refunds/{refund}/expire".format( refund=util.sanitize_id(refund) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -450,11 +405,7 @@ def _cls_expire( @overload @staticmethod def expire( - refund: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Refund.ExpireParams"] + refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -462,11 +413,7 @@ def expire( ... @overload - def expire( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Refund.ExpireParams"] - ) -> "Refund": + def expire(self, **params: Unpack["Refund.ExpireParams"]) -> "Refund": """ Expire a refund with a status of requires_action. """ @@ -474,9 +421,7 @@ def expire( @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Refund.ExpireParams"] + self, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. @@ -488,7 +433,6 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/refunds/{refund}/expire".format( refund=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/reporting/report_run.py b/stripe/api_resources/reporting/report_run.py index e08dcf293..3aab03c0a 100644 --- a/stripe/api_resources/reporting/report_run.py +++ b/stripe/api_resources/reporting/report_run.py @@ -214,14 +214,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReportRun.CreateParams"] - ) -> "ReportRun": + def create(cls, **params: Unpack["ReportRun.CreateParams"]) -> "ReportRun": """ Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ @@ -230,21 +223,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReportRun.ListParams"] + cls, **params: Unpack["ReportRun.ListParams"] ) -> ListObject["ReportRun"]: """ Returns a list of Report Runs, with the most recent appearing first. @@ -252,9 +237,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/reporting/report_type.py b/stripe/api_resources/reporting/report_type.py index e970a9740..bf2688d2f 100644 --- a/stripe/api_resources/reporting/report_type.py +++ b/stripe/api_resources/reporting/report_type.py @@ -75,11 +75,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReportType.ListParams"] + cls, **params: Unpack["ReportType.ListParams"] ) -> ListObject["ReportType"]: """ Returns a full list of Report Types. @@ -87,9 +83,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/review.py b/stripe/api_resources/review.py index 3d7a2c5d9..939bb2672 100644 --- a/stripe/api_resources/review.py +++ b/stripe/api_resources/review.py @@ -185,12 +185,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_approve( - cls, - review: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Review.ApproveParams"] + cls, review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -202,9 +197,6 @@ def _cls_approve( "/v1/reviews/{review}/approve".format( review=util.sanitize_id(review) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -212,11 +204,7 @@ def _cls_approve( @overload @staticmethod def approve( - review: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Review.ApproveParams"] + review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -224,11 +212,7 @@ def approve( ... @overload - def approve( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Review.ApproveParams"] - ) -> "Review": + def approve(self, **params: Unpack["Review.ApproveParams"]) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ @@ -236,9 +220,7 @@ def approve( @class_method_variant("_cls_approve") def approve( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Review.ApproveParams"] + self, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. @@ -250,18 +232,13 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] "/v1/reviews/{review}/approve".format( review=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Review.ListParams"] + cls, **params: Unpack["Review.ListParams"] ) -> ListObject["Review"]: """ Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. @@ -269,9 +246,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/setup_attempt.py b/stripe/api_resources/setup_attempt.py index 270ce4673..117c2e9a7 100644 --- a/stripe/api_resources/setup_attempt.py +++ b/stripe/api_resources/setup_attempt.py @@ -753,11 +753,7 @@ class ListParamsCreated(TypedDict): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupAttempt.ListParams"] + cls, **params: Unpack["SetupAttempt.ListParams"] ) -> ListObject["SetupAttempt"]: """ Returns a list of SetupAttempts that associate with a provided SetupIntent. @@ -765,9 +761,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/setup_intent.py b/stripe/api_resources/setup_intent.py index 9722c3ca5..eb049facd 100644 --- a/stripe/api_resources/setup_intent.py +++ b/stripe/api_resources/setup_intent.py @@ -3291,12 +3291,7 @@ class VerifyMicrodepositsParams(RequestOptions): @classmethod def _cls_cancel( - cls, - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.CancelParams"] + cls, intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -3310,9 +3305,6 @@ def _cls_cancel( "/v1/setup_intents/{intent}/cancel".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3320,11 +3312,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.CancelParams"] + intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -3335,9 +3323,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.CancelParams"] + self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -3348,9 +3334,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.CancelParams"] + self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. @@ -3364,19 +3348,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/setup_intents/{intent}/cancel".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_confirm( - cls, - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.ConfirmParams"] + cls, intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -3401,9 +3379,6 @@ def _cls_confirm( "/v1/setup_intents/{intent}/confirm".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3411,11 +3386,7 @@ def _cls_confirm( @overload @staticmethod def confirm( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.ConfirmParams"] + intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -3437,9 +3408,7 @@ def confirm( @overload def confirm( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.ConfirmParams"] + self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -3461,9 +3430,7 @@ def confirm( @class_method_variant("_cls_confirm") def confirm( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.ConfirmParams"] + self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or @@ -3488,19 +3455,13 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] "/v1/setup_intents/{intent}/confirm".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.CreateParams"] + cls, **params: Unpack["SetupIntent.CreateParams"] ) -> "SetupIntent": """ Creates a SetupIntent object. @@ -3513,21 +3474,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.ListParams"] + cls, **params: Unpack["SetupIntent.ListParams"] ) -> ListObject["SetupIntent"]: """ Returns a list of SetupIntents. @@ -3535,9 +3488,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -3581,9 +3531,6 @@ def retrieve( def _cls_verify_microdeposits( cls, intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ @@ -3596,9 +3543,6 @@ def _cls_verify_microdeposits( "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=util.sanitize_id(intent) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -3606,11 +3550,7 @@ def _cls_verify_microdeposits( @overload @staticmethod def verify_microdeposits( - intent: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -3619,9 +3559,7 @@ def verify_microdeposits( @overload def verify_microdeposits( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -3630,9 +3568,7 @@ def verify_microdeposits( @class_method_variant("_cls_verify_microdeposits") def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] + self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. @@ -3644,7 +3580,6 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/shipping_rate.py b/stripe/api_resources/shipping_rate.py index 3f4a4fa3f..42785b7f0 100644 --- a/stripe/api_resources/shipping_rate.py +++ b/stripe/api_resources/shipping_rate.py @@ -340,12 +340,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ShippingRate.CreateParams"] + cls, **params: Unpack["ShippingRate.CreateParams"] ) -> "ShippingRate": """ Creates a new shipping rate object. @@ -355,21 +350,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ShippingRate.ListParams"] + cls, **params: Unpack["ShippingRate.ListParams"] ) -> ListObject["ShippingRate"]: """ Returns a list of your shipping rates. @@ -377,9 +364,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/sigma/scheduled_query_run.py b/stripe/api_resources/sigma/scheduled_query_run.py index 071423197..f07e1dacf 100644 --- a/stripe/api_resources/sigma/scheduled_query_run.py +++ b/stripe/api_resources/sigma/scheduled_query_run.py @@ -99,11 +99,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ScheduledQueryRun.ListParams"] + cls, **params: Unpack["ScheduledQueryRun.ListParams"] ) -> ListObject["ScheduledQueryRun"]: """ Returns a list of scheduled query runs. @@ -111,9 +107,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/source.py b/stripe/api_resources/source.py index c5c42b721..73fac4283 100644 --- a/stripe/api_resources/source.py +++ b/stripe/api_resources/source.py @@ -1119,14 +1119,7 @@ class VerifyParams(RequestOptions): wechat: Optional[Wechat] @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Source.CreateParams"] - ) -> "Source": + def create(cls, **params: Unpack["Source.CreateParams"]) -> "Source": """ Creates a new source object. """ @@ -1135,10 +1128,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -1147,9 +1136,6 @@ def create( def _cls_list_source_transactions( cls, source: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ @@ -1162,9 +1148,6 @@ def _cls_list_source_transactions( "/v1/sources/{source}/source_transactions".format( source=util.sanitize_id(source) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1172,11 +1155,7 @@ def _cls_list_source_transactions( @overload @staticmethod def list_source_transactions( - source: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Source.ListSourceTransactionsParams"] + source: str, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -1185,9 +1164,7 @@ def list_source_transactions( @overload def list_source_transactions( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Source.ListSourceTransactionsParams"] + self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -1196,9 +1173,7 @@ def list_source_transactions( @class_method_variant("_cls_list_source_transactions") def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Source.ListSourceTransactionsParams"] + self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. @@ -1210,7 +1185,6 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] "/v1/sources/{source}/source_transactions".format( source=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1243,12 +1217,7 @@ def retrieve( @classmethod def _cls_verify( - cls, - source: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Source.VerifyParams"] + cls, source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. @@ -1260,9 +1229,6 @@ def _cls_verify( "/v1/sources/{source}/verify".format( source=util.sanitize_id(source) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1270,11 +1236,7 @@ def _cls_verify( @overload @staticmethod def verify( - source: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Source.VerifyParams"] + source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. @@ -1282,11 +1244,7 @@ def verify( ... @overload - def verify( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Source.VerifyParams"] - ) -> "Source": + def verify(self, **params: Unpack["Source.VerifyParams"]) -> "Source": """ Verify a given source. """ @@ -1294,9 +1252,7 @@ def verify( @class_method_variant("_cls_verify") def verify( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Source.VerifyParams"] + self, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. @@ -1308,7 +1264,6 @@ def verify( # pyright: ignore[reportGeneralTypeIssues] "/v1/sources/{source}/verify".format( source=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/subscription.py b/stripe/api_resources/subscription.py index 35724024b..976b68acd 100644 --- a/stripe/api_resources/subscription.py +++ b/stripe/api_resources/subscription.py @@ -1839,9 +1839,6 @@ class SearchParams(RequestOptions): def _cls_cancel( cls, subscription_exposed_id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ @@ -1860,9 +1857,6 @@ def _cls_cancel( subscription_exposed_id ) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1871,9 +1865,6 @@ def _cls_cancel( @staticmethod def cancel( subscription_exposed_id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ @@ -1887,9 +1878,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.CancelParams"] + self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -1902,9 +1891,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.CancelParams"] + self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. @@ -1920,19 +1907,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Subscription.CreateParams"] + cls, **params: Unpack["Subscription.CreateParams"] ) -> "Subscription": """ Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. @@ -1948,10 +1929,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -1960,9 +1937,6 @@ def create( def _cls_delete_discount( cls, subscription_exposed_id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ @@ -1977,9 +1951,6 @@ def _cls_delete_discount( subscription_exposed_id ) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1988,9 +1959,6 @@ def _cls_delete_discount( @staticmethod def delete_discount( subscription_exposed_id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ @@ -2000,9 +1968,7 @@ def delete_discount( @overload def delete_discount( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.DeleteDiscountParams"] + self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2011,9 +1977,7 @@ def delete_discount( @class_method_variant("_cls_delete_discount") def delete_discount( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.DeleteDiscountParams"] + self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. @@ -2025,18 +1989,13 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Subscription.ListParams"] + cls, **params: Unpack["Subscription.ListParams"] ) -> ListObject["Subscription"]: """ By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. @@ -2044,9 +2003,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -2093,12 +2049,7 @@ def modify( @classmethod def _cls_resume( - cls, - subscription: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Subscription.ResumeParams"] + cls, subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. @@ -2110,9 +2061,6 @@ def _cls_resume( "/v1/subscriptions/{subscription}/resume".format( subscription=util.sanitize_id(subscription) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -2120,11 +2068,7 @@ def _cls_resume( @overload @staticmethod def resume( - subscription: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Subscription.ResumeParams"] + subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. @@ -2133,9 +2077,7 @@ def resume( @overload def resume( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.ResumeParams"] + self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. @@ -2144,9 +2086,7 @@ def resume( @class_method_variant("_cls_resume") def resume( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Subscription.ResumeParams"] + self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. @@ -2158,7 +2098,6 @@ def resume( # pyright: ignore[reportGeneralTypeIssues] "/v1/subscriptions/{subscription}/resume".format( subscription=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/subscription_item.py b/stripe/api_resources/subscription_item.py index e5fe91f50..034d837d1 100644 --- a/stripe/api_resources/subscription_item.py +++ b/stripe/api_resources/subscription_item.py @@ -404,12 +404,7 @@ class ListUsageRecordSummariesParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionItem.CreateParams"] + cls, **params: Unpack["SubscriptionItem.CreateParams"] ) -> "SubscriptionItem": """ Adds a new item to an existing subscription. No existing items will be changed or replaced. @@ -419,10 +414,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -474,11 +465,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionItem.ListParams"] + cls, **params: Unpack["SubscriptionItem.ListParams"] ) -> ListObject["SubscriptionItem"]: """ Returns a list of your subscription items for a given subscription. @@ -486,9 +473,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -528,9 +512,6 @@ def retrieve( def create_usage_record( cls, subscription_item: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["SubscriptionItem.CreateUsageRecordParams"] ) -> "UsageRecord": """ @@ -549,9 +530,6 @@ def create_usage_record( "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=util.sanitize_id(subscription_item) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -560,9 +538,6 @@ def create_usage_record( def list_usage_record_summaries( cls, subscription_item: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"] ) -> ListObject["UsageRecordSummary"]: """ @@ -577,9 +552,6 @@ def list_usage_record_summaries( "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=util.sanitize_id(subscription_item) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/subscription_schedule.py b/stripe/api_resources/subscription_schedule.py index b668ede66..0efcd710d 100644 --- a/stripe/api_resources/subscription_schedule.py +++ b/stripe/api_resources/subscription_schedule.py @@ -1294,9 +1294,6 @@ class RetrieveParams(RequestOptions): def _cls_cancel( cls, schedule: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ @@ -1309,9 +1306,6 @@ def _cls_cancel( "/v1/subscription_schedules/{schedule}/cancel".format( schedule=util.sanitize_id(schedule) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1319,11 +1313,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - schedule: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.CancelParams"] + schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1332,9 +1322,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.CancelParams"] + self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1343,9 +1331,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.CancelParams"] + self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. @@ -1357,19 +1343,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/subscription_schedules/{schedule}/cancel".format( schedule=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.CreateParams"] + cls, **params: Unpack["SubscriptionSchedule.CreateParams"] ) -> "SubscriptionSchedule": """ Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. @@ -1379,21 +1359,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.ListParams"] + cls, **params: Unpack["SubscriptionSchedule.ListParams"] ) -> ListObject["SubscriptionSchedule"]: """ Retrieves the list of your subscription schedules. @@ -1401,9 +1373,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -1432,9 +1401,6 @@ def modify( def _cls_release( cls, schedule: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ @@ -1447,9 +1413,6 @@ def _cls_release( "/v1/subscription_schedules/{schedule}/release".format( schedule=util.sanitize_id(schedule) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1457,11 +1420,7 @@ def _cls_release( @overload @staticmethod def release( - schedule: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.ReleaseParams"] + schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1470,9 +1429,7 @@ def release( @overload def release( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.ReleaseParams"] + self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1481,9 +1438,7 @@ def release( @class_method_variant("_cls_release") def release( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["SubscriptionSchedule.ReleaseParams"] + self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. @@ -1495,7 +1450,6 @@ def release( # pyright: ignore[reportGeneralTypeIssues] "/v1/subscription_schedules/{schedule}/release".format( schedule=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/tax/calculation.py b/stripe/api_resources/tax/calculation.py index 2ef3adcbf..0c641229b 100644 --- a/stripe/api_resources/tax/calculation.py +++ b/stripe/api_resources/tax/calculation.py @@ -628,12 +628,7 @@ class ListLineItemsParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Calculation.CreateParams"] + cls, **params: Unpack["Calculation.CreateParams"] ) -> "Calculation": """ Calculates tax based on input and returns a Tax Calculation object. @@ -643,10 +638,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -655,9 +646,6 @@ def create( def _cls_list_line_items( cls, calculation: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ @@ -670,9 +658,6 @@ def _cls_list_line_items( "/v1/tax/calculations/{calculation}/line_items".format( calculation=util.sanitize_id(calculation) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -680,11 +665,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - calculation: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Calculation.ListLineItemsParams"] + calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a persisted tax calculation as a collection. @@ -693,9 +674,7 @@ def list_line_items( @overload def list_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Calculation.ListLineItemsParams"] + self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a persisted tax calculation as a collection. @@ -704,9 +683,7 @@ def list_line_items( @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Calculation.ListLineItemsParams"] + self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a persisted tax calculation as a collection. @@ -718,7 +695,6 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] "/v1/tax/calculations/{calculation}/line_items".format( calculation=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/tax/registration.py b/stripe/api_resources/tax/registration.py index 6a3725b52..4acd1b8ab 100644 --- a/stripe/api_resources/tax/registration.py +++ b/stripe/api_resources/tax/registration.py @@ -1637,12 +1637,7 @@ class ModifyParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Registration.CreateParams"] + cls, **params: Unpack["Registration.CreateParams"] ) -> "Registration": """ Creates a new Tax Registration object. @@ -1652,21 +1647,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Registration.ListParams"] + cls, **params: Unpack["Registration.ListParams"] ) -> ListObject["Registration"]: """ Returns a list of Tax Registration objects. @@ -1674,9 +1661,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/tax/transaction.py b/stripe/api_resources/tax/transaction.py index 61a717d81..b708b392b 100644 --- a/stripe/api_resources/tax/transaction.py +++ b/stripe/api_resources/tax/transaction.py @@ -456,11 +456,7 @@ class RetrieveParams(RequestOptions): @classmethod def create_from_calculation( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.CreateFromCalculationParams"] + cls, **params: Unpack["Transaction.CreateFromCalculationParams"] ) -> "Transaction": """ Creates a Tax Transaction from a calculation. @@ -470,20 +466,13 @@ def create_from_calculation( cls._static_request( "post", "/v1/tax/transactions/create_from_calculation", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def create_reversal( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.CreateReversalParams"] + cls, **params: Unpack["Transaction.CreateReversalParams"] ) -> "Transaction": """ Partially or fully reverses a previously created Transaction. @@ -493,9 +482,6 @@ def create_reversal( cls._static_request( "post", "/v1/tax/transactions/create_reversal", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -504,9 +490,6 @@ def create_reversal( def _cls_list_line_items( cls, transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ @@ -519,9 +502,6 @@ def _cls_list_line_items( "/v1/tax/transactions/{transaction}/line_items".format( transaction=util.sanitize_id(transaction) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -529,11 +509,7 @@ def _cls_list_line_items( @overload @staticmethod def list_line_items( - transaction: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.ListLineItemsParams"] + transaction: str, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -542,9 +518,7 @@ def list_line_items( @overload def list_line_items( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Transaction.ListLineItemsParams"] + self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -553,9 +527,7 @@ def list_line_items( @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Transaction.ListLineItemsParams"] + self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. @@ -567,7 +539,6 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] "/v1/tax/transactions/{transaction}/line_items".format( transaction=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/tax_code.py b/stripe/api_resources/tax_code.py index 3e3298f2f..492228413 100644 --- a/stripe/api_resources/tax_code.py +++ b/stripe/api_resources/tax_code.py @@ -3,7 +3,7 @@ from stripe.api_resources.abstract import ListableAPIResource from stripe.api_resources.list_object import ListObject from stripe.request_options import RequestOptions -from typing import ClassVar, List, Optional +from typing import ClassVar, List from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING @@ -58,11 +58,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TaxCode.ListParams"] + cls, **params: Unpack["TaxCode.ListParams"] ) -> ListObject["TaxCode"]: """ A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. @@ -70,9 +66,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/tax_rate.py b/stripe/api_resources/tax_rate.py index 34640e206..01ee26005 100644 --- a/stripe/api_resources/tax_rate.py +++ b/stripe/api_resources/tax_rate.py @@ -254,14 +254,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TaxRate.CreateParams"] - ) -> "TaxRate": + def create(cls, **params: Unpack["TaxRate.CreateParams"]) -> "TaxRate": """ Creates a new tax rate. """ @@ -270,21 +263,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TaxRate.ListParams"] + cls, **params: Unpack["TaxRate.ListParams"] ) -> ListObject["TaxRate"]: """ Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. @@ -292,9 +277,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/terminal/configuration.py b/stripe/api_resources/terminal/configuration.py index 769d2b2de..9b94d07ad 100644 --- a/stripe/api_resources/terminal/configuration.py +++ b/stripe/api_resources/terminal/configuration.py @@ -949,12 +949,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Configuration.CreateParams"] + cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a new Configuration object. @@ -964,10 +959,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -1019,11 +1010,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Configuration.ListParams"] + cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of Configuration objects. @@ -1031,9 +1018,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/terminal/connection_token.py b/stripe/api_resources/terminal/connection_token.py index 861273042..202381473 100644 --- a/stripe/api_resources/terminal/connection_token.py +++ b/stripe/api_resources/terminal/connection_token.py @@ -43,12 +43,7 @@ class CreateParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ConnectionToken.CreateParams"] + cls, **params: Unpack["ConnectionToken.CreateParams"] ) -> "ConnectionToken": """ To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. @@ -58,10 +53,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/terminal/location.py b/stripe/api_resources/terminal/location.py index 37b5d762a..55275abc8 100644 --- a/stripe/api_resources/terminal/location.py +++ b/stripe/api_resources/terminal/location.py @@ -217,14 +217,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Location.CreateParams"] - ) -> "Location": + def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": """ Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. @@ -234,10 +227,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -287,11 +276,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Location.ListParams"] + cls, **params: Unpack["Location.ListParams"] ) -> ListObject["Location"]: """ Returns a list of Location objects. @@ -299,9 +284,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/terminal/reader.py b/stripe/api_resources/terminal/reader.py index 69e8bad86..754f5b2f1 100644 --- a/stripe/api_resources/terminal/reader.py +++ b/stripe/api_resources/terminal/reader.py @@ -539,12 +539,7 @@ class PresentPaymentMethodParamsCardPresent(TypedDict): @classmethod def _cls_cancel_action( - cls, - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.CancelActionParams"] + cls, reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. @@ -556,9 +551,6 @@ def _cls_cancel_action( "/v1/terminal/readers/{reader}/cancel_action".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -566,11 +558,7 @@ def _cls_cancel_action( @overload @staticmethod def cancel_action( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.CancelActionParams"] + reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. @@ -579,9 +567,7 @@ def cancel_action( @overload def cancel_action( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.CancelActionParams"] + self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. @@ -590,9 +576,7 @@ def cancel_action( @class_method_variant("_cls_cancel_action") def cancel_action( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.CancelActionParams"] + self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. @@ -604,20 +588,12 @@ def cancel_action( # pyright: ignore[reportGeneralTypeIssues] "/v1/terminal/readers/{reader}/cancel_action".format( reader=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.CreateParams"] - ) -> "Reader": + def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ Creates a new Reader object. """ @@ -626,10 +602,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -677,11 +649,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.ListParams"] + cls, **params: Unpack["Reader.ListParams"] ) -> ListObject["Reader"]: """ Returns a list of Reader objects. @@ -689,9 +657,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -718,12 +683,7 @@ def modify( @classmethod def _cls_process_payment_intent( - cls, - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.ProcessPaymentIntentParams"] + cls, reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. @@ -735,9 +695,6 @@ def _cls_process_payment_intent( "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -745,11 +702,7 @@ def _cls_process_payment_intent( @overload @staticmethod def process_payment_intent( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.ProcessPaymentIntentParams"] + reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. @@ -758,9 +711,7 @@ def process_payment_intent( @overload def process_payment_intent( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.ProcessPaymentIntentParams"] + self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. @@ -769,9 +720,7 @@ def process_payment_intent( @class_method_variant("_cls_process_payment_intent") def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.ProcessPaymentIntentParams"] + self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. @@ -783,19 +732,13 @@ def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_process_setup_intent( - cls, - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.ProcessSetupIntentParams"] + cls, reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. @@ -807,9 +750,6 @@ def _cls_process_setup_intent( "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -817,11 +757,7 @@ def _cls_process_setup_intent( @overload @staticmethod def process_setup_intent( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.ProcessSetupIntentParams"] + reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. @@ -830,9 +766,7 @@ def process_setup_intent( @overload def process_setup_intent( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.ProcessSetupIntentParams"] + self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. @@ -841,9 +775,7 @@ def process_setup_intent( @class_method_variant("_cls_process_setup_intent") def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.ProcessSetupIntentParams"] + self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. @@ -855,19 +787,13 @@ def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_refund_payment( - cls, - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.RefundPaymentParams"] + cls, reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader @@ -879,9 +805,6 @@ def _cls_refund_payment( "/v1/terminal/readers/{reader}/refund_payment".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -889,11 +812,7 @@ def _cls_refund_payment( @overload @staticmethod def refund_payment( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.RefundPaymentParams"] + reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader @@ -902,9 +821,7 @@ def refund_payment( @overload def refund_payment( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.RefundPaymentParams"] + self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader @@ -913,9 +830,7 @@ def refund_payment( @class_method_variant("_cls_refund_payment") def refund_payment( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.RefundPaymentParams"] + self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader @@ -927,7 +842,6 @@ def refund_payment( # pyright: ignore[reportGeneralTypeIssues] "/v1/terminal/readers/{reader}/refund_payment".format( reader=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -945,12 +859,7 @@ def retrieve( @classmethod def _cls_set_reader_display( - cls, - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.SetReaderDisplayParams"] + cls, reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. @@ -962,9 +871,6 @@ def _cls_set_reader_display( "/v1/terminal/readers/{reader}/set_reader_display".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -972,11 +878,7 @@ def _cls_set_reader_display( @overload @staticmethod def set_reader_display( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.SetReaderDisplayParams"] + reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. @@ -985,9 +887,7 @@ def set_reader_display( @overload def set_reader_display( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.SetReaderDisplayParams"] + self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. @@ -996,9 +896,7 @@ def set_reader_display( @class_method_variant("_cls_set_reader_display") def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.SetReaderDisplayParams"] + self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. @@ -1010,7 +908,6 @@ def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] "/v1/terminal/readers/{reader}/set_reader_display".format( reader=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -1022,9 +919,6 @@ class TestHelpers(APIResourceTestHelpers["Reader"]): def _cls_present_payment_method( cls, reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ @@ -1037,9 +931,6 @@ def _cls_present_payment_method( "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=util.sanitize_id(reader) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -1047,11 +938,7 @@ def _cls_present_payment_method( @overload @staticmethod def present_payment_method( - reader: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Reader.PresentPaymentMethodParams"] + reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -1060,9 +947,7 @@ def present_payment_method( @overload def present_payment_method( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.PresentPaymentMethodParams"] + self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -1071,9 +956,7 @@ def present_payment_method( @class_method_variant("_cls_present_payment_method") def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Reader.PresentPaymentMethodParams"] + self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. @@ -1085,7 +968,6 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/test_helpers/test_clock.py b/stripe/api_resources/test_helpers/test_clock.py index 72d4d3196..6cf1e4cab 100644 --- a/stripe/api_resources/test_helpers/test_clock.py +++ b/stripe/api_resources/test_helpers/test_clock.py @@ -120,12 +120,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_advance( - cls, - test_clock: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TestClock.AdvanceParams"] + cls, test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -137,9 +132,6 @@ def _cls_advance( "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=util.sanitize_id(test_clock) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -147,11 +139,7 @@ def _cls_advance( @overload @staticmethod def advance( - test_clock: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TestClock.AdvanceParams"] + test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -160,9 +148,7 @@ def advance( @overload def advance( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["TestClock.AdvanceParams"] + self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -171,9 +157,7 @@ def advance( @class_method_variant("_cls_advance") def advance( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["TestClock.AdvanceParams"] + self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. @@ -185,20 +169,12 @@ def advance( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TestClock.CreateParams"] - ) -> "TestClock": + def create(cls, **params: Unpack["TestClock.CreateParams"]) -> "TestClock": """ Creates a new test clock that can be attached to new customers and quotes. """ @@ -207,10 +183,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -262,11 +234,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TestClock.ListParams"] + cls, **params: Unpack["TestClock.ListParams"] ) -> ListObject["TestClock"]: """ Returns a list of your test clocks. @@ -274,9 +242,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/token.py b/stripe/api_resources/token.py index b1cb6eeac..008c212f7 100644 --- a/stripe/api_resources/token.py +++ b/stripe/api_resources/token.py @@ -1075,14 +1075,7 @@ class RetrieveParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Token.CreateParams"] - ) -> "Token": + def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": """ Creates a single-use token that represents a bank account's details. You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). @@ -1092,10 +1085,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) diff --git a/stripe/api_resources/topup.py b/stripe/api_resources/topup.py index 12d9b10d4..6582beeea 100644 --- a/stripe/api_resources/topup.py +++ b/stripe/api_resources/topup.py @@ -236,12 +236,7 @@ class RetrieveParams(RequestOptions): @classmethod def _cls_cancel( - cls, - topup: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Topup.CancelParams"] + cls, topup: str, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. @@ -253,33 +248,20 @@ def _cls_cancel( "/v1/topups/{topup}/cancel".format( topup=util.sanitize_id(topup) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @overload @staticmethod - def cancel( - topup: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Topup.CancelParams"] - ) -> "Topup": + def cancel(topup: str, **params: Unpack["Topup.CancelParams"]) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ ... @overload - def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Topup.CancelParams"] - ) -> "Topup": + def cancel(self, **params: Unpack["Topup.CancelParams"]) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ @@ -287,9 +269,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["Topup.CancelParams"] + self, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. @@ -301,20 +281,12 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/topups/{topup}/cancel".format( topup=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Topup.CreateParams"] - ) -> "Topup": + def create(cls, **params: Unpack["Topup.CreateParams"]) -> "Topup": """ Top up the balance of an account """ @@ -323,31 +295,18 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod - def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Topup.ListParams"] - ) -> ListObject["Topup"]: + def list(cls, **params: Unpack["Topup.ListParams"]) -> ListObject["Topup"]: """ Returns a list of top-ups. """ result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/transfer.py b/stripe/api_resources/transfer.py index e62410798..9dba9238b 100644 --- a/stripe/api_resources/transfer.py +++ b/stripe/api_resources/transfer.py @@ -278,14 +278,7 @@ class ListReversalsParams(RequestOptions): """ @classmethod - def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transfer.CreateParams"] - ) -> "Transfer": + def create(cls, **params: Unpack["Transfer.CreateParams"]) -> "Transfer": """ To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. """ @@ -294,21 +287,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transfer.ListParams"] + cls, **params: Unpack["Transfer.ListParams"] ) -> ListObject["Transfer"]: """ Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. @@ -316,9 +301,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -358,12 +340,7 @@ def retrieve( @classmethod def create_reversal( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transfer.CreateReversalParams"] + cls, id: str, **params: Unpack["Transfer.CreateReversalParams"] ) -> "Reversal": """ When you create a new reversal, you must specify a transfer to create it on. @@ -377,9 +354,6 @@ def create_reversal( cls._static_request( "post", "/v1/transfers/{id}/reversals".format(id=util.sanitize_id(id)), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -389,9 +363,6 @@ def retrieve_reversal( cls, transfer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Transfer.RetrieveReversalParams"] ) -> "Reversal": """ @@ -405,9 +376,6 @@ def retrieve_reversal( transfer=util.sanitize_id(transfer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -417,9 +385,6 @@ def modify_reversal( cls, transfer: str, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["Transfer.ModifyReversalParams"] ) -> "Reversal": """ @@ -435,21 +400,13 @@ def modify_reversal( transfer=util.sanitize_id(transfer), id=util.sanitize_id(id), ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @classmethod def list_reversals( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transfer.ListReversalsParams"] + cls, id: str, **params: Unpack["Transfer.ListReversalsParams"] ) -> ListObject["Reversal"]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. @@ -459,9 +416,6 @@ def list_reversals( cls._static_request( "get", "/v1/transfers/{id}/reversals".format(id=util.sanitize_id(id)), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/treasury/credit_reversal.py b/stripe/api_resources/treasury/credit_reversal.py index 22e6c235e..e8f382969 100644 --- a/stripe/api_resources/treasury/credit_reversal.py +++ b/stripe/api_resources/treasury/credit_reversal.py @@ -141,12 +141,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditReversal.CreateParams"] + cls, **params: Unpack["CreditReversal.CreateParams"] ) -> "CreditReversal": """ Reverses a ReceivedCredit and creates a CreditReversal object. @@ -156,21 +151,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["CreditReversal.ListParams"] + cls, **params: Unpack["CreditReversal.ListParams"] ) -> ListObject["CreditReversal"]: """ Returns a list of CreditReversals. @@ -178,9 +165,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/treasury/debit_reversal.py b/stripe/api_resources/treasury/debit_reversal.py index 2ddbcb8de..fa10bb2c8 100644 --- a/stripe/api_resources/treasury/debit_reversal.py +++ b/stripe/api_resources/treasury/debit_reversal.py @@ -157,12 +157,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["DebitReversal.CreateParams"] + cls, **params: Unpack["DebitReversal.CreateParams"] ) -> "DebitReversal": """ Reverses a ReceivedDebit and creates a DebitReversal object. @@ -172,21 +167,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["DebitReversal.ListParams"] + cls, **params: Unpack["DebitReversal.ListParams"] ) -> ListObject["DebitReversal"]: """ Returns a list of DebitReversals. @@ -194,9 +181,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/treasury/financial_account.py b/stripe/api_resources/treasury/financial_account.py index cbb037ff0..fa431e239 100644 --- a/stripe/api_resources/treasury/financial_account.py +++ b/stripe/api_resources/treasury/financial_account.py @@ -775,12 +775,7 @@ class UpdateFeaturesParamsCardIssuing(TypedDict): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["FinancialAccount.CreateParams"] + cls, **params: Unpack["FinancialAccount.CreateParams"] ) -> "FinancialAccount": """ Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. @@ -790,21 +785,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["FinancialAccount.ListParams"] + cls, **params: Unpack["FinancialAccount.ListParams"] ) -> ListObject["FinancialAccount"]: """ Returns a list of FinancialAccounts. @@ -812,9 +799,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -854,9 +838,6 @@ def retrieve( def _cls_retrieve_features( cls, financial_account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -869,9 +850,6 @@ def _cls_retrieve_features( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=util.sanitize_id(financial_account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -880,9 +858,6 @@ def _cls_retrieve_features( @staticmethod def retrieve_features( financial_account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -892,9 +867,7 @@ def retrieve_features( @overload def retrieve_features( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -903,9 +876,7 @@ def retrieve_features( @class_method_variant("_cls_retrieve_features") def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] + self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. @@ -917,7 +888,6 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -926,9 +896,6 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] def _cls_update_features( cls, financial_account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -941,9 +908,6 @@ def _cls_update_features( "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=util.sanitize_id(financial_account) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -952,9 +916,6 @@ def _cls_update_features( @staticmethod def update_features( financial_account: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ @@ -964,9 +925,7 @@ def update_features( @overload def update_features( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. @@ -975,9 +934,7 @@ def update_features( @class_method_variant("_cls_update_features") def update_features( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["FinancialAccount.UpdateFeaturesParams"] + self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. @@ -989,7 +946,6 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/treasury/inbound_transfer.py b/stripe/api_resources/treasury/inbound_transfer.py index 2f12dc60f..6aeac00b3 100644 --- a/stripe/api_resources/treasury/inbound_transfer.py +++ b/stripe/api_resources/treasury/inbound_transfer.py @@ -344,9 +344,6 @@ class SucceedParams(RequestOptions): def _cls_cancel( cls, inbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ @@ -359,9 +356,6 @@ def _cls_cancel( "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=util.sanitize_id(inbound_transfer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -369,11 +363,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - inbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.CancelParams"] + inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -382,9 +372,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.CancelParams"] + self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -393,9 +381,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.CancelParams"] + self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. @@ -407,19 +393,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.CreateParams"] + cls, **params: Unpack["InboundTransfer.CreateParams"] ) -> "InboundTransfer": """ Creates an InboundTransfer. @@ -429,21 +409,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.ListParams"] + cls, **params: Unpack["InboundTransfer.ListParams"] ) -> ListObject["InboundTransfer"]: """ Returns a list of InboundTransfers sent from the specified FinancialAccount. @@ -451,9 +423,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -481,12 +450,7 @@ class TestHelpers(APIResourceTestHelpers["InboundTransfer"]): @classmethod def _cls_fail( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.FailParams"] + cls, id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -498,9 +462,6 @@ def _cls_fail( "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -508,11 +469,7 @@ def _cls_fail( @overload @staticmethod def fail( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.FailParams"] + id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -521,9 +478,7 @@ def fail( @overload def fail( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.FailParams"] + self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -532,9 +487,7 @@ def fail( @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.FailParams"] + self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. @@ -546,7 +499,6 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -555,9 +507,6 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_inbound_transfer( cls, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] ) -> "InboundTransfer": """ @@ -570,9 +519,6 @@ def _cls_return_inbound_transfer( "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -581,9 +527,6 @@ def _cls_return_inbound_transfer( @staticmethod def return_inbound_transfer( id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] ) -> "InboundTransfer": """ @@ -594,7 +537,6 @@ def return_inbound_transfer( @overload def return_inbound_transfer( self, - idempotency_key: Optional[str] = None, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] ) -> "InboundTransfer": """ @@ -605,7 +547,6 @@ def return_inbound_transfer( @class_method_variant("_cls_return_inbound_transfer") def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, - idempotency_key: Optional[str] = None, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"] ) -> "InboundTransfer": """ @@ -618,19 +559,13 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_succeed( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.SucceedParams"] + cls, id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -642,9 +577,6 @@ def _cls_succeed( "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -652,11 +584,7 @@ def _cls_succeed( @overload @staticmethod def succeed( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["InboundTransfer.SucceedParams"] + id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -665,9 +593,7 @@ def succeed( @overload def succeed( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.SucceedParams"] + self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -676,9 +602,7 @@ def succeed( @class_method_variant("_cls_succeed") def succeed( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["InboundTransfer.SucceedParams"] + self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. @@ -690,7 +614,6 @@ def succeed( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/treasury/outbound_payment.py b/stripe/api_resources/treasury/outbound_payment.py index 1ea287aad..5e802558e 100644 --- a/stripe/api_resources/treasury/outbound_payment.py +++ b/stripe/api_resources/treasury/outbound_payment.py @@ -526,12 +526,7 @@ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): @classmethod def _cls_cancel( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.CancelParams"] + cls, id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -543,9 +538,6 @@ def _cls_cancel( "/v1/treasury/outbound_payments/{id}/cancel".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -553,11 +545,7 @@ def _cls_cancel( @overload @staticmethod def cancel( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.CancelParams"] + id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -566,9 +554,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.CancelParams"] + self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -577,9 +563,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.CancelParams"] + self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. @@ -591,19 +575,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/treasury/outbound_payments/{id}/cancel".format( id=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.CreateParams"] + cls, **params: Unpack["OutboundPayment.CreateParams"] ) -> "OutboundPayment": """ Creates an OutboundPayment. @@ -613,21 +591,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.ListParams"] + cls, **params: Unpack["OutboundPayment.ListParams"] ) -> ListObject["OutboundPayment"]: """ Returns a list of OutboundPayments sent from the specified FinancialAccount. @@ -635,9 +605,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -665,12 +632,7 @@ class TestHelpers(APIResourceTestHelpers["OutboundPayment"]): @classmethod def _cls_fail( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.FailParams"] + cls, id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -682,9 +644,6 @@ def _cls_fail( "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -692,11 +651,7 @@ def _cls_fail( @overload @staticmethod def fail( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.FailParams"] + id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -705,9 +660,7 @@ def fail( @overload def fail( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.FailParams"] + self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -716,9 +669,7 @@ def fail( @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.FailParams"] + self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. @@ -730,19 +681,13 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def _cls_post( - cls, - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.PostParams"] + cls, id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -754,9 +699,6 @@ def _cls_post( "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -764,11 +706,7 @@ def _cls_post( @overload @staticmethod def post( - id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundPayment.PostParams"] + id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -777,9 +715,7 @@ def post( @overload def post( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.PostParams"] + self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -788,9 +724,7 @@ def post( @class_method_variant("_cls_post") def post( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundPayment.PostParams"] + self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. @@ -802,7 +736,6 @@ def post( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -811,9 +744,6 @@ def post( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_payment( cls, id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] ) -> "OutboundPayment": """ @@ -826,9 +756,6 @@ def _cls_return_outbound_payment( "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=util.sanitize_id(id) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -837,9 +764,6 @@ def _cls_return_outbound_payment( @staticmethod def return_outbound_payment( id: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] ) -> "OutboundPayment": """ @@ -850,7 +774,6 @@ def return_outbound_payment( @overload def return_outbound_payment( self, - idempotency_key: Optional[str] = None, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] ) -> "OutboundPayment": """ @@ -861,7 +784,6 @@ def return_outbound_payment( @class_method_variant("_cls_return_outbound_payment") def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] self, - idempotency_key: Optional[str] = None, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"] ) -> "OutboundPayment": """ @@ -874,7 +796,6 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=util.sanitize_id(self.resource.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/treasury/outbound_transfer.py b/stripe/api_resources/treasury/outbound_transfer.py index ca76d243b..081adf0ea 100644 --- a/stripe/api_resources/treasury/outbound_transfer.py +++ b/stripe/api_resources/treasury/outbound_transfer.py @@ -363,9 +363,6 @@ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): def _cls_cancel( cls, outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ @@ -378,9 +375,6 @@ def _cls_cancel( "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=util.sanitize_id(outbound_transfer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -389,9 +383,6 @@ def _cls_cancel( @staticmethod def cancel( outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ @@ -401,9 +392,7 @@ def cancel( @overload def cancel( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.CancelParams"] + self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -412,9 +401,7 @@ def cancel( @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.CancelParams"] + self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. @@ -426,19 +413,13 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=util.sanitize_id(self.get("id")) ), - idempotency_key=idempotency_key, params=params, ), ) @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundTransfer.CreateParams"] + cls, **params: Unpack["OutboundTransfer.CreateParams"] ) -> "OutboundTransfer": """ Creates an OutboundTransfer. @@ -448,21 +429,13 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["OutboundTransfer.ListParams"] + cls, **params: Unpack["OutboundTransfer.ListParams"] ) -> ListObject["OutboundTransfer"]: """ Returns a list of OutboundTransfers sent from the specified FinancialAccount. @@ -470,9 +443,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -502,9 +472,6 @@ class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): def _cls_fail( cls, outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ @@ -517,9 +484,6 @@ def _cls_fail( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=util.sanitize_id(outbound_transfer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -528,9 +492,6 @@ def _cls_fail( @staticmethod def fail( outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ @@ -540,9 +501,7 @@ def fail( @overload def fail( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.FailParams"] + self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -551,9 +510,7 @@ def fail( @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.FailParams"] + self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. @@ -567,7 +524,6 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource.get("id") ) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -576,9 +532,6 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] def _cls_post( cls, outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ @@ -591,9 +544,6 @@ def _cls_post( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=util.sanitize_id(outbound_transfer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -602,9 +552,6 @@ def _cls_post( @staticmethod def post( outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ @@ -614,9 +561,7 @@ def post( @overload def post( - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.PostParams"] + self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -625,9 +570,7 @@ def post( @class_method_variant("_cls_post") def post( # pyright: ignore[reportGeneralTypeIssues] - self, - idempotency_key: Optional[str] = None, - **params: Unpack["OutboundTransfer.PostParams"] + self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. @@ -641,7 +584,6 @@ def post( # pyright: ignore[reportGeneralTypeIssues] self.resource.get("id") ) ), - idempotency_key=idempotency_key, params=params, ), ) @@ -650,9 +592,6 @@ def post( # pyright: ignore[reportGeneralTypeIssues] def _cls_return_outbound_transfer( cls, outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] ) -> "OutboundTransfer": """ @@ -665,9 +604,6 @@ def _cls_return_outbound_transfer( "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=util.sanitize_id(outbound_transfer) ), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) @@ -676,9 +612,6 @@ def _cls_return_outbound_transfer( @staticmethod def return_outbound_transfer( outbound_transfer: str, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] ) -> "OutboundTransfer": """ @@ -689,7 +622,6 @@ def return_outbound_transfer( @overload def return_outbound_transfer( self, - idempotency_key: Optional[str] = None, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] ) -> "OutboundTransfer": """ @@ -700,7 +632,6 @@ def return_outbound_transfer( @class_method_variant("_cls_return_outbound_transfer") def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, - idempotency_key: Optional[str] = None, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"] ) -> "OutboundTransfer": """ @@ -715,7 +646,6 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self.resource.get("id") ) ), - idempotency_key=idempotency_key, params=params, ), ) diff --git a/stripe/api_resources/treasury/received_credit.py b/stripe/api_resources/treasury/received_credit.py index acace982f..892e061a7 100644 --- a/stripe/api_resources/treasury/received_credit.py +++ b/stripe/api_resources/treasury/received_credit.py @@ -367,11 +367,7 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount( @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReceivedCredit.ListParams"] + cls, **params: Unpack["ReceivedCredit.ListParams"] ) -> ListObject["ReceivedCredit"]: """ Returns a list of ReceivedCredits. @@ -379,9 +375,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -409,11 +402,7 @@ class TestHelpers(APIResourceTestHelpers["ReceivedCredit"]): @classmethod def create( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReceivedCredit.CreateParams"] + cls, **params: Unpack["ReceivedCredit.CreateParams"] ) -> "ReceivedCredit": """ Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. @@ -423,9 +412,6 @@ def create( cls._static_request( "post", "/v1/test_helpers/treasury/received_credits", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/treasury/received_debit.py b/stripe/api_resources/treasury/received_debit.py index da49c5b0c..733c99dbe 100644 --- a/stripe/api_resources/treasury/received_debit.py +++ b/stripe/api_resources/treasury/received_debit.py @@ -316,11 +316,7 @@ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount( @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReceivedDebit.ListParams"] + cls, **params: Unpack["ReceivedDebit.ListParams"] ) -> ListObject["ReceivedDebit"]: """ Returns a list of ReceivedDebits. @@ -328,9 +324,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): @@ -358,11 +351,7 @@ class TestHelpers(APIResourceTestHelpers["ReceivedDebit"]): @classmethod def create( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["ReceivedDebit.CreateParams"] + cls, **params: Unpack["ReceivedDebit.CreateParams"] ) -> "ReceivedDebit": """ Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. @@ -372,9 +361,6 @@ def create( cls._static_request( "post", "/v1/test_helpers/treasury/received_debits", - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ), ) diff --git a/stripe/api_resources/treasury/transaction.py b/stripe/api_resources/treasury/transaction.py index 1a2899609..daaed6ff1 100644 --- a/stripe/api_resources/treasury/transaction.py +++ b/stripe/api_resources/treasury/transaction.py @@ -277,11 +277,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["Transaction.ListParams"] + cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Retrieves a list of Transaction objects. @@ -289,9 +285,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/treasury/transaction_entry.py b/stripe/api_resources/treasury/transaction_entry.py index c2a06100f..d18490dd6 100644 --- a/stripe/api_resources/treasury/transaction_entry.py +++ b/stripe/api_resources/treasury/transaction_entry.py @@ -271,11 +271,7 @@ class RetrieveParams(RequestOptions): @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["TransactionEntry.ListParams"] + cls, **params: Unpack["TransactionEntry.ListParams"] ) -> ListObject["TransactionEntry"]: """ Retrieves a list of TransactionEntry objects. @@ -283,9 +279,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject): diff --git a/stripe/api_resources/webhook_endpoint.py b/stripe/api_resources/webhook_endpoint.py index 19e00e22d..bf3abc9e9 100644 --- a/stripe/api_resources/webhook_endpoint.py +++ b/stripe/api_resources/webhook_endpoint.py @@ -404,12 +404,7 @@ class RetrieveParams(RequestOptions): @classmethod def create( - cls, - api_key: Optional[str] = None, - idempotency_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["WebhookEndpoint.CreateParams"] + cls, **params: Unpack["WebhookEndpoint.CreateParams"] ) -> "WebhookEndpoint": """ A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. @@ -419,10 +414,6 @@ def create( cls._static_request( "post", cls.class_url(), - api_key, - idempotency_key, - stripe_version, - stripe_account, params, ), ) @@ -474,11 +465,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] @classmethod def list( - cls, - api_key: Optional[str] = None, - stripe_version: Optional[str] = None, - stripe_account: Optional[str] = None, - **params: Unpack["WebhookEndpoint.ListParams"] + cls, **params: Unpack["WebhookEndpoint.ListParams"] ) -> ListObject["WebhookEndpoint"]: """ Returns a list of your webhook endpoints. @@ -486,9 +473,6 @@ def list( result = cls._static_request( "get", cls.class_url(), - api_key=api_key, - stripe_version=stripe_version, - stripe_account=stripe_account, params=params, ) if not isinstance(result, ListObject):