o
    ȷe                     @   s    d dl mZ G dd deZdS )    )	EC2Objectc                       sT   e Zd ZdZd fdd	Zdd Zdd Zdd
dZeZdddZ	dddZ
  ZS )Addressa  
    Represents an EC2 Elastic IP Address

    :ivar public_ip: The Elastic IP address.
    :ivar instance_id: The instance the address is associated with (if any).
    :ivar domain: Indicates whether the address is a EC2 address or a VPC address (standard|vpc).
    :ivar allocation_id: The allocation ID for the address (VPC addresses only).
    :ivar association_id: The association ID for the address (VPC addresses only).
    :ivar network_interface_id: The network interface (if any) that the address is associated with (VPC addresses only).
    :ivar network_interface_owner_id: The owner IID (VPC addresses only).
    :ivar private_ip_address: The private IP address associated with the Elastic IP address (VPC addresses only).
    Nc                    sJ   t t| | || _|| _|| _d | _d | _d | _d | _	d | _
d | _d S )N)superr   __init__
connection	public_ipinstance_iddomainallocation_idassociation_idnetwork_interface_idnetwork_interface_owner_idprivate_ip_address)selfr   r   r   	__class__ G/var/www/ideatree/venv/lib/python3.10/site-packages/boto/ec2/address.pyr   (   s   
zAddress.__init__c                 C   s
   d| j  S )Nz
Address:%s)r   )r   r   r   r   __repr__4   s   
zAddress.__repr__c                 C   s   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S |dkr$|| _d S |dkr-|| _d S |dkr6|| _d S |dkr?|| _d S |dkrH|| _d S t| || d S )	NpublicIp
instanceIdr	   allocationIdassociationIdnetworkInterfaceIdnetworkInterfaceOwnerIdprivateIpAddress)	r   r   r	   r
   r   r   r   r   setattr)r   namevaluer   r   r   r   
endElement7   s"   







zAddress.endElementFc                 C   *   | j r| jj| j |dS | jj| j|dS )zz
        Free up this Elastic IP address.
        :see: :meth:`boto.ec2.connection.EC2Connection.release_address`
        )r
   dry_runr   r!   )r
   r   release_addressr   r   r!   r   r   r   releaseK   s   zAddress.releasec              	   C   s>   | j r| jj|| j| j ||||dS | jj|| j||||dS )z
        Associate this Elastic IP address with a currently running instance.
        :see: :meth:`boto.ec2.connection.EC2Connection.associate_address`
        )r   r   r
   r   r   allow_reassociationr!   )r   r   r   r   r&   r!   )r
   r   associate_addressr   )r   r   r   r   r&   r!   r   r   r   	associate\   s$   	zAddress.associatec                 C   r    )z
        Disassociate this Elastic IP address from a currently running instance.
        :see: :meth:`boto.ec2.connection.EC2Connection.disassociate_address`
        )r   r!   r"   )r   r   disassociate_addressr   r$   r   r   r   disassociatet   s   zAddress.disassociate)NNN)F)NNNFF)__name__
__module____qualname____doc__r   r   r   r%   deleter(   r*   __classcell__r   r   r   r   r      s    

r   N)boto.ec2.ec2objectr   r   r   r   r   r   <module>   s   