// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function route53RecoverycontrolconfigSafetyRuleRuleConfigToTerraform(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 {
        inverted: cdktf.booleanToTerraform(struct.inverted),
        threshold: cdktf.numberToTerraform(struct.threshold),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export class Route53RecoverycontrolconfigSafetyRuleRuleConfigOutputReference 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._inverted !== undefined) {
            hasAnyValues = true;
            internalValueResult.inverted = this._inverted;
        }
        if (this._threshold !== undefined) {
            hasAnyValues = true;
            internalValueResult.threshold = this._threshold;
        }
        if (this._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._inverted = undefined;
            this._threshold = undefined;
            this._type = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._inverted = value.inverted;
            this._threshold = value.threshold;
            this._type = value.type;
        }
    }
    // inverted - computed: false, optional: false, required: true
    _inverted;
    get inverted() {
        return this.getBooleanAttribute('inverted');
    }
    set inverted(value) {
        this._inverted = value;
    }
    // Temporarily expose input value. Use with caution.
    get invertedInput() {
        return this._inverted;
    }
    // threshold - computed: false, optional: false, required: true
    _threshold;
    get threshold() {
        return this.getNumberAttribute('threshold');
    }
    set threshold(value) {
        this._threshold = value;
    }
    // Temporarily expose input value. Use with caution.
    get thresholdInput() {
        return this._threshold;
    }
    // type - computed: false, optional: false, required: true
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/route53recoverycontrolconfig_safety_rule aws_route53recoverycontrolconfig_safety_rule}
*/
export class Route53RecoverycontrolconfigSafetyRule extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_route53recoverycontrolconfig_safety_rule";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/route53recoverycontrolconfig_safety_rule aws_route53recoverycontrolconfig_safety_rule} 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 Route53RecoverycontrolconfigSafetyRuleConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_route53recoverycontrolconfig_safety_rule',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._assertedControls = config.assertedControls;
        this._controlPanelArn = config.controlPanelArn;
        this._gatingControls = config.gatingControls;
        this._name = config.name;
        this._targetControls = config.targetControls;
        this._waitPeriodMs = config.waitPeriodMs;
        this._ruleConfig.internalValue = config.ruleConfig;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // asserted_controls - computed: false, optional: true, required: false
    _assertedControls;
    get assertedControls() {
        return this.getListAttribute('asserted_controls');
    }
    set assertedControls(value) {
        this._assertedControls = value;
    }
    resetAssertedControls() {
        this._assertedControls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get assertedControlsInput() {
        return this._assertedControls;
    }
    // control_panel_arn - computed: false, optional: false, required: true
    _controlPanelArn;
    get controlPanelArn() {
        return this.getStringAttribute('control_panel_arn');
    }
    set controlPanelArn(value) {
        this._controlPanelArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get controlPanelArnInput() {
        return this._controlPanelArn;
    }
    // gating_controls - computed: false, optional: true, required: false
    _gatingControls;
    get gatingControls() {
        return this.getListAttribute('gating_controls');
    }
    set gatingControls(value) {
        this._gatingControls = value;
    }
    resetGatingControls() {
        this._gatingControls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get gatingControlsInput() {
        return this._gatingControls;
    }
    // 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;
    }
    // status - computed: true, optional: false, required: false
    get status() {
        return this.getStringAttribute('status');
    }
    // target_controls - computed: false, optional: true, required: false
    _targetControls;
    get targetControls() {
        return this.getListAttribute('target_controls');
    }
    set targetControls(value) {
        this._targetControls = value;
    }
    resetTargetControls() {
        this._targetControls = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get targetControlsInput() {
        return this._targetControls;
    }
    // wait_period_ms - computed: false, optional: false, required: true
    _waitPeriodMs;
    get waitPeriodMs() {
        return this.getNumberAttribute('wait_period_ms');
    }
    set waitPeriodMs(value) {
        this._waitPeriodMs = value;
    }
    // Temporarily expose input value. Use with caution.
    get waitPeriodMsInput() {
        return this._waitPeriodMs;
    }
    // rule_config - computed: false, optional: false, required: true
    _ruleConfig = new Route53RecoverycontrolconfigSafetyRuleRuleConfigOutputReference(this, "rule_config", true);
    get ruleConfig() {
        return this._ruleConfig;
    }
    putRuleConfig(value) {
        this._ruleConfig.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get ruleConfigInput() {
        return this._ruleConfig.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            asserted_controls: cdktf.listMapper(cdktf.stringToTerraform)(this._assertedControls),
            control_panel_arn: cdktf.stringToTerraform(this._controlPanelArn),
            gating_controls: cdktf.listMapper(cdktf.stringToTerraform)(this._gatingControls),
            name: cdktf.stringToTerraform(this._name),
            target_controls: cdktf.listMapper(cdktf.stringToTerraform)(this._targetControls),
            wait_period_ms: cdktf.numberToTerraform(this._waitPeriodMs),
            rule_config: route53RecoverycontrolconfigSafetyRuleRuleConfigToTerraform(this._ruleConfig.internalValue),
        };
    }
}
//# sourceMappingURL=route53recoverycontrolconfig-safety-rule.js.map