
    E                         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
dZ ej                  ej                  j                          G d dej"                               Zy)z,'vmware private-connections update' command.    )absolute_import)division)unicode_literals)PrivateConnectionsClient)base)flags)logzq
          Updates a VMware Engine private connection. Only description and routing-mode can be updated.
        a  
        To update a private connection named `my-private-connection` in project `my-project` and region `us-west1` by changing its description to `Updated description for the private connection` and routing-mode to `GLOBAL`, run:

          $ {command} my-private-connection --location=us-west1 --project=my-project --description="Updated description for the private connection" --routing-mode=GLOBAL

        Or:

          $ {command} my-private-connection --description="Updated description for the private connection" --routing-mode=GLOBAL

        In the second example, the project and location are taken from gcloud properties core/project and compute/regions, respectively.
        )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Updatez)Update a Google Cloud Private Connection.c                 8   t        j                  | d       t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  dd       | j                  ddd	gd
       y)z Register flags for this command.T)
positionalyamlz--descriptionzA        Updated description for this Private Connection.
        )helpz--routing-modeGLOBALREGIONALzB        Updated routing mode for this Private Connection.
        )choicesr   N)	r   AddPrivateConnectionToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    0lib/surface/vmware/private_connections/update.pyArgszUpdate.Args4   s     
&&v$?OO'OOvt,
!!&)
  
 :&      c                    |j                   j                  j                         }t               }|j                  }|j                  ||j                  |j                        }|r#t        j                  |j                  dd       y |j                  |j                  |      dj                  |j                                     }t        j                  |j                         d       |S )NzPrivate ConnectionT)kindis_asyncz1waiting for private connection [{}] to be updated)operation_refmessage)r!   )CONCEPTSprivate_connectionParser   async_r   descriptionrouting_moder	   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr&   clientr"   	operationresources          r   Runz
Update.RunG   s    99??A%'F{{H0$2B2B"//1I	
..3dD&&,,Y7CJJ++-
 ' H '')0D Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r6    r   r   r   r   .   s!    1- $r   r   N)r:   
__future__r   r   r   0googlecloudsdk.api_lib.vmware.privateconnectionsr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   r;   ReleaseTracksReleaseTrackGAUpdateCommandr   r>   r   r   <module>rH      sj    3 &  ' U ( 3 #	
	( D%%((),T , *,r   