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 #1565

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
7 changes: 5 additions & 2 deletions radar/bgproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (r *BGPRouteService) Moas(ctx context.Context, query BGPRouteMoasParams, op
return
}

// Lookup prefix-to-origin mapping on global routing tables.
// Lookup prefix-to-ASN mapping on global routing tables.
func (r *BGPRouteService) Pfx2as(ctx context.Context, query BGPRoutePfx2asParams, opts ...option.RequestOption) (res *BGPRoutePfx2asResponse, err error) {
opts = append(r.Options[:], opts...)
var env BGPRoutePfx2asResponseEnvelope
Expand Down Expand Up @@ -529,9 +529,12 @@ func (r bgpRouteMoasResponseEnvelopeJSON) RawJSON() string {
type BGPRoutePfx2asParams struct {
// Format results are returned in.
Format param.Field[BGPRoutePfx2asParamsFormat] `query:"format"`
// 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 param.Field[bool] `query:"longestPrefixMatch"`
// Lookup prefixes originated by the given ASN
Origin param.Field[int64] `query:"origin"`
// Lookup origins of the given prefix
// Lookup origin ASNs of the given prefix
Prefix param.Field[string] `query:"prefix"`
// Return only results with matching rpki status: valid, invalid or unknown
RpkiStatus param.Field[BGPRoutePfx2asParamsRpkiStatus] `query:"rpkiStatus"`
Expand Down
9 changes: 5 additions & 4 deletions radar/bgproute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ func TestBGPRoutePfx2asWithOptionalParams(t *testing.T) {
option.WithAPIEmail("[email protected]"),
)
_, err := client.Radar.BGP.Routes.Pfx2as(context.TODO(), radar.BGPRoutePfx2asParams{
Format: cloudflare.F(radar.BGPRoutePfx2asParamsFormatJson),
Origin: cloudflare.F(int64(0)),
Prefix: cloudflare.F("1.1.1.0/24"),
RpkiStatus: cloudflare.F(radar.BGPRoutePfx2asParamsRpkiStatusInvalid),
Format: cloudflare.F(radar.BGPRoutePfx2asParamsFormatJson),
LongestPrefixMatch: cloudflare.F(true),
Origin: cloudflare.F(int64(0)),
Prefix: cloudflare.F("1.1.1.0/24"),
RpkiStatus: cloudflare.F(radar.BGPRoutePfx2asParamsRpkiStatusInvalid),
})
if err != nil {
var apierr *cloudflare.Error
Expand Down