// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function configConfigRuleScopeToTerraform(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 {
        compliance_resource_id: cdktf.stringToTerraform(struct.complianceResourceId),
        compliance_resource_types: cdktf.listMapper(cdktf.stringToTerraform)(struct.complianceResourceTypes),
        tag_key: cdktf.stringToTerraform(struct.tagKey),
        tag_value: cdktf.stringToTerraform(struct.tagValue),
    };
}
export class ConfigConfigRuleScopeOutputReference 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._complianceResourceId !== undefined) {
            hasAnyValues = true;
            internalValueResult.complianceResourceId = this._complianceResourceId;
        }
        if (this._complianceResourceTypes !== undefined) {
            hasAnyValues = true;
            internalValueResult.complianceResourceTypes = this._complianceResourceTypes;
        }
        if (this._tagKey !== undefined) {
            hasAnyValues = true;
            internalValueResult.tagKey = this._tagKey;
        }
        if (this._tagValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.tagValue = this._tagValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._complianceResourceId = undefined;
            this._complianceResourceTypes = undefined;
            this._tagKey = undefined;
            this._tagValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._complianceResourceId = value.complianceResourceId;
            this._complianceResourceTypes = value.complianceResourceTypes;
            this._tagKey = value.tagKey;
            this._tagValue = value.tagValue;
        }
    }
    // compliance_resource_id - computed: false, optional: true, required: false
    _complianceResourceId;
    get complianceResourceId() {
        return this.getStringAttribute('compliance_resource_id');
    }
    set complianceResourceId(value) {
        this._complianceResourceId = value;
    }
    resetComplianceResourceId() {
        this._complianceResourceId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get complianceResourceIdInput() {
        return this._complianceResourceId;
    }
    // compliance_resource_types - computed: false, optional: true, required: false
    _complianceResourceTypes;
    get complianceResourceTypes() {
        return cdktf.Fn.tolist(this.getListAttribute('compliance_resource_types'));
    }
    set complianceResourceTypes(value) {
        this._complianceResourceTypes = value;
    }
    resetComplianceResourceTypes() {
        this._complianceResourceTypes = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get complianceResourceTypesInput() {
        return this._complianceResourceTypes;
    }
    // tag_key - computed: false, optional: true, required: false
    _tagKey;
    get tagKey() {
        return this.getStringAttribute('tag_key');
    }
    set tagKey(value) {
        this._tagKey = value;
    }
    resetTagKey() {
        this._tagKey = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagKeyInput() {
        return this._tagKey;
    }
    // tag_value - computed: false, optional: true, required: false
    _tagValue;
    get tagValue() {
        return this.getStringAttribute('tag_value');
    }
    set tagValue(value) {
        this._tagValue = value;
    }
    resetTagValue() {
        this._tagValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagValueInput() {
        return this._tagValue;
    }
}
export function configConfigRuleSourceSourceDetailToTerraform(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 {
        event_source: cdktf.stringToTerraform(struct.eventSource),
        maximum_execution_frequency: cdktf.stringToTerraform(struct.maximumExecutionFrequency),
        message_type: cdktf.stringToTerraform(struct.messageType),
    };
}
export function configConfigRuleSourceToTerraform(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 {
        owner: cdktf.stringToTerraform(struct.owner),
        source_identifier: cdktf.stringToTerraform(struct.sourceIdentifier),
        source_detail: cdktf.listMapper(configConfigRuleSourceSourceDetailToTerraform)(struct.sourceDetail),
    };
}
export class ConfigConfigRuleSourceOutputReference 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._owner !== undefined) {
            hasAnyValues = true;
            internalValueResult.owner = this._owner;
        }
        if (this._sourceIdentifier !== undefined) {
            hasAnyValues = true;
            internalValueResult.sourceIdentifier = this._sourceIdentifier;
        }
        if (this._sourceDetail !== undefined) {
            hasAnyValues = true;
            internalValueResult.sourceDetail = this._sourceDetail;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._owner = undefined;
            this._sourceIdentifier = undefined;
            this._sourceDetail = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._owner = value.owner;
            this._sourceIdentifier = value.sourceIdentifier;
            this._sourceDetail = value.sourceDetail;
        }
    }
    // owner - computed: false, optional: false, required: true
    _owner;
    get owner() {
        return this.getStringAttribute('owner');
    }
    set owner(value) {
        this._owner = value;
    }
    // Temporarily expose input value. Use with caution.
    get ownerInput() {
        return this._owner;
    }
    // source_identifier - computed: false, optional: false, required: true
    _sourceIdentifier;
    get sourceIdentifier() {
        return this.getStringAttribute('source_identifier');
    }
    set sourceIdentifier(value) {
        this._sourceIdentifier = value;
    }
    // Temporarily expose input value. Use with caution.
    get sourceIdentifierInput() {
        return this._sourceIdentifier;
    }
    // source_detail - computed: false, optional: true, required: false
    _sourceDetail;
    get sourceDetail() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('source_detail')));
    }
    set sourceDetail(value) {
        this._sourceDetail = value;
    }
    resetSourceDetail() {
        this._sourceDetail = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sourceDetailInput() {
        return this._sourceDetail;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule aws_config_config_rule}
*/
export class ConfigConfigRule extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_config_config_rule";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule aws_config_config_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 ConfigConfigRuleConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_config_config_rule',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._description = config.description;
        this._inputParameters = config.inputParameters;
        this._maximumExecutionFrequency = config.maximumExecutionFrequency;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._scope.internalValue = config.scope;
        this._source.internalValue = config.source;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // input_parameters - computed: false, optional: true, required: false
    _inputParameters;
    get inputParameters() {
        return this.getStringAttribute('input_parameters');
    }
    set inputParameters(value) {
        this._inputParameters = value;
    }
    resetInputParameters() {
        this._inputParameters = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get inputParametersInput() {
        return this._inputParameters;
    }
    // maximum_execution_frequency - computed: false, optional: true, required: false
    _maximumExecutionFrequency;
    get maximumExecutionFrequency() {
        return this.getStringAttribute('maximum_execution_frequency');
    }
    set maximumExecutionFrequency(value) {
        this._maximumExecutionFrequency = value;
    }
    resetMaximumExecutionFrequency() {
        this._maximumExecutionFrequency = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get maximumExecutionFrequencyInput() {
        return this._maximumExecutionFrequency;
    }
    // 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;
    }
    // rule_id - computed: true, optional: false, required: false
    get ruleId() {
        return this.getStringAttribute('rule_id');
    }
    // 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;
    }
    // scope - computed: false, optional: true, required: false
    _scope = new ConfigConfigRuleScopeOutputReference(this, "scope", true);
    get scope() {
        return this._scope;
    }
    putScope(value) {
        this._scope.internalValue = value;
    }
    resetScope() {
        this._scope.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get scopeInput() {
        return this._scope.internalValue;
    }
    // source - computed: false, optional: false, required: true
    _source = new ConfigConfigRuleSourceOutputReference(this, "source", true);
    get source() {
        return this._source;
    }
    putSource(value) {
        this._source.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get sourceInput() {
        return this._source.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            description: cdktf.stringToTerraform(this._description),
            input_parameters: cdktf.stringToTerraform(this._inputParameters),
            maximum_execution_frequency: cdktf.stringToTerraform(this._maximumExecutionFrequency),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            scope: configConfigRuleScopeToTerraform(this._scope.internalValue),
            source: configConfigRuleSourceToTerraform(this._source.internalValue),
        };
    }
}
//# sourceMappingURL=config-config-rule.js.map