U
    3ìdÁ  ã                   @   sP   d Z ddlm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 Route Table
é    )ÚTaggedEC2Object)Ú	ResultSetc                       s:   e Zd Zd
‡ fdd„	Zdd„ Z‡ fdd„Zdd	„ Z‡  ZS )Ú
RouteTableNc                    s,   t t| ƒ |¡ d | _d | _g | _g | _d S ©N)Úsuperr   Ú__init__ÚidÚvpc_idÚroutesÚassociations©ÚselfÚ
connection©Ú	__class__© ú7/tmp/pip-unpacked-wheel-d7dsrkjd/boto/vpc/routetable.pyr      s
    zRouteTable.__init__c                 C   s
   d| j  S )NzRouteTable:%s©r   ©r   r   r   r   Ú__repr__&   s    zRouteTable.__repr__c                    sd   t t| ƒ |||¡}|d k	r |S |dkr>tdtfgƒ| _| jS |dkr\tdtfgƒ| _| jS d S d S )NZrouteSetÚitemZassociationSet)r   r   ÚstartElementr   ÚRouter
   ÚRouteAssociationr   )r   ÚnameÚattrsr   Úresultr   r   r   r   )   s    zRouteTable.startElementc                 C   s0   |dkr|| _ n|dkr || _nt| ||ƒ d S )NÚrouteTableIdZvpcId)r   r	   Úsetattr©r   r   Úvaluer   r   r   r   Ú
endElement9   s
    zRouteTable.endElement)N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r!   Ú__classcell__r   r   r   r   r      s   r   c                   @   s.   e Zd Zd
dd„Zdd„ Zdd„ Zdd	„ ZdS )r   Nc                 C   s.   d | _ d | _d | _d | _d | _d | _d | _d S r   ©Údestination_cidr_blockZ
gateway_idZinstance_idZinterface_idZvpc_peering_connection_idÚstateÚoriginr   r   r   r   r   B   s    zRoute.__init__c                 C   s
   d| j  S )NzRoute:%s)r'   r   r   r   r   r   K   s    zRoute.__repr__c                 C   s   d S r   r   ©r   r   r   r   r   r   r   r   N   s    zRoute.startElementc                 C   sr   |dkr|| _ n^|dkr || _nN|dkr0|| _n>|dkr@|| _n.|dkrP|| _n|dkr`|| _n|dkrn|| _d S )NZdestinationCidrBlockZ	gatewayIdZ
instanceIdZnetworkInterfaceIdZvpcPeeringConnectionIdr(   r)   r&   r   r   r   r   r!   Q   s    zRoute.endElement)N©r"   r#   r$   r   r   r   r!   r   r   r   r   r   A   s   
	r   c                   @   s.   e Zd Zd
dd„Zdd„ Zdd„ Zdd	„ ZdS )r   Nc                 C   s   d | _ d | _d | _d| _d S )NF©r   Zroute_table_idZ	subnet_idÚmainr   r   r   r   r   b   s    zRouteAssociation.__init__c                 C   s
   d| j  S )NzRouteAssociation:%sr   r   r   r   r   r   h   s    zRouteAssociation.__repr__c                 C   s   d S r   r   r*   r   r   r   r   k   s    zRouteAssociation.startElementc                 C   sF   |dkr|| _ n2|dkr || _n"|dkr0|| _n|dkrB|dk| _d S )NZrouteTableAssociationIdr   ZsubnetIdr-   Útruer,   r   r   r   r   r!   n   s    zRouteAssociation.endElement)Nr+   r   r   r   r   r   a   s   
r   N)	Ú__doc__Zboto.ec2.ec2objectr   Zboto.resultsetr   r   Úobjectr   r   r   r   r   r   Ú<module>   s
   $ 