o
    ȷe/                     @   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	   V/var/www/ideatree/venv/lib/python3.10/site-packages/boto/vpc/vpc_peering_connection.py__init__   s   	
zVpcInfo.__init__c                 C   
   d| j  S )Nz
VpcInfo:%s)r   r   r	   r	   r
   __repr__*      
zVpcInfo.__repr__c                 C      d S Nr	   r   nameattrs
connectionr	   r	   r
   startElement-      zVpcInfo.startElementc                 C   sF   |dkr	|| _ d S |dkr|| _d S |dkr|| _d S t| || d S )NvpcIdownerId	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   r   r   r	   r   r	   r	   r
   r   Q   r   z'VpcPeeringConnectionStatus.startElementc                 C   4   |dkr	|| _ d S |dkr|| _d S t| || d S )Nr#   r$   )r#   r$   r   r   r	   r	   r
   r   T   
   

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      | j jS r   )r.   r#   r   r	   r	   r
   status_coder      z VpcPeeringConnection.status_codec                 C   r1   r   )r.   r$   r   r	   r	   r
   status_messagev   r3   z#VpcPeeringConnection.status_messagec                 C   r   )NzVpcPeeringConnection:%s)r*   r   r	   r	   r
   r   z   r   zVpcPeeringConnection.__repr__c                    sN   t t| |||}|d ur|S |dkr| jS |dkr| jS |dkr%| jS d S )NrequesterVpcInfoaccepterVpcInfostatus)r)   r(   r   r,   r+   r.   )r   r   r   r   retvalr/   r	   r
   r   }   s   z!VpcPeeringConnection.startElementc                 C   r%   )NvpcPeeringConnectionIdexpirationTime)r*   r-   r   r   r	   r	   r
   r      r&   zVpcPeeringConnection.endElementc                 C   s   | j | jS r   )r   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   sN   | j j| jg|d}t|r|d }| | | jS |r$td| jf | jS )N)dry_runr   z)%s is not a valid VpcPeeringConnection ID)r   get_all_vpc_peering_connectionsr*   lenr@   
ValueErrorr2   )r   validaterA   vpc_peering_connection_listupdated_vpc_peering_connectionr	   r	   r
   r>      s   
zVpcPeeringConnection.updater   )FF)r   r   r    r   propertyr2   r4   r   r   r   r<   r@   r>   __classcell__r	   r	   r/   r
   r(   ^   s    

r(   N)r'   boto.ec2.ec2objectr   objectr   r!   r(   r	   r	   r	   r
   <module>   s
   $