o
    .&ßaÅµ  ã                   @   s  d Z ddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
l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$ ddl%m&Z& ddl%Z%ddl'Z%ddl%m(Z( ddl%m)Z) ddlm*Z* ddlm+Z+ ddlm,Z, e -e.¡Z/e0ƒ Z1e0ƒ Z2e 3d¡Z4dZ5dZ6e 3d 7e5e6g¡¡Z8e 3d¡Z9ddiZ:dd„ Z;d d!„ Z<d"d#„ Z=d$d%„ Z>d&d'„ Z?d(d)„ Z@d*d+„ ZAd,d-„ ZBd.d/„ ZCd0d1„ ZDd2d3„ ZEd4d5„ ZFdìd7d8„ZGd9d:„ ZHd;d<„ ZId=d>„ ZJG d?d@„ d@e0ƒZKdAdB„ ZLdCdD„ ZMdEdF„ ZNdGdH„ ZOdIdJ„ ZPdKdL„ ZQdMdN„ ZRdOdP„ ZSdQdR„ ZTdSdT„ ZUdUdV„ ZVdWdX„ ZWdYdZ„ ZXd[d\„ ZYd]d^„ ZZd_d`„ Z[dadb„ Z\dcdd„ Z]dedf„ Z^dgdh„ Z_didj„ Z`dkdl„ Zadmdn„ Zbdodp„ Zcdqdr„ Zddsdt„ Zedudv„ Zfdwdx„ Zgdydz„ Zhd{d|„ Zid}d~„ ZjG dd€„ d€e0ƒZkG d�d‚„ d‚e0ƒZlG dƒd„„ d„e0ƒZmd…d†„ Znd‡dˆ„ Zog d‰e;f‘dŠeld‹ƒf‘dŒeie2f‘d�eie2f‘dŽef‘d�ef‘d�ebf‘d‘eof‘d’eTf‘d“e@f‘d”eCf‘d•eVf‘d–eAf‘d—eDf‘d˜edf‘d™edf‘dšedf‘d›eMf‘dœeMf‘d›eYf‘d�eYf‘d�eYf‘džeLf‘dŸeLf‘d eJf‘d¡e\f‘d¢e]f‘d£e#f‘d¤e#f‘d¥e<f‘d¦e<f‘d§e^f‘d¨e^f‘d©eRf‘dªeaf‘d«e=e1f‘d¬e=e1f‘d­e=e1f‘d®eIf‘d¯eIf‘d°eIf‘d±eIf‘d²eIf‘d³eIf‘d´e?f‘dµeEf‘d¶eEf‘d�eEf‘d›eEf‘d›eFf‘d�eEf‘dŒeEf‘dœeEf‘dœeFf‘d·eWf‘d¸eWf‘d¹eZf‘dºe[f‘d»eef‘d¼eff‘d½egf‘d¾ecf‘d¿edÀdÁƒjpf‘dÂedÃƒjpf‘dÄedÃƒjpf‘dÅe_ƒ f‘dÆe`f‘dÇeXdÈƒf‘dÉeXdÈƒf‘dÊedËƒjpf‘dÊedÌƒjpf‘dÍedÎƒjpf‘dÍedÏƒjpf‘dÐeXdÑƒf‘dÍedÒdÓg dÔ¢ƒjqf‘dÕef‘dÖeSf‘d×eSf‘dØeSf‘dÙeSf‘dÚeSf‘dÛedÜƒjpf‘dÝedÜƒjpf‘dÞedÜƒjpf‘dßedÜƒjpf‘dàedÜƒjpf‘dáeSf‘dâeSf‘dãedÜƒjpf‘däedÜƒjpf‘dåeSf‘dæeSf‘dçedÜƒjpf‘dèedÜƒjpf‘déeKdêƒjrf‘dëenf‘Zsejesƒ dS )íz_Builtin event handlers.

