
                         ~   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 ddl	m
Z
 ddlmZ  e
j                  e
j                  j                  e
j                  j                          G d	 d
e
j"                               Z e
j                  e
j                  j&                         G d de
j"                               Zy)z?Command to list all folder IDs associated with the active user.    )absolute_import)division)unicode_literals)
list_pager)folders)base)flagsc                   &    e Zd ZdZed        Zd Zy)ListBetaaD  List folders accessible by the active account.

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

  ## EXAMPLES

  The following command lists folders under org with ID `123456789`:

    $ {command} --organization=123456789

  The following command lists folders under folder with ID `123456789`:

    $ {command} --folder=123456789

  The following command lists all the folders including the delete requested
  ones under the folder with ID `123456789`:

    $ {command} --folder=123456789 --show-deleted

  The following command lists only the deleted folders under folder with
  ID `123456789`:

    $ {command} --folder=123456789 --show-deleted \

        --filter='lifecycleState:DELETE_REQUESTED':

  c                     t        j                  d      j                  |        t        j                  d      j                  |        | j	                  ddd       | j
                  j                  d       y )Nto list folders underz--show-deleted
store_truezj            Put --show-deleted flag to include folders
            for which delete is requested.
        )actionhelpz
        table(
          displayName:label=DISPLAY_NAME,
          parent:label=PARENT_NAME,
          name.segment():label=ID:align=right:sort=1,
          lifecycleState
        )
    )r	   FolderIdFlagAddToParserOrganizationIdFlagadd_argumentdisplay_info	AddFormatparsers    ,lib/surface/resource_manager/folders/list.pyArgszListBeta.Args;   so    	./;;FC	45AA&I
   !! # 	    c                 .   t        j                  |       t        j                  t	        j
                         t	        j                         j                  t        j                  |      |j                        |j                  d|j                  d      S )Run the list command.)parentshowDeletedpageSizer   limitbatch_size_attribute
batch_sizefield)r	   CheckParentFlagsr   YieldFromListr   FoldersServiceFoldersMessages&CloudresourcemanagerFoldersListRequestGetParentFromFlagsshow_deletedr"   	page_sizeselfargss     r   RunzListBeta.RunO   sy    	4 ## !HH++D1)) 	I 	+ jj'>> r   N__name__
__module____qualname____doc__staticmethodr   r1    r   r   r   r      s     < 	 	&r   r   c                   &    e Zd ZdZed        Zd Zy)Lista  List folders accessible by the active account.

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

  ## EXAMPLES

  The following command lists folders under org with ID `123456789`:

    $ {command} --organization=123456789

  The following command lists folders under folder with ID `123456789`:

    $ {command} --folder=123456789
  c                     t        j                  d      j                  |        t        j                  d      j                  |        | j                  j                  d       y )Nr   z
        table(
          displayName:label=DISPLAY_NAME,
          parent:label=PARENT_NAME,
          name.segment():label=ID:align=right:sort=1
        )
    )r	   r   r   r   r   r   r   s    r   r   z	List.Argsp   sO    	./;;FC	45AA&I
!! # 	r   c                    t        j                  |       t        j                  t	        j
                         t	        j                         j                  t        j                  |            |j                  d|j                  d      S )r   )r   r    r   r!   )r	   r&   r   r'   r   r(   r)   r*   r+   r"   r-   r.   s     r   r1   zList.Run|   sn    	4 ## !HH++D1 	I 	3jj'>> r   Nr2   r8   r   r   r:   r:   ]   s     " 		 		
r   r:   N)r6   
__future__r   r   r   apitools.base.pyr   'googlecloudsdk.api_lib.resource_managerr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr	   ReleaseTracksReleaseTrackALPHABETAListCommandr   GAr:   r8   r   r   <module>rH      s    F &  ' ' ; ( = D%%++T->->-C-CD>t > E>B D%%(()(4 ( *(r   