U
    W¨+d¿  ã                   @   s   G d d„ de ƒZdS )c                   @   s:   e Zd ZdZddd„Zdd	„ Zd
d„ Zdd„ Zdd„ ZdS )ÚHealthCheckz¦
    Represents an EC2 Access Point Health Check. See
    :ref:`elb-configuring-a-health-check` for a walkthrough on configuring
    load balancer health checks.
    Né   é   é   c                 C   s(   || _ || _|| _|| _|| _|| _dS )aì  
        :ivar str access_point: The name of the load balancer this
            health check is associated with.
        :ivar int interval: Specifies how many seconds there are between
            health checks.
        :ivar str target: Determines what to check on an instance. See the
            Amazon HealthCheck_ documentation for possible Target values.

        .. _HealthCheck: http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/APIReference/API_HealthCheck.html
        N)Úaccess_pointÚintervalÚtargetÚhealthy_thresholdÚtimeoutÚunhealthy_threshold)Úselfr   r   r   r   r	   r
   © r   ú</tmp/pip-unpacked-wheel-dlxw5sjy/boto/ec2/elb/healthcheck.pyÚ__init__   s    zHealthCheck.__init__c                 C   s
   d| j  S )NzHealthCheck:%s)r   )r   r   r   r   Ú__repr__2   s    zHealthCheck.__repr__c                 C   s   d S )Nr   )r   ÚnameÚattrsÚ
connectionr   r   r   ÚstartElement5   s    zHealthCheck.startElementc                 C   sp   |dkrt |ƒ| _nX|dkr$|| _nH|dkr8t |ƒ| _n4|dkrLt |ƒ| _n |dkr`t |ƒ| _nt| ||ƒ d S )NZIntervalZTargetZHealthyThresholdÚTimeoutZUnhealthyThreshold)Úintr   r   r   r	   r
   Úsetattr)r   r   Úvaluer   r   r   r   Ú
endElement8   s    zHealthCheck.endElementc                 C   sF   | j s
dS | j | j | ¡}|j| _|j| _|j| _|j| _|j| _dS )a‘  
        In the case where you have accessed an existing health check on a
        load balancer, this method applies this instance's health check
        values to the load balancer it is attached to.

        .. note:: This method will not do anything if the :py:attr:`access_point`
            attribute isn't set, as is the case with a newly instantiated
            HealthCheck instance.
        N)r   r   Zconfigure_health_checkr   r   r   r
   r	   )r   Znew_hcr   r   r   ÚupdateF   s    

ÿzHealthCheck.update)Nr   Nr   r   r   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r      s         ÿ
r   N)Úobjectr   r   r   r   r   Ú<module>   ó    