This module contains builtin handlers for events emitted by botocore.
é    N)ÚunquoteÚjsonÚsixÚunquote_strÚensure_bytesÚget_md5ÚOrderedDictÚurlsplitÚ
urlunsplitÚXMLParseErrorÚETree)ÚAutoPopulatedParam)ÚHideParamFromOperations)ÚAppendParamDocumentation)Úadd_generate_presigned_url)Úadd_generate_presigned_post)Úadd_generate_db_auth_token)ÚParamValidationError)ÚAliasConflictParameterError)ÚUnsupportedTLSVersionWarning)Úpercent_encodeÚ
SAFE_CHARS©Úswitch_host_with_param)Úconditionally_calculate_md5)Úis_global_accesspoint)Úutils)Úretryhandler)Ú	translate)ÚMD5_AVAILABLE)ÚMissingServiceIdError)Úhyphenize_service_idz^[a-zA-Z0-9.\-_]{1,255}$z]^arn:(aws).*:(s3|s3-object-lambda):[a-z\-0-9]*:[0-9]{12}:accesspoint[/:][a-zA-Z0-9\-.]{1,63}$zt^arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:][a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63}$ú|z\?versionId=[^\s]+$zruntime.sagemakerzsagemaker-runtimec                 K   s   t  | | ¡S ©N)ÚSERVICE_NAME_ALIASESÚget)Úservice_nameÚkwargs© r(   ú3/usr/lib/python3/dist-packages/botocore/handlers.pyÚhandle_service_name_aliasS   ó   r*   c                 K   sz   | d }d}d|v rd}|  dd¡}d|v rd}|  dd¡}|s"d S || d< d| d	 v r;| d	 d= t| fi |¤Ž d S d S )
NÚbodyFó   Ts   &#xD;ó   
s   &#xA;zContent-MD5Úheaders)Úreplacer   )Úparamsr'   r,   Úreplacedr(   r(   r)   Úescape_xml_payloadW   s   
ýr3   c                 K   s6   | d u rd S | \}}t |ƒrt d|¡ d|_d S d S )NzWError found for response with 200 status code, errors: %s, changing status code to 500.iô  )Ú_looks_like_special_case_errorÚloggerÚdebugÚstatus_code)Úresponser'   Úhttp_responseÚparsedr(   r(   r)   Úcheck_for_200_errorq   s   þ
ür;   c                 C   s\   | j dkr,ztjt ¡ dd�}| | j¡ | ¡ }W n
 ty$   Y dS w |jdkr,dS dS )NéÈ   úutf-8©ÚtargetÚencodingTÚErrorF)	r7   r   Ú	XMLParserÚTreeBuilderÚfeedÚcontentÚcloser   Útag)r9   ÚparserÚrootr(   r(   r)   r4   �   s   
þü
r4   c                 K   s`   |   d¡}|s	dS |dkrtjS | d¡r.d}|dkr$t| ƒr"d}nd}|dkr,d	| d
< |S dS )a(   Choose the operation-specific signer.

    Individual operations may have a different auth type than the service as a
    whole. This will most often manifest as operations that should not be
    authenticated at all, but can include other auth modes such as sigv4
    without body signing.
    Ú	auth_typeNÚnoneÚv4Ús3Ús3v4aÚs3v4zv4-unsigned-bodyFÚpayload_signing_enabled)r%   ÚbotocoreÚUNSIGNEDÚ
startswithr   )ÚcontextÚsigning_namer'   rJ   Úsignature_versionr(   r(   r)   Úset_operation_specific_signerŸ   s   

órW   c              
   K   s`   d| v r.zt  t | d ¡¡ dd¡}|| d< W d S  tttfy-   tj	ddd� Y d S w d S )NÚOutputr=   r0   zError decoding base64T©Úexc_info)
Úbase64Ú	b64decoder   ÚbÚdecodeÚ
ValueErrorÚ	TypeErrorÚAttributeErrorr5   r6   ©r:   r'   Úvaluer(   r(   r)   Údecode_console_outputÃ   s   ÿÿørd   c                 K   s>   |j D ]}|| vrtt ¡ ƒ| |< t d| | |f ¡ qd S )Nz1injecting idempotency token (%s) into param '%s'.)Úidempotent_membersÚstrÚuuidÚuuid4r5   r6   )r1   Úmodelr'   Únamer(   r(   r)   Úgenerate_idempotent_uuidÐ   s   

ÿ€ýrk   c              	   C   s<   z
t  t| ƒ¡} W | S  ttfy   tjddd� Y | S w )NzError loading quoted JSONTrY   )r   Úloadsr   r_   r`   r5   r6   )rc   r(   r(   r)   Údecode_quoted_jsondocØ   s   þþrm   c              	   K   sT   d| v r(zt j| d td�}|| d< W d S  ttfy'   tjddd� Y d S w d S )NÚTemplateBody)Úobject_pairs_hookzerror loading JSONTrY   )r   rl   r   r_   r`   r5   r6   rb   r(   r(   r)   Újson_decode_template_bodyà   s   ÿÿûrp   c                 K   sL   d| vrd S | d }t  |¡s"t |¡s$d|t jtjf }t|d�‚d S d S )NÚBucketzdInvalid bucket name "%s": Bucket name must match the regex "%s" or be an ARN matching the regex "%s"©Úreport)ÚVALID_BUCKETÚsearchÚVALID_S3_ARNÚpatternr   )r1   r'   ÚbucketÚ	error_msgr(   r(   r)   Úvalidate_bucket_nameê   s   
ÿÿÿ
ûrz   c                 K   ó   t | dƒ dS )zò
    S3 server-side encryption requires the encryption key to be sent to the
    server base64 encoded, as well as a base64-encoded MD5 hash of the
    encryption key. This handler does both if the MD5 has not been set by
    the caller.
    ÚSSECustomerN©Ú_sse_md5©r1   r'   r(   r(   r)   Ússe_md5ö   ó   r€   c                 K   r{   )a1  
    S3 server-side encryption requires the encryption key to be sent to the
    server base64 encoded, as well as a base64-encoded MD5 hash of the
    encryption key. This handler does both if the MD5 has not been set by
    the caller specifically if the parameter is for the copy-source sse-c key.
    ÚCopySourceSSECustomerNr}   r   r(   r(   r)   Úcopy_source_sse_md5   r�   rƒ   r|   c                 C   sx   t | |ƒsd S |d }|d }| | }t|tjƒr| d¡}t t|ƒ ¡ ¡ 	d¡}t |¡ 	d¡}|| |< || |< d S )NÚKeyÚKeyMD5r=   )
