"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VideoStudioCommand = void 0;
const shared_1 = require("../shared");
class VideoStudioCommand extends shared_1.AbstractCommand {
    static getComplexTask() {
        return [
            {
                name: 'cut',
                options: {
                    start: 1,
                    end: 3
                }
            },
            {
                name: 'add-outro',
                options: {
                    file: 'video_short.webm'
                }
            },
            {
                name: 'add-watermark',
                options: {
                    file: 'thumbnail.png'
                }
            },
            {
                name: 'add-intro',
                options: {
                    file: 'video_very_short_240p.mp4'
                }
            }
        ];
    }
    createEditionTasks(options) {
        const path = '/api/v1/videos/' + options.videoId + '/studio/edit';
        const attaches = {};
        for (let i = 0; i < options.tasks.length; i++) {
            const task = options.tasks[i];
            if (task.name === 'add-intro' || task.name === 'add-outro' || task.name === 'add-watermark') {
                attaches[`tasks[${i}][options][file]`] = task.options.file;
            }
        }
        return this.postUploadRequest(Object.assign(Object.assign({}, options), { path,
            attaches, fields: { tasks: options.tasks }, implicitToken: true, defaultExpectedStatus: 204 }));
    }
}
exports.VideoStudioCommand = VideoStudioCommand;
//# sourceMappingURL=video-studio-command.js.map