https://t.me/RX1948
Server : nginx/1.24.0
System : Linux ip-172-31-33-48 6.14.0-1011-aws #11~24.04.1-Ubuntu SMP Fri Aug 1 02:07:25 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
Directory :  /lib/python3/dist-packages/botocore/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/botocore/__pycache__/endpoint.cpython-312.pyc
�

P��e9@���ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZmZmZej4e�Ze
�ZdZdZd
�Z Gd�d�Z!Gd�d�Z"y)�N)�parsers)�create_request_object)�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_url�<�
c�R�|j|jd|jid�}|ddk\r|j|d<|S|jr|j
|d<|S|jr/|djd�}t|j
|�|d<|S|j|d<|S)a�Convert an HTTP response object to a request dict.

    This converts the requests library's HTTP response object to
    a dictionary.

    :type http_response: botocore.vendored.requests.model.Response
    :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)

    �operation_name)�headers�status_code�contextr�,�bodyrzcontent-length)	rr�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� -� 1� 1�
�f����
�	-�	-��y�)�-�-�.>�?�� -�m�.?�.?�� H�
�f����!.� 5� 5�
�f����c��eZdZdZ		dd�Zd�Zd�Zd�Zdd�Zd�Z	d	�Z
d
�Zd�Zdd�Z
d
�Zd�Zd�Zd�Z		dd�Zd�Zy)�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���||_||_||_tj�|_|�t
j�}||_||_	|j�t�|_	yy�N)�_endpoint_prefix�_event_emitter�host�	threading�Lock�_lockr�ResponseParserFactory�_response_parser_factory�http_sessionr	)�selfr*�endpoint_prefix�
event_emitter�response_parser_factoryr0s      r!�__init__zEndpoint.__init__Xsj��!0���+�����	��^�^�%��
�"�*�&-�&C�&C�&E�#�(?��%�(������$� .� 0�D��%r#c�:�|j�d|j�d�S)N�(�))r(r*�r1s r!�__repr__zEndpoint.__repr__ks ���'�'�(��$�)�)��A�6�6r#c�8�|jj�yr')r0�closer9s r!r<zEndpoint.closens�������!r#c�T�tjd||�|j||�S)Nz%Making request for %s with params: %s)�logger�debug�
_send_request)r1r�request_dicts   r!�make_requestzEndpoint.make_requestqs,�����3���	
�
�!�!�,��@�@r#c�`�t|�}|r�t|j|jg�|_|j
jj�}dj||j��}|jj|||j��|j|�}|S)Nz&request-created.{service_id}.{op_name})�
service_id�op_name)�requestr)
r�anyrr�
stream_output�
service_modelrD�	hyphenize�formatrr)�emit�prepare_request)r1�paramsrrFrD�
event_name�prepared_requests       r!�create_requestzEndpoint.create_requestys���'��/���$'�#�8�8�#�;�;��%�G�!�)�6�6�A�A�K�K�M�J�A�H�H�%��/C�/C�I��J�
���$�$���.�3�3�
%�
�
 �/�/��8���r#c�~�|j�D]*\}}t|t�s�|jd�||<�,y)Nzutf-8)�items�
isinstance�str�encode)r1r�key�values    r!�_encode_headerszEndpoint._encode_headers�s7��!�-�-�/�	5�J�C���%��%�$�|�|�G�4����	5r#c�X�|j|j�|j�Sr')rYr�prepare�r1rFs  r!rMzEndpoint.prepare_request�s!�����W�_�_�-���� � r#c���tjj�}tjj|d�}||z
}|tj|��z|z}|j	d�S)Nz%a, %d %b %Y %H:%M:%S %Z)�secondsz%Y%m%dT%H%M%SZ)�datetime�utcnow�strptime�	timedelta�strftime)r1�response_received_timestamp�date_header�read_timeout�local_timestamp�date_conversion�estimated_skew�ttls        r!�_calculate_ttlzEndpoint._calculate_ttl�sv��#�+�+�2�2�4��"�+�+�4�4��3�
��)�+F�F���� � ��6�
7��
�	�
�|�|�,�-�-r#c�$�|djjd�}|jd�}|r9|s6	tjj�}|j	|||�|d<yyy#t
$rtjdd��YywxYw)Nr�Date�has_streaming_inputrjz9Exception received when updating retries context with TTLT��exc_info)rrr_r`rk�	Exceptionr>r?)r1�retries_contextrf�success_response�response_date_headerrnrds       r!�_set_ttlzEndpoint._set_ttl�s���/��2�:�:�>�>�v�F��-�1�1�2G�H���(;�
�.6�.?�.?�.F�.F�.H�+�)-�)<�)<�/�(� �*���&�)<����
����O�!���
�s�4A,�, B�Bc���|jdi�}||d<d|vr ttj��|d<|r#|dj}|j|||�yy)N�retries�attemptz
invocation-id�
client_config)�
setdefaultrU�uuid�uuid4rfru)r1rrxrsrrrfs      r!�_update_retries_contextz Endpoint._update_retries_context�sd��!�,�,�Y��;��%,��	�"��/�1�/2�4�:�:�<�/@�O�O�,��"�?�3�@�@�L��M�M�/�<�9I�J�r#c��d}|d}|j||�|j||�}|j|||�\}}|j|||||�rf|dz
}|j|||�|j	�|j||�}|j|||�\}}|j|||||�r�f|�d|dvr|dz
}||ddd<|�|�|S)N�r�ResponseMetadata�
RetryAttempts)r}rQ�
_get_response�_needs_retry�reset_stream)	r1rAr�attemptsrrFrs�	exception�
total_retriess	         r!r@zEndpoint._send_request�s:�����y�)���$�$�W�h�7��%�%�l�O�D��&*�&8�&8��_�g�'
�#��)���������
�
��M�H��(�(��(�<L�M�

� � �"��)�)�,��H�G�*.�*<�*<���'�+�'��i�!��������
�(
�(�"�&6�q�&9�9�%�q�L�M��
�Q�� 2�3��
�� ��O�#�#r#c��|j|||�\}}dd||d�}|�|\}}||d<t||�|d<|jjj	�}	|j
jd|	�d|j��fi|��||fS)N)r�parsed_responserr�r�rzresponse-received.�.)�_do_get_responser"rIrDrJr)rLr)
r1rFrrrsr��kwargs_to_emitrr�rDs
          r!r�zEndpoint._get_response�s���'+�&;�&;��_�g�'
�#��)�"�#��"�	
���'�-=�*�M�?�0?�N�,�-�.F���/�N�?�+�%�2�2�=�=�G�G�I�
� ���� � � ���A�o�.B�.B�-C�D�	
��	
� ��*�*r#c	���	tjd|�tjd|j|j
|j|j|jd��|jjj�}d|�d|j��}|jj||��}t|�}|�|j!|�}t'||�}	t)||	||�|	j+�}
|j,|
d
<tjd|
�|j.d}|j0j3|�}|j5|	|j6�}
|j8d
k\r|j;|	|
||�tjd|
�||
fdfS#t"$r}d|fcYd}~Sd}~wt$$r%}tjdd�	�d|fcYd}~Sd}~wwxYw)NzSending http request: %s�HTTP_REQUEST)�methodr�	streaming�urlrzbefore-send.r�)rFz-Exception received when sending HTTP request.Tror��
HTTP_RESPONSE�protocolr�PARSED_RESPONSE)r>r?�history_recorder�recordr�rrnr�rrIrDrJrr)rLr�_sendrrqr"r�copyr�metadatar/�
create_parser�parse�output_shaper�_add_modeled_error_fields)r1rFrrrDrO�	responsesr�er�http_response_record_dictr��parserr�s              r!r�zEndpoint._do_get_responses���	��L�L�3�W�=��#�#��%�n�n�&���!0�!D�!D�"�;�;�#�L�L��	
�)�6�6�A�A�K�K�M�J�'�
�|�1�_�5I�5I�4J�K�J��+�+�0�0��W�0�M�I�3�I�>�M��$� $�
�
�7� 3�
�1��?�
�
�	�����		
�%2�$6�$6�$8�!�
�0�0�	"��	
�	����1J�K�"�+�+�J�7���.�.�<�<�X�F�� �,�,��?�7�7�
���$�$��+��*�*�����	
�	��� 1�?�C���/��5�5��U�	��!�9����	��L�L�?�$�
�
��!�9���		�s0�CF+�+	G.�4F=�7G.�=G.�	G)�#G.�)G.c���|jdi�jd�}|�y|j}|j|�}|�y|j||�}|j	|�y)N�Error�Code)rrI�shape_for_error_coder��update)	r1rr�rr��
error_coderI�error_shape�
modeled_parses	         r!r�z"Endpoint._add_modeled_error_fieldsFsl��%�(�(��"�5�9�9�&�A�
����'�5�5�
�#�8�8��D��������]�K�@�
����}�-r#c	�&�|jjj�}d|�d|j��}|jj|||||||��}t
|�}	|	�ytjd|	�tj|	�y)Nzneeds-retry.r�)�response�endpoint�	operationr��caught_exceptionrAFz3Response received to retry, sleeping for %s secondsT)rIrDrJrr)rLrr>r?�time�sleep)
r1r�rrAr�r�rDrOr��handler_responses
          r!r�zEndpoint._needs_retryXs���%�2�2�=�=�G�G�I�
�#�J�<�q��1E�1E�0F�G�
��'�'�,�,����%��-�%�-�
�	�3�9�=���#��
�L�L�E� �
�
�J�J�'�(�r#c�8�|jj|�Sr')r0�sendr\s  r!r�zEndpoint._sendxs��� � �%�%�g�.�.r#)NNr')�__name__�
__module__�__qualname__�__doc__r5r:r<rBrQrYrMrkrur}r@r�r�r�r�r��r#r!r%r%Msl���!%��
1�&7�"�A� �*5�!�
.��"K�'$�R+�8=6�~.�.��
�@/r#r%c	�8�eZdZd�Zddeeeddddf	d�Zd�Zd�Z	y)�EndpointCreatorc��||_yr')r))r1r3s  r!r5zEndpointCreator.__init__}s
��+��r#Nc
	�&�t|�st|�std|z��|	�|j|�}	|j}
t
j
d|
|�|||	|j|�||
||��}t||
|j||��S)NzInvalid endpoint: %szSetting %s timeout as %s)�timeout�proxies�verify�max_pool_connections�socket_options�client_cert�proxies_config)r2r3r4r0)
rr
�
ValueError�_get_proxiesr2r>r?�_get_verify_valuer%r))r1rI�region_name�endpoint_urlr�r4r�r��http_session_clsr�r�r�r�r2r0s               r!�create_endpointzEndpointCreator.create_endpoint�s���%��
�,�\�:��3�l�B�C�C��?��'�'��5�G�'�7�7�����/��'�J�'����)�)�&�1�!5�)�#�)�
����+��-�-�$;�%�
�	
r#c��t|�Sr')r)r1r�s  r!r�zEndpointCreator._get_proxies�s��#�3�'�'r#c�J�|�|Stjjdd�S)N�REQUESTS_CA_BUNDLET)�os�environr)r1r�s  r!r�z!EndpointCreator._get_verify_value�s'�����M��z�z�~�~�2�D�9�9r#)
r�r�r�r5�DEFAULT_TIMEOUT�MAX_POOL_CONNECTIONSr	r�r�r�r�r#r!r�r�|s4��,�� $��1�'�����)
�V(�
:r#r�)#r_�loggingr�r+r�r{�botocorer�botocore.awsrequestr�botocore.exceptionsr�botocore.historyr�botocore.hooksr�botocore.httpchecksumr�botocore.httpsessionr	�botocore.responser
�botocore.utilsrrr
�	getLoggerr�r>r�r�r�r"r%r�r�r#r!�<module>r�s�����	�����5�/�8�2�6�/�+���
��	�	�8�	$��.�0������ �Fl/�l/�^	?:�?:r#

https://t.me/RX1948 - 2025