
                            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
  \R                  \R                  " \R                  R                  5      \R                   " S S	\R                   5      5       5       5       rg
)z'logging buckets move' command.    )absolute_import)division)unicode_literals)util)base)
console_ioc                   .    \ rS rSrSr\S 5       rS rSrg)Move   a  Move a bucket.

In order to be movable, a bucket must satisfy the following restrictions:

 - Be a ```_Default``` or ```_Required``` bucket
 - Have a location of global
 - Have a non-project parent when it is a ```_Default``` bucket

## EXAMPLES

To move the ```_Required``` bucket from `global` to another location, run:

  $ {command} _Required --location=global --new-location=us-central1
c                     U R                  SSS9  U R                  SSSS9  [        R                  " U SS5        [        R                  " U S	5        U R                  R                  S
5        g
)z Register flags for this command.	BUCKET_IDzID of the bucket to move.)helpz--new-locationTz#New location to move the bucket to.)requiredr   zLocation of the bucket.zbucket to moveN)add_argumentr   AddBucketLocationArgAddParentArgsdisplay_infoAddCacheUpdater)parsers    #lib/surface/logging/buckets/move.pyArgs	Move.Args.   sq     *EF
2  4 	/1v/0
''-    c                    [         R                  " U5      n[         R                  " [         R                  " USUR                  5      SUR                  5      n[         R                  " [         R                  " USUR
                  5      SUR                  5      n[        R                  " SU< SU< S3SS9  [         R                  " 5       R                  R                  [         R                  " 5       R                  X4S95      $ )	zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  A long running operation containing related information.
	locationsbucketszReally move bucket [z] to [z]? T)cancel_on_no)namenewName)r   GetParentFromArgsCreateResourceNamelocationr   new_locationr   PromptContinue	GetClientprojects_locations_bucketsr
   GetMessagesMoveBucketRequest)selfargsparent_namesource_bucket
new_buckets        r   RunMove.Run;   s     ((.K++[$--H4>>#M (([$:K:KL4>>#J /<jI >>66;;,, 	- 	45 5r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r.   __static_attributes__r0   r   r   r
   r
      s      
. 
.5r   r
   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksReleaseTrackGAHiddenCommandr
   r0   r   r   <module>rB      sl     & &  ' / ( 2 D%%(()554<< 55  * 55r   