o
    ~j@c9                     @   s  d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZmZmZ d dlmZmZ d dlmZmZmZmZ d d	lmZ d d
lmZ d dlmZmZ d dlm Z  d dl!m"Z" d dl#m$Z$m%Z% d dl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ d dl0m1Z1 d dlm2Z2 d dlmZ d dlm3Z3 e 4e5Z6e Z7G dd dZ8G dd dZ9G dd dZ:G dd dZ;dd Z<dS )    N)waiter
xform_name)ClientArgsCreator)AUTH_TYPE_MAPS)prepare_request_dict)EndpointDiscoveryHandlerEndpointDiscoveryManager,block_endpoint_discovery_required_operations)ClientMethodDocstringPaginatorDocstring)DataNotFoundError*InvalidEndpointDiscoveryConfigurationErrorOperationNotPageableErrorUnknownSignatureVersionError)get_global_history_recorder)first_non_none_response)apply_request_checksumresolve_checksum_context)ServiceModel)	Paginator)adaptivestandard)	CachedPropertyEventbridgeSignerSetterS3ArnParamHandlerS3ControlArnParamHandlerS3ControlEndpointSetterS3EndpointSetterS3RegionRedirectorensure_booleanget_service_module_name)Config)ClientError)UNSIGNEDc                   @   s   e Zd ZdZ			d4ddZ								d5ddZd6dd	Zd
d Zdd Zd6ddZ	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 ZdS )7ClientCreatorz%Creates client objects for a service.Nc
           
      C   s:   || _ || _|| _|| _|| _|| _|| _|| _|	| _d S N)	_loader_endpoint_resolver_user_agent_event_emitter_retry_handler_factory_retry_config_translator_response_parser_factory_exceptions_factory_config_store)
selfloaderendpoint_resolver
user_agentevent_emitterZretry_handler_factoryZretry_config_translatorZresponse_parser_factoryexceptions_factoryconfig_store r6   3usr/lib/python3.10/site-packages/botocore/client.py__init__G   s   
zClientCreator.__init__Tc                 C   s   | j jd|d}t||d}| ||}| ||}| ||	\}}	t| j||	|j	d| j
d}| ||||||||	||

}|di |}| | | ||| | ||||	| | ||||	| | |||	 |S )Nzchoose-service-nameservice_namedefaultZsigningName)service_signing_namer5   r6   )r)   emitr   _load_service_model_create_client_class_normalize_fips_regionClientEndpointBridger'   metadatagetr.   _get_client_args_register_retries_register_eventbridge_events_register_s3_events_register_s3_control_events_register_endpoint_discovery)r/   r:   region_name	is_secureendpoint_urlverifycredentialsscoped_configapi_versionclient_config
auth_token	responsesservice_modelclsendpoint_bridgeZclient_argsZservice_clientr6   r6   r7   create_clienta   sf   

zClientCreator.create_clientc                 C   s   |  ||}| ||S r%   )r?   r@   )r/   r:   rQ   rU   r6   r6   r7   create_client_class   s   z!ClientCreator.create_client_classc           	      C   sb   |  |}| |}||d< tg}|j }| jjd| ||d t|}tt	|t
||}|S )N_PY_TO_OP_NAMEzcreating-client-class.%s)class_attributesZbase_classes)_create_methods_create_name_mapping
BaseClient
service_id	hyphenizer)   r>   r    typestrtuple)	r/   r:   rU   r[   Zpy_name_to_operation_namebasesr_   
class_namerV   r6   r6   r7   r@      s   


z"ClientCreator._create_client_classc                 C   s`   |d ur,| dd dd}||kr,tdd}|r||}n|}td||f  |}||fS )Nzfips- z-fipsT)use_fips_endpointztransforming region from %s to %s and setting use_fips_endpoint to true. client should not be configured with a fips psuedo region.)replacer!   mergeloggerwarning)r/   rK   rR   Znormalized_region_nameZconfig_use_fips_endpointr6   r6   r7   rA      s$   
z$ClientCreator._normalize_fips_regionc                 C   s"   | j j|d|d}t||d}|S )Nz	service-2)rQ   r9   )r&   load_service_modelr   )r/   r:   rQ   Z
json_modelrU   r6   r6   r7   r?      s
   z!ClientCreator._load_service_modelc                 C   s^   |j jjd }|dkr| | d S |dkr"| | | | d S |dkr-| | d S d S )Nmoder   r   legacy)metaconfigretries_register_v2_standard_retries_register_v2_adaptive_retries_register_legacy_retries)r/   client
