Skip to content

Commit fef43ec

Browse files
feat(api): api update
1 parent 6750686 commit fef43ec

File tree

11 files changed

+544
-11
lines changed

11 files changed

+544
-11
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1781
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6eb17c94a367941ef4fd3ad0750ea42308813e96e904d31b776ed848d849be90.yml
3-
openapi_spec_hash: 9fa312b08e4ba5659a03d7143210437f
1+
configured_endpoints: 1783
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c3722d2349434f1cf268b7f391080c3905e8b66b20a00bef2e00104a8e83f8fc.yml
3+
openapi_spec_hash: 4e221dc6dd407ab6dab265a68adf140a
44
config_hash: b5608440cfd3f75f7cfabd36fbc7cd88

api.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6377,8 +6377,24 @@ Methods:
63776377

63786378
#### Summary
63796379

6380+
Types:
6381+
6382+
- <code><a href="./src/resources/radar/ai/bots/summary.ts">SummaryUserAgentResponse</a></code>
6383+
6384+
Methods:
6385+
6386+
- <code title="get /radar/ai/bots/summary/user_agent">client.radar.ai.bots.summary.<a href="./src/resources/radar/ai/bots/summary.ts">userAgent</a>({ ...params }) -> SummaryUserAgentResponse</code>
6387+
63806388
### TimeseriesGroups
63816389

6390+
Types:
6391+
6392+
- <code><a href="./src/resources/radar/ai/timeseries-groups.ts">TimeseriesGroupUserAgentResponse</a></code>
6393+
6394+
Methods:
6395+
6396+
- <code title="get /radar/ai/bots/timeseries_groups/user_agent">client.radar.ai.timeseriesGroups.<a href="./src/resources/radar/ai/timeseries-groups.ts">userAgent</a>({ ...params }) -> TimeseriesGroupUserAgentResponse</code>
6397+
63826398
## Annotations
63836399

63846400
Types:

