Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 5, 2024
1 parent ad8dfff commit 262d4b6
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 16 deletions.
5 changes: 0 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3937,13 +3937,8 @@ Methods:

# Stream

Params Types:

- <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#AllowedOriginsItemParam">AllowedOriginsItemParam</a>

Response Types:

- <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#AllowedOriginsItem">AllowedOriginsItem</a>
- <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#Video">Video</a>

Methods:
Expand Down
4 changes: 2 additions & 2 deletions stream/clip.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Clip struct {
// Lists the origins allowed to display the video. Enter allowed origin domains in
// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
// viewed on any origin.
AllowedOrigins []AllowedOriginsItem `json:"allowedOrigins"`
AllowedOrigins []string `json:"allowedOrigins"`
// The unique video identifier (UID).
ClippedFromVideoUid string `json:"clippedFromVideoUID"`
// The date and time the clip was created.
Expand Down Expand Up @@ -193,7 +193,7 @@ type ClipNewParams struct {
// Lists the origins allowed to display the video. Enter allowed origin domains in
// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
// viewed on any origin.
AllowedOrigins param.Field[[]AllowedOriginsItemParam] `json:"allowedOrigins"`
AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
// A user-defined identifier for the media creator.
Creator param.Field[string] `json:"creator"`
// The maximum duration in seconds for a video upload. Can be set for a video that
Expand Down
2 changes: 1 addition & 1 deletion stream/clip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestClipNewWithOptionalParams(t *testing.T) {
ClippedFromVideoUid: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
EndTimeSeconds: cloudflare.F(int64(0)),
StartTimeSeconds: cloudflare.F(int64(0)),
AllowedOrigins: cloudflare.F([]stream.AllowedOriginsItemParam{"example.com"}),
AllowedOrigins: cloudflare.F([]string{"example.com"}),
Creator: cloudflare.F("creator-id_abcde12345"),
MaxDurationSeconds: cloudflare.F(int64(1)),
RequireSignedURLs: cloudflare.F(true),
Expand Down
2 changes: 1 addition & 1 deletion stream/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type CopyNewParams struct {
// Lists the origins allowed to display the video. Enter allowed origin domains in
// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
// viewed on any origin.
AllowedOrigins param.Field[[]AllowedOriginsItemParam] `json:"allowedOrigins"`
AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
// A user-defined identifier for the media creator.
Creator param.Field[string] `json:"creator"`
// A user modifiable key-value store used to reference other systems of record for
Expand Down
2 changes: 1 addition & 1 deletion stream/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCopyNewWithOptionalParams(t *testing.T) {
_, err := client.Stream.Copy.New(context.TODO(), stream.CopyNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
URL: cloudflare.F("https://example.com/myvideo.mp4"),
AllowedOrigins: cloudflare.F([]stream.AllowedOriginsItemParam{"example.com"}),
AllowedOrigins: cloudflare.F([]string{"example.com"}),
Creator: cloudflare.F("creator-id_abcde12345"),
Meta: cloudflare.F[any](map[string]interface{}{
"name": "video12345.mp4",
Expand Down
2 changes: 1 addition & 1 deletion stream/directupload.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type DirectUploadNewParams struct {
// Lists the origins allowed to display the video. Enter allowed origin domains in
// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
// viewed on any origin.
AllowedOrigins param.Field[[]AllowedOriginsItemParam] `json:"allowedOrigins"`
AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
// A user-defined identifier for the media creator.
Creator param.Field[string] `json:"creator"`
// The date and time after upload when videos will not be accepted.
Expand Down
2 changes: 1 addition & 1 deletion stream/directupload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestDirectUploadNewWithOptionalParams(t *testing.T) {
_, err := client.Stream.DirectUpload.New(context.TODO(), stream.DirectUploadNewParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
MaxDurationSeconds: cloudflare.F(int64(1)),
AllowedOrigins: cloudflare.F([]stream.AllowedOriginsItemParam{"example.com"}),
AllowedOrigins: cloudflare.F([]string{"example.com"}),
Creator: cloudflare.F("creator-id_abcde12345"),
Expiry: cloudflare.F(time.Now()),
Meta: cloudflare.F[any](map[string]interface{}{
Expand Down
4 changes: 0 additions & 4 deletions stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ func (r *StreamService) Get(ctx context.Context, identifier string, query Stream
return
}

type AllowedOriginsItem = string

type AllowedOriginsItemParam = string

type Video struct {
// Lists the origins allowed to display the video. Enter allowed origin domains in
// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
Expand Down

0 comments on commit 262d4b6

Please sign in to comment.