Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8342,13 +8342,13 @@ Methods:
Types:

```python
from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckListResponse
from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckGetResponse
```

Methods:

- <code title="post /zones/{zone_id}/leaked-credential-checks">client.leaked_credential_checks.<a href="./src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/leaked_credential_check_create_params.py">params</a>) -> <a href="./src/cloudflare/types/leaked_credential_check_create_response.py">LeakedCredentialCheckCreateResponse</a></code>
- <code title="get /zones/{zone_id}/leaked-credential-checks">client.leaked_credential_checks.<a href="./src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py">list</a>(\*, zone_id) -> <a href="./src/cloudflare/types/leaked_credential_check_list_response.py">LeakedCredentialCheckListResponse</a></code>
- <code title="get /zones/{zone_id}/leaked-credential-checks">client.leaked_credential_checks.<a href="./src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/leaked_credential_check_get_response.py">LeakedCredentialCheckGetResponse</a></code>

## Detections

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -105,7 +105,7 @@ def create(
cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]),
)

def list(
def get(
self,
*,
zone_id: str,
Expand All @@ -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

Expand All @@ -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]),
)


Expand Down Expand Up @@ -214,7 +214,7 @@ async def create(
cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]),
)

async def list(
async def get(
self,
*,
zone_id: str,
Expand All @@ -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

Expand All @@ -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]),
)


Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 1 addition & 3 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
46 changes: 23 additions & 23 deletions tests/api_resources/test_leaked_credential_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.types import (
LeakedCredentialCheckListResponse,
LeakedCredentialCheckGetResponse,
LeakedCredentialCheckCreateResponse,
)

Expand Down Expand Up @@ -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="",
)

Expand Down Expand Up @@ -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="",
)