// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function ecsCapacityProviderAutoScalingGroupProviderManagedScalingToTerraform(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 {
        instance_warmup_period: cdktf.numberToTerraform(struct.instanceWarmupPeriod),
        maximum_scaling_step_size: cdktf.numberToTerraform(struct.maximumScalingStepSize),
        minimum_scaling_step_size: cdktf.numberToTerraform(struct.minimumScalingStepSize),
        status: cdktf.stringToTerraform(struct.status),
        target_capacity: cdktf.numberToTerraform(struct.targetCapacity),
    };
}
export class EcsCapacityProviderAutoScalingGroupProviderManagedScalingOutputReference 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._instanceWarmupPeriod !== undefined) {
            hasAnyValues = true;
            internalValueResult.instanceWarmupPeriod = this._instanceWarmupPeriod;
        }
        if (this._maximumScalingStepSize !== undefined) {
            hasAnyValues = true;
            internalValueResult.maximumScalingStepSize = this._maximumScalingStepSize;
        }
        if (this._minimumScalingStepSize !== undefined) {
            hasAnyValues = true;
            internalValueResult.minimumScalingStepSize = this._minimumScalingStepSize;
        }
        if (this._status !== undefined) {
            hasAnyValues = true;
            internalValueResult.status = this._status;
        }
        if (this._targetCapacity !== undefined) {
            hasAnyValues = true;
            internalValueResult.targetCapacity = this._targetCapacity;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._instanceWarmupPeriod = undefined;
            this._maximumScalingStepSize = undefined;
            this._minimumScalingStepSize = undefined;
            this._status = undefined;
            this._targetCapacity = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._instanceWarmupPeriod = value.instanceWarmupPeriod;
            this._maximumScalingStepSize = value.maximumScalingStepSize;
            this._minimumScalingStepSize = value.minimumScalingStepSize;
            this._status = value.status;
            this._targetCapacity = value.targetCapacity;
        }
    }
    // instance_warmup_period - computed: true, optional: true, required: false
    _instanceWarmupPeriod;
    get instanceWarmupPeriod() {
        return this.getNumberAttribute('instance_warmup_period');
    }
    set instanceWarmupPeriod(value) {
        this._instanceWarmupPeriod = value;
    }
    resetInstanceWarmupPeriod() {
        this._instanceWarmupPeriod = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get instanceWarmupPeriodInput() {
        return this._instanceWarmupPeriod;
    }
    // maximum_scaling_step_size - computed: true, optional: true, required: false
    _maximumScalingStepSize;
    get maximumScalingStepSize() {
        return this.getNumberAttribute('maximum_scaling_step_size');
    }
    set maximumScalingStepSize(value) {
        this._maximumScalingStepSize = value;
    }
    resetMaximumScalingStepSize() {
        this._maximumScalingStepSize = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maximumScalingStepSizeInput() {
        return this._maximumScalingStepSize;
    }
    // minimum_scaling_step_size - computed: true, optional: true, required: false
    _minimumScalingStepSize;
    get minimumScalingStepSize() {
        return this.getNumberAttribute('minimum_scaling_step_size');
    }
    set minimumScalingStepSize(value) {
        this._minimumScalingStepSize = value;
    }
    resetMinimumScalingStepSize() {
        this._minimumScalingStepSize = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get minimumScalingStepSizeInput() {
        return this._minimumScalingStepSize;
    }
    // status - computed: true, optional: true, required: false
    _status;
    get status() {
        return this.getStringAttribute('status');
    }
    set status(value) {
        this._status = value;
    }
    resetStatus() {
        this._status = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statusInput() {
        return this._status;
    }
    // target_capacity - computed: true, optional: true, required: false
    _targetCapacity;
    get targetCapacity() {
        return this.getNumberAttribute('target_capacity');
    }
    set targetCapacity(value) {
        this._targetCapacity = value;
    }
    resetTargetCapacity() {
        this._targetCapacity = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get targetCapacityInput() {
        return this._targetCapacity;
    }
}
export function ecsCapacityProviderAutoScalingGroupProviderToTerraform(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 {
        auto_scaling_group_arn: cdktf.stringToTerraform(struct.autoScalingGroupArn),
        managed_termination_protection: cdktf.stringToTerraform(struct.managedTerminationProtection),
        managed_scaling: ecsCapacityProviderAutoScalingGroupProviderManagedScalingToTerraform(struct.managedScaling),
    };
}
export class EcsCapacityProviderAutoScalingGroupProviderOutputReference 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._autoScalingGroupArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.autoScalingGroupArn = this._autoScalingGroupArn;
        }
        if (this._managedTerminationProtection !== undefined) {
            hasAnyValues = true;
            internalValueResult.managedTerminationProtection = this._managedTerminationProtection;
        }
        if (this._managedScaling?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.managedScaling = this._managedScaling?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._autoScalingGroupArn = undefined;
            this._managedTerminationProtection = undefined;
            this._managedScaling.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._autoScalingGroupArn = value.autoScalingGroupArn;
            this._managedTerminationProtection = value.managedTerminationProtection;
            this._managedScaling.internalValue = value.managedScaling;
        }
    }
    // auto_scaling_group_arn - computed: false, optional: false, required: true
    _autoScalingGroupArn;
    get autoScalingGroupArn() {
        return this.getStringAttribute('auto_scaling_group_arn');
    }
    set autoScalingGroupArn(value) {
        this._autoScalingGroupArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get autoScalingGroupArnInput() {
        return this._autoScalingGroupArn;
    }
    // managed_termination_protection - computed: true, optional: true, required: false
    _managedTerminationProtection;
    get managedTerminationProtection() {
        return this.getStringAttribute('managed_termination_protection');
    }
    set managedTerminationProtection(value) {
        this._managedTerminationProtection = value;
    }
    resetManagedTerminationProtection() {
        this._managedTerminationProtection = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get managedTerminationProtectionInput() {
        return this._managedTerminationProtection;
    }
    // managed_scaling - computed: false, optional: true, required: false
    _managedScaling = new EcsCapacityProviderAutoScalingGroupProviderManagedScalingOutputReference(this, "managed_scaling", true);
    get managedScaling() {
        return this._managedScaling;
    }
    putManagedScaling(value) {
        this._managedScaling.internalValue = value;
    }
    resetManagedScaling() {
        this._managedScaling.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get managedScalingInput() {
        return this._managedScaling.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/ecs_capacity_provider aws_ecs_capacity_provider}
*/
export class EcsCapacityProvider extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_ecs_capacity_provider";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ecs_capacity_provider aws_ecs_capacity_provider} 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 EcsCapacityProviderConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_ecs_capacity_provider',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._autoScalingGroupProvider.internalValue = config.autoScalingGroupProvider;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // 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;
    }
    // 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;
    }
    // auto_scaling_group_provider - computed: false, optional: false, required: true
    _autoScalingGroupProvider = new EcsCapacityProviderAutoScalingGroupProviderOutputReference(this, "auto_scaling_group_provider", true);
    get autoScalingGroupProvider() {
        return this._autoScalingGroupProvider;
    }
    putAutoScalingGroupProvider(value) {
        this._autoScalingGroupProvider.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get autoScalingGroupProviderInput() {
        return this._autoScalingGroupProvider.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            auto_scaling_group_provider: ecsCapacityProviderAutoScalingGroupProviderToTerraform(this._autoScalingGroupProvider.internalValue),
        };
    }
}
//# sourceMappingURL=ecs-capacity-provider.js.map