
    vKg++                         S SK r S SKrS SKrS SKJr  S SKJrJrJr  S SK	J
r
  S SKJr  \ R                  " \5      r " S S\5      r " S S	\5      r " S
 S\5      rS r " S S5      r " S S5      r " S S5      rg)    N)
xform_name)BotoCoreErrorConnectionErrorHTTPClientError)OperationNotFoundError)CachedPropertyc                       \ rS rSrSrg)EndpointDiscoveryException    N)__name__
__module____qualname____firstlineno____static_attributes__r       R/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/botocore/discovery.pyr
   r
      s    r   r
   c                       \ rS rSrSrSrSrg)EndpointDiscoveryRequired   zBEndpoint Discovery is disabled but is required for this operation.zAEndpoint Discovery is not enabled but this operation requires it.r   Nr   r   r   r   __doc__fmtr   r   r   r   r   r      s
    L
MCr   r   c                       \ rS rSrSrSrSrg)EndpointDiscoveryRefreshFailed#   z=Endpoint Discovery failed to the refresh the known endpoints.z<Endpoint Discovery failed to refresh the required endpoints.r   Nr   r   r   r   r   r   #   s
    G
HCr   r   c                 l    U R                   nU(       a!  UR                  S5      (       a
  [        5       eg g )Nrequired)endpoint_discoverygetr   )modelkwargsr   s      r   ,block_endpoint_discovery_required_operationsr#   )   s4    11044Z@@')) Ar   c                   V    \ rS rSrS r\S 5       r\S 5       rS rS r	S r
