
    Q                     8   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	lmZ dd
lmZ  ej$                  ej&                  j(                  ej&                  j*                        ej,                   G d dej.                                      Zy)z3`gcloud dataplex encryption-config create` command.    )absolute_import)division)unicode_literals)encryption_config)util)
exceptions)base)resource_args)logc                   X    e Zd ZdZddiZed        Z ej                  d      d        Z	y)CreatezxCreate 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                 X    t        j                  | d       | j                  ddd       y )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ArgszCreate.Args,   s.    00F
1      z-Status code: {status_code}. {status_message}.c           	         |j                   j                  j                         }t        j                         }|j
                  j                  t        j                         j                  |j                         |j                         j                         t        j                  |                   t        j                  j                  d       y )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   Runz
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____doc__detailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptionr-    r   r   r   r      sQ      -   5445r   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.dataplexr   r   r   googlecloudsdk.api_lib.utilr   r4   googlecloudsdk.callioper	   #googlecloudsdk.command_lib.dataplexr
   googlecloudsdk.corer   ReleaseTracksReleaseTrackALPHAGADefaultUniverseOnlyCommandr   r6   r   r   <module>rC      sz    : &  ' = A F ( = # D%%++T->->-A-AB*T\\ *  C*r   