Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 5, 2024
1 parent 6d79974 commit 0113c95
Show file tree
Hide file tree
Showing 20 changed files with 497 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1335
configured_endpoints: 1338
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-563da3da7347fb7ce5676737cc6a457de5da7c96aa7d44098a9db3b2fb8d6599.yml
26 changes: 24 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2280,11 +2280,23 @@ Types:

Types:

- <code><a href="./src/resources/workers/ai.ts">AIRunResponse</a></code>
- <code><a href="./src/resources/workers/ai/ai.ts">AIRunResponse</a></code>

Methods:

- <code title="post /accounts/{account_id}/ai/run/{model_name}">client.workers.ai.<a href="./src/resources/workers/ai.ts">run</a>(modelName, { ...params }) -> AIRunResponse</code>
- <code title="post /accounts/{account_id}/ai/run/{model_name}">client.workers.ai.<a href="./src/resources/workers/ai/ai.ts">run</a>(modelName, { ...params }) -> AIRunResponse</code>

### Models

#### Schema

Types:

- <code><a href="./src/resources/workers/ai/models/schema.ts">SchemaGetResponse</a></code>

Methods:

- <code title="get /accounts/{account_id}/ai/models/schema">client.workers.ai.models.schema.<a href="./src/resources/workers/ai/models/schema.ts">get</a>({ ...params }) -> SchemaGetResponse</code>

## Scripts

Expand Down Expand Up @@ -5620,12 +5632,14 @@ Methods:

Types:

- <code><a href="./src/resources/radar/bgp/routes.ts">RouteAsesResponse</a></code>
- <code><a href="./src/resources/radar/bgp/routes.ts">RouteMoasResponse</a></code>
- <code><a href="./src/resources/radar/bgp/routes.ts">RoutePfx2asResponse</a></code>
- <code><a href="./src/resources/radar/bgp/routes.ts">RouteStatsResponse</a></code>

Methods:

- <code title="get /radar/bgp/routes/ases">client.radar.bgp.routes.<a href="./src/resources/radar/bgp/routes.ts">ases</a>({ ...params }) -> RouteAsesResponse</code>
- <code title="get /radar/bgp/routes/moas">client.radar.bgp.routes.<a href="./src/resources/radar/bgp/routes.ts">moas</a>({ ...params }) -> RouteMoasResponse</code>
- <code title="get /radar/bgp/routes/pfx2as">client.radar.bgp.routes.<a href="./src/resources/radar/bgp/routes.ts">pfx2as</a>({ ...params }) -> RoutePfx2asResponse</code>
- <code title="get /radar/bgp/routes/stats">client.radar.bgp.routes.<a href="./src/resources/radar/bgp/routes.ts">stats</a>({ ...params }) -> RouteStatsResponse</code>
Expand Down Expand Up @@ -6149,6 +6163,14 @@ Methods:

## HTTP

Types:

- <code><a href="./src/resources/radar/http/http.ts">HTTPTimeseriesResponse</a></code>

Methods:

- <code title="get /radar/http/timeseries">client.radar.http.<a href="./src/resources/radar/http/http.ts">timeseries</a>({ ...params }) -> HTTPTimeseriesResponse</code>

### Top

