Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 18, 2024
1 parent 0769422 commit 74bbd97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/resources/radar/bgp/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Routes extends APIResource {
}

/**
* Lookup prefix-to-origin mapping on global routing tables.
* Lookup prefix-to-ASN mapping on global routing tables.
*/
pfx2as(query?: RoutePfx2asParams, options?: Core.RequestOptions): Core.APIPromise<RoutePfx2asResponse>;
pfx2as(options?: Core.RequestOptions): Core.APIPromise<RoutePfx2asResponse>;
Expand Down Expand Up @@ -267,13 +267,19 @@ export interface RoutePfx2asParams {
*/
format?: 'JSON' | 'CSV';

/**
* Return only results with the longest prefix match for the given prefix. For
* example, specify a /32 prefix to lookup the origin ASN for an IPv4 address.
*/
longestPrefixMatch?: boolean;

/**
* Lookup prefixes originated by the given ASN
*/
origin?: number;

/**
* Lookup origins of the given prefix
* Lookup origin ASNs of the given prefix
*/
prefix?: string;

Expand Down
2 changes: 1 addition & 1 deletion tests/api-resources/radar/bgp/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('resource routes', () => {
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
await expect(
cloudflare.radar.bgp.routes.pfx2as(
{ format: 'JSON', origin: 0, prefix: '1.1.1.0/24', rpkiStatus: 'INVALID' },
{ format: 'JSON', longestPrefixMatch: true, origin: 0, prefix: '1.1.1.0/24', rpkiStatus: 'INVALID' },
{ path: '/_stainless_unknown_path' },
),
).rejects.toThrow(Cloudflare.NotFoundError);
Expand Down

0 comments on commit 74bbd97

Please sign in to comment.