
    (ph^                    N    S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\5      r	g)	z=Helpers for batch requests to the Google Cloud Firestore API.    )annotations)gapic_v1)retry)BaseWriteBatchc                     ^  \ rS rSrSrS	U 4S jjr\R                  R                  S4     S
S jjr	S r
S rSrU =r$ )
WriteBatch   a  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                (   > [         [        U ]  US9  g )N)client)superr   __init__)selfr   	__class__s     R/var/www/html/venv/lib/python3.13/site-packages/google/cloud/firestore_v1/batch.pyr   WriteBatch.__init__%   s    j$((7    Nc                   U R                  X5      u  p4U R                  R                  R                  " SUU R                  R                  S.UD6n/ U l        [        UR                  5      =U l        nUR                  U l        U$ )a4  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   WriteBatch.commit(   s    & ++E;,,55<< 
\\//
 
 '+O,I,I'JJW*66r   c                    U $ Nr   )r   s    r   	__enter__WriteBatch.__enter__I   s    r   c                ,    Uc  U R                  5         g g r&   )r   )r   exc_type	exc_value	tracebacks       r   __exit__WriteBatch.__exit__L   s    KKM r   )r   r   r   )returnNone)r   zretries.Retry | object | Noner    zfloat | Noner/   r   )__name__
__module____qualname____firstlineno____doc__r   r   methodDEFAULTr   r'   r-   __static_attributes____classcell__)r   s   @r   r   r      sP    8
 08/F/F $,  
	B r   r   N)
r5   
__future__r   google.api_corer   r   retries$google.cloud.firestore_v1.base_batchr   r   r   r   r   <module>r>      s#    D " $ , ?7 7r   