U!\ci@sdZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z m Z mZmZmZmZmZmZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lm Z ddl!m"Z"m#Z#ddl!m$Z$ddl!m%Z%ddl&m'Z'ddl&m(Z(ddl&m)Z)ddl&Z&ddl*Z&ej+e,Z-e.Z/e.Z0ej1dZ2ej1dZ3idd6Z4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ<d Z=d!Z>d"Z?d#Z@d$ZAd%ZBd&ZCd'd(ZDd)ZEd*ZFd+ZGd,ZHd-ZId.ZJd/e.fd0YZKd1ZLd2ZMd3ZNd4ZOd5ZPd6ZQd7ZRd8ZSd9ZTd:ZUd;ZVd<ZWd=ZXd>ZYd?ZZd@Z[dAZ\dBZ]dCZ^dDZ_dEZ`dFZadGZbdHZcdIZddJZedKZfdLZgdMZhdNZidOe.fdPYZjdQe.fdRYZkdSe.fdTYZldUZmdVe5fdWekdXfdYehe0fdZehe0fd[efd\efd]ebfd^eTfd_e9fd`e<fdaeVfdbe:fdceAfddedfdeedfdfe=fdge=fdhe=fdie=fdje=fdke=fdle@fdme@fdne@fdoe@fdpe@fdqe@fdre@fdse@fdte@fdue@fdve=fdwe=fdxe=fdyeMfdzeMfdyeYfdZeYfd{eYfd|eLfd}eLfd~eJfde\fde]fde^fde^fdeRfdeafde6e/fde6e/fde6e/fdeFfdeIfdeIfdeIfdeIfdeIfdeIfde8fdeBfdeBfdZeBfdyeBfdyeCfd{eBfdYeBfdzeBfdzeCfdeWfdeWfdeZfde[fdeefdeffdecfdeddjnfdedjnfdedjnfde_fde`fdeXdfdeXdfdedjnfdedjnfdedjnfdedjnfdeXdfdedddddddddddddddg jofdefdeSfdeSfdeSfdeSfdedjnfdedjnfdedjnfdedjnfdeSfdeSfdedjnfdedjnfdeldjpfdeKdjqfdemfghZreierdS(s_Builtin event handlers. This module contains builtin handlers for events emitted by botocore. iN( tunquotetjsontsixt unquote_strt ensure_bytestget_md5t MD5_AVAILABLEt OrderedDictturlsplitt urlunsplit(tAutoPopulatedParam(tHideParamFromOperations(tAppendParamDocumentation(tadd_generate_presigned_url(tadd_generate_presigned_post(tadd_generate_db_auth_token(tParamValidationError(tAliasConflictParameterError(tUnsupportedTLSVersionWarning(tMissingServiceIdError(tpercent_encodet SAFE_CHARS(tswitch_host_with_param(thyphenize_service_id(t retryhandler(tutils(t translates^[a-zA-Z0-9.\-_]{1,255}$s\?versionId=[^\s]+$ssagemaker-runtimesruntime.sagemakercKstj||S(N(tSERVICE_NAME_ALIASEStget(t service_nametkwargs((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pythandle_service_name_aliasCscKsH|dkrdS|\}}t|rDtjd|d|_ndS(NsWError found for response with 200 status code, errors: %s, changing status code to 500.i(tNonet_looks_like_special_case_errortloggertdebugt status_code(tresponseRt http_responsetparsed((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytcheck_for_200_errorGs    cCso|jdkrktjjjdtjjjdd}|j|j|j}|j dkrkt Snt S(Nittargettencodingsutf-8tError( R$txmltetreet cElementTreet XMLParsert TreeBuildertfeedtcontenttclosettagtTruetFalse(R&tparsertroot((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyR!cs  cKsw|jd}|sdS|dkr,tjS|jdrsd}|dkrVd}n|dkrot|dst(ttellRtitertupdatetseekRl(Rptstart_positionRntchunk((Rps5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyRfs    cKstrt||ndS(s1Only add a Content-MD5 if the system supports it.N(RRk(RVRBtrequest_signerR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytconditionally_calculate_md5scKsXd|krdS|d}tj|dkrTd|tjf}td|ndS(NtBuckets?Invalid bucket name "%s": Bucket name must match the regex "%s"treport(t VALID_BUCKETtsearchR tpatternR(RVRtbuckett error_msg((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytvalidate_bucket_names  cKst|ddS(s 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. t SSECustomerN(t_sse_md5(RVR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytsse_md5scKst|ddS(s1 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. tCopySourceSSECustomerN(R(RVR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytcopy_source_sse_md5sRcCst||sdS|d}|d}||}t|tjrU|jd}ntjt|jj d}tj|j d}|||<||| %s(RR(t input_shapeRRRRXtsplitR"R#(RVRWRRRXRRt orig_value((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytfix_route53_idsVs    cKs&|jddkr"d|dtj|}n|j}d|krrtj|dt|d`_. 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')) tchecksum(R R(tdoc((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyt#document_glacier_tree_hash_checksums cKsd|krD|jd}|jd}|j|jdnSd|kr|jd}|jd}|jd}|j|jdndS( Nsresponse-paramsR\s param-types (*dict*) --sresponse-examplesstructure-values member-values{}(RRR(RRRttemplate_body_sectionRRRR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyt0document_cloudformation_get_template_return_types    cKst|ddS(NtPredictEndpoint(R(trequestR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pytswitch_host_machinelearningscKsWddl}y3|j}|dkr>tjd|jtnWntk rRnXdS(NiiisCurrently 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.(iii(tssltOPENSSL_VERSION_INFOtwarningstwarntOPENSSL_VERSIONRRO(RR3topenssl_version_tuple((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyt&check_openssl_supports_tls_version_1_2s    cKs\|jdkrXd|jkrXd|jd(RR(R@RDR'RBRttop_keyt child_keyR((s5/tmp/pip-install-usGedi/botocore/botocore/handlers.pyRHs   cKsyd|krut|dtjrBtjt|d|ds       F        !                                1 $