Ë
    €Ïú  ã                   ó°   — 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 ej                   G d
„ dej                  «      «       Zy)zCommand for undeleting a role.é    )Úabsolute_import)Údivision)Úunicode_literals)Úutil)Úbase)Ú
exceptions)Úflags)Úiam_utilc                   ó&   — e Zd ZdZed„ «       Zd„ Zy)ÚUndeletead  Undelete a custom role from an organization or a project.

  This command undeletes a role. Roles that have been deleted for certain long
  time can't be undeleted.

  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 undelete the role ``ProjectUpdater'' of the organization ``1234567'', run:

    $ {command} ProjectUpdater --organization=1234567

  To undelete the role ``ProjectUpdater'' of the project ``myproject'',
  run:

    $ {command} ProjectUpdater --project=myproject
  c                 óx   — t        j                  | d«       t        j                  d«      j                  | «       y )NÚundelete)r	   ÚAddParentFlagsÚGetCustomRoleFlagÚAddToParser)Úparsers    ú!lib/surface/iam/roles/undelete.pyÚArgszUndelete.Args4   s+   € ä	×Ñ˜ Ô,Ü	×Ñ˜JÓ'×3Ñ3°FÕ;ó    c                 óL  — t        j                  «       \  }}t        j                  |j                  |j
                  |j                  «      }|j                  €"|j
                  €t        j                  dd«      ‚|j                  j                  |j                  |¬«      «      S )NÚROLE_IDz/You can not undelete a curated/predefined role.)Úname)r   ÚGetClientAndMessagesr
   ÚGetRoleNameÚorganizationÚprojectÚroler   ÚInvalidArgumentExceptionÚorganizations_rolesr   Ú$IamOrganizationsRolesUndeleteRequest)ÚselfÚargsÚclientÚmessagesÚ	role_names        r   ÚRunzUndelete.Run9   s“   € Ü×0Ñ0Ó2Ñ€FˆHÜ×$Ñ$ T×%6Ñ%6¸¿¹ÀdÇiÁiÓP€IØ×ÑÐ  T§\¡\Ð%9Ü×/Ñ/Ø
Ø
;ó=ð =ð ×%Ñ%×.Ñ.Ø×5Ñ5¸9Ð5ÓEóGð Gr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústaticmethodr   r&   © r   r   r   r      s!   „ ñð* ñ<ó ð<óGr   r   N)r*   Ú
__future__r   r   r   Úgooglecloudsdk.api_lib.iamr   Úgooglecloudsdk.callioper   r   Úgooglecloudsdk.command_lib.iamr	   r
   ÚUniverseCompatibleÚDescribeCommandr   r,   r   r   Ú<module>r3      sL   ðñ  %å &Ý Ý 'å +Ý (Ý .Ý 0Ý 3ð ×Ñô#Gˆt×#Ñ#ó #Gó ñ#Gr   