Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #333

Merged
merged 1 commit into from
Apr 16, 2024
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
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>
Expand Down
37 changes: 35 additions & 2 deletions src/cloudflare/resources/healthchecks/healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
HTTPConfigurationParam,
HealthcheckDeleteResponse,
healthcheck_edit_params,
healthcheck_list_params,
healthcheck_create_params,
healthcheck_delete_params,
healthcheck_update_params,
Expand Down Expand Up @@ -278,6 +279,8 @@ def list(
self,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -291,6 +294,10 @@ def list(
Args:
zone_id: Identifier

page: Page number of paginated results.

per_page: Maximum number of results per page. Must be a multiple of 5.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -305,7 +312,17 @@ def list(
f"/zones/{zone_id}/healthchecks",
page=SyncSinglePage[Healthcheck],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
healthcheck_list_params.HealthcheckListParams,
),
),
model=Healthcheck,
)
Expand Down Expand Up @@ -740,6 +757,8 @@ def list(
self,
*,
zone_id: str,
page: object | NotGiven = NOT_GIVEN,
per_page: object | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -753,6 +772,10 @@ def list(
Args:
zone_id: Identifier

page: Page number of paginated results.

per_page: Maximum number of results per page. Must be a multiple of 5.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -767,7 +790,17 @@ def list(
f"/zones/{zone_id}/healthchecks",
page=AsyncSinglePage[Healthcheck],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{
"page": page,
"per_page": per_page,
},
healthcheck_list_params.HealthcheckListParams,
),
),
model=Healthcheck,
)
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/healthchecks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .preview_create_params import PreviewCreateParams as PreviewCreateParams
from .preview_delete_params import PreviewDeleteParams as PreviewDeleteParams
from .healthcheck_edit_params import HealthcheckEditParams as HealthcheckEditParams
from .healthcheck_list_params import HealthcheckListParams as HealthcheckListParams
from .preview_delete_response import PreviewDeleteResponse as PreviewDeleteResponse
from .tcp_configuration_param import TCPConfigurationParam as TCPConfigurationParam
from .http_configuration_param import HTTPConfigurationParam as HTTPConfigurationParam
Expand Down
18 changes: 18 additions & 0 deletions src/cloudflare/types/healthchecks/healthcheck_list_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Required, TypedDict

__all__ = ["HealthcheckListParams"]


class HealthcheckListParams(TypedDict, total=False):
zone_id: Required[str]
"""Identifier"""

page: object
"""Page number of paginated results."""

per_page: object
"""Maximum number of results per page. Must be a multiple of 5."""
20 changes: 20 additions & 0 deletions tests/api_resources/test_healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ def test_method_list(self, client: Cloudflare) -> None:
)
assert_matches_type(SyncSinglePage[Healthcheck], healthcheck, path=["response"])

@pytest.mark.skip()
@parametrize
def test_method_list_with_all_params(self, client: Cloudflare) -> None:
healthcheck = client.healthchecks.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(SyncSinglePage[Healthcheck], healthcheck, path=["response"])

@pytest.mark.skip()
@parametrize
def test_raw_response_list(self, client: Cloudflare) -> None:
Expand Down Expand Up @@ -653,6 +663,16 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(AsyncSinglePage[Healthcheck], healthcheck, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None:
healthcheck = await async_client.healthchecks.list(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
page={},
per_page={},
)
assert_matches_type(AsyncSinglePage[Healthcheck], healthcheck, path=["response"])

@pytest.mark.skip()
@parametrize
async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
Expand Down