
                         Z   d Z ddlmZ ddlmZ ddlmZ ddl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Zej$                   ej&                  ej(                  j*                  ej(                  j,                         G d dej.                                      Zddie_        y)z2Command for moving organization security policies.    )absolute_import)division)unicode_literalsN)base_classes)client)base)flags)org_security_policies_utils)logc                   *    e Zd ZdZdZed        Zd Zy)MovezMove a Compute Engine organization security policy.

  *{command}* is used to move is used to move organization security policies to
  new parent nodes.
  Nc                     t        j                  dd      | _        | j                  j                  |d       t        j                  |       y )NTmove)required	operation)operation_type)r	   OrgSecurityPolicyArgumentORG_SECURITY_POLICY_ARGAddArgumentAddArgsMove)clsparsers     1lib/surface/compute/org_security_policies/move.pyArgsz	Move.Args,   sA    "'"A"A#)C++F6+J	f    c           	         t        j                  | j                               }| j                  j	                  ||j
                  d      }t        j                  ||j                  |j
                  t        j                  | j                               j                               }d }|j                  d      rd|j                  z   }|j                  d      rd|j                  z   }|)t        j                  d       t!        j"                          t%        j&                  ||j)                         |j                  	      }|j+                  d||
      S )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   RunzMove.Run3   s+   **4+<+<+>?F

&
&
8
8fU 9 4C 22}}""d//1288:	< I'"T%6%66i!t{{*i	ii " #	hhj';;SXXZd6G6GIE###5I $ G Gr   )__name__
__module____qualname____doc__r   classmethodr   r8    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
    )r<   
__future__r   r   r   r0   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UpdateCommandr   detailed_helpr>   r   r   <module>rL      s    9 &  ' 
 7 G ( J' # 
 D%%++T->->-C-CD&G4 &G E &GT 	 r   