
    
                     ,   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  \R                  " \R                  R                  \R                  R                   \R                  R"                  5       " S	 S
\R$                  5      5       rg)z&Command to set an Organization Policy.    )absolute_import)division)unicode_literals)org_policies)base)org_policies_base)org_policies_flagsc                   .    \ rS rSrSr\S 5       rS rSrg)	SetPolicy   a  Set Organization Policy.

Sets an Organization Policy associated with the specified resource from
a file that contains the JSON or YAML encoded Organization Policy.

## EXAMPLES

Organization policy list constraint YAML file example:

  constraint: constraints/CONSTRAINT_NAME
  listPolicy:
    deniedValues:
    - VALUE_A

Organization policy list constraint JSON file example:

  {
    "constraint": "constraints/CONSTRAINT_NAME",
    "listPolicy": {
      "deniedValues": ["VALUE_A"]
    }
  }

The following command sets an Organization Policy for a constraint
on project `foo-project` from file `/tmp/policy.yaml`:

  $ {command} --project=foo-project /tmp/policy.yaml
c                 x    [         R                  " U 5        [        R                  " SSS9R	                  U 5        g )Npolicy_filez/JSON or YAML file with the Organization Policy.)help)flagsAddParentResourceFlagsToParserr   ArgumentAddToParser)parsers    7lib/surface/resource_manager/org_policies/set_policy.pyArgsSetPolicy.Args;   s1    	((0MM>@@KA    c           	          [         R                  " U5      n[        R                  " 5       nUR	                  [         R
                  " U[        R                  " UR                  UR                  5      5      5      $ )N)	r   OrgPoliciesServicer   OrgPoliciesMessagesSetOrgPolicySetOrgPolicyRequestGetFileAsMessager   	OrgPolicy)selfargsservicemessagess       r   RunSetPolicy.RunC   sg    2248G//1H--d.:.K.K262B2B2:2D2D/F	GH Hr    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r$   __static_attributes__r&   r   r   r   r      s!    :  Hr   r   N)r+   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr   r	   r   ReleaseTracksReleaseTrackALPHABETAGADescribeCommandr   r&   r   r   <module>r8      sy    - &  ' @ ( I S D%%++T->->-C-C%%((*.H$$ .H*.Hr   