Skip to content

Commit 93f6779

Browse files
feat(api): sora api improvements: character api, video extensions/edits, higher resolution exports.
1 parent 20da043 commit 93f6779

File tree

7 files changed

+174
-241
lines changed

7 files changed

+174
-241
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 139
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-8de5b14ece687aac55187d923c8dca4b8c4a4dbaaa38bb1bcfffc975d441aca8.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-3e207c26eea3b15837c78ef2fe0e1c68937708fd0763971ce749c0bdb7db6376.yml
33
openapi_spec_hash: 626982004d5a594a822fa7883422efb4
4-
config_hash: 8421b0e4dae127df4dcc071c1aa5ea1a
4+
config_hash: 0dda4b3af379312c9c55467a5e1e1ec0

api.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ Methods:
744744

745745
Params Types:
746746

747+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#ImageInputReferenceParam">ImageInputReferenceParam</a>
747748
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoModel">VideoModel</a>
748749
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoSeconds">VideoSeconds</a>
749750
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoSize">VideoSize</a>
@@ -756,26 +757,18 @@ Response Types:
756757
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoSeconds">VideoSeconds</a>
757758
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoSize">VideoSize</a>
758759
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoDeleteResponse">VideoDeleteResponse</a>
760+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoNewCharacterResponse">VideoNewCharacterResponse</a>
761+
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoGetCharacterResponse">VideoGetCharacterResponse</a>
759762

760763
Methods:
761764

