
                         z    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	\R                  5      rg
)z-The gcloud firestore operations list command.    )
operations)rewrite_backend)base)flags)
properties)resource_projection_specc                   <    \ rS rSrSrSS0r\S 5       rS rS r	Sr
g	)
List   a  List pending Cloud Firestore admin operations and their status.

Filters are case-sensitive and have the following syntax:

  field = value [AND [field = value]] ...

Only the logical `AND` operator is
supported; space-separated items are treated as having an implicit `AND`
operator.
EXAMPLESz          To retrieve information about recent operations, run:

            $ {command}

          To only list operations that are done, run:

            $ {command} --filter="done:true"
      c                     [         R                  R                  U [        R                  5        [         R
                  R                  U [        R                  5        [        R                  " U 5        g)z Register flags for this command.N)r   PAGE_SIZE_FLAG
SetDefaultr   DEFAULT_PAGE_SIZE
LIMIT_FLAGr   AddDatabaseIdFlag)parsers    (lib/surface/firestore/operations/list.pyArgs	List.Args3   sH     	""6:+G+GHOOvz'C'CD	F#    c                     U R                  UR                  U5      u  p#X!l        [        R                  " [        R
                  R                  R                  R                  SS9UR                  UR                  US9$ )NT)required)projectdatabaselimitoperation_filter)_ConvertFilterfilterr   ListOperationsr   VALUEScorer   Getr   r   )selfargsfrontend_filterbackend_filters       r   RunList.Run:   sg    &*&9&9$++t&L#O!K$$!!&&..22D2Ajj'	) )r   c                     [         R                  " 5       nUR                  5       n[        R                  " UR
                  UR                  S9nUR                  XS9$ )a8  Translates user-provided filter spec into one our backend understands.

Args:
  expression: a filter spec to translate
  args: the args namespace object
Returns:
  A tuple of string filter specs. The first is the frontend spec for post
  filtering, the second is a spec that the Firestore Admin API understands.
)symbolsaliases)defaults)r   OperationsRewriteBackendGetDisplayInfor   ProjectionSpec
transformsr,   Rewrite)r$   
expressionr%   operation_rewrite_backenddisplay_infor-   s         r   r   List._ConvertFilterD   sW     !0 H H J&&(L'66''1E1EGH$,,Z,KKr    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r(   r   __static_attributes__r7   r   r   r
   r
      s7    	 
- $ $)Lr   r
   N)r<    googlecloudsdk.api_lib.firestorer   r   googlecloudsdk.callioper   $googlecloudsdk.command_lib.firestorer   googlecloudsdk.corer   googlecloudsdk.core.resourcer   ListCommandr
   r7   r   r   <module>rF      s2    4 8 < ( 6 * A8L4 8Lr   