"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class BoardSetClosed extends BaseCommand_1.BaseCommand {
    async run() {
        const board = await this.client.boards.updateBoard({
            id: this.lookups.board,
            closed: !this.flags.open,
        });
        // Sync after closing a board
        await this.cache.sync();
        this.output(board);
    }
    toData(data) {
        return {
            id: data.id,
            name: data.name,
            desc: data.desc,
            url: data.url,
            closed: data.closed,
        };
    }
}
BoardSetClosed.description = "Change a board's 'closed' status";
BoardSetClosed.flags = {
    board: core_1.Flags.string({ required: true, description: "The board's ID" }),
    open: core_1.Flags.boolean({
        default: false,
        description: "Set the board status to `closed: false`",
    }),
};
exports.default = BoardSetClosed;
