
                         j   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	KJr  S
SS.r\R$                  " \R&                  R(                  5       " S S\R*                  5      5       r\R$                  " \R&                  R.                  5       " S S\R*                  5      5       rg)z&Set the IAM policy for an application.    )absolute_import)division)unicode_literals)utils)client)base)flags)iam_utilz{description}a           To set the application IAM policy using a json file 'my_policy.json' for
        the Application `my-app` in location `us-east1`, run:

          $ {command} my-app --location=us-east1 /path/to/my_policy.json

        To set the application IAM policy using a yaml file 'my_policy.yaml` for
        the Application `my-app` in location `us-east1`, run:

          $ {command} my-app --location=us-east1 /path/to/my_policy.yaml
        )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)SetIamPolicyGA+   Set the IAM policy for an Apphub application as defined in a JSON/YAML file.

See https://cloud.google.com/iam/docs/managing-policies for details of
   the policy file format and contents.
c                 \    [         R                  " U 5        [        R                  " U 5        g Nr	   AddSetIamPolicyFlagsr
   AddArgForPolicyFileparsers    1lib/surface/apphub/applications/set_iam_policy.pyArgsSetIamPolicyGA.Args4       	v&  (    c                     [         R                  " [        R                  R                  S9n[
        R                  " U5      nUR                  UR                  5       UR                  S9$ N)release_track)app_idpolicy_file)
apisApplicationsClientr   ReleaseTrackGAapi_lib_utilsGetApplicationRefSetIamPolicyRelativeNamer!   selfargsr   app_refs       r   RunSetIamPolicyGA.Run9   sZ    $$43D3D3G3GHF--d3G##%43C3C   r    N__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r.   __static_attributes__r0   r   r   r   r   +   %    
 !-) )r   r   c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)SetIamPolicyAlphaA   r   c                 \    [         R                  " U 5        [        R                  " U 5        g r   r   r   s    r   r   SetIamPolicyAlpha.ArgsJ   r   r   c                     [         R                  " [        R                  R                  S9n[
        R                  " U5      nUR                  UR                  5       UR                  S9$ r   )
r"   r#   r   r$   ALPHAr&   r'   r(   r)   r!   r*   s       r   r.   SetIamPolicyAlpha.RunO   sZ    $$43D3D3J3JKF--d3G##%43C3C   r   r0   Nr1   r0   r   r   r=   r=   A   r;   r   r=   N)r6   
__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
   r7   ReleaseTracksr$   r%   Commandr   rB   r=   r0   r   r   <module>rL      s    - &  ' @ E ( 3 3 #
  D%%(()T\\  ** D%%++,  -r   