Ë
    V¼Sf  ã                   óB   — d 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.é    )Úgapic_v1)Úretry_async)ÚBaseWriteBatchc                   ó†   ‡ — e Zd ZdZd
ˆ fd„Zej                  j                  dfdej                  de
defd„Zd„ Zd	„ Zˆ xZS )ÚAsyncWriteBatcha¯  Accumulate write operations to be sent in a batch.

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

    Args:
        client (:class:`~google.cloud.firestore_v1.async_client.AsyncClient`):
            The client that created this batch.
    ÚreturnNc                 ó.   •— t         t        | �  |¬«       y )N)Úclient)Úsuperr   Ú__init__)Úselfr
   Ú	__class__s     €údC:\Users\user\Documents\project_loop\venv\Lib\site-packages\google/cloud/firestore_v1/async_batch.pyr   zAsyncWriteBatch.__init__$   s   ø€ ÜŒo˜tÑ-°VÐ-Õ<ó    ÚretryÚtimeoutc              ƒ   ó.  K  — | j                  ||«      \  }} | j                  j                  j                  d|| j                  j                  dœ|¤Žƒ d{  –—† }g | _        t        |j                  «      x| _        }|j                  | _        |S 7 Œ:­w)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.proto.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ÚmetadataN© )	Ú_prep_commitÚ_clientÚ_firestore_apiÚcommitÚ_rpc_metadataÚ
_write_pbsÚlistÚwrite_resultsÚcommit_time)r   r   r   r   ÚkwargsÚcommit_responseÚresultss          r   r   zAsyncWriteBatch.commit'   s—   è ø€ ð& ×+Ñ+¨E°7Ó;‰ˆ�à B §¡× ;Ñ ;× BÑ Bð !
ØØ—\‘\×/Ñ/ñ!
ð ñ!
÷ 
ˆð ˆŒÜ'+¨O×,IÑ,IÓ'JÐJˆÔ˜WØ*×6Ñ6ˆÔàˆð
ús   ‚ABÁBÁ;Bc              ƒ   ó   K  — | S ­w©Nr   )r   s    r   Ú
__aenter__zAsyncWriteBatch.__aenter__H   s   è ø€ Øˆùs   ‚c              ƒ   óF   K  — |€| j                  «       ƒ d {  –—†  y y 7 Œ­wr$   )r   )r   Úexc_typeÚ	exc_valueÚ	tracebacks       r   Ú	__aexit__zAsyncWriteBatch.__aexit__K   s#   è ø€ ØÐØ—+‘+“-×Ñð Øús   ‚!˜™!)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚmethodÚDEFAULTÚretriesÚ
AsyncRetryÚfloatr   r   r%   r*   Ú__classcell__)r   s   @r   r   r      sQ   ø„ ñ	õ=ð
 %-§O¡O×$;Ñ$;Øñà×!Ñ!ðð ðð 
ó	òBö r   r   N)r.   Úgoogle.api_corer   r   r1   Ú$google.cloud.firestore_v1.base_batchr   r   r   r   r   ú<module>r7      s"   ðñ Dõ %Ý 2å ?ô5 �nõ 5 r   