Ë
    P÷Ôe›w  ã                   óö  — d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	m
Z
 ddlmZmZmZ  e«       Z G d„ de«      Z G d	„ d
e«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d e«      Z G d!„ d"«      Z  G d#„ d$«      Z! G d%„ d&«      Z" G d'„ d(«      Z# G d)„ d*«      Z$ G d+„ d,«      Z%y-).z-Abstractions to interact with service models.é    )Údefaultdict)Ú
NamedTupleÚUnion)ÚOrderedDict)ÚMissingServiceIdErrorÚUndefinedModelAttributeError)ÚCachedPropertyÚhyphenize_service_idÚinstance_cachec                   ó   — e Zd Zy)ÚNoShapeFoundErrorN©Ú__name__Ú
__module__Ú__qualname__© ó    ú0/usr/lib/python3/dist-packages/botocore/model.pyr   r      ó   „ Ør   r   c                   ó   — e Zd Zy)ÚInvalidShapeErrorNr   r   r   r   r   r      r   r   r   c                   ó   — e Zd Zy)ÚOperationNotFoundErrorNr   r   r   r   r   r   #   r   r   r   c                   ó   — e Zd Zy)ÚInvalidShapeReferenceErrorNr   r   r   r   r   r   '   r   r   r   c                   ó   — e Zd Zd„ Zy)Ú	ServiceIdc                 ó   — t        | «      S ©N)r
   ©Úselfs    r   Ú	hyphenizezServiceId.hyphenize,   s   € Ü# DÓ)Ð)r   N)r   r   r   r"   r   r   r   r   r   +   s   „ ó*r   r   c                   óx   — e Zd ZdZg d¢Zg d¢ZeZdd„Ze	d„ «       Z
e	d„ «       Ze	d„ «       Zd	„ Zd
„ Zed„ «       Zy)ÚShapez3Object representing a shape from the service model.)ÚlocationNameÚ	queryNameÚ	flattenedÚlocationÚpayloadÚ	streamingÚtimestampFormatÚxmlNamespaceÚresultWrapperÚxmlAttributeÚeventstreamÚeventÚeventheaderÚeventpayloadÚ	jsonvaluer+   Ú	hostLabel)ÚrequiredÚminÚmaxÚpatternÚ	sensitiveÚenumÚidempotencyTokenÚerrorÚ	exceptionÚendpointdiscoveryidÚ	retryableÚdocumentÚunionÚcontextParamÚclientContextParamsÚrequiresLengthNc                 ó–   — || _         |d   | _        |j                  dd«      | _        || _        |€
t        «       }|| _        i | _        y)a  

        :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.

        ÚtypeÚdocumentationÚ N)ÚnameÚ	type_nameÚgetrG   Ú_shape_modelÚUnresolvableShapeMapÚ_shape_resolverÚ_cache)r!   Ú
