
                         F   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  SSKJr  SSKJr  SSKJr  SSKr\R2                  " \R4                  R6                  \R4                  R8                  5       " S S\R:                  5      5       rg)z4Command to remove IAM policy binding for a resource.    )absolute_import)division)unicode_literals)projects_api)smart_guardrails)
http_retry)base)iam_util)flags)util)
completers)
console_ioNc                       \ rS rSrSr\R                  " 5       r\S 5       r	\
R                  " \R                  R                  R                  5      S 5       rSrg)RemoveIamPolicyBinding"   zRemove IAM policy binding from the IAM policy of a project.

Removes a policy binding from the IAM policy of a project, given a project ID
and the binding.
c                 :   [         R                  " S5      R                  U5        [        R                  " U[
        R                  SS9  U R                  5       [        R                  R                  :w  a&  [         R                  " S5      R                  U5        g g )Nzremove IAM policy binding fromT)role_completeradd_conditionzIAM policy binding removal)r   GetProjectResourceArgAddToParserr
    AddArgsForRemoveIamPolicyBindingr   ProjectsIamRolesCompleterReleaseTrackr	   GAGetRecommendFlag)clsparsers     1lib/surface/projects/remove_iam_policy_binding.pyArgsRemoveIamPolicyBinding.Args,   s|    	 @AMM --!;;
 T..1119:FFvN 2    c                    [         R                  " UR                  5      n[        R                  " U5      nU R                  5       [        R
                  R                  :w  a  UR                  (       a  U(       d  [        R                  " 5         [        R                  " [        R
                  R                  UR                  5       UR                  UR                  5      n[        R                  " 5         U(       a  [         R"                  " U5      (       d  g [$        R&                  " X!R                  UR                  X1R(                  5      n[        R*                  " UR                  S5        U$ )Nproject)command_lib_utilParseProject
project_idr
   $ValidateAndExtractConditionMutexRoler   r	   r   	recommendEnableUserProjectQuotar   GetIamPolicyBindingDeletionRiskNamememberroleDisableUserProjectQuotar   PromptContinuer   #RemoveIamPolicyBindingWithConditionallLogSetIamPolicy)selfargsproject_ref	conditionrisk_messageresults         r   RunRemoveIamPolicyBinding.Run9   s    "//@K==dCI 	t00333NN
 !!#%EE




 0 0 2DKKl ""$	((66==[[$))YF T__i8Mr!    N)__name__
__module____qualname____firstlineno____doc__r$   (GetDetailedHelpForRemoveIamPolicyBindingdetailed_helpclassmethodr   r   RetryOnHttpStatussixmoveshttp_clientCONFLICTr9   __static_attributes__r;   r!   r   r   r   "   s[     #KKM-
O 
O 		 5 5 > >? @r!   r   )r@   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   'googlecloudsdk.api_lib.smart_guardrailsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   googlecloudsdk.command_lib.iamr
   #googlecloudsdk.command_lib.projectsr   r   r$   +googlecloudsdk.command_lib.resource_managerr   googlecloudsdk.core.consoler   six.moves.http_clientrE   ReleaseTracksr   ALPHABETACommandr   r;   r!   r   <module>rX      sv     ; &  ' D D 2 ( 3 5 H B 2  D%%++T->->-C-CD0T\\ 0 E0r!   