import { createApiClient } from "../../common/api/client.js";
import { printJsonToConsoleAndExitGracefully, printResultToConsole, } from "../../common/output.js";
export async function deleteCommand(argv) {
    const { account } = argv;
    const certId = argv["cert-id"];
    const client = createApiClient({ authToken: argv.authToken });
    await client.delete(`/v1/accounts/${account}/client-mtls-ca-certificates/${encodeURIComponent(certId)}`, {
        operation: "Failed to delete CA certificate",
        errorMessage: "Error: Failed to delete CA certificate.",
        emptyResponse: true,
    });
    if (argv.output === "json") {
        await printJsonToConsoleAndExitGracefully({ id: certId, deleted: true });
        return;
    }
    printResultToConsole(`CA certificate ${certId} deleted successfully`);
}
//# sourceMappingURL=handler.js.map