
    b                         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 dd	lmZ dd
lmZ  G d de
j"                        Zy)zGCommand to list all of the workforce pools under a parent organization.    )absolute_import)division)unicode_literals)
list_pager)util)base)
exceptions)iam_util)flagsc                   &    e Zd ZdZed        Zd Zy)Lista  List the workforce pools for an organization.

  Lists all of the workforce pools for an organization given a valid
  organization ID.

  This command can fail for the following reasons:
  * The organization specified does not exist.
  * The active account does not have permission to access the organization.

  ## EXAMPLES

  The following command lists the workforce pools for an organization with the
  ID ``12345'', including soft-deleted pools:

    $ {command} --organization=12345 --location=global --show-deleted
  c                     t        j                  | d       t        j                  | d       | j                  ddd       t        j
                  j                  |        y )Nlistz--show-deleted
store_truez:Show soft-deleted workforce pools by specifying this flag.)actionhelp)r   AddParentFlagsAddLocationFlagadd_argumentr   URI_FLAGRemoveFromParser)parsers    'lib/surface/iam/workforce_pools/list.pyArgsz	List.Args0   sS    	(	&&)
I  K 	MM""6*    c           
         |j                   $|j                   dk  rt        j                  d      t        j                         \  }}|j
                  st        j                  dd      t        j                  |j
                  d d      }t        j                  |j                  |j                  ||j                  t        j                  |            d|j                   |j                   d	      S )
N   zLimit size must be >=1z--organizationz4Should specify the organization for workforce pools.zworkforce pools)parentshowDeletedlocationworkforcePoolspageSize)fieldlimit
batch_sizebatch_size_attribute)r$   gcloud_exceptionsInvalidArgumentExceptionr   GetClientAndMessagesorganizationRequiredArgumentExceptionr
   GetParentNamer   YieldFromListlocations_workforcePools%IamLocationsWorkforcePoolsListRequestshow_deletedr   ParseLocation	page_size)selfargsclientmessagesparent_names        r   RunzList.Run:   s    zz4::>667OPP002FH77

@B B (():):D):<K##''66))((. 	7 	0 jj>>'	) 	)r   N)__name__
__module____qualname____doc__staticmethodr   r8    r   r   r   r      s     " + +)r   r   N)r<   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   r	   r'   googlecloudsdk.command_lib.iamr
   .googlecloudsdk.command_lib.iam.workforce_poolsr   ListCommandr   r>   r   r   <module>rF      s:    N &  ' ( + ( C 3 @0)4 0)r   