Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 23, 2024
1 parent c0f7159 commit f168068
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ from cloudflare.types.zones import ActivationCheckTriggerResponse

Methods:

- <code title="put /zones/{zone_id}/activation_check">client.zones.activation_check.<a href="./src/cloudflare/resources/zones/activation_check.py">trigger</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/activation_check_trigger_response.py">ActivationCheckTriggerResponse</a></code>
- <code title="put /zones/{zone_id}/activation_check">client.zones.activation_check.<a href="./src/cloudflare/resources/zones/activation_check.py">trigger</a>(\*, zone_id) -> <a href="./src/cloudflare/types/zones/activation_check_trigger_response.py">Optional</a></code>

## DNSSettings

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

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast

import httpx

Expand Down Expand Up @@ -43,7 +43,7 @@ def trigger(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ActivationCheckTriggerResponse:
) -> Optional[ActivationCheckTriggerResponse]:
"""Triggeres a new activation check for a PENDING Zone.
This can be triggered every
Expand All @@ -69,9 +69,9 @@ def trigger(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ActivationCheckTriggerResponse]._unwrapper,
post_parser=ResultWrapper[Optional[ActivationCheckTriggerResponse]]._unwrapper,
),
cast_to=cast(Type[ActivationCheckTriggerResponse], ResultWrapper[ActivationCheckTriggerResponse]),
cast_to=cast(Type[Optional[ActivationCheckTriggerResponse]], ResultWrapper[ActivationCheckTriggerResponse]),
)


Expand All @@ -94,7 +94,7 @@ async def trigger(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ActivationCheckTriggerResponse:
) -> Optional[ActivationCheckTriggerResponse]:
"""Triggeres a new activation check for a PENDING Zone.
This can be triggered every
Expand All @@ -120,9 +120,9 @@ async def trigger(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[ActivationCheckTriggerResponse]._unwrapper,
post_parser=ResultWrapper[Optional[ActivationCheckTriggerResponse]]._unwrapper,
),
cast_to=cast(Type[ActivationCheckTriggerResponse], ResultWrapper[ActivationCheckTriggerResponse]),
cast_to=cast(Type[Optional[ActivationCheckTriggerResponse]], ResultWrapper[ActivationCheckTriggerResponse]),
)


Expand Down
14 changes: 7 additions & 7 deletions tests/api_resources/zones/test_activation_check.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 @@ -23,7 +23,7 @@ def test_method_trigger(self, client: Cloudflare) -> None:
activation_check = client.zones.activation_check.trigger(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])

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

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

activation_check = response.parse()
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -69,7 +69,7 @@ async def test_method_trigger(self, async_client: AsyncCloudflare) -> None:
activation_check = await async_client.zones.activation_check.trigger(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])

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

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

activation_check = await response.parse()
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down

0 comments on commit f168068

Please sign in to comment.