
    Q                     8   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
KJr  \R$                  " \R&                  R(                  \R&                  R*                  5      \R,                   " S S\R.                  5      5       5       rg)z3`gcloud dataplex encryption-config create` command.    )absolute_import)division)unicode_literals)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	)
Create   ztCreate a Dataplex encryption config resource.

An EncryptionConfig is created only for CMEK opted in organizations.
EXAMPLESz            To create an EncryptionConfig `default` in organization `test-org-id` at location `us-central1` with key `test-key`, run:
            $ {command} default --location=us-central1 --organization=test-org-id --key='test-key'
            c                 T    [         R                  " U S5        U R                  SSSS9  g )Nz
to create.z--keyFz"The KMS key to use for encryption.)requiredhelp)r
   AddEncryptionConfigResourceArgadd_argument)parsers    0lib/surface/dataplex/encryption_config/create.pyArgsCreate.Args,   s.    00F
1      z-Status code: {status_code}. {status_message}.c           	         UR                   R                  R                  5       n[        R                  " 5       nUR
                  R                  [        R                  " 5       R                  UR                  5       UR                  5       R                  5       [        R                  " U5      S95        [        R                  R                  S5        g )N)encryptionConfigIdparent%googleCloudDataplexV1EncryptionConfigzEncryption Config is saved successfully. Please use gcloud describe command to check the data encryption status after sometime.)CONCEPTSr   Parsedataplex_utilGetClientInstance)organizations_locations_encryptionConfigsr   GetMessageModule<DataplexOrganizationsLocationsEncryptionConfigsCreateRequestNameParentRelativeName(GenerateEncryptionConfigForCreateRequestr   statusPrint)selfargsencryption_config_refdataplex_clients       r   Run
Create.Run5   s     !MM;;AAC#557O==DD&&(ee499;(//1>>@2C2l2l3 	f 	
 JJ	G r    N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionr/   __static_attributes__r1   r   r   r   r      sN      -   445r   r   N)r6   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r    googlecloudsdk.api_lib.utilr   r9   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyCommandr   r1   r   r   <module>rH      sx    : &  ' = A F ( = # D%%++T->->-A-AB*T\\ *  C*r   