SS	 jrS
rg)EndpointDiscoveryModel/   c                     Xl         g N_service_model)selfservice_models     r   __init__EndpointDiscoveryModel.__init__0   s    +r   c                 X    U R                   R                  n[        UR                  5      $ r(   )r*   endpoint_discovery_operationr   name)r+   discovery_operations     r   discovery_operation_name/EndpointDiscoveryModel.discovery_operation_name3   s&    "11NN-2233r   c                     U R                   R                  n/ nUR                  (       a-  [        UR                  R                  R                  5       5      nU$ r(   )r*   r0   input_shapelistmemberskeys)r+   r2   r9   s      r   discovery_operation_keys/EndpointDiscoveryModel.discovery_operation_keys8   sG    "11NN**+77??DDFGDr   c                      U R                   R                  U5      nUR                  R                  SS5      $ ! [         a     gf = f)Nr   F)r*   operation_modelr   r    r   )r+   operation_namer=   s      r   discovery_required_for-EndpointDiscoveryModel.discovery_required_for@   sM    	"11AAO #5599*eLL% 		s   69 
AAc                     U R                   nUR                  S5      (       d$  UR                  SS 5        UR                  SS 5        UR                  5        VVs0 sH  u  p4X2;   d  M  X4_M     snn$ s  snnf )NIdentifiers	Operation)r:   r    popitems)r+   r"   
input_keyskvs        r   discovery_operation_kwargs1EndpointDiscoveryModel.discovery_operation_kwargsI   s`    22
zz-((JJ{D)JJ}d+!'C1?CCCs   
A2(A2c                 :    U R                  UR                  U5      $ r(   )_gather_idsr6   r+   	operationparamss      r   gather_identifiers)EndpointDiscoveryModel.gather_identifiersQ   s    	 5 5v>>r   Nc                    Uc  0 nUR                   R                  5        H[  u  pEUR                  R                  S5      (       a  X$   X4'   M-  UR                  S:X  d  M?  XB;   d  MF  U R                  XRU   U5        M]     U$ )Nendpointdiscoveryid	structure)r8   rE   metadatar    	type_namerL   )r+   shaperO   idsmember_namemember_shapes         r   rL   "EndpointDiscoveryModel._gather_idsT   sz     ;C).)<)<)>%K$$(()>??#)#6 &&+5+:O  k/BCH *? 
r   r)   r(   )r   r   r   r   r-   r   r3   r:   r?   rI   rP   rL   r   r   r   r   r%   r%   /   sD    , 4 4  D?r   r%   c                   b    \ rS rSr SS jrS rS rS rS rS r	S	 r
S
 rS rS rS rS rSrg)EndpointDiscoveryManagerc   Nc                     Uc  0 nX l         0 U l        Uc  [        R                  nX0l        X@l        [
        R                  " U5      U l        [        UR                  R                  5      U l        g r(   )_cache_failed_attemptstime_time_always_discoverweakrefproxy_clientr%   metar,   _model)r+   clientcachecurrent_timealways_discovers        r   r-   !EndpointDiscoveryManager.__init__d   s]     =E "99L!
 / }}V,,V[[-F-FGr   c                 x    US   nU R                  5       nU H  nUR                  S5      nX5S-  -   US'   M      U$ )N	EndpointsCachePeriodInMinutes<   
Expiration)rc   r    )r+   response	endpointsrl   endpoint
cache_times         r   _parse_endpoints)EndpointDiscoveryManager._parse_endpointsu   sI    [)	zz|!H!&<=J%1O%CH\" " r   c                 t    [        U[        5      (       a"  [        [        UR	                  5       5      5      $ U$ r(   )
isinstancedicttuplesortedrE   )r+   values     r   _cache_item$EndpointDiscoveryManager._cache_item}   s*    eT"".//Lr   c                    ^  T R                   R                  " S0 UD6n[        U 4S j[        UR	                  5       5       5       5      $ )Nc              3   H   >#    U H  u  pTR                  U5      v   M     g 7fr(   )r   ).0rG   rH   r+   s      r   	<genexpr>=EndpointDiscoveryManager._create_cache_key.<locals>.<genexpr>   s#     L5KTQT%%a((5Ks   "r   )ri   rI   r}   r~   rE   )r+   r"   s   ` r   _create_cache_key*EndpointDiscoveryManager._create_cache_key   s6    77A&ALVFLLN5KLLLr   c                 8    U R                   R                  X5      $ r(   )ri   rP   rM   s      r   rP   +EndpointDiscoveryManager.gather_identifiers   s    {{--i@@r   c                 b    U R                   " S0 UD6nX R                  ;   a  U R                  U	 g g )Nr   )r   r`   )r+   r"   	cache_keys      r   delete_endpoints)EndpointDiscoveryManager.delete_endpoints   s0    **4V4	#I& $r   c                     U R                   R                  " S0 UD6nU R                   R                  n[        U R                  U5      n[
        R                  SU5        U" S0 UD6$ )Nz%Discovering endpoints with kwargs: %sr   )ri   rI   r3   getattrrg   loggerdebug)r+   r"   r>   r2   s       r   _describe_endpoints,EndpointDiscoveryManager._describe_endpoints   sX     77A&A==%dllNC<fE",V,,r   c                     XR                   ;  a  g U R                  5       nU R                   U    Vs/ sH  o2US   :  d  M  UPM     sn$ s  snf )Nrs   )r`   rc   )r+   keynowes       r   _get_current_endpoints/EndpointDiscoveryManager._get_current_endpoints   sF    kk!jjl;;s+E+aQ|_/D+EEEs   A
A
c                 2   U R                   " S0 UD6n U R                  " S0 UD6nU R                  U5      nX@R                  U'   U R                  R                  US 5        U$ ! [        [        4 a#    U R                  5       S-   U R                  U'    g f = f)Nrr   r   )	r   r   rx   r`   ra   rD   r   r   rc   )r+   r"   r   rt   ru   s        r   _refresh_current_endpoints3EndpointDiscoveryManager._refresh_current_endpoints   s    **4V4		//9&9H--h7I%.KK	"!!%%i61 	/3zz|b/@D!!),	s   AA# #0BBc                     XR                   ;   a0  U R                  5       nX R                   U   :  a  gU R                   U	 g)NTF)ra   rc   )r+   r   r   s      r   _recently_failed)EndpointDiscoveryManager._recently_failed   s>    ---**,C**955%%i0r   c                     US   S   $ )Nr   Addressr   )r+   ru   s     r   _select_endpoint)EndpointDiscoveryManager._select_endpoint   s    |I&&r   c                    US   nU R                   R                  U5      nU R                  (       d   U(       d  [        R	                  SU 35        g U R
                  " S0 UD6nU R                  U5      nU(       a  U R                  U5      $ U R                  U5      nU(       d*  U R                  " S0 UD6nU(       a  U R                  U5      $ [        R	                  SU5        U R                  R                  US 5      nU(       a  U R                  U5      $ U(       a;  U(       a*  U R                  " S0 UD6nU(       a  U R                  U5      $ [        5       eg )NrC   z?Optional discovery disabled. Skipping discovery for Operation: z%Endpoint Discovery has failed for: %sr   )ri   r?   rd   r   r   r   r   r   r   r   r`   r    r   )r+   r"   rN   discovery_requiredr   ru   recently_failedstale_entriess           r   describe_endpoint*EndpointDiscoveryManager.describe_endpoint   s/   ;'	![[??	J$$-?LLQR[Q\]  **4V4	//	:	((33//	:77A&AI,,Y77<fE	48((77  ;;EfE	00;;022r   )rd   r`   rg   ra   ri   rc   )NNT)r   r   r   r   r-   rx   r   r   rP   r   r   r   r   r   r   r   r   r   r   r   r]   r]   c   sE    EIH"MA'