retry_moder6   r6   r7   rF      s   
zClientCreator._register_retriesc                 C   s<   |j jjd}d|i}|d ur||d< tjdi | d S )Ntotal_max_attemptsru   max_attemptsr6   )ro   rp   rq   rD   r   register_retry_handler)r/   ru   rx   kwargsr6   r6   r7   rr      s
   z+ClientCreator._register_v2_standard_retriesc                 C   s   t | d S r%   )r   ry   )r/   ru   r6   r6   r7   rs      s   z+ClientCreator._register_v2_adaptive_retriesc           
      C   s   |j jj}|j jj}| }| jd}|sd S | |j jj	}| j
||di |di |}td|j jj | j||}d| }	|j jjd| ||	d d S )NZ_retryretrydefinitionsz*Registering retry handlers for service: %szretry-config-%szneeds-retry.)	unique_id)ro   rU   endpoint_prefixr_   r`   r&   Z	load_data_transform_legacy_retriesrp   rq   r+   Zbuild_retry_configrD   rj   debugr:   r*   Zcreate_retry_handlereventsregister)
r/   ru   r~   r_   Zservice_event_nameZoriginal_configrq   Zretry_confighandlerr}   r6   r6   r7   rt      s0   




z&ClientCreator._register_legacy_retriesc                 C   s:   |d u rd S |  }d|v r|  }|dd |d< |S )Nrw      rx   )copypop)r/   rq   Zcopied_argsr6   r6   r7   r     s   z'ClientCreator._transform_legacy_retriesc                 C   s6   |j jj}|d ur|dd ur|d S |dpdS )Nrm   rv   rn   )ro   rp   rq   rD   get_config_variable)r/   ru   r5   Zclient_retriesr6   r6   r7   _get_retry_mode  s
   
zClientCreator._get_retry_modec           
      C   s   |d urd S |j jjd u rd S |j j}|j jj }d}|r'|jd ur'|j}n	| jr0| jd}| 	|}|rS| 
||rS|du }t||d}t|}	|	|| d S |dt d S )NFendpoint_discovery_enabledT)Zalways_discoverzbefore-parameter-build)ro   rU   Zendpoint_discovery_operationr   r_   r`   r   r.   r   $_normalize_endpoint_discovery_config_requires_endpoint_discoveryr   r   r   r	   )
r/   ru   rM   rp   r   r_   enableddiscovermanagerr   r6   r6   r7   rJ     s2   
z*ClientCreator._register_endpoint_discoveryc                 C   sL   t |tr|  }|dkr|S |dv rt|S nt |tr!|S t|d)z?Config must either be a boolean-string or string-literal 'auto'auto)truefalse)Zconfig_value)
isinstancerb   lowerstripr   boolr   )r/   r   r6   r6   r7   r   :  s   


