
    Dh                     T    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y)    N)EndpointDiscoveryHandlerEndpointDiscoveryManagerEndpointDiscoveryRefreshFailedHTTPClientErrorloggerc                       e Zd Zd Zd Zy)AioEndpointDiscoveryManagerc                 |  K    | j                   di |}	  | j                  di |}t        j                  |      r
| d {   }| j	                  |      }|| j
                  |<   | j                  j                  |d        |S 7 B# t        t        f$ r# | j                         dz   | j                  |<   Y y w xY ww)N<    )_create_cache_key_describe_endpointsinspectisawaitable_parse_endpoints_cache_failed_attemptspopConnectionErrorr   _time)selfkwargs	cache_keyresponse	endpointss        w/var/www/fastuser/data/www/generator.snapmosaic.io/flask_app/venv/lib/python3.12/site-packages/aiobotocore/discovery.py_refresh_current_endpointsz6AioEndpointDiscoveryManager._refresh_current_endpoints   s     *D**4V4		/t//9&9H""8,!)>--h7I%.DKK	"!!%%i6 *  1 	/3zz|b/@D!!),	s;   B<,B BAB B<B /B96B<8B99B<c                   K   |d   }| j                   j                  |      }| j                  s|st        j                  d|z         y  | j
                  di |}| j                  |      }|r| j                  |      S | j                  |      }|s- | j                  di | d {   }|r| j                  |      S t        j                  d|       | j                  j                  |d       }|r| j                  |      S |r9|r- | j                  di | d {   }|r| j                  |      S t               y 7 7 $w)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   sK    ;'	![[??	J$$-?LLS  +D**4V4	//	:	((33//	:=d==GGGI,,Y77<fE	48((77 "A$"A"A"KF"KK	00;;022) H Ls%   B&E(E)A5EE#EEN)__name__
__module____qualname__r   r,   r       r   r	   r	      s     )r0   r	   c                       e Zd Zd Zy)AioEndpointDiscoveryHandlerc                 L  K   |j                   j                  di       j                  d      }|y | j                  j                  ||       d {   }|t	        j
                  d       y |j                  d      sd|z   }t	        j
                  d|       ||_        y 7 Pw)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     oo!!+r266}E;88$# 9 
 
 LLAB""6*!H,H8(C
s   AB$B"AB$N)r-   r.   r/   r@   r   r0   r   r2   r2   I   s    r0   r2   )	r   botocore.discoveryr   r   r   r   r   r	   r2   r   r0   r   <module>rB      s-     :": :z": r0   