// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../core/resource'; import * as AsesAPI from './ases'; import { AseGetParams, AseGetResponse, AsePrefixesParams, AsePrefixesResponse, Ases, BaseAses } from './ases'; import { APIPromise } from '../../../../core/api-promise'; import { RequestOptions } from '../../../../internal/request-options'; export class BaseTop extends APIResource { static override readonly _key: readonly ['radar', 'bgp', 'top'] = Object.freeze([ 'radar', 'bgp', 'top', ] as const); /** * Retrieves the top network prefixes by BGP updates. * * @example * ```ts * const response = await client.radar.bgp.top.prefixes(); * ``` */ prefixes( query: TopPrefixesParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return ( this._client.get('/radar/bgp/top/prefixes', { query, ...options }) as APIPromise<{ result: TopPrefixesResponse; }> )._thenUnwrap((obj) => obj.result); } } export class Top extends BaseTop { ases: AsesAPI.Ases = new AsesAPI.Ases(this._client); } export interface TopPrefixesResponse { meta: TopPrefixesResponse.Meta; top_0: Array; } export namespace TopPrefixesResponse { export interface Meta { dateRange: Array; } export namespace Meta { export interface DateRange { /** * Adjusted end of date range. */ endTime: string; /** * Adjusted start of date range. */ startTime: string; } } export interface Top0 { prefix: string; /** * A numeric string. */ value: string; } } export interface TopPrefixesParams { /** * Filters results by Autonomous System. Specify one or more Autonomous System * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from * results. For example, `-174, 3356` excludes results from AS174, but includes * results from AS3356. */ asn?: Array; /** * End of the date range (inclusive). */ dateEnd?: Array; /** * Filters results by date range. For example, use `7d` and `7dcontrol` to compare * this week with the previous week. Use this parameter or set specific start and * end dates (`dateStart` and `dateEnd` parameters). */ dateRange?: Array; /** * Start of the date range. */ dateStart?: Array; /** * Format in which results will be returned. */ format?: 'JSON' | 'CSV'; /** * Limits the number of objects returned in the response. */ limit?: number; /** * Array of names used to label the series in the response. */ name?: Array; /** * Filters results by BGP update type. */ updateType?: Array<'ANNOUNCEMENT' | 'WITHDRAWAL'>; } Top.Ases = Ases; Top.BaseAses = BaseAses; export declare namespace Top { export { type TopPrefixesResponse as TopPrefixesResponse, type TopPrefixesParams as TopPrefixesParams }; export { Ases as Ases, BaseAses as BaseAses, type AseGetResponse as AseGetResponse, type AsePrefixesResponse as AsePrefixesResponse, type AseGetParams as AseGetParams, type AsePrefixesParams as AsePrefixesParams, }; }