import { deleteCommand } from "../../ca-certificate/delete/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: "Deletes a CA certificate by ID",
    command: "delete",
    builder: (yargs) => {
        return yargs
            .usage("$0 ca-certificate delete --cert-id <id> [options]")
            .option("cert-id", {
            type: "string",
            describe: "The ID of the CA certificate to delete",
        })
            .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",
        })
            .demandOption(["cert-id"])
            .example([
            [
                "$0 ca-certificate delete --cert-id mtlsca_abc123",
                "Delete a CA certificate",
            ],
            [
                "$0 ca-certificate delete --cert-id mtlsca_abc123 --output json",
                "Delete a CA certificate and output the result as JSON",
            ],
            [
                "$0 ca-certificate delete --cert-id mtlsca_abc123 --account my-account",
                "Explicitly specify the account",
            ],
        ])
            .middleware([authenticate, configure, fetchAccount, identify]);
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo ca-certificate delete" });
        await deleteCommand(argv);
    },
};
//# sourceMappingURL=delete.js.map