
                             d 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mZ ej                   G d	 d
ej                               Zy)z!'logging buckets delete' command.    )absolute_import)division)unicode_literals)util)base)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)DeletezDelete a bucket.

  ## EXAMPLES

  To delete bucket 'my-bucket' in location 'global', run:

    $ {command} my-bucket --location=global
  c                     | j                  dd       t        j                  | dd       t        j                  | d       | j                  j                  d       y)z Register flags for this command.	BUCKET_IDzID of the bucket to delete.)helpTzLocation of the bucket.zbucket to deleteN)add_argumentr   AddBucketLocationArgAddParentArgsdisplay_infoAddCacheUpdater)parsers    %lib/surface/logging/buckets/delete.pyArgszDelete.Args'   sX     7  9/1v12
''-    c                    t        j                  d|j                  z  d       t        j                         j
                  j                  t        j                         j                  t        j                  t        j                  t        j                  |      d|j                        d|j                                     t        j                  |j                         y)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.
    z\Really delete bucket [%s]? (You can undelete it within 7 days if you change your mind later)T)cancel_on_no	locationsbuckets)nameN)r	   PromptContinuer   r   	GetClientprojects_locations_bucketsr   GetMessages,LoggingProjectsLocationsBucketsDeleteRequestCreateResourceNameGetParentFromArgslocationr   DeletedResource)selfargss     r   Runz
Delete.Run1   s     	"$(NN	3
 	NN//66GG((''**40+t}}N4>>+ 	H 	,- 'r   N)__name__
__module____qualname____doc__staticmethodr   r(    r   r   r   r      s      . .(r   r   N)r,   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.corer   googlecloudsdk.core.consoler	   UniverseCompatibleDeleteCommandr   r.   r   r   <module>r6      sF     ( &  ' / ( # 2 &(T &( &(r   