Skip to content

Commit 8766ffb

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#318)
1 parent e553303 commit 8766ffb

File tree

9 files changed

+60
-60
lines changed

9 files changed

+60
-60
lines changed

api.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ from cloudflare.types.dns.analytics import Report
16471647

16481648
Methods:
16491649

1650-
- <code title="get /zones/{zone_id}/dns_analytics/report">client.dns.analytics.reports.<a href="./src/cloudflare/resources/dns/analytics/reports/reports.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Report</a></code>
1650+
- <code title="get /zones/{zone_id}/dns_analytics/report">client.dns.analytics.reports.<a href="./src/cloudflare/resources/dns/analytics/reports/reports.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Optional</a></code>
16511651

16521652
#### Bytimes
16531653

@@ -1659,7 +1659,7 @@ from cloudflare.types.dns.analytics.reports import ByTime
16591659

16601660
Methods:
16611661

1662-
- <code title="get /zones/{zone_id}/dns_analytics/report/bytime">client.dns.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/analytics/reports/bytimes.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">ByTime</a></code>
1662+
- <code title="get /zones/{zone_id}/dns_analytics/report/bytime">client.dns.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/analytics/reports/bytimes.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">Optional</a></code>
16631663

16641664
## FirewallResource
16651665

@@ -1689,13 +1689,13 @@ Methods:
16891689

16901690
Methods:
16911691

1692-
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report">client.dns.firewall.analytics.reports.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/reports.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Report</a></code>
1692+
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report">client.dns.firewall.analytics.reports.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/reports.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Optional</a></code>
16931693

16941694
##### Bytimes
16951695

16961696
Methods:
16971697

1698-
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report/bytime">client.dns.firewall.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">ByTime</a></code>
1698+
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report/bytime">client.dns.firewall.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">Optional</a></code>
16991699

17001700
# DNSSECResource
17011701

src/cloudflare/resources/dns/analytics/reports/bytimes.py

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

33
from __future__ import annotations
44

5-
from typing import Type, Union, cast
5+
from typing import Type, Union, Optional, cast
66
from datetime import datetime
77
from typing_extensions import Literal
88

@@ -58,7 +58,7 @@ def get(
5858
extra_query: Query | None = None,
5959
extra_body: Body | None = None,
6060
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61-
) -> ByTime:
61+
) -> Optional[ByTime]:
6262
"""
6363
Retrieves a list of aggregate metrics grouped by time interval.
6464
@@ -118,7 +118,7 @@ def get(
118118
),
119119
post_parser=ResultWrapper._unwrapper,
120120
),
121-
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
121+
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
122122
)
123123

124124

@@ -150,7 +150,7 @@ async def get(
150150
extra_query: Query | None = None,
151151
extra_body: Body | None = None,
152152
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
153-
) -> ByTime:
153+
) -> Optional[ByTime]:
154154
"""
155155
Retrieves a list of aggregate metrics grouped by time interval.
156156
@@ -210,7 +210,7 @@ async def get(
210210
),
211211
post_parser=ResultWrapper._unwrapper,
212212
),
213-
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
213+
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
214214
)
215215

216216

src/cloudflare/resources/dns/analytics/reports/reports.py

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

33
from __future__ import annotations
44

5-
from typing import Type, Union, cast
5+
from typing import Type, Union, Optional, cast
66
from datetime import datetime
77

88
import httpx
@@ -67,7 +67,7 @@ def get(
6767
extra_query: Query | None = None,
6868
extra_body: Body | None = None,
6969
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
70-
) -> Report:
70+
) -> Optional[Report]:
7171
"""
7272
Retrieves a list of summarised aggregate metrics over a given time period.
7373
@@ -124,7 +124,7 @@ def get(
124124
),
125125
post_parser=ResultWrapper._unwrapper,
126126
),
127-
cast_to=cast(Type[Report], ResultWrapper[Report]),
127+
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
128128
)
129129

130130

@@ -158,7 +158,7 @@ async def get(
158158
extra_query: Query | None = None,
159159
extra_body: Body | None = None,
160160
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
161-
) -> Report:
161+
) -> Optional[Report]:
162162
"""
163163
Retrieves a list of summarised aggregate metrics over a given time period.
164164
@@ -215,7 +215,7 @@ async def get(
215215
),
216216
post_parser=ResultWrapper._unwrapper,
217217
),
218-
cast_to=cast(Type[Report], ResultWrapper[Report]),
218+
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
219219
)
220220

221221

src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py

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

33
from __future__ import annotations
44

5-
from typing import Type, Union, cast
5+
from typing import Type, Union, Optional, cast
66
from datetime import datetime
77
from typing_extensions import Literal
88

@@ -60,7 +60,7 @@ def get(
6060
extra_query: Query | None = None,
6161
extra_body: Body | None = None,
6262
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> ByTime:
63+
) -> Optional[ByTime]:
6464
"""
6565
Retrieves a list of aggregate metrics grouped by time interval.
6666
@@ -124,7 +124,7 @@ def get(
124124
),
125125
post_parser=ResultWrapper._unwrapper,
126126
),
127-
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
127+
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
128128
)
129129

130130

@@ -157,7 +157,7 @@ async def get(
157157
extra_query: Query | None = None,
158158
extra_body: Body | None = None,
159159
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
160-
) -> ByTime:
160+
) -> Optional[ByTime]:
161161
"""
162162
Retrieves a list of aggregate metrics grouped by time interval.
163163
@@ -221,7 +221,7 @@ async def get(
221221
),
222222
post_parser=ResultWrapper._unwrapper,
223223
),
224-
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
224+
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
225225
)
226226

227227

src/cloudflare/resources/dns/firewall/analytics/reports/reports.py

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

33
from __future__ import annotations
44

