
    g                        S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SS	KJr  S
SS.r\R                   \R"                  " \R$                  R&                  5       " S S\R(                  5      5       5       rg)z9'vmware  private-clouds identity-sources update' command.    )absolute_import)division)unicode_literals)IdentitySourcesClient)base)flags)log)filesz
        Update an identity source. Only base-users-dn, base-groups-dn, domain-user, domain-password and ssl-certificates can be updated.
      aH  
        To update an identity source called `my-identity-source` in private cloud `my-private-cloud` and zone `us-west2-a`
        by changing base-users-dn to `dc=example,dc=com`, domain-user to `user@example.com`, and domain-password to `secretPassword123` run:

          $ {command} my-identity-source --project=my-project --location=us-west2-a --private-cloud=my-private-cloud
            --base-users-dn dc=example,dc=com --domain-user user@example.com --domain-password secretPassword123

          Or:

          $ {command} my-identity-source --private-cloud=my-private-cloud --base-users-dn dc=example,dc=com
            --domain-user user@example.com --domain-password secretPassword123

         In the second example, the project and location are taken from gcloud properties `core/project` and `compute/zone` respectively.
  )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Update0   z4Update a Google Cloud VMware Engine identity source.c                    [         R                  " U 5        [        R                  R	                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  SSS9  U R                  SSS9  U R                  SS	S9  U R                  S
SS9  U R                  SS/ SS9  g)z Register flags for this command.Tyamlz--base-users-dnz&The base distinguished name for users.)helpz--base-groups-dnz'The base distinguished name for groups.z--domain-userzuID of a user in the domain who has a minimum of read-only access to the base distinguished names of users and groups.z--domain-passwordz~Password of the user in the domain who has a  minimum of read-only access to the base distinguished names of users and groups.z--ssl-certificate-from-fileappendzgPath to the root CA certificate files in CER format for the LDAPS server. Can be passed multiple times.)actiondefaultr   N)	r   AddIdentitySourceArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    <lib/surface/vmware/private_clouds/identity_sources/update.pyArgsUpdate.Args7   s     
&&v.OO'OOvt,
!!&)
5   6   D   K   %5      c           	      j   UR                   R                  R                  5       n[        5       nUR                   Vs/ s H  n[
        R                  " U5      PM     nnUR                  UUR                  UR                  UR                  UR                  US9nUR                  nU(       a!  [        R                  " UR                  SSS9  g UR!                  UR#                  U5      SR%                  UR'                  5       5      S9n[        R                  " UR'                  5       SS9  U$ s  snf )N)base_users_dnbase_groups_dndomain_userdomain_passwordssl_certificateszidentity sourceT)kindis_asyncz.waiting for identity source [{}] to be updated)operation_refmessage)r(   )CONCEPTSidentity_sourceParser   ssl_certificate_from_filer
   ReadFileContentsr   r#   r$   r%   r&   async_r	   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)	selfargssourceclientpathcertificates	operationr)   resources	            r   Run
Update.Run^   s   ]]**002F"$F 261O1O1Ot$1O   ((**$$,,%  I {{H	)../@4P&&,,Y7@GG!
 ' H ++-4EFO3s    D0 N)__name__
__module____qualname____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr   r@   __static_attributes__rB   r!   r   r   r   0   s$     = -$ $Lr!   r   N)rG   
__future__r   r   r   -googlecloudsdk.api_lib.vmware.identitysourcesr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.vmwarer   googlecloudsdk.corer	   googlecloudsdk.core.utilr
   rH   HiddenReleaseTracksReleaseTrackGAUpdateCommandr   rB   r!   r   <module>rW      s{    @ &  ' O ( 3 # *
	* D%%(()IT I * Ir!   