// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function codedeployDeploymentConfigMinimumHealthyHostsToTerraform(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 {
        type: cdktf.stringToTerraform(struct.type),
        value: cdktf.numberToTerraform(struct.value),
    };
}
export class CodedeployDeploymentConfigMinimumHealthyHostsOutputReference 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._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        if (this._value !== undefined) {
            hasAnyValues = true;
            internalValueResult.value = this._value;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._type = undefined;
            this._value = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._type = value.type;
            this._value = value.value;
        }
    }
    // type - computed: false, optional: true, required: false
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    resetType() {
        this._type = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
    // value - computed: false, optional: true, required: false
    _value;
    get value() {
        return this.getNumberAttribute('value');
    }
    set value(value) {
        this._value = value;
    }
    resetValue() {
        this._value = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get valueInput() {
        return this._value;
    }
}
export function codedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryToTerraform(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 {
        interval: cdktf.numberToTerraform(struct.interval),
        percentage: cdktf.numberToTerraform(struct.percentage),
    };
}
export class CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryOutputReference 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._interval !== undefined) {
            hasAnyValues = true;
            internalValueResult.interval = this._interval;
        }
        if (this._percentage !== undefined) {
            hasAnyValues = true;
            internalValueResult.percentage = this._percentage;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._interval = undefined;
            this._percentage = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._interval = value.interval;
            this._percentage = value.percentage;
        }
    }
    // interval - computed: false, optional: true, required: false
    _interval;
    get interval() {
        return this.getNumberAttribute('interval');
    }
    set interval(value) {
        this._interval = value;
    }
    resetInterval() {
        this._interval = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get intervalInput() {
        return this._interval;
    }
    // percentage - computed: false, optional: true, required: false
    _percentage;
    get percentage() {
        return this.getNumberAttribute('percentage');
    }
    set percentage(value) {
        this._percentage = value;
    }
    resetPercentage() {
        this._percentage = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get percentageInput() {
        return this._percentage;
    }
}
export function codedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearToTerraform(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 {
        interval: cdktf.numberToTerraform(struct.interval),
        percentage: cdktf.numberToTerraform(struct.percentage),
    };
}
export class CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearOutputReference 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._interval !== undefined) {
            hasAnyValues = true;
            internalValueResult.interval = this._interval;
        }
        if (this._percentage !== undefined) {
            hasAnyValues = true;
            internalValueResult.percentage = this._percentage;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._interval = undefined;
            this._percentage = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._interval = value.interval;
            this._percentage = value.percentage;
        }
    }
    // interval - computed: false, optional: true, required: false
    _interval;
    get interval() {
        return this.getNumberAttribute('interval');
    }
    set interval(value) {
        this._interval = value;
    }
    resetInterval() {
        this._interval = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get intervalInput() {
        return this._interval;
    }
    // percentage - computed: false, optional: true, required: false
    _percentage;
    get percentage() {
        return this.getNumberAttribute('percentage');
    }
    set percentage(value) {
        this._percentage = value;
    }
    resetPercentage() {
        this._percentage = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get percentageInput() {
        return this._percentage;
    }
}
export function codedeployDeploymentConfigTrafficRoutingConfigToTerraform(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 {
        type: cdktf.stringToTerraform(struct.type),
        time_based_canary: codedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryToTerraform(struct.timeBasedCanary),
        time_based_linear: codedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearToTerraform(struct.timeBasedLinear),
    };
}
export class CodedeployDeploymentConfigTrafficRoutingConfigOutputReference 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._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        if (this._timeBasedCanary?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.timeBasedCanary = this._timeBasedCanary?.internalValue;
        }
        if (this._timeBasedLinear?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.timeBasedLinear = this._timeBasedLinear?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._type = undefined;
            this._timeBasedCanary.internalValue = undefined;
            this._timeBasedLinear.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._type = value.type;
            this._timeBasedCanary.internalValue = value.timeBasedCanary;
            this._timeBasedLinear.internalValue = value.timeBasedLinear;
        }
    }
    // type - computed: false, optional: true, required: false
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    resetType() {
        this._type = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
    // time_based_canary - computed: false, optional: true, required: false
    _timeBasedCanary = new CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedCanaryOutputReference(this, "time_based_canary", true);
    get timeBasedCanary() {
        return this._timeBasedCanary;
    }
    putTimeBasedCanary(value) {
        this._timeBasedCanary.internalValue = value;
    }
    resetTimeBasedCanary() {
        this._timeBasedCanary.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeBasedCanaryInput() {
        return this._timeBasedCanary.internalValue;
    }
    // time_based_linear - computed: false, optional: true, required: false
    _timeBasedLinear = new CodedeployDeploymentConfigTrafficRoutingConfigTimeBasedLinearOutputReference(this, "time_based_linear", true);
    get timeBasedLinear() {
        return this._timeBasedLinear;
    }
    putTimeBasedLinear(value) {
        this._timeBasedLinear.internalValue = value;
    }
    resetTimeBasedLinear() {
        this._timeBasedLinear.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeBasedLinearInput() {
        return this._timeBasedLinear.internalValue;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config aws_codedeploy_deployment_config}
*/
export class CodedeployDeploymentConfig extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_codedeploy_deployment_config";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/codedeploy_deployment_config aws_codedeploy_deployment_config} 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 CodedeployDeploymentConfigConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_codedeploy_deployment_config',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._computePlatform = config.computePlatform;
        this._deploymentConfigName = config.deploymentConfigName;
        this._minimumHealthyHosts.internalValue = config.minimumHealthyHosts;
        this._trafficRoutingConfig.internalValue = config.trafficRoutingConfig;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // compute_platform - computed: false, optional: true, required: false
    _computePlatform;
    get computePlatform() {
        return this.getStringAttribute('compute_platform');
    }
    set computePlatform(value) {
        this._computePlatform = value;
    }
    resetComputePlatform() {
        this._computePlatform = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get computePlatformInput() {
        return this._computePlatform;
    }
    // deployment_config_id - computed: true, optional: false, required: false
    get deploymentConfigId() {
        return this.getStringAttribute('deployment_config_id');
    }
    // deployment_config_name - computed: false, optional: false, required: true
    _deploymentConfigName;
    get deploymentConfigName() {
        return this.getStringAttribute('deployment_config_name');
    }
    set deploymentConfigName(value) {
        this._deploymentConfigName = value;
    }
    // Temporarily expose input value. Use with caution.
    get deploymentConfigNameInput() {
        return this._deploymentConfigName;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // minimum_healthy_hosts - computed: false, optional: true, required: false
    _minimumHealthyHosts = new CodedeployDeploymentConfigMinimumHealthyHostsOutputReference(this, "minimum_healthy_hosts", true);
    get minimumHealthyHosts() {
        return this._minimumHealthyHosts;
    }
    putMinimumHealthyHosts(value) {
        this._minimumHealthyHosts.internalValue = value;
    }
    resetMinimumHealthyHosts() {
        this._minimumHealthyHosts.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get minimumHealthyHostsInput() {
        return this._minimumHealthyHosts.internalValue;
    }
    // traffic_routing_config - computed: false, optional: true, required: false
    _trafficRoutingConfig = new CodedeployDeploymentConfigTrafficRoutingConfigOutputReference(this, "traffic_routing_config", true);
    get trafficRoutingConfig() {
        return this._trafficRoutingConfig;
    }
    putTrafficRoutingConfig(value) {
        this._trafficRoutingConfig.internalValue = value;
    }
    resetTrafficRoutingConfig() {
        this._trafficRoutingConfig.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get trafficRoutingConfigInput() {
        return this._trafficRoutingConfig.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            compute_platform: cdktf.stringToTerraform(this._computePlatform),
            deployment_config_name: cdktf.stringToTerraform(this._deploymentConfigName),
            minimum_healthy_hosts: codedeployDeploymentConfigMinimumHealthyHostsToTerraform(this._minimumHealthyHosts.internalValue),
            traffic_routing_config: codedeployDeploymentConfigTrafficRoutingConfigToTerraform(this._trafficRoutingConfig.internalValue),
        };
    }
}
//# sourceMappingURL=codedeploy-deployment-config.js.map