"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const BaseCommand_1 = require("../../BaseCommand");
const core_1 = require("@oclif/core");
class CardLabel extends BaseCommand_1.BaseCommand {
    async run() {
        const labelId = await this.cache.getLabelIdByName(this.flags.label);
        const result = await this.client.cards.addCardLabel({
            id: this.lookups.card,
            value: labelId,
        });
        this.output(result);
    }
    toData(data) {
        return {
            id: data.id,
            name: data.name,
            labels: data.labels,
        };
    }
}
CardLabel.description = "Add a label to a card";
CardLabel.flags = {
    board: core_1.Flags.string({ required: true }),
    list: core_1.Flags.string({ required: true }),
    card: core_1.Flags.string({ required: true }),
    label: core_1.Flags.string({ required: true }),
};
exports.default = CardLabel;
