Skip to content

Commit 2b35234

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(leaked_credential_check): add terraform resource (#2229)
1 parent a369813 commit 2b35234

File tree

5 files changed

+45
-47
lines changed

5 files changed

+45
-47
lines changed

api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8342,13 +8342,13 @@ Methods:
83428342
Types:
83438343

83448344
```python
8345-
from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckListResponse
8345+
from cloudflare.types import LeakedCredentialCheckCreateResponse, LeakedCredentialCheckGetResponse
83468346
```
83478347

83488348
Methods:
83498349

83508350
- <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>
8351-
- <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>
8351+
- <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>
83528352

83538353
## Detections
83548354

src/cloudflare/resources/leaked_credential_checks/leaked_credential_checks.py

+17-17
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131
from ..._wrappers import ResultWrapper
3232
from ..._base_client import make_request_options
33-
from ...types.leaked_credential_check_list_response import LeakedCredentialCheckListResponse
33+
from ...types.leaked_credential_check_get_response import LeakedCredentialCheckGetResponse
3434
from ...types.leaked_credential_check_create_response import LeakedCredentialCheckCreateResponse
3535

3636
__all__ = ["LeakedCredentialChecksResource", "AsyncLeakedCredentialChecksResource"]
@@ -105,7 +105,7 @@ def create(
105105
cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]),
106106
)
107107

108-
def list(
108+
def get(
109109
self,
110110
*,
111111
zone_id: str,
@@ -115,7 +115,7 @@ def list(
115115
extra_query: Query | None = None,
116116
extra_body: Body | None = None,
117117
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
118-
) -> LeakedCredentialCheckListResponse:
118+
) -> LeakedCredentialCheckGetResponse:
119119
"""
120120
Retrieves the current status of Leaked Credential Checks
121121
@@ -139,9 +139,9 @@ def list(
139139
extra_query=extra_query,
140140
extra_body=extra_body,
141141
timeout=timeout,
142-
post_parser=ResultWrapper[LeakedCredentialCheckListResponse]._unwrapper,
142+
post_parser=ResultWrapper[LeakedCredentialCheckGetResponse]._unwrapper,
143143
),
144-
cast_to=cast(Type[LeakedCredentialCheckListResponse], ResultWrapper[LeakedCredentialCheckListResponse]),
144+
cast_to=cast(Type[LeakedCredentialCheckGetResponse], ResultWrapper[LeakedCredentialCheckGetResponse]),
145145
)
146146

147147

@@ -214,7 +214,7 @@ async def create(
214214
cast_to=cast(Type[LeakedCredentialCheckCreateResponse], ResultWrapper[LeakedCredentialCheckCreateResponse]),
215215
)
216216

217-
async def list(
217+
async def get(
218218
self,
219219
*,
220220
zone_id: str,
@@ -224,7 +224,7 @@ async def list(
224224
extra_query: Query | None = None,
225225
extra_body: Body | None = None,
226226
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
227-
) -> LeakedCredentialCheckListResponse:
227+
) -> LeakedCredentialCheckGetResponse:
228228
"""
229229
Retrieves the current status of Leaked Credential Checks
230230
@@ -248,9 +248,9 @@ async def list(
248248
extra_query=extra_query,
249249
extra_body=extra_body,
250250
timeout=timeout,
251-
post_parser=ResultWrapper[LeakedCredentialCheckListResponse]._unwrapper,
251+
post_parser=ResultWrapper[LeakedCredentialCheckGetResponse]._unwrapper,
252252
),
253-
cast_to=cast(Type[LeakedCredentialCheckListResponse], ResultWrapper[LeakedCredentialCheckListResponse]),
253+
cast_to=cast(Type[LeakedCredentialCheckGetResponse], ResultWrapper[LeakedCredentialCheckGetResponse]),
254254
)
255255

256256

