B ݁['@sfdZddlZddlZddlZddlZddlmZddlm Z ddl m Z e e ZGdddeZdS)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_factoryrN/Users/kashii/Desktop/Projects/Workshops/worker-safety/lambda/botocore/args.py__init__!s zClientArgsCreator.__init__c  CsB|||| ||||} | d} | d} | d} | d}| d}| d}| ddd}| d }| d }| d }|dkr|dkr|| | \}}||d <t|j}t|j|| d | d ||}||d<tf|}t|}|j ||| d||j |j |j |j |jf||jd }tj|| }tj|}|||||||j|||jd S)N service_nameparameter_validationendpoint_configprotocol config_kwargs s3_configmetadata partitionsocket_optionssigning_region region_name signing_namesignature_versions3 endpoint_url) rr"verifyrmax_pool_connectionsproxiestimeoutr client_cert) serializerendpointresponse_parserr request_signer service_modelr client_configrr)compute_client_argsget_get_default_s3_regioncopyrr service_idrrZcreate_endpointrr$r%connect_timeout read_timeoutr'botocore serializeZcreate_serializerparsersZ 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$|js$d} n |rD|d} | dk rD|| } |||||} |j} |dk r|jdk rr|j} |jdk r| d|j7} t | d| d| d}|dk r|j |j |j |j |j|j|jd |||}|| | | | ||||d S) NrTFrz %srr )rr r )r3r4r$r%retriesr')rrr rrrrr)endpoint_prefixrrr/_ensure_booleanresolverr user_agent_extradictupdater3r4r$r%r=r'compute_s3_config_compute_socket_options)r r,r-r;rr"r8r:rrrZ raw_valuerr rrrrrr.fsN        z%ClientArgsCreator.compute_client_argscCsd}|dk rJ|d}t|ts0td|d}|rJdddg}|||}|dk r|jdk r|dkrl|j}n|}||j|S)Nr!zEThe s3 config key is not a dictionary type, ignoring its value of: %suse_accelerate_endpointuse_dualstack_endpointpayload_signing_enabled) r/ isinstancerBloggerdebug_convert_config_to_boolr!r1rC)r r:r-Zs3_configurationZ boolean_keysrrrrDs(    z#ClientArgsCreator.compute_s3_configcs>|fdd|D}x|D]}|||<q WS)Ncsg|]}|kr|qSrr).0k) config_copyrr sz=ClientArgsCreator._convert_config_to_bool..)r1r?)r Z config_dictkeysZ present_keyskeyr)rOrrLs  z)ClientArgsCreator._convert_config_to_boolcCs&|dkr"|d}|d|dfSdS)Nr!rr)NN)r@)r rr;r)rrrr0s z(ClientArgsCreator._get_default_s3_regioncCs>tjtjdfg}|r:||ddr:|tjtjdf|S)NZ tcp_keepaliveF)socket IPPROTO_TCP TCP_NODELAYr?r/append SOL_SOCKET SO_KEEPALIVE)r r:rrrrrEs z)ClientArgsCreator._compute_socket_optionscCst|tr|S|dkSdS)Ntrue)rIboollower)r valrrrr?s z!ClientArgsCreator._ensure_booleanN) __name__ __module__ __qualname__rr<r.rDrLr0rEr?rrrrr s=5(   r)__doc__r1loggingrTZbotocore.serializer5Zbotocore.signersrbotocore.configrZbotocore.endpointr getLoggerr^rJobjectrrrrrs