
    Iig                     @    S SK JrJr   " S S\5      r " S S\5      rg)   )KnownProfilesProfileDefinitionc                       \ rS rSrSrSrg)InvalidMultiApiClientError   z6If the mixin is not used with a compatible class.
     N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       C/venv/lib/python3.13/site-packages/azure/profiles/multiapiclient.pyr   r      s
    r   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )MultiApiClientMixin   aS  Mixin that contains multi-api version profile management.

To use this mixin, a client must define two class attributes:
- LATEST_PROFILE : a ProfileDefinition correspond to latest profile
- _PROFILE_TAG : a tag that filter a full profile for this particular client

This should not be used directly and will only provide private methods.
c                   > UR                  SS 5      nUR                  S[        R                  5      nU(       d  SU;   d  SU;   a  [        [        U ]  " U0 UD6   [        U 5      R                     [        U 5      R                    U(       a  U[        R                  La  [        S5      eU(       a0  [        U R                  S U00U R                  S-   U-   5      U l        g [        U[        5      (       aX  [        U R                  U0U R                  S	-   5      U l        U(       a&  X0R                  R                   U R                     S '   g g X@l        g ! [         a    [        S5      ef = f! [         a    [        S5      ef = f)
Napi_versionprofilecredsconfigzITo use this mixin, main client MUST define LATEST_PROFILE class attributezGTo use this mixin, main client MUST define _PROFILE_TAG class attributez>Cannot use api-version and profile parameters at the same time z dict)popr   defaultsuperr   __init__typeLATEST_PROFILEAttributeErrorr   _PROFILE_TAG
ValueErrorr   r   
isinstancedict_profile_dict)selfargskwargsr   r   	__class__s        r   r   MultiApiClientMixin.__init__   sw   jj5**Y(=(=> 7f$F(:%t5tFvF	zJ%%	xJ## 7-*?*??]^^,!!+$. !!C'+5	DL &&,!!7. !!G+DL
 FQ**4+<+<=dC  #L7  	z,-xyy	z
  	x,-vww	xs   E 2E0 E-0Fc                    U R                   nU R                   [        R                  L a(  [        R                  R                  R	                  5       nU[        R
                  L a  U R                  nO\[        U[        5      (       a  UR                  nO:[        U[        5      (       a  O$[        SR                  U R                   5      5      eUR                  5       nU R                  U;  a$  [        SR                  U R                  5      5      eX0R                     nX;   a  XA   $  US    $ ! [         a    [        S5      ef = f)Nz,Cannot determine a ProfileDefinition from {}zThis profile doesn't define {}z>This profile definition does not contain a default API version)r   r   r   value
definitionlatestr   r#   r   r"   formatget_profile_dictr!   KeyError)r&   operation_group_namecurrent_profilelocal_profile_dictlocal_profiles        r   _get_api_version$MultiApiClientMixin._get_api_versionC   s   ,,<<=000+3399DDFOm222"11O77-33O):;;KRRSWS_S_`aa,==?$66=DDTEVEVWXX*+<+<=0 66	_ && 	_]^^	_s   *D/ /E)r   )	r	   r
   r   r   r   r   r6   r   __classcell__)r)   s   @r   r   r      s    *#X_ _r   r   N) r   r   	Exceptionr   objectr   r   r   r   <module>r<      s&    /	 	
N_& N_r   