
                         >   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	l
mZ ddlmZ d
ZddiZd Ze	j&                   e	j(                  e	j*                  j,                        e	j.                   G d d
e	j0                                             Zy)z+Command for deleting recoverable snapshots.    )absolute_import)division)unicode_literals)base_classes)utils)base)flags)scopeDeleteEXAMPLESa-          To delete Compute Engine recoverable snapshots with the names 'recoverable-snapshot-1'
        and 'recoverable-snapshot-2', run:
          $ {command} recoverable-snapshot-1 recoverable-snapshot-2
        To list all recoverable snapshots that were created before a specific date, use
        the --filter flag with the `{parent_command} list` command.
          $ {parent_command} list --filter="creationTimestamp<'2017-01-01'"
        For more information on how to use --filter with the list command,
        run $ gcloud topic filters.
        c                     t        j                  d      t        _        t        j                  j	                  | d       y)z6A helper function to build args for Alpha API version.T)pluraldelete)operation_typeN)r	   MakeRecoverableSnapshotArgr   RecoverableSnapshotArgAddArgumentparsers    3lib/surface/compute/recoverable_snapshots/delete.py
_AlphaArgsr   ,   s3    "'"B"B#& 	++F8+L    c                   0    e Zd ZdZeZed        Zd Zd Z	y)r   zxDelete Compute Engine recoverable snapshots.

  *{command}* deletes one or more Compute Engine recoverable snapshots.
  c                     t        |        y N)r   r   s    r   ArgszDelete.Args>   s
    vr   c                 $    | j                  |      S r   )_Run)selfargss     r   Runz
Delete.RunB   s    99T?r   c           	      $   t        j                  | j                               }|j                  }t        j
                  j                  ||j                  t        j                  |      t        j                  j                        }t        j                  |       g }|D ]]  }|j                  |j                   j"                  t$        |j&                  j)                  |j*                  |j,                        f       _ |j/                  |      S )N)scope_listerdefault_scope)projectrecoverableSnapshot)r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListercompute_scope	ScopeEnumGLOBALr   PromptForDeletionappendapitools_clientrecoverableSnapshotsDELETEmessages(ComputeRecoverableSnapshotsDeleteRequestr%   r&   MakeRequests)r   r    holderr)   recoverable_snapshot_refsrequestsrecoverable_snapshot_refs          r   r   zDelete._RunE   s    **4+<+<+>?F]]F & = = O O"88@#--44	 !P ! 
56H$= oo

 
 
5
5

//
B
B.66":"N"N C  	 %> x((r   N)
__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r!   r    r   r   r   r   4   s*      - )r   N)r@   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r,   r
   r.   8googlecloudsdk.command_lib.compute.recoverable_snapshotsr5   rA   r   HiddenReleaseTracksr(   ALPHADefaultUniverseOnlyDeleteCommandr   rD   r   r   <module>rO      s    2 &  ' 7 0 ( E E J			M D%%++,")T ")  - ")r   