z2ClientCreator._normalize_endpoint_discovery_configc                 C   s   |dkr	|j jjS |S )Nr   )ro   rU   Zendpoint_discovery_required)r/   ru   r   r6   r6   r7   r   G  s   
z*ClientCreator._requires_endpoint_discoveryc                 C   s4   |j jjdkr	d S t| j|j j|d|j j d S )Nr   )r1   regionrM   )ro   rU   r:   r   r'   rK   r   r   )r/   ru   rW   rM   r6   r6   r7   rG   L  s   z*ClientCreator._register_eventbridge_eventsc                 C   s|   |j jjdkr	d S t||  t |j j |j jj}t	| j
|j j|j jj||j j|d|j j | |j || d S )Ns3r1   r   Z	s3_configrM   	partitionrg   )ro   rU   r:   r   r   r   r   rp   rg   r   r'   rK   r   r   !_set_s3_presign_signature_versionr/   ru   rW   rM   rR   rP   rg   r6   r6   r7   rH   W  s"   
z!ClientCreator._register_s3_eventsc                 C   s^   |j jjdkr	d S |j jj}t |j j t| j	|j j
|j jj||j j|d|j j d S )NZ	s3controlr   )ro   rU   r:   rp   rg   r   r   r   r   r'   rK   r   r   r   r6   r6   r7   rI   p  s   
z)ClientCreator._register_s3_control_eventsc                 C   sx   t d||}|d urd S | jd|j}|jdkr |j|vr d S | jd|j}|d }d|vr2d S |jd| j d S )Nr   z
aws-globalsignatureVersionszchoose-signer.s3)	!_get_configured_signature_versionr'   Zget_available_endpointsr   rK   construct_endpointr   r   _default_s3_presign_to_sigv2)r/   Zclient_metarR   rP   Zprovided_signature_versionZregionsendpointZsignature_versionsr6   r6   r7   r     s(   

z/ClientCreator._set_s3_presign_signature_versionc                 K   s$   dD ]}| |rd|   S qdS )a  
        Returns the 's3' (sigv2) signer if presigning an s3 request. This is
        intended to be used to set the default signature version for the signer
        to sigv2.

        :type signature_version: str
        :param signature_version: The current client signature version.

        :type signing_name: str
        :param signing_name: The signing name of the service.

        :return: 's3' if the request is an s3 presign request, None otherwise
        )z-queryz-presign-postr   N)endswith)r/   signature_versionrz   suffixr6   r6   r7   r     s
   
z*ClientCreator._default_s3_presign_to_sigv2c                 C   s<   t | j| j| j| j| j| jd}||||||||||	|

S )N)r5   )r   r)   r(   r,   r&   r-   r.   Zget_client_args)r/   rU   rK   rL   rM   rN   rO   rP   rR   rW   rS   Zargs_creatorr6   r6   r7   rE     s(   zClientCreator._get_client_argsc                 C   s.   i }|j D ]}t|}| |||||< q|S r%   )operation_namesr   _create_api_method)r/   rU   Zop_dictoperation_namepy_operation_namer6   r6   r7   r\     s   

zClientCreator._create_methodsc                 C   s$   i }|j D ]
}t|}|||< q|S r%   )r   r   )r/   rU   mappingr   r   r6   r6   r7   r]     s
   

z"ClientCreator._create_name_mappingc                    sH    fdd}t |_| }t| | j|jd dd}||_|S )Nc                    s   |r	t  d|  |S )Nz"() only accepts keyword arguments.)	TypeError_make_api_call)r/   argsrz   r   r   r6   r7   	_api_call  s
   z3ClientCreator._create_api_method.<locals>._api_callzresponse = client.%sF)operation_modelmethod_namer3   Zmethod_descriptionZexample_prefixinclude_signature)rb   __name__r   r
   r)   documentation__doc__)r/   r   r   rU   r   r   	docstringr6   r   r7   r     s   

z ClientCreator._create_api_method)NNN)TNNNNNNNr%   )r   
__module____qualname__r   r8   rX   rY   r@   rA   r?   rF   rr   rs   rt   r   r   rJ   r   r   rG   rH   rI   r   r   rE   r\   r]   r   r6   r6   r6   r7   r$   D   sJ    



