Ë
    U¼Sfˆ  ã                   ó|   — d Z ddlmZmZ dZ G d„ de«      Z G d„ de«      Zdee   d	ee   d
efd„Z	deded
e
fd„Zy)zHelpers for universe domain.é    )ÚAnyÚOptionalzgoogleapis.comc                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )ÚEmptyUniverseErrorc                 ó(   •— d}t         ‰| �  |«       y )Nz*Universe Domain cannot be an empty string.)ÚsuperÚ__init__)ÚselfÚmessageÚ	__class__s     €úWC:\Users\user\Documents\project_loop\venv\Lib\site-packages\google/api_core/universe.pyr	   zEmptyUniverseError.__init__   s   ø€ Ø>ˆÜ‰Ñ˜Õ!ó    ©Ú__name__Ú
__module__Ú__qualname__r	   Ú__classcell__©r   s   @r   r   r      s   ø„ ÷"ð "r   r   c                   ó   ‡ — e Zd Zˆ fd„Zˆ xZS )ÚUniverseMismatchErrorc                 óD   •— d|› d|› dt         › d�}t        ‰| �	  |«       y )Nz The configured universe domain (z?) does not match the universe domain found in the credentials (z>). If you haven't configured the universe domain explicitly, `z` is the default.)ÚDEFAULT_UNIVERSEr   r	   )r
   Úclient_universeÚcredentials_universer   r   s       €r   r	   zUniverseMismatchError.__init__   s>   ø€ à.¨Ð.?ð @)Ø)=Ð(>ð ?ä Ð!Ð!2ð4ð 	ô 	‰Ñ˜Õ!r   r   r   s   @r   r   r      s   ø„ ÷"ð "r   r   Úclient_universe_domainÚuniverse_domain_envÚreturnc                 óh   — t         }| �| }n|�|}t        |j                  «       «      dk(  rt        ‚|S )aË  Return the universe domain used by the client.

    Args:
        client_universe_domain (Optional[str]): The universe domain configured via the client options.
        universe_domain_env (Optional[str]): The universe domain configured via the
        "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable.

    Returns:
        str: The universe domain to be used by the client.

    Raises:
        ValueError: If the universe domain is an empty string.
    r   )r   ÚlenÚstripr   )r   r   Úuniverse_domains      r   Údetermine_domainr"   '   sA   € ô  '€OØÐ)Ø0‰Ø	Ð	(Ø-ˆÜ
ˆ?× Ñ Ó"Ó# qÒ(Ü Ð ØÐr   r   Úcredentialsc                 óH   — t        |dt        «      }| |k7  rt        | |«      ‚y)a´  Returns True iff the universe domains used by the client and credentials match.

    Args:
        client_universe (str): The universe domain configured via the client options.
        credentials Any: The credentials being used in the client.

    Returns:
        bool: True iff client_universe matches the universe in credentials.

    Raises:
        ValueError: when client_universe does not match the universe in credentials.
    r!   T)Úgetattrr   r   )r   r#   r   s      r   Úcompare_domainsr&   A   s/   € ô # ;Ð0AÔCSÓTÐàÐ.Ò.Ü# OÐ5IÓJÐJØr   N)Ú__doc__Útypingr   r   r   Ú
ValueErrorr   r   Ústrr"   Úboolr&   © r   r   ú<module>r-      sj   ðñ #ç  à#Ð ô"˜ô "ô"˜Jô "ðØ$ S™MðØ@HÈÁðàóð4 Sð °sð ¸tô r   