
                            S r SSKJr  SSKJr  SSKJr  SSK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)z2Command for moving organization security policies.    )absolute_import)division)unicode_literalsN)base_classes)client)base)flags)org_security_policies_utils)logc                   2    \ rS rSrSrSr\S 5       rS rSr	g)Move    zMove a Compute Engine organization security policy.

*{command}* is used to move is used to move organization security policies to
new parent nodes.
Nc                     [         R                  " SSS9U l        U R                  R                  USS9  [         R                  " U5        g )NTmove)required	operation)operation_type)r	   OrgSecurityPolicyArgumentORG_SECURITY_POLICY_ARGAddArgumentAddArgsMove)clsparsers     1lib/surface/compute/org_security_policies/move.pyArgs	Move.Args-   sA    "'"A"A#)C++F6+J	f    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S nUR                  S5      (       a  SUR                  -   nUR                  S5      (       a  SUR                  -   nUc+  [        R                  " S5        [         R"                  " 5         [$        R&                  " XCR)                  5       UR                  S	9nUR+                  SXeS
9$ )NF)with_project)refcompute_client	resourcesversionorganizationzorganizations/folderzfolders/zIMust specify parent id with --organization=ORGANIZATION or--folder=FOLDER)r$   )only_generate_requestsp_id	parent_id)r   ComputeApiHolderReleaseTrackr   ResolveAsResourcer"   r   OrgSecurityPolicysix	text_typelowerIsSpecifiedr$   r%   r   errorsysexitr
   GetSecurityPolicyIdNamer   )selfargsholderr    org_security_policyr(   r'   s          r   RunMove.Run4   s+   **4+<+<+>?F

&
&
8
8U 9 4C 22}}""d//1288:	< I''"T%6%66i!!t{{*i	ii " #	hhj';;XXZd6G6GIE###5 $ G Gr    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr   r:   __static_attributes__r<   r   r   r   r       s'    
 ! Gr   r   EXAMPLESz    To move an organization security policy under folder with ID ``123456789'' to
    folder ``987654321'', run:

      $ {command} 123456789 --folder=987654321
    )rA   
__future__r   r   r   r2   googlecloudsdk.api_lib.computer   4googlecloudsdk.api_lib.compute.org_security_policiesr   googlecloudsdk.callioper   8googlecloudsdk.command_lib.compute.org_security_policiesr	   r
   googlecloudsdk.corer   r-   UniverseCompatibleReleaseTracksr*   ALPHABETAGAUpdateCommandr   detailed_helpr<   r   r   <module>rR      s    9 &  ' 
 7 G ( J ` # 
 T..33T5F5F5I5I&G4 &G &GT 	 r   