shape_nameÚshape_modelÚshape_resolvers       r   Ú__init__zShape.__init__^   sQ   € ð( ˆŒ	Ø$ VÑ,ˆŒØ(Ÿ_™_¨_¸bÓAˆÔØ'ˆÔØÐ!ô 2Ó3ˆNØ-ˆÔØˆ�r   c                 ó¢   — | j                   }i }| j                  D ]  }|| j                   v sŒ||   ||<   Œ d|v r|j                  d«      |d<   |S )a  Serialization information about the shape.

        This contains information that may be needed for input serialization
        or response parsing.  This can include:

            * name
            * queryName
            * flattened
            * location
            * payload
            * streaming
            * xmlNamespace
            * resultWrapper
            * xmlAttribute
            * jsonvalue
            * timestampFormat

        :rtype: dict
        :return: Serialization information about the shape.

        r%   rI   )rL   ÚSERIALIZED_ATTRSÚpop)r!   ÚmodelÚserializationÚattrs       r   rX   zShape.serialization€   sj   € ð. ×!Ñ!ˆØˆØ×)Ñ)ò 	2ˆDØ�t×(Ñ(Ò(Ø&+¨D¡k�˜dÒ#ð	2ð ˜]Ñ*Ø$1×$5Ñ$5°nÓ$EˆM˜&Ñ!ØÐr   c                 ór   — | j                   }i }| j                  D ]  }|| j                   v sŒ||   ||<   Œ |S )aÍ  Metadata about the shape.

        This requires optional information about the shape, including:

            * min
            * max
            * pattern
            * enum
            * sensitive
            * required
            * idempotencyToken
            * document
            * union
            * contextParam
            * clientContextParams
            * requiresLength

        :rtype: dict
        :return: Metadata about the shape.

        )rL   ÚMETADATA_ATTRS)r!   rW   ÚmetadatarY   s       r   r\   zShape.metadata¡   sK   € ð. ×!Ñ!ˆØˆØ×'Ñ'ò 	-ˆDØ�t×(Ñ(Ò(Ø!& t¡�˜’ð	-ð ˆr   c                 ó:   — | j                   j                  dg «      S )zïA list of members that are required.

        A structure shape can define members that are required.
        This value will return a list of required members.  If there
        are no required members an empty list is returned.

        r5   ©r\   rK   r    s    r   Úrequired_memberszShape.required_members¿   s   € ð �}‰}× Ñ  ¨RÓ0Ð0r   c                 ó8   — | j                   j                  |«      S r   ©rN   Úresolve_shape_ref©r!   Ú	shape_refs     r   Ú_resolve_shape_refzShape._resolve_shape_refÊ   ó   € Ø×#Ñ#×5Ñ5°iÓ@Ð@r   c                 óP   — d| j                   j                  › d| j                  › d�S )Nú<ú(z)>©Ú	__class__r   rI   r    s    r   Ú__repr__zShape.__repr__Í   s&   € Ø�4—>‘>×*Ñ*Ð+¨1¨T¯Y©Y¨K°rÐ:Ð:r   c                  ó   — y r   r   r    s    r   Úevent_stream_namezShape.event_stream_nameÐ   s   € àr   r   )r   r   r   Ú__doc__rU   r[   r   ÚMAP_TYPErS   r	   rX   r\   r_   re   rl   Úpropertyrn   r   r   r   r$   r$   0   s}   „ Ù=òÐò&€Nð$ €Hó ðD ñó ðð@ ñó ðð: ñ1ó ð1òAò;ð ñó ñr   r$   c                   ó\   — e Zd Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zy)ÚStructureShapec                 óÒ   — | j                   j                  d| j                  «       «      }| j                  «       }|j                  «       D ]  \  }}| j	                  |«      ||<   Œ |S )NÚmembers)rL   rK   rp   Úitemsre   )r!   ru   Úshape_membersrI   rd   s        r   ru   zStructureShape.membersÖ   sc   € à×#Ñ#×'Ñ'¨	°4·=±=³?ÓCˆð Ÿ™›ˆØ&Ÿ}™}›ò 	E‰OˆD�)Ø"&×"9Ñ"9¸)Ó"DˆM˜$Òð	EàÐr   c                 ó†   — | j                   j                  «       D ]$  \  }}|j                  j                  d«      sŒ"|c S  y )Nr/   )ru   rv   rX   rK   )r!   Úmember_nameÚmembers      r   rn   z StructureShape.event_stream_nameä   sB   € à#'§<¡<×#5Ñ#5Ó#7ò 	#ÑˆK˜Ø×#Ñ#×'Ñ'¨Õ6Ø"Ò"ð	#ð r   c                 ó¶   — | j                   j                  dd«      sy | j                   j                  di «      }|j                  d«      }|r|S | j                  S )Nr=   Fr<   Úcode)r\   rK   rI   )r!   Úerror_metadatar|   s      r   Ú
error_codezStructureShape.error_codeë   sQ   € à�}‰}× Ñ  ¨eÔ4ØØŸ™×*Ñ*¨7°BÓ7ˆØ×!Ñ! &Ó)ˆÙØˆKà�y‰yÐr   c                 ó:   — | j                   j                  dd«      S )Nr@   Fr^   r    s    r   Úis_document_typezStructureShape.is_document_typeö   s   € à�}‰}× Ñ  ¨UÓ3Ð3r   c                 ó:   — | j                   j                  dd«      S )NrA   Fr^   r    s    r   Úis_tagged_unionzStructureShape.is_tagged_unionú   s   € à�}‰}× Ñ  ¨%Ó0Ð0r   N)	r   r   r   r	   ru   rn   r~   r€   r‚   r   r   r   rs   rs   Õ   sd   „ Øñó ðð ñó ðð ñó ðð ñ4ó ð4ð ñ1ó ñ1r   rs   c                   ó   — e Zd Zed„ «       Zy)Ú	ListShapec                 ó>   — | j                  | j                  d   «      S )Nrz   ©re   rL   r    s    r   rz   zListShape.member   s   € à×&Ñ& t×'8Ñ'8¸Ñ'BÓCÐCr   N)r   r   r   r	   rz   r   r   r   r„   r„   ÿ   s   „ ØñDó ñDr   r„   c                   ó,   — e Zd Zed„ «       Zed„ «       Zy)ÚMapShapec                 ó>   — | j                  | j                  d   «      S )NÚkeyr†   r    s    r   rŠ   zMapShape.key  s   € à×&Ñ& t×'8Ñ'8¸Ñ'?Ó@Ð@r   c                 ó>   — | j                  | j                  d   «      S )NÚvaluer†   r    s    r   rŒ   zMapShape.value
  s   € à×&Ñ& t×'8Ñ'8¸Ñ'AÓBÐBr   N)r   r   r   r	   rŠ   rŒ   r   r   r   rˆ   rˆ     s,   „ ØñAó ðAð ñCó ñCr   rˆ   c                   ó   — e Zd Zed„ «       Zy)ÚStringShapec                 ó:   — | j                   j                  dg «      S )Nr:   r^   r    s    r   r:   zStringShape.enum  s   € à�}‰}× Ñ  ¨Ó,Ð,r   N)r   r   r   r	   r:   r   r   r   rŽ   rŽ     s   „ Øñ-ó ñ-r   rŽ   c                   ó,   — e Zd ZU eed<   eeef   ed<   y)ÚStaticContextParameterrI   rŒ   N)r   r   r   ÚstrÚ__annotations__r   Úboolr   r   r   r‘   r‘     s   … Ø
