Skip to content

Commit 7549d12

Browse files
Add support for AutoVideoDetails upload parameter
1 parent ae6067f commit 7549d12

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

api/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ func (at AutoTranscription) MarshalJSON() ([]byte, error) {
185185
return []byte(strconv.Quote(string(marshalled))), nil
186186
}
187187

188+
// AutoVideoDetails represents the auto video details param.
189+
type AutoVideoDetails struct{}
190+
188191
// BriefAssetResult represents a partial asset result that is returned when assets are listed.
189192
type BriefAssetResult struct {
190193
AssetID string `json:"asset_id"`

api/uploader/upload_acceptance_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,34 @@ func getAutoTranscriptionTestCases() []UploadAPIAcceptanceTestCase {
154154
}
155155
}
156156

157+
// Acceptance test cases for auto video details
158+
func getAutoVideoDetailsTestCases() []UploadAPIAcceptanceTestCase {
159+
bodyEmpty := "auto_video_details=%7B%7D" +
160+
"&file=data%3Aimage%2Fgif%3Bbase64%2CR0lGODlhAQABAIAAAAAAAP%2F%2F%2FyH5BAEAAAAALAAAAAABAAEAAAIBRAA7" +
161+
"&timestamp=123456789" +
162+
"&unsigned=true"
163+
164+
return []UploadAPIAcceptanceTestCase{
165+
{
166+
Name: "Upload Test Auto Video Details Empty",
167+
RequestTest: func(uploadAPI *uploader.API, ctx context.Context) (interface{}, error) {
168+
return uploadAPI.Upload(ctx, cldtest.Base64Image, uploader.UploadParams{
169+
AutoVideoDetails: &api.AutoVideoDetails{},
170+
Unsigned: api.Bool(true),
171+
Timestamp: 123456789,
172+
})
173+
},
174+
ResponseTest: func(response interface{}, t *testing.T) {},
175+
ExpectedRequest: cldtest.ExpectedRequestParams{
176+
Method: "POST",
177+
URI: "/auto/upload",
178+
Body: &bodyEmpty,
179+
},
180+
ExpectedCallCount: 1,
181+
},
182+
}
183+
}
184+
157185
// Acceptance test cases for handling of boolean values
158186
func getBooleanValuesTestCases() []UploadAPIAcceptanceTestCase {
159187
body := "file=data%3Aimage%2Fgif%3Bbase64%2CR0lGODlhAQABAIAAAAAAAP%2F%2F%2FyH5BAEAAAAALAAAAAABAAEAAAIBRAA7" +

api/uploader/upload_asset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ type UploadParams struct {
7575
CinemagraphAnalysis *bool `json:"cinemagraph_analysis,omitempty"`
7676
AutoChaptering *bool `json:"auto_chaptering,omitempty"`
7777
AutoTranscription *api.AutoTranscription `json:"auto_transcription,omitempty"`
78+
AutoVideoDetails *api.AutoVideoDetails `json:"auto_video_details,omitempty"`
7879
}
7980

8081
// SingleResponsiveBreakpointsParams represents params for a single responsive breakpoints generation request.

0 commit comments

Comments
 (0)