Ë
    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)Ú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 )Ú
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.
    ÚreturnNc                 ó.   •— t         t        | �  |¬«       y )N)Úclient)Úsuperr   Ú__init__)Úselfr
   Ú	__class__s     €ú^C:\Users\user\Documents\project_loop\venv\Lib\site-packages\google/cloud/firestore_v1/batch.pyr   zWriteBatch.__init__%   s   ø€ ÜŒj˜$Ñ(°Ð(Õ7ó    r   Útimeoutc                 ó  — | 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.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Úmetadata© )	Ú_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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__G   s   € Øˆr   c                 ó*   — |€| j                  «        y y r#   )r   )r   Úexc_typeÚ	exc_valueÚ	tracebacks       r   Ú__exit__zWriteBatch.__exit__J   s   € ØÐØ�K‰K�Mð r   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚmethodÚDEFAULTÚretriesÚRetryÚfloatr   r   r$   r)   Ú__classcell__)r   s   @r   r   r      sI   ø„ ñõ8ð &.§_¡_×%<Ñ%<ÈtñØ—]‘]ðØGLðà	óò>ör   r   N)r-   Úgoogle.api_corer   r   r0   Ú$google.cloud.firestore_v1.base_batchr   r   r   r   r   ú<module>r6      s    ðñ Då $Ý ,å ?ô5�õ 5r   