
                         ^   S r SSKJr  SSKJr  SSKJr  SSK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$                  R(                  \	R$                  R*                  5       " S S\	R,                  5      5       5       rg)z/The gcloud Firestore databases restore command.    )absolute_import)division)unicode_literalsN)	databases)base)flags)util)
propertiesc                   4    \ rS rSrSr\S 5       rS rS rSr	g)RestoreFirestoreAPI   a  Restores a Cloud Firestore database from a backup.

## EXAMPLES

To restore a database from a backup.

    $ {command}
    --source-backup=projects/PROJECT_ID/locations/LOCATION_ID/backups/BACKUP_ID
    --destination-database=DATABASE_ID

To restore a database from a backup with tags.

    $ {command}
    --source-backup=projects/PROJECT_ID/locations/LOCATION_ID/backups/BACKUP_ID
    --destination-database=DATABASE_ID
    --tags=key1=value1,key2=value2

To restore to a CMEK-enabled database.

    $ {command}
    --source-backup=projects/PROJECT_ID/locations/LOCATION_ID/backups/BACKUP_ID
    --destination-database=DATABASE_ID
    --encryption-type=customer-managed-encryption
    --kms-key-name=projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING_ID/cryptoKeys/CRYPTO_KEY_ID
c           	          UR                  SS[        S[        R                  " S5      S9  [        R
                  " USS5        [        R                  " US5        [        R                  " US5        g )	Nz--source-backupSOURCE_BACKUPTa              The source backup to restore from.

            For example, to restore from backup `cf9f748a-7980-4703-b1a1-d1ffff591db0` in us-east1:

            $ {command} --source-backup=projects/PROJECT_ID/locations/us-east1/backups/cf9f748a-7980-4703-b1a1-d1ffff591db0
            )metavartyperequiredhelprestorebackupdatabase)add_argumentstrtextwrapdedentr   AddDestinationDatabaseAddEncryptionConfigGroupAddTags)clsparsers     *lib/surface/firestore/databases/restore.pyArgsRestoreFirestoreAPI.Args=   sd    
__     
  H=	""684	MM&*%    c                     [         R                  R                  R                  R	                  SS9n[
        R                  " UUR                  UR                  U R                  U5      UR                  5      $ )NT)r   )r
   VALUEScoreprojectGetr   RestoreDatabasesource_backupdestination_databaseEncryptionConfigtags)selfargsr'   s      r    RunRestoreFirestoreAPI.RunP   sd    $$,,00$0?G$$!!d#		 r#   c                 .    [         R                  " U5      $ )N)utilsExtractEncryptionConfig)r.   r/   s     r    r,   $RestoreFirestoreAPI.EncryptionConfigZ   s    ((..r#    N)
__name__
__module____qualname____firstlineno____doc__classmethodr!   r0   r,   __static_attributes__r6   r#   r    r   r      s%    
4 & &$/r#   r   )r;   
__future__r   r   r   r    googlecloudsdk.api_lib.firestorer   googlecloudsdk.callioper   $googlecloudsdk.command_lib.firestorer   r	   r3   googlecloudsdk.corer
   DefaultUniverseOnlyReleaseTracksReleaseTrackALPHABETAGACommandr   r6   r#   r    <module>rJ      s    6 &  '  6 ( 6 > * T..33T5F5F5I5I9/$,, 9/ 9/r#   