ó –ee[c@s©dZddlmZddlmZmZddlmZeƒZ de fd„ƒYZ de fd„ƒYZ d e fd „ƒYZ d e fd „ƒYZd e fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!efd"„ƒYZd#efd$„ƒYZd%S(&s-Abstractions to interact with service models.iÿÿÿÿ(t defaultdict(tCachedPropertytinstance_cache(t OrderedDicttNoShapeFoundErrorcBseZRS((t__name__t __module__(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRstInvalidShapeErrorcBseZRS((RR(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRstOperationNotFoundErrorcBseZRS((RR(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRstInvalidShapeReferenceErrorcBseZRS((RR(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR #stUndefinedModelAttributeErrorcBseZRS((RR(((s2/tmp/pip-install-xdEqop/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(tselft shape_namet shape_modeltshape_resolver((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt__init__:s      cCsi|j}i}x1|jD]&}||jkr||||(t __class__RR&(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt__repr__£s N(RRt__doc__R3R8RtMAP_TYPER*R2RR6R9R:R=R?(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR +s      "! tStructureShapecBseZed„ƒZRS(cCsM|jd}|jƒ}x-|jƒD]\}}|j|ƒ||½s(RpR(RY(R.RM((R.s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt error_shapesºscCs|jƒdk S(N(tget_event_stream_inputR*(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pythas_event_stream_input¿scCs|jƒdk S(N(tget_event_stream_outputR*(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pythas_event_stream_outputÃscCs|j|jƒS(N(t_get_event_streamRy(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR„ÇscCs|j|jƒS(N(RˆR{(R.((s2/tmp/pip-install-xdEqop/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*RCtvaluesR6R((R.R|RG((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRˆÍs  cCs|jƒdk S(N(tget_streaming_inputR*(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pythas_streaming_inputÖscCs|jƒdk S(N(tget_streaming_outputR*(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pythas_streaming_outputÚscCs|j|jƒS(N(t_get_streaming_bodyRy(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRŠÞscCs|j|jƒS(N(RŽR{(R.((s2/tmp/pip-install-xdEqop/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*R6R(RCR'(R.R|Rt payload_shape((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRŽäs   cCsd|jj|jfS(Ns %s(name=%s)(R>RR&(R.((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR?ïsN(RRR*R2RR&RmRuRtR$RvRyR{R}RRƒR…R‡R„R†RˆR‹RRŠRŒRŽR?(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR]Rs, %         ROcBsNeZdZied6ed6ed6ed6Zd„Zdd„Z d„Z RS( sResolves shape references.t structureRYtmaptstringcCs||_i|_dS(N(t _shape_mapt _shape_cache(R.t shape_map((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR2þs 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(R Rtcopytupdate(R.R/RWR0t shape_clstresult((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRVs   cCs†t|ƒdkr/d|kr/|j|dƒS|jƒ}y|jdƒ}Wn!tk rqtd|ƒ‚nX|j||ƒSdS(NiR|s*Invalid model, missing shape reference: %s(tlenRVR˜R4R\R (R.R<RWR/((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR;s  N( RRR@RBRFRHRKR—R2R*RVR;(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyROó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.R/RW((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRV*scCstdƒ‚dS(Ns?Attempted to resolve shape '%s', but no shape map was provided.(R(R.R<((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR;.sN(RRR@R*RVR;(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR+'s 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‘(RRCtShapeNameGeneratort_name_generatorR*tnew_shape_nameR&(R.R&((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR2Ws   cCs ||_|S(sp :type members: dict :param members: The denormalized members. :return: self (t_members(R.RC((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt with_members]s 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#RCR–R/R0R1(RR¢t _build_modelR&RORB(R.RMt denormalizedtresolver((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt build_modelis   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((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyR¡Âs  (RRR@R2R¡(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyRŸ¸s N(R@t collectionsRtbotocore.utilsRRtbotocore.compatRtobjectRPt ExceptionRRRR R R RBRFRHRKRLR]ROR+RžRŸ(((s2/tmp/pip-install-xdEqop/botocore/botocore/model.pyt s( } „¡4 …