diff --git a/api.md b/api.md index df694e69d0b..a9e9107c5a0 100644 --- a/api.md +++ b/api.md @@ -8342,13 +8342,13 @@ Methods: Types: ```python -from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckListResponse +from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckGetResponse ``` Methods: - client.leaked_credential_checks.create(\*, zone_id, \*\*params) -> LeakedCredentialCheckCreateResponse -- client.leaked_credential_checks.list(\*, zone_id) -> LeakedCredentialCheckListResponse +- client.leaked_credential_checks.get(\*, zone_id) -> LeakedCredentialCheckGetResponse ## Detections diff --git a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py index ef96635ae76..b2e0d0c988c 100644 --- a/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py +++ b/src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py @@ -30,7 +30,7 @@ ) from ..._wrappers import ResultWrapper from ..._base_client import make_request_options -from ...types.leaked_credential_check_list_response import LeakedCredentialCheckListResponse +from ...types.leaked_credential_check_get_response import LeakedCredentialCheckGetResponse from ...types.leaked_credential_check_create_response import LeakedCredentialCheckCreateResponse __all__ = ["LeakedCredentialChecksResource", "AsyncLeakedCredentialChecksResource"] @@ -105,7 +105,7 @@ def create( cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]), ) - def list( + def get( self, *, zone_id: str, @@ -115,7 +115,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LeakedCredentialCheckListResponse: + ) -> LeakedCredentialCheckGetResponse: """ Retrieves the current status of Leaked Credential Checks @@ -139,9 +139,9 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[LeakedCredentialCheckListResponse]._unwrapper, + post_parser=ResultWrapper[LeakedCredentialCheckGetResponse]._unwrapper, ), - cast_to=cast(Type[LeakedCredentialCheckListResponse], ResultWrapper[LeakedCredentialCheckListResponse]), + cast_to=cast(Type[LeakedCredentialCheckGetResponse], ResultWrapper[LeakedCredentialCheckGetResponse]), ) @@ -214,7 +214,7 @@ async def create( cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]), ) - async def list( + async def get( self, *, zone_id: str, @@ -224,7 +224,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LeakedCredentialCheckListResponse: + ) -> LeakedCredentialCheckGetResponse: """ Retrieves the current status of Leaked Credential Checks @@ -248,9 +248,9 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[LeakedCredentialCheckListResponse]._unwrapper, + post_parser=ResultWrapper[LeakedCredentialCheckGetResponse]._unwrapper, ), - cast_to=cast(Type[LeakedCredentialCheckListResponse], ResultWrapper[LeakedCredentialCheckListResponse]), + cast_to=cast(Type[LeakedCredentialCheckGetResponse], ResultWrapper[LeakedCredentialCheckGetResponse]), ) @@ -261,8 +261,8 @@ def __init__(self, leaked_credential_checks: LeakedCredentialChecksResource) -> self.create = to_raw_response_wrapper( leaked_credential_checks.create, ) - self.list = to_raw_response_wrapper( - leaked_credential_checks.list, + self.get = to_raw_response_wrapper( + leaked_credential_checks.get, ) @cached_property @@ -277,8 +277,8 @@ def __init__(self, leaked_credential_checks: AsyncLeakedCredentialChecksResource self.create = async_to_raw_response_wrapper( leaked_credential_checks.create, ) - self.list = async_to_raw_response_wrapper( - leaked_credential_checks.list, + self.get = async_to_raw_response_wrapper( + leaked_credential_checks.get, ) @cached_property @@ -293,8 +293,8 @@ def __init__(self, leaked_credential_checks: LeakedCredentialChecksResource) -> self.create = to_streamed_response_wrapper( leaked_credential_checks.create, ) - self.list = to_streamed_response_wrapper( - leaked_credential_checks.list, + self.get = to_streamed_response_wrapper( + leaked_credential_checks.get, ) @cached_property @@ -309,8 +309,8 @@ def __init__(self, leaked_credential_checks: AsyncLeakedCredentialChecksResource self.create = async_to_streamed_response_wrapper( leaked_credential_checks.create, ) - self.list = async_to_streamed_response_wrapper( - leaked_credential_checks.list, + self.get = async_to_streamed_response_wrapper( + leaked_credential_checks.get, ) @cached_property diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index a5357be430b..4ea4d98ec3d 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -28,12 +28,10 @@ CertificateRequestType as CertificateRequestType, TokenConditionCIDRList as TokenConditionCIDRList, ) +from .leaked_credential_check_get_response import LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse from .leaked_credential_check_create_params import ( LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams, ) -from .leaked_credential_check_list_response import ( - LeakedCredentialCheckListResponse as LeakedCredentialCheckListResponse, -) from .leaked_credential_check_create_response import ( LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse, ) diff --git a/src/cloudflare/types/leaked_credential_check_list_response.py b/src/cloudflare/types/leaked_credential_check_get_response.py similarity index 71% rename from src/cloudflare/types/leaked_credential_check_list_response.py rename to src/cloudflare/types/leaked_credential_check_get_response.py index 3ab990d3a57..a6b05b32d98 100644 --- a/src/cloudflare/types/leaked_credential_check_list_response.py +++ b/src/cloudflare/types/leaked_credential_check_get_response.py @@ -4,9 +4,9 @@ from .._models import BaseModel -__all__ = ["LeakedCredentialCheckListResponse"] +__all__ = ["LeakedCredentialCheckGetResponse"] -class LeakedCredentialCheckListResponse(BaseModel): +class LeakedCredentialCheckGetResponse(BaseModel): enabled: Optional[bool] = None """Whether or not Leaked Credential Checks are enabled""" diff --git a/tests/api_resources/test_leaked_credential_checks.py b/tests/api_resources/test_leaked_credential_checks.py index 5fe8da324d7..fe08a76916f 100644 --- a/tests/api_resources/test_leaked_credential_checks.py +++ b/tests/api_resources/test_leaked_credential_checks.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types import ( - LeakedCredentialCheckListResponse, + LeakedCredentialCheckGetResponse, LeakedCredentialCheckCreateResponse, ) @@ -67,40 +67,40 @@ def test_path_params_create(self, client: Cloudflare) -> None: ) @parametrize - def test_method_list(self, client: Cloudflare) -> None: - leaked_credential_check = client.leaked_credential_checks.list( + def test_method_get(self, client: Cloudflare) -> None: + leaked_credential_check = client.leaked_credential_checks.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.leaked_credential_checks.with_raw_response.list( + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.leaked_credential_checks.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" leaked_credential_check = response.parse() - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.leaked_credential_checks.with_streaming_response.list( + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.leaked_credential_checks.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" leaked_credential_check = response.parse() - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: + def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.leaked_credential_checks.with_raw_response.list( + client.leaked_credential_checks.with_raw_response.get( zone_id="", ) @@ -155,39 +155,39 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: ) @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - leaked_credential_check = await async_client.leaked_credential_checks.list( + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + leaked_credential_check = await async_client.leaked_credential_checks.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.leaked_credential_checks.with_raw_response.list( + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.leaked_credential_checks.with_raw_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" leaked_credential_check = await response.parse() - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.leaked_credential_checks.with_streaming_response.list( + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.leaked_credential_checks.with_streaming_response.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" leaked_credential_check = await response.parse() - assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"]) + assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.leaked_credential_checks.with_raw_response.list( + await async_client.leaked_credential_checks.with_raw_response.get( zone_id="", )