
    pge                     j    d dl Z d dlZd dlmZ d dlmZ  ej        e          Z G d de          Z	dS )    N)EndpointProviderError)EndpointRulesetResolverc                        e Zd Zd Zd Zd ZdS )AioEndpointRulesetResolverc                 R  K   |i }|i }|                      |||           d{V }t                              d|z             	  | j        j        d
i |}n.# t
          $ r!}|                     ||          }| ||d}~ww xY wt                              d|j        z             | j        s@|j        	                    d          r&|
                    d|j        dd                    }|
                    d |j                                        D             	          }|S )zAInvokes the provider with params defined in the service's rulesetNz-Calling endpoint provider with parameters: %szEndpoint provider result: %szhttps://zhttp://   )urlc                 &    i | ]\  }}||d          S )r    ).0keyvals      3lib/python3.11/site-packages/aiobotocore/regions.py
<dictcomp>zAAioEndpointRulesetResolver.construct_endpoint.<locals>.<dictcomp>6   s/        (SSV      )headersr   )_get_provider_paramsLOGdebug	_providerresolve_endpointr   #ruleset_error_to_botocore_exceptionr	   _use_ssl
startswith_replacer   items)selfoperation_model	call_argsrequest_contextprovider_paramsprovider_resultexbotocore_exceptions           r   construct_endpointz-AioEndpointRulesetResolver.construct_endpoint   s      I" O $ 9 9Y!
 !
 
 
 
 
 
 
 			;oM	
 	
 	
	1=dn=  ! OO % 	1 	1 	1!%!I!IO" " ")(b0	1 			0?3FFGGG } 	!4!?!?
!K!K 	-667o1!""577 7  O *22 ,;,C,I,I,K,K   3 
 
 s   A 
B#A??Bc                   K   i }|                      |||           d{V }| j                                        D ]I\  }}|                     |||          }|#|j        |                     |j        |          }||||<   J|S )a  Resolve a value for each parameter defined in the service's ruleset

        The resolution order for parameter values is:
        1. Operation-specific static context values from the service definition
        2. Operation-specific dynamic context values from API parameters
        3. Client-specific context parameters
        4. Built-in values such as region, FIPS usage, ...
        N)
param_namer   r   )builtin_namebuiltins)_get_customized_builtins_param_definitionsr   _resolve_param_from_contextbuiltin_resolve_param_as_builtin)	r   r   r   r    r!   customized_builtinsr'   	param_def	param_vals	            r   r   z/AioEndpointRulesetResolver._get_provider_params=   s        %)$A$AY%
 %
 
 
 
 
 
 
 &*%<%B%B%D%D 	8 	8!J	88% /# 9  I
  Y%6%B ::!*!20 ;  	 $.7
+r   c                    K   | j         j                                        }t          j        | j                  }| j                            d|z  ||||           d {V  |S )Nzbefore-endpoint-resolution.%s)r)   modelparamscontext)_service_model
service_id	hyphenizecopy	_builtins_event_emitteremit)r   r   r   r    r7   r/   s         r   r*   z3AioEndpointRulesetResolver._get_customized_builtins^   s       (3==??
"i77!&&+j8(!# ' 
 
 	
 	
 	
 	
 	
 	
 	
 #"r   N)__name__
__module____qualname__r%   r   r*   r   r   r   r   r   
   sC        0 0 0d  B# # # # #r   r   )
r9   loggingbotocore.exceptionsr   botocore.regionsr   	getLoggerr=   r   r   r   r   r   <module>rD      s      5 5 5 5 5 5 4 4 4 4 4 4g!!a# a# a# a# a#!8 a# a# a# a# a#r   