Ú_needs_s3_sse_customizationÚ
isinstancer   Ú	text_typeÚencoder[   Ú	b64encoder   Údigestr^   )r1   Ússe_member_prefixÚsse_key_memberÚsse_md5_memberÚkey_as_bytesÚkey_md5_strÚkey_b64_encodedr(   r(   r)   r~   
  s   


ÿÿr~   c                 C   s   |   |d ¡d uo|d | vS )Nr„   r…   ©r%   )r1   rŒ   r(   r(   r)   r†     s   
þr†   c                  K   s   t jS )zk
    This handler disables request signing by setting the signer
    name to a special sentinel value.
    )rQ   rR   )r'   r(   r(   r)   Údisable_signing!  s   r“   c                 K   sR   | j  dd¡dvrd S d|v r%|d }t|dƒr't d¡ d|d d	< d S d S d S )
NÚmethodÚ )ÚPUTÚPOSTr,   Úreadz-Adding expect 100 continue header to request.z100-continuer/   ÚExpect)Úhttpr%   Úhasattrr5   r6   )ri   r1   r'   r,   r(   r(   r)   Úadd_expect_header)  s   

úrœ   c                   @   ó   e Zd Zdd„ Zdd„ ZdS )ÚDeprecatedServiceDocumenterc                 C   ó
   || _ d S r#   )Ú_replacement_service_name)ÚselfÚreplacement_service_namer(   r(   r)   Ú__init__6  ó   
z$DeprecatedServiceDocumenter.__init__c                 K   s>   |j  ¡  | d¡ |j  | j| j¡ | d¡ |j  ¡  d S )Nz.This service client is deprecated. Please use z	 instead.)ÚstyleÚstart_importantÚwriteÚrefr    Úend_important)r¡   ÚsectionÚ
event_namer'   r(   r(   r)   Úinject_deprecation_notice9  s   

þ
z5DeprecatedServiceDocumenter.inject_deprecation_noticeN)Ú__name__Ú
__module__Ú__qualname__r£   r¬   r(   r(   r(   r)   rž   5  s    rž   c           	      K   sŽ   d|v r|   d¡}|  d¡}|  d¡}| ¡  | d¡ d S d|v rE|   d¡}|  d¡}| ¡  | d¡ |  d	¡}| ¡  | d
¡ d S d S )Nzrequest-exampleústructure-valueÚ
CopySourceúmember-valuezH'string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}zrequest-paramsú
param-typez:type CopySource: str or dictzparam-documentationaq  The name of the source bucket, key name of the source object, and optional version ID of the source object.  You can either provide this value as a string or a dictionary.  The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version.  You can also provide this value as a dictionary.  The dictionary format is recommended over the string format because it is more explicit.  The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}.  Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the ``Bucket`` key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key})©Úget_sectionÚ
clear_textr§   )	rª   r«   r'   ÚparentÚ
param_lineÚvalue_portionÚparam_sectionÚtype_sectionÚdoc_sectionr(   r(   r)   Údocument_copy_source_formD  s"   






ÿùr½   c                 K   sP   |   d¡}|du rdS t|tjƒrt|ƒ| d< dS t|tƒr&t|ƒ| d< dS dS )aH  Convert CopySource param for CopyObject/UploadPartCopy.

    This handler will deal with two cases:

        * CopySource provided as a string.  We'll make a best effort
          to URL encode the key name as required.  This will require
          parsing the bucket and version id from the CopySource value
          and only encoding the key.
        * CopySource provided as a dict.  In this case we're
          explicitly given the Bucket, Key, and VersionId so we're
          able to encode the key and ensure this value is serialized
          and correctly sent to S3.

    r±   N)r%   r‡   r   Ústring_typesÚ_quote_source_headerÚdictÚ_quote_source_header_from_dict)r1   r'   Úsourcer(   r(   r)   Úhandle_copy_source_paramg  s   

ÿrÃ   c              
   C   s–   z!| d }| d }|   d¡}t |¡rd||f }nd||f }W n ty6 } z	tdt|ƒ d�‚d }~ww t|td d	�}|d urI|d
