
    8                     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 rejecting spokes 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)RejectSpokeUpdatezReject a proposal to update a spoke in a hub.

  Reject a VPC spoke update proposal. By rejecting a spoke update,
  you prevent updating the connectivity between the associated VPC network and
  any other VPC networks that are attached to the same hub.
  c                     t        j                  | d       t        j                  | d       t        j                  | d       t        j                  |        t        j
                  |        y )Nzto reject the spoke updatez!URI of the spoke to reject updatez"Etag of the spoke to reject update)r
   AddHubResourceArgAddSpokeFlagAddSpokeEtagFlagAddRejectionDetailsFlagAddAsyncFlag)parsers    <lib/surface/network_connectivity/hubs/reject_spoke_update.pyArgszRejectSpokeUpdate.Args)   sQ    	F$@A	vBC	6#GH	!!&)	v    c                 (   t        j                  | j                               }|j                  j                  j                         }| j                         t        j                  j                  k(  r3|j                  ||j                  |j                  |j                        }n2|j                  ||j                  |j                  |j                        }t        j                  j                  dj!                  |j#                                      t$        j&                  j)                  |j*                  dt,        j.                  | j                                  }t1        j2                  |j4                        }|j6                  r|j9                  |      S |j:                  r:t        j                  j                  dj!                  |j*                               |S t1        j<                  ||dj!                  |j*                              }|S )N)release_trackz,Reject 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RejectSpokeUpdateBetaspoke
spoke_etagdetailsr   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RejectSpokeUpdate.Run1   s   $//'')F mm%%'Gd//444++
4::tf ''
4::tf 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 reject updating a spoke named ``my-spoke'' with ``etag'' in a hub named ``my-hub'' with reason ``my-reason'', run:

    $ {command} my-hub --spoke="projects/spoke-project/locations/global/hubs/my-spoke" --spoke-etag=etag --details=my-reason
  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)rA   
__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_helprC   r   r   <module>rP      s     , &  ' O P . ( A # ) D%%**D,=,=,@,@A3 3 B 3p		#  r   