// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function gameliftFleetCertificateConfigurationToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        certificate_type: cdktf.stringToTerraform(struct.certificateType),
    };
}
export class GameliftFleetCertificateConfigurationOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._certificateType !== undefined) {
            hasAnyValues = true;
            internalValueResult.certificateType = this._certificateType;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._certificateType = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._certificateType = value.certificateType;
        }
    }
    // certificate_type - computed: false, optional: true, required: false
    _certificateType;
    get certificateType() {
        return this.getStringAttribute('certificate_type');
    }
    set certificateType(value) {
        this._certificateType = value;
    }
    resetCertificateType() {
        this._certificateType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get certificateTypeInput() {
        return this._certificateType;
    }
}
export function gameliftFleetEc2InboundPermissionToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        from_port: cdktf.numberToTerraform(struct.fromPort),
        ip_range: cdktf.stringToTerraform(struct.ipRange),
        protocol: cdktf.stringToTerraform(struct.protocol),
        to_port: cdktf.numberToTerraform(struct.toPort),
    };
}
export function gameliftFleetResourceCreationLimitPolicyToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        new_game_sessions_per_creator: cdktf.numberToTerraform(struct.newGameSessionsPerCreator),
        policy_period_in_minutes: cdktf.numberToTerraform(struct.policyPeriodInMinutes),
    };
}
export class GameliftFleetResourceCreationLimitPolicyOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._newGameSessionsPerCreator !== undefined) {
            hasAnyValues = true;
            internalValueResult.newGameSessionsPerCreator = this._newGameSessionsPerCreator;
        }
        if (this._policyPeriodInMinutes !== undefined) {
            hasAnyValues = true;
            internalValueResult.policyPeriodInMinutes = this._policyPeriodInMinutes;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._newGameSessionsPerCreator = undefined;
            this._policyPeriodInMinutes = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._newGameSessionsPerCreator = value.newGameSessionsPerCreator;
            this._policyPeriodInMinutes = value.policyPeriodInMinutes;
        }
    }
    // new_game_sessions_per_creator - computed: false, optional: true, required: false
    _newGameSessionsPerCreator;
    get newGameSessionsPerCreator() {
        return this.getNumberAttribute('new_game_sessions_per_creator');
    }
    set newGameSessionsPerCreator(value) {
        this._newGameSessionsPerCreator = value;
    }
    resetNewGameSessionsPerCreator() {
        this._newGameSessionsPerCreator = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get newGameSessionsPerCreatorInput() {
        return this._newGameSessionsPerCreator;
    }
    // policy_period_in_minutes - computed: false, optional: true, required: false
    _policyPeriodInMinutes;
    get policyPeriodInMinutes() {
        return this.getNumberAttribute('policy_period_in_minutes');
    }
    set policyPeriodInMinutes(value) {
        this._policyPeriodInMinutes = value;
    }
    resetPolicyPeriodInMinutes() {
        this._policyPeriodInMinutes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyPeriodInMinutesInput() {
        return this._policyPeriodInMinutes;
    }
}
export function gameliftFleetRuntimeConfigurationServerProcessToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        concurrent_executions: cdktf.numberToTerraform(struct.concurrentExecutions),
        launch_path: cdktf.stringToTerraform(struct.launchPath),
        parameters: cdktf.stringToTerraform(struct.parameters),
    };
}
export function gameliftFleetRuntimeConfigurationToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        game_session_activation_timeout_seconds: cdktf.numberToTerraform(struct.gameSessionActivationTimeoutSeconds),
        max_concurrent_game_session_activations: cdktf.numberToTerraform(struct.maxConcurrentGameSessionActivations),
        server_process: cdktf.listMapper(gameliftFleetRuntimeConfigurationServerProcessToTerraform)(struct.serverProcess),
    };
}
export class GameliftFleetRuntimeConfigurationOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._gameSessionActivationTimeoutSeconds !== undefined) {
            hasAnyValues = true;
            internalValueResult.gameSessionActivationTimeoutSeconds = this._gameSessionActivationTimeoutSeconds;
        }
        if (this._maxConcurrentGameSessionActivations !== undefined) {
            hasAnyValues = true;
            internalValueResult.maxConcurrentGameSessionActivations = this._maxConcurrentGameSessionActivations;
        }
        if (this._serverProcess !== undefined) {
            hasAnyValues = true;
            internalValueResult.serverProcess = this._serverProcess;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._gameSessionActivationTimeoutSeconds = undefined;
            this._maxConcurrentGameSessionActivations = undefined;
            this._serverProcess = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._gameSessionActivationTimeoutSeconds = value.gameSessionActivationTimeoutSeconds;
            this._maxConcurrentGameSessionActivations = value.maxConcurrentGameSessionActivations;
            this._serverProcess = value.serverProcess;
        }
    }
    // game_session_activation_timeout_seconds - computed: false, optional: true, required: false
    _gameSessionActivationTimeoutSeconds;
    get gameSessionActivationTimeoutSeconds() {
        return this.getNumberAttribute('game_session_activation_timeout_seconds');
    }
    set gameSessionActivationTimeoutSeconds(value) {
        this._gameSessionActivationTimeoutSeconds = value;
    }
    resetGameSessionActivationTimeoutSeconds() {
        this._gameSessionActivationTimeoutSeconds = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get gameSessionActivationTimeoutSecondsInput() {
        return this._gameSessionActivationTimeoutSeconds;
    }
    // max_concurrent_game_session_activations - computed: false, optional: true, required: false
    _maxConcurrentGameSessionActivations;
    get maxConcurrentGameSessionActivations() {
        return this.getNumberAttribute('max_concurrent_game_session_activations');
    }
    set maxConcurrentGameSessionActivations(value) {
        this._maxConcurrentGameSessionActivations = value;
    }
    resetMaxConcurrentGameSessionActivations() {
        this._maxConcurrentGameSessionActivations = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maxConcurrentGameSessionActivationsInput() {
        return this._maxConcurrentGameSessionActivations;
    }
    // server_process - computed: false, optional: true, required: false
    _serverProcess;
    get serverProcess() {
        // Getting the computed value is not yet implemented
        return this.interpolationForAttribute('server_process');
    }
    set serverProcess(value) {
        this._serverProcess = value;
    }
    resetServerProcess() {
        this._serverProcess = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get serverProcessInput() {
        return this._serverProcess;
    }
}
export function gameliftFleetTimeoutsToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
        return struct;
    }
    if (cdktf.isComplexElement(struct)) {
        throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
    }
    return {
        create: cdktf.stringToTerraform(struct.create),
        delete: cdktf.stringToTerraform(struct.delete),
    };
}
export class GameliftFleetTimeoutsOutputReference extends cdktf.ComplexObject {
    isEmptyObject = false;
    /**
    * @param terraformResource The parent resource
    * @param terraformAttribute The attribute on the parent resource this class is referencing
    * @param isSingleItem True if this is a block, false if it's a list
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._create !== undefined) {
            hasAnyValues = true;
            internalValueResult.create = this._create;
        }
        if (this._delete !== undefined) {
            hasAnyValues = true;
            internalValueResult.delete = this._delete;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._create = undefined;
            this._delete = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            this._delete = value.delete;
        }
    }
    // create - computed: false, optional: true, required: false
    _create;
    get create() {
        return this.getStringAttribute('create');
    }
    set create(value) {
        this._create = value;
    }
    resetCreate() {
        this._create = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get createInput() {
        return this._create;
    }
    // delete - computed: false, optional: true, required: false
    _delete;
    get delete() {
        return this.getStringAttribute('delete');
    }
    set delete(value) {
        this._delete = value;
    }
    resetDelete() {
        this._delete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deleteInput() {
        return this._delete;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/gamelift_fleet aws_gamelift_fleet}
*/
export class GameliftFleet extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_gamelift_fleet";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/gamelift_fleet aws_gamelift_fleet} Resource
    *
    * @param scope The scope in which to define this construct
    * @param id The scoped construct ID. Must be unique amongst siblings in the same scope
    * @param options GameliftFleetConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_gamelift_fleet',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._buildId = config.buildId;
        this._description = config.description;
        this._ec2InstanceType = config.ec2InstanceType;
        this._fleetType = config.fleetType;
        this._instanceRoleArn = config.instanceRoleArn;
        this._metricGroups = config.metricGroups;
        this._name = config.name;
        this._newGameSessionProtectionPolicy = config.newGameSessionProtectionPolicy;
        this._scriptId = config.scriptId;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._certificateConfiguration.internalValue = config.certificateConfiguration;
        this._ec2InboundPermission = config.ec2InboundPermission;
        this._resourceCreationLimitPolicy.internalValue = config.resourceCreationLimitPolicy;
        this._runtimeConfiguration.internalValue = config.runtimeConfiguration;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // build_arn - computed: true, optional: false, required: false
    get buildArn() {
        return this.getStringAttribute('build_arn');
    }
    // build_id - computed: false, optional: true, required: false
    _buildId;
    get buildId() {
        return this.getStringAttribute('build_id');
    }
    set buildId(value) {
        this._buildId = value;
    }
    resetBuildId() {
        this._buildId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get buildIdInput() {
        return this._buildId;
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // ec2_instance_type - computed: false, optional: false, required: true
    _ec2InstanceType;
    get ec2InstanceType() {
        return this.getStringAttribute('ec2_instance_type');
    }
    set ec2InstanceType(value) {
        this._ec2InstanceType = value;
    }
    // Temporarily expose input value. Use with caution.
    get ec2InstanceTypeInput() {
        return this._ec2InstanceType;
    }
    // fleet_type - computed: false, optional: true, required: false
    _fleetType;
    get fleetType() {
        return this.getStringAttribute('fleet_type');
    }
    set fleetType(value) {
        this._fleetType = value;
    }
    resetFleetType() {
        this._fleetType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get fleetTypeInput() {
        return this._fleetType;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // instance_role_arn - computed: false, optional: true, required: false
    _instanceRoleArn;
    get instanceRoleArn() {
        return this.getStringAttribute('instance_role_arn');
    }
    set instanceRoleArn(value) {
        this._instanceRoleArn = value;
    }
    resetInstanceRoleArn() {
        this._instanceRoleArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get instanceRoleArnInput() {
        return this._instanceRoleArn;
    }
    // log_paths - computed: true, optional: false, required: false
    get logPaths() {
        return this.getListAttribute('log_paths');
    }
    // metric_groups - computed: true, optional: true, required: false
    _metricGroups;
    get metricGroups() {
        return this.getListAttribute('metric_groups');
    }
    set metricGroups(value) {
        this._metricGroups = value;
    }
    resetMetricGroups() {
        this._metricGroups = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get metricGroupsInput() {
        return this._metricGroups;
    }
    // name - computed: false, optional: false, required: true
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // new_game_session_protection_policy - computed: false, optional: true, required: false
    _newGameSessionProtectionPolicy;
    get newGameSessionProtectionPolicy() {
        return this.getStringAttribute('new_game_session_protection_policy');
    }
    set newGameSessionProtectionPolicy(value) {
        this._newGameSessionProtectionPolicy = value;
    }
    resetNewGameSessionProtectionPolicy() {
        this._newGameSessionProtectionPolicy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get newGameSessionProtectionPolicyInput() {
        return this._newGameSessionProtectionPolicy;
    }
    // operating_system - computed: true, optional: false, required: false
    get operatingSystem() {
        return this.getStringAttribute('operating_system');
    }
    // script_arn - computed: true, optional: false, required: false
    get scriptArn() {
        return this.getStringAttribute('script_arn');
    }
    // script_id - computed: false, optional: true, required: false
    _scriptId;
    get scriptId() {
        return this.getStringAttribute('script_id');
    }
    set scriptId(value) {
        this._scriptId = value;
    }
    resetScriptId() {
        this._scriptId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get scriptIdInput() {
        return this._scriptId;
    }
    // tags - computed: false, optional: true, required: false
    _tags;
    get tags() {
        return this.getStringMapAttribute('tags');
    }
    set tags(value) {
        this._tags = value;
    }
    resetTags() {
        this._tags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsInput() {
        return this._tags;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // certificate_configuration - computed: false, optional: true, required: false
    _certificateConfiguration = new GameliftFleetCertificateConfigurationOutputReference(this, "certificate_configuration", true);
    get certificateConfiguration() {
        return this._certificateConfiguration;
    }
    putCertificateConfiguration(value) {
        this._certificateConfiguration.internalValue = value;
    }
    resetCertificateConfiguration() {
        this._certificateConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get certificateConfigurationInput() {
        return this._certificateConfiguration.internalValue;
    }
    // ec2_inbound_permission - computed: false, optional: true, required: false
    _ec2InboundPermission;
    get ec2InboundPermission() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('ec2_inbound_permission')));
    }
    set ec2InboundPermission(value) {
        this._ec2InboundPermission = value;
    }
    resetEc2InboundPermission() {
        this._ec2InboundPermission = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ec2InboundPermissionInput() {
        return this._ec2InboundPermission;
    }
    // resource_creation_limit_policy - computed: false, optional: true, required: false
    _resourceCreationLimitPolicy = new GameliftFleetResourceCreationLimitPolicyOutputReference(this, "resource_creation_limit_policy", true);
    get resourceCreationLimitPolicy() {
        return this._resourceCreationLimitPolicy;
    }
    putResourceCreationLimitPolicy(value) {
        this._resourceCreationLimitPolicy.internalValue = value;
    }
    resetResourceCreationLimitPolicy() {
        this._resourceCreationLimitPolicy.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get resourceCreationLimitPolicyInput() {
        return this._resourceCreationLimitPolicy.internalValue;
    }
    // runtime_configuration - computed: false, optional: true, required: false
    _runtimeConfiguration = new GameliftFleetRuntimeConfigurationOutputReference(this, "runtime_configuration", true);
    get runtimeConfiguration() {
        return this._runtimeConfiguration;
    }
    putRuntimeConfiguration(value) {
        this._runtimeConfiguration.internalValue = value;
    }
    resetRuntimeConfiguration() {
        this._runtimeConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get runtimeConfigurationInput() {
        return this._runtimeConfiguration.internalValue;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new GameliftFleetTimeoutsOutputReference(this, "timeouts", true);
    get timeouts() {
        return this._timeouts;
    }
    putTimeouts(value) {
        this._timeouts.internalValue = value;
    }
    resetTimeouts() {
        this._timeouts.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutsInput() {
        return this._timeouts.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            build_id: cdktf.stringToTerraform(this._buildId),
            description: cdktf.stringToTerraform(this._description),
            ec2_instance_type: cdktf.stringToTerraform(this._ec2InstanceType),
            fleet_type: cdktf.stringToTerraform(this._fleetType),
            instance_role_arn: cdktf.stringToTerraform(this._instanceRoleArn),
            metric_groups: cdktf.listMapper(cdktf.stringToTerraform)(this._metricGroups),
            name: cdktf.stringToTerraform(this._name),
            new_game_session_protection_policy: cdktf.stringToTerraform(this._newGameSessionProtectionPolicy),
            script_id: cdktf.stringToTerraform(this._scriptId),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            certificate_configuration: gameliftFleetCertificateConfigurationToTerraform(this._certificateConfiguration.internalValue),
            ec2_inbound_permission: cdktf.listMapper(gameliftFleetEc2InboundPermissionToTerraform)(this._ec2InboundPermission),
            resource_creation_limit_policy: gameliftFleetResourceCreationLimitPolicyToTerraform(this._resourceCreationLimitPolicy.internalValue),
            runtime_configuration: gameliftFleetRuntimeConfigurationToTerraform(this._runtimeConfiguration.internalValue),
            timeouts: gameliftFleetTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=gamelift-fleet.js.map