| 7 }|S )Nrq   r„   Ú	VersionIdz%s/object/%sz%s/%szMissing required parameter: %srr   ú/©Úsafez?versionId=%s)r%   rv   ru   ÚKeyErrorr   rf   r   r   )Úsource_dictrx   ÚkeyÚ
version_idÚfinalÚer(   r(   r)   rÁ   ‚  s$   

€
ÿ€ÿrÁ   c                 C   sX   t  | ¡}|d u rt| td d�S | d | ¡ … | | ¡ d … }}t|td d�| S )NrÅ   rÆ   )ÚVERSION_ID_SUFFIXru   r   r   Ústart)rc   ÚresultÚfirstrË   r(   r(   r)   r¿   ”  s
   
"r¿   c                 C   sL   t  |¡}||d d< |d  ||¡|d< d|d< i |d< | j|||jd�S )Nr,   ÚDestinationRegionÚurlÚGETr”   r/   )Úregion_nameÚoperation_name)ÚcopyÚdeepcopyr0   Úgenerate_presigned_urlrj   )Úrequest_signerÚrequest_dictri   Úsource_regionÚdestination_regionÚrequest_dict_copyr(   r(   r)   Ú_get_cross_region_presigned_url�  s   

ÿþrß   c                 C   s   | j }| d¡}||fS )NÚSourceRegion)Ú_region_namer%   )rÚ   r1   rÝ   rÜ   r(   r(   r)   Ú1_get_presigned_url_source_and_destination_regions²  s   
râ   c                 K   sN   d| d v rd S t || d ƒ\}}t|| |||ƒ}|| d d< || d d< d S )NÚPresignedUrlr,   rÒ   ©râ   rß   ©r1   rÚ   ri   r'   ÚsrcÚdestrÓ   r(   r(   r)   Úinject_presigned_url_ec2¹  s   ÿ
ÿrè   c                 K   s\   d| d vrd S t || d ƒ\}}| d d= d| d v rd S t|| |||ƒ}|| d d< d S )Nrà   r,   ÚPreSignedUrlrä   rå   r(   r(   r)   Úinject_presigned_url_rdsÇ  s   ÿ

ÿrê   c                 K   s"   |j }|d urt| |j ƒ d S d S r#   )Úoutput_shapeÚ_decode_policy_types)r:   ri   r'   rë   r(   r(   r)   Újson_decode_policiesÝ  s   ÿrí   c                 C   s’   d}|j dkr3|j ¡ D ]&\}}|j dkr'|j|kr'|| v r't| | ƒ| |< q|| v r2t| | |ƒ q|j dkrE|j}| D ]	}t||ƒ q=d S d S )NÚpolicyDocumentTypeÚ	structureÚstringÚlist)Ú	type_nameÚmembersÚitemsrj   rm   rì   Úmember)r:   ÚshapeÚ
shape_nameÚmember_nameÚmember_shapeÚshape_memberÚitemr(   r(   r)   rì   é  s$   



ÿ€
ýrì   c                 K   sJ   |j d u rd S |j}tjt ¡ dd�}| |¡ | ¡ }|j}|| d< d S )Nr=   r>   ÚLocationConstraint)ÚrawrE   r   rB   rC   rD   rF   Útext)r:   r9   r'   Úresponse_bodyrH   rI   Úregionr(   r(   r)   Úparse_get_bucket_locationü  s   
þ
r  c                 K   sJ   d| v r#t | d tjƒr| d  d¡| d< t | d ¡ d¡| d< d S d S )NÚUserDatar=   )r‡   r   rˆ   r‰   r[   rŠ   r^   r   r(   r(   r)   Úbase64_encode_user_data  s   ÿ
ÿür  c                 C   s   d}t | |ƒ}|jS )Nzw**This value will be base64 encoded automatically. Do not base64 encode this value prior to performing the operation.**©r   Úappend_documentation)ÚparamÚdescriptionÚappendr(   r(   r)   Údocument_base64_encoding  s   
r	  c              	   K   sn   |   d¡}|rt|tƒsdS | ¡ D ]"\}}z| d¡ | d¡ W q ty4   d||f }t|d�‚w dS )aE  Verify S3 Metadata only contains ascii characters.

    From: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html

    "Amazon S3 stores user-defined metadata in lowercase. Each name, value pair
    must conform to US-ASCII when using REST and UTF-8 when using SOAP or
    browser-based uploads via POST."

    ÚMetadataNÚasciizvNon ascii characters found in S3 metadata for key "%s", value: "%s".  
S3 metadata can only contain ASCII characters. rr   )r%   r‡   rÀ   rô   r‰   ÚUnicodeEncodeErrorr   )r1   r'   ÚmetadatarÊ   rc   ry   r(   r(   r)   Úvalidate_ascii_metadata  s"   


