
    $                        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
KJr  SSKJr  \	R&                  " \	R(                  R*                  5       " S S\	R,                  5      5       r\	R&                  " \	R(                  R0                  \	R(                  R2                  5       " S S\	R,                  5      5       rg)z@Command to list all project IDs associated with the active user.    )absolute_import)division)unicode_literals)filter_rewrite)projects_api)base)util)flags)log)resource_projection_specc                   .    \ rS rSrSr\S 5       rS rSrg)	ListAlpha   ak  List projects for which the user has resourcemanager.projects.list permission.

List all projects to which the user has access under the specified
parent (either an Organization or a Folder). Exactly one of --folder
or --organization can be provided.

The output format slightly differs from the Beta and GA versions.

## EXAMPLES

The following command lists projects under the organization with
ID `123456789`:

  $ {command} --organization=123456789

The following command lists projects with display names starting with a
under folder with ID `123456789`:

  $ {command} --folder=123456789 --filter='displayName:a*'

The following command lists the last five created projects, sorted
alphabetically by project ID:

  $ {command} --sort-by=projectId --limit=5

To list projects that have been marked for deletion:

  $ {command} --filter='lifecycleState:DELETE_REQUESTED'
c                     [         R                  " S5      R                  U 5        [         R                  " S5      R                  U 5        U R                  R                  [        R                  5        g )Nzto list projects under)r
   FolderIdFlagAddToParserOrganizationIdFlagdisplay_info	AddFormatcommand_lib_utilLIST_FORMATparsers    lib/surface/projects/list.pyArgsListAlpha.Args>   sQ    	/0<<VD	56BB6J
!!"2">">?    c                 t   UR                  5       n[        R                  " UR                  UR                  S9n[
        R                  " 5       R                  UR                  US9u  Ul        n[        R                  " SUR                  U5        UR                  nUR                  (       a  SnUR                  (       d  UR                  (       aT  [        R                  " U5        [         R"                  " [        R$                  " U5      UR                  UR&                  S9$ [         R(                  " XTS9$ )Run the list command.symbolsaliasesdefaults%client_filter="%s" server_filter="%s"N)parentlimit
batch_sizer'   filter)GetDisplayInfor   ProjectionSpec
transformsr"   r   ListRewriterRewriter*   r   infor'   organizationfolderr
   CheckParentFlagsr   ListV3GetParentFromFlags	page_sizeListselfargsr   r$   server_filterserver_limits         r   RunListAlpha.RunD   s     &&(L'66''1E1EGH!/!<!<!>!F!Fh "G "(DKHH4[[-)::L{{ lDKKT"  (@(@(F'+zzdnnN N \HHr    N	__name__
__module____qualname____firstlineno____doc__staticmethodr   r=   __static_attributes__r?   r   r   r   r      s#    < @ @
Ir   r   c                   .    \ rS rSrSr\S 5       rS rSrg)r7   \   az  List projects accessible by the active account.

Lists all active projects, where the active account has Owner, Editor, Browser
or Viewer permissions. Projects are listed in alphabetical order by project
name. Projects that have been deleted or are pending deletion are not
included.

You can specify the maximum number of projects to list using the `--limit`
flag.

## EXAMPLES

The following command lists the last five created projects, sorted
alphabetically by project ID:

  $ {command} --sort-by=projectId --limit=5

To list projects that have been marked for deletion:

  $ {command} --filter='lifecycleState:DELETE_REQUESTED'
c                 V    U R                   R                  [        R                  5        g )N)r   r   r   r   r   s    r   r   	List.Argst   s    
!!"2">">?r   c                    UR                  5       n[        R                  " UR                  UR                  S9n[
        R                  " 5       R                  UR                  US9u  Ul        n[        R                  " SUR                  U5        UR                  nUR                  (       a  Sn[        R                  " XTS9$ )r   r    r#   r%   Nr)   )r+   r   r,   r-   r"   r   r.   r/   r*   r   r0   r'   r   r7   r8   s         r   r=   List.Runx   s    &&(L'66''1E1EGH!/!<!<!>!F!Fh "G "(DKHH4[[-)::L{{l<FFr   r?   Nr@   r?   r   r   r7   r7   \   s#    , @ @Gr   r7   N)rE   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.projectsr	   r   +googlecloudsdk.command_lib.resource_managerr
   googlecloudsdk.corer   googlecloudsdk.core.resourcer   ReleaseTracksReleaseTrackALPHAListCommandr   BETAGAr7   r?   r   r   <module>r[      s    G &  ' F D ( H = # A D%%++,:I   :I -:Iz D%%**D,=,=,@,@A(G4 (G B(Gr   