# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = [
    'PolicyCustomRuleArgs',
    'PolicyCustomRuleMatchConditionArgs',
    'PolicyCustomRuleMatchConditionMatchVariableArgs',
    'PolicyManagedRulesArgs',
    'PolicyManagedRulesExclusionArgs',
    'PolicyManagedRulesManagedRuleSetArgs',
    'PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs',
    'PolicyPolicySettingsArgs',
]

@pulumi.input_type
class PolicyCustomRuleArgs:
    def __init__(__self__, *,
                 action: pulumi.Input[str],
                 match_conditions: pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionArgs']]],
                 priority: pulumi.Input[int],
                 rule_type: pulumi.Input[str],
                 name: Optional[pulumi.Input[str]] = None):
        """
        :param pulumi.Input[str] action: Type of action.
        :param pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionArgs']]] match_conditions: One or more `match_conditions` blocks as defined below.
        :param pulumi.Input[int] priority: Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
        :param pulumi.Input[str] rule_type: Describes the type of rule.
        :param pulumi.Input[str] name: Gets name of the resource that is unique within a policy. This name can be used to access the resource.
        """
        pulumi.set(__self__, "action", action)
        pulumi.set(__self__, "match_conditions", match_conditions)
        pulumi.set(__self__, "priority", priority)
        pulumi.set(__self__, "rule_type", rule_type)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def action(self) -> pulumi.Input[str]:
        """
        Type of action.
        """
        return pulumi.get(self, "action")

    @action.setter
    def action(self, value: pulumi.Input[str]):
        pulumi.set(self, "action", value)

    @property
    @pulumi.getter(name="matchConditions")
    def match_conditions(self) -> pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionArgs']]]:
        """
        One or more `match_conditions` blocks as defined below.
        """
        return pulumi.get(self, "match_conditions")

    @match_conditions.setter
    def match_conditions(self, value: pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionArgs']]]):
        pulumi.set(self, "match_conditions", value)

    @property
    @pulumi.getter
    def priority(self) -> pulumi.Input[int]:
        """
        Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value.
        """
        return pulumi.get(self, "priority")

    @priority.setter
    def priority(self, value: pulumi.Input[int]):
        pulumi.set(self, "priority", value)

    @property
    @pulumi.getter(name="ruleType")
    def rule_type(self) -> pulumi.Input[str]:
        """
        Describes the type of rule.
        """
        return pulumi.get(self, "rule_type")

    @rule_type.setter
    def rule_type(self, value: pulumi.Input[str]):
        pulumi.set(self, "rule_type", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Gets name of the resource that is unique within a policy. This name can be used to access the resource.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)


@pulumi.input_type
class PolicyCustomRuleMatchConditionArgs:
    def __init__(__self__, *,
                 match_values: pulumi.Input[Sequence[pulumi.Input[str]]],
                 match_variables: pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionMatchVariableArgs']]],
                 operator: pulumi.Input[str],
                 negation_condition: Optional[pulumi.Input[bool]] = None,
                 transforms: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        :param pulumi.Input[Sequence[pulumi.Input[str]]] match_values: A list of match values.
        :param pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionMatchVariableArgs']]] match_variables: One or more `match_variables` blocks as defined below.
        :param pulumi.Input[str] operator: Describes operator to be matched.
        :param pulumi.Input[bool] negation_condition: Describes if this is negate condition or not
        :param pulumi.Input[Sequence[pulumi.Input[str]]] transforms: A list of transformations to do before the match is attempted.
        """
        pulumi.set(__self__, "match_values", match_values)
        pulumi.set(__self__, "match_variables", match_variables)
        pulumi.set(__self__, "operator", operator)
        if negation_condition is not None:
            pulumi.set(__self__, "negation_condition", negation_condition)
        if transforms is not None:
            pulumi.set(__self__, "transforms", transforms)

    @property
    @pulumi.getter(name="matchValues")
    def match_values(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
        """
        A list of match values.
        """
        return pulumi.get(self, "match_values")

    @match_values.setter
    def match_values(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
        pulumi.set(self, "match_values", value)

    @property
    @pulumi.getter(name="matchVariables")
    def match_variables(self) -> pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionMatchVariableArgs']]]:
        """
        One or more `match_variables` blocks as defined below.
        """
        return pulumi.get(self, "match_variables")

    @match_variables.setter
    def match_variables(self, value: pulumi.Input[Sequence[pulumi.Input['PolicyCustomRuleMatchConditionMatchVariableArgs']]]):
        pulumi.set(self, "match_variables", value)

    @property
    @pulumi.getter
    def operator(self) -> pulumi.Input[str]:
        """
        Describes operator to be matched.
        """
        return pulumi.get(self, "operator")

    @operator.setter
    def operator(self, value: pulumi.Input[str]):
        pulumi.set(self, "operator", value)

    @property
    @pulumi.getter(name="negationCondition")
    def negation_condition(self) -> Optional[pulumi.Input[bool]]:
        """
        Describes if this is negate condition or not
        """
        return pulumi.get(self, "negation_condition")

    @negation_condition.setter
    def negation_condition(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "negation_condition", value)

    @property
    @pulumi.getter
    def transforms(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        A list of transformations to do before the match is attempted.
        """
        return pulumi.get(self, "transforms")

    @transforms.setter
    def transforms(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "transforms", value)


@pulumi.input_type
class PolicyCustomRuleMatchConditionMatchVariableArgs:
    def __init__(__self__, *,
                 variable_name: pulumi.Input[str],
                 selector: Optional[pulumi.Input[str]] = None):
        """
        :param pulumi.Input[str] variable_name: The name of the Match Variable
        :param pulumi.Input[str] selector: Describes field of the matchVariable collection
        """
        pulumi.set(__self__, "variable_name", variable_name)
        if selector is not None:
            pulumi.set(__self__, "selector", selector)

    @property
    @pulumi.getter(name="variableName")
    def variable_name(self) -> pulumi.Input[str]:
        """
        The name of the Match Variable
        """
        return pulumi.get(self, "variable_name")

    @variable_name.setter
    def variable_name(self, value: pulumi.Input[str]):
        pulumi.set(self, "variable_name", value)

    @property
    @pulumi.getter
    def selector(self) -> Optional[pulumi.Input[str]]:
        """
        Describes field of the matchVariable collection
        """
        return pulumi.get(self, "selector")

    @selector.setter
    def selector(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "selector", value)


@pulumi.input_type
class PolicyManagedRulesArgs:
    def __init__(__self__, *,
                 managed_rule_sets: pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetArgs']]],
                 exclusions: Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesExclusionArgs']]]] = None):
        """
        :param pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetArgs']]] managed_rule_sets: One or more `managed_rule_set` block defined below.
        :param pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesExclusionArgs']]] exclusions: One or more `exclusion` block defined below.
        """
        pulumi.set(__self__, "managed_rule_sets", managed_rule_sets)
        if exclusions is not None:
            pulumi.set(__self__, "exclusions", exclusions)

    @property
    @pulumi.getter(name="managedRuleSets")
    def managed_rule_sets(self) -> pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetArgs']]]:
        """
        One or more `managed_rule_set` block defined below.
        """
        return pulumi.get(self, "managed_rule_sets")

    @managed_rule_sets.setter
    def managed_rule_sets(self, value: pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetArgs']]]):
        pulumi.set(self, "managed_rule_sets", value)

    @property
    @pulumi.getter
    def exclusions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesExclusionArgs']]]]:
        """
        One or more `exclusion` block defined below.
        """
        return pulumi.get(self, "exclusions")

    @exclusions.setter
    def exclusions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesExclusionArgs']]]]):
        pulumi.set(self, "exclusions", value)


@pulumi.input_type
class PolicyManagedRulesExclusionArgs:
    def __init__(__self__, *,
                 match_variable: pulumi.Input[str],
                 selector: pulumi.Input[str],
                 selector_match_operator: pulumi.Input[str]):
        """
        :param pulumi.Input[str] match_variable: The name of the Match Variable. Possible values: `RequestArgNames`, `RequestCookieNames`, `RequestHeaderNames`.
        :param pulumi.Input[str] selector: Describes field of the matchVariable collection.
        :param pulumi.Input[str] selector_match_operator: Describes operator to be matched. Possible values: `Contains`, `EndsWith`, `Equals`, `EqualsAny`, `StartsWith`.
        """
        pulumi.set(__self__, "match_variable", match_variable)
        pulumi.set(__self__, "selector", selector)
        pulumi.set(__self__, "selector_match_operator", selector_match_operator)

    @property
    @pulumi.getter(name="matchVariable")
    def match_variable(self) -> pulumi.Input[str]:
        """
        The name of the Match Variable. Possible values: `RequestArgNames`, `RequestCookieNames`, `RequestHeaderNames`.
        """
        return pulumi.get(self, "match_variable")

    @match_variable.setter
    def match_variable(self, value: pulumi.Input[str]):
        pulumi.set(self, "match_variable", value)

    @property
    @pulumi.getter
    def selector(self) -> pulumi.Input[str]:
        """
        Describes field of the matchVariable collection.
        """
        return pulumi.get(self, "selector")

    @selector.setter
    def selector(self, value: pulumi.Input[str]):
        pulumi.set(self, "selector", value)

    @property
    @pulumi.getter(name="selectorMatchOperator")
    def selector_match_operator(self) -> pulumi.Input[str]:
        """
        Describes operator to be matched. Possible values: `Contains`, `EndsWith`, `Equals`, `EqualsAny`, `StartsWith`.
        """
        return pulumi.get(self, "selector_match_operator")

    @selector_match_operator.setter
    def selector_match_operator(self, value: pulumi.Input[str]):
        pulumi.set(self, "selector_match_operator", value)


@pulumi.input_type
class PolicyManagedRulesManagedRuleSetArgs:
    def __init__(__self__, *,
                 version: pulumi.Input[str],
                 rule_group_overrides: Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs']]]] = None,
                 type: Optional[pulumi.Input[str]] = None):
        """
        :param pulumi.Input[str] version: The rule set version. Possible values: `0.1`, `1.0`, `2.2.9`, `3.0`, `3.1` and `3.2`.
        :param pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs']]] rule_group_overrides: One or more `rule_group_override` block defined below.
        :param pulumi.Input[str] type: The rule set type. Possible values: `Microsoft_BotManagerRuleSet` and `OWASP`.
        """
        pulumi.set(__self__, "version", version)
        if rule_group_overrides is not None:
            pulumi.set(__self__, "rule_group_overrides", rule_group_overrides)
        if type is not None:
            pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def version(self) -> pulumi.Input[str]:
        """
        The rule set version. Possible values: `0.1`, `1.0`, `2.2.9`, `3.0`, `3.1` and `3.2`.
        """
        return pulumi.get(self, "version")

    @version.setter
    def version(self, value: pulumi.Input[str]):
        pulumi.set(self, "version", value)

    @property
    @pulumi.getter(name="ruleGroupOverrides")
    def rule_group_overrides(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs']]]]:
        """
        One or more `rule_group_override` block defined below.
        """
        return pulumi.get(self, "rule_group_overrides")

    @rule_group_overrides.setter
    def rule_group_overrides(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs']]]]):
        pulumi.set(self, "rule_group_overrides", value)

    @property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[str]]:
        """
        The rule set type. Possible values: `Microsoft_BotManagerRuleSet` and `OWASP`.
        """
        return pulumi.get(self, "type")

    @type.setter
    def type(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "type", value)


@pulumi.input_type
class PolicyManagedRulesManagedRuleSetRuleGroupOverrideArgs:
    def __init__(__self__, *,
                 disabled_rules: pulumi.Input[Sequence[pulumi.Input[str]]],
                 rule_group_name: pulumi.Input[str]):
        """
        :param pulumi.Input[Sequence[pulumi.Input[str]]] disabled_rules: One or more Rule ID's
        :param pulumi.Input[str] rule_group_name: The name of the Rule Group
        """
        pulumi.set(__self__, "disabled_rules", disabled_rules)
        pulumi.set(__self__, "rule_group_name", rule_group_name)

    @property
    @pulumi.getter(name="disabledRules")
    def disabled_rules(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
        """
        One or more Rule ID's
        """
        return pulumi.get(self, "disabled_rules")

    @disabled_rules.setter
    def disabled_rules(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]):
        pulumi.set(self, "disabled_rules", value)

    @property
    @pulumi.getter(name="ruleGroupName")
    def rule_group_name(self) -> pulumi.Input[str]:
        """
        The name of the Rule Group
        """
        return pulumi.get(self, "rule_group_name")

    @rule_group_name.setter
    def rule_group_name(self, value: pulumi.Input[str]):
        pulumi.set(self, "rule_group_name", value)


@pulumi.input_type
class PolicyPolicySettingsArgs:
    def __init__(__self__, *,
                 enabled: Optional[pulumi.Input[bool]] = None,
                 file_upload_limit_in_mb: Optional[pulumi.Input[int]] = None,
                 max_request_body_size_in_kb: Optional[pulumi.Input[int]] = None,
                 mode: Optional[pulumi.Input[str]] = None,
                 request_body_check: Optional[pulumi.Input[bool]] = None):
        """
        :param pulumi.Input[bool] enabled: Describes if the policy is in enabled state or disabled state. Defaults to `true`.
        :param pulumi.Input[int] file_upload_limit_in_mb: The File Upload Limit in MB. Accepted values are in the range `1` to `750`. Defaults to `100`.
        :param pulumi.Input[int] max_request_body_size_in_kb: The Maximum Request Body Size in KB.  Accepted values are in the range `8` to `128`. Defaults to `128`.
        :param pulumi.Input[str] mode: Describes if it is in detection mode or prevention mode at the policy level. Defaults to `Prevention`.
        :param pulumi.Input[bool] request_body_check: Is Request Body Inspection enabled? Defaults to `true`.
        """
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if file_upload_limit_in_mb is not None:
            pulumi.set(__self__, "file_upload_limit_in_mb", file_upload_limit_in_mb)
        if max_request_body_size_in_kb is not None:
            pulumi.set(__self__, "max_request_body_size_in_kb", max_request_body_size_in_kb)
        if mode is not None:
            pulumi.set(__self__, "mode", mode)
        if request_body_check is not None:
            pulumi.set(__self__, "request_body_check", request_body_check)

    @property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Describes if the policy is in enabled state or disabled state. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

    @enabled.setter
    def enabled(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "enabled", value)

    @property
    @pulumi.getter(name="fileUploadLimitInMb")
    def file_upload_limit_in_mb(self) -> Optional[pulumi.Input[int]]:
        """
        The File Upload Limit in MB. Accepted values are in the range `1` to `750`. Defaults to `100`.
        """
        return pulumi.get(self, "file_upload_limit_in_mb")

    @file_upload_limit_in_mb.setter
    def file_upload_limit_in_mb(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "file_upload_limit_in_mb", value)

    @property
    @pulumi.getter(name="maxRequestBodySizeInKb")
    def max_request_body_size_in_kb(self) -> Optional[pulumi.Input[int]]:
        """
        The Maximum Request Body Size in KB.  Accepted values are in the range `8` to `128`. Defaults to `128`.
        """
        return pulumi.get(self, "max_request_body_size_in_kb")

    @max_request_body_size_in_kb.setter
    def max_request_body_size_in_kb(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "max_request_body_size_in_kb", value)

    @property
    @pulumi.getter
    def mode(self) -> Optional[pulumi.Input[str]]:
        """
        Describes if it is in detection mode or prevention mode at the policy level. Defaults to `Prevention`.
        """
        return pulumi.get(self, "mode")

    @mode.setter
    def mode(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "mode", value)

    @property
    @pulumi.getter(name="requestBodyCheck")
    def request_body_check(self) -> Optional[pulumi.Input[bool]]:
        """
        Is Request Body Inspection enabled? Defaults to `true`.
        """
        return pulumi.get(self, "request_body_check")

    @request_body_check.setter
    def request_body_check(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "request_body_check", value)


