
                            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  \R                  " \R                   R"                  \R                   R$                  5       " S
 S\R&                  5      5       rg)z)Command to set IAM policy for a resource.    )absolute_import)division)unicode_literals)projects_api)base)iam_util)flags)utilc                   .    \ rS rSrSr\S 5       rS rSrg)SetIamPolicy   aa  Set IAM policy for a project.

Sets the IAM policy for a project, given a project ID and a file encoded in
JSON or YAML that contains the IAM policy.

## EXAMPLES

The following command reads an IAM policy defined in a JSON file `policy.json`
and sets it for a project with the ID `example-project-id-1`:

  $ {command} example-project-id-1 policy.json
c                 z    [         R                  " S5      R                  U 5        [        R                  " U 5        g )Nzset IAM policy for)r	   GetProjectIDNumberFlagAddToParserr   AddArgForPolicyFile)parsers    &lib/surface/projects/set_iam_policy.pyArgsSetIamPolicy.Args+   s*    	  !56BB6J  (    c                     [         R                  " UR                  5      n[        R                  " X!R
                  5      n[        R                  " UR                  5       S5        U$ )Nproject)	command_lib_utilParseProjectidr   SetIamPolicyFromFilepolicy_filer   LogSetIamPolicyName)selfargsproject_refresultss       r   RunSetIamPolicy.Run0   sJ    "//8K//=M=MNG[--/;Nr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r$   __static_attributes__r&   r   r   r   r      s      ) )r   r   N)r+   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   googlecloudsdk.callioper   googlecloudsdk.command_lib.iamr   #googlecloudsdk.command_lib.projectsr	   r
   r   ReleaseTracksReleaseTrackBETAGACommandr   r&   r   r   <module>r8      sg    0 &  ' D ( 3 5 H D%%**D,=,=,@,@A4<<  Br   