import { list } from "../../ca-certificate/list/handler.js";
import { captureEvent } from "../../common/analytics/lib.js";
import { authenticate } from "../../common/middleware/authentication.js";
import { fetchAccount } from "../../common/middleware/get-account-param.js";
import { configure } from "../../common/middleware/user-configuration.js";
import { identify } from "../../common/middleware/user-identification.js";
export default {
    desc: "Lists all CA certificates for an account",
    command: "list",
    builder: (yargs) => {
        return yargs
            .usage("$0 ca-certificate list [options]")
            .option("api-key", {
            type: "string",
            describe: "The API Key from Zuplo",
            envVar: "API_KEY",
            alias: "apikey",
        })
            .option("account", {
            type: "string",
            describe: "The account name",
        })
            .option("output", {
            type: "string",
            alias: "o",
            describe: "Output format",
            choices: ["default", "json"],
            default: "default",
        })
            .example([
            ["$0 ca-certificate list", "List all CA certificates for your account"],
            [
                "$0 ca-certificate list --account my-account",
                "Explicitly specify the account",
            ],
            [
                "$0 ca-certificate list --output json",
                "List CA certificates as JSON",
            ],
        ])
            .middleware([authenticate, configure, fetchAccount, identify]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo ca-certificate list" });
        await list(argv);
    },
};
//# sourceMappingURL=list.js.map