+
    icA                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHtHtHt ]P8                  ! ]4      t]! 4       t^<t ^
t!R t" ! R R4      t# ! R R4      t$R# )    N)parsers)create_request_object)get_current_datetime)HTTPClientError)get_global_history_recorder)first_non_none_response)handle_checksum_body)URLLib3Session)StreamingBody)get_environ_proxiesis_valid_endpoint_urlis_valid_ipv6_endpoint_urlc                   RV P                   RV P                  RRVP                  //pVR,          R8  d   V P                  VR&   V# VP                  '       d   V P
                  VR&   V# VP                  '       d4   VR,          P                  R4      p\        V P
                  V4      VR&   V# V P                  VR&   V# )a  Convert an HTTP response object to a request dict.

This converts the HTTP response object to a dictionary.

:type http_response: botocore.awsrequest.AWSResponse
:param http_response: The HTTP response from an AWS service request.

:rtype: dict
:return: A response dictionary which will contain the following keys:
    * headers (dict)
    * status_code (int)
    * body (string or file-like object)

headersstatus_codecontextoperation_name,  bodyzcontent-length)	r   r   namecontenthas_event_stream_outputrawhas_streaming_outputgetr   )http_responseoperation_modelresponse_dictlengths   &&  3/usr/lib/python3/dist-packages/botocore/endpoint.pyconvert_to_response_dictr!   +   s      	=((}00o22
M ]#s* - 5 5f  
	0	0	0 - 1 1f  
	-	-	-y)--.>? -m.?.? Hf  !. 5 5f    c                      a  ] tR t^Mt o RtRR ltR tR tR tRR lt	R t
R	 tR
 tR tRR ltR tR tR tR tRR ltR tRtV tR# )Endpointa  
Represents an endpoint for a particular service in a specific
region.  Only an endpoint can make requests.

:ivar service: The Service object that describes this endpoints
    service.
:ivar host: The fully qualified endpoint hostname.
:ivar session: The session object.
Nc                    W n         W0n        Wn        \        P                  ! 4       V n        Vf   \        P                  ! 4       pW@n        WPn	        V P                  f   \        4       V n	        R # R # N)_endpoint_prefix_event_emitterhost	threadingLock_lockr   ResponseParserFactory_response_parser_factoryhttp_sessionr
   )selfr)   endpoint_prefixevent_emitterresponse_parser_factoryr/   s   &&&&&&r    __init__Endpoint.__init__X   s`     !0+	^^%
"*&-&C&C&E#(?%($ . 0D %r"   c                :    V P                    R V P                   R2# )())r'   r)   r0   s   &r    __repr__Endpoint.__repr__k   s     ''($))A66r"   c                :    V P                   P                  4        R # r&   )r/   closer9   s   &r    r=   Endpoint.closen   s    !r"   c                R    \         P                  R VV4       V P                  W!4      # )z%Making request for %s with params: %s)loggerdebug_send_request)r0   r   request_dicts   &&&r    make_requestEndpoint.make_requestq   s*    3	

 !!,@@r"   c                V   \        V4      pV'       d   \        VP                  VP                  .4      Vn        VP
                  P                  P                  4       pR V RVP                   2pV P                  P                  VVVP                  R7       V P                  V4      pV# )zrequest-created..)requestr   )r   anyr   r   stream_outputservice_model
service_id	hyphenizer   r(   emitprepare_request)r0   paramsr   rH   rL   
event_nameprepared_requests   &&&    r    create_requestEndpoint.create_requesty   s    '/$'#88#;;%G! )66AAKKMJ+J<q9M9M8NOJ$$.33 % 
  //8r"   c                    VP                  4        F0  w  r#\        V\        4      '       g   K  VP                  R 4      W&   K2  	  R# )zutf-8N)items
isinstancestrencode)r0   r   keyvalues   &&  r    _encode_headersEndpoint._encode_headers   s1    !--/JC%%%$||G4 *r"   c                X    V P                  VP                  4       VP                  4       # r&   )r\   r   preparer0   rH   s   &&r    rO   Endpoint.prepare_request   s!    W__-  r"   c                    \        4       p\        P                  P                  VR 4      pWQ,
          pV\        P                  ! VR7      ,           V,           pVP	                  R4      # )z%a, %d %b %Y %H:%M:%S %Z)secondsz%Y%m%dT%H%M%SZ)r   datetimestrptime	timedeltastrftime)r0   response_received_timestampdate_headerread_timeoutlocal_timestampdate_conversionestimated_skewttls   &&&&    r    _calculate_ttlEndpoint._calculate_ttl   sg     /0"++443
 )F  67 	
 ||,--r"   c                (   V^ ,          P                   P                  R4      pVP                  R4      pV'       d.   V'       g$    \        4       pV P                  VVV4      VR&   R# R# R#   \         d    \
        P                  RRR7        R# i ; i)r   Datehas_streaming_inputrn   z9Exception received when updating retries context with TTLTexc_infoN)r   r   r   ro   	Exceptionr@   rA   )r0   retries_contextrj   success_responseresponse_date_headerrs   rh   s   &&&&   r    _set_ttlEndpoint._set_ttl   s    /2::>>vF-112GH(;.B.D+)-)<)</( *& )<  O!  s    A+ +"BBc                    VP                  R / 4      pW$R&   RV9  d"   \        \        P                  ! 4       4      VR&   V'       d(   VR,          P                  pV P                  WEV4       R# R# )retriesattemptzinvocation-idclient_configN)
setdefaultrX   uuiduuid4rj   rz   )r0   r   r~   rx   rw   rj   s   &&&&  r    _update_retries_context Endpoint._update_retries_context   s`    !,,Y;%,	"/1/24::</@OO,"?3@@LMM/9IJ r"   c                   ^pVR,          pV P                  WC4       V P                  W4      pV P                  WRV4      w  rgV P                  VVVVV4      '       dS   V^,          pV P                  WCV4       VP	                  4        V P                  W4      pV P                  WRV4      w  rgKm  Ve+   RV^,          9   d   V^,
          pVV^,          R,          R&   Ve   VhV# )   r   ResponseMetadataRetryAttempts)r   rS   _get_response_needs_retryreset_stream)	r0   rC   r   attemptsr   rH   rx   	exceptiontotal_retriess	   &&&      r    rB   Endpoint._send_request   s   y)$$W7%%lD&*&8&8g'
