
    [                         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  \
R                   " S S\
R                   5      5       rg)zHCommand for to list all the roles of a parent organization or a project.    )absolute_import)division)unicode_literals)
list_pager)util)base)
exceptions)flags)iam_utilc                   .    \ rS rSrSr\S 5       rS rSrg)List   a  List predefined roles, or the custom roles for an organization or project.

When an organization or project is specified, this command lists the custom
roles that are defined for that organization or project.

Otherwise, this command lists IAM's predefined roles.

## EXAMPLES

To list custom roles for the organization ``12345'', run:

  $ {command} --organization=12345

To list custom roles for the project ``myproject'', run:

  $ {command} --project=myproject

To list all predefined roles, run:

  $ {command}
c                    U R                  SSSS9  [        R                  " U SSS9  [        R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        g )Nz--show-deleted
store_truez+Show deleted roles by specifying this flag.)actionhelplistF)required)add_argumentr
   AddParentFlagsr   
ASYNC_FLAGRemoveFromParserPAGE_SIZE_FLAGURI_FLAG)parsers    lib/surface/iam/roles/list.pyArgs	List.Args7   sj    
:  < 
%8OO$$V,((0MM""6*    c                 ,   [         R                  " 5       u  p#UR                  cP  UR                  cC  [        R
                  " UR                  UR                  UR                  S9SUR                  SS9$ [        R                  " UR                  UR                  5      nUR                  b&  UR                  S:  a  [        R                  " S5      e[        R
                  " UR                  UR                  XAR                  S9SUR                  SS9$ )N)showDeletedrolespageSize)fieldlimitbatch_size_attribute   zLimit size must be >=1)parentr!   )r   GetClientAndMessagesprojectorganizationr   YieldFromListr"   IamRolesListRequestshow_deletedr%   r   GetParentNamer	   InvalidArgumentExceptionorganizations_roles IamOrganizationsRolesListRequest)selfargsclientmessagesparent_names        r   RunList.RunB   s    002F|| 1 1 9%%
,,

&
&43D3D
&
E

)+ + (():):DLLIKzz4::>//0HII##""11,=,= 	2 	?jj') )r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r8   __static_attributes__r:   r   r   r   r      s     , + +)r   r   N)r?   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   r	   googlecloudsdk.command_lib.iamr
   r   UniverseCompatibleListCommandr   r:   r   r   <module>rI      sM     O &  ' ' + ( . 0 3 6)4 6) 6)r   