o
    ˷eM                     @   s   d Z G dd deZedZedZG dd deZG dd deZG d	d
 d
eZG dd deZG dd deZ	G dd deZ
G dd deZdS )z4Helpful constants to use for Google Cloud Firestore.c                   @   s&   e Zd ZdZdZd	ddZdd ZdS )
Sentinelz1Sentinel objects used to signal special handling.descriptionreturnNc                 C   s
   || _ d S Nr   )selfr    r   [/var/www/ideatree/venv/lib/python3.10/site-packages/google/cloud/firestore_v1/transforms.py__init__   s   
zSentinel.__init__c                 C   s   d | jS )NzSentinel: {})formatr   r   r   r   r   __repr__   s   zSentinel.__repr__r   N)__name__
__module____qualname____doc__	__slots__r	   r   r   r   r   r   r      s
    
r   z+Value used to delete a field in a document.z;Value used to set a document field to the server timestamp.c                   @   s2   e Zd ZdZdZdddZdd Zed	d
 ZdS )
_ValueListzcRead-only list of values.

    Args:
        values (List | Tuple): values held in the helper.
    _valuesr   Nc                 C   s8   t |ttfstdt|dkrtdt|| _d S )Nz!'values' must be a list or tuple.    z'values' must be non-empty.)
isinstancelisttuple
ValueErrorlenr   )r   valuesr   r   r   r	   /   s
   z_ValueList.__init__c                 C      t || jstS | j|jkS r   )r   	__class__NotImplementedr   r   otherr   r   r   __eq__8      z_ValueList.__eq__c                 C      | j S )zgValues to append.

        Returns (List):
            values to be appended by the transform.
        r   r   r   r   r   r   =      z_ValueList.valuesr   )	r   r   r   r   slotsr	   r"   propertyr   r   r   r   r   r   &   s    
	r   c                   @      e Zd ZdZdS )
ArrayUniona{  Field transform: appends missing values to an array field.

    See:
    https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1#google.firestore.v1.DocumentTransform.FieldTransform.FIELDS.google.firestore.v1.ArrayValue.google.firestore.v1.DocumentTransform.FieldTransform.append_missing_elements

    Args:
        values (List | Tuple): values to append.
    Nr   r   r   r   r   r   r   r   r)   G       r)   c                   @   r(   )ArrayRemovear  Field transform: remove values from an array field.

    See:
    https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1#google.firestore.v1.DocumentTransform.FieldTransform.FIELDS.google.firestore.v1.ArrayValue.google.firestore.v1.DocumentTransform.FieldTransform.remove_all_from_array

    Args:
        values (List | Tuple): values to remove.
    Nr*   r   r   r   r   r,   R   r+   r,   c                   @   s.   e Zd ZdZd
ddZedd Zdd	 ZdS )_NumericValuezkHold a single integer / float value.

    Args:
        value (int | float): value held in the helper.
    r   Nc                 C   s    t |ttfstd|| _d S )NzPass an integer / float value.)r   intfloatr   _value)r   valuer   r   r   r	   d   s   
z_NumericValue.__init__c                 C   r$   )zvValue used by the transform.

        Returns:
            (Integer | Float) value passed in the constructor.
        )r0   r   r   r   r   r1   j   r%   z_NumericValue.valuec                 C   r   r   )r   r   r   r0   r    r   r   r   r"   s   r#   z_NumericValue.__eq__r   )r   r   r   r   r	   r'   r1   r"   r   r   r   r   r-   ]   s    

r-   c                   @   r(   )	Incrementa  Field transform: increment a numeric field with specified value.

    See:
    https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1#google.firestore.v1.DocumentTransform.FieldTransform.FIELDS.google.firestore.v1.ArrayValue.google.firestore.v1.DocumentTransform.FieldTransform.increment

    Args:
        value (int | float): value used to increment the field.
    Nr*   r   r   r   r   r2   y   r+   r2   c                   @   r(   )Maximumav  Field transform: bound numeric field with specified value.

    See:
    https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1#google.firestore.v1.DocumentTransform.FieldTransform.FIELDS.google.firestore.v1.ArrayValue.google.firestore.v1.DocumentTransform.FieldTransform.maximum

    Args:
        value (int | float): value used to bound the field.
    Nr*   r   r   r   r   r3      r+   r3   c                   @   r(   )Minimumav  Field transform: bound numeric field with specified value.

    See:
    https://cloud.google.com/firestore/docs/reference/rpc/google.firestore.v1#google.firestore.v1.DocumentTransform.FieldTransform.FIELDS.google.firestore.v1.ArrayValue.google.firestore.v1.DocumentTransform.FieldTransform.minimum

    Args:
        value (int | float): value used to bound the field.
    Nr*   r   r   r   r   r4      r+   r4   N)r   objectr   DELETE_FIELDSERVER_TIMESTAMPr   r)   r,   r-   r2   r3   r4   r   r   r   r   <module>   s   !