o
    ëÉ¶dì"  ã                   @   s8   d dl mZmZmZ d dlmZ eG dd„ deƒƒZdS )é    )Úformatted_flat_dictÚNONE_SENTINELÚ#value_allowed_none_or_none_sentinel)Úinit_model_state_from_kwargsc                   @   sò   e Zd ZdZdZdZdZdd„ Zedd„ ƒZ	e	j
d	d„ ƒZ	ed
d„ ƒZej
dd„ ƒZedd„ ƒZej
dd„ ƒZedd„ ƒZej
dd„ ƒZedd„ ƒZej
dd„ ƒZedd„ ƒZej
dd„ ƒZedd„ ƒZej
dd„ ƒZdd„ Zdd„ Zd d!„ Zd"S )#ÚProtectionRulez”
    The protection rule settings. Protection rules can allow, block, or trigger an alert if a request meets the parameters of an applied rule.
    ÚOFFÚDETECTÚBLOCKc                 K   sZ   ddddddddœ| _ ddddd	d
ddœ| _d| _d| _d| _d| _d| _d| _d| _dS )a„  
        Initializes a new ProtectionRule object with values from keyword arguments.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param key:
            The value to assign to the key property of this ProtectionRule.
        :type key: str

        :param mod_security_rule_ids:
            The value to assign to the mod_security_rule_ids property of this ProtectionRule.
        :type mod_security_rule_ids: list[str]

        :param name:
            The value to assign to the name property of this ProtectionRule.
        :type name: str

        :param description:
            The value to assign to the description property of this ProtectionRule.
        :type description: str

        :param action:
            The value to assign to the action property of this ProtectionRule.
            Allowed values for this property are: "OFF", "DETECT", "BLOCK", 'UNKNOWN_ENUM_VALUE'.
            Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.
        :type action: str

        :param labels:
            The value to assign to the labels property of this ProtectionRule.
        :type labels: list[str]

        :param exclusions:
            The value to assign to the exclusions property of this ProtectionRule.
        :type exclusions: list[oci.waas.models.ProtectionRuleExclusion]

        Ústrz	list[str]zlist[ProtectionRuleExclusion])ÚkeyÚmod_security_rule_idsÚnameÚdescriptionÚactionÚlabelsÚ
exclusionsr   ZmodSecurityRuleIdsr   r   r   r   r   N)	Zswagger_typesZattribute_mapÚ_keyÚ_mod_security_rule_idsÚ_nameÚ_descriptionÚ_actionÚ_labelsÚ_exclusions)ÚselfÚkwargs© r   úCusr/lib/python3.10/site-packages/oci/waas/models/protection_rule.pyÚ__init__   s.   %ùù

zProtectionRule.__init__c                 C   ó   | j S )z¬
        Gets the key of this ProtectionRule.
        The unique key of the protection rule.


        :return: The key of this ProtectionRule.
        :rtype: str
        ©r   ©r   r   r   r   r   ^   ó   
zProtectionRule.keyc                 C   ó
   || _ dS )z®
        Sets the key of this ProtectionRule.
        The unique key of the protection rule.


        :param key: The key of this ProtectionRule.
        :type: str
        Nr   )r   r   r   r   r   r   j   ó   

