
    	                         d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ  G d	 d
e	j                        Zy)z*Command for access approval list requests.    )absolute_import)division)unicode_literalsN)requests)base)parentc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)ListzkList Access Approval requests.

  List Access Approval requests by parent (project/folder/organization).
  EXAMPLESa          To list all approval requests owned by project my-project-123, run:

          $ {command} --project=my-project-123 --state=all

        To list pending approval requests owned by organization 999, run:

          $ {command} --organization=999

        or

          $ {command} --organization=999 --state=pending

        Note that the user needs to have permission
        accessapproval.requests.list on the project/folder/organization
        c                     t        j                  |        | j                  ddd       t        j                  j                  |        y)zAdd command-specific args.z--statependingzfilter for request state)defaulthelpN)r   Argsadd_argumentr   URI_FLAGRemoveFromParser)parsers    ,lib/surface/access_approval/requests/list.pyr   z	List.Args6   s@     KK
'  ) 	MM""6*    c                     t        j                  |      }t        j                  ||j                  r|j                  j                               S d      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:
      Some value that we want to have printed later.
    N)r   filter)r   	GetParentr   r
   stateupper)selfargsps      r   RunzList.Run@   sJ     	A=="jj

5 5.25 5r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r    r   r   r
   r
      s?     
(//  -( + +5r   r
   )r#   
__future__r   r   r   r$   &googlecloudsdk.api_lib.access_approvalr   googlecloudsdk.callioper   *googlecloudsdk.command_lib.access_approvalr   ListCommandr
   r(   r   r   <module>r.      s1    1 &  '  ; ( =054 05r   