
    7
                     j   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ ddlmZ dd	lmZ d
ddZ ej$                  ej&                  j(                         G d dej*                               Z ej$                  ej&                  j.                         G d dej*                               Zy)z)Add IAM policy binding to an application.    )absolute_import)division)unicode_literals)utils)client)base)flags)iam_utilz{description}a*          To add an IAM policy binding for the role of `roles/apphub.viewer`
        for the user `test-user@gmail.com` to Application `my-app` in location
        `us-east1`, run:

          $ {command} my-app --location=us-east1 --role=roles/apphub.viewer --member=user:test-user@gmail.com
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)AddIamPolicyBindingGA0Add IAM policy binding to an Apphub application.c                 X    t        j                  |        t        j                  |        y Nr	   AddAddIamPolicyBindingFlagsr
   AddArgsForAddIamPolicyBindingparsers    9lib/surface/apphub/applications/add_iam_policy_binding.pyArgszAddIamPolicyBindingGA.Args/       	%%f-**62    c                     t        j                  t        j                  j                        }t        j                  |      }|j                  |j                         |j                  |j                        S N)release_track)app_idmemberrole)apisApplicationsClientr   ReleaseTrackGAapi_lib_utilsGetApplicationRefAddIamPolicyBindingRelativeNamer   r    selfargsr   app_refs       r   RunzAddIamPolicyBindingGA.Run4   s^    $$43D3D3G3GHF--d3G%%##%dkk		 &  r   N	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   r-    r   r   r   r   )   !    8 -3 3r   r   c                   *    e Zd ZdZeZed        Zd Zy)AddIamPolicyBindingAlphar   c                 X    t        j                  |        t        j                  |        y r   r   r   s    r   r   zAddIamPolicyBindingAlpha.ArgsB   r   r   c                     t        j                  t        j                  j                        }t        j                  |      }|j                  |j                         |j                  |j                        S r   )r!   r"   r   r#   ALPHAr%   r&   r'   r(   r   r    r)   s       r   r-   zAddIamPolicyBindingAlpha.RunG   s^    $$43D3D3J3JKF--d3G%%##%dkk		 &  r   Nr.   r6   r   r   r9   r9   <   r7   r   r9   N)r2   
__future__r   r   r   googlecloudsdk.api_lib.apphubr   r%   *googlecloudsdk.api_lib.apphub.applicationsr   r!   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apphubr	   googlecloudsdk.command_lib.iamr
   r3   ReleaseTracksr#   r$   Commandr   r<   r9   r6   r   r   <module>rE      s    0 '  ' @ E ( 3 3 #	 D%%(()DLL  *$ D%%++,t||  -r   