þÿÿúür  c                 K   sp   |j }|r
t|dƒsdS dd„ |j ¡ D ƒ}|D ]}|| v r5| | }| d¡d | |< t d||| | ¡ qdS )zì
    Check for and split apart Route53 resource IDs, setting
    only the last piece. This allows the output of one operation
    (e.g. ``'foo/1234'``) to be used as input in another
    operation (e.g. it expects just ``'1234'``).
    ró   Nc                 S   s   g | ]\}}|j d v r|‘qS ))Ú
ResourceIdÚDelegationSetId)rj   )Ú.0rj   rö   r(   r(   r)   Ú
<listcomp>J  s    
ÿz#fix_route53_ids.<locals>.<listcomp>rÅ   éÿÿÿÿz%s %s -> %s)Úinput_shaper›   ró   rô   Úsplitr5   r6   )r1   ri   r'   r  ró   rj   Ú
orig_valuer(   r(   r)   Úfix_route53_ids?  s   €ür  c                 K   s   |   d¡d u rd| d< d S d S )NÚ	accountIdú-r’   r   r(   r(   r)   Úinject_account_idT  s   ûr  c                 K   s   |}| j d |d d< d S )NÚ
apiVersionr/   zx-amz-glacier-version)r  ©ri   r1   r'   rÛ   r(   r(   r)   Úadd_glacier_version]  s   ÿr  c                 K   s,   |d   dd ¡d u r|}d|d d< d S d S )Nr/   ÚAcceptzapplication/jsonr’   r  r(   r(   r)   Úadd_accept_headerc  s   þr  c                 K   sz   | }|d }|d }t |tjƒrt |¡}| ¡ }d|vr&tj|dd�|d< | |¡ d|vr6t |¡|d< | |¡ dS )zûAdd glacier checksums to the http request.

    This will add two headers to the http request:

        * x-amz-content-sha256
        * x-amz-sha256-tree-hash

    These values will only be added if they are not present
    in the HTTP request.

    r/   r,   zx-amz-content-sha256T)Úas_hexzx-amz-sha256-tree-hashN)	r‡   r   Úbinary_typeÚBytesIOÚtellr   Úcalculate_sha256ÚseekÚcalculate_tree_hash)r1   r'   rÛ   r/   r,   Ústarting_positionr(   r(   r)   Úadd_glacier_checksumsi  s   

