"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvironmentTypeHelper = void 0;
const workbench_core_environments_1 = require("@aws/workbench-core-environments");
const setup_1 = __importDefault(require("../setup"));
const randomTextGenerator_1 = __importDefault(require("../utils/randomTextGenerator"));
class EnvironmentTypeHelper {
    constructor() {
        const setup = setup_1.default.getSetup();
        this._awsSdk = setup.getMainAwsClient();
        this._settings = setup.getSettings();
        this._environmentTypeService = new workbench_core_environments_1.EnvironmentTypeService(this._awsSdk.helpers.ddb);
    }
    async createEnvironmentType(productId, provisioningArtifactId) {
        const randomTextGenerator = new randomTextGenerator_1.default(this._settings.get('runId'));
        return this._environmentTypeService.createNewEnvironmentType({
            description: randomTextGenerator.getFakeText('fakeDescription'),
            name: randomTextGenerator.getFakeText('fakeName'),
            params: {},
            productId,
            provisioningArtifactId,
            status: 'NOT_APPROVED',
            type: randomTextGenerator.getFakeText('fakeType')
        });
    }
    async deleteEnvironmentType(envTypeId) {
        await this._awsSdk.helpers.ddb.delete({ pk: `ET#${envTypeId}`, sk: `ET#${envTypeId}` }).execute();
    }
}
exports.EnvironmentTypeHelper = EnvironmentTypeHelper;
//# sourceMappingURL=environmentTypeHelper.js.map