
                         >   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                  \R                  R                  \R                  R                   5      \R"                   " S S	\R$                  5      5       5       rg
)zAdd IAM Policy Binding.    )absolute_import)division)unicode_literals)base)iam_util)utilc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	AddIamPolicyBinding   zAdd IAM policy binding to an IAP TCP Tunnel Destination Group resource.

Adds a policy binding to the IAM policy of an IAP TCP Tunnel Destination Group
resource. One binding consists of a member, a role, and an optional condition.
EXAMPLESa            To add an IAM policy binding for the role of
          'roles/iap.tunnelResourceAccessor' for the user 'test-user@gmail.com'
          in the group 'my-group' located in the region 'us-west1', run:

            $ {command} --member='user:test-user@gmail.com'
               --role='roles/iap.tunnelResourceAccessor'
               --dest-group='my-group' --region='us-west1'

          To add an IAM policy binding for the role of
          'roles/iap.tunnelResourceAccessor' for all authenticated users in the
          group 'my-group' located in the region 'us-west1', run:

            $ {command} --member='allAuthenticatedUsers'
              --role='roles/iap.tunnelResourceAccessor'
              --dest-group='my-group' --region='us-west1'

          To add an IAM policy binding which expires at the end of the year 2018
          for the role of 'roles/iap.tunnelResourceAccessor' and the user
          'test-user@gmail.com' in the group 'my-group' located in the region
          'us-west1', run:

            $ {command} --member='user:test-user@gmail.com'
                --role='roles/iap.tunnelResourceAccessor'
                --condition='expression=request.time <
                timestamp("2019-01-01T00:00:00Z"),title=expires_end_of_2018,
                description=Expires at midnight on 2018-12-31'
                --dest-group='my-group' --region='us-west1'

          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AddAddIamPolicyBindingArgsAddIamDestGroupArgsr   URI_FLAGRemoveFromParser)parsers    9lib/surface/iap/tcp/dest_groups/add_iam_policy_binding.pyArgsAddIamPolicyBinding.ArgsG   s2     ''/  (MM""6*    c                     [         R                  " U5      n[        R                  " U R	                  5       U5      nUR                  UR                  UR                  U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   $ValidateAndExtractConditionMutexRoler   ParseIapDestGroupResourceReleaseTrackr
   memberrole)selfargs	conditioniap_iam_refs       r   RunAddIamPolicyBinding.RunS   sL     ==dCI44T5F5F5H$OK**4;;		9MMr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r"   __static_attributes__r$   r   r   r
   r
      s3     "-H 	+ 	+Nr   r
   N)r)   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   googlecloudsdk.command_lib.iapr   r   ReleaseTracksr   ALPHABETAGADefaultUniverseOnlyCommandr
   r$   r   r   <module>r7      s     &  ' ( 3 ; D%%++T->->-C-C%%((*BN$,, BN *BNr   