
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d	d
dZ ej                  ej                  j                          G d dej"                               Zy)z/private connection peering routes list command.    )absolute_import)division)unicode_literals)$PrivateConnectionPeeringRoutesClient)base)flags)resource_projectorz\
          Lists the private connection routes exchanged over a peering connection.
        a  
          To list all the peering routes of private connection called `my-private-connection` in project `my-project` and region `us-west1`, run:

            $ {command} --private-connection=my-private-connection --location=us-west1 --project=my-project

          Or:

            $ {command} --private-connection=my-private-connection

          In the last example, the project and the location are taken from gcloud properties core/project and compute/region, respectively.
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Listz4List Google Cloud private connection peering routes.c                 d    t        j                  |        | j                  j                  d       y)z Register flags for this command.z        table(
            dest_range,
            type,
            next_hop_region,
            status,
            direction)
    N)r   AddPrivateConnectionToParserdisplay_info	AddFormat)parsers    5lib/surface/vmware/private_connections/routes/list.pyArgsz	List.Args4   s+     
&&v.
!! # 	    c              #     K   |j                   j                  j                         }t               }|j	                  |      }d }|D ]:  }t        j                  |      } ||d   |j                  dd            |d<   | < y w)Nc                 "    |r| dk(  ryy| dk(  ryy)z?Create customized status field based on direction and imported.INCOMINGacceptedzaccepted by peerzrejected by configzrejected by peer config )	directionimporteds     r   _TransformStatusz"List.Run.<locals>._TransformStatusF   s!    	
"!	j	 #&r   r   r   Fstatus)CONCEPTSprivate_connectionParser   r   r	   MakeSerializableget)selfargsprivateconnectionclientitemsr   itemroutes           r   RunzList.RunA   s     88>>@13FKK)*E'  11$7e(

eii
E:eHo k s   BBN)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r+   r   r   r   r   r   .   s!    <-
	 
	r   r   N)r/   
__future__r   r   r   5googlecloudsdk.api_lib.vmware.privateconnectionroutesr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.core.resourcer	   r0   ReleaseTracksReleaseTrackGAListCommandr   r   r   r   <module>r<      sj    6 &  ' f ( 3 ;	
	( D%%(()'4 ' *'r   