
                            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Jr  SS
KJr  SSKr\
R$                  \
R&                  " \
R(                  R*                  \
R(                  R,                  \
R(                  R.                  5       " S S\
R0                  5      5       5       rSS0\l        g)z4Command for updating organization security policies.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)org_security_policies_utils)security_policies_utilsNc                   2    \ rS rSrSrSr\S 5       rS rSr	g)Update   zUpdate a Compute Engine organization security policy.

*{command}* is used to update organization security policies. An organization
security policy is a set of rules that controls access to various resources.
Nc                     [         R                  " SSS9U l        U R                  R                  USS9  [         R                  " U5        [
        R                  " U5        g )NTupdate)required	operation)operation_type)r	   OrgSecurityPolicyArgumentORG_SECURITY_POLICY_ARGAddArgumentAddArgsUpdateSpsp_flagsAddAdvancedOptions)clsparsers     3lib/surface/compute/org_security_policies/update.pyArgsUpdate.Args,   sO    "'"A"A#+C++F8+L	&!'    c           	         [         R                  " U R                  5       5      nU R                  R	                  XR
                  SS9n[        R                  " UUR                  UR
                  [        R                  " U R                  5       5      R                  5       S9n[        R                  " XCR                  5       UR                  S9nUR                  USS9S   nUR                   nUR"                  nUR                   b  UR                   nUR%                  S5      (       dB  UR%                  S5      (       d,  UR%                  S	5      (       d  UR%                  S
5      (       a!  [&        R(                  " UR                  X5      nUR                  R*                  R-                  UUUR.                  S9n	UR1                  USU	S9$ )NF)with_project)refcompute_client	resourcesversion)organization)sp_idonly_generate_requestr   json_parsingjson_custom_content_types	log_leveluser_ip_request_headers)descriptionadvancedOptionsConfigfingerprint)r'   r(   security_policy)r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer$   r   OrgSecurityPolicysix	text_typelowerr
   GetSecurityPolicyIdNamer&   Describer-   r.   IsSpecifiedr   CreateAdvancedOptionsConfigmessagesSecurityPolicyr/   r   )
selfargsholderr"   org_security_policyr'   existing_security_policyr-   advanced_options_configr0   s
             r   Run
Update.Run4   s   **4+<+<+>?F

&
&
8
8U 9 4C 22}}""d//1288:	<
 (;;XXZd6G6GIE2;;5  <  223 5*66K6LL#$$k((455%%233
!
=
=mmT<  mm,,;;5,88 < :O
 %%#' & ) )r    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr   rE   __static_attributes__rG   r   r   r   r      s&    
 !( ( )r   r   EXAMPLESz    To update an organization security policy with ID ``123456789'' to change the
    description to ``New description'', run:

      $ {command} 123456789 --description='New description'
    )rL   
__future__r   r   r   googlecloudsdk.api_lib.computer   4googlecloudsdk.api_lib.compute.org_security_policiesr   googlecloudsdk.callioper   8googlecloudsdk.command_lib.compute.org_security_policiesr	   r
   4googlecloudsdk.command_lib.compute.security_policiesr   r   r5   UniverseCompatibleReleaseTracksr2   ALPHABETAGAUpdateCommandr   detailed_helprG   r   r   <module>r]      s    ; &  ' 7 G ( J ` R X 
 T..33T5F5F5I5I1)T 1) 1)j 	 r   