U
    W¨+d/  ã                   @   sD   d Z ddlmZ G dd„ deƒZG dd„ deƒZG dd„ deƒZd	S )
z&
Represents a VPC Peering Connection.
é    )ÚTaggedEC2Objectc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚVpcInfoc                 C   s   d| _ d| _d| _dS )z½
        Information on peer Vpc.
        
        :ivar id: The unique ID of peer Vpc.
        :ivar owner_id: Owner of peer Vpc.
        :ivar cidr_block: CIDR Block of peer Vpc.
        N)Úvpc_idÚowner_idÚ
cidr_block©Úself© r	   úC/tmp/pip-unpacked-wheel-dlxw5sjy/boto/vpc/vpc_peering_connection.pyÚ__init__   s    	zVpcInfo.__init__c                 C   s
   d| j  S )Nz
VpcInfo:%s)r   r   r	   r	   r
   Ú__repr__*   s    zVpcInfo.__repr__c                 C   s   d S ©Nr	   ©r   ÚnameÚattrsÚ
connectionr	   r	   r
   ÚstartElement-   s    zVpcInfo.startElementc                 C   s@   |dkr|| _ n,|dkr || _n|dkr0|| _nt| ||ƒ d S )NZvpcIdZownerIdZ	cidrBlock)r   r   r   Úsetattr©r   r   Úvaluer   r	   r	   r
   Ú
endElement0   s    zVpcInfo.endElementN)Ú__name__Ú
__module__Ú__qualname__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 )ÚVpcPeeringConnectionStatusa†  
    The status of VPC peering connection.

    :ivar code: The status of the VPC peering connection. Valid values are:

        * pending-acceptance
        * failed
        * expired
        * provisioning
        * active
        * deleted
        * rejected

    :ivar message: A message that provides more information about the status of the VPC peering connection, if applicable.
    r   Nc                 C   s   || _ || _d S r   ©ÚcodeÚmessage)r   r   r   r	   r	   r
   r   J   s    z#VpcPeeringConnectionStatus.__init__c                 C   s   d| j | jf S )Nz%s(%d)r   r   r	   r	   r
   r   N   s    z#VpcPeeringConnectionStatus.__repr__c                 C   s   d S r   r	   r   r	   r	   r
   r   Q   s    z'VpcPeeringConnectionStatus.startElementc                 C   s0   |dkr|| _ n|dkr || _nt| ||ƒ d S )Nr   r   )r   r   r   r   r	   r	   r
   r   T   s
    z%VpcPeeringConnectionStatus.endElement)r   N)r   r   r   Ú__doc__r   r   r   r   r	   r	   r	   r
   r   :   s
   
r   c                       sl   e Zd Zd‡ fdd„	Zedd„ ƒZedd„ ƒZdd	„ Z‡ fd
d„Zdd„ Z	dd„ Z
dd„ Zddd„Z‡  ZS )ÚVpcPeeringConnectionNc                    s8   t t| ƒ |¡ d| _tƒ | _tƒ | _d| _tƒ | _	dS )a  
        Represents a VPC peering connection.

        :ivar id: The unique ID of the VPC peering connection.
        :ivar accepter_vpc_info: Information on peer Vpc.
        :ivar requester_vpc_info: Information on requester Vpc.
        :ivar expiration_time: The expiration date and time for the VPC peering connection.
        :ivar status_code: The status of the VPC peering connection.
        :ivar status_message: A message that provides more information about the status of the VPC peering connection, if applicable.
        N)
Úsuperr   r   Úidr   Úaccepter_vpc_infoÚrequester_vpc_infoÚexpiration_timer   Ú_status)r   r   ©Ú	__class__r	   r
   r   `   s    zVpcPeeringConnection.__init__c                 C   s   | j jS r   )r%   r   r   r	   r	   r
   Ústatus_coder   s    z VpcPeeringConnection.status_codec                 C   s   | j jS r   )r%   r   r   r	   r	   r
   Ústatus_messagev   s    z#VpcPeeringConnection.status_messagec                 C   s
   d| j  S )NzVpcPeeringConnection:%s)r!   r   r	   r	   r
   r   z   s    zVpcPeeringConnection.__repr__c                    sN   t t| ƒ |||¡}|d k	r |S |dkr.| jS |dkr<| jS |dkrJ| jS d S )NZrequesterVpcInfoZaccepterVpcInfoÚstatus)r    r   r   r#   r"   r%   )r   r   r   r   Úretvalr&   r	   r
   r   }   s    z!VpcPeeringConnection.startElementc                 C   s0   |dkr|| _ n|dkr || _nt| ||ƒ d S )NZvpcPeeringConnectionIdZexpirationTime)r!   r$   r   r   r	   r	   r
   r   ‹   s
    zVpcPeeringConnection.endElementc                 C   s   | j  | j¡S r   )r   Zdelete_vpc_peering_connectionr!   r   r	   r	   r
   Údelete“   s    zVpcPeeringConnection.deletec                 C   s   | j  |j ¡ d S r   )Ú__dict__Úupdate)r   Úupdatedr	   r	   r
   Ú_update–   s    zVpcPeeringConnection._updateFc                 C   sJ   | j j| jg|d}t|ƒr0|d }|  |¡ n|rDtd| jf ƒ‚| jS )N)Údry_runr   z)%s is not a valid VpcPeeringConnection ID)r   Zget_all_vpc_peering_connectionsr!   Úlenr0   Ú
ValueErrorr(   )r   Úvalidater1   Zvpc_peering_connection_listZupdated_vpc_peering_connectionr	   r	   r
   r.   ™   s    þzVpcPeeringConnection.update)N)FF)r   r   r   r   Úpropertyr(   r)   r   r   r   r,   r0   r.   Ú__classcell__r	   r	   r&   r
   r   ^   s   

r   N)r   Zboto.ec2.ec2objectr   Úobjectr   r   r   r	   r	   r	   r
   Ú<module>   s   $