import { createApiClient } from "../../common/api/client.js";
import { printResultToConsole } from "../../common/output.js";
export async function create(argv) {
    const { account, project } = argv;
    const client = createApiClient({ authToken: argv.authToken });
    const variable = await client.post(`/v1/accounts/${account}/projects/${project}/branches/${encodeURIComponent(argv["branch"])}/variables`, {
        operation: "Failed to create variable",
        errorMessage: "Error: Failed to create variable. Check the arguments.",
        body: {
            name: argv["name"],
            isSecret: argv["is-secret"],
            value: argv["value"],
        },
    });
    printResultToConsole(`${variable.name} created successfully`);
}
//# sourceMappingURL=handler.js.map