
                         d   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dlmZ ddlmZ ej&                   ej(                  ej*                  j,                  ej*                  j.                         G d dej0                                      Zddde_        y)zCommand for deleting spokes.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)waiter)base)flags)log)	resources)
console_ioc                   &    e Zd ZdZed        Zd Zy)Deletez1Delete a spoke.

  Delete the specified spoke.
  c                     t        j                  | d       t        j                  | d       t        j                  |        y )Nz	to deleteF)hide_global_arg)r
   AddSpokeResourceArgAddRegionGroupAddAsyncFlag)parsers    1lib/surface/network_connectivity/spokes/delete.pyArgszDelete.Args(   s0    	fk2	7	v    c                    t        j                  | j                               }|j                  j                  j                         }t        j                  dj                  |j                               d       |j                  |      }t        j                  j                  dj                  |j                                      |j                  r't        j                  |j                         d       |S |j                   r:t        j                  j                  dj                  |j"                               |S t$        j&                  | j                            }t(        j*                  j-                  |j"                  d	|
      }t/        j0                  |j2                        }t/        j4                  ||dj                  |j"                              }t        j                  |j                         d       |S )N)release_trackz"You are about to delete spoke [{}]T)messagecancel_on_nozDelete request issued for: [{}]spoke)kindz Check operation [{}] for status.z1networkconnectivity.projects.locations.operations)
collectionapi_versionz&Waiting for operation [{}] to complete)r   SpokesClientReleaseTrackCONCEPTSr   Parser   PromptContinueformatNamer   r   statusPrintdoneDeletedResourceasync_namer   VERSION_MAPr   REGISTRYParseRelativeNamer   CloudOperationPollerNoResourcesoperation_serviceWaitFor)	selfargsclient	spoke_refop_refr    op_resourcepollerress	            r   Runz
Delete.Run.   s   $11'')+F##))+I5<<Y^^=MN ]]9%FJJ6==inn>NOP{{	)..*9m{{	jj9@@MNm*66t7H7H7JKK$$66F 7 !K 33  "F
..AHH#[[*+C 	(w7Jr   N)__name__
__module____qualname____doc__staticmethodr   r<    r   r   r   r       s     
  
 r   r   z{   To delete a spoke named ``myspoke'' in the ``us-central1'' region, run:

    $ {command} myspoke --region=us-central1
  z   This command uses the networkconnectivity/v1 API. The full documentation
  for this API can be found at:
  https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
  )EXAMPLESzAPI REFERENCEN)r@   
__future__r   r   r   +googlecloudsdk.api_lib.network_connectivityr   r   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   /googlecloudsdk.command_lib.network_connectivityr
   googlecloudsdk.corer   r   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksr"   BETAGADeleteCommandr   detailed_helprB   r   r   <module>rQ      s     # &  ' O P . ( A # ) 2 D%%**D,=,=,@,@A,T , B ,b		 r   