Skip to content

Commit 5ec0a7b

Browse files
feat: feat(radar): add AI markdown for agents and agent readiness endpoints
* feat(radar): add AI markdown for agents and agent readiness endpoints
1 parent e7ee358 commit 5ec0a7b

18 files changed

Lines changed: 1474 additions & 2 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 2126
1+
configured_endpoints: 2129
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-83a81462699153d3f2d3c484d97cdc6877b7c73a664cae829661e89bc6130afc.yml
33
openapi_spec_hash: 6b9d05215024e69850fed051e136ba7c
4-
config_hash: fab306f9c013d1ed01ed9c35c79f428b
4+
config_hash: 61ff4afd70fa432affae760c7dedebad

api.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7998,6 +7998,18 @@ Methods:
79987998

79997999
# Radar
80008000

8001+
## AgentReadiness
8002+
8003+
Types:
8004+
8005+
```python
8006+
from cloudflare.types.radar import AgentReadinessSummaryResponse
8007+
```
8008+
8009+
Methods:
8010+
8011+
- <code title="get /radar/agent_readiness/summary/{dimension}">client.radar.agent_readiness.<a href="./src/cloudflare/resources/radar/agent_readiness.py">summary</a>(dimension, \*\*<a href="src/cloudflare/types/radar/agent_readiness_summary_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/agent_readiness_summary_response.py">AgentReadinessSummaryResponse</a></code>
8012+
80018013
## AI
80028014

80038015
### ToMarkdown
@@ -8109,6 +8121,22 @@ Methods:
81098121
- <code title="get /radar/ai/bots/timeseries_groups/{dimension}">client.radar.ai.timeseries_groups.<a href="./src/cloudflare/resources/radar/ai/timeseries_groups.py">timeseries_groups</a>(dimension, \*\*<a href="src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_response.py">TimeseriesGroupTimeseriesGroupsResponse</a></code>
81108122
- <code title="get /radar/ai/bots/timeseries_groups/user_agent">client.radar.ai.timeseries_groups.<a href="./src/cloudflare/resources/radar/ai/timeseries_groups.py">user_agent</a>(\*\*<a href="src/cloudflare/types/radar/ai/timeseries_group_user_agent_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/timeseries_group_user_agent_response.py">TimeseriesGroupUserAgentResponse</a></code>
81118123

8124+
### MarkdownForAgents
8125+
8126+
Types:
8127+
8128+
```python
8129+
from cloudflare.types.radar.ai import (
8130+
MarkdownForAgentSummaryResponse,
8131+
MarkdownForAgentTimeseriesResponse,
8132+
)
8133+
```
8134+
8135+
Methods:
8136+
8137+
- <code title="get /radar/ai/markdown_for_agents/summary">client.radar.ai.markdown_for_agents.<a href="./src/cloudflare/resources/radar/ai/markdown_for_agents.py">summary</a>(\*\*<a href="src/cloudflare/types/radar/ai/markdown_for_agent_summary_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/markdown_for_agent_summary_response.py">MarkdownForAgentSummaryResponse</a></code>
8138+
- <code title="get /radar/ai/markdown_for_agents/timeseries">client.radar.ai.markdown_for_agents.<a href="./src/cloudflare/resources/radar/ai/markdown_for_agents.py">timeseries</a>(\*\*<a href="src/cloudflare/types/radar/ai/markdown_for_agent_timeseries_params.py">params</a>) -> <a href="./src/cloudflare/types/radar/ai/markdown_for_agent_timeseries_response.py">MarkdownForAgentTimeseriesResponse</a></code>
8139+
81128140
## CT
81138141

81148142
Types:

src/cloudflare/resources/radar/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,14 @@
168168
VerifiedBotsResourceWithStreamingResponse,
169169
AsyncVerifiedBotsResourceWithStreamingResponse,
170170
)
171+
from .agent_readiness import (
172+
AgentReadinessResource,
173+
AsyncAgentReadinessResource,
174+
AgentReadinessResourceWithRawResponse,
175+
AsyncAgentReadinessResourceWithRawResponse,
176+
AgentReadinessResourceWithStreamingResponse,
177+
AsyncAgentReadinessResourceWithStreamingResponse,
178+
)
171179
from .traffic_anomalies import (
172180
TrafficAnomaliesResource,
173181
AsyncTrafficAnomaliesResource,
@@ -194,6 +202,12 @@
194202
)
195203

196204
__all__ = [
205+
"AgentReadinessResource",
206+
"AsyncAgentReadinessResource",
207+
"AgentReadinessResourceWithRawResponse",
208+
"AsyncAgentReadinessResourceWithRawResponse",
209+
"AgentReadinessResourceWithStreamingResponse",
210+
"AsyncAgentReadinessResourceWithStreamingResponse",
197211
"AIResource",
198212
"AsyncAIResource",
199213
"AIResourceWithRawResponse",
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Type, Union, cast
6+
from datetime import date
7+
from typing_extensions import Literal
8+
9+
import httpx
10+
11+
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
12+
from ..._utils import maybe_transform, async_maybe_transform
13+
from ..._compat import cached_property
14+
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
from ..._response import (
16+
to_raw_response_wrapper,
17+
to_streamed_response_wrapper,
18+
async_to_raw_response_wrapper,
19+
async_to_streamed_response_wrapper,
20+
)
21+
from ..._wrappers import ResultWrapper
22+
from ...types.radar import agent_readiness_summary_params
23+
from ..._base_client import make_request_options
24+
from ...types.radar.agent_readiness_summary_response import AgentReadinessSummaryResponse
25+
26+
__all__ = ["AgentReadinessResource", "AsyncAgentReadinessResource"]
27+
28+
29+
class AgentReadinessResource(SyncAPIResource):
30+
@cached_property
31+
def with_raw_response(self) -> AgentReadinessResourceWithRawResponse:
32+
"""
33+
This property can be used as a prefix for any HTTP method call to return
34+
the raw response object instead of the parsed content.
35+
36+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
37+
"""
38+
return AgentReadinessResourceWithRawResponse(self)
39+
40+
@cached_property
41+
def with_streaming_response(self) -> AgentReadinessResourceWithStreamingResponse:
42+
"""
43+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44+
45+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
46+
"""
47+
return AgentReadinessResourceWithStreamingResponse(self)
48+
49+
def summary(
50+
self,
51+
dimension: Literal["CHECK"],
52+
*,
53+
date: Union[str, date] | Omit = omit,
54+
domain_category: SequenceNotStr[str] | Omit = omit,
55+
format: Literal["JSON", "CSV"] | Omit = omit,
56+
name: SequenceNotStr[str] | Omit = omit,
57+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
58+
# The extra values given here take precedence over values defined on the client or passed to this method.
59+
extra_headers: Headers | None = None,
60+
extra_query: Query | None = None,
61+
extra_body: Body | None = None,
62+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
63+
) -> AgentReadinessSummaryResponse:
64+
"""
65+
Returns a summary of AI agent readiness scores across scanned domains, grouped
66+
by the specified dimension. Data is sourced from weekly bulk scans. All values
67+
are raw domain counts.
68+
69+
Args:
70+
dimension: Specifies the agent readiness data dimension by which to group the results.
71+
72+
date: Filters results by the specified date.
73+
74+
domain_category: Filters results by domain category.
75+
76+
format: Format in which results will be returned.
77+
78+
name: Array of names used to label the series in the response.
79+
80+
extra_headers: Send extra headers
81+
82+
extra_query: Add additional query parameters to the request
83+
84+
extra_body: Add additional JSON properties to the request
85+
86+
timeout: Override the client-level default timeout for this request, in seconds
87+
"""
88+
if not dimension:
89+
raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}")
90+
return self._get(
91+
f"/radar/agent_readiness/summary/{dimension}",
92+
options=make_request_options(
93+
extra_headers=extra_headers,
94+
extra_query=extra_query,
95+
extra_body=extra_body,
96+
timeout=timeout,
97+
query=maybe_transform(
98+
{
99+
"date": date,
100+
"domain_category": domain_category,
101+
"format": format,
102+
"name": name,
103+
},
104+
agent_readiness_summary_params.AgentReadinessSummaryParams,
105+
),
106+
post_parser=ResultWrapper[AgentReadinessSummaryResponse]._unwrapper,
107+
),
108+
cast_to=cast(Type[AgentReadinessSummaryResponse], ResultWrapper[AgentReadinessSummaryResponse]),
109+
)
110+
111+
112+
class AsyncAgentReadinessResource(AsyncAPIResource):
113+
@cached_property
114+
def with_raw_response(self) -> AsyncAgentReadinessResourceWithRawResponse:
115+
"""
116+
This property can be used as a prefix for any HTTP method call to return
117+
the raw response object instead of the parsed content.
118+
119+
For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
120+
"""
121+
return AsyncAgentReadinessResourceWithRawResponse(self)
122+
123+
@cached_property
124+
def with_streaming_response(self) -> AsyncAgentReadinessResourceWithStreamingResponse:
125+
"""
126+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
127+
128+
For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
129+
"""
130+
return AsyncAgentReadinessResourceWithStreamingResponse(self)
131+
132+
async def summary(
133+
self,
134+
dimension: Literal["CHECK"],
135+
*,
136+
date: Union[str, date] | Omit = omit,
137+
domain_category: SequenceNotStr[str] | Omit = omit,
138+
format: Literal["JSON", "CSV"] | Omit = omit,
139+
name: SequenceNotStr[str] | Omit = omit,
140+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
141+
# The extra values given here take precedence over values defined on the client or passed to this method.
142+
extra_headers: Headers | None = None,
143+
extra_query: Query | None = None,
144+
extra_body: Body | None = None,
145+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
146+
) -> AgentReadinessSummaryResponse:
147+
"""
148+
Returns a summary of AI agent readiness scores across scanned domains, grouped
149+
by the specified dimension. Data is sourced from weekly bulk scans. All values
150+
are raw domain counts.
151+
152+
Args:
153+
dimension: Specifies the agent readiness data dimension by which to group the results.
154+
155+
date: Filters results by the specified date.
156+
157+
domain_category: Filters results by domain category.
158+
159+
format: Format in which results will be returned.
160+
161+
name: Array of names used to label the series in the response.
162+
163+
extra_headers: Send extra headers
164+
165+
extra_query: Add additional query parameters to the request
166+
167+
extra_body: Add additional JSON properties to the request
168+
169+
timeout: Override the client-level default timeout for this request, in seconds
170+
"""
171+
if not dimension:
172+
raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}")
173+
return await self._get(
174+
f"/radar/agent_readiness/summary/{dimension}",
175+
options=make_request_options(
176+
extra_headers=extra_headers,
177+
extra_query=extra_query,
178+
extra_body=extra_body,
179+
timeout=timeout,
180+
query=await async_maybe_transform(
181+
{
182+
"date": date,
183+
"domain_category": domain_category,
184+
"format": format,
185+
"name": name,
186+
},
187+
agent_readiness_summary_params.AgentReadinessSummaryParams,
188+
),
189+
post_parser=ResultWrapper[AgentReadinessSummaryResponse]._unwrapper,
190+
),
191+
cast_to=cast(Type[AgentReadinessSummaryResponse], ResultWrapper[AgentReadinessSummaryResponse]),
192+
)
193+
194+
195+
class AgentReadinessResourceWithRawResponse:
196+
def __init__(self, agent_readiness: AgentReadinessResource) -> None:
197+
self._agent_readiness = agent_readiness
198+
199+
self.summary = to_raw_response_wrapper(
200+
agent_readiness.summary,
201+
)
202+
203+
204+
class AsyncAgentReadinessResourceWithRawResponse:
205+
def __init__(self, agent_readiness: AsyncAgentReadinessResource) -> None:
206+
self._agent_readiness = agent_readiness
207+
208+
self.summary = async_to_raw_response_wrapper(
209+
agent_readiness.summary,
210+
)
211+
212+
213+
class AgentReadinessResourceWithStreamingResponse:
214+
def __init__(self, agent_readiness: AgentReadinessResource) -> None:
215+
self._agent_readiness = agent_readiness
216+
217+
self.summary = to_streamed_response_wrapper(
218+
agent_readiness.summary,
219+
)
220+
221+
222+
class AsyncAgentReadinessResourceWithStreamingResponse:
223+
def __init__(self, agent_readiness: AsyncAgentReadinessResource) -> None:
224+
self._agent_readiness = agent_readiness
225+
226+
self.summary = async_to_streamed_response_wrapper(
227+
agent_readiness.summary,
228+
)

src/cloudflare/resources/radar/ai/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
TimeseriesGroupsResourceWithStreamingResponse,
4141
AsyncTimeseriesGroupsResourceWithStreamingResponse,
4242
)
43+
from .markdown_for_agents import (
44+
MarkdownForAgentsResource,
45+
AsyncMarkdownForAgentsResource,
46+
MarkdownForAgentsResourceWithRawResponse,
47+
AsyncMarkdownForAgentsResourceWithRawResponse,
48+
MarkdownForAgentsResourceWithStreamingResponse,
49+
AsyncMarkdownForAgentsResourceWithStreamingResponse,
50+
)
4351

4452
__all__ = [
4553
"ToMarkdownResource",
@@ -66,6 +74,12 @@
6674
"AsyncTimeseriesGroupsResourceWithRawResponse",
6775
"TimeseriesGroupsResourceWithStreamingResponse",
6876
"AsyncTimeseriesGroupsResourceWithStreamingResponse",
77+
"MarkdownForAgentsResource",
78+
"AsyncMarkdownForAgentsResource",
79+
"MarkdownForAgentsResourceWithRawResponse",
80+
"AsyncMarkdownForAgentsResourceWithRawResponse",
81+
"MarkdownForAgentsResourceWithStreamingResponse",
82+
"AsyncMarkdownForAgentsResourceWithStreamingResponse",
6983
"AIResource",
7084
"AsyncAIResource",
7185
"AIResourceWithRawResponse",

0 commit comments

Comments
 (0)