
    "                         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
\R                  5      rg)z(Remove IAM Policy Binding for EkmConfig.    )absolute_import)division)unicode_literals)iam)base)iam_util)resource_argsc                   .    \ rS rSrSr\S 5       rS rSrg)RemoveIamPolicyBinding   a  Remove IAM policy binding from an EkmConfig.

Removes a policy binding from the IAM policy of a kms EkmConfig. A binding
consists of at
least one member, a role, and an optional condition.

## EXAMPLES
To remove an IAM policy binding for the role of 'roles/editor' for the user
'test-user@gmail.com' on the EkmConfig with location us-central1, run:

  $ {command} --location='us-central1' --member='user:test-user@gmail.com'
  --role='roles/editor'

To remove an IAM policy binding with a condition of
expression='request.time < timestamp("2023-01-01T00:00:00Z")',
title='expires_end_of_2022',
and description='Expires at midnight on 2022-12-31' for the role of
'roles/editor'
for the user 'test-user@gmail.com' on the EkmConfig with location us-central1,
run:

  $ {command} --location='us-central1' --member='user:test-user@gmail.com'
  --role='roles/editor' --condition='expression=request.time <
  timestamp("2023-01-01T00:00:00Z"),title=expires_end_of_2022,description=Expires
  at midnight on 2022-12-31'

To remove all IAM policy bindings regardless of the condition for the role of
'roles/editor' and for the user 'test-user@gmail.com' on the EkmConfig with
location us-central1, run:

  $ {command} laplace --location='us-central1'
  --member='user:test-user@gmail.com' --role='roles/editor' --all

See https://cloud.google.com/iam/docs/managing-policies for details of
policy role and member types.
c                 ^    [         R                  " U SS5        [        R                  " U SS9  g )NTz
--location)add_condition)r	   AddKmsLocationResourceArgForKMSr    AddArgsForRemoveIamPolicyBinding)parsers    7lib/surface/kms/ekm_config/remove_iam_policy_binding.pyArgsRemoveIamPolicyBinding.ArgsA   s$    11&$M--fDI    c                    UR                   R                  R                  5       nSR                  UR                  UR
                  5      n[        R                  " X1R                  UR                  5      n[        R                  " US5        U$ )Nz$projects/{0}/locations/{1}/ekmConfig	EkmConfig)CONCEPTSlocationParseformat
projectsIdlocationsIdr    RemovePolicyBindingFromEkmConfigmemberroler   LogSetIamPolicy)selfargslocation_refekm_config_nameresults        r   RunRemoveIamPolicyBinding.RunF   sm    ==))//1L<CC!9!9;O11/;;26))=F_k:Mr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r'   __static_attributes__r)   r   r   r   r      s#    #J J Jr   r   N)r.   
__future__r   r   r   googlecloudsdk.api_lib.cloudkmsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.command_lib.kmsr	   Commandr   r)   r   r   <module>r7      s/    / &  ' / ( 3 82T\\ 2r   