ƒIØ��s�ÑÔr   r‘   c                   ó"   — e Zd ZU eed<   eed<   y)ÚContextParameterrI   ry   N©r   r   r   r’   r“   r   r   r   r–   r–     s   … Ø
ƒIØÔr   r–   c                   ó,   — e Zd ZU eed<   eed<   eed<   y)ÚClientContextParameterrI   rF   rG   Nr—   r   r   r   r™   r™     s   … Ø
ƒIØ
ƒIØÔr   r™   c                   ó\  — e Zd ZdZdd„Zdd„Zd„ Zed„ «       Zd„ Z	ed„ «       Z
ed	„ «       Zed
„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zd„ Zed„ «       Zej8                  d„ «       Zd„ Zy)ÚServiceModelzQ

    :ivar service_description: The parsed service description dictionary.

    Nc                 ó²   — || _         |j                  di «      | _        t        |j                  di «      «      | _        t
        | _        || _        i | _        y)a‡  

        :type service_description: dict
        :param service_description: The service description model.  This value
            is obtained from a botocore.loader.Loader, or from directly loading
            the file yourself::

                service_description = json.load(
                    open('/path/to/service-description-model.json'))
                model = ServiceModel(service_description)

        :type service_name: str
        :param service_name: The name of the service.  Normally this is
            the endpoint prefix defined in the service_description.  However,
            you can override this value to provide a more convenient name.
            This is done in a few places in botocore (ses instead of email,
            emr instead of elasticmapreduce).  If this value is not provided,
            it will default to the endpointPrefix defined in the model.

        r\   ÚshapesN)	Ú_service_descriptionrK   r\   ÚShapeResolverrN   ÚNOT_SETÚ_signature_versionÚ_service_nameÚ_instance_cache)r!   Úservice_descriptionÚservice_names      r   rS   zServiceModel.__init__,  sW   € ð* %8ˆÔ!à+×/Ñ/°
¸BÓ?ˆŒÜ,Ø×#Ñ# H¨bÓ1ó 
ˆÔô #*ˆÔØ)ˆÔØ!ˆÕr   c                 ó:   — | j                   j                  ||«      S r   )rN   Úget_shape_by_name©r!   rP   Úmember_traitss      r   Ú	shape_forzServiceModel.shape_forK  s    € Ø×#Ñ#×5Ñ5Ø˜ó
ð 	
r   c                 ó:   — | j                   j                  |d «      S r   )Ú_error_code_cacherK   )r!   r~   s     r   Úshape_for_error_codez!ServiceModel.shape_for_error_codeP  s   € Ø×%Ñ%×)Ñ)¨*°dÓ;Ð;r   c                 óN   — i }| j                   D ]  }|j                  }|||<   Œ |S r   )Úerror_shapesr~   )r!   Úerror_code_cacheÚerror_shaper|   s       r   r¬   zServiceModel._error_code_cacheS  s;   € àÐØ×,Ñ,ò 	1ˆKØ×)Ñ)ˆDØ%0Ð˜TÒ"ð	1ð  Ðr   c                 ó8   — | j                   j                  |«      S r   ra   rc   s     r   rb   zServiceModel.resolve_shape_ref[  rf   r   c                 óL   — t        | j                  j                  di «      «      S )Nr�   ©Úlistrž   rK   r    s    r   Úshape_nameszServiceModel.shape_names^  s    € ä�D×-Ñ-×1Ñ1°(¸BÓ?Ó@Ð@r   c                 óª   — g }| j                   D ]A  }| j                  |«      }|j                  j                  dd«      sŒ1|j	                  |«       ŒC |S )Nr=   F)r¶   rª   r\   rK   Úappend)r!   r¯   rP   r±   s       r   r¯   zServiceModel.error_shapesb  sV   € àˆØ×*Ñ*ò 	1ˆJØŸ.™.¨Ó4ˆKØ×#Ñ#×'Ñ'¨°UÕ;Ø×#Ñ# KÕ0ð	1ð Ðr   c                 ór   — 	 | j                   d   |   }t        || |«      S # t        $ r t        |«      ‚w xY w©NÚ
operations)rž   ÚKeyErrorr   ÚOperationModel)r!   Úoperation_namerW   s      r   Úoperation_modelzServiceModel.operation_modelk  sI   € ð	9Ø×-Ñ-¨lÑ;¸NÑKˆEô ˜e T¨>Ó:Ð:øô ò 	9Ü(¨Ó8Ð8ð	9ús   ‚! ¡6c                 ó:   — | j                   j                  dd«      S ©NrG   rH   )rž   rK   r    s    r   rG   zServiceModel.documentations  s   € à×(Ñ(×,Ñ,¨_¸bÓAÐAr   c                 óL   — t        | j                  j                  dg «      «      S rº   r´   r    s    r   Úoperation_nameszServiceModel.operation_namesw  s    € ä�D×-Ñ-×1Ñ1°,ÀÓCÓDÐDr   c                 óJ   — | j                   �| j                   S | j                  S )a«  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.

        )r¢   Úendpoint_prefixr    s    r   r¥   zServiceModel.service_name{  s(   € ð ×ÑÐ)Ø×%Ñ%Ð%à×'Ñ'Ð'r   c                 ó~   — 	 t        | j                  d«      «      S # t        $ r t        | j                  ¬«      ‚w xY w)NÚ	serviceId)r¥   )r   Ú_get_metadata_propertyr   r   r¢   r    s    r   Ú
service_idzServiceModel.service_idŒ  s@   € ð	IÜ˜T×8Ñ8¸ÓEÓFÐFøÜ+ò 	IÜ'°T×5GÑ5GÔHÐHð	Iús   ‚ œ <c                 óX   — | j                   j                  d«      }|€| j                  }|S )z®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.
        ÚsigningName)r\   rK   rÅ   )r!   Úsigning_names     r   rÌ   zServiceModel.signing_name“  s/   € ð —}‘}×(Ñ(¨Ó7ˆØÐØ×/Ñ/ˆLØÐr   c                 ó$   — | j                  d«      S )NÚ
apiVersion©rÈ   r    s    r   Úapi_versionzServiceModel.api_versionŸ  s   € à×*Ñ*¨<Ó8Ð8r   c                 ó$   — | j                  d«      S )NÚprotocolrÏ   r    s    r   rÒ   zServiceModel.protocol£  s   € à×*Ñ*¨:Ó6Ð6r   c                 ó$   — | j                  d«      S )NÚendpointPrefixrÏ   r    s    r   rÅ   zServiceModel.endpoint_prefix§  s   € à×*Ñ*Ð+;Ó<Ð<r   c                 óh   — | j                   D ]#  }| j                  |«      }|j                  sŒ!|c S  y r   )rÃ   r¿   Úis_endpoint_discovery_operation©r!   Ú	operationrW   s      r   Úendpoint_discovery_operationz)ServiceModel.endpoint_discovery_operation«  s5   € à×-Ñ-ò 	ˆIØ×(Ñ(¨Ó3ˆEØ×4Ó4Ø’ñ	r   c                 óœ   — | j                   D ]=  }| j                  |«      }|j                  €Œ!|j                  j                  d«      sŒ= y y)Nr5   TF)rÃ   r¿   Úendpoint_discoveryrK   r×   s      r   Úendpoint_discovery_requiredz(ServiceModel.endpoint_discovery_required²  sO   € à×-Ñ-ò 	ˆIØ×(Ñ(¨Ó3ˆEà×(Ñ(Ñ4Ø×,Ñ,×0Ñ0°Õ<áð	ð r   c           
      ó°   — | j                   j                  di «      }|j                  «       D ��cg c]  \  }}t        ||d   |d   ¬«      ‘Œ c}}S c c}}w )NrC   rF   rG   )rI   rF   rG   )rž   rK   rv   r™   )r!   ÚparamsÚ