scripts/detect-breaking-changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,9 @@ TEST_PATHS=(
542542
tests/api-resources/radar/ai/inference/summary.test.ts
543543
tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts
544544
tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts
545+
tests/api-resources/radar/ai/bots/bots.test.ts
546+
tests/api-resources/radar/ai/bots/summary.test.ts
547+
tests/api-resources/radar/ai/timeseries-groups.test.ts
545548
tests/api-resources/radar/annotations/annotations.test.ts
546549
tests/api-resources/radar/annotations/outages.test.ts
547550
tests/api-resources/radar/bgp/bgp.test.ts

src/resources/radar/ai/ai.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
import { APIResource } from '../../../resource';
44
import * as TimeseriesGroupsAPI from './timeseries-groups';
5-
import { TimeseriesGroups } from './timeseries-groups';
5+
import {
6+
TimeseriesGroupUserAgentParams,
7+
TimeseriesGroupUserAgentResponse,
8+
TimeseriesGroups,
9+
} from './timeseries-groups';
610
import * as ToMarkdownAPI from './to-markdown';
711
import {
812
ToMarkdown,
@@ -42,5 +46,9 @@ export declare namespace AI {
4246

4347
export { Bots as Bots };
4448

45-
export { TimeseriesGroups as TimeseriesGroups };
49+
export {
50+
TimeseriesGroups as TimeseriesGroups,
51+
type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse,
52+
type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams,
53+
};
4654
}

src/resources/radar/ai/bots/bots.ts

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

33
import { APIResource } from '../../../../resource';
44
import * as SummaryAPI from './summary';
5-
import { Summary } from './summary';
5+
import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary';
66

77
export class Bots extends APIResource {
88
summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client);
@@ -11,5 +11,9 @@ export class Bots extends APIResource {
1111
Bots.Summary = Summary;
1212

1313
export declare namespace Bots {
14-
export { Summary as Summary };
14+
export {
15+
Summary as Summary,
16+
type SummaryUserAgentResponse as SummaryUserAgentResponse,
17+
type SummaryUserAgentParams as SummaryUserAgentParams,
18+
};
1519
}

src/resources/radar/ai/bots/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
export { Bots } from './bots';
4-
export { Summary } from './summary';
4+
export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary';
Lines changed: 189 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,193 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../../../resource';
4+
import { isRequestOptions } from '../../../../core';
5+
import * as Core from '../../../../core';
46

5-
export class Summary extends APIResource {}
7+
export class Summary extends APIResource {
8+
/**
9+
* Retrieves the distribution of traffic by AI user agent.
10+
*
11+
* @deprecated
12+
*/
13+
userAgent(
14+
query?: SummaryUserAgentParams,
15+
options?: Core.RequestOptions,
16+
): Core.APIPromise<SummaryUserAgentResponse>;
17+
userAgent(options?: Core.RequestOptions): Core.APIPromise<SummaryUserAgentResponse>;
18+
userAgent(
19+
query: SummaryUserAgentParams | Core.RequestOptions = {},
20+
options?: Core.RequestOptions,
21+
): Core.APIPromise<SummaryUserAgentResponse> {
22+
if (isRequestOptions(query)) {
23+
return this.userAgent({}, query);
24+
}
25+
return (
26+
this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{
27+
result: SummaryUserAgentResponse;
28+
}>
29+
)._thenUnwrap((obj) => obj.result);
30+
}
31+
}
32+
33+
export interface SummaryUserAgentResponse {
34+
/**
35+
* Metadata for the results.
36+
*/
37+
meta: SummaryUserAgentResponse.Meta;
38+
39+
summary_0: { [key: string]: string };
40+
}
41+
42+
export namespace SummaryUserAgentResponse {
43+
/**
44+
* Metadata for the results.
45+
*/
46+
export interface Meta {
47+
confidenceInfo: Meta.ConfidenceInfo;
48+
49+
dateRange: Array<Meta.DateRange>;
50+
51+
/**
52+
* Timestamp of the last dataset update.
53+
*/
54+
lastUpdated: string;
55+
56+
/**
57+
* Normalization method applied to the results. Refer to
58+
* [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/).
59+
*/
60+
normalization:
61+
| 'PERCENTAGE'
62+
| 'MIN0_MAX'
63+
| 'MIN_MAX'
64+
| 'RAW_VALUES'
65+
| 'PERCENTAGE_CHANGE'
66+
| 'ROLLING_AVERAGE'
67+
| 'OVERLAPPED_PERCENTAGE'
68+
| 'RATIO';
69+
70+
/**
71+
* Measurement units for the results.
72+
*/
73+
units: Array<Meta.Unit>;
74+
}
75+
76+
export namespace Meta {
77+
export interface ConfidenceInfo {
78+
annotations: Array<ConfidenceInfo.Annotation>;
79+
80+
/**
81+
* Provides an indication of how much confidence Cloudflare has in the data.
82+
*/
83+
level: number;
84+
}
85+
86+
export namespace ConfidenceInfo {
87+
/**
88+
* Annotation associated with the result (e.g. outage or other type of event).
89+
*/
90+
export interface Annotation {
91+
dataSource: string;
92+
93+
description: string;
94+
95+
endDate: string;
96+
97+
eventType: string;
98+
99+
/**
100+
* Whether event is a single point in time or a time range.
101+
*/
102+
isInstantaneous: boolean;
103+
104+
linkedUrl: string;
105+
106+
startDate: string;
107+
}
108+
}
109+
110+
export interface DateRange {
111+
/**
112+
* Adjusted end of date range.
113+
*/
114+
endTime: string;
115+
116+
/**
117+
* Adjusted start of date range.
118+
*/
119+
startTime: string;
120+
}
121+
122+
export interface Unit {
123+
name: string;
124+
125+
value: string;
126+
}
127+
}
128+
}
129+
130+
export interface SummaryUserAgentParams {
131+
/**
132+
* Filters results by Autonomous System. Specify one or more Autonomous System
133+
* Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from
134+
* results. For example, `-174, 3356` excludes results from AS174, but includes
135+
* results from AS3356.
136+
*/
137+
asn?: Array<string>;
138+
139+
/**
140+
* Filters results by continent. Specify a comma-separated list of alpha-2 codes.
141+
* Prefix with `-` to exclude continents from results. For example, `-EU,NA`
142+
* excludes results from EU, but includes results from NA.
143+
*/
144+
continent?: Array<string>;
145+
146+
/**
147+
* End of the date range (inclusive).
148+
*/
149+
dateEnd?: Array<string>;
150+
151+
/**
152+
* Filters results by date range. For example, use `7d` and `7dcontrol` to compare
153+
* this week with the previous week. Use this parameter or set specific start and
154+
* end dates (`dateStart` and `dateEnd` parameters).
155+
*/
156+
dateRange?: Array<string>;
157+
158+
/**
159+
* Start of the date range.
160+
*/
161+
dateStart?: Array<string>;
162+
163+
/**
164+
* Format in which results will be returned.
165+
*/
166+
format?: 'JSON' | 'CSV';
167+
168+
/**
169+
* Limits the number of objects per group to the top items within the specified
170+
* time range. When item count exceeds the limit, extra items appear grouped under
171+
* an "other" category.
172+
*/
173+
limitPerGroup?: number;
174+
175+
/**
176+
* Filters results by location. Specify a comma-separated list of alpha-2 codes.
177+
* Prefix with `-` to exclude locations from results. For example, `-US,PT`
178+
* excludes results from the US, but includes results from PT.
179+
*/
180+
location?: Array<string>;
181+
182+
/**
183+
* Array of names used to label the series in the response.
184+
*/
185+
name?: Array<string>;
186+
}
187+
188+
export declare namespace Summary {
189+
export {
190+
type SummaryUserAgentResponse as SummaryUserAgentResponse,
191+
type SummaryUserAgentParams as SummaryUserAgentParams,
192+
};
193+
}

src/resources/radar/ai/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
export { AI } from './ai';
44
export { Bots } from './bots/index';
55
export { Inference } from './inference/index';
6-
export { TimeseriesGroups } from './timeseries-groups';
6+
export {
7+
TimeseriesGroups,
8+
type TimeseriesGroupUserAgentResponse,
9+
type TimeseriesGroupUserAgentParams,
10+
} from './timeseries-groups';
711
export {
812
ToMarkdownCreateResponsesSinglePage,
913
ToMarkdown,

0 commit comments

Comments
 (0)