A

	+"		r$   c                   @   s   e Zd ZdZdZddgZ					d!ddZ	d"d	d
Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  ZdS )#rB   a  Bridges endpoint data and client creation

    This class handles taking out the relevant arguments from the endpoint
    resolver and determining which values to use, taking into account any
    client configuration options and scope configuration options.

    This class also handles determining what, if any, region to use if no
    explicit region setting is provided. For example, Amazon S3 client will
    utilize "us-east-1" by default if no region can be resolved.z {service}.{region}.amazonaws.comr   z
s3-controlNc                 C   s.   || _ || _|| _|| _|p| j| _|| _d S r%   )r=   r1   rP   rR   DEFAULT_ENDPOINTdefault_endpointr5   )r/   r1   rP   rR   r   r=   r5   r6   r6   r7   r8   "  s   	
zClientEndpointBridge.__init__Tc                 C   st   |  ||}| |}| d}| jj||||d}|s'| jj||d||d}|r2| |||||S | ||||S )Nrg   )use_dualstack_endpointrg   Zaws)Zpartition_namer   rg   )_check_default_region_resolve_use_dualstack_endpoint$_resolve_endpoint_variant_config_varr1   r   _create_endpoint_assume_endpoint)r/   r:   rK   rM   rL   r   rg   resolvedr6   r6   r7   resolve2  s8   	
zClientEndpointBridge.resolvec                 C   s.   |d ur|S | j r| j jd ur| j jS d S d S r%   )rR   rK   )r/   r:   rK   r6   r6   r7   r   Y  s
   z*ClientEndpointBridge._check_default_regionc              	   C   s   |  |||\}}|d u rH|d}|d}ttjdd}	|	s=|d ur=||kr=tjd| d| d| dtd	 |}| |||d
g }| 	||}
| 
||}| j|||||||
dS )NsslCommonNamehostnameZBOTO_DISABLE_COMMONNAMEFzThe z2 client is currently using a deprecated endpoint: z2. In the next minor version this will be moved to zD. See https://github.com/boto/botocore/issues/2705 for more details.)categoryZ	protocols)r:   rK   signing_regionsigning_namerM   rC   r   )_pick_region_valuesrD   r   osenvironwarningswarnFutureWarning	_make_url_resolve_signature_version_resolve_signing_name_create_result)r/   r   r:   rK   rM   rL   r   r   r   Zis_disabledr   r   r6   r6   r7   r   `  sL   

z%ClientEndpointBridge._create_endpointc                 C   s@   | j }d}|rt||d urt||S | jd ur| j|}|S )NF)rR   getattrr5   r   )r/   Z
config_varrR   Z
config_valr6   r6   r7   r     s   

z9ClientEndpointBridge._resolve_endpoint_variant_config_varc                 C   s    |  |}|d ur|S | dS )Nr   )_is_s3_dualstack_moder   )r/   r:   Zs3_dualstack_moder6   r6   r7   r     s   
z4ClientEndpointBridge._resolve_use_dualstack_endpointc                 C   sl   || j vrd S | j}|d ur|jd urd|jv r|jd S | jd ur2| jdi d}|dv r4dS d S d S )Nr   r   )TTruer   T)_DUALSTACK_CUSTOMIZED_SERVICESrR   r   rP   rD   )r/   r:   rR   r   r6   r6   r7   r     s   




z*ClientEndpointBridge._is_s3_dualstack_modec              	   C   s~   |d u r| j j||d}| ||ddg}td| d| d|  | |ddgi}| j|i d	}| j||||||i d
S )N)servicer   httphttpszAssuming an endpoint for z, z: r   v4)r   )r:   rK   r   r   r   rM   rC   )r   formatr   rj   r   r   r   r   )r/   r:   rK   rM   rL   r   r   r   r6   r6   r7   r     s.   

