+
     Ii  c                   s    ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
 ^ RIHtHt ^ RIHtHtHt ^ RIHt ] P&                  ! ]4      t ! R	 R
]4      tR tR# )    N)IOBase)ProtocolError)ReadTimeoutError)ScalarTypesparsers)XMLParseErrorset_socket_timeout)IncompleteReadErrorr   ResponseStreamingError)first_non_none_responsec                   s   a  ] tR t^'t o RtRtR tR tR tR t	RR lt
R	 tR
 tR tR tR tR t]t]R3R lt]3R ltR tR tR tRtV tR# )StreamingBodyaI  Wrapper class for an http response body.

This provides a few additional conveniences that do not exist
in the urllib3 model:

    * Set the timeout on the socket (i.e read() timeouts)
    * Auto validation of content length, if the amount of bytes
      we read does not match the content length, an exception
      is raised.

i   c                s,    Wn         W n        ^ V n        R# )r    N)_raw_stream_content_length_amount_read)selfZ
raw_streamZcontent_lengths   &&&6/usr/lib/python3.14/site-packages/botocore/response.py__init__ZStreamingBody.__init__6   s    %-    c                s    R # N r      &r   __del__ZStreamingBody.__del__;   s     	r   c                s~     \        V P                  V4       R#   \         d    \        P	                  R4       h i ; i)z&Set the timeout seconds on the socket.zaCannot access the socket object of a streaming response. It's possible the interface has changed.N)r   r   AttributeErrorloggerZ	exception)r   Ztimeouts   &&r   r   Z StreamingBody.set_socket_timeoutA   s>    	t//9 	; 	s    "<c                s\     V P                   P                  4       #   \         d     R # i ; i)F)r   readabler   r   r   r   r   ZStreamingBody.readableV   s.    	##,,.. 		s    ++Nc                sP    V P                   P                  V4      pT ;P                  \        T4      ,          un        Te   T'       g   T^ 8  d   T P                  4        T#   \         d   p\        TP                  TR7      hRp?i\
         d   p\        TR7      hRp?ii ; i)zXRead at most amt bytes from the stream.

If the amt argument is omitted, read all data.
Zendpoint_urlerrorNr   )
r   readURLLib3ReadTimeoutErrorr   urlURLLib3ProtocolErrorr	   r   len_verify_content_length)r   Zamtchunke   &&  r   r   ZStreamingBody.read\   s    
	2$$))#.E 	SZ';uq '') ' 	@"Q??# 	2(q11	2s)   A$ $B%/BB%B%B  B%c                sF    V P                   P                  V4      pT ;P                  T,          un        T^ 8X  d!   \        T4      ^ 8  d   T P                  4        T#   \         d   p\        TP                  TR7      hRp?i\
         d   p\        TR7      hRp?ii ; i)zcRead bytes into a pre-allocated, writable bytes-like object b, and return the number of bytes read.r   Nr   )
r   readintor   r   r    r!   r	   r   r"   r#   )r   ZbZamount_readr%   r&   r   r'   ZStreamingBody.readintop   s    	2**33A6K 	[(!A
 '') ' 	@"Q??# 	2(q11	2s)   A B *BB B BB c                6    V P                   P                  4       # r   )r   	readlinesr   r   r   r)   ZStreamingBody.readlines   s    ))++r   c                s8    V P                  V P                  4      # )z:Return an iterator to yield 1k chunks from the raw stream.)iter_chunks_DEFAULT_CHUNK_SIZEr   r   r   __iter__ZStreamingBody.__iter__   s     8 899r   c                s`    V P                  V P                  4      pV'       d   V# \        4       h)z-Return the next 1k chunk from the raw stream.)r   r+   ZStopIteration)r   current_chunks   & r   __next__ZStreamingBody.__next__   s'    		$":":;  or   c                s    V P                   # r   )r   r   r   r   	__enter__ZStreamingBody.__enter__   s    r   c                s:    V P                   P                  4        R # r   r   close)r   ZtypeZvalueZ	tracebacks   &&&&r   __exit__ZStreamingBody.__exit__   s     r   Fc              #  s  "   RpV P                  V4       FI  pW4,           P                  R4      pVRR  F  pVP                  V4      ^ ,          x  K  	  VR,          pKK  	  V'       d   VP                  V4      ^ ,          x  R# R# 5i)zReturn an iterator to yield lines from the raw stream.

This is achieved by reading chunk of bytes (of size chunk_size) at a
time from the raw stream, and then yielding lines from there.
r   TNi)r*   Z
splitlines)r   
chunk_sizeZkeependsZpendingr$   ZlinesZlines   &&&    r   
iter_linesZStreamingBody.iter_lines   s      %%j1E_006Ecr
ooh/22 #BiG	 2
 $$X.q11 s   A(B	+B	c              #  sL   "    V P                  V4      pVR8X  d   R# Vx  K!  5i)zLReturn an iterator to yield chunks of chunk_size bytes from the raw
stream.
r   N)r   )r   r3   r-   s   && r   r*   ZStreamingBody.iter_chunks   s)       IIj1M#s   "$c                s    V P                   eQ   V P                  \        V P                   4      8w  d+   \        V P                  \        V P                   4      R7      hR # R # )N)Zactual_bytesZexpected_bytes)r   r   Zintr   r   r   r   r#   Z$StreamingBody._verify_content_length   s\     +0A0AS  F
 1
 &!.."4#7#78 1
+r   c                r(   r   )r   tellr   r   r   r5   ZStreamingBody.tell   s    $$&&r   c                s:    V P                   P                  4        R# )z*Close the underlying http response stream.Nr0   r   r   r   r1   ZStreamingBody.close   s     r   )r   r   r   r   )__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r+   r   r   r   r   r   r'   r)   r,   r.   r/   r2   Znextr4   r*   r#   r5   r1   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r   r   '   sx     
 
*( ,: ! D$7% 2 &9  
'! !r   r   c                 s   V P                   P                  pR VP                  RVP                  /pVR,          R8  d   VP                  VR&   MQV P
                  '       d1   \        VP                  VR ,          P                  R4      4      VR&   MVP                  VR&   \        P                  ! V4      pWP                  W0P                  4      3# )headersstatus_codei,  Zbodyzcontent-length)Zservice_modelZresolved_protocolr7   r8   ZcontentZhas_streaming_outputr   ZrawZgetr   Zcreate_parserZparseZoutput_shape)Zoperation_modelZhttp_responseZprotocolZresponse_dictZparsers   &&   r   get_responser9      s    ,,>>H=((}00M ]#s* - 5 5f		-	-	- -}Y7;;<LM!
f !. 5 5f""8,F,,33  r   )ZloggingZior   Zurllib3.exceptionsr   r!   r   r   Zbotocorer   r   Zbotocore.compatr   r   Zbotocore.exceptionsr   r	   Zbotocore.hooksr
   Z	getLoggerr6   r   r   r9   r   r   r   <module>r:      sP      D J 
 3			8	$Y!F Y!xr   