
    r	                         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 d	d
dZe	j                   G d de	j                               Zee_        y)z'logging views delete' command.    )absolute_import)division)unicode_literals)util)arg_parsers)base)logz)
        Deletes a view on a bucket.
    zo
     To delete a view on a bucket, run:

        $ {command} my-view --bucket=my-bucket --location=global
    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)DeletezDelete a view.
  c                    | j                  dd       t        j                  | dd       t        j                  | d       | j                  ddt	        j
                  dd	      d
       | j                  j                  d       y)z Register flags for this command.VIEW_IDzID of the view to delete.)helpTzLocation of the bucket.zview to deletez--bucketz.+zmust be non-emptyzID of bucket)requiredtyper   N)add_argumentr   AddBucketLocationArgAddParentArgsr   RegexpValidatordisplay_infoAddCacheUpdater)parsers    #lib/surface/logging/views/delete.pyArgszDelete.Args/   s     3  5/1v/0
((0CD	  
 ''-    c                    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.
    bucketsviews)nameN)r   	GetClient projects_locations_buckets_viewsr   GetMessages1LoggingProjectsLocationsBucketsViewsDeleteRequestCreateResourceNameGetBucketLocationFromArgsbucketr   r	   DeletedResource)selfargss     r   Runz
Delete.Run>   s     	NN55<<LL((''2248)KK!")4<<9 	M 	:; %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   r   googlecloudsdk.corer	   DETAILED_HELPUniverseCompatibleDeleteCommandr   detailed_helpr1   r   r   <module>r:      sb     & &  ' / / ( #
		  &T  &  &F % r   