ee[cm@sdZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z m Z m Z mZmZmZmZddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZm Z ddlm!Z!ddl"m#Z#ddl"m$Z$ddl"m%Z%ddl"Z"ddl&Z"ej'e(Z)e*Z+e*Z,ej-dZ.ej-dZ/idd6Z0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:d Z;d!Z<d"Z=d#Z>d$Z?d%d&Z@d'ZAd(ZBd)ZCd*ZDd+ZEd,ZFd-ZGd.ZHd/ZId0ZJd1ZKd2ZLd3ZMd4ZNd5ZOd6ZPd7ZQd8ZRd9ZSd:ZTd;ZUd<ZVd=ZWd>ZXd?ZYd@ZZdAZ[dBZ\dCZ]dDZ^dEZ_dFZ`dGZadHZbdIe*fdJYZcdKe*fdLYZddMZedNe1fdOeddPfdQeae,fdReae,fdSeefdTefdUefdVefdWe]fdXeOfdYe5fdZe8fd[eQfd\e6fd]e=fd^e_fd_e9fd`e9fdae9fdbe9fdce9fdde9fdee<fdfe<fdge<fdhe<fdie<fdje<fdke<fdle<fdme<fdne<fdoeHfdpeHfdoeTfdReTfdqeTfdreGfdseGfdteFfdueWfdveXfdweYfdxeYfdyeMfdzeNfd{eNfd|eNfd}eNfd~e\fde2e+fde2e+fde2e+fdeBfdeEfdeEfdeEfdeEfdeEfdeEfde4fde>fde>fdRe>fdoe>fdoe?fdqe>fdQe>fdpe>fdpe?fdeRfdeRfdeUfdeVfde`fde^fdeddjffdedjffdedjffdeZfde[fdeSdfdeSdfdedjffdedjffdedjffdedjffdedjffdedjffdedjffdedjffdeSdfdedddddddddddddddg jgfg]ZhebehdS(s_Builtin event handlers. This module contains builtin handlers for events emitted by botocore. iN(tunquotetjsontsixt unquote_strt ensure_bytestget_md5t MD5_AVAILABLEt OrderedDict(tAutoPopulatedParam(tHideParamFromOperations(tAppendParamDocumentation(tadd_generate_presigned_url(tadd_generate_presigned_post(tadd_generate_db_auth_token(tParamValidationError(tAliasConflictParameterError(tUnsupportedTLSVersionWarning(tpercent_encodet SAFE_CHARS(tswitch_host_with_param(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-xdEqop/botocore/botocore/handlers.pythandle_service_name_aliasAscKsH|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-xdEqop/botocore/botocore/handlers.pytcheck_for_200_errorEs    cCso|jdkrktjjjdtjjjdd}|j|j|j}|j dkrkt Snt S(Nittargettencodingsutf-8tError( R txmltetreet cElementTreet XMLParsert TreeBuildertfeedtcontenttclosettagtTruetFalse(R"tparsertroot((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pyRas  cKsw|jd}|sdS|dkr,tjS|jdrsd}|dkrVd}n|dkrot|dst(ttellRtitertupdatetseekRh(Rltstart_positionRjtchunk((Rls5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pyRbs    cKstrt||ndS(s1Only add a Content-MD5 if the system supports it.N(RRg(RRR>trequest_signerR((s5/tmp/pip-install-xdEqop/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_BUCKETtsearchRtpatternR(RRRtbuckett error_msg((s5/tmp/pip-install-xdEqop/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(RRR((s5/tmp/pip-install-xdEqop/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(RRR((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pytcopy_source_sse_md5sRcCst||sdS|d}|d}||}t|tjrU|jd}ntjt|jj d}tj|j d}|||<||| %s(RR(t input_shapeRRRRTtsplitRR(RRRSRRRTRRt orig_value((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pytfix_route53_idsBs    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-xdEqop/botocore/botocore/handlers.pyt#document_glacier_tree_hash_checksums cKsd|krD|jd}|jd}|j|jdnSd|kr|jd}|jd}|jd}|j|jdndS( Nsresponse-paramsRXs param-types (*dict*) --sresponse-examplesstructure-values member-values{}(RRR(RRRttemplate_body_sectionRRRR((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pyt0document_cloudformation_get_template_return_types    cKst|ddS(NtPredictEndpoint(R(trequestR((s5/tmp/pip-install-xdEqop/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_VERSIONRRK(RR topenssl_version_tuple((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pyt&check_openssl_supports_tls_version_1_2s    cKs\|jdkrXd|jkrXd|jdR((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pyt"set_list_objects_encoding_type_urls  c Ks|jddkr|jdrdddg}x1|D])}||kr:t||||Rttop_level_keysRt nested_keysttop_keyt child_keyR((s5/tmp/pip-install-xdEqop/botocore/botocore/handlers.pytdecode_list_objects     cKsyd|krut|dtjrBtjt|d|ds       :        !                              1