ó
    €Ïˆ  ã                   ó€   • S r SSKJrJr  Sr " S S\5      r " S S\5      rS\\   S	\\   S
\4S jr	S\S\S
\
4S jrg)zHelpers for universe domain.é    )ÚAnyÚOptionalzgoogleapis.comc                   ó(   ^ • \ rS rSrU 4S jrSrU =r$ )ÚEmptyUniverseErroré   c                 ó(   >• Sn[         TU ]  U5        g )Nz*Universe Domain cannot be an empty string.)ÚsuperÚ__init__)ÚselfÚmessageÚ	__class__s     €Ú+lib/third_party/google/api_core/universe.pyr
   ÚEmptyUniverseError.__init__   s   ø€ Ø>ˆÜ‰Ñ˜Õ!ó    © ©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r
   Ú__static_attributes__Ú__classcell__©r   s   @r   r   r      s   ø† ÷"ó "r   r   c                   ó(   ^ • \ rS rSrU 4S jrSrU =r$ )ÚUniverseMismatchErroré   c                 óD   >• SU SU S[          S3n[        TU ]	  U5        g )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
   ÚUniverseMismatchError.__init__   s>   ø€ à.¨Ð.?ð @)Ø)=Ð(>ð ?ä Ð!Ð!2ð4ð 	ô 	‰Ñ˜Õ!r   r   r   r   s   @r   r   r      s   ø† ÷"ó "r   r   Úclient_universe_domainÚuniverse_domain_envÚreturnc                 ón   • [         nU b  U nOUb  Un[        UR                  5       5      S:X  a  [        eU$ )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                 óF   • [        US[        5      nX:w  a  [        X5      eg)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ÓJÐJØr   N)Ú__doc__Útypingr   r   r   Ú
ValueErrorr   r   Ústrr)   Úboolr-   r   r   r   Ú<module>r3      sj   ðñ #ç  à#Ð ô"˜ô "ô"˜Jô "ðØ$ S™MðØ@HÈÁðàôð4 Sð °sð ¸tõ r   