5-
from typing import Type, Union, cast
5+
from typing import Type, Union, Optional, cast
66
from datetime import datetime
77

88
import httpx
@@ -69,7 +69,7 @@ def get(
6969
extra_query: Query | None = None,
7070
extra_body: Body | None = None,
7171
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
72-
) -> Report:
72+
) -> Optional[Report]:
7373
"""
7474
Retrieves a list of summarised aggregate metrics over a given time period.
7575
@@ -130,7 +130,7 @@ def get(
130130
),
131131
post_parser=ResultWrapper._unwrapper,
132132
),
133-
cast_to=cast(Type[Report], ResultWrapper[Report]),
133+
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
134134
)
135135

136136

@@ -165,7 +165,7 @@ async def get(
165165
extra_query: Query | None = None,
166166
extra_body: Body | None = None,
167167
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
168-
) -> Report:
168+
) -> Optional[Report]:
169169
"""
170170
Retrieves a list of summarised aggregate metrics over a given time period.
171171
@@ -226,7 +226,7 @@ async def get(
226226
),
227227
post_parser=ResultWrapper._unwrapper,
228228
),
229-
cast_to=cast(Type[Report], ResultWrapper[Report]),
229+
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
230230
)
231231

232232

tests/api_resources/dns/analytics/reports/test_bytimes.py

+9-9
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

@@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
2424
bytime = client.dns.analytics.reports.bytimes.get(
2525
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
2626
)
27-
assert_matches_type(ByTime, bytime, path=["response"])
27+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
2828

2929
@pytest.mark.skip()
3030
@parametrize
@@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
4040
time_delta="hour",
4141
until=parse_datetime("2023-11-11T13:00:00Z"),
4242
)
43-
assert_matches_type(ByTime, bytime, path=["response"])
43+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
4444

4545
@pytest.mark.skip()
4646
@parametrize
@@ -52,7 +52,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
5252
assert response.is_closed is True
5353
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5454
bytime = response.parse()
55-
assert_matches_type(ByTime, bytime, path=["response"])
55+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
5656

5757
@pytest.mark.skip()
5858
@parametrize
@@ -64,7 +64,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
6464
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6565

6666
bytime = response.parse()
67-
assert_matches_type(ByTime, bytime, path=["response"])
67+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
6868

6969
assert cast(Any, response.is_closed) is True
7070

@@ -86,7 +86,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
8686
bytime = await async_client.dns.analytics.reports.bytimes.get(
8787
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
8888
)
89-
assert_matches_type(ByTime, bytime, path=["response"])
89+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
9090

9191
@pytest.mark.skip()
9292
@parametrize
@@ -102,7 +102,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
102102
time_delta="hour",
103103
until=parse_datetime("2023-11-11T13:00:00Z"),
104104
)
105-
assert_matches_type(ByTime, bytime, path=["response"])
105+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
106106

107107
@pytest.mark.skip()
108108
@parametrize
@@ -114,7 +114,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
114114
assert response.is_closed is True
115115
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
116116
bytime = await response.parse()
117-
assert_matches_type(ByTime, bytime, path=["response"])
117+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
118118

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

128128
bytime = await response.parse()
129-
assert_matches_type(ByTime, bytime, path=["response"])
129+
assert_matches_type(Optional[ByTime], bytime, path=["response"])
130130

131131
assert cast(Any, response.is_closed) is True
132132

tests/api_resources/dns/analytics/test_reports.py

+9-9
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

@@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
2424
report = client.dns.analytics.reports.get(
2525
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
2626
)
27-
assert_matches_type(Report, report, path=["response"])
27+
assert_matches_type(Optional[Report], report, path=["response"])
2828

2929
@pytest.mark.skip()
3030
@parametrize
@@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
3939
sort="+responseCode,-queryName",
4040
until=parse_datetime("2023-11-11T13:00:00Z"),
4141
)
42-
assert_matches_type(Report, report, path=["response"])
42+
assert_matches_type(Optional[Report], report, path=["response"])
4343

4444
@pytest.mark.skip()
4545
@parametrize
@@ -51,7 +51,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
5151
assert response.is_closed is True
5252
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
5353
report = response.parse()
54-
assert_matches_type(Report, report, path=["response"])
54+
assert_matches_type(Optional[Report], report, path=["response"])
5555

5656
@pytest.mark.skip()
5757
@parametrize
@@ -63,7 +63,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
6363
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
6464

6565
report = response.parse()
66-
assert_matches_type(Report, report, path=["response"])
66+
assert_matches_type(Optional[Report], report, path=["response"])
6767

6868
assert cast(Any, response.is_closed) is True
6969

@@ -85,7 +85,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
8585
report = await async_client.dns.analytics.reports.get(
8686
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
8787
)
88-
assert_matches_type(Report, report, path=["response"])
88+
assert_matches_type(Optional[Report], report, path=["response"])
8989

9090
@pytest.mark.skip()
9191
@parametrize
@@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
100100
sort="+responseCode,-queryName",
101101
until=parse_datetime("2023-11-11T13:00:00Z"),
102102
)
103-
assert_matches_type(Report, report, path=["response"])
103+
assert_matches_type(Optional[Report], report, path=["response"])
104104

105105
@pytest.mark.skip()
106106
@parametrize
@@ -112,7 +112,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
112112
assert response.is_closed is True
113113
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
114114
report = await response.parse()
115-
assert_matches_type(Report, report, path=["response"])
115+
assert_matches_type(Optional[Report], report, path=["response"])
116116

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

126126
report = await response.parse()
127-
assert_matches_type(Report, report, path=["response"])
127+
assert_matches_type(Optional[Report], report, path=["response"])
128128

129129
assert cast(Any, response.is_closed) is True
130130

0 commit comments

Comments
 (0)