"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const environmentTypeHelper_1 = require("../../complex/environmentTypeHelper");
const constants_1 = require("../../utils/constants");
const utilities_1 = require("../../utils/utilities");
const resource_1 = __importDefault(require("../base/resource"));
const environmentTypeConfigs_1 = __importDefault(require("../environmentTypeConfigs/environmentTypeConfigs"));
class EnvironmentType extends resource_1.default {
    constructor(id, clientSession, parentApi) {
        super(clientSession, 'environmentType', id, parentApi);
        this._clientSession = clientSession;
    }
    configurations() {
        return new environmentTypeConfigs_1.default(this._clientSession, this._api, this._id);
    }
    async cleanup() {
        await (0, utilities_1.sleep)(constants_1.DEFLAKE_DELAY_IN_MILLISECONDS); //Avoid throttling when terminating multiple environment types
        const envTypeHelper = new environmentTypeHelper_1.EnvironmentTypeHelper();
        await envTypeHelper.deleteEnvironmentType(this._id);
    }
}
exports.default = EnvironmentType;
//# sourceMappingURL=environmentType.js.map