ÿ
r(  c                  C   s   d} t d| ƒjS )Naî  
        This is a required field.

        Ideally you will want to compute this value with checksums from
        previous uploaded parts, using the algorithm described in
        `Glacier documentation <http://docs.aws.amazon.com/amazonglacier/latest/dev/checksum-calculations.html>`_.

        But if you prefer, you can also use botocore.utils.calculate_tree_hash()
        to compute it from raw file by::

            checksum = calculate_tree_hash(open('your_file.txt', 'rb'))

        Úchecksumr  )Údocr(   r(   r)   Ú#document_glacier_tree_hash_checksum‰  s   r+  c                 K   sr   d|v r|   d¡}|  d¡}| ¡  | d¡ d S d|v r7|   d¡}|  d¡}|  d¡}| ¡  | d¡ d S d S )	Nzresponse-paramsrn   r³   z(*dict*) --zresponse-exampler°   r²   z{}r´   )rª   r«   r'   Útemplate_body_sectionr»   r·   r¸   r¹   r(   r(   r)   Ú0document_cloudformation_get_template_return_typeš  s   




ûr-  c                 K   s   t | dƒ d S )NÚPredictEndpointr   ©Úrequestr'   r(   r(   r)   Úswitch_host_machinelearning¨  s   r1  c                  K   sJ   dd l }z|j}|dk rt d|j t¡ W d S W d S  ty$   Y d S w )Nr   )é   r   r2  zªCurrently installed openssl version: %s does not support TLS 1.2, which is required for use of iot-data. Please use python installed with openssl version 1.0.1 or higher.)ÚsslÚOPENSSL_VERSION_INFOÚwarningsÚwarnÚOPENSSL_VERSIONr   ra   )r'   r3  Úopenssl_version_tupler(   r(   r)   Ú&check_openssl_supports_tls_version_1_2¬  s   ý
ûÿ
ÿr9  c                 K   sF   | j dkrd| jv r!d| jd< d| _ | j dd¡\| _| _d S d S d S )NrÔ   ú?z!application/x-www-form-urlencodedzContent-Typer—   r2  )r”   rÓ   r/   r  Údatar/  r(   r(   r)   Úchange_get_to_post¾  s
   
ýr<  c                 K   s    d| vrd|d< d| d< d S d S )NÚEncodingTypeTÚencoding_type_auto_setrÓ   r(   )r1   rT   r'   r(   r(   r)   Ú"set_list_objects_encoding_type_urlÇ  s   ür?  c                 K   ó   t g d¢ddg| |d� d S )N)Ú	DelimiterÚMarkerÚ
NextMarker©ÚContentsr„   ©ÚCommonPrefixesÚPrefix©Útop_level_keysÚnested_keysr:   rT   ©Ú_decode_list_object©r:   rT   r'   r(   r(   r)   Údecode_list_objectÏ  s   	
ürO  c                 K   r@  )N)rA  rH  Ú
StartAfterrD  rF  rI  rL  rN  r(   r(   r)   Údecode_list_object_v2à  s   
ürQ  c                 K   s   t g d¢g d¢| |d� d S )N)Ú	KeyMarkerÚNextKeyMarkerrH  rA  ))ÚVersionsr„   )ÚDeleteMarkersr„   rF  rI  rL  rN  r(   r(   r)   Údecode_list_object_versionsí  s   
órV  c                 C   sz   |  d¡dkr7|  d¡r9| D ]}||v rt|| ƒ||< q|D ]\}}||v r6|| D ]
}t|| ƒ||< q+qd S d S d S )Nr=  rÓ   r>  )r%   r   )rJ  rK  r:   rT   rÊ   Útop_keyÚ	child_keyrõ   r(   r(   r)   rM    s   €€÷rM  c                 K   s`   d| v r,t | d tjƒrt t| d ƒ¡| d< d S t | d tjƒr.t | d ¡| d< d S d S d S )NÚBody)r‡   r   r¾   r"  r   r!  r   r(   r(   r)   Ú convert_body_to_file_like_object  s   ürZ  c           	      C   sr   ddddœ}|  ¡ D ],\}}| dd¡\}}t||ƒ}d| |jtf}d| d	 |jf}|  |¡ |  |¡ q
d S )
NÚFiltersÚfromTimeÚreturnFields)zec2.*.Filterzlogs.CreateExportTask.fromzcloudsearchdomain.Search.returnÚ.r2  zbefore-parameter-build.zdocs.*.z.complete-section)rô   ÚrsplitÚParameterAliasÚalias_parameter_in_callÚREGISTER_FIRSTÚ alias_parameter_in_documentationr  )	Úhandler_listÚaliasesÚoriginalÚnew_nameÚevent_portionÚoriginal_nameÚparameter_aliasÚ#parameter_build_event_handler_tupleÚdocs_event_handler_tupler(   r(   r)   Ú_add_parameter_aliases  s"   ý
ý
þ
ïrm  c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
r`  c                 C   s   || _ || _d S r#   )Ú_original_nameÚ_alias_name)r¡   ri  Ú
alias_namer(   r(   r)   r£   9  s   
zParameterAlias.__init__c                 K   s^   |j r)| j|j jv r+| j|v r-| j|v rt| j| j|jd�‚| | j¡|| j< d S d S d S d S )N)rf  ÚaliasÚ	operation)r  rn  ró   ro  r   rj   Úpop)r¡   r1   ri   r'   r(   r(   r)   ra  =  s   

ýóz&ParameterAlias.alias_parameter_in_callc                 K   s”   |  d¡r)| j|jvrd S | | j¡}| d¡}|  |¡ | d¡}|  |¡ d S |  d¡rH| d¡}| j|jvr;d S | | j¡}|  |¡ d S d S )Nzdocs.request-paramsr³   z
param-namezdocs.request-exampler°   )rS   rn  Úavailable_sectionsrµ   Ú_replace_content)r¡   r«   rª   r'   rº   Úparam_type_sectionÚparam_name_sectionr(   r(   r)   rc  M  s   





úz/ParameterAlias.alias_parameter_in_documentationc                 C   s4   |  ¡  d¡}| | j| j¡}| ¡  | |¡ d S )Nr=   )Úgetvaluer^   r0   rn  ro  r¶   r§   )r¡   rª   rE   Úupdated_contentr(   r(   r)   ru  a  s   ÿzParameterAlias._replace_contentN)r­   r®   r¯   r£   ra  rc  ru  r(   r(   r(   r)   r`  8  s
    r`  c                   @   r�   )ÚClientMethodAliasc                 C   s
   || _ dS )z  Aliases a non-extant method to an existing method.

        :param actual_name: The name of the method that actually exists on
            the client.
        N)Ú_actual)r¡   Úactual_namer(   r(   r)   r£   j  s   
zClientMethodAlias.__init__c                 K   s   t || jƒS r#   )Úgetattrr{  )r¡   Úclientr'   r(   r(   r)   Ú__call__r  r+   zClientMethodAlias.__call__N)r­   r®   r¯   r£   r  r(   r(   r(   r)   rz  i  s    rz  c                   @   s>   e Zd ZdZe dej¡Zdd„ Zdd„ Z	dd„ Z
d	d
„ ZdS )ÚHeaderToHostHoisterz@Takes a header and moves it to the front of the hoststring.
    z(?!-)[a-z\d-]{1,63}(?<!-)$c                 C   rŸ   r#   )Ú_header_name)r¡   Úheader_namer(   r(   r)   r£   |  r¤   zHeaderToHostHoister.__init__c                 K   sJ   | j |d vr	dS |d | j  }|  |¡ |d }|  ||¡}||d< dS )a  Hoist a header to the hostname.

        Hoist a header to the beginning of the hostname with a suffix "." after
        it. The original header should be removed from the header map. This
        method is intended to be used as a target for the before-call event.
        r/   NrÓ   )r�  Ú_ensure_header_is_valid_hostÚ_prepend_to_host)r¡   r1   r'   Úheader_valueÚoriginal_urlÚnew_urlr(   r(   r)   Úhoist  s   
