Skip to content

Commit f168068

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#355)
1 parent c0f7159 commit f168068

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ from cloudflare.types.zones import ActivationCheckTriggerResponse
292292

293293
Methods:
294294

295-
- <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>
295+
- <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>
296296

297297
## DNSSettings
298298

src/cloudflare/resources/zones/activation_check.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, cast
5+
from typing import Type, Optional, cast
66

77
import httpx
88

@@ -43,7 +43,7 @@ def trigger(
4343
extra_query: Query | None = None,
4444
extra_body: Body | None = None,
4545
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
46-
) -> ActivationCheckTriggerResponse:
46+
) -> Optional[ActivationCheckTriggerResponse]:
4747
"""Triggeres a new activation check for a PENDING Zone.
4848
4949
This can be triggered every
@@ -69,9 +69,9 @@ def trigger(
6969
extra_query=extra_query,
7070
extra_body=extra_body,
7171
timeout=timeout,
72-
post_parser=ResultWrapper[ActivationCheckTriggerResponse]._unwrapper,
72+
post_parser=ResultWrapper[Optional[ActivationCheckTriggerResponse]]._unwrapper,
7373
),
74-
cast_to=cast(Type[ActivationCheckTriggerResponse], ResultWrapper[ActivationCheckTriggerResponse]),
74+
cast_to=cast(Type[Optional[ActivationCheckTriggerResponse]], ResultWrapper[ActivationCheckTriggerResponse]),
7575
)
7676

7777

@@ -94,7 +94,7 @@ async def trigger(
9494
extra_query: Query | None = None,
9595
extra_body: Body | None = None,
9696
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
97-
) -> ActivationCheckTriggerResponse:
97+
) -> Optional[ActivationCheckTriggerResponse]:
9898
"""Triggeres a new activation check for a PENDING Zone.
9999
100100
This can be triggered every
@@ -120,9 +120,9 @@ async def trigger(
120120
extra_query=extra_query,
121121
extra_body=extra_body,
122122
timeout=timeout,
123-
post_parser=ResultWrapper[ActivationCheckTriggerResponse]._unwrapper,
123+
post_parser=ResultWrapper[Optional[ActivationCheckTriggerResponse]]._unwrapper,
124124
),
125-
cast_to=cast(Type[ActivationCheckTriggerResponse], ResultWrapper[ActivationCheckTriggerResponse]),
125+
cast_to=cast(Type[Optional[ActivationCheckTriggerResponse]], ResultWrapper[ActivationCheckTriggerResponse]),
126126
)
127127

128128

tests/api_resources/zones/test_activation_check.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import Any, cast
6+
from typing import Any, Optional, cast
77

88
import pytest
99

@@ -23,7 +23,7 @@ def test_method_trigger(self, client: Cloudflare) -> None:
2323
activation_check = client.zones.activation_check.trigger(
2424
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
2525
)
26-
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
26+
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])
2727

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

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

4949
activation_check = response.parse()
50-
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
50+
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])
5151

5252
assert cast(Any, response.is_closed) is True
5353

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

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

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

9595
activation_check = await response.parse()
96-
assert_matches_type(ActivationCheckTriggerResponse, activation_check, path=["response"])
96+
assert_matches_type(Optional[ActivationCheckTriggerResponse], activation_check, path=["response"])
9797

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

0 commit comments

Comments
 (0)