
    C                     @   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
Kr\	R                  " \	R                   R"                  \	R                   R$                  \	R                   R&                  5       " S S\	R(                  5      5       rg
)zCCommand to add denied values to an Organization Policy list policy.    )absolute_import)division)unicode_literals)
exceptions)org_policies)base)org_policies_base)org_policies_flagsNc                   .    \ rS rSrSr\S 5       rS rSrg)Deny   a  Add values to an Organization Policy denied_values list policy.

Adds one or more values to the specified Organization Policy denied_values
list policy associated with the specified resource.

## EXAMPLES

The following command adds `devEnv` and `prodEnv` to an Organization Policy
denied_values list policy for constraint `serviceuser.services`
on project `foo-project`:

  $ {command} serviceuser.services --project=foo-project devEnv prodEnv
c                     [         R                  " U 5        [         R                  " U 5        [        R                  " SSSSS9R                  U 5        g )Ndenied_valueDENIED_VALUE+z3The values to add to the denied_values list policy.)metavarnargshelp)flagsAddIdArgToParserAddParentResourceFlagsToParserr   ArgumentAddToParser)parsers    1lib/surface/resource_manager/org_policies/deny.pyArgs	Deny.Args.   sB    	6"	((0MMB	
 k&    c                 t   [         R                  " 5       n[        R                  " U5      nUR	                  [        R
                  " U5      5      nUR                  (       d,  UR                  (       a1  UR                  R                  (       a  [        R                  " S5      eUR                  (       a1  UR                  R                  (       a  [        R                  " S5      eUR                  (       ah  UR                  R                  (       aM  UR                   H<  nUR                  R                  R                  [        R                   " U5      5        M>     OUR#                  UR                  S9Ul        UR$                  (       a  S Ul        UR'                  [        R(                  " X5      5      $ )Nz5Cannot add values to a non-denied_values list policy.z5Cannot add values if all_values is already specified.)deniedValues)r   OrgPoliciesMessagesr	   OrgPoliciesServiceGetOrgPolicyGetOrgPolicyRequestbooleanPolicy
listPolicyallowedValuesr   ResourceManagerError	allValuesr    r   appendsix	text_type
ListPolicyrestoreDefaultSetOrgPolicySetOrgPolicyRequest)selfargsmessagesservicepolicyvalues         r   RunDeny.Run:   sA   //1H2248G!!"3"G"G"MNF 1 1 & 1 1 ? ?++
AC C V..88++
AC C V..;;$$%&&--cmmE.BC % #--4;L;L-Mf"f--d;= =r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r7   __static_attributes__r9   r   r   r   r      s       =r   r   )r>   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   r   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr	   r
   r   r+   ReleaseTracksReleaseTrackALPHABETAGACommandr   r9   r   r   <module>rK      s{    J &  ' > @ ( I S 
 D%%++T->->-C-C%%((*4=4<< 4=*4=r   