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d Ze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 )ResolverRulez
    A rule for a resolver. Specifying both qnameCoverConditions and clientAddressConditions is not allowed.

    **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
    FORWARDc                 K   s2   dddd| _ dddd| _d| _d| _d| _dS )aU  
        Initializes a new ResolverRule object with values from keyword arguments. This class has the following subclasses and if you are using this class as input
        to a service operations then you should favor using a subclass over the base class:

        * :class:`~oci.dns.models.ResolverForwardRule`

        The following keyword arguments are supported (corresponding to the getters/setters of this class):

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

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

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

        z	list[str]str)client_address_conditionsqname_cover_conditionsactionZclientAddressConditionsZqnameCoverConditionsr   N)Zswagger_typesZattribute_map_client_address_conditions_qname_cover_conditions_action)selfkwargs r   @usr/lib/python3.10/site-packages/oci/dns/models/resolver_rule.py__init__   s   
zResolverRule.__init__c                 C   s   | d }|dkr
dS dS )z
        Given the hash representation of a subtype of this class,
        use the info in the hash to return the class of the subtype.
        r   r   ZResolverForwardRuler   r   )Zobject_dictionarytyper   r   r   get_subtype@   s   zResolverRule.get_subtypec                 C      | j S )aC  
        **[Required]** Gets the client_address_conditions of this ResolverRule.
        A list of CIDR blocks. The query must come from a client within one of the blocks in order for the rule action
        to apply.


        :return: The client_address_conditions of this ResolverRule.
        :rtype: list[str]
        r   r   r   r   r   r	   M   s   z&ResolverRule.client_address_conditionsc                 C   
   || _ dS )aL  
        Sets the client_address_conditions of this ResolverRule.
        A list of CIDR blocks. The query must come from a client within one of the blocks in order for the rule action
        to apply.


        :param client_address_conditions: The client_address_conditions of this ResolverRule.
        :type: list[str]
        Nr   )r   r	   r   r   r   r	   Z   s   
c                 C   r   )a+  
        **[Required]** Gets the qname_cover_conditions of this ResolverRule.
        A list of domain names. The query must be covered by one of the domains in order for the rule action to apply.


        :return: The qname_cover_conditions of this ResolverRule.
        :rtype: list[str]
        r   r   r   r   r   r
   g   s   
z#ResolverRule.qname_cover_conditionsc                 C   r   )a1  
        Sets the qname_cover_conditions of this ResolverRule.
        A list of domain names. The query must be covered by one of the domains in order for the rule action to apply.


        :param qname_cover_conditions: The qname_cover_conditions of this ResolverRule.
        :type: list[str]
        Nr   )r   r
   r   r   r   r
   s   s   

c                 C   r   )a  
        **[Required]** Gets the action of this ResolverRule.
        The action determines the behavior of the rule. If a query matches a supplied condition, the action will
        apply. If there are no conditions on the rule, all queries are subject to the specified action.
        * `FORWARD` - Matching requests will be forwarded from the source interface to the destination address.

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


        :return: The action of this ResolverRule.
        :rtype: str
        )r   r   r   r   r   r      s   zResolverRule.actionc                 C   s   dg}t ||s
d}|| _dS )a  
        Sets the action of this ResolverRule.
        The action determines the behavior of the rule. If a query matches a supplied condition, the action will
        apply. If there are no conditions on the rule, all queries are subject to the specified action.
        * `FORWARD` - Matching requests will be forwarded from the source interface to the destination address.


        :param action: The action of this ResolverRule.
        :type: str
        r   ZUNKNOWN_ENUM_VALUEN)r   r   )r   r   Zallowed_valuesr   r   r   r      s   

c                 C   s   t | S N)r   r   r   r   r   __repr__   s   zResolverRule.__repr__c                 C   s   |d u rdS | j |j kS )NF)__dict__r   otherr   r   r   __eq__   s   zResolverRule.__eq__c                 C   s
   | |k S r   r   r   r   r   r   __ne__   s   
zResolverRule.__ne__N)__name__
__module____qualname____doc__ZACTION_FORWARDr   staticmethodr   propertyr	   setterr
   r   r   r    r!   r   r   r   r   r      s*    (






r   N)Zoci.utilr   r   r   Zoci.decoratorsr   objectr   r   r   r   r   <module>   s   