
                            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  \	R"                  " \	R$                  R&                  5      \	R(                   " S
 S\	R*                  5      5       5       r\	R"                  " \	R$                  R.                  5       " S S\5      5       r\	R"                  " \	R$                  R2                  5       " S S\5      5       rg)z(Updates a Cloud NetApp Active Directory.    )absolute_import)division)unicode_literals)client)base)flags)labels_util)logc                   d    \ rS rSrSr\R                  R                  rSSS.r	\
S 5       rS rSrg	)
Update   'Update a Cloud NetApp Active Directory.zT          Updates AD (Active Directory) configs for Cloud NetApp Volumes.
          a$            The following command updates an AD config in the given project and location with specified arguments:

              $ {command} AD_NAME --location=us-central1 --domain=new-domain.com --dns=1.1.1.1 --site=new_site --net-bios-prefix=new_prefix --organizational-unit=ou2 --enable-aes=true --username=user2 --password="secure2" --backup-operators=backup_op1,backup_op2 --security-operators=secure_op1,secure_op2 --administrators=admin_op1,admin_op2 --enable-ldap-signing=true --encrypt-dc-connections=yes --kdc-hostname=kdc-host1
          )DESCRIPTIONEXAMPLESc                 0    [         R                  " U 5        g )N)activedirectories_flagsAddActiveDirectoryUpdateArgs)parsers    /lib/surface/netapp/active_directories/update.pyArgsUpdate.Args/   s    88@    c                 F
   UR                   R                  R                  5       n[        R                  " U R
                  5      nUR                  U5      n[        R                  R                  U5      nUR                  5       (       aI  UR                  UR                  R                  R                  UR                  5      R!                  5       nOSnUR#                  UUR$                  UR&                  UR(                  UR*                  UR,                  UR.                  UR0                  UR2                  UR4                  UR6                  UR8                  UR:                  UR<                  UR>                  UR@                  URB                  URD                  US9n/ nURG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S	5        URG                  S
5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       a  URI                  S5        URG                  S5      (       d,  URG                  S5      (       d  URG                  S 5      (       a  URI                  S!5        S"RK                  U5      n	URM                  X'XRN                  5      n
URN                  (       aW  S#RQ                  U RS                  5       RT                  5      n[V        RX                  R[                  S$RQ                  U5      5        U
$ )%z:Update a Cloud NetApp Storage Pool in the current project.N)domainsitednsnet_bios_prefixorganizational_unitaes_encryptionusernamepasswordbackup_operatorssecurity_operatorsadministratorskdc_hostnamekdc_ipnfs_users_with_ldapldap_signingencrypt_dc_connectionsdescriptionlabelsr   r   r   r   netBiosPrefixr   organizationalUnit
enable_aesaesEncryptionr    r!   r"   backupOperatorsr#   securityOperatorsr$   r%   kdcHostnamer&   kdcIpr'   nfsUsersWithLdapenable_ldap_signingldapSigningr)   encryptDcConnectionsr*   update_labelsremove_labelsclear_labelsr+   ,z(gcloud {} netapp active-directories listz[Check the status of the updated active directory by listing all active directories:
  $ {} ).CONCEPTSactive_directoryParse	ad_clientActiveDirectoriesClient_RELEASE_TRACKGetActiveDirectoryr	   DiffFromUpdateArgsMayHaveUpdatesApplymessagesActiveDirectoryLabelsValuer+   	GetOrNone!ParseUpdatedActiveDirectoryConfigr   r   r   r   r   r.   r    r!   r"   r#   r$   r%   r&   r'   r5   r)   r*   IsSpecifiedappendjoinUpdateActiveDirectoryasync_formatReleaseTrackprefixr
   statusPrint)selfargsactivedirectory_refr   orig_activedirectorylabels_diffr+   r=   updated_fieldsupdate_maskresultcommands               r   Run
Update.Run3   s)   --88>>@..t/B/BCF!445HI""11$7K!!##  !@!@!L!L!5!<!<>>Gik  f??{{YYHH,, 44..22**&&{{ 44--#::$$' @ * N!!H%F#E")**O,-..01%%O,
##J'
##J'*++-.,--/0()),-''M*!!G$-.../-..M*01123&&M*))))T-=-=n-M-MH%((>*K))*=*5{{DF{{:AA




$
$&g	jj**0&/ Mr    N)__name__
__module____qualname____firstlineno____doc__r   rR   GArA   detailed_helpstaticmethodr   r_   __static_attributes__ra   r   r   r   r      sE     0$$''.		- A ATr   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)
UpdateBeta   r   ra   N)
rb   rc   rd   re   rf   r   rR   BETArA   rj   ra   r   r   rl   rl      s    /$$)).r   rl   c                   D    \ rS rSrSr\R                  R                  rSr	g)UpdateAlpha   r   ra   N)
rb   rc   rd   re   rf   r   rR   ALPHArA   rj   ra   r   r   rp   rp      s    /$$**.r   rp   N)rf   
__future__r   r   r   0googlecloudsdk.api_lib.netapp.active_directoriesr   r?   googlecloudsdk.callioper   4googlecloudsdk.command_lib.netapp.active_directoriesr   r   $googlecloudsdk.command_lib.util.argsr	   googlecloudsdk.corer
   ReleaseTracksrR   rg   DefaultUniverseOnlyUpdateCommandr   rn   rl   rr   rp   ra   r   r   <module>r|      s    / &  ' P ( a < # D%%(()hT h  *hV D%%**+* * ,* D%%++,+* + -+r   