
    
                     8    S r SSKJr  SSKJr  S rS rS rS rg)	zEUseful commands for interacting with the Cloud Firestore Backups API.    )	api_utils)logc                  @    [         R                  " 5       R                  $ )zFReturns the service for interacting with the Firestore Backup service.)r   	GetClientprojects_locations_backups     /lib/googlecloudsdk/api_lib/firestore/backups.py_GetBackupServicer      s    					9	99r	   c                 P   [        5       R                  [        R                  " 5       R	                  SR                  X5      S95      nUR                  (       a9  UR                   H)  n[        R                  R                  SU SU S35        M+     [        UR                  5      $ )zLists backups available to Google Cloud Firestore.

Args:
  project: the project id to list backups, a string.
  location: the location to list backups, a string.

Returns:
  a List of Backups.
zprojects/{}/locations/{})parentz$Failed to list backups for location zO, please retry with command gcloud {version} firestore backups list --location=z to get a more concrete error)r   Listr   GetMessages,FirestoreProjectsLocationsBackupsListRequestformatunreachabler   statusPrintlistbackups)projectlocationresultr   s       r
   ListBackupsr      s     ##JJ+227E K &
 ))	jj0 >$%BD * 
fnn	r	   c           	          [        5       R                  [        R                  " 5       R	                  SR                  XU5      S95      $ )zGets backup with the given name.

Args:
  project: the project id to get backup, a string.
  location: the location to get backup, a string.
  backup: the backup id to get backup, a string.

Returns:
  A Backup.
#projects/{}/locations/{}/backups/{}name)r   Getr   r   +FirestoreProjectsLocationsBackupsGetRequestr   r   r   backups      r
   	GetBackupr#   4   sJ     
		 	 II4;; J 
 r	   c           	          [        5       R                  [        R                  " 5       R	                  SR                  XU5      S95      $ )zDeletes backup with the given name.

Args:
  project: the project id to get backup, a string.
  location: the location to get backup, a string.
  backup: the backup id to get backup, a string.

Returns:
  Empty.
r   r   )r   Deleter   r   .FirestoreProjectsLocationsBackupsDeleteRequestr   r!   s      r
   DeleteBackupr'   H   sJ     
		#	#LL4;; M 
 r	   N)	__doc__ googlecloudsdk.api_lib.firestorer   googlecloudsdk.corer   r   r   r#   r'   r   r	   r
   <module>r+      s'    L 7 #:
2(r	   