# 
 
 MH((<LM
   ")),HG*.*<*<'+'i ("&6q&99 %qLM Q 23OD  O##r"   c                   V P                  WV4      w  rER RRRRVRV/pVe   Vw  rxWR&   \        Wr4      VR &   VP                  P                  P	                  4       p	V P
                  P                  ! RV	 RVP                   23/ VB  WE3# )r   Nparsed_responser   r   zresponse-received.rG   )_do_get_responser!   rK   rL   rM   r(   rN   r   )
r0   rH   r   r   rx   r   kwargs_to_emitr   r   rL   s
   &&&&      r    r   Endpoint._get_response   s     '+&;&;g'
# Ttw	
 '-=*M0?,-.F/N?+ %22==GGI
   Ao.B.B-CD	
	
  **r"   c                    \         P                  R V4       \        P                  RRVP                  RVP
                  RVP                  RVP                  RVP                  /4       VP                  P                  P                  4       pRV RVP                   2pV P                  P                  WQR	7      p\        V4      pVf   V P!                  V4      p\'        Yr4      p	\)        TT	TT4       T	P+                  4       p
TP,                  T
R&   \        P                  RT
4       TP                  P.                  p/ pT P                  P                  RT RTP                   2TT	TR7       T P0                  P3                  T4      pTP5                  YP6                  4      pTP9                  T4       TP:                  R8  d   T P=                  T	TTT4       \        P                  RT4       Y~3R
3#   \"         d   pR
T3u R
p?# R
p?i\$         d&   p\         P                  RRR7       R
T3u R
p?# R
p?ii ; i)zSending http request: %sHTTP_REQUESTmethodr   	streamingurlr   zbefore-send.rG   )rH   Nz-Exception received when sending HTTP request.Trt   HTTP_RESPONSEzbefore-parse.)r   r   customized_response_dictr   PARSED_RESPONSE)r@   rA   history_recorderrecordr   r   rs   r   r   rK   rL   rM   r   r(   rN   r   _sendr   rv   r!   r	   copyr   resolved_protocolr.   create_parserparseoutput_shapeupdater   _add_modeled_error_fields)r0   rH   r   r   rL   rQ   	responsesr   er   http_response_record_dictprotocolr   parserr   s   &&&&           r    r   Endpoint._do_get_response  sF   	LL3W=##gnnw!D!D7;;GLL	 )66AAKKMJ'
|1_5I5I4JKJ++000MI3I>M$ $

