
                         P    d Z ddlmZ ddlmZ ddlmZ ddlmZ d Zd Zd Z	d	 Z
y
)z;Utilities for "gcloud metastore services backups" commands.    )absolute_import)division)unicode_literals)	resourcesc                      t        | ||d      S )Nv1alphaapi_version_UpdateBackuprefargsrequests      Alib/googlecloudsdk/command_lib/metastore/services/backups/util.pyUpdateBackupV1Alphar      s    	sD'y	AA    c                      t        | ||d      S )Nv1betar	   r   r   s      r   UpdateBackupV1Betar      s    	sD'x	@@r   c                      t        | ||d      S )Nv1r	   r   r   s      r   UpdateBackupV1r       s    	sD't	<<r   c                     |j                   |S t        j                  j                  |j                   | j                  | j
                  | j                  d|d      j                         |j                  _         |S )ad  Returns a modified create request with the `backup` field updated if the `backup` is passed.

  If the user passes in a single resource like `my-backup`, convert it to a
  relative resource name. If the user passes in a relative resource name, parse
  to make sure it's valid. This will always overwrite the `backup` field in the
  request, however, it might be overwritten with the same value.

  Args:
    ref: A resource ref to the parsed Service resource.
    args: The parsed args namespace from CLI.
    request: The framework generated request to modify.
    api_version: The API version of the backup.
  )
projectsIdlocationsId
servicesIdz-metastore.projects.locations.services.backups)paramsr
   
collection)	backupr   REGISTRYParser   r   r   RelativeNamerestoreServiceRequest)r   r   r   r
   s       r   r   r   $   s{     
[[N)2););)A)A
kk
 @ *B *B CO, C 
& 
.r   N)__doc__
__future__r   r   r   googlecloudsdk.corer   r   r   r   r    r   r   <module>r)      s-    B &  ' )BA=r   