Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 15, 2024
1 parent fa88c78 commit 2d557ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
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

0 comments on commit 2d557ac

Please sign in to comment.