
    	                     r   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	Z ej                  ej                  j                          G d
 dej"                               Z ej                  ej                  j&                  ej                  j(                         G d de             Zy)z"Cloud Pub/Sub topics list command.    )absolute_import)division)unicode_literals)topics)base)util)
propertiesc              #      K   t        j                         }|j                  t        j                         | j
                        D ]  }|rt        j                  |      }|  y w)N)	page_size)r   TopicsClientListr   ParseProjectr   ListTopicDisplayDict)argslegacy_outputclienttopics       !lib/surface/pubsub/topics/list.py_Runr      sQ      &{{4,,.$..{Ie''.e
K Js   A%A'c                   0    e Zd ZdZdddZed        Zd Zy)r   ,Lists Cloud Pub/Sub topics within a project.z          Lists all of the Cloud Pub/Sub topics that exist in a given project that
          match the given topic name filter.a            To filter results by topic name (ie. only show topic 'my-topic'), run:

            $ {command} --filter="name.scope(topic):'my-topic'"

          To combine multiple filters (with AND or OR), run:

            $ {command} --filter="name.scope(topic):'my-topic' OR name.scope(topic):'my-other-topic'"

          To filter topics that match an expression:

            $ {command} --filter="name.scope(topic):'my-topic_*'"
          )DESCRIPTIONEXAMPLESc                     | j                   j                  d       | j                   j                  t        j                         y )Nyaml)display_info	AddFormat
AddUriFuncr   TopicUriFunc)parsers    r   Argsz	List.Args<   s0    
!!&)
""4#4#45    c                     t        |      S )N)r   )selfr   s     r   RunzList.RunA   s    :r"   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr!   r%    r"   r   r   r   #   s/    40-* 6 6r"   r   c                       e Zd ZdZd Zy)ListBetar   c                     t         j                  j                  j                  j	                         }t        ||      S )N)r   )r	   VALUESpubsubr   GetBoolr   )r$   r   r   s      r   r%   zListBeta.RunI   s/    %%,,::BBDMM22r"   N)r&   r'   r(   r)   r%   r,   r"   r   r.   r.   E   s
    43r"   r.   N)F)r)   
__future__r   r   r   googlecloudsdk.api_lib.pubsubr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.pubsubr   googlecloudsdk.corer	   r   ReleaseTracksReleaseTrackGAListCommandr   BETAALPHAr.   r,   r"   r   <module>r>      s    ) &  ' 0 ( 2 * D%%(()4  *B D%%**D,=,=,C,CD3t 3 E3r"   