param_nameÚ	param_vals       r   Úclient_context_parametersz&ServiceModel.client_context_parameters½  sa   € à×*Ñ*×.Ñ.Ð/DÀbÓIˆð *0¯©«÷
ñ &�
˜Iô #ØØ˜vÑ&Ø'¨Ñ8öó
ð 	
ùó 
s   °Ac                 ó^   — 	 | j                   |   S # t        $ r t        d|› d| › �«      ‚w xY w)Nú"z," not defined in the metadata of the model: )r\   r¼   r   ©r!   rI   s     r   rÈ   z#ServiceModel._get_metadata_propertyÉ  sC   € ð	Ø—=‘= Ñ&Ð&øÜò 	Ü.Ø�D�6ÐEÀdÀVÐLóð ð	ús   ‚ ‘,c                 ó‚   — | j                   t        u r"| j                  j                  d«      }|| _         | j                   S )NÚsignatureVersion)r¡   r    r\   rK   )r!   Úsignature_versions     r   rç   zServiceModel.signature_versionÔ  s:   € à×"Ñ"¤gÑ-Ø $§¡× 1Ñ 1Ð2DÓ EÐØ&7ˆDÔ#Ø×&Ñ&Ð&r   c                 ó   — || _         y r   )r¡   )r!   rŒ   s     r   rç   zServiceModel.signature_versionÛ  s
   € à"'ˆÕr   c                 óN   — | j                   j                  › d| j                  › d�S )Nri   ú))rk   r   r¥   r    s    r   rl   zServiceModel.__repr__ß  s'   € Ø—.‘.×)Ñ)Ð*¨!¨D×,=Ñ,=Ð+>¸aÐ@Ð@r   r   )r   r   r   ro   rS   rª   r­   r	   r¬   rb   r¶   r¯   r   r¿   rG   rÃ   r¥   rÉ   rÌ   rÐ   rÒ   rÅ   rÙ   rÜ   rá   rÈ   rq   rç   Úsetterrl   r   r   r   r›   r›   %  s‰  „ ñó"ó>
