
    6	                         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	d
Z
 G d de	j                        Ze
e_        y)z'logging links list' command.    )absolute_import)division)unicode_literals)util)arg_parsers)basez<
        List the linked datasets created for a bucket.
    zV
     To list the linked datasets created for a bucket, run:

        $ {command}
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)Listz5List created linked datasets on the specified bucket.c                     t        j                  | d       t        j                  | dd       | j                  ddt	        j
                  dd      d       | j                  j                  d	       y
)z Register flags for this command.zlinked datasets to listTz Location of the specified bucketz--bucketz.+zmust be non-emptyzID of bucket)requiredtypehelpz2table(name.segment(-1):label=LINK_ID, create_time)N)r   AddParentArgsAddBucketLocationArgadd_argumentr   RegexpValidatordisplay_info	AddFormat)parsers    !lib/surface/logging/links/list.pyArgsz	List.Args)   sn     	v89fd,NO
((0CD	   !!<    c           	   #   8  K   t        j                         j                  j                  t        j                         j                  t        j                  t        j                  |      d|j                                    }|j                  D ]  }|  yw)zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Yields:
      The list of linked datasets.
    buckets)parentN)
r   	GetClient projects_locations_buckets_linksr   GetMessages/LoggingProjectsLocationsBucketsLinksListRequestCreateResourceNameGetBucketLocationFromArgsbucketlinks)selfargsresultlinks       r   RunzList.Run9   s{      ^^>>CCJJ**..t4i 	K 	
F j s   BBN)__name__
__module____qualname____doc__staticmethodr   r*    r   r   r   r   &   s    = r   r   N)r.   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   r   DETAILED_HELPListCommandr   detailed_helpr0   r   r   <module>r7      sJ     $ &  ' / / (		%4 %P # r   