zHeaderToHostHoister.hoistc                 C   s   | j  |¡}|stdd�‚d S )Nz`Hostnames must contain only - and alphanumeric characters, and between 1 and 63 characters long.rr   )Ú_VALID_HOSTNAMEÚmatchr   )r¡   ÚheaderrŠ  r(   r(   r)   rƒ  Ž  s   ÿÿz0HeaderToHostHoister._ensure_header_is_valid_hostc                 C   sH   t |ƒ}|j d¡}|g| }d |¡}|j||j|jdf}t|ƒ}|S )Nr^  r•   )r	   Únetlocr  ÚjoinÚschemeÚpathÚqueryr
   )r¡   rÓ   ÚprefixÚurl_componentsÚpartsÚ
new_netlocÚnew_componentsr‡  r(   r(   r)   r„  –  s   

ûz$HeaderToHostHoister._prepend_to_hostN)r­   r®   r¯   Ú__doc__ÚreÚcompileÚ
IGNORECASEr‰  r£   rˆ  rƒ  r„  r(   r(   r(   r)   r€  w  s    r€  c                 K   s   | j sd S | jj|d d< d S )Nr/   zx-amz-api-version)Úis_endpoint_discovery_operationÚservice_modelÚapi_version)ri   r1   r'   r(   r(   r)   Ú#inject_api_version_header_if_needed¦  s   r�  c                 K   s   d| v r	| d= dS dS )z>Operation requires h2 which is currently unsupported in PythonÚstart_conversationNr(   )Úclass_attributesr'   r(   r(   r)   Ú remove_lex_v2_start_conversation¬  s   
ÿr   zchoose-service-namez/getattr.mturk.list_hi_ts_for_qualification_typeÚ list_hits_for_qualification_typez$before-parameter-build.s3.UploadPartz#before-parameter-build.s3.PutObjectzcreating-client-classzcreating-client-class.s3zcreating-client-class.iot-dataz$creating-client-class.lex-runtime-v2zafter-call.iamzafter-call.ec2.GetConsoleOutputz%after-call.cloudformation.GetTemplatezafter-call.s3.GetBucketLocationzbefore-parameter-buildzbefore-parameter-build.s3z%before-parameter-build.s3.ListObjectsz'before-parameter-build.s3.ListObjectsV2z,before-parameter-build.s3.ListObjectVersionsz$before-parameter-build.s3.CopyObjectz(before-parameter-build.s3.UploadPartCopyz/before-parameter-build.s3.CreateMultipartUploadz%docs.*.s3.CopyObject.complete-sectionz)docs.*.s3.UploadPartCopy.complete-sectionzbefore-call.s3zbefore-call.glacierzbefore-call.apigatewayzbefore-call.s3.PutObjectzbefore-call.s3.UploadPartzbefore-call.s3.DeleteObjectsz.before-call.s3.PutBucketLifecycleConfigurationz!before-call.glacier.UploadArchivez'before-call.glacier.UploadMultipartPartzbefore-call.ec2.CopySnapshotz'request-created.machinelearning.Predictzneeds-retry.s3.UploadPartCopyzneeds-retry.s3.CopyObjectz&needs-retry.s3.CompleteMultipartUploadz$choose-signer.cognito-identity.GetIdz-choose-signer.cognito-identity.GetOpenIdTokenz-choose-signer.cognito-identity.UnlinkIdentityz8choose-signer.cognito-identity.GetCredentialsForIdentityz$choose-signer.sts.AssumeRoleWithSAMLz+choose-signer.sts.AssumeRoleWithWebIdentityzchoose-signerz$before-parameter-build.s3.HeadObjectz#before-parameter-build.s3.GetObjectz'before-parameter-build.ec2.RunInstancesz<before-parameter-build.autoscaling.CreateLaunchConfigurationzbefore-parameter-build.route53zbefore-parameter-build.glacierzafter-call.s3.ListObjectszafter-call.s3.ListObjectsV2z after-call.s3.ListObjectVersionsz(request-created.cloudsearchdomain.Searchz!docs.*.glacier.*.complete-sectionr  zJNote: this parameter is set to "-" bydefault if no value is not specified.z-docs.*.glacier.UploadArchive.complete-sectionr)  z3docs.*.glacier.UploadMultipartPart.complete-sectionzDdocs.request-params.glacier.CompleteMultipartUpload.complete-sectionz2docs.*.cloudformation.GetTemplate.complete-sectionz(docs.*.ec2.RunInstances.complete-sectionr  z=docs.*.autoscaling.CreateLaunchConfiguration.complete-sectionz(docs.*.ec2.CopySnapshot.complete-sectionrã   rÒ   zdocs.*.s3.*.complete-sectionÚSSECustomerKeyMD5ÚCopySourceSSECustomerKeyMD5z1docs.*.lambda.UpdateFunctionCode.complete-sectionÚZipFilerM   Ú
ContentMD5)ÚDeleteObjectsÚPutBucketAclÚPutBucketCorsÚPutBucketLifecycleÚPutBucketLoggingÚPutBucketNotificationÚPutBucketPolicyÚPutBucketReplicationÚPutBucketRequestPaymentÚPutBucketTaggingÚPutBucketVersioningÚPutBucketWebsiteÚPutObjectAclzcreating-client-class.rdsz%before-call.rds.CopyDBClusterSnapshotzbefore-call.rds.CreateDBClusterzbefore-call.rds.CopyDBSnapshotz+before-call.rds.CreateDBInstanceReadReplicaz:before-call.rds.StartDBInstanceAutomatedBackupsReplicationz1docs.*.rds.CopyDBClusterSnapshot.complete-sectionré   z+docs.*.rds.CreateDBCluster.complete-sectionz*docs.*.rds.CopyDBSnapshot.complete-sectionz7docs.*.rds.CreateDBInstanceReadReplica.complete-sectionzFdocs.*.rds.StartDBInstanceAutomatedBackupsReplication.complete-sectionz)before-call.neptune.CopyDBClusterSnapshotz#before-call.neptune.CreateDBClusterz5docs.*.neptune.CopyDBClusterSnapshot.complete-sectionz/docs.*.neptune.CreateDBCluster.complete-sectionz'before-call.docdb.CopyDBClusterSnapshotz!before-call.docdb.CreateDBClusterz3docs.*.docdb.CopyDBClusterSnapshot.complete-sectionz-docs.*.docdb.CreateDBCluster.complete-sectionzdocs.title.sms-voicezpinpoint-sms-voicezbefore-call)r|   )tr–  r[   Úloggingr×   r—  r5  rg   Úbotocore.compatr   r   r   r   r   r   r   r	   r
   r   r   Úbotocore.docs.utilsr   r   r   Úbotocore.signersr   r   r   Úbotocore.exceptionsr   r   r   Úbotocore.utilsr   r   r   r   r   rQ   r   Úbotocore.authr   r   r   r    r!   Ú	getLoggerr­   r5   Úobjectrb  ÚREGISTER_LASTr˜  rt   Ú_ACCESSPOINT_ARNÚ_OUTPOST_ARNr�  rv   rÎ   r$   r*   r3   r;   r4   rW   rd   rk   rm   rp   rz   r€   rƒ   r~   r†   r“   rœ   rž   r½   rÃ   rÁ   r¿   rß   râ   rè   rê   rí   rì   r  r  r	  r  r  r  r  r  r(  r+  r-  r1  r9  r<  r?  rO  rQ  rV  rM  rZ  rm  r`  rz  r€  r�  r   Údocument_auto_populated_paramÚ
hide_paramr¬   ÚBUILTIN_HANDLERSr(   r(   r(   r)   Ú<module>   sT  4

ÿÿ
ÿ$



#		 	 	 1/
ÿÿþÿüÿúø	÷
öõôòñðîìÿêÿèÿæÿäÿâ à!ß"ÿÞ$Ü%Û'Ù(Ø)×*Ö+Õ,Ô-Ó.Ò/Ñ0Ð1Ï2Î3Í4ÿÌ6Ê7É8È9ÿÇ;Å<Ä=Ã>Â?Á@ÀA¿B¾C½D¼E»FºG¹Hÿ¸J¶KµL´M³N²Qÿ¯Tý¬Xÿ¨Zÿ¦\ÿ¤_ÿ¡cÿ�eÿ›iÿ—kÿ•nÿ’qÿ�tÿŒwþù‰  �ü ÿ �ú ÿ �ø 
ÿ �ö ÿ �ô ÿ �ò ÿ �î ÿ �ì ÿ �ê ÿ �è ÿ �æ  ÿ �à "ÿ �Þ &ÿ �Ú (ÿ �Ø .ÿ �Ò 0ÿ �Ð 4ÿ �Ì 6ÿ �Ê <ÿ �Ä > �Â A