
    lh;                     2   d dl mZ d dlZd dlmZmZ d dlmZmZm	Z	 d dl
mZ d dlmZmZmZmZ d dlmZ erd dlmZ d d	lmZ d d
lmZ d dlmZ 	 d dlmZ d dlmZ d dlmZ d dlmZ  G d de      Z! ee!      d        Z"d Z#d Z$y# e $ r	  e	d      w xY w)    )partialN)OPSPANDATA)_check_minimum_versionIntegrationDidNotEnable)Span)capture_internal_exceptionsensure_integration_enabled	parse_urlparse_version)TYPE_CHECKING)Any)Dict)Optional)Type)__version__)
BaseClient)StreamingBody)
AWSRequestzbotocore is not installedc                   *    e Zd ZdZde Zed        Zy)Boto3Integrationboto3z
auto.http.c                      t        t              } t        t        | d       t        j
                  fd}|t        _        y )Nbotocorec                 T    | g|i | | j                   }|j                  j                  j                         }|j                  j                  dt        t        |             |j                  j                  dt               |j                  j                  dt               y )Nzrequest-created)
service_idz
after-callzafter-call-error)
metaservice_modelr   	hyphenizeeventsregisterr   _sentry_request_created_sentry_after_call_sentry_after_call_error)selfargskwargsr   r   	orig_inits        o/var/www/pru.catia.catastroantioquia-mas.com/tasa/lib/python3.12/site-packages/sentry_sdk/integrations/boto3.pysentry_patched_initz8Boto3Integration.setup_once.<locals>.sentry_patched_init+   s    d,T,V,99D++66@@BJKK  !/JG KK  /ABKK  !35MN    )r   BOTOCORE_VERSIONr   r   r   __init__)versionr+   r)   s     @r*   
setup_oncezBoto3Integration.setup_once#   s8       01/*E''	
	O 2
r,   N)__name__
__module____qualname__
identifieroriginstaticmethodr0    r,   r*   r   r      s%    J*&F2 2r,   r   c                    d| d|}t        j                  t        j                  |t        j
                        }t               5  t        |j                  d      }|j                  d|j                         |j                  t        j                  |j                         |j                  t        j                  |j                         d d d        |j                  d|        |j                  d|       |j                  t        j                   |j"                         |j%                          ||j&                  d	<   y # 1 sw Y   wxY w)
Nzaws..opnamer5   F)sanitizezaws.request.urlzaws.service_idzaws.operation_name_sentrysdk_span)
sentry_sdk
start_spanr   HTTP_CLIENTr   r5   r
   r   urlset_datar   
HTTP_QUERYqueryHTTP_FRAGMENTfragmentset_tagHTTP_METHODmethod	__enter__context)r   requestoperation_namer(   descriptionspan
parsed_urls          r*   r#   r#   :   s     ",^<K  >>&&D 
%	& Cw{{U;
'8h)):+;+;<h,,j.A.AB	C 	LL!:.LL%~6MM(&&7 	NN *.GOO%&!C Cs   BEEc                 v  	 | j                  dd       }|y |j                  d d d        |j                  d      }t        |t              sy |j                  t        j                  |j                  t        j                        	|j                  |j                  	fd}||_        	fd}||_        y )Nr>   Bodyr:   c                  z    	  | i |}|sj                          |S # t        $ r j                           w xY wN)finish	Exception)r'   r(   ret	orig_readstreaming_spans      r*   sentry_streaming_body_readz6_sentry_after_call.<locals>.sentry_streaming_body_readm   sI    	T,V,C%%'J 	!!#	s    :c                  6    j                           | i | y rU   )rV   )r'   r(   
orig_closerZ   s     r*   sentry_streaming_body_closez7_sentry_after_call.<locals>.sentry_streaming_body_closez   s    D#F#r,   )pop__exit__get
isinstancer   start_childr   HTTP_CLIENT_STREAMrO   r   r5   readclose)
rL   parsedr(   rP   bodyr[   r^   r]   rY   rZ   s
          @@@r*   r$   r$   W   s    ;;($/D |MM$d#::fDdM*%%  && & N 		IJ	 +DI$
 -DJr,   c                 f    | j                  dd       }|y |j                  t        |      |d        y )Nr>   )r_   r`   type)rL   	exceptionr(   rP   s       r*   r%   r%      s1    ;;($/D |MM$y/9d3r,   )%	functoolsr   r?   sentry_sdk.constsr   r   sentry_sdk.integrationsr   r   r   sentry_sdk.tracingr	   sentry_sdk.utilsr
   r   r   r   typingr   r   r   r   r   r   r   r-   botocore.clientr   botocore.responser   botocore.awsrequestr   ImportErrorr   r#   r$   r%   r7   r,   r*   <module>rv      s      * U U #  !48*/.
2{ 26 ,-. ..8(-V4O  4
2
334s   B B