Ë
    ö%9j`  ã                  óN   — d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d„ de«      Z	y)	z=Helpers for batch requests to the Google Cloud Firestore API.é    )Úannotations)Úgapic_v1)Úretry)ÚBaseWriteBatchc                  óp   ‡ — e Zd ZdZdˆ fd„Zej                  j                  df	 	 	 	 	 dd„Zd„ Z	d„ Z
ˆ xZS )	Ú
WriteBatcha
  Accumulate write operations to be sent in a batch. Use this over
    `BulkWriteBatch` for lower volumes or when the order of operations
    within a given batch is important.

    This has the same set of methods for write operations that
    :class:`~google.cloud.firestore_v1.document.DocumentReference` does,
    e.g. :meth:`~google.cloud.firestore_v1.document.DocumentReference.create`.

    Args:
        client (:class:`~google.cloud.firestore_v1.client.Client`):
            The client that created this batch.
    c                ó.   •— t         t        | �  |¬«       y )N)Úclient)Úsuperr   Ú__init__)Úselfr
   Ú	__class__s     €ú[/var/www/html/truck-me/venv/lib/python3.12/site-packages/google/cloud/firestore_v1/batch.pyr   zWriteBatch.__init__'   s   ø€ ÜŒj˜$Ñ(°Ð(Õ7ó    Nc                ó  — | j                  ||«      \  }} | j                  j                  j                  d|| j                  j                  dœ|¤Ž}g | _        t        |j                  «      x| _        }|j                  | _        |S )aŒ  Commit the changes accumulated in this batch.

        Args:
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.  Defaults to a system-specified policy.
            timeout (float): The timeout for this request.  Defaults to a
                system-specified value.

        Returns:
            List[:class:`google.cloud.firestore_v1.write.WriteResult`, ...]:
            The write results corresponding to the changes committed, returned
            in the same order as the changes were applied to this batch. A
            write result contains an ``update_time`` field.
        )ÚrequestÚmetadata© )	Ú_prep_commitÚ_clientÚ_firestore_apiÚcommitÚ_rpc_metadataÚ
_write_pbsÚlistÚwrite_resultsÚcommit_time)r   r   Útimeoutr   ÚkwargsÚcommit_responseÚresultss          r   r   zWriteBatch.commit*   s‰   € ð& ×+Ñ+¨E°7Ó;‰ˆ�à<˜$Ÿ,™,×5Ñ5×<Ñ<ð 
ØØ—\‘\×/Ñ/ñ
ð ñ
ˆð ˆŒÜ'+¨O×,IÑ,IÓ'JÐJˆÔ˜WØ*×6Ñ6ˆÔàˆr   c                ó   — | S ©Nr   )r   s    r   Ú	__enter__zWriteBatch.__enter__K   s   € Øˆr   c                ó*   — |€| j                  «        y y r#   )r   )r   Úexc_typeÚ	exc_valueÚ	tracebacks       r   Ú__exit__zWriteBatch.__exit__N   s   € ØÐØ�K‰K�Mð r   )ÚreturnÚNone)r   zretries.Retry | object | Noner   zfloat | Noner*   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚmethodÚDEFAULTr   r$   r)   Ú__classcell__)r   s   @r   r   r      sK   ø„ ñõ8ð
 08¯©×/FÑ/FØ $ðà,ðð ðð 
ó	òBör   r   N)
r/   Ú
__future__r   Úgoogle.api_corer   r   ÚretriesÚ$google.cloud.firestore_v1.base_batchr   r   r   r   r   ú<module>r7      s#   ðñ Då "å $Ý ,å ?ô7�õ 7r   