/* eslint-disable @typescript-eslint/unified-signatures */
import { HttpStep } from '../../HttpStep.js';
export const DeleteVariableStepKind = 'HttpAction#DeleteVariable';
export class DeleteVariableStep extends HttpStep {
    kind = DeleteVariableStepKind;
    /**
     * The name of the variable to delete
     */
    name = '';
    constructor(nameOrInit) {
        super();
        if (!nameOrInit) {
            return;
        }
        if (typeof nameOrInit === 'object') {
            const typed = nameOrInit;
            this.new(typed);
        }
        else if (typeof nameOrInit === 'string') {
            this.new({
                kind: DeleteVariableStepKind,
                name: nameOrInit,
                enabled: true,
            });
        }
    }
    new(init) {
        super.new(init);
        this.kind = DeleteVariableStepKind;
        this.name = init.name;
    }
    checkValidity() {
        const { name } = this;
        return !!name;
    }
    toJSON() {
        const result = {
            ...super.toJSON(),
            kind: DeleteVariableStepKind,
            name: this.name,
        };
        return result;
    }
}
//# sourceMappingURL=DeleteVariableStep.js.map