
    :                        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j.                                      Zdej2                  j4                  j6                  j9                          ddde_        y)z'Command for accepting spokes into hubs.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)waiter)base)flags)log)
properties)	resourcesc                   &    e Zd ZdZed        Zd Zy)AcceptSpokezAccept a spoke into a hub.

  Accept a proposed or previously rejected VPC spoke. By accepting a spoke,
  you permit 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                  |        y )Nzto accept the spoke intozURI of the spoke to accept)r
   AddHubResourceArgAddSpokeFlagAddAsyncFlag)parsers    5lib/surface/network_connectivity/hubs/accept_spoke.pyArgszAcceptSpoke.Args*   s2    	F$>?	v;<	v    c                    t        j                  | j                               }|j                  j                  j                         }| j                         t        j                  j                  k(  r|j                  ||j                        }n|j                  ||j                        }t        j                  j                  dj                  |j                                      t         j"                  j%                  |j&                  dt(        j*                  | j                                  }t-        j.                  |j0                        }|j2                  r|j5                  |      S |j6                  r:t        j                  j                  dj                  |j&                               |S t-        j8                  ||dj                  |j&                              }|S )N)release_trackz%Accept spoke 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AcceptSpokeBetaspoker   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AcceptSpoke.Run0   sr   $//'')+Fmm%%'Gd//444%%gtzz:f!!'4::6fJJ<CC  $$66F,889J9J9LM 7 O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 a spoke named ``my-spoke'' into a hub named ``my-hub'', run:

    $ {command} my-hub --spoke="https://networkconnectivity.z?/v1/projects/spoke-project/locations/global/spokes/my-spoke"
  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   r   DefaultUniverseOnlyReleaseTracksr   r!   GACommandr   VALUEScoreuniverse_domainGetdetailed_helpr@   r   r   <module>rQ      s     . &  ' O P . ( A # * ) D%%**D,=,=,@,@A*$,, * B *^? @J?P?P?U?U?e?e?i?i?k>l m		 r   