
    k	                         d Z ddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ej                   G d dej                               Zy)	z:Command to add an IAM policy binding for an investigation.    N)args)util)base)iam_utilc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)AddIamPolicyBindingz0Adds an IAM policy binding for an investigation.EXAMPLESaA            To add an IAM policy binding for the role of 'roles/geminicloudassist.investigationViewer'
          for the user 'test-user@gmail.com' on the investigation
          'project/my-project/locations/my-location/investigations/my-investigation', run:

            $ {command} project/my-project/locations/my-location/investigations/my-investigation --member='user:test-user@gmail.com' --role='roles/geminicloudassist.investigationViewer'

          See https://cloud.google.com/iam/docs/managing-policies for details of
          policy role and member types.
          c                 Z    t        j                  | d       t        j                  |        y)zTRegisters flags for this command.

    Args:
      parser: The argparse parser.
    zto add IAM policy binding forN)geminicloudassist_argsAddInvestigationResourceArgr   AddArgsForAddIamPolicyBinding)parsers    Hlib/surface/gemini/cloud_assist/investigations/add_iam_policy_binding.pyArgszAddIamPolicyBinding.Args+   s(     66/ **62    c                 l    t        j                  |j                  |j                  |j                        S )zAdds an IAM policy binding for an investigation.

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

    Returns:
      The updated IAM policy.
    )geminicloudassist_util AddInvestigationIamPolicyBindinginvestigationmemberrole)selfr   s     r   RunzAddIamPolicyBinding.Run7   s,     "BBDKK r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r    r   r   r   r      s<    8 /(// 	# 	- 	3 	3r   r   )r   r   *googlecloudsdk.api_lib.gemini_cloud_assistr   r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   UniverseCompatibleCommandr   r"   r   r   <module>r(      s?     A  U U ( 3 ($,, ( (r   