
                         X   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*                         G d dej,                                      Zddde_        y)z$Command for accepting spoke updates.    )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)AcceptSpokeUpdatea  Accept a proposal to update a spoke in a hub.

  Accept a proposed or previously rejected VPC spoke update. By accepting a
  spoke update, you permit updating connectivity between the associated VPC
  network and other VPC networks that are attached to the same hub.
  c                     t        j                  | d       t        j                  | d       t        j                  | d       t        j                  |        y )Nzto accept the spoke updatez!URI of the spoke to accept updatez"Etag of the spoke to accept update)r
   AddHubResourceArgAddSpokeFlagAddSpokeEtagFlagAddAsyncFlag)parsers    <lib/surface/network_connectivity/hubs/accept_spoke_update.pyArgszAcceptSpokeUpdate.Args)   sC    	F$@A	vBC	6#GH	v    c                    t        j                  | j                               }|j                  j                  j                         }| j                         t        j                  j                  k(  r(|j                  ||j                  |j                        }n'|j                  ||j                  |j                        }t        j                  j                  dj                  |j!                                      t"        j$                  j'                  |j(                  dt*        j,                  | j                                  }t/        j0                  |j2                        }|j4                  r|j7                  |      S |j8                  r:t        j                  j                  dj                  |j(                               |S t/        j:                  ||dj                  |j(                              }|S )N)release_trackz,Accept spoke update request issued for: [{}]z1networkconnectivity.projects.locations.operations)
collectionapi_versionz Check operation [{}] for status.z&Waiting for operation [{}] to complete)r   
HubsClientReleaseTrackCONCEPTShubParser	   BETAAcceptSpokeUpdateBetaspoke
spoke_etagr   r   statusPrintformatNamer   REGISTRYParseRelativeNamenamer   VERSION_MAPr   CloudOperationPollerNoResourcesoperation_servicedone	GetResultasync_WaitFor)selfargsclienthub_refop_refop_resourcepollerress           r   RunzAcceptSpokeUpdate.Run0   s   $//'')F mm%%'Gd//444++
4::tf ''T__MfJJ6==gllnM $$66F,889J9J9LM 7 K
 33F4L4LMF{{k**{{	jj9@@MNm
..077DFC Jr   N)__name__
__module____qualname____doc__staticmethodr   r;    r   r   r   r      s       !r   r   z   To accept updating a spoke named ``my-spoke'' with ``etag'' in a hub named ``my-hub'', run:

    $ {command} my-hub --spoke="projects/spoke-project/locations/global/hubs/my-spoke" --spoke-etag=etag
  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   DefaultUniverseOnlyReleaseTracksr   r!   GACommandr   detailed_helprA   r   r   <module>rN      s     + &  ' O P . ( A # ) D%%**D,=,=,@,@A0 0 B 0j		#  r   