7 3 1
 			
 %2$6$6$8!00 	"+. 	1JK"00BB#%   J<q)=)=(>?+'%=	 	! 	
 ..<<XF ,,77
 	78 $$+**	 	 1?C/55e  	!9 	LL?$   !9		s6   CG8 8H?HH?H?H?H:4H?:H?c                    VP                  R / 4      P                  R4      pVf   R# VP                  pVP                  V4      pVf   R# VP                  W4      pVP	                  V4       R# )ErrorCodeN)r   rK   shape_for_error_coder   r   )	r0   r   r   r   r   
error_coderK   error_shapemodeled_parses	   &&&&&    r    r   "Endpoint._add_modeled_error_fieldsL  sj     %(("599&A
'55#88D]@}-r"   c           
     0   VP                   P                  P                  4       pR V RVP                   2pV P                  P                  VVV VVVVR7      p\        V4      p	V	f   R# \        P                  RV	4       \        P                  ! V	4       R# )zneeds-retry.rG   )responseendpoint	operationr   caught_exceptionrC   Fz3Response received to retry, sleeping for %s secondsT)rK   rL   rM   r   r(   rN   r   r@   rA   timesleep)
r0   r   r   rC   r   r   rL   rQ   r   handler_responses
   &&&&&&    r    r   Endpoint._needs_retry^  s     %22==GGI
#J<q1E1E0FG
'',,%-% - 
	 39=# LLE  JJ'(r"   c                8    V P                   P                  V4      # r&   )r/   sendr`   s   &&r    r   Endpoint._send~  s      %%g..r"   )r'   r(   r,   r.   r)   r/   )NNr&   )__name__
__module____qualname____firstlineno____doc__r4   r:   r=   rD   rS   r\   rO   ro   rz   r   rB   r   r   r   r   r   __static_attributes____classdictcell____classdict__s   @r    r$   r$   M   se     1&7"A &5!."K'$R+8E6N.$@/ /r"   r$   c            	       N   a  ] tR tRt o R tRR]]]RRRR3	R ltR t	R t
RtV tR# )EndpointCreatori  c                    Wn         R # r&   r(   )r0   r2   s   &&r    r4   EndpointCreator.__init__  s    +r"   Nc           
     @   \        V4      '       g    \        V4      '       g   \        R V 24      hV	f   V P                  V4      p	VP                  p\
        P                  RW4       V! VV	V P                  V4      VV
VVR7      p\        VVV P                  VVR7      # )zInvalid endpoint: zSetting %s timeout as %s)timeoutproxiesverifymax_pool_connectionssocket_optionsclient_certproxies_config)r1   r2   r3   r/   )
r   r   
ValueError_get_proxiesr1   r@   rA   _get_verify_valuer$   r(   )r0   rK   region_nameendpoint_urlr   r3   r   r   http_session_clsr   r   r   r   r1   r/   s   &&&&&&&&&&&&&  r    create_endpointEndpointCreator.create_endpoint  s     %
 
,\::1,@AA?''5G'77/J'))&1!5)#)
 +--$;%
 	
r"   c                    \        V4      # r&   )r   )r0   r   s   &&r    r   EndpointCreator._get_proxies  s     #3''r"   c                N    Ve   V# \         P                  P                  RR4      # )NREQUESTS_CA_BUNDLET)osenvironr   )r0   r   s   &&r    r   !EndpointCreator._get_verify_value  s'     M zz~~2D99r"   r   )r   r   r   r   r4   DEFAULT_TIMEOUTMAX_POOL_CONNECTIONSr
   r   r   r   r   r   r   s   @r    r   r     s<     ,  $1')
V(
: :r"   r   )%rd   loggingr   r*   r   r   botocorer   botocore.awsrequestr   botocore.compatr   botocore.exceptionsr   botocore.historyr   botocore.hooksr   botocore.httpchecksumr	   botocore.httpsessionr
   botocore.responser   botocore.utilsr   r   r   	getLoggerr   r@   r   r   r   r!   r$   r    r"   r    <module>r      s      	     5 0 / 8 2 6 / +  
		8	$.0  Dr/ r/j	?: ?:r"   