
                             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                   G d	 d
ej                               Zy)zCommand for describing a role.    )absolute_import)division)unicode_literals)util)base)flags)iam_utilc                   &    e Zd ZdZed        Zd Zy)Describea  Show metadata for a role.

  This command shows metadata for a role.

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

  ## EXAMPLES

  To print metadata for the role ``spanner.databaseAdmin'' of the organization
  ``1234567'', run:

    $ {command} roles/spanner.databaseAdmin --organization=1234567

  To print metadata for the role ``spanner.databaseAdmin'' of the project
  ``myproject'', run:

    $ {command} roles/spanner.databaseAdmin --project=myproject

  To print metadata for a predefined role, ``spanner.databaseAdmin'', run:

    $ {command} roles/spanner.databaseAdmin
  c                 |    t        j                  | dd       t        j                  d      j                  |        y )NdescribeF)required)r   AddParentFlagsGetRoleFlagAddToParser)parsers    !lib/surface/iam/roles/describe.pyArgszDescribe.Args7   s-    	e<	j!--f5    c                    t        j                  |j                  |j                  |j                        }t        j                         \  }}|j                  j                  |j                  |            }t        j                  |       |S )N)name)r	   GetRoleNameorganizationprojectroler   GetClientAndMessagesorganizations_rolesGetIamOrganizationsRolesGetRequestSetRoleStageIfAlpha)selfargs	role_nameclientmessagesress         r   RunzDescribe.Run<   sr    $$T%6%6diiPI002FH

$
$
(
(00i0@BC  %Jr   N)__name__
__module____qualname____doc__staticmethodr   r'    r   r   r   r      s     2 6 6r   r   N)r+   
__future__r   r   r   googlecloudsdk.api_lib.iamr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   r	   UniverseCompatibleDescribeCommandr   r-   r   r   <module>r4      sF     % &  ' + ( 0 3 %t## % %r   