ò
<ð ñ ó ð òAð ñAó ðAð ñó ðð ñ;ó ð;ð ñBó ðBð ñEó ðEð ñ(ó ð(ð  ñIó ðIð ñ	ó ð	ð ñ9ó ð9ð ñ7ó ð7ð ñ=ó ð=ð ñó ðð ñó ðð ñ	
ó ð	
òð ñ'ó ð'ð ×Ññ(ó ð(óAr   r›   c                   óž  — e Zd Zd d„Zed„ «       Zed„ «       Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       Zed	„ «       Zed
„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zd„ Zd„ Zd„ Zed„ «       Zed„ «       Zd„ Zd„ Z d„ Z!d„ Z"y)!r½   Nc                 óª   — || _         || _        || _        |j                  d«      | _        |j
                  | _        |j                  di «      | _        y)a†  

        :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.

        rI   ÚhttpN)Ú_operation_modelÚ_service_modelÚ	_api_namerK   Ú
_wire_namer\   rî   )r!   r¿   Úservice_modelrI   s       r   rS   zOperationModel.__init__ä  sP   € ð8 !0ˆÔØ+ˆÔØˆŒð *×-Ñ-¨fÓ5ˆŒØ%×.Ñ.ˆŒØ#×'Ñ'¨°Ó3ˆ�	r   c                 óJ   — | j                   �| j                   S | j                  S r   )rñ   Ú	wire_namer    s    r   rI   zOperationModel.name	  s    € à�>‰>Ð%Ø—>‘>Ð!à—>‘>Ð!r   c                 ó8   — | j                   j                  d«      S )aR  The 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 operation name
        we send across the wire (e.g cloudfront).

        Any serialization code should use ``wire_name``.

        rI   ©rï   rK   r    s    r   rõ   zOperationModel.wire_name  s   € ð ×$Ñ$×(Ñ(¨Ó0Ð0r   c                 ó   — | j                   S r   )rð   r    s    r   ró   zOperationModel.service_model  s   € à×"Ñ"Ð"r   c                 ó:   — | j                   j                  dd«      S rÁ   r÷   r    s    r   rG   zOperationModel.documentation"  s   € à×$Ñ$×(Ñ(¨¸"Ó=Ð=r   c                 ó:   — | j                   j                  dd«      S )NÚ
deprecatedFr÷   r    s    r   rû   zOperationModel.deprecated&  s   € à×$Ñ$×(Ñ(¨°uÓ=Ð=r   c                 ó:   — | j                   j                  dd «      S )NÚendpointdiscoveryr÷   r    s    r   rÛ   z!OperationModel.endpoint_discovery*  s   € ð ×$Ñ$×(Ñ(Ð)<¸dÓCÐCr   c                 ó:   — | j                   j                  dd«      S )NÚendpointoperationFr÷   r    s    r   rÖ   z.OperationModel.is_endpoint_discovery_operation0  s   € à×$Ñ$×(Ñ(Ð)<¸eÓDÐDr   c                 óp   — d| j                   vry | j                  j                  | j                   d   «      S )NÚinput©rï   rð   rb   r    s    r   Úinput_shapezOperationModel.input_shape4  s<   € à˜$×/Ñ/Ñ/ð Ø×"Ñ"×4Ñ4Ø×!Ñ! 'Ñ*ó
ð 	
r   c                 óp   — d| j                   vry | j                  j                  | j                   d   «      S )NÚoutputr  r    s    r   Úoutput_shapezOperationModel.output_shape>  s<   € à˜4×0Ñ0Ñ0ð Ø×"Ñ"×4Ñ4Ø×!Ñ! (Ñ+ó
ð 	
r   c                 óÂ   — | j                   }|sg S |j                  j                  «       D ��cg c]$  \  }}d|j                  v r|j                  d   r|‘Œ& c}}S c c}}w )Nr;   )r  ru   rv   r\   )r!   r  rI   Úshapes       r   Úidempotent_membersz!OperationModel.idempotent_membersI  sc   € à×&Ñ&ˆÙØˆIð "-×!4Ñ!4×!:Ñ!:Ó!<÷
á��uØ! U§^¡^Ñ3Ø—‘Ð1Ò2ò ó
ð 	
ùó 
s   ®)Ac           
      óÀ   — | j                   j                  di «      }|j                  «       D ��cg c]!  \  }}t        ||j                  d«      ¬«      ‘Œ# c}}S c c}}w )NÚstaticContextParamsrŒ   )rI   rŒ   )rï   rK   rv   r‘   )r!   rÞ   rI   Úpropss       r   Ústatic_context_parametersz(OperationModel.static_context_parametersV  sW   € à×&Ñ&×*Ñ*Ð+@À"ÓEˆð  &Ÿ|™|›~÷
á��eô #¨°E·I±I¸gÓ4FÖGó
ð 	
ùó 
s   °&Ac                 ó  — | j                   sg S | j                   j                  j                  «       D ��cg c]A  \  }}d|j                  v r.d|j                  d   v rt	        |j                  d   d   |¬«      ‘ŒC c}}S c c}}w )NrB   rI   )rI   ry   )r  ru   rv   r\   r–   )r!   rI   r  s      r   Úcontext_parametersz!OperationModel.context_parameters^  sƒ   € à×ÒØˆIð  $×/Ñ/×7Ñ7×=Ñ=Ó?÷
ñ
 ��eØ §¡Ñ/Ø˜%Ÿ.™.¨Ñ8Ñ8ô Ø—^‘^ NÑ3°FÑ;Ø öó