c                 C   r   )a£  
        Gets the mod_security_rule_ids of this ProtectionRule.
        The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see `Mod Security's documentation`__.

        __ https://www.modsecurity.org/CRS/Documentation/index.html


        :return: The mod_security_rule_ids of this ProtectionRule.
        :rtype: list[str]
        ©r   r    r   r   r   r   v   ó   z$ProtectionRule.mod_security_rule_idsc                 C   r"   )a·  
        Sets the mod_security_rule_ids of this ProtectionRule.
        The list of the ModSecurity rule IDs that apply to this protection rule. For more information about ModSecurity's open source WAF rules, see `Mod Security's documentation`__.

        __ https://www.modsecurity.org/CRS/Documentation/index.html


        :param mod_security_rule_ids: The mod_security_rule_ids of this ProtectionRule.
        :type: list[str]
        Nr$   )r   r   r   r   r   r   „   ó   
c                 C   r   )z¨
        Gets the name of this ProtectionRule.
        The name of the protection rule.


        :return: The name of this ProtectionRule.
        :rtype: str
        ©r   r    r   r   r   r   ’   r!   zProtectionRule.namec                 C   r"   )z«
        Sets the name of this ProtectionRule.
        The name of the protection rule.


        :param name: The name of this ProtectionRule.
        :type: str
        Nr'   )r   r   r   r   r   r   ž   r#   c                 C   r   )z½
        Gets the description of this ProtectionRule.
        The description of the protection rule.


        :return: The description of this ProtectionRule.
        :rtype: str
        ©r   r    r   r   r   r   ª   r!   zProtectionRule.descriptionc                 C   r"   )zÇ
        Sets the description of this ProtectionRule.
        The description of the protection rule.


        :param description: The description of this ProtectionRule.
        :type: str
        Nr(   )r   r   r   r   r   r   ¶   r#   c                 C   r   )a©  
        Gets the action of this ProtectionRule.
        The action to take when the traffic is detected as malicious. If unspecified, defaults to `OFF`.

        Allowed values for this property are: "OFF", "DETECT", "BLOCK", 'UNKNOWN_ENUM_VALUE'.
        Any unrecognized values returned by a service will be mapped to 'UNKNOWN_ENUM_VALUE'.


        :return: The action of this ProtectionRule.
        :rtype: str
        )r   r    r   r   r   r   Â   s   zProtectionRule.actionc                 C   s    g d¢}t ||ƒsd}|| _dS )zñ
        Sets the action of this ProtectionRule.
        The action to take when the traffic is detected as malicious. If unspecified, defaults to `OFF`.


        :param action: The action of this ProtectionRule.
        :type: str
        )r   r   r	   ZUNKNOWN_ENUM_VALUEN)r   r   )r   r   Zallowed_valuesr   r   r   r   Ñ   s   


c                 C   r   )a7  
        Gets the labels of this ProtectionRule.
        The list of labels for the protection rule.

        **Note:** Protection rules with a `ResponseBody` label will have no effect unless `isResponseInspected` is true.


        :return: The labels of this ProtectionRule.
        :rtype: list[str]
        ©r   r    r   r   r   r   à   r%   zProtectionRule.labelsc                 C   r"   )a<  
        Sets the labels of this ProtectionRule.
        The list of labels for the protection rule.

        **Note:** Protection rules with a `ResponseBody` label will have no effect unless `isResponseInspected` is true.


        :param labels: The labels of this ProtectionRule.
        :type: list[str]
        Nr)   )r   r   r   r   r   r   î   r&   c                 C   r   )z´
        Gets the exclusions of this ProtectionRule.

        :return: The exclusions of this ProtectionRule.
        :rtype: list[oci.waas.models.ProtectionRuleExclusion]
        ©r   r    r   r   r   r   ü   s   zProtectionRule.exclusionsc                 C   r"   )z½
        Sets the exclusions of this ProtectionRule.

        :param exclusions: The exclusions of this ProtectionRule.
        :type: list[oci.waas.models.ProtectionRuleExclusion]
        Nr*   )r   r   r   r   r   r     s   
c                 C   s   t | ƒS ©N)r   r    r   r   r   Ú__repr__  s   zProtectionRule.__repr__c                 C   s   |d u rdS | j |j kS )NF)Ú__dict__©r   Úotherr   r   r   Ú__eq__  s   zProtectionRule.__eq__c                 C   s
   | |k S r+   r   r.   r   r   r   Ú__ne__  s   
zProtectionRule.__ne__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Z
ACTION_OFFZACTION_DETECTZACTION_BLOCKr   Úpropertyr   Úsetterr   r   r   r   r   r   r,   r0   r1   r   r   r   r   r      sJ    @












	
	r   N)Zoci.utilr   r   r   Zoci.decoratorsr   Úobjectr   r   r   r   r   Ú<module>   s   