Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1827)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent bbc396f commit f427ad2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
10 changes: 5 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3285,15 +3285,15 @@ Methods:

Params Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNParam">ASNParam</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#IntelASNParam">IntelASNParam</a>

Response Types:

- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASN">ASN</a>
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#IntelASN">IntelASN</a>

Methods:

- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.Intel.ASN.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, asn <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNParam">ASNParam</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNGetParams">ASNGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASN">ASN</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /accounts/{account_id}/intel/asn/{asn}">client.Intel.ASN.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, asn <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#IntelASNParam">IntelASNParam</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNGetParams">ASNGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#IntelASN">IntelASN</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

### Subnets

Expand All @@ -3303,7 +3303,7 @@ Response Types:

Methods:

- <code title="get /accounts/{account_id}/intel/asn/{asn}/subnets">client.Intel.ASN.Subnets.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, asn <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNParam">ASNParam</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetGetParams">ASNSubnetGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetGetResponse">ASNSubnetGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /accounts/{account_id}/intel/asn/{asn}/subnets">client.Intel.ASN.Subnets.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, asn <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#IntelASNParam">IntelASNParam</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetGetParams">ASNSubnetGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel">intel</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/intel#ASNSubnetGetResponse">ASNSubnetGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## DNS

Expand Down Expand Up @@ -4119,7 +4119,7 @@ Methods:

Methods:

- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.Stream.Captions.Language.Vtt.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream#CaptionLanguageVttService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, language <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream#CaptionLanguageVttGetParams">CaptionLanguageVttGetParams</a>) (<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /accounts/{account_id}/stream/{identifier}/captions/{language}/vtt">client.Stream.Captions.Language.Vtt.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream#CaptionLanguageVttService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, language <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v2/stream#CaptionLanguageVttGetParams">CaptionLanguageVttGetParams</a>) (<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Downloads

Expand Down
8 changes: 4 additions & 4 deletions intel/asn.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewASNService(opts ...option.RequestOption) (r *ASNService) {
}

// Get ASN Overview
func (r *ASNService) Get(ctx context.Context, asn ASNParam, query ASNGetParams, opts ...option.RequestOption) (res *ASN, err error) {
func (r *ASNService) Get(ctx context.Context, asn IntelASNParam, query ASNGetParams, opts ...option.RequestOption) (res *IntelASN, err error) {
opts = append(r.Options[:], opts...)
var env ASNGetResponseEnvelope
path := fmt.Sprintf("accounts/%s/intel/asn/%v", query.AccountID, asn)
Expand All @@ -46,9 +46,9 @@ func (r *ASNService) Get(ctx context.Context, asn ASNParam, query ASNGetParams,
return
}

type ASN = int64
type IntelASN = int64

type ASNParam = int64
type IntelASNParam = int64

type ASNGetParams struct {
// Identifier
Expand All @@ -58,7 +58,7 @@ type ASNGetParams struct {
type ASNGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ASN `json:"result,required"`
Result IntelASN `json:"result,required"`
// Whether the API call was successful
Success ASNGetResponseEnvelopeSuccess `json:"success,required"`
JSON asnGetResponseEnvelopeJSON `json:"-"`
Expand Down
4 changes: 2 additions & 2 deletions intel/asnsubnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ func NewASNSubnetService(opts ...option.RequestOption) (r *ASNSubnetService) {
}

// Get ASN Subnets
func (r *ASNSubnetService) Get(ctx context.Context, asn ASNParam, query ASNSubnetGetParams, opts ...option.RequestOption) (res *ASNSubnetGetResponse, err error) {
func (r *ASNSubnetService) Get(ctx context.Context, asn IntelASNParam, query ASNSubnetGetParams, opts ...option.RequestOption) (res *ASNSubnetGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := fmt.Sprintf("accounts/%s/intel/asn/%v/subnets", query.AccountID, asn)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}

type ASNSubnetGetResponse struct {
ASN ASN `json:"asn"`
ASN IntelASN `json:"asn"`
// Total results returned based on your search parameters.
Count float64 `json:"count"`
IPCountTotal int64 `json:"ip_count_total"`
Expand Down
10 changes: 2 additions & 8 deletions stream/captionlanguagevtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"net/http"

"github.com/cloudflare/cloudflare-go/v2/internal/apijson"
"github.com/cloudflare/cloudflare-go/v2/internal/param"
"github.com/cloudflare/cloudflare-go/v2/internal/requestconfig"
"github.com/cloudflare/cloudflare-go/v2/option"
Expand All @@ -32,20 +31,15 @@ func NewCaptionLanguageVttService(opts ...option.RequestOption) (r *CaptionLangu
}

// Return WebVTT captions for a provided language.
func (r *CaptionLanguageVttService) Get(ctx context.Context, identifier string, language string, params CaptionLanguageVttGetParams, opts ...option.RequestOption) (res *string, err error) {
func (r *CaptionLanguageVttService) Get(ctx context.Context, identifier string, language string, query CaptionLanguageVttGetParams, opts ...option.RequestOption) (res *string, err error) {
opts = append(r.Options[:], opts...)
opts = append([]option.RequestOption{option.WithHeader("Accept", "text/vtt")}, opts...)
path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s/vtt", params.AccountID, identifier, language)
path := fmt.Sprintf("accounts/%s/stream/%s/captions/%s/vtt", query.AccountID, identifier, language)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
return
}

type CaptionLanguageVttGetParams struct {
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}

func (r CaptionLanguageVttGetParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r.Body)
}
1 change: 0 additions & 1 deletion stream/captionlanguagevtt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func TestCaptionLanguageVttGet(t *testing.T) {
"tr",
stream.CaptionLanguageVttGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Body: map[string]interface{}{},
},
)
if err != nil {
Expand Down

0 comments on commit f427ad2

Please sign in to comment.