HEX
Server: Apache
System: Linux vps35971 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
User: haitiopendh (6209306)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/botocore/__pycache__/args.cpython-310.pyc
o

<&�a!B�@s�dZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
e�e�ZddgZgd�ZGd	d
�d
e�ZdS)z�Internal module to help with normalizing botocore client args.

This module (and all function/classes within this module) should be
considered internal, and *not* a public API.

�N)�
RequestSigner)�Config)�EndpointCreator�legacy�regional)zap-northeast-1z
ap-south-1zap-southeast-1zap-southeast-2�
aws-globalzca-central-1zeu-central-1z
eu-north-1z	eu-west-1z	eu-west-2z	eu-west-3z	sa-east-1�	us-east-1z	us-east-2z	us-west-1z	us-west-2c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'S)(�ClientArgsCreatorcCs(||_||_||_||_||_||_dS�N)�_event_emitter�_user_agent�_response_parser_factory�_loader�_exceptions_factory�
_config_store)�self�
event_emitter�
user_agent�response_parser_factory�loader�exceptions_factory�config_store�r�//usr/lib/python3/dist-packages/botocore/args.py�__init__;s
zClientArgsCreator.__init__c

Cs"|�|||	||||�}
|
d}|
d}|
d}
|
d}|
d}|
d}|
d�dd�}|
d	}|
d
}|
d}t�|j�}t|j||
d|
d
||�}||d<tdi|��}t|�}|j|||
d||j	|j
|j|j|j
f||j|jd�}tj�||�}tj�|�}|||||||j|||jd�
S)N�service_name�parameter_validation�endpoint_config�protocol�
config_kwargs�	s3_config�metadata�	partition�socket_options�signing_region�region_name�signing_name�signature_version�s3�endpoint_url)
r%r)�verifyr�max_pool_connections�proxies�timeoutr#�client_cert�proxies_config)
�
serializer�endpoint�response_parserr�request_signer�
service_modelr�
client_configr"rr)�compute_client_args�get�copyrr�
service_idrr�create_endpointr
r+r,�connect_timeout�read_timeoutr.r/�botocore�	serialize�create_serializer�parsers�
create_parserrr)rr4r%�	is_securer)r*�credentials�
scoped_configr5�endpoint_bridge�
final_argsrrrrrr r"r#r$�endpoint_region_namer�signer�
new_config�endpoint_creatorr1r0r2rrr�get_client_argsDsd��
���z!ClientArgsCreator.get_client_argsc
Cst|j}|jd}	d}
|r|jsd}
n|r#|�d�}|dur#tj�|�}
|j}|dur>|jdur2|j}|j	dur>|d|j	7}|�
|�}
|j||||||
d�}|d�dg�}t|d	|d
|d�}d|vrk|j
dd
�d|vru|j
dd�|dur�|j
|j|j|j|j|j|j|j|jd�|�|�|�
|�}
|dv}|r�d|vr�|
dur�i}
d|
d<||
|||	||
|�|�d�S)NrTFrz %s)rr%r)rBrEr r!�tagsr%r')r%r'r�	dualstack)�use_dualstack_endpoint�fips)�use_fips_endpoint)r;r<r+r,r/�retriesr.�inject_host_prefix)r(z
s3-controlrN)rrrrrrr r#)�endpoint_prefixr!rr7r=�utils�ensure_booleanrr�user_agent_extra�compute_s3_config�_compute_endpoint_config�dict�updater;r<r+r,r/rQr.rR�_compute_retry_config�_compute_socket_options)rr4r5rEr%r)rBrDrrr�	raw_valuerr r�endpoint_variant_tagsr�
is_s3_servicerrrr6~sz





���


