
    pge                     b    d dl Z d dlmZmZmZmZmZ  G d de          Z G d de          ZdS )    N)EndpointDiscoveryHandlerEndpointDiscoveryManagerEndpointDiscoveryRefreshFailedHTTPClientErrorloggerc                       e Zd Zd Zd ZdS )AioEndpointDiscoveryManagerc                 Z  K    | j         di |}	  | j        di |}t          j        |          r| d {V }|                     |          }|| j        |<   | j                            |d            |S # t          t          f$ r# | 
                                dz   | j        |<   Y d S w xY w)N<    )_create_cache_key_describe_endpointsinspectisawaitable_parse_endpoints_cache_failed_attemptspopConnectionErrorr   _time)selfkwargs	cache_keyresponse	endpointss        5lib/python3.11/site-packages/aiobotocore/discovery.py_refresh_current_endpointsz6AioEndpointDiscoveryManager._refresh_current_endpoints   s      *D*44V44		/t/99&99H"8,, *!)>>>>>>--h77I%.DK	"!%%i6661 	 	 	/3zz||b/@D!),44	s   A$A6 60B*)B*c                   K   |d         }| j                             |          }| j        s|st          j        d|z             d S  | j        di |}|                     |          }|r|                     |          S |                     |          }|s* | j	        di | d {V }|r|                     |          S t          j        d|           | j
                            |d           }|r|                     |          S |r:|r* | j	        di | d {V }|r|                     |          S t                      d S )N	OperationzAOptional discovery disabled. Skipping discovery for Operation: %sz%Endpoint Discovery has failed for: %sr   )_modeldiscovery_required_for_always_discoverr   debugr   _get_current_endpoints_select_endpoint_recently_failedr   r   getr   )r   r   	operationdiscovery_requiredr   r   recently_failedstale_entriess           r   describe_endpointz-AioEndpointDiscoveryManager.describe_endpoint   s     ;'	![??	JJ$ 	-? 	LS   4 +D*44V44	//	::	 	4((333//	:: 	8=d=GGGGGGGGGGI 8,,Y777<fEEE	488 	8((777 		3  <"A$"A"K"KF"K"KKKKKKK	 <00;;;0222t    N)__name__
__module____qualname__r   r,   r   r-   r   r	   r	      s2           ) ) ) ) )r-   r	   c                       e Zd Zd ZdS )AioEndpointDiscoveryHandlerc                 N  K   |j                             di                               d          }|d S | j                            ||           d {V }|t	          j        d           d S |                    d          sd|z   }t	          j        d|           ||_        d S )N	discoveryidentifiers)r   Identifiersz&Failed to discover and inject endpointhttpzhttps://z!Injecting discovered endpoint: %s)contextr'   _managerr,   r   r#   
startswithurl)r   requestoperation_namer   idsendpoints         r   discover_endpointz-AioEndpointDiscoveryHandler.discover_endpointJ   s      o!!+r2266}EE;F88$# 9 
 
 
 
 
 
 
 
 LABBBF""6** 	-!H,H8(CCCr-   N)r.   r/   r0   r@   r   r-   r   r2   r2   I   s#            r-   r2   )	r   botocore.discoveryr   r   r   r   r   r	   r2   r   r-   r   <module>rB      s                 : : : : :": : : :z    ":     r-   