
    f
                     F   d Z 	 ddlmZ  e                                            Zej                                        D ]+\  ZZ	e
                    d          seevre	 e            e<   ,n# e$ r  ed          w xY wddlmZ dZddej        fd	Z G d
 d          ZdS )zCloud Firestore module.

This module contains utilities for accessing the Google Cloud Firestore databases associated with
Firebase apps. This requires the ``google-cloud-firestore`` Python module.
    )	firestore_zrFailed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.)_utils
_firestoreNreturnc                 t    t          j        | t          t          j                  }|                                S )a  Returns a client that can be used to interact with Google Cloud Firestore.

    Args:
      app: An App instance (optional).

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

    Raises:
      ValueError: 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 Client: https://googlecloudplatform.github.io/google-cloud-python/latest          /firestore/client.html
    )r   get_app_service_FIRESTORE_ATTRIBUTE_FirestoreClientfrom_appget)app	fs_clients     R/var/www/html/Alfredo/env/lib/python3.11/site-packages/firebase_admin/firestore.pyclientr   %   s+      &s,@BRB[\\I==??    c                   4    e Zd ZdZd Zd Zed             ZdS )r   z/Holds a Google Cloud Firestore client instance.c                 <    t          j        ||          | _        d S )N)credentialsproject)r   Client_client)selfr   r   s      r   __init__z_FirestoreClient.__init__<   s     'KQQQr   c                     | j         S N)r   )r   s    r   r   z_FirestoreClient.get?   s
    |r   c                     |j                                         }|j        }|st          d          t	          ||          S )z5Creates a new _FirestoreClient for the specified app.zProject ID is required to access Firestore. Either set the projectId option, or use service account credentials. Alternatively, set the GOOGLE_CLOUD_PROJECT environment variable.)
credentialget_credential
project_id
ValueErrorr   )clsr   r   r   s       r   r   z_FirestoreClient.from_appB   sO     n3355. 	)() ) )  W555r   N)__name__
__module____qualname____doc__r   r   classmethodr    r   r   r   r   9   sV        99R R R   	6 	6 [	6 	6 	6r   r   r   )r&   google.cloudr   globalskeysexisting__dict__itemskeyvalue
startswithImportErrorfirebase_adminr   r
   r   r   r   r(   r   r   <module>r4      s@   I&&&&&&wyy~~H(..00 # #
U~~c"" 	#s(':':"GGIIcN#  I I I
+ H I I II " ! ! ! ! ! $  	(    (6 6 6 6 6 6 6 6 6 6s   A'A, ,A=