
    	                         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 sinks delete' command.    )absolute_import)division)unicode_literals)util)base)log)
console_ioc                   &    e Zd ZdZed        Zd Zy)DeleteaN  Delete a sink.

  Delete a sink and halt the export of log entries associated with that sink.
  Deleting a sink does not affect log entries already exported through
  the deleted sink, and will not affect other sinks that are exporting
  the same log(s).

  ## EXAMPLES

  To delete a sync 'my-bq-sync':

    $ {command} my-bq-sink
  c                     | j                  dd       t        j                  | d       | j                  j	                  d       y)z Register flags for this command.	sink_namezThe name of the sink to delete.)helpzsink to deleteN)add_argumentr   AddParentArgsdisplay_infoAddCacheUpdater)parsers    #lib/surface/logging/sinks/delete.pyArgszDelete.Args,   s=     *KLv/0
''-    c                    t        j                  |j                  |      }t        j                  t        j                  |      d|j
                        }t        j                  d|j
                  z  d       t        j                         j                  j                  t        j                         j                  |             t        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.
    sinkszReally delete sink [%s]?T)cancel_on_no)sinkNameN)r   GetSinkReferencer   CreateResourceNameGetParentFromArgssinksIdr	   PromptContinue	GetClientprojects_sinksr   GetMessages!LoggingProjectsSinksDeleteRequestr   DeletedResource)selfargssink_refsink_resources       r   Runz
Delete.Run3   s     $$T^^T:H++D,B,B4,H,3X5E5EGM 88;K;KK+/1 	NN##**<<" 	= 	$% !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>r7      sF     & &  ' / ( # 2 '"T '" '"r   