diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 7cf5bc38e..97cee5c2e 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -43,7 +43,6 @@ from stripe._base_address import BaseAddress from stripe._api_mode import ApiMode -from stripe import _util if TYPE_CHECKING: from stripe._stripe_object import StripeObject @@ -143,13 +142,6 @@ def _global_with_options( ) -> "APIRequestor": return APIRequestor._global_instance()._replace_options(params) - @classmethod - @_util.deprecated( - "This method is internal to stripe-python and the public interface will be removed in a future stripe-python version" - ) - def format_app_info(cls, info): - return cls._format_app_info(info) - @classmethod def _format_app_info(cls, info): str = info["name"] diff --git a/stripe/_error.py b/stripe/_error.py index 39bbc6503..c86ce0e1c 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -4,9 +4,6 @@ import stripe # noqa: IMP101 from stripe._error_object import ErrorObject -from stripe import _util -import warnings - class StripeError(Exception): _message: Optional[str] @@ -71,10 +68,7 @@ def __repr__(self): self.request_id, ) - @_util.deprecated( - "For internal stripe-python use only. The public interface will be removed in a future version." - ) - def construct_error_object(self) -> Optional[ErrorObject]: + def _construct_error_object(self) -> Optional[ErrorObject]: if ( self.json_body is None or not isinstance(self.json_body, dict) @@ -89,11 +83,6 @@ def construct_error_object(self) -> Optional[ErrorObject]: api_mode="V1", ) - def _construct_error_object(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - return self.construct_error_object() - class APIError(StripeError): pass diff --git a/stripe/_list_object.py b/stripe/_list_object.py index 554fad608..bfd1a5a37 100644 --- a/stripe/_list_object.py +++ b/stripe/_list_object.py @@ -142,16 +142,6 @@ def auto_paging_iter(self) -> Iterator[T]: if page.is_empty: break - @classmethod - @_util.deprecated( - "This method is for internal stripe-python use only. The public interface will be removed in a future version." - ) - def empty_list( - cls, - **params: Unpack[RequestOptions], - ) -> Self: - return cls._empty_list(**params) - @classmethod def _empty_list( cls, diff --git a/stripe/_search_result_object.py b/stripe/_search_result_object.py index 6f71492ca..862ebda4f 100644 --- a/stripe/_search_result_object.py +++ b/stripe/_search_result_object.py @@ -97,18 +97,6 @@ def _empty_search_result( api_mode="V1", ) - @classmethod - @_util.deprecated( - "For internal stripe-python use only. This will be removed in a future version." - ) - def empty_search_result( - cls, - **params: Unpack[RequestOptions], - ) -> Self: - return cls._empty_search_result( - **params, - ) - @property def is_empty(self) -> bool: return not self.data diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index f67d7887a..fe909f505 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -84,12 +84,6 @@ def default(self, o: Any) -> Any: return _encode_datetime(o) return super(StripeObject._ReprJSONEncoder, self).default(o) - @_util.deprecated( - "For internal stripe-python use only. The public interface will be removed in a future version" - ) - class ReprJSONEncoder(_ReprJSONEncoder): - pass - _retrieve_params: Mapping[str, Any] _previous: Optional[Mapping[str, Any]] @@ -376,13 +370,6 @@ def _refresh_from( self._previous = values - @classmethod - @_util.deprecated( - "This will be removed in a future version of stripe-python." - ) - def api_base(cls) -> Optional[str]: - return None - @_util.deprecated( "This will be removed in a future version of stripe-python." ) diff --git a/stripe/oauth_error.py b/stripe/oauth_error.py index a97019a25..d646eb538 100644 --- a/stripe/oauth_error.py +++ b/stripe/oauth_error.py @@ -17,7 +17,7 @@ def __init__( description, http_body, http_status, json_body, headers, code ) - def construct_error_object(self): + def _construct_error_object(self): if self.json_body is None: return None diff --git a/tests/api_resources/test_list_object.py b/tests/api_resources/test_list_object.py index 48d7c4df3..72aa8dc11 100644 --- a/tests/api_resources/test_list_object.py +++ b/tests/api_resources/test_list_object.py @@ -90,7 +90,7 @@ def test_is_empty(self): assert lo.is_empty is True def test_empty_list(self): - lo = stripe.ListObject.empty_list() + lo = stripe.ListObject._empty_list() assert lo.is_empty def test_iter(self): @@ -176,7 +176,7 @@ def test_next_page_empty_list(self): ) next_lo = lo.next_page() - assert next_lo == stripe.ListObject.empty_list() + assert next_lo == stripe.ListObject._empty_list() def test_prev_page(self, http_client_mock): lo = stripe.ListObject.construct_from( diff --git a/tests/api_resources/test_search_result_object.py b/tests/api_resources/test_search_result_object.py index c61c3305e..c77abf467 100644 --- a/tests/api_resources/test_search_result_object.py +++ b/tests/api_resources/test_search_result_object.py @@ -47,7 +47,7 @@ def test_is_empty(self): assert sro.is_empty is True def test_empty_search_result(self): - sro = stripe.SearchResultObject.empty_search_result() + sro = stripe.SearchResultObject._empty_search_result() assert sro.is_empty def test_iter(self): @@ -149,7 +149,7 @@ def test_next_search_result_page_empty_search_result(self): ) next_sro = sro.next_search_result_page() - assert next_sro == stripe.SearchResultObject.empty_search_result() + assert next_sro == stripe.SearchResultObject._empty_search_result() def test_serialize_empty_search_result(self): empty = stripe.SearchResultObject.construct_from(