"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const DiskEncryptionService = {
    diskEncryptionEnableOn(isEnableOnMasters, isEnableOnWorkers, isEnableOnArbiters) {
        let enableOnParam;
        if (isEnableOnMasters && isEnableOnWorkers && isEnableOnArbiters)
            enableOnParam = 'all';
        else if (isEnableOnMasters && isEnableOnWorkers)
            enableOnParam = 'masters,workers';
        else if (isEnableOnMasters && isEnableOnArbiters)
            enableOnParam = 'masters,arbiters';
        else if (isEnableOnWorkers && isEnableOnArbiters)
            enableOnParam = 'arbiters,workers';
        else if (isEnableOnArbiters)
            enableOnParam = 'arbiters';
        else if (isEnableOnWorkers)
            enableOnParam = 'workers';
        else if (isEnableOnMasters)
            enableOnParam = 'masters';
        else
            enableOnParam = 'none';
        return enableOnParam;
    },
    getDiskEncryptionParams(values) {
        return {
            mode: values.diskEncryptionMode,
            enableOn: values.controlPlaneCount === 1
                ? values.enableDiskEncryptionOnMasters
                    ? 'all'
                    : 'none'
                : DiskEncryptionService.diskEncryptionEnableOn(values.enableDiskEncryptionOnMasters, values.enableDiskEncryptionOnWorkers, values.enableDiskEncryptionOnArbiters),
            tangServers: values.diskEncryptionMode === 'tang'
                ? JSON.stringify(values.diskEncryptionTangServers)
                : undefined,
        };
    },
};
exports.default = DiskEncryptionService;
//# sourceMappingURL=DiskEncryptionService.js.map