z%ClientEndpointBridge._assume_endpointc                 C   s   |||||||dS )N)r:   rK   r   r   rM   r   rC   r6   )r/   r:   rK   r   r   rM   r   rC   r6   r6   r7   r     s   z#ClientEndpointBridge._create_resultc                 C   s$   |r	d|v r	d}nd}| d| S )Nr   r   z://r6   )r/   r   rL   Zsupported_protocolsschemer6   r6   r7   r     s   zClientEndpointBridge._make_urlc                 C   s0   d|v rd|d v r|d d S | j r| j S |S )NcredentialScoper   )r=   )r/   r:   r   r6   r6   r7   r     s   z*ClientEndpointBridge._resolve_signing_namec                 C   s@   |}|d u r|d }|}d|v rd|d v r|d d }||fS )NZendpointNamer   r   r6   )r/   r   rK   rM   r   r6   r6   r7   r     s   z(ClientEndpointBridge._pick_region_valuesc                 C   sn   t || j| j}|d ur|S d|v r/|d }|dkrdS d|v r"dS |D ]
}|tv r.|  S q$t|dd)Nr   r   Zs3v4r   )r   )r   rR   rP   r   r   rD   )r/   r:   r   Zconfigured_versionZpotential_versionsZknownr6   r6   r7   r     s$   
z/ClientEndpointBridge._resolve_signature_version)NNNNN)NNT)r   r   r   r   r   r   r8   r   r   r   r   r   r   r   r   r   r   r   r   r6   r6   r6   r7   rB     s.    


'+rB   c                   @   s   e Zd Zi Zdd Zdd Zdd Zdd Zed	d
 Z	dd Z
dd Z	d"ddZdd Zdd Zdd Zdd Zdd Zedd Zedd Zd d! ZdS )#r^   c                 C   s\   || _ || _|| _|| _i | _|| _|| _t|| j|j|| j	|	| _
|
| _d | _|   d S r%   )_serializer	_endpointZ_response_parser_request_signer_cacher&   _client_config
ClientMetahostrZ   ro   r-   _exceptions_register_handlers)r/   Z
serializerr   Zresponse_parserr3   request_signerrU   r0   rR   r   r4   r6   r6   r7   r8   2  s$   zBaseClient.__init__c                 C   sX   | j j }d| d| }| jjj|| d\}}|d ur|S td| jj d| d)Nzgetattr..)ru   'z' object has no attribute ')	_service_modelr_   r`   ro   r   emit_until_responseAttributeError	__class__r   )r/   itemr_   Z
event_namer   event_responser6   r6   r7   __getattr__R  s   
zBaseClient.__getattr__c                 C   s   | j   dS )z'Closes underlying endpoint connections.N)r   closer/   r6   r6   r7   r   a  s   zBaseClient.closec                 C   s,   | j jj }| j jd| | jj d S )Nzrequest-created.)ro   rU   r_   r`   r   r   r   r   )r/   r_   r6   r6   r7   r   e  s   zBaseClient._register_handlersc                 C      | j jS r%   )ro   rU   r   r6   r6   r7   r   l     zBaseClient._service_modelc                 C   s*  | j |}| j j}td|||d |jrtd|| | jj	| jj
|j|jd}| j|||d}t||| | j j }| jjjdj||d||| j|d\}}	|	d ur\|	\}
}nt| | |||\}
}| jjjd	j||d|
|||d
 |
