
                         |   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  \R                  " \R                  R                  5      \R                   " S S	\R                   5      5       5       r\R                  " \R                  R$                  \R                  R&                  5       " S
 S\5      5       rg)zRemove IAM Policy Binding.    )absolute_import)division)unicode_literals)base)iam_util)utilc                   :    \ rS rSrSrSS0rSr\S 5       rS r	Sr
g	)
RemoveIamPolicyBinding     Remove IAM policy binding from an IAP IAM resource.

Removes a policy binding from the IAM policy of an IAP IAM resource. One
binding consists of a member, a role and an optional condition.
See $ {parent_command} get-iam-policy for examples of how to
specify an IAP IAM resource.
EXAMPLESav            See $ {parent_command} get-iam-policy for examples of how to specify
          an IAP IAM resource.

          To remove an IAM policy binding for the role of 'roles/editor' for the
          user 'test-user@gmail.com' on IAP IAM resource IAP_IAM_RESOURCE, run:

            $ {command} --resource-type=IAP_IAM_RESOURCE --member='user:test-user@gmail.com'
                --role='roles/editor'

          To remove an IAM policy binding for the role of 'roles/editor' for the
          user 'test-user@gmail.com' on regional IAP IAM resource
          IAP_IAM_RESOURCE, run:

            $ {command} --resource-type=IAP_IAM_RESOURCE --member='user:test-user@gmail.com'
                --role='roles/editor' --region=REGION

          To remove an IAM policy binding for the role of 'roles/editor' from
          all authenticated users on IAP IAM resource IAP_IAM_RESOURCE,run:

            $ {command} --resource-type=IAP_IAM_RESOURCE --member='allAuthenticatedUsers'
                --role='roles/editor'

          To remove an IAM policy binding with a condition of
          expression='request.time < timestamp("2019-01-01T00:00:00Z")',
          title='expires_end_of_2018', and description='Expires at midnight on
          2018-12-31' for the role of 'roles/browser' for the user
          'test-user@gmail.com' on IAP IAM resource IAP_IAM_RESOURCE,
          run:

            $ {command} --resource-type=IAP_IAM_RESOURCE --member='user:test-user@gmail.com'
                --role='roles/browser' --condition='expression=request.time <
                timestamp("2019-01-01T00:00:00Z"),title=expires_end_of_2018,
                description=Expires at midnight on 2018-12-31'

          To remove all IAM policy bindings regardless of the condition for the
          role of 'roles/browser' and for the user 'test-user@gmail.com' on IAP
          IAM resource IAP_IAM_RESOURCE, run:

            $ {command} --resource-type=IAP_IAM_RESOURCE --member='user:test-user@gmail.com'
                --role='roles/browser' --all

          See https://cloud.google.com/iam/docs/managing-policies for details of
          policy role and member types.
  Fc                     [         R                  " UU R                  S9  [         R                  " U5        [        R
                  R                  U5        g)zRegister flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
      to capture some information, but behaves like an ArgumentParser.
)support_cloud_runN)iap_utilAddIapIamResourceArgs_support_cloud_runAddRemoveIamPolicyBindingArgsr   URI_FLAGRemoveFromParser)clsparsers     0lib/surface/iap/web/remove_iam_policy_binding.pyArgsRemoveIamPolicyBinding.ArgsX   s@     ""00
 **62MM""6*    c                     [         R                  " U5      n[        R                  " U R	                  5       UU R
                  5      nUR                  UR                  UR                  UUR                  5      $ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  The specified function with its description and configured filter.
)
r   ValidateAndExtractConditionr   ParseIapIamResourceReleaseTrackr   r
   memberroleall)selfargs	conditioniap_iam_refs       r   RunRemoveIamPolicyBinding.Rung   sf     44T:I..K
 --dkk499i.2hh8 8r    N)__name__
__module____qualname____firstlineno____doc__detailed_helpr   classmethodr   r'   __static_attributes__r)   r   r   r
   r
      s8     ,/-b + +8r   r
   c                       \ rS rSrSrSrSrg)RemoveIamPolicyBindingAlpha{   r   Tr)   N)r*   r+   r,   r-   r.   r   r1   r)   r   r   r3   r3   {   s     r   r3   N)r.   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.command_lib.iapr   r   ReleaseTracksr   GADefaultUniverseOnlyCommandr
   ALPHABETAr3   r)   r   r   <module>r?      s     ! &  ' ( 3 ; D%%(()[8T\\ [8  *[8| D%%++T->->-C-CD	"8 	 E	r   