// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function guarddutyFilterFindingCriteriaCriterionToTerraform(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 {
        equals: cdktf.listMapper(cdktf.stringToTerraform)(struct.equalTo),
        field: cdktf.stringToTerraform(struct.field),
        greater_than: cdktf.stringToTerraform(struct.greaterThan),
        greater_than_or_equal: cdktf.stringToTerraform(struct.greaterThanOrEqual),
        less_than: cdktf.stringToTerraform(struct.lessThan),
        less_than_or_equal: cdktf.stringToTerraform(struct.lessThanOrEqual),
        not_equals: cdktf.listMapper(cdktf.stringToTerraform)(struct.notEquals),
    };
}
export function guarddutyFilterFindingCriteriaToTerraform(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 {
        criterion: cdktf.listMapper(guarddutyFilterFindingCriteriaCriterionToTerraform)(struct.criterion),
    };
}
export class GuarddutyFilterFindingCriteriaOutputReference 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._criterion !== undefined) {
            hasAnyValues = true;
            internalValueResult.criterion = this._criterion;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._criterion = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._criterion = value.criterion;
        }
    }
    // criterion - computed: false, optional: false, required: true
    _criterion;
    get criterion() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('criterion')));
    }
    set criterion(value) {
        this._criterion = value;
    }
    // Temporarily expose input value. Use with caution.
    get criterionInput() {
        return this._criterion;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/guardduty_filter aws_guardduty_filter}
*/
export class GuarddutyFilter extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_guardduty_filter";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/guardduty_filter aws_guardduty_filter} 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 GuarddutyFilterConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_guardduty_filter',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._action = config.action;
        this._description = config.description;
        this._detectorId = config.detectorId;
        this._name = config.name;
        this._rank = config.rank;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._findingCriteria.internalValue = config.findingCriteria;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // action - computed: false, optional: false, required: true
    _action;
    get action() {
        return this.getStringAttribute('action');
    }
    set action(value) {
        this._action = value;
    }
    // Temporarily expose input value. Use with caution.
    get actionInput() {
        return this._action;
    }
    // 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;
    }
    // detector_id - computed: false, optional: false, required: true
    _detectorId;
    get detectorId() {
        return this.getStringAttribute('detector_id');
    }
    set detectorId(value) {
        this._detectorId = value;
    }
    // Temporarily expose input value. Use with caution.
    get detectorIdInput() {
        return this._detectorId;
    }
    // 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;
    }
    // rank - computed: false, optional: false, required: true
    _rank;
    get rank() {
        return this.getNumberAttribute('rank');
    }
    set rank(value) {
        this._rank = value;
    }
    // Temporarily expose input value. Use with caution.
    get rankInput() {
        return this._rank;
    }
    // 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;
    }
    // finding_criteria - computed: false, optional: false, required: true
    _findingCriteria = new GuarddutyFilterFindingCriteriaOutputReference(this, "finding_criteria", true);
    get findingCriteria() {
        return this._findingCriteria;
    }
    putFindingCriteria(value) {
        this._findingCriteria.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get findingCriteriaInput() {
        return this._findingCriteria.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            action: cdktf.stringToTerraform(this._action),
            description: cdktf.stringToTerraform(this._description),
            detector_id: cdktf.stringToTerraform(this._detectorId),
            name: cdktf.stringToTerraform(this._name),
            rank: cdktf.numberToTerraform(this._rank),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            finding_criteria: guarddutyFilterFindingCriteriaToTerraform(this._findingCriteria.internalValue),
        };
    }
}
//# sourceMappingURL=guardduty-filter.js.map