
    
                     ,   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  ej                  ej                  j                  ej                  j                   ej                  j"                         G d	 d
ej$                               Zy)z&Command to set an Organization Policy.    )absolute_import)division)unicode_literals)org_policies)base)org_policies_base)org_policies_flagsc                   &    e Zd ZdZed        Zd Zy)	SetPolicya  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                 z    t        j                  |        t        j                  dd      j	                  |        y )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ArgszSetPolicy.Args;   s1    	((0MM>@@KA    c           	          t        j                  |      }t        j                         }|j	                  t        j
                  |t        j                  |j                  |j                                    S )N)	r   OrgPoliciesServicer   OrgPoliciesMessagesSetOrgPolicySetOrgPolicyRequestGetFileAsMessager   	OrgPolicy)selfargsservicemessagess       r   RunzSetPolicy.RunC   sg    2248G//1H--d.:.K.K262B2B2:2D2D/F	GH Hr   N)__name__
__module____qualname____doc__staticmethodr   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>r3      s{    - &  ' @ ( I S D%%++T->->-C-C%%((*.H$$ .H*.Hr   