ð 	
ùó 
s   ¶AB c                 ó8   — | j                   j                  d«      S )NÚrequestcompressionr÷   r    s    r   Úrequest_compressionz"OperationModel.request_compressionm  s   € à×$Ñ$×(Ñ(Ð)=Ó>Ð>r   c                 ó8   — | j                   j                  d«      S )NÚauthtyper÷   r    s    r   Ú	auth_typezOperationModel.auth_typeq  ó   € à×$Ñ$×(Ñ(¨Ó4Ð4r   c                 ód   ‡ — ‰ j                   j                  dg «      }t        ˆ fd„|D «       «      S )NÚerrorsc              3   óT   •K  — | ]  }‰j                   j                  |«      –— Œ! y ­wr   )rð   rb   )Ú.0Úsr!   s     €r   ú	<genexpr>z.OperationModel.error_shapes.<locals>.<genexpr>x  s"   øè ø€ ÒMÀ�D×'Ñ'×9Ñ9¸!×<ÑMùs   ƒ%()rï   rK   rµ   )r!   r�   s   ` r   r¯   zOperationModel.error_shapesu  s,   ø€ à×&Ñ&×*Ñ*¨8°RÓ8ˆÜÓMÀfÔMÓMÐMr   c                 ó8   — | j                   j                  d«      S )NÚendpointr÷   r    s    r   r  zOperationModel.endpointz  r  r   c                 ó:   — | j                   j                  dd«      S )NÚhttpChecksumRequiredFr÷   r    s    r   Úhttp_checksum_requiredz%OperationModel.http_checksum_required~  s   € à×$Ñ$×(Ñ(Ð)?ÀÓGÐGr   c                 ó:   — | j                   j                  di «      S )NÚhttpChecksumr÷   r    s    r   Úhttp_checksumzOperationModel.http_checksum‚  s   € à×$Ñ$×(Ñ(¨¸Ó<Ð<r   c                 ó&   — | j                  «       d uS r   )Úget_event_stream_inputr    s    r   Úhas_event_stream_inputz%OperationModel.has_event_stream_input†  s   € à×*Ñ*Ó,°DÐ8Ð8r   c                 ó&   — | j                  «       d uS r   )Úget_event_stream_outputr    s    r   Úhas_event_stream_outputz&OperationModel.has_event_stream_outputŠ  s   € à×+Ñ+Ó-°TÐ9Ð9r   c                 ó8   — | j                  | j                  «      S r   )Ú_get_event_streamr  r    s    r   r&  z%OperationModel.get_event_stream_inputŽ  s   € Ø×%Ñ% d×&6Ñ&6Ó7Ð7r   c                 ó8   — | j                  | j                  «      S r   )r,  r  r    s    r   r)  z&OperationModel.get_event_stream_output‘  s   € Ø×%Ñ% d×&7Ñ&7Ó8Ð8r   c                 óD   — |€y|j                   }|r|j                  |   S y)zAReturns the event stream member's shape if any or None otherwise.N)rn   ru   )r!   r  Ú
event_names      r   r,  z OperationModel._get_event_stream”  s*   € àˆ=ØØ×,Ñ,ˆ
ÙØ—=‘= Ñ,Ð,Ør   c                 ó&   — | j                  «       d uS r   )Úget_streaming_inputr    s    r   Úhas_streaming_inputz"OperationModel.has_streaming_input�  s   € à×'Ñ'Ó)°Ð5Ð5r   c                 ó&   — | j                  «       d uS r   )Úget_streaming_outputr    s    r   Úhas_streaming_outputz#OperationModel.has_streaming_output¡  s   € à×(Ñ(Ó*°$Ð6Ð6r   c                 ó8   — | j                  | j                  «      S r   )Ú_get_streaming_bodyr  r    s    r   r1  z"OperationModel.get_streaming_input¥  s   € Ø×'Ñ'¨×(8Ñ(8Ó9Ð9r   c                 ó8   — | j                  | j                  «      S r   )r7  r  r    s    r   r4  z#OperationModel.get_streaming_output¨  s   € Ø×'Ñ'¨×(9Ñ(9Ó:Ð:r   c                 ó„   — |€y|j                   j                  d«      }|� |j                  |   }|j                  dk(  r|S y)z?Returns the streaming member's shape if any; or None otherwise.Nr)   Úblob)rX   rK   ru   rJ   )r!   r  r)   Úpayload_shapes       r   r7  z"OperationModel._get_streaming_body«  sK   € àˆ=ØØ×%Ñ%×)Ñ)¨)Ó4ˆØÐØ!ŸM™M¨'Ñ2ˆMØ×&Ñ&¨&Ò0Ø$Ð$Ør   c                 óN   — | j                   j                  › d| j                  › d�S )Nz(name=rê   rj   r    s    r   rl   zOperationModel.__repr__¶  s$   € Ø—.‘.×)Ñ)Ð*¨&°·±°¸1Ð=Ð=r   r   )#r   r   r   rS   r	   rI   rq   rõ   ró   rG   rû   rÛ   rÖ   r  r  r	  r  r  r  r  r¯   r  r!  r$  r'  r*  r&  r)  r,  r2  r5  r1  r4  r7  rl   r   r   r   r½   r½   ã  së  „ ó#4ðJ ñ"ó ð"ð ñ1ó ð1ð ñ#ó ð#ð ñ>ó ð>ð ñ>ó ð>ð ñDó ðDð
 ñEó ðEð ñ
ó ð
ð ñ
ó ð
ð ñ

ó ð

ð ñ
ó ð
ð ñ
ó ð
ð ñ?ó ð?ð ñ5ó ð5ð ñNó ðNð ñ5ó ð5ð ñHó ðHð ñ=ó ð=ð ñ9ó ð9ð ñ:ó ð:ò8ò9òð ñ6ó ð6ð ñ7ó ð7ò:ò;ò	ó>r   r½   c                   ó2   — e Zd ZdZeeeedœZd„ Z	dd„Z
d„ Zy)rŸ   zResolves shape references.)Ú	structurerµ   ÚmapÚstringc                 ó    — || _         i | _        y r   )Ú
_shape_mapÚ_shape_cache)r!   Ú	shape_maps     r   rS   zShapeResolver.__init__Å  s   € Ø#ˆŒØˆÕr   Nc                 ó.  — 	 | j                   |   }	 | j                  j	                  |d   t
        «      }|r!|j                  «       }|j                  |«        |||| «      }|S # t        $ r t        |«      ‚w xY w# t        $ r t        d|› �«      ‚w xY w)NrF   z&Shape is missing required key 'type': )	rB  r¼   r   ÚSHAPE_CLASSESrK   r$   r   ÚcopyÚupdate)r!   rP   r©   rQ   Ú	shape_clsÚresults         r   r§   zShapeResolver.get_shape_by_nameÉ  s®   € ð	0ØŸ/™/¨*Ñ5ˆKð	Ø×*Ñ*×.Ñ.¨{¸6Ñ/BÄEÓJˆIñ
 Ø%×*Ñ*Ó,ˆKØ×Ñ˜}Ô-Ù˜: {°DÓ9ˆØˆøô ò 	0Ü# JÓ/Ð/ð	0ûô ò 	Ü#Ø8¸¸ÐFóð ð	ús   ‚A$ ’#A< Á$A9Á<Bc                 óì   — t        |«      dk(  rd|v r| j                  |d   «      S |j                  «       }	 |j                  d«      }| j                  ||«      S # t        $ r t        d|› �«      ‚w xY w)Né   r  z(Invalid model, missing shape reference: )Úlenr§   rG  rV   r¼   r   )r!   rd   r©   rP   s       r   rb   zShapeResolver.resolve_shape_refÚ  s�   € ô ˆy‹>˜QÒ 7¨iÑ#7ð ×)Ñ)¨)°GÑ*<Ó=Ð=à%ŸN™NÓ,ˆMðØ*×.Ñ.¨wÓ7�
ð
 ×)Ñ)¨*°mÓDÐDøô	 ò Ü0Ø>¸y¸kÐJóð ðús   ¸A ÁA3r   )r   r   r   ro   rs   r„   rˆ   rŽ   rF  rS   r§   rb   r   r   r   rŸ   rŸ   º  s*   „ Ù$ð $ØØØñ	€Mòóó"Er   rŸ   c                   ó   — e Zd ZdZdd„Zd„ Zy)rM   zEA ShapeResolver that will throw ValueErrors when shapes are resolved.Nc                 ó    — t        d|› d�«      ‚)NzAttempted to lookup shape 'ú!', but no shape map was provided.©Ú
ValueErrorr¨   s      r   r§   z&UnresolvableShapeMap.get_shape_by_nameó  s   € ÜØ)¨*¨Ð5VÐWó
ð 	
r   c                 ó    — t        d|› d�«      ‚)NzAttempted to resolve shape 'rP  rQ  rc   s     r   rb   z&UnresolvableShapeMap.resolve_shape_refø  s    € ÜØ*¨9¨+ð 6 ð !ó
ð 	
r   r   )r   r   r   ro   r§   rb   r   r   r   rM   rM   ð  s   „ ÙOó
ó

r   rM   c                   óR   — e Zd ZdZdZdd„Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ Zd„ Zy)ÚDenormalizedStructureBuilderaÊ  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.

    )	r@  ÚintegerÚbooleanr:  ÚfloatÚ	timestampÚlongÚdoubleÚcharNc                 ó†   — t        «       | _        t        «       | _        |€!| j                  j	                  d«      | _        y y )Nr>  )r   ru   ÚShapeNameGeneratorÚ_name_generatorÚnew_shape_namerI   rä   s     r   rS   z%DenormalizedStructureBuilder.__init__0  s8   € Ü"“}ˆŒÜ1Ó3ˆÔØˆ<Ø×,Ñ,×;Ñ;¸KÓHˆD�Ið r   c                 ó   — || _         | S )zp

        :type members: dict
        :param members: The denormalized members.

        :return: self

        )Ú_members)r!   ru   s     r   Úwith_membersz)DenormalizedStructureBuilder.with_members6  s   € ð  ˆŒØˆr   c                 óÐ   — t        «       }d| j                  dœ}| j                  ||| j                  «       t	        |¬«      }t        | j                  || j                     |¬«      S )z™Build the model based on the provided members.

        :rtype: botocore.model.StructureShape
        :return: The built StructureShape object.

        r>  )rF   ru   )rD  )rP   rQ   rR   )r   rb  Ú_build_modelrI   rŸ   rs   )r!   r�   ÚdenormalizedÚresolvers       r   Úbuild_modelz(DenormalizedStructureBuilder.build_modelB  sa   € ô “ˆàØ—}‘}ñ
ˆð 	×Ñ˜,¨°·	±	Ô:Ü ¨6Ô2ˆÜØ—y‘yØ˜tŸy™yÑ)Ø#ô
ð 	
r   c                 ó$  — |d   dk(  r| j                  ||«      ||<   y |d   dk(  r| j                  ||«      ||<   y |d   dk(  r| j                  ||«      ||<   y |d   | j                  v r| j	                  |«      ||<   y t        d|d   › �«      ‚)NrF   r>  rµ   r?  zUnknown shape type: )Ú_build_structureÚ_build_listÚ
_build_mapÚSCALAR_TYPESÚ_build_scalarr   )r!   rW   r�   rP   s       r   re  z)DenormalizedStructureBuilder._build_modelV  s§   € Ø�‰=˜KÒ'Ø!%×!6Ñ!6°u¸fÓ!EˆF�:ÒØ�6‰]˜fÒ$Ø!%×!1Ñ!1°%¸Ó!@ˆF�:ÒØ�6‰]˜eÒ#Ø!%§¡°¸Ó!?ˆF�:ÒØ�6‰]˜d×/Ñ/Ñ/Ø!%×!3Ñ!3°EÓ!:ˆF�:Òä#Ð&:¸5À¹=¸/Ð$JÓKÐKr   c                 óü   — t        «       }| j                  |«      }||d<   |j                  dt        «       «      j                  «       D ]0  \  }}| j	                  |«      }d|i||<   | j                  |||«       Œ2 |S )Nru   r  )r   Ú_build_initial_shaperK   rv   Ú_get_shape_namere  )r!   rW   r�   ru   r  rI   Úmember_modelÚmember_shape_names           r   rj  z-DenormalizedStructureBuilder._build_structureb  s‰   € Ü“-ˆØ×)Ñ)¨%Ó0ˆØ"ˆˆiÑà"'§)¡)¨I´{³}Ó"E×"KÑ"KÓ"Mò 	GÑˆD�,Ø $× 4Ñ 4°\Ó BÐØ$Ð&7Ð8ˆG�D‰MØ×Ñ˜l¨FÐ4EÕFð	Gð ˆr   c                 ó„   — | j                  |«      }| j                  |«      }d|i|d<   | j                  |d   ||«       |S )Nr  rz   ©rq  rp  re  )r!   rW   r�   rs  r  s        r   rk  z(DenormalizedStructureBuilder._build_listm  sN   € Ø ×0Ñ0°Ó7ÐØ×)Ñ)¨%Ó0ˆØ"Ð$5Ð6ˆˆh‰Ø×Ñ˜% ™/¨6Ð3DÔEØˆr   c                 óì   — | j                  |d   «      }| j                  |d   «      }| j                  |«      }d|i|d<   d|i|d<   | j                  |d   ||«       | j                  |d   ||«       |S )NrŠ   rŒ   r  ru  )r!   rW   r�   Úkey_shape_nameÚvalue_shape_namer  s         r   rl  z'DenormalizedStructureBuilder._build_mapt  sŠ   € Ø×-Ñ-¨e°E©lÓ;ˆØ×/Ñ/°°g±Ó?ÐØ×)Ñ)¨%Ó0ˆØ Ð0ˆˆe‰Ø!Ð#3Ð4ˆˆg‰Ø×Ñ˜% ™,¨°Ô?Ø×Ñ˜% ™.¨&Ð2BÔCØˆr   c                 óp   — d|d   i}d|v r|d   |d<   t         j                  D ]  }||v sŒ||   ||<   Œ |S )NrF   rG   )r$   r[   )r!   rW   r  rY   s       r   rp  z1DenormalizedStructureBuilder._build_initial_shape~  s[   € à�E˜&‘Mð
ˆð ˜eÑ#Ø%*¨?Ñ%;ˆE�/Ñ"Ü×(Ñ(ò 	*ˆDØ�uŠ}Ø# D™k��d’ð	*ð ˆr   c                 ó$   — | j                  |«      S r   )rp  ©r!   rW   s     r   rn  z*DenormalizedStructureBuilder._build_scalar‰  s   € Ø×(Ñ(¨Ó/Ð/r   c                 óP   — d|v r|d   S | j                   j                  |d   «      S )NrP   rF   )r_  r`  r{  s     r   rq  z,DenormalizedStructureBuilder._get_shape_nameŒ  s0   € Ø˜5Ñ Ø˜Ñ&Ð&à×'Ñ'×6Ñ6°u¸V±}ÓEÐEr   r   )r   r   r   ro   rm  rS   rc  rh  re  rj  rk  rl  rp  rn  rq  r   r   r   rU  rU  ÿ  sD   „ ñ"ðH
€LóIò
ò
ò(
Lò	òòò	ò0óFr   rU  c                   ó   — e Zd ZdZd„ Zd„ Zy)r^  z³Generate unique shape names for a type.

    This class can be used in conjunction with the DenormalizedStructureBuilder
    to generate unique shape names for a given type.

    c                 ó,   — t        t        «      | _        y r   )r   ÚintÚ_name_cacher    s    r   rS   zShapeNameGenerator.__init__›  s   € Ü&¤sÓ+ˆÕr   c                 óx   — | j                   |xx   dz  cc<   | j                   |   }|j                  «       › d|› �S )aŸ  Generate a unique shape name.

        This method will guarantee a unique shape name each time it is
        called with the same type.

        ::

            >>> 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

        rL  ÚType)r€  Ú
