Skip to content

Commit 81d95a5

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#333)
1 parent 8b4c1a0 commit 81d95a5

File tree

5 files changed

+75
-3
lines changed

5 files changed

+75
-3
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1994,7 +1994,7 @@ Methods:
19941994

19951995
- <code title="post /zones/{zone_id}/healthchecks">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/healthchecks/healthcheck_create_params.py">params</a>) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">Healthcheck</a></code>
19961996
- <code title="put /zones/{zone_id}/healthchecks/{healthcheck_id}">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">update</a>(healthcheck_id, \*, zone_id, \*\*<a href="src/cloudflare/types/healthchecks/healthcheck_update_params.py">params</a>) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">Healthcheck</a></code>
1997-
- <code title="get /zones/{zone_id}/healthchecks">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">list</a>(\*, zone_id) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">SyncSinglePage[Healthcheck]</a></code>
1997+
- <code title="get /zones/{zone_id}/healthchecks">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/healthchecks/healthcheck_list_params.py">params</a>) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">SyncSinglePage[Healthcheck]</a></code>
19981998
- <code title="delete /zones/{zone_id}/healthchecks/{healthcheck_id}">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">delete</a>(healthcheck_id, \*, zone_id, \*\*<a href="src/cloudflare/types/healthchecks/healthcheck_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/healthchecks/healthcheck_delete_response.py">HealthcheckDeleteResponse</a></code>
19991999
- <code title="patch /zones/{zone_id}/healthchecks/{healthcheck_id}">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">edit</a>(healthcheck_id, \*, zone_id, \*\*<a href="src/cloudflare/types/healthchecks/healthcheck_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">Healthcheck</a></code>
20002000
- <code title="get /zones/{zone_id}/healthchecks/{healthcheck_id}">client.healthchecks.<a href="./src/cloudflare/resources/healthchecks/healthchecks.py">get</a>(healthcheck_id, \*, zone_id) -> <a href="./src/cloudflare/types/healthchecks/healthcheck.py">Healthcheck</a></code>

src/cloudflare/resources/healthchecks/healthchecks.py

+35-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
HTTPConfigurationParam,
4141
HealthcheckDeleteResponse,
4242
healthcheck_edit_params,
43+
healthcheck_list_params,
4344
healthcheck_create_params,
4445
healthcheck_delete_params,
4546
healthcheck_update_params,
@@ -278,6 +279,8 @@ def list(
278279
self,
279280
*,
280281
zone_id: str,
282+
page: object | NotGiven = NOT_GIVEN,
283+
per_page: object | NotGiven = NOT_GIVEN,
281284
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
282285
# The extra values given here take precedence over values defined on the client or passed to this method.
283286
extra_headers: Headers | None = None,
@@ -291,6 +294,10 @@ def list(
291294
Args:
292295
zone_id: Identifier
293296
297+
page: Page number of paginated results.
298+
299+
per_page: Maximum number of results per page. Must be a multiple of 5.
300+
294301
extra_headers: Send extra headers
295302
296303
extra_query: Add additional query parameters to the request
@@ -305,7 +312,17 @@ def list(
305312
f"/zones/{zone_id}/healthchecks",
306313
page=SyncSinglePage[Healthcheck],
307314
options=make_request_options(
308-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
315+
extra_headers=extra_headers,
316+
extra_query=extra_query,
317+
extra_body=extra_body,
318+
timeout=timeout,
319+
query=maybe_transform(
320+
{
321+
"page": page,
322+
"per_page": per_page,
323+
},
324+
healthcheck_list_params.HealthcheckListParams,
325+
),
309326
),
310327
model=Healthcheck,
311328
)
@@ -740,6 +757,8 @@ def list(
740757
self,
741758
*,
742759
zone_id: str,
760+
page: object | NotGiven = NOT_GIVEN,
761+
per_page: object | NotGiven = NOT_GIVEN,
743762
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
744763
# The extra values given here take precedence over values defined on the client or passed to this method.
745764
extra_headers: Headers | None = None,
@@ -753,6 +772,10 @@ def list(
753772
Args:
754773
zone_id: Identifier
755774
775+
page: Page number of paginated results.
776+
777+
per_page: Maximum number of results per page. Must be a multiple of 5.
778+
756779
extra_headers: Send extra headers
757780
758781
extra_query: Add additional query parameters to the request
@@ -767,7 +790,17 @@ def list(
767790
f"/zones/{zone_id}/healthchecks",
768791
page=AsyncSinglePage[Healthcheck],
769792
options=make_request_options(
770-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
793+
extra_headers=extra_headers,
794+
extra_query=extra_query,
795+
extra_body=extra_body,
796+
timeout=timeout,
797+
query=maybe_transform(
798+
{
799+
"page": page,
800+
"per_page": per_page,
801+
},
802+
healthcheck_list_params.HealthcheckListParams,
803+
),
771804
),
772805
model=Healthcheck,
773806
)

src/cloudflare/types/healthchecks/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .preview_create_params import PreviewCreateParams as PreviewCreateParams
1010
from .preview_delete_params import PreviewDeleteParams as PreviewDeleteParams
1111
from .healthcheck_edit_params import HealthcheckEditParams as HealthcheckEditParams
12+
from .healthcheck_list_params import HealthcheckListParams as HealthcheckListParams
1213
from .preview_delete_response import PreviewDeleteResponse as PreviewDeleteResponse
1314
from .tcp_configuration_param import TCPConfigurationParam as TCPConfigurationParam
1415
from .http_configuration_param import HTTPConfigurationParam as HTTPConfigurationParam
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["HealthcheckListParams"]
8+
9+
10+
class HealthcheckListParams(TypedDict, total=False):
11+
zone_id: Required[str]
12+
"""Identifier"""
13+
14+
page: object
15+
"""Page number of paginated results."""
16+
17+
per_page: object
18+
"""Maximum number of results per page. Must be a multiple of 5."""

tests/api_resources/test_healthchecks.py

+20
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ def test_method_list(self, client: Cloudflare) -> None:
214214
)
215215
assert_matches_type(SyncSinglePage[Healthcheck], healthcheck, path=["response"])
216216

217+
@pytest.mark.skip()
218+
@parametrize
219+
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
220+
healthcheck = client.healthchecks.list(
221+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
222+
page={},
223+
per_page={},
224+
)
225+
assert_matches_type(SyncSinglePage[Healthcheck], healthcheck, path=["response"])
226+
217227
@pytest.mark.skip()
218228
@parametrize
219229
def test_raw_response_list(self, client: Cloudflare) -> None:
@@ -653,6 +663,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
653663
)
654664
assert_matches_type(AsyncSinglePage[Healthcheck], healthcheck, path=["response"])
655665

666+
@pytest.mark.skip()
667+
@parametrize
668+
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
669+
healthcheck = await async_client.healthchecks.list(
670+
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
671+
page={},
672+
per_page={},
673+
)
674+
assert_matches_type(AsyncSinglePage[Healthcheck], healthcheck, path=["response"])
675+
656676
@pytest.mark.skip()
657677
@parametrize
658678
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:

0 commit comments

Comments
 (0)