�z%ClientArgsCreator.compute_client_argscCsH|j�d�}|dur"|jdur"|dur|j}|S|��}|�|j�|S)Nr()r�get_config_variabler(r8rZ)rr5�s3_configurationrrrrW�s
	�z#ClientArgsCreator.compute_s3_configcCsT|||||d�}|dkr|jdd|i|��S|dkr"|jdi|��S|jdi|��S)N)rr%r)rBrEr(r �stsr)�_compute_s3_endpoint_config�_compute_sts_endpoint_config�_resolve_endpoint)rrr%r)rBrEr �resolve_endpoint_kwargsrrrrX�s���z*ClientArgsCreator._compute_endpoint_configcKsX|�|d|�}|rd|d<|jdi|��}|�||d�|r*|ddkr*d|d<|S)Nr%rErrr)�_should_force_s3_globalre�!_set_region_if_custom_s3_endpoint)rr rf�force_s3_globalrrrrrc�s��z-ClientArgsCreator._compute_s3_endpoint_configcCs2d}|rd|vr|d}|�|�|dko|dvS)Nr�us_east_1_regional_endpoint)rN)�_validate_s3_regional_config)rr%r �s3_regional_configrrrrg�s
�z)ClientArgsCreator._should_force_s3_globalcCs|tvrtjj|d��dS)N)�%s3_us_east_1_regional_endpoint_config)�VALID_REGIONAL_ENDPOINTS_CONFIGr=�
exceptions�+InvalidS3UsEast1RegionalEndpointConfigError)r�
config_valrrrrks��z.ClientArgsCreator._validate_s3_regional_configcCsF|ddur|ddur!|�d�}|d|d<|d|d<dSdSdS)Nr$r%r(��resolve)rrrEr1rrrrh
s
�z3ClientArgsCreator._set_region_if_custom_s3_endpointcKs:|jdi|��}|�|d|d|�r|�||d�|S)Nr%r)rBr)re�_should_set_global_sts_endpoint�_set_global_sts_endpoint)rrfrrrrrds��z.ClientArgsCreator._compute_sts_endpoint_configcCs.|d�d�}|s|r
dS|��dko|tvS)Nr!rLFr)r7�"_get_sts_regional_endpoints_config�LEGACY_GLOBAL_STS_REGIONS)rr%r)rr^rrrrt#s�z1ClientArgsCreator._should_set_global_sts_endpointcCs.|j�d�}|s
d}|tvrtjj|d��|S)N�sts_regional_endpointsr)�sts_regional_endpoints_config)rr`rnr=ro�&InvalidSTSRegionalEndpointsConfigError)rryrrrrv-s���z4ClientArgsCreator._get_sts_regional_endpoints_configcCs$|rdnd}d||d<d|d<dS)N�https�httpz%s://sts.amazonaws.comr)rr$r)rrrB�schemerrrru8sz*ClientArgsCreator._set_global_sts_endpointcCs|�||||�Sr
rr)rrr%r)rBrErrrre=s�z#ClientArgsCreator._resolve_endpointcCs>tjtjdfg}|r|�|�dd��r|�tjtjdf�|S)N��
tcp_keepaliveF)�socket�IPPROTO_TCP�TCP_NODELAY�_ensure_booleanr7�append�
SOL_SOCKET�SO_KEEPALIVE)rrDr#rrrr\Bs�z)ClientArgsCreator._compute_socket_optionscCs|�|�|�|�dSr
)�_compute_retry_max_attempts�_compute_retry_mode)rrrrrr[Ms
z'ClientArgsCreator._compute_retry_configcCs�|�d�}|dur&d|vr|�dd�dSd|vr&|�d�}|d|d<dS|j�d�}|dur@|dur:i}||d<||d<dSdS)NrQ�total_max_attempts�max_attemptsr~)r7�poprr`)rrrQ�valuer�rrrr�Qs 


�z-ClientArgsCreator._compute_retry_max_attemptscCsP|�d�}|duri}||d<nd|vrdS|j�d�}|dur"d}||d<dS)NrQ�mode�
retry_moder)r7rr`)rrrQr�rrrr�qs

z%ClientArgsCreator._compute_retry_modecCst|t�r|S|��dkS)N�true)�
isinstance�bool�lower)r�valrrrr�s
z!ClientArgsCreator._ensure_booleanN)�__name__�
__module__�__qualname__rrKr6rWrXrcrgrkrhrdrtrvrurer\r[r�r�r�rrrrr	:s(	:J

 r	)�__doc__r8�loggingr��botocore.exceptionsr=�botocore.serialize�botocore.utils�botocore.signersr�botocore.configr�botocore.endpointr�	getLoggerr��loggerrnrw�objectr	rrrr�<module>s 
