Skip to content

Commit f704605

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): api update (#2171)
1 parent bfd27f8 commit f704605

File tree

4 files changed

+102
-1
lines changed

4 files changed

+102
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1411
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d8a11058191753bacee9c070940904a1318942d364a2420ad1e253bd450b2bcf.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-79262f52aa0305d7e45a8aca559302bac22ba83027c7957ffa65d80834bd50dd.yml

src/cloudflare/resources/radar/http/http.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,22 @@ def timeseries(
116116
*,
117117
agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN,
118118
asn: List[str] | NotGiven = NOT_GIVEN,
119+
bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN,
119120
continent: List[str] | NotGiven = NOT_GIVEN,
120121
date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN,
121122
date_range: List[str] | NotGiven = NOT_GIVEN,
122123
date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN,
124+
device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN,
123125
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
126+
http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN,
127+
http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN,
128+
ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN,
124129
location: List[str] | NotGiven = NOT_GIVEN,
125130
name: List[str] | NotGiven = NOT_GIVEN,
126131
normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN,
132+
os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]]
133+
| NotGiven = NOT_GIVEN,
134+
tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN,
127135
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
128136
# The extra values given here take precedence over values defined on the client or passed to this method.
129137
extra_headers: Headers | None = None,
@@ -143,6 +151,9 @@ def timeseries(
143151
For example, `-174, 3356` excludes results from AS174, but includes results from
144152
AS3356.
145153
154+
bot_class: Filter for bot class. Refer to
155+
[Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
156+
146157
continent: Array of comma separated list of continents (alpha-2 continent codes). Start
147158
with `-` to exclude from results. For example, `-EU,NA` excludes results from
148159
Europe, but includes results from North America.
@@ -155,8 +166,16 @@ def timeseries(
155166
156167
date_start: Array of datetimes to filter the start of a series.
157168
169+
device_type: Filter for device type.
170+
158171
format: Format results are returned in.
159172
173+
http_protocol: Filter for http protocol.
174+
175+
http_version: Filter for http version.
176+
177+
ip_version: Filter for ip version.
178+
160179
location: Array of comma separated list of locations (alpha-2 country codes). Start with
161180
`-` to exclude from results. For example, `-US,PT` excludes results from the US,
162181
but includes results from PT.
@@ -166,6 +185,10 @@ def timeseries(
166185
normalization: Normalization method applied. Refer to
167186
[Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
168187
188+
os: Filter for os name.
189+
190+
tls_version: Filter for tls version.
191+
169192
extra_headers: Send extra headers
170193
171194
extra_query: Add additional query parameters to the request
@@ -185,14 +208,21 @@ def timeseries(
185208
{
186209
"agg_interval": agg_interval,
187210
"asn": asn,
211+
"bot_class": bot_class,
188212
"continent": continent,
189213
"date_end": date_end,
190214
"date_range": date_range,
191215
"date_start": date_start,
216+
"device_type": device_type,
192217
"format": format,
218+
"http_protocol": http_protocol,
219+
"http_version": http_version,
220+
"ip_version": ip_version,
193221
"location": location,
194222
"name": name,
195223
"normalization": normalization,
224+
"os": os,
225+
"tls_version": tls_version,
196226
},
197227
http_timeseries_params.HTTPTimeseriesParams,
198228
),
@@ -247,14 +277,22 @@ async def timeseries(
247277
*,
248278
agg_interval: Literal["15m", "1h", "1d", "1w"] | NotGiven = NOT_GIVEN,
249279
asn: List[str] | NotGiven = NOT_GIVEN,
280+
bot_class: List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]] | NotGiven = NOT_GIVEN,
250281
continent: List[str] | NotGiven = NOT_GIVEN,
251282
date_end: List[Union[str, datetime]] | NotGiven = NOT_GIVEN,
252283
date_range: List[str] | NotGiven = NOT_GIVEN,
253284
date_start: List[Union[str, datetime]] | NotGiven = NOT_GIVEN,
285+
device_type: List[Literal["DESKTOP", "MOBILE", "OTHER"]] | NotGiven = NOT_GIVEN,
254286
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
287+
http_protocol: List[Literal["HTTP", "HTTPS"]] | NotGiven = NOT_GIVEN,
288+
http_version: List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]] | NotGiven = NOT_GIVEN,
289+
ip_version: List[Literal["IPv4", "IPv6"]] | NotGiven = NOT_GIVEN,
255290
location: List[str] | NotGiven = NOT_GIVEN,
256291
name: List[str] | NotGiven = NOT_GIVEN,
257292
normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | NotGiven = NOT_GIVEN,
293+
os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]]
294+
| NotGiven = NOT_GIVEN,
295+
tls_version: List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]] | NotGiven = NOT_GIVEN,
258296
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
259297
# The extra values given here take precedence over values defined on the client or passed to this method.
260298
extra_headers: Headers | None = None,
@@ -274,6 +312,9 @@ async def timeseries(
274312
For example, `-174, 3356` excludes results from AS174, but includes results from
275313
AS3356.
276314
315+
bot_class: Filter for bot class. Refer to
316+
[Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
317+
277318
continent: Array of comma separated list of continents (alpha-2 continent codes). Start
278319
with `-` to exclude from results. For example, `-EU,NA` excludes results from
279320
Europe, but includes results from North America.
@@ -286,8 +327,16 @@ async def timeseries(
286327
287328
date_start: Array of datetimes to filter the start of a series.
288329
330+
device_type: Filter for device type.
331+
289332
format: Format results are returned in.
290333
334+
http_protocol: Filter for http protocol.
335+
336+
http_version: Filter for http version.
337+
338+
ip_version: Filter for ip version.
339+
291340
location: Array of comma separated list of locations (alpha-2 country codes). Start with
292341
`-` to exclude from results. For example, `-US,PT` excludes results from the US,
293342
but includes results from PT.
@@ -297,6 +346,10 @@ async def timeseries(
297346
normalization: Normalization method applied. Refer to
298347
[Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
299348
349+
os: Filter for os name.
350+
351+
tls_version: Filter for tls version.
352+
300353
extra_headers: Send extra headers
301354
302355
extra_query: Add additional query parameters to the request
@@ -316,14 +369,21 @@ async def timeseries(
316369
{
317370
"agg_interval": agg_interval,
318371
"asn": asn,
372+
"bot_class": bot_class,
319373
"continent": continent,
320374
"date_end": date_end,
321375
"date_range": date_range,
322376
"date_start": date_start,
377+
"device_type": device_type,
323378
"format": format,
379+
"http_protocol": http_protocol,
380+
"http_version": http_version,
381+
"ip_version": ip_version,
324382
"location": location,
325383
"name": name,
326384
"normalization": normalization,
385+
"os": os,
386+
"tls_version": tls_version,
327387
},
328388
http_timeseries_params.HTTPTimeseriesParams,
329389
),

src/cloudflare/types/radar/http_timeseries_params.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ class HTTPTimeseriesParams(TypedDict, total=False):
2626
AS3356.
2727
"""
2828

29+
bot_class: Annotated[List[Literal["LIKELY_AUTOMATED", "LIKELY_HUMAN"]], PropertyInfo(alias="botClass")]
30+
"""Filter for bot class.
31+
32+
Refer to
33+
[Bot classes](https://developers.cloudflare.com/radar/concepts/bot-classes/).
34+
"""
35+
2936
continent: List[str]
3037
"""Array of comma separated list of continents (alpha-2 continent codes).
3138
@@ -46,9 +53,21 @@ class HTTPTimeseriesParams(TypedDict, total=False):
4653
date_start: Annotated[List[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")]
4754
"""Array of datetimes to filter the start of a series."""
4855

56+
device_type: Annotated[List[Literal["DESKTOP", "MOBILE", "OTHER"]], PropertyInfo(alias="deviceType")]
57+
"""Filter for device type."""
58+
4959
format: Literal["JSON", "CSV"]
5060
"""Format results are returned in."""
5161

62+
http_protocol: Annotated[List[Literal["HTTP", "HTTPS"]], PropertyInfo(alias="httpProtocol")]
63+
"""Filter for http protocol."""
64+
65+
http_version: Annotated[List[Literal["HTTPv1", "HTTPv2", "HTTPv3"]], PropertyInfo(alias="httpVersion")]
66+
"""Filter for http version."""
67+
68+
ip_version: Annotated[List[Literal["IPv4", "IPv6"]], PropertyInfo(alias="ipVersion")]
69+
"""Filter for ip version."""
70+
5271
location: List[str]
5372
"""Array of comma separated list of locations (alpha-2 country codes).
5473
@@ -65,3 +84,11 @@ class HTTPTimeseriesParams(TypedDict, total=False):
6584
Refer to
6685
[Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
6786
"""
87+
88+
os: List[Literal["WINDOWS", "MACOSX", "IOS", "ANDROID", "CHROMEOS", "LINUX", "SMART_TV"]]
89+
"""Filter for os name."""
90+
91+
tls_version: Annotated[
92+
List[Literal["TLSv1_0", "TLSv1_1", "TLSv1_2", "TLSv1_3", "TLSvQUIC"]], PropertyInfo(alias="tlsVersion")
93+
]
94+
"""Filter for tls version."""

tests/api_resources/radar/test_http.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None:
2828
http = client.radar.http.timeseries(
2929
agg_interval="15m",
3030
asn=["string"],
31+
bot_class=["LIKELY_AUTOMATED"],
3132
continent=["string"],
3233
date_end=[parse_datetime("2019-12-27T18:11:19.117Z")],
3334
date_range=["7d"],
3435
date_start=[parse_datetime("2019-12-27T18:11:19.117Z")],
36+
device_type=["DESKTOP"],
3537
format="JSON",
38+
http_protocol=["HTTP"],
39+
http_version=["HTTPv1"],
40+
ip_version=["IPv4"],
3641
location=["string"],
3742
name=["string"],
3843
normalization="PERCENTAGE_CHANGE",
44+
os=["WINDOWS"],
45+
tls_version=["TLSv1_0"],
3946
)
4047
assert_matches_type(HTTPTimeseriesResponse, http, path=["response"])
4148

@@ -73,14 +80,21 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf
7380
http = await async_client.radar.http.timeseries(
7481
agg_interval="15m",
7582
asn=["string"],
83+
bot_class=["LIKELY_AUTOMATED"],
7684
continent=["string"],
7785
date_end=[parse_datetime("2019-12-27T18:11:19.117Z")],
7886
date_range=["7d"],
7987
date_start=[parse_datetime("2019-12-27T18:11:19.117Z")],
88+
device_type=["DESKTOP"],
8089
format="JSON",
90+
http_protocol=["HTTP"],
91+
http_version=["HTTPv1"],
92+
ip_version=["IPv4"],
8193
location=["string"],
8294
name=["string"],
8395
normalization="PERCENTAGE_CHANGE",
96+
os=["WINDOWS"],
97+
tls_version=["TLSv1_0"],
8498
)
8599
assert_matches_type(HTTPTimeseriesResponse, http, path=["response"])
86100

0 commit comments

Comments
 (0)