
    d                        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  \	R                  " \	R                  R                   \	R                  R"                  5      \	R$                   " S S	\	R&                  5      5       5       rg
)z3`gcloud dataplex encryption-config update` command.    )encryption_config)util)
exceptions)base)resource_args)logc                   `    \ rS rSrSrSS0r\S 5       r\R                  " S5      S 5       r
Srg	)
Update   zUpdate an Encryption Config.EXAMPLESz          To update EncryptionConfig in organization `123` and location `us-central1`, run:

            $ {command} organizations/123/locations/us-central1/encryptionConfigs/default --enable-metastore-encryption
          c                 V    [         R                  " U S5        U R                  SSSSS9  g )Nz
to update.z--enable-metastore-encryptionF
store_truezNHelps user to explicitly enable cmek encryption for dataplex metadata storage.)defaultactionhelp)r   AddEncryptionConfigResourceArgadd_argument)parsers    0lib/surface/dataplex/encryption_config/update.pyArgsUpdate.Args&   s3    00F
'!      z-Status code: {status_code}. {status_message}.c           	         UR                   (       d   [        R                  R                  S5        g [        R
                  " U5      nUR                  R                  R                  5       n[        R                  " 5       nUR                  R                  [        R                  " 5       R                  UR                  5       SR                  U5      [        R                   " U5      S95        [        R                  R                  S5        g )Nz,There is no update for the EncryptionConfig.,)name
updateMask%googleCloudDataplexV1EncryptionConfigzxSuccessfully updated the Encryption Config. Please use the gcloud describe to check the latest update of data encryption)enable_metastore_encryptionr   statusPrintr   GenerateUpdateMaskCONCEPTSParsedataplex_api_utilGetClientInstance)organizations_locations_encryptionConfigsPatchGetMessageModule;DataplexOrganizationsLocationsEncryptionConfigsPatchRequestRelativeNamejoin(GenerateEncryptionConfigForUpdateRequest)selfargsupdate_maskencryption_config_refdataplex_clients        r   Run
Update.Run3   s     ++	jj
8 #66t<K MM;;AAC'99;O==CC**,hh&335xx,2C2l2l3 	i 	
 JJ	A r    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionr2   __static_attributes__r4   r   r   r
   r
      sN     %  - 
 
 445r   r
   N)r9   googlecloudsdk.api_lib.dataplexr   r   r$   googlecloudsdk.api_lib.utilr   r<   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataplexr   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyUpdateCommandr
   r4   r   r   <module>rJ      sq    : = E F ( = # D%%++T->->-A-AB0T 0  C0r   