
                         T    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
d
 Zy)zCUseful commands for interacting with the Cloud Firestore Admin API.    )absolute_import)division)unicode_literals)apisv1c                  6    t        j                  dt              S )z8Import and return the appropriate admin messages module.	firestore)r   GetMessagesModuleFIRESTORE_API_VERSION     1lib/googlecloudsdk/api_lib/firestore/api_utils.pyGetMessagesr          			-B	CCr   c                  6    t        j                  dt              S )zEReturns the Cloud Firestore client for the appropriate release track.r	   )r   GetClientInstancer   r   r   r   	GetClientr   !   r   r   c                 $    dj                  |       S )zReturns the duration string.

  Args:
    duration: the duration, an int. The unit is seconds.

  Returns:
    a duration with string format.
  z{}s)format)durations    r   FormatDurationStringr   &   s     
h	r   c                     d}| r<| j                         D cg c]  \  }}|j                  ||       }}} ||      }|S c c}}w )zReturns the TagsValue message.

  Args:
    tags: the tags, a dictionary.
    tags_value_message_type: the TagsValue message type.

  Returns:
    a TagsValue message.
  N)keyvalue)additionalProperties)itemsAdditionalProperty)tagstags_value_message_type
tags_valuer   r   additional_propertiess         r   ParseTagsForTagsValuer"   2   sp     *	
 **,	 'JC 	 225 	3 	
 '	   	 !6	
 
 
s   AN)__doc__
__future__r   r   r   googlecloudsdk.api_lib.utilr   r   r   r   r   r"   r   r   r   <module>r&      s7    J '  ' ,  D
D
	 r   