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 #351

Merged
merged 1 commit into from
Apr 22, 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
6 changes: 3 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1713,9 +1713,9 @@ from cloudflare.types.dnssec import DNSSEC, DNSSECDeleteResponse

Methods:

- <code title="delete /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">delete</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dnssec/dnssec_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/dnssec/dnssec_delete_response.py">DNSSECDeleteResponse</a></code>
- <code title="patch /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dnssec/dnssec_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">DNSSEC</a></code>
- <code title="get /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">DNSSEC</a></code>
- <code title="delete /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">delete</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dnssec/dnssec_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/dnssec/dnssec_delete_response.py">Optional</a></code>
- <code title="patch /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dnssec/dnssec_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">Optional</a></code>
- <code title="get /zones/{zone_id}/dnssec">client.dnssec.<a href="./src/cloudflare/resources/dnssec.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/dnssec/dnssec.py">Optional</a></code>

# EmailRouting

Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/dnssec.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Type, cast
from typing import Any, Type, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -49,7 +49,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSECDeleteResponse:
) -> Optional[DNSSECDeleteResponse]:
"""
Delete DNSSEC.

Expand All @@ -67,7 +67,7 @@ def delete(
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
DNSSECDeleteResponse,
Optional[DNSSECDeleteResponse],
self._delete(
f"/zones/{zone_id}/dnssec",
body=maybe_transform(body, dnssec_delete_params.DNSSECDeleteParams),
Expand All @@ -76,7 +76,7 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSECDeleteResponse]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSECDeleteResponse]]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[DNSSECDeleteResponse]
Expand All @@ -97,7 +97,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSEC:
) -> Optional[DNSSEC]:
"""
Enable or disable DNSSEC.

Expand Down Expand Up @@ -148,9 +148,9 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSEC]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSEC]]._unwrapper,
),
cast_to=cast(Type[DNSSEC], ResultWrapper[DNSSEC]),
cast_to=cast(Type[Optional[DNSSEC]], ResultWrapper[DNSSEC]),
)

def get(
Expand All @@ -163,7 +163,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSEC:
) -> Optional[DNSSEC]:
"""
Details about DNSSEC status and configuration.

Expand All @@ -187,9 +187,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSEC]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSEC]]._unwrapper,
),
cast_to=cast(Type[DNSSEC], ResultWrapper[DNSSEC]),
cast_to=cast(Type[Optional[DNSSEC]], ResultWrapper[DNSSEC]),
)


Expand All @@ -213,7 +213,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSECDeleteResponse:
) -> Optional[DNSSECDeleteResponse]:
"""
Delete DNSSEC.

Expand All @@ -231,7 +231,7 @@ async def delete(
if not zone_id:
raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
return cast(
DNSSECDeleteResponse,
Optional[DNSSECDeleteResponse],
await self._delete(
f"/zones/{zone_id}/dnssec",
body=await async_maybe_transform(body, dnssec_delete_params.DNSSECDeleteParams),
Expand All @@ -240,7 +240,7 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSECDeleteResponse]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSECDeleteResponse]]._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[DNSSECDeleteResponse]
Expand All @@ -261,7 +261,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSEC:
) -> Optional[DNSSEC]:
"""
Enable or disable DNSSEC.

Expand Down Expand Up @@ -312,9 +312,9 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSEC]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSEC]]._unwrapper,
),
cast_to=cast(Type[DNSSEC], ResultWrapper[DNSSEC]),
cast_to=cast(Type[Optional[DNSSEC]], ResultWrapper[DNSSEC]),
)

async def get(
Expand All @@ -327,7 +327,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DNSSEC:
) -> Optional[DNSSEC]:
"""
Details about DNSSEC status and configuration.

Expand All @@ -351,9 +351,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[DNSSEC]._unwrapper,
post_parser=ResultWrapper[Optional[DNSSEC]]._unwrapper,
),
cast_to=cast(Type[DNSSEC], ResultWrapper[DNSSEC]),
cast_to=cast(Type[Optional[DNSSEC]], ResultWrapper[DNSSEC]),
)


Expand Down
42 changes: 21 additions & 21 deletions tests/api_resources/test_dnssec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import os
from typing import Any, cast
from typing import Any, Optional, cast

import pytest

Expand All @@ -24,7 +24,7 @@ def test_method_delete(self, client: Cloudflare) -> None:
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
)
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -37,7 +37,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = response.parse()
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -50,7 +50,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = response.parse()
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -69,7 +69,7 @@ def test_method_edit(self, client: Cloudflare) -> None:
dnssec = client.dnssec.edit(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -80,7 +80,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
dnssec_presigned=True,
status="active",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -92,7 +92,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -104,7 +104,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -122,7 +122,7 @@ def test_method_get(self, client: Cloudflare) -> None:
dnssec = client.dnssec.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -134,7 +134,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -146,7 +146,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -169,7 +169,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
body={},
)
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -182,7 +182,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = await response.parse()
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -195,7 +195,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) ->
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = await response.parse()
assert_matches_type(DNSSECDeleteResponse, dnssec, path=["response"])
assert_matches_type(Optional[DNSSECDeleteResponse], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -214,7 +214,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
dnssec = await async_client.dnssec.edit(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -225,7 +225,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare)
dnssec_presigned=True,
status="active",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -237,7 +237,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = await response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -249,7 +249,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = await response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -267,7 +267,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
dnssec = await async_client.dnssec.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -279,7 +279,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
dnssec = await response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -291,7 +291,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

dnssec = await response.parse()
assert_matches_type(DNSSEC, dnssec, path=["response"])
assert_matches_type(Optional[DNSSEC], dnssec, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down