3 B\ (@sndZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ej eZGdddeZdS)zInternal 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)EndpointCreatorc@sLeZdZddZddZddZddZd d Zd d Zd dZ ddZ dS)ClientArgsCreatorcCs"||_||_||_||_||_dS)N)_event_emitter _user_agent_response_parser_factory_loader_exceptions_factory)self event_emitter user_agentresponse_parser_factoryloaderexceptions_factoryrg/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-install-emcbgzcf/botocore/botocore/args.py__init__"s zClientArgsCreator.__init__c  CsB|j||| ||||} | d} | d} | d} | d}| d}| d}| djdd}| d }| d }| d }|dkr|dkr|j| | \}}||d <tj|j}t|j|| d | d ||}||d<tf|}t|}|j ||| d||j |j |j |j |jf||jd }tjj|| }tjj|}|||||||j|||jd S)N service_nameparameter_validationendpoint_configprotocol config_kwargs s3_configmetadata partitionsocket_optionssigning_region region_nameZ signing_namesignature_versions3 endpoint_url) rr!verifyrmax_pool_connectionsproxiestimeoutr client_cert) serializerendpointresponse_parserr Zrequest_signer service_modelr client_configrr)compute_client_argsget_get_default_s3_regioncopyrrZ service_idrrZcreate_endpointrr#r$connect_timeout read_timeoutr&botocore serializeZcreate_serializerparsers create_parserr r )r r*r is_securer!r" credentials scoped_configr+endpoint_bridgeZ final_argsrrrrrrrrrZendpoint_region_namer ZsignerZ new_configZendpoint_creatorr(r'r)rrrget_client_args*s^      z!ClientArgsCreator.get_client_argsc Cs|j}|jd} d} |r&|j r&d} n"|rH|jd} | dk rHtjj| } |j||||} |j} |dk r|j dk rv|j } |j dk r| d|j 7} t | d| d| d}|dk r|j |j |j|j|j|j|j|jd |j||}|| | | | |||j|d S) NrTFrz %srr)rrr )r0r1r#r$retriesr&inject_host_prefix)rrr rrrrr)Zendpoint_prefixrrr-r2utilsensure_booleanresolverr Zuser_agent_extradictupdater0r1r#r$r;r&r<compute_s3_config_compute_socket_options)r r*r+r9rr!r6r8rrrZ raw_valuerr rrrrrr,gsP        z%ClientArgsCreator.compute_client_argscCsd}|dk rJ|jd}t|ts0tjd|d}|rJdddg}|j||}|dk r|jdk r|dkrl|j}n|j}|j|j|S)Nr zEThe s3 config key is not a dictionary type, ignoring its value of: %sZuse_accelerate_endpointZuse_dualstack_endpointZpayload_signing_enabled) r- isinstancer@loggerdebug_convert_config_to_boolr r/rA)r r8r+Zs3_configurationZ boolean_keysrrrrBs(    z#ClientArgsCreator.compute_s3_configcs@|jfdd|D}x |D]}tjj||<q WS)Ncsg|]}|kr|qSrr).0k) config_copyrr sz=ClientArgsCreator._convert_config_to_bool..)r/r2r=r>)r Z config_dictkeysZ present_keyskeyr)rJrrGs  z)ClientArgsCreator._convert_config_to_boolcCs&|dkr"|jd}|d|dfSdS)Nr rr)NN)r?)r rr9r(rrrr.s z(ClientArgsCreator._get_default_s3_regioncCs>tjtjdfg}|r:|j|jddr:|jtjtjdf|S)NZ tcp_keepaliveF)socket IPPROTO_TCP TCP_NODELAY_ensure_booleanr-append SOL_SOCKET SO_KEEPALIVE)r r8rrrrrCs z)ClientArgsCreator._compute_socket_optionscCst|tr|S|jdkSdS)Ntrue)rDboollower)r valrrrrRs z!ClientArgsCreator._ensure_booleanN) __name__ __module__ __qualname__rr:r,rBrGr.rCrRrrrrr!s=6(   r)__doc__r/loggingrOZbotocore.serializer2Zbotocore.utilsZbotocore.signersrZbotocore.configrZbotocore.endpointr getLoggerrZrEobjectrrrrrs