@@ -261,8 +261,8 @@ def __init__(self, leaked_credential_checks: LeakedCredentialChecksResource) ->
261261
self.create = to_raw_response_wrapper(
262262
leaked_credential_checks.create,
263263
)
264-
self.list = to_raw_response_wrapper(
265-
leaked_credential_checks.list,
264+
self.get = to_raw_response_wrapper(
265+
leaked_credential_checks.get,
266266
)
267267

268268
@cached_property
@@ -277,8 +277,8 @@ def __init__(self, leaked_credential_checks: AsyncLeakedCredentialChecksResource
277277
self.create = async_to_raw_response_wrapper(
278278
leaked_credential_checks.create,
279279
)
280-
self.list = async_to_raw_response_wrapper(
281-
leaked_credential_checks.list,
280+
self.get = async_to_raw_response_wrapper(
281+
leaked_credential_checks.get,
282282
)
283283

284284
@cached_property
@@ -293,8 +293,8 @@ def __init__(self, leaked_credential_checks: LeakedCredentialChecksResource) ->
293293
self.create = to_streamed_response_wrapper(
294294
leaked_credential_checks.create,
295295
)
296-
self.list = to_streamed_response_wrapper(
297-
leaked_credential_checks.list,
296+
self.get = to_streamed_response_wrapper(
297+
leaked_credential_checks.get,
298298
)
299299

300300
@cached_property
@@ -309,8 +309,8 @@ def __init__(self, leaked_credential_checks: AsyncLeakedCredentialChecksResource
309309
self.create = async_to_streamed_response_wrapper(
310310
leaked_credential_checks.create,
311311
)
312-
self.list = async_to_streamed_response_wrapper(
313-
leaked_credential_checks.list,
312+
self.get = async_to_streamed_response_wrapper(
313+
leaked_credential_checks.get,
314314
)
315315

316316
@cached_property

src/cloudflare/types/__init__.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@
2828
CertificateRequestType as CertificateRequestType,
2929
TokenConditionCIDRList as TokenConditionCIDRList,
3030
)
31+
from .leaked_credential_check_get_response import LeakedCredentialCheckGetResponse as LeakedCredentialCheckGetResponse
3132
from .leaked_credential_check_create_params import (
3233
LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams,
3334
)
34-
from .leaked_credential_check_list_response import (
35-
LeakedCredentialCheckListResponse as LeakedCredentialCheckListResponse,
36-
)
3735
from .leaked_credential_check_create_response import (
3836
LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse,
3937
)

src/cloudflare/types/leaked_credential_check_list_response.py src/cloudflare/types/leaked_credential_check_get_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
from .._models import BaseModel
66

7-
__all__ = ["LeakedCredentialCheckListResponse"]
7+
__all__ = ["LeakedCredentialCheckGetResponse"]
88

99

10-
class LeakedCredentialCheckListResponse(BaseModel):
10+
class LeakedCredentialCheckGetResponse(BaseModel):
1111
enabled: Optional[bool] = None
1212
"""Whether or not Leaked Credential Checks are enabled"""

tests/api_resources/test_leaked_credential_checks.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from cloudflare import Cloudflare, AsyncCloudflare
1111
from tests.utils import assert_matches_type
1212
from cloudflare.types import (
13-
LeakedCredentialCheckListResponse,
13+
LeakedCredentialCheckGetResponse,
1414
LeakedCredentialCheckCreateResponse,
1515
)
1616

@@ -67,40 +67,40 @@ def test_path_params_create(self, client: Cloudflare) -> None:
6767
)
6868

6969
@parametrize
70-
def test_method_list(self, client: Cloudflare) -> None:
71-
leaked_credential_check = client.leaked_credential_checks.list(
70+
def test_method_get(self, client: Cloudflare) -> None:
71+
leaked_credential_check = client.leaked_credential_checks.get(
7272
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
7373
)
74-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
74+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
7575

7676
@parametrize
77-
def test_raw_response_list(self, client: Cloudflare) -> None:
78-
response = client.leaked_credential_checks.with_raw_response.list(
77+
def test_raw_response_get(self, client: Cloudflare) -> None:
78+
response = client.leaked_credential_checks.with_raw_response.get(
7979
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
8080
)
8181

8282
assert response.is_closed is True
8383
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
8484
leaked_credential_check = response.parse()
85-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
85+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
8686

8787
@parametrize
88-
def test_streaming_response_list(self, client: Cloudflare) -> None:
89-
with client.leaked_credential_checks.with_streaming_response.list(
88+
def test_streaming_response_get(self, client: Cloudflare) -> None:
89+
with client.leaked_credential_checks.with_streaming_response.get(
9090
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
9191
) as response:
9292
assert not response.is_closed
9393
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
9494

9595
leaked_credential_check = response.parse()
96-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
96+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
9797

9898
assert cast(Any, response.is_closed) is True
9999

100100
@parametrize
101-
def test_path_params_list(self, client: Cloudflare) -> None:
101+
def test_path_params_get(self, client: Cloudflare) -> None:
102102
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
103-
client.leaked_credential_checks.with_raw_response.list(
103+
client.leaked_credential_checks.with_raw_response.get(
104104
zone_id="",
105105
)
106106

@@ -155,39 +155,39 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None:
155155
)
156156

157157
@parametrize
158-
async def test_method_list(self, async_client: AsyncCloudflare) -> None:
159-
leaked_credential_check = await async_client.leaked_credential_checks.list(
158+
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
159+
leaked_credential_check = await async_client.leaked_credential_checks.get(
160160
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
161161
)
162-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
162+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
163163

164164
@parametrize
165-
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
166-
response = await async_client.leaked_credential_checks.with_raw_response.list(
165+
async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
166+
response = await async_client.leaked_credential_checks.with_raw_response.get(
167167
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
168168
)
169169

170170
assert response.is_closed is True
171171
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
172172
leaked_credential_check = await response.parse()
173-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
173+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
174174

175175
@parametrize
176-
async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
177-
async with async_client.leaked_credential_checks.with_streaming_response.list(
176+
async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
177+
async with async_client.leaked_credential_checks.with_streaming_response.get(
178178
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
179179
) as response:
180180
assert not response.is_closed
181181
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
182182

183183
leaked_credential_check = await response.parse()
184-
assert_matches_type(LeakedCredentialCheckListResponse, leaked_credential_check, path=["response"])
184+
assert_matches_type(LeakedCredentialCheckGetResponse, leaked_credential_check, path=["response"])
185185

186186
assert cast(Any, response.is_closed) is True
187187

188188
@parametrize
189-
async def test_path_params_list(self, async_client: AsyncCloudflare) -> None:
189+
async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
190190
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
191-
await async_client.leaked_credential_checks.with_raw_response.list(
191+
await async_client.leaked_credential_checks.with_raw_response.get(
192192
zone_id="",
193193
)

0 commit comments

Comments
 (0)