jdkr|di d}| j|}||||S )NZAPI_CALL)r   Z	operationparamszWarning: %s.%s() is deprecated)Zclient_regionrR   has_streaming_input	auth_type)contextz)before-call.{service_id}.{operation_name}r_   r   )modelr   r   r   z(after-call.{service_id}.{operation_name})Zhttp_responseparsedr   r   i,  ErrorZCode)r   r   r:   history_recorderrecordZ
deprecatedrj   r   ro   rK   rp   r   r   _convert_to_request_dictr   r_   r`   r   r   r   r   r   _make_requestr>   Zstatus_coderD   
exceptionsZ	from_code)r/   r   
api_paramsr   r:   request_contextrequest_dictr_   r   r   r   Zparsed_responseZ
error_codeZerror_classr6   r6   r7   r   p  sh   





zBaseClient._make_api_callc              
   C   sT   z| j ||W S  ty) } z| jjjdj| jj	 |j
d||d  d }~ww )Nz.after-call-error.{service_id}.{operation_name}r   )	exceptionr   )r   Zmake_request	Exceptionro   r   r>   r   r   r_   r`   name)r/   r   r  r   er6   r6   r7   r     s   
zBaseClient._make_requestNc                 C   sL   |  |||}| j||}| jjs|dd  t|| jj| jj	|d |S )NZhost_prefix)rM   r2   r   )
_emit_api_paramsr   Zserialize_to_requestr   Zinject_host_prefixr   r   r   r   r2   )r/   r   r   r   r  r6   r6   r7   r     s   z#BaseClient._convert_to_request_dictc                 C   sf   |j }| jj }| jjjd| d| |||d}t||d}| jjjd| d| |||d |S )Nzprovide-client-params.r   )r   r   r   r;   zbefore-parameter-build.)r  r   r_   r`   ro   r   r>   r   )r/   r   r   r   r   r_   rT   r6   r6   r7   r    s    zBaseClient._emit_api_paramsc           
      C   s   |  |s
t|d| j| }dd }| jd | }t|| jj| jj|dd|_t	| jj}| d| }t
|tfd|i}| j|}|t| |||}	|	S )	a  Create a paginator for an operation.

        :type operation_name: string
        :param operation_name: The operation name.  This is the same name
            as the method name on the client.  For example, if the
            method name is ``create_foo``, and you'd normally invoke the
            operation as ``client.create_foo(**kwargs)``, if the
            ``create_foo`` operation can be paginated, you can use the
            call ``client.get_paginator("create_foo")``.

        :raise OperationNotPageableError: Raised if the operation is not
            pageable.  You can use the ``client.can_paginate`` method to
            check if an operation is pageable.

        :rtype: L{botocore.paginate.Paginator}
        :return: A paginator object.

        )r   c                 [   s   t j| fi |S r%   )r   paginate)r/   rz   r6   r6   r7   r    s   z*BaseClient.get_paginator.<locals>.paginatepage_configF)Zpaginator_namer3   rU   paginator_configr   z.Paginator.r  )can_paginater   rZ   r   r   ro   r   rU   r   r    ra   r   r   r   r   )
r/   r   actual_operation_namer  r	  Zservice_module_nameZpaginator_class_nameZdocumented_paginator_clsr   Z	paginatorr6   r6   r7   get_paginator  s>   


	zBaseClient.get_paginatorc                 C   sj   d| j vr)z| j| jjd| jjd }|| j d< W n ty(   i | j d< Y nw | j| }|| j d v S )aM  Check if an operation can be paginated.

        :type operation_name: string
        :param operation_name: The operation name.  This is the same name
            as the method name on the client.  For example, if the
            method name is ``create_foo``, and you'd normally invoke the
            operation as ``client.create_foo(**kwargs)``, if the
            ``create_foo`` operation can be paginated, you can use the
            call ``client.get_paginator("create_foo")``.

        :return: ``True`` if the operation can be paginated,
            ``False`` otherwise.

        r  zpaginators-1Z
pagination)r   r&   rl   r   r:   rQ   r   rZ   )r/   r   r  r  r6   r6   r7   r
  )  s   

zBaseClient.can_paginatec                 C   sX   d| j vr'z| j| jjd| jj}|| j d< W n ty&   i | j d< Y nw | j d S )Nwaiter_configz	waiters-2)r   r&   rl   r   r:   rQ   r   )r/   r  r6   r6   r7   _get_waiter_configE  s   

zBaseClient._get_waiter_configc                 C   sd   |   }|std| t|}i }|jD ]}||t|< q||vr)td| t|| || S )aG  Returns an object that can wait for some condition.

        :type waiter_name: str
        :param waiter_name: The name of the waiter to get. See the waiters
            section of the service docs for a list of available waiters.

        :returns: The specified waiter object.
        :rtype: botocore.waiter.Waiter
        zWaiter does not exist: %s)r  
