
                         v   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 ej"                   ej$                  ej&                  j(                  ej&                  j*                        ej,                   G d dej.                                             Zddde_        y)z Command for deactivating spokes.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)waiter)base)flags)log)	resourcesc                   &    e Zd ZdZed        Zd Zy)
Deactivatea  Deactivate a spoke.

  Deactivate the specified spoke. When you deactivate a spoke, it
  can't connect to other spokes that are attached to the same hub.

  Network Connectivity Center retains details about deactivated
  spokes so that they can be reactivated later.
  c                     t        j                  | d       t        j                  | d       t        j                  |        y )Nzto deactivateT)hide_global_arg)r
   AddSpokeResourceArgAddRegionGroupAddAsyncFlag)parsers    5lib/surface/network_connectivity/spokes/deactivate.pyArgszDeactivate.Args,   s0    	fo6	6	v    c                 @   t        j                  | j                               }|j                  j                  j                         }|j                  |      }t        j                  j                  dj                  |j                                      t        j                  j                  |j                  dt         j"                  | j                                  }t%        j&                  |j(                  |j*                        }|j,                  r|j/                  |      S |j0                  r:t        j                  j                  dj                  |j                               |S t%        j2                  ||dj                  |j                              }|S )N)release_trackz#Deactivate request issued for: [{}]z1networkconnectivity.projects.locations.operations)
collectionapi_versionz Check operation [{}] for status.z&Waiting for operation [{}] to complete)r   SpokesClientReleaseTrackCONCEPTSspokeParser   r   statusPrintformatNamer   REGISTRYParseRelativeNamenamer   VERSION_MAPr   CloudOperationPollerspoke_serviceoperation_servicedone	GetResultasync_WaitFor)selfargsclient	spoke_refop_refop_resourcepollerress           r   RunzDeactivate.Run2   sI   $11'')+F##))+Iy)FJJ:AA  $$66F,889J9J9LM 7 OK (()=)=)/)A)ACF {{k**{{	jj9@@MNm
..AHH#[[*+C Jr   N)__name__
__module____qualname____doc__staticmethodr   r8    r   r   r   r      s       
r   r   z   To deactivate 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   HiddenReleaseTracksr   BETAGADefaultUniverseOnlyCommandr   detailed_helpr>   r   r   <module>rM      s     ' &  ' O P . ( A # ) D%%**D,=,=,@,@A* *  B *^		
 r   