capitalize)r!   rJ   Úcurrent_indexs      r   r`  z!ShapeNameGenerator.new_shape_namež  sE   € ð4 	×Ñ˜Ó# qÑ(Ó#Ø×(Ñ(¨Ñ3ˆØ×&Ñ&Ó(Ð)¨¨m¨_Ð=Ð=r   N)r   r   r   ro   rS   r`  r   r   r   r^  r^  “  s   „ ñò,ó>r   r^  N)&ro   Úcollectionsr   Útypingr   r   Úbotocore.compatr   Úbotocore.exceptionsr   r   Úbotocore.utilsr	   r
   r   Úobjectr    Ú	Exceptionr   r   r   r   r’   r   r$   rs   r„   rˆ   rŽ   r‘   r–   r™   r›   r½   rŸ   rM   rU  r^  r   r   r   ú<module>rŒ     s  ðñ 4Ý #ß $å '÷÷ PÑ Oá
‹(€ô	˜	ô 	ô	˜	ô 	ô	˜Yô 	ô	 ô 	ô*�ô *÷
bñ bôJ'1�Uô '1ôTD�ô DôCˆuô Cô-�%ô -ô˜Zô ô
�zô ô
˜Zô ÷{Añ {A÷|T>ñ T>÷n3Eñ 3E÷l
ñ 
÷QFñ QF÷h'>ò '>r   