
    =                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  SS	KJr   " S
 S\R                  5      rg)z?Implementation of the gcloud genomics operations list command.
    )absolute_import)division)unicode_literals)
list_pager)filter_rewrite)genomics_util)base)logc                   .    \ rS rSrSr\S 5       rS rSrg)List   znList Genomics operations in a project.

Prints a table with summary information on operations in the project.
c                 n    [         R                  R                  U 5        U R                  SS[        SS9  g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go
      on the command line after this command. Positional arguments are
      allowed.
z--filter a          A string for filtering operations created with the v2alpha1 API. In
        addition to typical operators (AND, OR, =, >, etc.) the following
        filter fields are supported:

          metadata.createTime - The time the operation was created as a
                                timestamp YYYY-MM-DD HH:MM:SS<time zone>.  T can
                                also be used as a separator between the date and
                                time.  The time zone is optional and can be
                                specified as an offset from UTC, a name, or 'Z'
                                for UTC. Run $ gcloud topic datetimes
                                to see more examples.
                                    2018-02-15T16:53:38
                                    2018-02-15 16:53:38-5:00
                                    2018-02-15T16:53:38Z
                                    2018-02-15 16:53:38 America/Los_Angeles
                         done - A boolean for whether the operation has
                                completed.
                   error.code - A google.rpc.Code for a completed operation.
              metadata.events - A set of strings for all events on the
                                operation.
                                    events:WorkerStartedEvent
              metadata.labels - A map of string key and value for the operation.
                                    labels.key = value
                                    labels."key with space" = "value with space"
                                For the existence of a key with any value.
                                    labels.key:*
        Run "$ gcloud topic filters" for more information.
        )defaulttypehelpN)r	   
LIMIT_FLAGAddToParseradd_argumentstr)parsers    'lib/surface/genomics/operations/list.pyArgs	List.Args$   s7     	OO'
	       c           	         [         R                  " S5      n[         R                  " S5      nSnUR                  (       aZ  [        R
                  " 5       nUR                  UR                  5      u  Ul        n[        R                  " SUR                  U5        UR                  S[         R                  " 5       < S3US9n[        R                  " UR                  UUR                  SUR                  SS	9$ )
zRun 'operations list'.

Args:
  args: argparse.Namespace, The arguments that this command was invoked
      with.

Returns:
  The list of operations for this project.
v2alpha1Nz!client_filter=%r server_filter=%rz	projects/z/operations)namefilterpageSize
operations)limitbatch_size_attribute
batch_sizefield)r   GetGenomicsClientGetGenomicsMessagesr   r   OperationsBackendRewriter
   info%GenomicsProjectsOperationsListRequestGetProjectIdr   YieldFromListprojects_operationsr"   )selfargsapitools_clientgenomics_messagesrequest_filterrewriterrequests          r   RunList.RunP   s     $55jAO%99*EN{{113h$,$4$4T[[$A!dk>	hh2DKKPEE)6)C)C)EG F G ##++jj':: r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r6   __static_attributes__r8   r   r   r   r      s!    
 ) )Vr   r   N)r=   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.genomicsr   r   googlecloudsdk.callioper	   googlecloudsdk.corer
   Commandr   r8   r   r   <module>rF      s6    '  ' ' : 9 ( #O4<< Or   