Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func (at AutoTranscription) MarshalJSON() ([]byte, error) {
return []byte(strconv.Quote(string(marshalled))), nil
}

// AutoVideoDetails represents the auto video details param.
type AutoVideoDetails struct{}

// BriefAssetResult represents a partial asset result that is returned when assets are listed.
type BriefAssetResult struct {
AssetID string `json:"asset_id"`
Expand Down
28 changes: 28 additions & 0 deletions api/uploader/upload_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,34 @@ func getAutoTranscriptionTestCases() []UploadAPIAcceptanceTestCase {
}
}

// Acceptance test cases for auto video details
func getAutoVideoDetailsTestCases() []UploadAPIAcceptanceTestCase {
bodyEmpty := "auto_video_details=%7B%7D" +
"&file=data%3Aimage%2Fgif%3Bbase64%2CR0lGODlhAQABAIAAAAAAAP%2F%2F%2FyH5BAEAAAAALAAAAAABAAEAAAIBRAA7" +
"&timestamp=123456789" +
"&unsigned=true"

return []UploadAPIAcceptanceTestCase{
{
Name: "Upload Test Auto Video Details Empty",
RequestTest: func(uploadAPI *uploader.API, ctx context.Context) (interface{}, error) {
return uploadAPI.Upload(ctx, cldtest.Base64Image, uploader.UploadParams{
AutoVideoDetails: &api.AutoVideoDetails{},
Unsigned: api.Bool(true),
Timestamp: 123456789,
})
},
ResponseTest: func(response interface{}, t *testing.T) {},
ExpectedRequest: cldtest.ExpectedRequestParams{
Method: "POST",
URI: "/auto/upload",
Body: &bodyEmpty,
},
ExpectedCallCount: 1,
},
}
}

// Acceptance test cases for handling of boolean values
func getBooleanValuesTestCases() []UploadAPIAcceptanceTestCase {
body := "file=data%3Aimage%2Fgif%3Bbase64%2CR0lGODlhAQABAIAAAAAAAP%2F%2F%2FyH5BAEAAAAALAAAAAABAAEAAAIBRAA7" +
Expand Down
1 change: 1 addition & 0 deletions api/uploader/upload_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ type UploadParams struct {
CinemagraphAnalysis *bool `json:"cinemagraph_analysis,omitempty"`
AutoChaptering *bool `json:"auto_chaptering,omitempty"`
AutoTranscription *api.AutoTranscription `json:"auto_transcription,omitempty"`
AutoVideoDetails *api.AutoVideoDetails `json:"auto_video_details,omitempty"`
}

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