
    <                     8   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  \	R                  " \	R                  R                   \	R                  R"                  \	R                  R$                  5       " S
 S\	R&                  5      5       rg)zCommand to move a folder.    )absolute_import)division)unicode_literals)folders)
operations)base)flags)logc                   .    \ rS rSrSr\S 5       rS rSrg)Move   a  Move a folder to a new position within the same organization.

Move the given folder under a new parent folder or under the organization.
Exactly one of --folder or --organization must be provided.

This command can fail for the following reasons:
    * There is no folder with the given ID.
    * There is no parent with the given type and ID.
    * The new parent is not in the same organization of the given folder.
    * Permission missing for performing this move.

## EXAMPLES

The following command moves a folder with the ID `123456789` into a
folder with the ID `2345`:

  $ {command} 123456789 --folder=2345

The following command moves a folder with the ID `123456789` into an
organization with ID `1234`:

  $ {command} 123456789 --organization=1234
c                     [         R                  " S5      R                  U 5        [         R                  " 5       R                  U 5        [         R                  " U 5        g )Nzyou want to move.)r	   FolderIdArgAddToParserOperationAsyncFlagAddParentFlagsToParser)parsers    ,lib/surface/resource_manager/folders/move.pyArgs	Move.Args7   sA    	)*66v>	**62	  (    c                 Z   [         R                  " U5        [        R                  " 5       nUR	                  UR
                  UR                  [         R                  " U5      S9S9n[        R                  " 5       R                  U5      nUR                  (       a  U$ UR                  (       a1  UR                  (       d   [        R                  R                  S5        g [         R"                  " U5      n[         R$                  " XRR&                  5      n[        R(                  " U5        g )N)destinationParent)	foldersIdmoveFolderRequestzNo changes necessary.)r	   CheckParentFlagsr   FoldersMessages&CloudresourcemanagerFoldersMoveRequestidMoveFolderRequestGetParentFromFlagsFoldersServicer   async_donenamer
   statusPrintr   WaitForOperationExtractOperationResponseFolderUpdatedResource)selfargsmessagesmove_request	operationfinished_opresults          r   RunMove.Run=   s    	4 &&(HBB''"44#66t< 5 > C ?L &&(--l;I{{		

01//	:k22;Pf	&!r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r3   __static_attributes__r5   r   r   r   r      s     0 ) )
"r   r   N)r:   
__future__r   r   r   'googlecloudsdk.api_lib.resource_managerr   r   googlecloudsdk.callioper   +googlecloudsdk.command_lib.resource_managerr	   googlecloudsdk.corer
   ReleaseTracksReleaseTrackALPHABETAGAUpdateCommandr   r5   r   r   <module>rH      sy      &  ' ; > ( = # D%%++T->->-C-C%%((*/"4 /"*/"r   