Types:
Expand Down
2 changes: 2 additions & 0 deletions src/resources/radar/bgp/bgp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,11 @@ export namespace BGP {
export import TopPrefixesParams = TopAPI.TopPrefixesParams;
export import Hijacks = HijacksAPI.Hijacks;
export import Routes = RoutesAPI.Routes;
export import RouteAsesResponse = RoutesAPI.RouteAsesResponse;
export import RouteMoasResponse = RoutesAPI.RouteMoasResponse;
export import RoutePfx2asResponse = RoutesAPI.RoutePfx2asResponse;
export import RouteStatsResponse = RoutesAPI.RouteStatsResponse;
export import RouteAsesParams = RoutesAPI.RouteAsesParams;
export import RouteMoasParams = RoutesAPI.RouteMoasParams;
export import RoutePfx2asParams = RoutesAPI.RoutePfx2asParams;
export import RouteStatsParams = RoutesAPI.RouteStatsParams;
Expand Down
2 changes: 2 additions & 0 deletions src/resources/radar/bgp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ export { Hijacks } from './hijacks/index';
export { IPTimeseriesResponse, IPTimeseriesParams, IPs } from './ips';
export { Leaks } from './leaks/index';
export {
RouteAsesResponse,
RouteMoasResponse,
RoutePfx2asResponse,
RouteStatsResponse,
RouteAsesParams,
RouteMoasParams,
RoutePfx2asParams,
RouteStatsParams,
Expand Down
122 changes: 122 additions & 0 deletions src/resources/radar/bgp/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,25 @@ import { isRequestOptions } from '../../../core';
import * as RoutesAPI from './routes';

export class Routes extends APIResource {
/**
* List all ASes on current global routing tables with routing statistics
*/
ases(query?: RouteAsesParams, options?: Core.RequestOptions): Core.APIPromise<RouteAsesResponse>;
ases(options?: Core.RequestOptions): Core.APIPromise<RouteAsesResponse>;
ases(
query: RouteAsesParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.APIPromise<RouteAsesResponse> {
if (isRequestOptions(query)) {
return this.ases({}, query);
}
return (
this._client.get('/radar/bgp/routes/ases', { query, ...options }) as Core.APIPromise<{
result: RouteAsesResponse;
}>
)._thenUnwrap((obj) => obj.result);
}

/**
* List all Multi-origin AS (MOAS) prefixes on the global routing tables.
*/
Expand Down Expand Up @@ -64,6 +83,80 @@ export class Routes extends APIResource {
}
}

export interface RouteAsesResponse {
asns: Array<RouteAsesResponse.ASN>;

meta: RouteAsesResponse.Meta;
}

export namespace RouteAsesResponse {
export interface ASN {
asn: number;

/**
* AS's customer cone size
*/
coneSize: number;

/**
* 2-letter country code for the AS's registration country
*/
country: string;

/**
* number of IPv4 addresses originated by the AS
*/
ipv4Count: number;

/**
* number of IPv6 addresses originated by the AS
*/
ipv6Count: string;

/**
* name of the AS
*/
name: string;

/**
* number of total IP prefixes originated by the AS
*/
pfxsCount: number;

/**
* number of RPKI invalid prefixes originated by the AS
*/
rpkiInvalid: number;

/**
* number of RPKI unknown prefixes originated by the AS
*/
rpkiUnknown: number;

/**
* number of RPKI valid prefixes originated by the AS
*/
rpkiValid: number;
}

export interface Meta {
/**
* the timestamp of when the data is generated
*/
dataTime: string;

/**
* the timestamp of the query
*/
queryTime: string;

/**
* total number of route collector peers used to generate this data
*/
totalPeers: number;
}
}

export interface RouteMoasResponse {
meta: RouteMoasResponse.Meta;

Expand Down Expand Up @@ -176,6 +269,33 @@ export namespace RouteStatsResponse {
}
}

export interface RouteAsesParams {
/**
* Format results are returned in.
*/
format?: 'JSON' | 'CSV';

/**
* Limit the number of objects in the response.
*/
limit?: number;

/**
* Location Alpha2 code.
*/
location?: string;

/**
* Return order results by given type
*/
sortBy?: 'cone' | 'pfxs' | 'ipv4' | 'ipv6' | 'rpki_valid' | 'rpki_invalid' | 'rpki_unknown';

/**
* Sort by value ascending or descending
*/
sortOrder?: 'asc' | 'desc';
}

export interface RouteMoasParams {
/**
* Format results are returned in.
Expand Down Expand Up @@ -244,9 +364,11 @@ export interface RouteStatsParams {
}

export namespace Routes {
export import RouteAsesResponse = RoutesAPI.RouteAsesResponse;
export import RouteMoasResponse = RoutesAPI.RouteMoasResponse;
export import RoutePfx2asResponse = RoutesAPI.RoutePfx2asResponse;
export import RouteStatsResponse = RoutesAPI.RouteStatsResponse;
export import RouteAsesParams = RoutesAPI.RouteAsesParams;
export import RouteMoasParams = RoutesAPI.RouteMoasParams;
export import RoutePfx2asParams = RoutesAPI.RoutePfx2asParams;
export import RouteStatsParams = RoutesAPI.RouteStatsParams;
Expand Down
Loading

0 comments on commit 0113c95

Please sign in to comment.