
                             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 ej                   G d dej                               Zy	)
z'logging sinks list' command.    )absolute_import)division)unicode_literals)util)basec                   &    e Zd ZdZed        Zd Zy)Listz~List the defined sinks.

  List the defined sinks.

  ## EXAMPLES

  To list all defined sinks:

    $ {command} --limit=10
  c                 >   t         j                  j                  |        t         j                  j                  |        t	        j
                  | d       | j                  dd       | j                  j                  d       | j                  j                  d       y)z Register flags for this command.zsinks to listz--sink-filterzA filter expression passed to the Logging API to constrain the sinks returned. For information on accepted values, see https://cloud.google.com/logging/docs/reference/v2/rpc/google.logging.v2#listsinksrequest)helpz table(name, destination, filter)N)
r   PAGE_SIZE_FLAGRemoveFromParserURI_FLAGr   AddParentArgsadd_argumentdisplay_info	AddFormatAddCacheUpdater)parsers    !lib/surface/logging/sinks/list.pyArgsz	List.Args'   s     	((0MM""6*v/
h   !!"DE
''-    c                 >   t        j                         j                  j                  t        j                         j                  t        j                  |      |j                              }|j                  D ]  }|j                  rd|_	         |j                  S )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.

    Returns:
      The list of sinks.
    )parentfilterz(empty filter))
r   	GetClientprojects_sinksr	   GetMessagesLoggingProjectsSinksListRequestGetParentFromArgssink_filtersinksr   )selfargsresultsinks       r   RunzList.Run8   s}     ^^,,11::))$/8H8H 	; 	
F
 [[&  <<r   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   UniverseCompatibleListCommandr	   r,   r   r   <module>r2      s@     $ &  ' / ( /4 / /r   