Skip to content

Commit c78996b

Browse files
feat(api): api update
1 parent 0f9df9c commit c78996b

8 files changed

Lines changed: 153 additions & 107 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56825afb1a7a893f4928c3184b8db1345893562278db43d1ab77ebeff740082e.yml
3-
openapi_spec_hash: 2b5b0dcc1d4a02ae0cee79e6065bbef1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9e7c566c3ce59d925331b04a5c4802747f67167d4645637414a17b2db0f89a5a.yml
3+
openapi_spec_hash: 43e4ef78fd8c5d5a4695688659db7fbd
44
config_hash: 284c4178d08f75d8c8b29f275948a8fd

src/cloudflare/resources/radar/search.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def global_(
4949
self,
5050
*,
5151
query: str,
52-
exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
52+
exclude: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
5353
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
54-
include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
54+
include: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
5555
limit: int | NotGiven = NOT_GIVEN,
5656
limit_per_group: float | NotGiven = NOT_GIVEN,
5757
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -62,7 +62,7 @@ def global_(
6262
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
6363
) -> SearchGlobalResponse:
6464
"""
65-
Searches for locations, autonomous systems, and reports.
65+
Searches for locations, autonomous systems, reports, and bots.
6666
6767
Args:
6868
query: Search for locations, autonomous systems and reports.
@@ -133,9 +133,9 @@ async def global_(
133133
self,
134134
*,
135135
query: str,
136-
exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
136+
exclude: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
137137
format: Literal["JSON", "CSV"] | NotGiven = NOT_GIVEN,
138-
include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
138+
include: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]] | NotGiven = NOT_GIVEN,
139139
limit: int | NotGiven = NOT_GIVEN,
140140
limit_per_group: float | NotGiven = NOT_GIVEN,
141141
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -146,7 +146,7 @@ async def global_(
146146
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
147147
) -> SearchGlobalResponse:
148148
"""
149-
Searches for locations, autonomous systems, and reports.
149+
Searches for locations, autonomous systems, reports, and bots.
150150
151151
Args:
152152
query: Search for locations, autonomous systems and reports.

src/cloudflare/resources/radar/verified_bots/top.py

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import typing_extensions
56
from typing import List, Type, Union, cast
67
from datetime import datetime
78
from typing_extensions import Literal
@@ -47,6 +48,9 @@ def with_streaming_response(self) -> TopResourceWithStreamingResponse:
4748
"""
4849
return TopResourceWithStreamingResponse(self)
4950

51+
@typing_extensions.deprecated(
52+
"Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead."
53+
)
5054
def bots(
5155
self,
5256
*,
@@ -131,6 +135,9 @@ def bots(
131135
cast_to=cast(Type[TopBotsResponse], ResultWrapper[TopBotsResponse]),
132136
)
133137

138+
@typing_extensions.deprecated(
139+
"Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead."
140+
)
134141
def categories(
135142
self,
136143
*,
@@ -237,6 +244,9 @@ def with_streaming_response(self) -> AsyncTopResourceWithStreamingResponse:
237244
"""
238245
return AsyncTopResourceWithStreamingResponse(self)
239246

247+
@typing_extensions.deprecated(
248+
"Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead."
249+
)
240250
async def bots(
241251
self,
242252
*,
@@ -321,6 +331,9 @@ async def bots(
321331
cast_to=cast(Type[TopBotsResponse], ResultWrapper[TopBotsResponse]),
322332
)
323333

334+
@typing_extensions.deprecated(
335+
"Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead."
336+
)
324337
async def categories(
325338
self,
326339
*,
@@ -411,45 +424,61 @@ class TopResourceWithRawResponse:
411424
def __init__(self, top: TopResource) -> None:
412425
self._top = top
413426

414-
self.bots = to_raw_response_wrapper(
415-
top.bots,
427+
self.bots = ( # pyright: ignore[reportDeprecated]
428+
to_raw_response_wrapper(
429+
top.bots # pyright: ignore[reportDeprecated],
430+
)
416431
)
417-
self.categories = to_raw_response_wrapper(
418-
top.categories,
432+
self.categories = ( # pyright: ignore[reportDeprecated]
433+
to_raw_response_wrapper(
434+
top.categories # pyright: ignore[reportDeprecated],
435+
)
419436
)
420437

421438

422439
class AsyncTopResourceWithRawResponse:
423440
def __init__(self, top: AsyncTopResource) -> None:
424441
self._top = top
425442

426-
self.bots = async_to_raw_response_wrapper(
427-
top.bots,
443+
self.bots = ( # pyright: ignore[reportDeprecated]
444+
async_to_raw_response_wrapper(
445+
top.bots # pyright: ignore[reportDeprecated],
446+
)
428447
)
429-
self.categories = async_to_raw_response_wrapper(
430-
top.categories,
448+
self.categories = ( # pyright: ignore[reportDeprecated]
449+
async_to_raw_response_wrapper(
450+
top.categories # pyright: ignore[reportDeprecated],
451+
)
431452
)
432453

433454

434455
class TopResourceWithStreamingResponse:
435456
def __init__(self, top: TopResource) -> None:
436457
self._top = top
437458

438-
self.bots = to_streamed_response_wrapper(
439-
top.bots,
459+
self.bots = ( # pyright: ignore[reportDeprecated]
460+
to_streamed_response_wrapper(
461+
top.bots # pyright: ignore[reportDeprecated],
462+
)
440463
)
441-
self.categories = to_streamed_response_wrapper(
442-
top.categories,
464+
self.categories = ( # pyright: ignore[reportDeprecated]
465+
to_streamed_response_wrapper(
466+
top.categories # pyright: ignore[reportDeprecated],
467+
)
443468
)
444469

445470

446471
class AsyncTopResourceWithStreamingResponse:
447472
def __init__(self, top: AsyncTopResource) -> None:
448473
self._top = top
449474

450-
self.bots = async_to_streamed_response_wrapper(
451-
top.bots,
475+
self.bots = ( # pyright: ignore[reportDeprecated]
476+
async_to_streamed_response_wrapper(
477+
top.bots # pyright: ignore[reportDeprecated],
478+
)
452479
)
453-
self.categories = async_to_streamed_response_wrapper(
454-
top.categories,
480+
self.categories = ( # pyright: ignore[reportDeprecated]
481+
async_to_streamed_response_wrapper(
482+
top.categories # pyright: ignore[reportDeprecated],
483+
)
455484
)

src/cloudflare/types/radar/entities/asn_get_response.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ class ASN(BaseModel):
6060

6161
aka: Optional[str] = None
6262

63-
name_long: Optional[str] = FieldInfo(alias="nameLong", default=None)
64-
"""Deprecated field. Please use 'aka'."""
65-
6663

6764
class ASNGetResponse(BaseModel):
6865
asn: ASN

src/cloudflare/types/radar/entities/asn_ip_response.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ class ASN(BaseModel):
5858

5959
aka: Optional[str] = None
6060

61-
name_long: Optional[str] = FieldInfo(alias="nameLong", default=None)
62-
"""Deprecated field. Please use 'aka'."""
63-
6461

6562
class ASNIPResponse(BaseModel):
6663
asn: ASN

src/cloudflare/types/radar/entities/asn_list_response.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class ASN(BaseModel):
2020

2121
aka: Optional[str] = None
2222

23-
name_long: Optional[str] = FieldInfo(alias="nameLong", default=None)
24-
"""Deprecated field. Please use 'aka'."""
25-
2623
org_name: Optional[str] = FieldInfo(alias="orgName", default=None)
2724

2825
website: Optional[str] = None

src/cloudflare/types/radar/search_global_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class SearchGlobalParams(TypedDict, total=False):
1414
query: Required[str]
1515
"""Search for locations, autonomous systems and reports."""
1616

17-
exclude: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]]
17+
exclude: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]]
1818
"""Search types excluded from results."""
1919

2020
format: Literal["JSON", "CSV"]
2121
"""Format in which results will be returned."""
2222

23-
include: List[Literal["ASNS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]]
23+
include: List[Literal["ASNS", "BOTS", "LOCATIONS", "NOTEBOOKS", "SPECIAL_EVENTS"]]
2424
"""Search types included in results."""
2525

2626
limit: int

0 commit comments

Comments
 (0)