U
    >i                     @   s,   d dl Z d dlmZ G dd de jjZdS )    N)Sequencec                   @   sd   e Zd ZU dZdZee ed< ee dddZdd Z	d	d
 Z
eedddZdd Zdd ZdS )VectorzA class to represent Firestore Vector in python.

    Underlying object will be converted to a map representation in Firestore API.
     _value)valuec                 C   s   t dd |D | _d S )Nc                 S   s   g | ]}t |qS r   )float).0vr   r   D/tmp/pip-unpacked-wheel-599y42ri/google/cloud/firestore_v1/vector.py
<listcomp>   s     z#Vector.__init__.<locals>.<listcomp>)tupler   )selfr   r   r   r
   __init__   s    zVector.__init__c                 C   s
   | j | S Nr   )r   argr   r   r
   __getitem__   s    zVector.__getitem__c                 C   s
   t | jS r   )lenr   r   r   r   r
   __len__"   s    zVector.__len__)otherreturnc                 C   s   t |tsdS | j|jkS )NF)
isinstancer   r   )r   r   r   r   r
   __eq__%   s    
zVector.__eq__c                 C   s   dt | jdd  dS )NzVector<   >)strr   r   r   r   r
   __repr__*   s    zVector.__repr__c                 C   s   d| j dS )NZ
__vector__)Z__type__r   r   r   r   r   r
   to_map_value-   s    zVector.to_map_valueN)__name__
__module____qualname____doc__r   r   r   __annotations__r   r   r   objectboolr   r   r   r   r   r   r
   r      s   
r   )collectionstypingr   abcr   r   r   r   r
   <module>   s   