Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #155

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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