
                            S r SSKJr  SSKJr  SSKJr  \R                  " \R                  R                  \R                  R                  \R                  R                  5      \R                   " S S\R                  5      5       5       rg)zRemove IAM Policy Binding.    )base)iam_util)utilc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	RemoveIamPolicyBinding   a  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.
  c                     [         R                  " U5        [         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.
N)iap_utilAddIapIamResourceArgsAddRemoveIamPolicyBindingArgsr   URI_FLAGRemoveFromParser)clsparsers     0lib/surface/iap/web/remove_iam_policy_binding.pyArgsRemoveIamPolicyBinding.ArgsU   s7     ""
 **62MM""6*    c                     [         R                  " U5      n[        R                  " U R	                  5       U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   memberroleall)selfargs	conditioniap_iam_refs       r   RunRemoveIamPolicyBinding.Runc   s]     44T:I..K --dkk499i.2hh8 8r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   r!   __static_attributes__r#   r   r   r   r      s2    
 ,/-b + +8r   r   N)r(   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.command_lib.iapr   r   ReleaseTracksr   ALPHABETAGADefaultUniverseOnlyCommandr   r#   r   r   <module>r5      s}     ! ) 3 ; T..33T5F5F5I5I W8T\\ W8 W8r   