ó Ýç[c@sÅdZddlmZddlmZmZmZddlmZe ƒZ de fd„ƒYZ de fd„ƒYZ d e fd „ƒYZd e fd „ƒYZd e fd„ƒYZdefd„ƒYZde fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZde fd„ƒYZde fd„ƒYZde fd „ƒYZd!e fd"„ƒYZd#e fd$„ƒYZd%e fd&„ƒYZd'S((s-Abstractions to interact with service models.iÿÿÿÿ(t defaultdict(tCachedPropertytinstance_cachethyphenize_service_id(t OrderedDicttNoShapeFoundErrorcBseZRS((t__name__t __module__(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRstInvalidShapeErrorcBseZRS((RR(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRstOperationNotFoundErrorcBseZRS((RR(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR stInvalidShapeReferenceErrorcBseZRS((RR(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR #stUndefinedModelAttributeErrorcBseZRS((RR(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR 'st ServiceIdcBseZd„ZRS(cCs t|ƒS(N(R(tself((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt hyphenize,s(RRR(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR +stShapecBs³eZdZddddddddd d d d d dddgZddddddddgZeZdd„Ze d„ƒZ e d„ƒZ e d„ƒZ d„Z d„ZRS(s3Object representing a shape from the service model.t locationNamet queryNamet flattenedtlocationtpayloadt streamingttimestampFormatt xmlNamespacet resultWrappert xmlAttributet eventstreamteventt eventheadert eventpayloadt jsonvaluetrequiredtmintmaxt sensitivetenumtidempotencyTokenterrort exceptioncCsb||_|d|_|jddƒ|_||_|dkrLtƒ}n||_i|_dS(s  :type shape_name: string :param shape_name: The name of the shape. :type shape_model: dict :param shape_model: The shape model. This would be the value associated with the key in the "shapes" dict of the service model (i.e ``model['shapes'][shape_name]``) :type shape_resolver: botocore.model.ShapeResolver :param shape_resolver: A shape resolver object. This is used to resolve references to other shapes. For scalar shape types (string, integer, boolean, etc.), this argument is not required. If a shape_resolver is not provided for a complex type, then a ``ValueError`` will be raised when an attempt to resolve a shape is made. ttypet documentationtN( tnamet type_nametgetR(t _shape_modeltNonetUnresolvableShapeMapt_shape_resolvert_cache(R t shape_namet shape_modeltshape_resolver((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt__init__?s      cCsi|j}i}x1|jD]&}||jkr||||(t __class__RR*(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt__repr__¨s N(RRt__doc__R6R;RtMAP_TYPER.R5RR9R<R=R@RB(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR0s      "! tStructureShapecBseZed„ƒZRS(cCsM|jd}|jƒ}x-|jƒD]\}}|j|ƒ||(R R?((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR>üscCst|jjdiƒƒS(NRP(tlistRQR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt shape_namesÿscCsEy|jd|}Wntk r4t|ƒ‚nXt|||ƒS(Nt operations(RQtKeyErrorR tOperationModel(R toperation_nameR8((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pytoperation_models  cCs|jjddƒS(NR(R)(RQR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR( scCst|jjdgƒƒS(NR^(R\RQR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pytoperation_namesscCs!|jdk r|jS|jSdS(s«The name of the service. This defaults to the endpointPrefix defined in the service model. However, this value can be overriden when a ``ServiceModel`` is created. If a service_name was not provided when the ``ServiceModel`` was created and if there is no endpointPrefix defined in the service model, then an ``UndefinedModelAttributeError`` exception will be raised. N(RUR.tendpoint_prefix(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRXs cCst|jdƒƒS(Nt serviceId(R t_get_metadata_property(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt service_id$scCs.|jjdƒ}|dkr*|j}n|S(s®The name to use when computing signatures. If the model does not define a signing name, this value will be the endpoint prefix defined in the model. t signingNameN(R<R,R.Rd(R t signing_name((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRi(s  cCs |jdƒS(Nt apiVersion(Rf(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt api_version4scCs |jdƒS(Ntprotocol(Rf(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRl8scCs |jdƒS(NtendpointPrefix(Rf(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRd<scCs=y|j|SWn'tk r8td||fƒ‚nXdS(Ns1"%s" not defined in the metadata of the model: %s(R<R_R (R R*((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRf@s  cCs4|jtkr-|jjdƒ}||_n|jS(NtsignatureVersion(RTRSR<R,(R tsignature_version((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRoKs cCs ||_dS(N(RT(R RM((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRoRscCsd|jj|jfS(Ns%s(%s)(RARRX(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRBVsN(RRRCR.R5R[R>RR]RRbR(RcRXRgRiRkRlRdRftpropertyRotsetterRB(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyROÓs$     R`cBs%eZdd„Zed„ƒZed„ƒZed„ƒZed„ƒZ ed„ƒZ ed„ƒZ ed„ƒZ ed„ƒZ ed „ƒZed „ƒZed „ƒZed „ƒZd „Zd„Zd„Zed„ƒZed„ƒZd„Zd„Zd„Zd„ZRS(cCsR||_||_||_|jdƒ|_|j|_|jdiƒ|_dS(s† :type operation_model: dict :param operation_model: The operation model. This comes from the service model, and is the value associated with the operation name in the service model (i.e ``model['operations'][op_name]``). :type service_model: botocore.model.ServiceModel :param service_model: The service model associated with the operation. :type name: string :param name: The operation name. This is the operation name exposed to the users of this model. This can potentially be different from the "wire_name", which is the operation name that *must* by provided over the wire. For example, given:: "CreateCloudFrontOriginAccessIdentity":{ "name":"CreateCloudFrontOriginAccessIdentity2014_11_06", ... } The ``name`` would be ``CreateCloudFrontOriginAccessIdentity``, but the ``self.wire_name`` would be ``CreateCloudFrontOriginAccessIdentity2014_11_06``, which is the value we must send in the corresponding HTTP request. R*thttpN(t_operation_modelt_service_modelt _api_nameR,t _wire_nameR<Rr(R Rbt service_modelR*((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR5\s     cCs!|jdk r|jS|jSdS(N(RuR.t wire_name(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR*scCs|jjdƒS(sRThe wire name of the operation. In many situations this is the same value as the ``name``, value, but in some services, the operation name exposed to the user is different from the operaiton name we send across the wire (e.g cloudfront). Any serialization code should use ``wire_name``. R*(RsR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRxˆs cCs|jS(N(Rt(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRw–scCs|jjddƒS(NR(R)(RsR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR(šscCs|jjdtƒS(Nt deprecated(RsR,tFalse(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRyžscCs*d|jkrdS|jj|jdƒS(Ntinput(RsR.RtR>(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt input_shape¢s cCs*d|jkrdS|jj|jdƒS(Ntoutput(RsR.RtR>(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt output_shape«s cCsU|j}|sgSg|jjƒD].\}}d|jkr#|jdr#|^q#S(NR$(R|RFRGR<(R R|R*tshape((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pytidempotent_membersµs  cCs|jjdƒS(Ntauthtype(RsR,(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt auth_type¿scs/ˆjjdgƒ}t‡fd†|DƒƒS(Nterrorsc3s!|]}ˆjj|ƒVqdS(N(RtR>(t.0ts(R (sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pys Æs(RsR,R\(R RP((R sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt error_shapesÃscCs|jƒdk S(N(tget_event_stream_inputR.(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pythas_event_stream_inputÈscCs|jƒdk S(N(tget_event_stream_outputR.(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pythas_event_stream_outputÌscCs|j|jƒS(N(t_get_event_streamR|(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR‡ÐscCs|j|jƒS(N(R‹R~(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR‰ÓscCsD|dkrdSx-|jjƒD]}|jjdƒr |Sq WdS(sAReturns the event stream member's shape if any or None otherwise.RN(R.RFtvaluesR9R,(R RRJ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR‹Ös  cCs|jƒdk S(N(tget_streaming_inputR.(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pythas_streaming_inputßscCs|jƒdk S(N(tget_streaming_outputR.(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pythas_streaming_outputãscCs|j|jƒS(N(t_get_streaming_bodyR|(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRçscCs|j|jƒS(N(R‘R~(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRêscCsU|dkrdS|jjdƒ}|dk rQ|j|}|jdkrQ|SndS(s?Returns the streaming member's shape if any; or None otherwise.RtblobN(R.R9R,RFR+(R RRt payload_shape((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR‘ís   cCsd|jj|jfS(Ns %s(name=%s)(RARR*(R ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRBøsN(RRR.R5RR*RpRxRwR(RyR|R~R€R‚R†RˆRŠR‡R‰R‹RŽRRRR‘RB(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR`[s, %         RRcBsNeZdZied6ed6ed6ed6Zd„Zdd„Z d„Z RS( sResolves shape references.t structureR\tmaptstringcCs||_i|_dS(N(t _shape_mapt _shape_cache(R t shape_map((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR5s cCsªy|j|}Wntk r0t|ƒ‚nXy|jj|dtƒ}Wn!tk rqtd|ƒ‚nX|r”|jƒ}|j|ƒn||||ƒ}|S(NR's(Shape is missing required key 'type': %s( R—R_Rt SHAPE_CLASSESR,RRtcopytupdate(R R2RZR3t shape_clstresult((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRY s   cCs†t|ƒdkr/d|kr/|j|dƒS|jƒ}y|jdƒ}Wn!tk rqtd|ƒ‚nX|j||ƒSdS(NiRs*Invalid model, missing shape reference: %s(tlenRYR›R7R_R (R R?RZR2((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR>s  N( RRRCRERIRKRNRšR5R.RYR>(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRRüs   R/cBs#eZdZdd„Zd„ZRS(sJA ShapeResolver that will throw ValueErrors when shapes are resolved. cCstdƒ‚dS(Ns>Attempted to lookup shape '%s', but no shape map was provided.(t ValueError(R R2RZ((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyRY3scCstdƒ‚dS(Ns?Attempted to resolve shape '%s', but no shape map was provided.(R (R R?((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR>7sN(RRRCR.RYR>(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR/0s tDenormalizedStructureBuildercBskeZdZd d„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z RS( sÊBuild a StructureShape from a denormalized model. This is a convenience builder class that makes it easy to construct ``StructureShape``s based on a denormalized model. It will handle the details of creating unique shape names and creating the appropriate shape map needed by the ``StructureShape`` class. Example usage:: builder = DenormalizedStructureBuilder() shape = builder.with_members({ 'A': { 'type': 'structure', 'members': { 'B': { 'type': 'structure', 'members': { 'C': { 'type': 'string', } } } } } }).build_model() # ``shape`` is now an instance of botocore.model.StructureShape :type dict_type: class :param dict_type: The dictionary type to use, allowing you to opt-in to using OrderedDict or another dict type. This can be particularly useful for testing when order matters, such as for documentation. cCs@tƒ|_tƒ|_|dkr<|jjdƒ|_ndS(NR”(RRFtShapeNameGeneratort_name_generatorR.tnew_shape_nameR*(R R*((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR5`s   cCs ||_|S(sp :type members: dict :param members: The denormalized members. :return: self (t_members(R RF((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt with_membersfs cCshtƒ}idd6|jd6}|j|||jƒtd|ƒ}td|jd||jd|ƒS(s™Build the model based on the provided members. :rtype: botocore.model.StructureShape :return: The built StructureShape object. R”R'RFR™R2R3R4(RR¥t _build_modelR*RRRE(R RPt denormalizedtresolver((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt build_modelrs   c Cs¹|ddkr)|j||ƒ||>> s = ShapeNameGenerator() >>> s.new_shape_name('structure') 'StructureType1' >>> s.new_shape_name('structure') 'StructureType2' >>> s.new_shape_name('list') 'ListType1' >>> s.new_shape_name('list') 'ListType2' :type type_name: string :param type_name: The type name (structure, list, map, string, etc.) :rtype: string :return: A unique shape name for the given type is%sType%s(R½t capitalize(R R+t current_index((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR¤Ës  (RRRCR5R¤(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyR¢Ás N(RCt collectionsRtbotocore.utilsRRRtbotocore.compatRtobjectRSt ExceptionRRR R R tstrR RRERIRKRNROR`RRR/R¡R¢(((sf/private/var/folders/71/gccz42bs2nl23mxwq3vp1qmhw5xjlw/T/pip-install-k836tR/botocore/botocore/model.pyt s* } ˆ¡4 …