-F
'(r   r]   c                   2    \ rS rSrS rS rS rS rS rSr	g)	EndpointDiscoveryHandler   c                     Xl         g r(   _manager)r+   managers     r   r-   !EndpointDiscoveryHandler.__init__   s    r   c                     UR                  SU 3U R                  5        UR                  SU 3U R                  5        UR                  SU 3U R                  5        g )Nzbefore-parameter-build.zrequest-created.zneeds-retry.)registerrP   register_firstdiscover_endpointhandle_retries)r+   events
service_ids      r   r   !EndpointDiscoveryHandler.register   s_    %j\2D4K4K	
 	zl+T-C-C	
 	,zl3T5H5HIr   c                 h    UR                   nUc  g U R                  R                  X!5      nSU0US'   g )Nidentifiers	discovery)r   r   rP   )r+   rO   r!   contextr"   r   rX   s          r   rP   +EndpointDiscoveryHandler.gather_identifiers   s:    "55%mm..u= -s3r   c                 4   UR                   R                  S0 5      R                  S5      nUc  g U R                  R                  X$S9nUc  [        R                  S5        g UR                  S5      (       d  SU-   n[        R                  SU5        XQl        g )Nr   r   rC   rB   z&Failed to discover and inject endpointhttpzhttps://z!Injecting discovered endpoint: %s)r   r    r   r   r   r   
startswithurl)r+   requestr>   r"   rX   rv   s         r   r   *EndpointDiscoveryHandler.discover_endpoint   s    oo!!+r266}E;==22$ 3 
 LLAB""6**!H,H8(Cr   c                 h   Uc  g Uu  pRUR                  S0 5      R                  S5      nUR                  S0 5      R                  S5      nUS:w  a  US:w  a  g UR                  S0 5      nUR                  S0 5      R                  S	5      n	U	c  g U R                  R                  UR                  U	S
9  g)NResponseMetadataHTTPStatusCodeErrorCodei  InvalidEndpointExceptionr   r   r   r   r   )r    r   r   r1   )
r+   request_dictrt   rN   r"   _status
error_coder   rX   s
             r   r   'EndpointDiscoveryHandler.handle_retries  s    0"599:JK\\'2.226:
S=Z+EE""9b1kk+r*..}=;
 	&&nn# 	' 	
 r   r   N)
r   r   r   r   r-   r   rP   r   r   r   r   r   r   r   r      s     J4r   r   )loggingrb   re   botocorer   botocore.exceptionsr   r   r   botocore.modelr   botocore.utilsr   	getLoggerr   r   r
   r   r   r#   r%   r]   r   r   r   r   <module>r      s        O O 1 )			8	$	 	N : NI%? I*1 1hz zz9 9r   