o
    È·eÆ  ã                   @   sd   G d d„ de ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZdS )c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚDetailsz–
    A dict object that contains name/value pairs which provide
    more detailed information about the status of the system
    or the instance.
    c                 C   ó   d S ©N© ©ÚselfÚnameÚattrsÚ
connectionr   r   úN/var/www/ideatree/venv/lib/python3.10/site-packages/boto/ec2/instancestatus.pyÚstartElement    ó   zDetails.startElementc                 C   s8   |dkr	|| _ d S |dkr|| | j < d S t| ||ƒ d S )Nr   Ústatus)Ú_nameÚsetattr©r   r   Úvaluer	   r   r   r
   Ú
endElement#   s
   
zDetails.endElementN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r
   r      s    r   c                   @   ó6   e Zd ZdZ		ddd„Zdd„ Zdd„ Zd	d
„ ZdS )ÚEventaN  
    A status event for an instance.

    :ivar code: A string indicating the event type.
    :ivar description: A string describing the reason for the event.
    :ivar not_before: A datestring describing the earliest time for
        the event.
    :ivar not_after: A datestring describing the latest time for
        the event.
    Nc                 C   s   || _ || _|| _|| _d S r   )ÚcodeÚdescriptionÚ
not_beforeÚ	not_after)r   r   r   r   r   r   r   r
   Ú__init__8   s   
zEvent.__init__c                 C   ó
   d| j  S )NzEvent:%s)r   ©r   r   r   r
   Ú__repr__?   ó   
zEvent.__repr__c                 C   r   r   r   r   r   r   r
   r   B   r   zEvent.startElementc                 C   sX   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S t| ||ƒ d S )Nr   r   Ú	notBeforeÚnotAfter)r   r   r   r   r   r   r   r   r
   r   E   s   



zEvent.endElement)NNNN©r   r   r   r   r   r    r   r   r   r   r   r
   r   ,   s    
ÿr   c                   @   s2   e Zd ZdZddd„Zdd„ Zdd„ Zd	d
„ ZdS )ÚStatusz÷
    A generic Status object used for system status and instance status.

    :ivar status: A string indicating overall status.
    :ivar details: A dict containing name-value pairs which provide
        more details about the current status.
    Nc                 C   s   || _ |stƒ }|| _d S r   )r   r   Údetails)r   r   r&   r   r   r
   r   [   s   
zStatus.__init__c                 C   r   )Nz	Status:%s)r   r   r   r   r
   r    a   r!   zStatus.__repr__c                 C   s   |dkr| j S d S )Nr&   )r&   r   r   r   r
   r   d   s   zStatus.startElementc                 C   s"   |dkr	|| _ d S t| ||ƒ d S )Nr   )r   r   r   r   r   r
   r   i   s   
zStatus.endElement)NNr$   r   r   r   r
   r%   R   s    
r%   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚEventSetc                 C   ó    |dkrt ƒ }|  |¡ |S d S ©NÚitem)r   Úappend)r   r   r   r	   Úeventr   r   r
   r   r   ó
   
zEventSet.startElementc                 C   s   t | ||ƒ d S r   )r   r   r   r   r
   r   z   s   zEventSet.endElementN)r   r   r   r   r   r   r   r   r
   r'   p   s    r'   c                   @   r   )ÚInstanceStatusa%  
    Represents an EC2 Instance status as reported by
    DescribeInstanceStatus request.

    :ivar id: The instance identifier.
    :ivar zone: The availability zone of the instance.
    :ivar events: A list of events relevant to the instance.
    :ivar state_code: An integer representing the current state
        of the instance.
    :ivar state_name: A string describing the current state
        of the instance.
    :ivar system_status: A Status object that reports impaired
        functionality that stems from issues related to the systems
        that support an instance, such as such as hardware failures
        and network connectivity problems.
    :ivar instance_status: A Status object that reports impaired
        functionality that arises from problems internal to the instance.
    Nc                 C   s2   || _ || _|| _|| _|| _tƒ | _tƒ | _d S r   )ÚidÚzoneÚeventsÚ
state_codeÚ
state_namer%   Úsystem_statusÚinstance_status)r   r/   r0   r1   r2   r3   r   r   r
   r   ’   s   zInstanceStatus.__init__c                 C   r   )NzInstanceStatus:%s)r/   r   r   r   r
   r    œ   r!   zInstanceStatus.__repr__c                 C   s6   |dkrt ƒ | _| jS |dkr| jS |dkr| jS d S )NÚ	eventsSetÚsystemStatusÚinstanceStatus)r'   r1   r4   r5   r   r   r   r
   r   Ÿ   s   zInstanceStatus.startElementc                 C   s\   |dkr	|| _ d S |dkr|| _d S |dkrt|ƒ| _d S |dkr&|| _d S t| ||ƒ d S )NÚ
instanceIdÚavailabilityZoner   r   )r/   r0   Úintr2   r3   r   r   r   r   r
   r   ª   s   


zInstanceStatus.endElement)NNNNNr$   r   r   r   r
   r.   ~   s    
ÿ
r.   c                   @   s*   e Zd ZdZd	dd„Zdd„ Zdd„ ZdS )
ÚInstanceStatusSetaž  
    A list object that contains the results of a call to
    DescribeInstanceStatus request.  Each element of the
    list will be an InstanceStatus object.

    :ivar next_token: If the response was truncated by
        the EC2 service, the next_token attribute of the
        object will contain the string that needs to be
        passed in to the next request to retrieve the next
        set of results.
    Nc                 C   s   t  | ¡ || _d | _d S r   )Úlistr   r	   Ú
next_token)r   r	   r   r   r
   r   Ä   s   

zInstanceStatusSet.__init__c                 C   r(   r)   )r.   r+   )r   r   r   r	   r   r   r   r
   r   É   r-   zInstanceStatusSet.startElementc                 C   s   |dkr|| _ t| ||ƒ d S )NÚ	nextToken)r>   r   r   r   r   r
   r   Ñ   s   zInstanceStatusSet.endElementr   )r   r   r   r   r   r   r   r   r   r   r
   r<   ·   s
    
r<   N)	Údictr   Úobjectr   r%   r=   r'   r.   r<   r   r   r   r
   Ú<module>   s   &9