ValueErrorr   WaiterModelwaiter_namesr   Zcreate_waiter_with_client)r/   Zwaiter_namerp   r   r   r  r6   r6   r7   
get_waiterR  s   



zBaseClient.get_waiterc                 C   s*   |   }|sg S t|}dd |jD S )z(Returns a list of all available waiters.c                 S   s   g | ]}t |qS r6   )r   ).0r  r6   r6   r7   
<listcomp>s  s    z+BaseClient.waiter_names.<locals>.<listcomp>)r  r   r  r  )r/   rp   r   r6   r6   r7   r  j  s
   
zBaseClient.waiter_namesc                 C   s   | j d u r
|  | _ | j S r%   )r   _load_exceptionsr   r6   r6   r7   r   u  s   

zBaseClient.exceptionsc                 C   s   | j | jS r%   )r-   Zcreate_client_exceptionsr   r   r6   r6   r7   r  {  s   zBaseClient._load_exceptionsr%   )r   r   r   rZ   r8   r   r   r   propertyr   r   r   r   r  r  r
  r  r  r   r  r   r  r6   r6   r6   r7   r^   (  s,     
>
A


r^   c                   @   s`   e Zd ZdZdd Zedd Zedd Zedd	 Zed
d Z	edd Z
edd ZdS )r   a~  Holds additional client methods.

    This class holds additional information for clients.  It exists for
    two reasons:

        * To give advanced functionality to clients
        * To namespace additional client attributes from the operation
          names which are mapped to methods at runtime.  This avoids
          ever running into collisions with operation names.

    c                 C   s(   || _ || _|| _|| _|| _|| _d S r%   )r   r   _endpoint_urlr   _method_to_api_mapping
_partition)r/   r   rR   rM   rU   method_to_api_mappingr   r6   r6   r7   r8     s   	
zClientMeta.__init__c                 C      | j S r%   )r   r   r6   r6   r7   rU        zClientMeta.service_modelc                 C   r   r%   )r   rK   r   r6   r6   r7   rK     r   zClientMeta.region_namec                 C   r  r%   )r  r   r6   r6   r7   rM     r  zClientMeta.endpoint_urlc                 C   r  r%   )r   r   r6   r6   r7   rp     r  zClientMeta.configc                 C   r  r%   )r  r   r6   r6   r7   r    r  z ClientMeta.method_to_api_mappingc                 C   r  r%   )r  r   r6   r6   r7   r     r  zClientMeta.partitionN)r   r   r   r   r8   r  rU   rK   rM   rp   r  r   r6   r6   r6   r7   r     s    




r   c                 C   s\   |r
|j dur
|j S |dur,|| }|dur,t|tr,|d}|r,td| | |S dS )z
    Gets the manually configured signature version.

    :returns: the customer configured signature version, or None if no
        signature version was configured.
    Nr   zWSwitching signature version for service %s to version %s based on config file override.)r   rD   r   dictrj   r   )r:   rR   rP   Zservice_configversionr6   r6   r7   r     s   


r   )=loggingr   r   botocorer   r   Zbotocore.argsr   Zbotocore.authr   Zbotocore.awsrequestr   Zbotocore.discoveryr   r   r	   Zbotocore.docs.docstringr
   r   Zbotocore.exceptionsr   r   r   r   Zbotocore.historyr   Zbotocore.hooksr   Zbotocore.httpchecksumr   r   Zbotocore.modelr   Zbotocore.paginater   Zbotocore.retriesr   r   Zbotocore.utilsr   r   r   r   r   r   r   r   r    Zbotocore.configr!   r"   r#   	getLoggerr   rj   r   r$   rB   r^   r   r   r6   r6   r6   r7   <module>   sF   ,
   S    [6