
    	                         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
\R                  5      rg)z)Command to set IAM policy for a resource.    )absolute_import)division)unicode_literals)organizations)base)flags)	org_utilsc                   X    \ rS rSrSrSSR                  / SQ5      0r\S 5       rS r	Sr
g	)
SetIamPolicy   zSet IAM policy for an organization.

Given an organization ID and a file encoded in JSON or YAML that contains the
IAM policy, this command will set the IAM policy for that organization.
EXAMPLES
);The following command reads an IAM policy defined in a JSONz>file `policy.json` and sets it for an organization with the IDz`123456789`: z#  $ {command} 123456789 policy.jsonr   r   z>file `policy.json` and sets it for the organization associatedzwith the domain `example.com`:r   z%  $ {command} example.com policy.jsonc                 n    [         R                  " S5      R                  U 5        U R                  SSS9  g )Nz!whose IAM policy you want to set.policy_filez,JSON or YAML file containing the IAM policy.)help)r   IdArgAddToParseradd_argument)parsers    +lib/surface/organizations/set_iam_policy.pyArgsSetIamPolicy.Args4   s4    	KK34@@H
J  L    c                     [         R                  " UR                  5      nU(       a.  [        R                  " 5       R                  X!R                  5      $ [         R                  " UR                  5      e)N)r	   GetOrganizationIdidr   Clientr   r   UnknownOrganizationError)selfargsorg_ids      r   RunSetIamPolicy.Run:   sN    ((1F!!#009I9IJJ..tww77r    N)__name__
__module____qualname____firstlineno____doc__joindetailed_helpstaticmethodr   r$   __static_attributes__r&   r   r   r   r      s?     
))  -" L L
8r   r   N)r+   
__future__r   r   r   +googlecloudsdk.api_lib.cloudresourcemanagerr   googlecloudsdk.callioper   (googlecloudsdk.command_lib.organizationsr   r	   Commandr   r&   r   r   <module>r5      s/     0 &  ' E ( : >#84<< #8r   