
                         p    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r	Sr
S	rS
rSrS rS rS rS rg)z=Common utility functions for Cloud Filestore backup commands.    )absolute_import)division)unicode_literals)util)
propertiesz%projects/{}/locations/{}/instances/{}z#projects/{}/locations/{}/backups/{}zprojects/{}/locations/{}v1
v1p1alpha1c                     A UR                   Ul        [        R                  R                  R
                  R                  SS9nUR                  n[        R                  X45      Ul
        U$ )zUPython hook for yaml commands to supply the backup create request with proper values.Trequired)backupbackupIdr   VALUEScoreprojectGetregionPARENT_TEMPLATEformatparentrefargsreqr   locations        8lib/googlecloudsdk/command_lib/filestore/backups/util.pyFormatBackupCreateRequestr       sU    	#,""**...='[[(%%g8#*	*    c                     A [         R                  R                  R                  R	                  SS9nUR
                  n[        R                  X4UR                  5      Ul	        U$ )zTPython hook for yaml commands to supply backup access requests with the proper name.Tr   )
r   r   r   r   r   r   BACKUP_NAME_TEMPLATEr   r   namer   s        r   FormatBackupAccessRequestr"   *   sP    	""**...='[[(!((DKKH#(	*r   c                 8   A [         R                  R                  R                  R	                  SS9n[
        R                  " U5      nU[        :X  a;  [        R                  X1R                  UR                  5      UR                  l        U$ UR                  b9  [        R                  X1R                  UR                  5      UR                  l        UR                  b9  [        R                  X1R                  UR                  5      UR                  l        U$ )zBPython hook for yaml commands to process the source instance name.Tr   )r   r   r   r   r   r   GetApiVersionFromArgsALPHA_API_VERSIONINSTANCE_NAME_TEMPLATEr   instance_zoneinstancer   sourceInstanceinstance_location)r   r   r   r   api_versions        r   AddInstanceNameToRequestr,   3   s    	""**...='**40+%% 6 = =##T]]!4CJJJ	# 6 = =##T]]!4CJJ	' 6 = =''!8CJJ	*r   c                    A UR                   b  UR                  c  U$ [        R                  R                  R
                  R                  SS9n[        R                  X1R                  UR                   5      UR                  l
        U$ )z@Python hook for yaml commands to process the source backup name.Tr   )source_backupsource_backup_regionr   r   r   r   r   r    r   restoreInstanceRequestsourceBackup)r   r   r   r   s       r   AddBackupNameToRequestr2   G   su    		4#<#<#DJ""**...=',@,G,G(($*<*<->#)	*r   N)__doc__
__future__r   r   r   $googlecloudsdk.command_lib.filestorer   googlecloudsdk.corer   r&   r    r   V1_API_VERSIONr%   r   r"   r,   r2    r   r   <module>r9      sJ    D &  ' 5 *@ < ,  (r   