"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PushFileStep = void 0;
const MablStepV2_1 = require("../../MablStepV2");
class PushFileStep extends MablStepV2_1.MablStepV2 {
    static stepName = 'PushFile';
    static yamlMablScriptNames = [PushFileStep.stepName];
    static stepVersion = 2;
    constructor(descriptor) {
        super(PushFileStep.stepName, descriptor, PushFileStep.stepName);
    }
    stepDescription() {
        const filesLength = this.descriptor.files.length;
        if (filesLength > 1) {
            return `Push ${filesLength} files to the test device`;
        }
        const firstFile = this.descriptor.files[0];
        if (firstFile.file.name) {
            return `Push the file "${firstFile.file.name}" to the test device at path "${firstFile.path}"`;
        }
        return `Push file to the test device at path "${firstFile.path}"`;
    }
    static fromYaml(_stepName, stepDescriptor) {
        return new PushFileStep(stepDescriptor);
    }
    static create(descriptor) {
        descriptor.id = descriptor.id ?? MablStepV2_1.MablStepV2.generateStepId();
        return new PushFileStep(descriptor);
    }
}
exports.PushFileStep = PushFileStep;
