// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function networkfirewallFirewallPolicyFirewallPolicyStatefulEngineOptionsToTerraform(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 {
        rule_order: cdktf.stringToTerraform(struct.ruleOrder),
    };
}
export class NetworkfirewallFirewallPolicyFirewallPolicyStatefulEngineOptionsOutputReference 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._ruleOrder !== undefined) {
            hasAnyValues = true;
            internalValueResult.ruleOrder = this._ruleOrder;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._ruleOrder = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._ruleOrder = value.ruleOrder;
        }
    }
    // rule_order - computed: false, optional: false, required: true
    _ruleOrder;
    get ruleOrder() {
        return this.getStringAttribute('rule_order');
    }
    set ruleOrder(value) {
        this._ruleOrder = value;
    }
    // Temporarily expose input value. Use with caution.
    get ruleOrderInput() {
        return this._ruleOrder;
    }
}
export function networkfirewallFirewallPolicyFirewallPolicyStatefulRuleGroupReferenceToTerraform(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 {
        priority: cdktf.numberToTerraform(struct.priority),
        resource_arn: cdktf.stringToTerraform(struct.resourceArn),
    };
}
export function networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionDimensionToTerraform(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 {
        value: cdktf.stringToTerraform(struct.value),
    };
}
export function networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionToTerraform(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 {
        dimension: cdktf.listMapper(networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionDimensionToTerraform)(struct.dimension),
    };
}
export class NetworkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionOutputReference 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._dimension !== undefined) {
            hasAnyValues = true;
            internalValueResult.dimension = this._dimension;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._dimension = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._dimension = value.dimension;
        }
    }
    // dimension - computed: false, optional: false, required: true
    _dimension;
    get dimension() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('dimension')));
    }
    set dimension(value) {
        this._dimension = value;
    }
    // Temporarily expose input value. Use with caution.
    get dimensionInput() {
        return this._dimension;
    }
}
export function networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionToTerraform(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 {
        publish_metric_action: networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionToTerraform(struct.publishMetricAction),
    };
}
export class NetworkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionOutputReference 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._publishMetricAction?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.publishMetricAction = this._publishMetricAction?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._publishMetricAction.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._publishMetricAction.internalValue = value.publishMetricAction;
        }
    }
    // publish_metric_action - computed: false, optional: false, required: true
    _publishMetricAction = new NetworkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionPublishMetricActionOutputReference(this, "publish_metric_action", true);
    get publishMetricAction() {
        return this._publishMetricAction;
    }
    putPublishMetricAction(value) {
        this._publishMetricAction.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get publishMetricActionInput() {
        return this._publishMetricAction.internalValue;
    }
}
export function networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionToTerraform(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 {
        action_name: cdktf.stringToTerraform(struct.actionName),
        action_definition: networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionActionDefinitionToTerraform(struct.actionDefinition),
    };
}
export function networkfirewallFirewallPolicyFirewallPolicyStatelessRuleGroupReferenceToTerraform(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 {
        priority: cdktf.numberToTerraform(struct.priority),
        resource_arn: cdktf.stringToTerraform(struct.resourceArn),
    };
}
export function networkfirewallFirewallPolicyFirewallPolicyToTerraform(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 {
        stateful_default_actions: cdktf.listMapper(cdktf.stringToTerraform)(struct.statefulDefaultActions),
        stateless_default_actions: cdktf.listMapper(cdktf.stringToTerraform)(struct.statelessDefaultActions),
        stateless_fragment_default_actions: cdktf.listMapper(cdktf.stringToTerraform)(struct.statelessFragmentDefaultActions),
        stateful_engine_options: networkfirewallFirewallPolicyFirewallPolicyStatefulEngineOptionsToTerraform(struct.statefulEngineOptions),
        stateful_rule_group_reference: cdktf.listMapper(networkfirewallFirewallPolicyFirewallPolicyStatefulRuleGroupReferenceToTerraform)(struct.statefulRuleGroupReference),
        stateless_custom_action: cdktf.listMapper(networkfirewallFirewallPolicyFirewallPolicyStatelessCustomActionToTerraform)(struct.statelessCustomAction),
        stateless_rule_group_reference: cdktf.listMapper(networkfirewallFirewallPolicyFirewallPolicyStatelessRuleGroupReferenceToTerraform)(struct.statelessRuleGroupReference),
    };
}
export class NetworkfirewallFirewallPolicyFirewallPolicyOutputReference 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._statefulDefaultActions !== undefined) {
            hasAnyValues = true;
            internalValueResult.statefulDefaultActions = this._statefulDefaultActions;
        }
        if (this._statelessDefaultActions !== undefined) {
            hasAnyValues = true;
            internalValueResult.statelessDefaultActions = this._statelessDefaultActions;
        }
        if (this._statelessFragmentDefaultActions !== undefined) {
            hasAnyValues = true;
            internalValueResult.statelessFragmentDefaultActions = this._statelessFragmentDefaultActions;
        }
        if (this._statefulEngineOptions?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.statefulEngineOptions = this._statefulEngineOptions?.internalValue;
        }
        if (this._statefulRuleGroupReference !== undefined) {
            hasAnyValues = true;
            internalValueResult.statefulRuleGroupReference = this._statefulRuleGroupReference;
        }
        if (this._statelessCustomAction !== undefined) {
            hasAnyValues = true;
            internalValueResult.statelessCustomAction = this._statelessCustomAction;
        }
        if (this._statelessRuleGroupReference !== undefined) {
            hasAnyValues = true;
            internalValueResult.statelessRuleGroupReference = this._statelessRuleGroupReference;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._statefulDefaultActions = undefined;
            this._statelessDefaultActions = undefined;
            this._statelessFragmentDefaultActions = undefined;
            this._statefulEngineOptions.internalValue = undefined;
            this._statefulRuleGroupReference = undefined;
            this._statelessCustomAction = undefined;
            this._statelessRuleGroupReference = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._statefulDefaultActions = value.statefulDefaultActions;
            this._statelessDefaultActions = value.statelessDefaultActions;
            this._statelessFragmentDefaultActions = value.statelessFragmentDefaultActions;
            this._statefulEngineOptions.internalValue = value.statefulEngineOptions;
            this._statefulRuleGroupReference = value.statefulRuleGroupReference;
            this._statelessCustomAction = value.statelessCustomAction;
            this._statelessRuleGroupReference = value.statelessRuleGroupReference;
        }
    }
    // stateful_default_actions - computed: false, optional: true, required: false
    _statefulDefaultActions;
    get statefulDefaultActions() {
        return cdktf.Fn.tolist(this.getListAttribute('stateful_default_actions'));
    }
    set statefulDefaultActions(value) {
        this._statefulDefaultActions = value;
    }
    resetStatefulDefaultActions() {
        this._statefulDefaultActions = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statefulDefaultActionsInput() {
        return this._statefulDefaultActions;
    }
    // stateless_default_actions - computed: false, optional: false, required: true
    _statelessDefaultActions;
    get statelessDefaultActions() {
        return cdktf.Fn.tolist(this.getListAttribute('stateless_default_actions'));
    }
    set statelessDefaultActions(value) {
        this._statelessDefaultActions = value;
    }
    // Temporarily expose input value. Use with caution.
    get statelessDefaultActionsInput() {
        return this._statelessDefaultActions;
    }
    // stateless_fragment_default_actions - computed: false, optional: false, required: true
    _statelessFragmentDefaultActions;
    get statelessFragmentDefaultActions() {
        return cdktf.Fn.tolist(this.getListAttribute('stateless_fragment_default_actions'));
    }
    set statelessFragmentDefaultActions(value) {
        this._statelessFragmentDefaultActions = value;
    }
    // Temporarily expose input value. Use with caution.
    get statelessFragmentDefaultActionsInput() {
        return this._statelessFragmentDefaultActions;
    }
    // stateful_engine_options - computed: false, optional: true, required: false
    _statefulEngineOptions = new NetworkfirewallFirewallPolicyFirewallPolicyStatefulEngineOptionsOutputReference(this, "stateful_engine_options", true);
    get statefulEngineOptions() {
        return this._statefulEngineOptions;
    }
    putStatefulEngineOptions(value) {
        this._statefulEngineOptions.internalValue = value;
    }
    resetStatefulEngineOptions() {
        this._statefulEngineOptions.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statefulEngineOptionsInput() {
        return this._statefulEngineOptions.internalValue;
    }
    // stateful_rule_group_reference - computed: false, optional: true, required: false
    _statefulRuleGroupReference;
    get statefulRuleGroupReference() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('stateful_rule_group_reference')));
    }
    set statefulRuleGroupReference(value) {
        this._statefulRuleGroupReference = value;
    }
    resetStatefulRuleGroupReference() {
        this._statefulRuleGroupReference = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statefulRuleGroupReferenceInput() {
        return this._statefulRuleGroupReference;
    }
    // stateless_custom_action - computed: false, optional: true, required: false
    _statelessCustomAction;
    get statelessCustomAction() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('stateless_custom_action')));
    }
    set statelessCustomAction(value) {
        this._statelessCustomAction = value;
    }
    resetStatelessCustomAction() {
        this._statelessCustomAction = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statelessCustomActionInput() {
        return this._statelessCustomAction;
    }
    // stateless_rule_group_reference - computed: false, optional: true, required: false
    _statelessRuleGroupReference;
    get statelessRuleGroupReference() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('stateless_rule_group_reference')));
    }
    set statelessRuleGroupReference(value) {
        this._statelessRuleGroupReference = value;
    }
    resetStatelessRuleGroupReference() {
        this._statelessRuleGroupReference = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get statelessRuleGroupReferenceInput() {
        return this._statelessRuleGroupReference;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/networkfirewall_firewall_policy aws_networkfirewall_firewall_policy}
*/
export class NetworkfirewallFirewallPolicy extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_networkfirewall_firewall_policy";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/networkfirewall_firewall_policy aws_networkfirewall_firewall_policy} 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 NetworkfirewallFirewallPolicyConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_networkfirewall_firewall_policy',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._description = config.description;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._firewallPolicy.internalValue = config.firewallPolicy;
    }
    // ==========
    // 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');
    }
    // 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;
    }
    // update_token - computed: true, optional: false, required: false
    get updateToken() {
        return this.getStringAttribute('update_token');
    }
    // firewall_policy - computed: false, optional: false, required: true
    _firewallPolicy = new NetworkfirewallFirewallPolicyFirewallPolicyOutputReference(this, "firewall_policy", true);
    get firewallPolicy() {
        return this._firewallPolicy;
    }
    putFirewallPolicy(value) {
        this._firewallPolicy.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get firewallPolicyInput() {
        return this._firewallPolicy.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            description: cdktf.stringToTerraform(this._description),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            firewall_policy: networkfirewallFirewallPolicyFirewallPolicyToTerraform(this._firewallPolicy.internalValue),
        };
    }
}
//# sourceMappingURL=networkfirewall-firewall-policy.js.map