762765
- <code title="post /videos">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoNewParams">VideoNewParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
763766
- <code title="get /videos/{video_id}">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, videoID <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
764767
- <code title="get /videos">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoListParams">VideoListParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3/packages/pagination#ConversationCursorPage">ConversationCursorPage</a>[<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
765768
- <code title="delete /videos/{video_id}">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, videoID <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoDeleteResponse">VideoDeleteResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
769+
- <code title="post /videos/characters">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.NewCharacter">NewCharacter</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoNewCharacterParams">VideoNewCharacterParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoNewCharacterResponse">VideoNewCharacterResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
766770
- <code title="get /videos/{video_id}/content">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.DownloadContent">DownloadContent</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, videoID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoDownloadContentParams">VideoDownloadContentParams</a>) (\*http.Response, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
767771
- <code title="post /videos/edits">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.Edit">Edit</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoEditParams">VideoEditParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
768772
- <code title="post /videos/extensions">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.Extend">Extend</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoExtendParams">VideoExtendParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
773+
- <code title="get /videos/characters/{character_id}">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.GetCharacter">GetCharacter</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, characterID <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoGetCharacterResponse">VideoGetCharacterResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
769774
- <code title="post /videos/{video_id}/remix">client.Videos.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoService.Remix">Remix</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, videoID <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoRemixParams">VideoRemixParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#Video">Video</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
770-
771-
## Character
772-
773-
Response Types:
774-
775-
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterNewResponse">VideoCharacterNewResponse</a>
776-
- <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterGetResponse">VideoCharacterGetResponse</a>
777-
778-
Methods:
779-
780-
- <code title="post /videos/characters">client.Videos.Character.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, body <a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterNewParams">VideoCharacterNewParams</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterNewResponse">VideoCharacterNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
781-
- <code title="get /videos/characters/{character_id}">client.Videos.Character.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, characterID <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/openai/openai-go/v3">openai</a>.<a href="https://pkg.go.dev/github.com/openai/openai-go/v3#VideoCharacterGetResponse">VideoCharacterGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

scripts/detect-breaking-changes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ TEST_PATHS=(
5252
skillversion_test.go
5353
skillversioncontent_test.go
5454
video_test.go
55-
videocharacter_test.go
5655
usage_test.go
5756
paginationauto_test.go
5857
paginationmanual_test.go

video.go

Lines changed: 119 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ import (
3131
// automatically. You should not instantiate this service directly, and instead use
3232
// the [NewVideoService] method instead.
3333
type VideoService struct {
34-
Options []option.RequestOption
35-
Character VideoCharacterService
34+
Options []option.RequestOption
3635
}
3736

3837
// NewVideoService generates a new service that applies the given options to each
@@ -41,7 +40,6 @@ type VideoService struct {
4140
func NewVideoService(opts ...option.RequestOption) (r VideoService) {
4241
r = VideoService{}
4342
r.Options = opts
44-
r.Character = NewVideoCharacterService(opts...)
4543
return
4644
}
4745

@@ -112,6 +110,14 @@ func (r *VideoService) Delete(ctx context.Context, videoID string, opts ...optio
112110
return res, err
113111
}
114112

113+
// Create a character from an uploaded video.
114+
func (r *VideoService) NewCharacter(ctx context.Context, body VideoNewCharacterParams, opts ...option.RequestOption) (res *VideoNewCharacterResponse, err error) {
115+
opts = slices.Concat(r.Options, opts)
116+
path := "videos/characters"
117+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
118+
return res, err
119+
}
120+
115121
// Download the generated video bytes or a derived preview asset.
116122
//
117123
// Streams the rendered video content for the specified video job.
@@ -144,6 +150,18 @@ func (r *VideoService) Extend(ctx context.Context, body VideoExtendParams, opts
144150
return res, err
145151
}
146152

153+
// Fetch a character.
154+
func (r *VideoService) GetCharacter(ctx context.Context, characterID string, opts ...option.RequestOption) (res *VideoGetCharacterResponse, err error) {
155+
opts = slices.Concat(r.Options, opts)
156+
if characterID == "" {
157+
err = errors.New("missing required character_id parameter")
158+
return nil, err
159+
}
160+
path := fmt.Sprintf("videos/characters/%s", characterID)
161+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
162+
return res, err
163+
}
164+
147165
// Create a remix of a completed video using a refreshed prompt.
148166
func (r *VideoService) Remix(ctx context.Context, videoID string, body VideoRemixParams, opts ...option.RequestOption) (res *Video, err error) {
149167
opts = slices.Concat(r.Options, opts)
@@ -156,6 +174,21 @@ func (r *VideoService) Remix(ctx context.Context, videoID string, body VideoRemi
156174
return res, err
157175
}
158176

177+
type ImageInputReferenceParam struct {
178+
FileID param.Opt[string] `json:"file_id,omitzero"`
179+
// A fully qualified URL or base64-encoded data URL.
180+
ImageURL param.Opt[string] `json:"image_url,omitzero"`
181+
paramObj
182+
}
183+
184+
func (r ImageInputReferenceParam) MarshalJSON() (data []byte, err error) {
185+
type shadow ImageInputReferenceParam
186+
return param.MarshalObject(r, (*shadow)(&r))
187+
}
188+
func (r *ImageInputReferenceParam) UnmarshalJSON(data []byte) error {
189+
return apijson.UnmarshalRoot(data, r)
190+
}
191+
159192
// Structured information describing a generated video job.
160193
type Video struct {
161194
// Unique identifier for the video job.
@@ -297,6 +330,52 @@ func (r *VideoDeleteResponse) UnmarshalJSON(data []byte) error {
297330
return apijson.UnmarshalRoot(data, r)
298331
}
299332

333+
type VideoNewCharacterResponse struct {
334+
// Identifier for the character creation cameo.
335+
ID string `json:"id" api:"required"`
336+
// Unix timestamp (in seconds) when the character was created.
337+
CreatedAt int64 `json:"created_at" api:"required"`
338+
// Display name for the character.
339+
Name string `json:"name" api:"required"`
340+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
341+
JSON struct {
342+
ID respjson.Field
343+
CreatedAt respjson.Field
344+
Name respjson.Field
345+
ExtraFields map[string]respjson.Field
346+
raw string
347+
} `json:"-"`
348+
}
349+
350+
// Returns the unmodified JSON received from the API
351+
func (r VideoNewCharacterResponse) RawJSON() string { return r.JSON.raw }
352+
func (r *VideoNewCharacterResponse) UnmarshalJSON(data []byte) error {
353+
return apijson.UnmarshalRoot(data, r)
354+
}
355+
356+
type VideoGetCharacterResponse struct {
357+
// Identifier for the character creation cameo.
358+
ID string `json:"id" api:"required"`
359+
// Unix timestamp (in seconds) when the character was created.
360+
CreatedAt int64 `json:"created_at" api:"required"`
361+
// Display name for the character.
362+
Name string `json:"name" api:"required"`
363+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
364+
JSON struct {
365+
ID respjson.Field
366+
CreatedAt respjson.Field
367+
Name respjson.Field
368+
ExtraFields map[string]respjson.Field
369+
raw string
370+
} `json:"-"`
371+
}
372+
373+
// Returns the unmodified JSON received from the API
374+
func (r VideoGetCharacterResponse) RawJSON() string { return r.JSON.raw }
375+
func (r *VideoGetCharacterResponse) UnmarshalJSON(data []byte) error {
376+
return apijson.UnmarshalRoot(data, r)
377+
}
378+
300379
type VideoNewParams struct {
301380
// Text prompt that describes the video to generate.
302381
Prompt string `json:"prompt" api:"required"`
@@ -339,13 +418,13 @@ func (r VideoNewParams) MarshalMultipart() (data []byte, contentType string, err
339418
//
340419
// Use [param.IsOmitted] to confirm if a field is set.
341420
type VideoNewParamsInputReferenceUnion struct {
342-
OfFile io.Reader `json:",omitzero,inline"`
343-
OfVideoNewsInputReferenceImageRefParam2 *VideoNewParamsInputReferenceImageRefParam2 `json:",omitzero,inline"`
421+
OfFile io.Reader `json:",omitzero,inline"`
422+
OfImageInputReference *ImageInputReferenceParam `json:",omitzero,inline"`
344423
paramUnion
345424
}
346425

347426
func (u VideoNewParamsInputReferenceUnion) MarshalJSON() ([]byte, error) {
348-
return param.MarshalUnion(u, u.OfFile, u.OfVideoNewsInputReferenceImageRefParam2)
427+
return param.MarshalUnion(u, u.OfFile, u.OfImageInputReference)
349428
}
350429
func (u *VideoNewParamsInputReferenceUnion) UnmarshalJSON(data []byte) error {
351430
return apijson.UnmarshalRoot(data, u)
@@ -354,27 +433,12 @@ func (u *VideoNewParamsInputReferenceUnion) UnmarshalJSON(data []byte) error {
354433
func (u *VideoNewParamsInputReferenceUnion) asAny() any {
355434
if !param.IsOmitted(u.OfFile) {
356435
return &u.OfFile
357-
} else if !param.IsOmitted(u.OfVideoNewsInputReferenceImageRefParam2) {
358-
return u.OfVideoNewsInputReferenceImageRefParam2
436+
} else if !param.IsOmitted(u.OfImageInputReference) {
437+
return u.OfImageInputReference
359438
}
360439
return nil
361440
}
362441

363-
type VideoNewParamsInputReferenceImageRefParam2 struct {
364-
FileID param.Opt[string] `json:"file_id,omitzero"`
365-
// A fully qualified URL or base64-encoded data URL.
366-
ImageURL param.Opt[string] `json:"image_url,omitzero"`
367-
paramObj
368-
}
369-
370-
func (r VideoNewParamsInputReferenceImageRefParam2) MarshalJSON() (data []byte, err error) {
371-
type shadow VideoNewParamsInputReferenceImageRefParam2
372-
return param.MarshalObject(r, (*shadow)(&r))
373-
}
374-
func (r *VideoNewParamsInputReferenceImageRefParam2) UnmarshalJSON(data []byte) error {
375-
return apijson.UnmarshalRoot(data, r)
376-
}
377-
378442
type VideoListParams struct {
379443
// Identifier for the last item from the previous pagination request
380444
After param.Opt[string] `query:"after,omitzero" json:"-"`
@@ -405,6 +469,32 @@ const (
405469
VideoListParamsOrderDesc VideoListParamsOrder = "desc"
406470
)
407471

472+
type VideoNewCharacterParams struct {
473+
// Display name for this API character.
474+
Name string `json:"name" api:"required"`
475+
// Video file used to create a character.
476+
Video io.Reader `json:"video,omitzero" api:"required" format:"binary"`
477+
paramObj
478+
}
479+
480+
func (r VideoNewCharacterParams) MarshalMultipart() (data []byte, contentType string, err error) {
481+
buf := bytes.NewBuffer(nil)
482+
writer := multipart.NewWriter(buf)
483+
err = apiform.MarshalRoot(r, writer)
484+
if err == nil {
485+
err = apiform.WriteExtras(writer, r.ExtraFields())
486+
}
487+
if err != nil {
488+
writer.Close()
489+
return nil, "", err
490+
}
491+
err = writer.Close()
492+
if err != nil {
493+
return nil, "", err
494+
}
495+
return buf.Bytes(), writer.FormDataContentType(), nil
496+
}
497+
408498
type VideoDownloadContentParams struct {
409499
// Which downloadable asset to return. Defaults to the MP4 video.
410500
//
@@ -507,7 +597,7 @@ type VideoExtendParams struct {
507597
//
508598
// Any of "4", "8", "12".
509599
Seconds VideoSeconds `json:"seconds,omitzero" api:"required"`
510-
// Reference to the completed video.
600+
// Reference to the completed video to extend.
511601
Video VideoExtendParamsVideoUnion `json:"video,omitzero" api:"required" format:"binary"`
512602
paramObj
513603
}
@@ -534,23 +624,23 @@ func (r VideoExtendParams) MarshalMultipart() (data []byte, contentType string,
534624
//
535625
// Use [param.IsOmitted] to confirm if a field is set.
536626
type VideoExtendParamsVideoUnion struct {
537-
OfVideoExtendsVideoVideoReferenceInputParam *VideoExtendParamsVideoVideoReferenceInputParam `json:",omitzero,inline"`
538627
OfFile io.Reader `json:",omitzero,inline"`
628+
OfVideoExtendsVideoVideoReferenceInputParam *VideoExtendParamsVideoVideoReferenceInputParam `json:",omitzero,inline"`
539629
paramUnion
540630
}
541631

542632
func (u VideoExtendParamsVideoUnion) MarshalJSON() ([]byte, error) {
543-
return param.MarshalUnion(u, u.OfVideoExtendsVideoVideoReferenceInputParam, u.OfFile)
633+
return param.MarshalUnion(u, u.OfFile, u.OfVideoExtendsVideoVideoReferenceInputParam)
544634
}
545635
func (u *VideoExtendParamsVideoUnion) UnmarshalJSON(data []byte) error {
546636
return apijson.UnmarshalRoot(data, u)
547637
}
548638

549639
func (u *VideoExtendParamsVideoUnion) asAny() any {
550-
if !param.IsOmitted(u.OfVideoExtendsVideoVideoReferenceInputParam) {
551-
return u.OfVideoExtendsVideoVideoReferenceInputParam
552-
} else if !param.IsOmitted(u.OfFile) {
640+
if !param.IsOmitted(u.OfFile) {
553641
return &u.OfFile
642+
} else if !param.IsOmitted(u.OfVideoExtendsVideoVideoReferenceInputParam) {
643+
return u.OfVideoExtendsVideoVideoReferenceInputParam
554644
}
555645
return nil
556646
}

0 commit comments

Comments
 (0)