Ë
    ö%9j‹  ã                  ób  — U d Z ddlmZ ddlmZmZ ddlmZ ddlmZ 	 ddl	m
Z
 ddlmZ  e«       j                  «       Ze
j                   j#                  «       D ]&  \  ZZej)                  d«      rŒeevsŒe e«       e<   Œ( 	 dZded<   ddd„Z G d„ d«      Zy
# e$ rZ ed	«      e‚d
Z[ww xY w)zÚCloud Firestore Async module.

This module contains utilities for asynchronusly accessing the Google Cloud Firestore databases
associated with Firebase apps. This requires the ``google-cloud-firestore`` Python module.
é    )Úannotations)ÚOptionalÚDict)ÚApp)Ú_utils)Ú	firestore)ÚDEFAULT_DATABASEÚ_zrFailed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.NÚ_firestore_asyncÚstrÚ_FIRESTORE_ASYNC_ATTRIBUTEc                ó¤   — |�t        |t        «      st        d|› d�«      ‚t        j                  | t
        t        «      }|j                  |«      S )aP  Returns an async client that can be used to interact with Google Cloud Firestore.

    Args:
        app: An App instance (optional).
        database_id: The database ID of the Google Cloud Firestore database to be used.
            Defaults to the default Firestore database ID if not specified or an empty string
            (optional).

    Returns:
        google.cloud.firestore.Firestore_Async: A `Firestore Async Client`_.

    Raises:
        ValueError: If the specified database ID is not a valid string, or if a project ID is not
            specified either via options, credentials or environment variables, or if the specified
            project ID is not a valid string.

    .. _Firestore Async Client: https://cloud.google.com/python/docs/reference/firestore/latest/        google.cloud.firestore_v1.async_client.AsyncClient
    zdatabase_id "z" must be a string or None.)Ú
isinstancer   Ú
ValueErrorr   Úget_app_servicer   Ú_FirestoreAsyncServiceÚ
get_client)ÚappÚdatabase_idÚ
fs_services      úZ/var/www/html/truck-me/venv/lib/python3.12/site-packages/firebase_admin/firestore_async.pyÚclientr   )   sO   € ð* Ð¤z°+¼sÔ'CÜ˜=¨¨Ð5PÐQÓRÐRä×'Ñ'¨Ô-GÔI_Ó`€JØ× Ñ  Ó-Ð-ó    c                  ó    — e Zd ZdZdd„Zdd„Zy)r   z?Service that maintains a collection of firestore async clients.c                ó    — || _         i | _        y )N)Ú_appÚ_clients)Úselfr   s     r   Ú__init__z_FirestoreAsyncService.__init__G   s   € ØˆŒ	Ø:<ˆ�r   c                ó,  — |xs t         }|| j                  vrn| j                  j                  j	                  «       }| j                  j
                  }|st        d«      ‚t        j                  |||¬«      }|| j                  |<   | j                  |   S )zKCreates an async client based on the database_id. These clients are cached.z²Project ID is required to access Firestore. Either set the projectId option, or use service account credentials. Alternatively, set the GOOGLE_CLOUD_PROJECT environment variable.)ÚcredentialsÚprojectÚdatabase)	r	   r   r   Ú
credentialÚget_credentialÚ
project_idr   r   ÚAsyncClient)r   r   r!   r"   Ú	fs_clients        r   r   z!_FirestoreAsyncService.get_clientK   s�   € à!Ò5Ô%5ˆØ˜dŸm™mÑ+àŸ)™)×.Ñ.×=Ñ=Ó?ˆKØ—i‘i×*Ñ*ˆGÙÜ ðAóBð Bô
 "×-Ñ-Ø'°À;ôPˆIà)2ˆD�M‰M˜+Ñ&à�}‰}˜[Ñ)Ð)r   N)r   r   ÚreturnÚNone)r   úOptional[str]r)   úfirestore.AsyncClient)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   © r   r   r   r   D   s   „ ÙIó=ô*r   r   )NN)r   zOptional[App]r   r+   r)   r,   )r0   Ú
__future__r   Útypingr   r   Úfirebase_adminr   r   Úgoogle.cloudr   Ú%google.cloud.firestore_v1.base_clientr	   ÚglobalsÚkeysÚexistingÚ__dict__ÚitemsÚkeyÚvalueÚ
startswithÚImportErrorÚerrorr   Ú__annotations__r   r   r1   r   r   ú<module>rB      s»   ðòõ #ß !Ý Ý !ð	TÝ&ÝFÙ‹y�~‰~Ó€HØ×(Ñ(×.Ñ.Ó0ò #‰
ˆˆUØ�~‰~˜cÕ" s°(Ò':Ø"‰G‹I�cŠNñ#ð #5Ð ˜CÓ 4ô.÷6*ò *øðG ò TÙ
ð Hó IØNSðTûðTús$   ŸAB Á2B Á7B ÂB.Â 	B)Â)B.