
    	                     F   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
Zedz   Z e	j                   e	j"                  j$                  e	j"                  j&                  e	j"                  j(                         G d de	j*                               Zy)z!services api-keys delete command.    )absolute_import)division)unicode_literals)apikeys)services_util)base)common_flags)logzgcloud services operations zwait {0}c                   &    e Zd ZdZed        Zd Zy)DeletezDelete an API key.

  Delete an API key.

  ## EXAMPLES

   Delete an API Key :

   $ {command} projects/myproject/locations/global/keys/1234

   $ {command} 1234
  c                 p    t        j                  | d       t        j                  j	                  |        y )Nz	to delete)parsersuffix)r	   key_flagr   
ASYNC_FLAGAddToParser)r   s    'lib/surface/services/api_keys/delete.pyArgszDelete.Args0   s&     <OO'    c                 X   t        j                         }|j                  }|j                  j                  j                         }|j                  |j                               }|j                  j                  |      }|j                  s|j                  rOt        j                  |j                        }t        j                   j#                  dj                  |             |S t%        j&                  |j                  t         j(                        }t%        j*                  |       |S )zRun command.

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

    Returns:
      The response from the Delete API call.
    )namezcAsynchronous operation is in progress... Use the following command to wait for its completion:
 {0})r   GetClientInstanceMESSAGES_MODULECONCEPTSkeyParse)ApikeysProjectsLocationsKeysDeleteRequestRelativeNameprojects_locations_keysr   doneasync_OP_WAIT_CMDformatr   r
   statusPrintr   WaitOperationGetOperationPrintOperationWithResponse)selfargsclientmessageskey_refrequestopcmds           r   Runz
Delete.Run6   s     &&(F%%Hmm%%'G@@!!# A %G		'	'	.	.w	7B77	  )

 --3VC[	: 	&&rww0D0DEb,,R0Ir   N)__name__
__module____qualname____doc__staticmethodr   r1    r   r   r   r      s      ( (
r   r   N)r5   
__future__r   r   r   googlecloudsdk.api_lib.servicesr   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.servicesr	   googlecloudsdk.corer
   OP_BASE_CMDr"   ReleaseTracksReleaseTrackALPHABETAGADeleteCommandr   r7   r   r   <module>rD      s    ( &  ' 3 9 ( < #+J& T..33T5F5F5I5I0T 00r   