HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python311/lib/python3.11/site-packages/botocore/__pycache__/model.cpython-311.pyc
�

/�;f�w��p�dZddlmZddlmZmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZe��ZGd�de��ZGd	�d
e��ZGd�de��ZGd
�de��ZGd�de��ZGd�d��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�d e��ZGd!�d"��Z Gd#�d$��Z!Gd%�d&��Z"Gd'�d(��Z#Gd)�d*��Z$Gd+�d,��Z%d-S).z-Abstractions to interact with service models.�)�defaultdict)�
NamedTuple�Union)�OrderedDict)�MissingServiceIdError�UndefinedModelAttributeError)�CachedProperty�hyphenize_service_id�instance_cachec��eZdZdS)�NoShapeFoundErrorN��__name__�
__module__�__qualname__���A/opt/alt/python311/lib/python3.11/site-packages/botocore/model.pyr
r
��������Drr
c��eZdZdS)�InvalidShapeErrorNrrrrrrrrrc��eZdZdS)�OperationNotFoundErrorNrrrrrr#rrrc��eZdZdS)�InvalidShapeReferenceErrorNrrrrrr'rrrc��eZdZd�ZdS)�	ServiceIdc� �t|��S�N)r
��selfs r�	hyphenizezServiceId.hyphenize,s��#�D�)�)�)rN)rrrr"rrrrr+s#������*�*�*�*�*rrc��eZdZdZgd�Zgd�ZeZdd�Ze	d���Z
e	d���Ze	d���Zd	�Z
d
�Zed���ZdS)
�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|_|�dd��|_||_|�t��}||_i|_dS)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__zShape.__init__^s[��(��	�$�V�,���(�_�_�_�b�A�A���'����!�2�3�3�N�-�������rc��|j}i}|jD]}||jvr||||<�d|vr|�d��|d<|S)aSerialization 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    rrXzShape.serialization�si��.�!���
��)�	2�	2�D��t�(�(�(�&+�D�k�
�d�#���]�*�*�$1�$5�$5�n�$E�$E�M�&�!��rc�T�|j}i}|jD]}||jvr||||<�|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�metadatarYs    rr\zShape.metadata�sD��.�!�����'�	-�	-�D��t�(�(�(�!&�t�������rc�8�|j�dg��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\rKr s r�required_memberszShape.required_members�s���}� � ��R�0�0�0rc�6�|j�|��Sr�rN�resolve_shape_ref�r!�	shape_refs  r�_resolve_shape_refzShape._resolve_shape_ref�����#�5�5�i�@�@�@rc�2�d|jj�d|j�d�S)N�<�(z)>��	__class__rrIr s r�__repr__zShape.__repr__�s"��:�4�>�*�:�:�T�Y�:�:�:�:rc��dSrrr s r�event_stream_namezShape.event_stream_name�s���trr)rrr�__doc__rUr[r�MAP_TYPErSr	rXr\r_rerl�propertyrnrrrr$r$0s�������=�=�����&���N�$�H� � � � �D����^��@����^��:�1�1��^�1�A�A�A�;�;�;�����X���rr$c�|�eZdZed���Zed���Zed���Zed���Zed���ZdS)�StructureShapec���|j�d|�����}|���}|���D]\}}|�|��||<�|S)N�members)rLrKrp�itemsre)r!ru�
shape_membersrIrds     rruzStructureShape.members�so���#�'�'�	�4�=�=�?�?�C�C���
�
���
�&�}�}���	E�	E�O�D�)�"&�"9�"9�)�"D�"D�M�$����rc��|j���D]#\}}|j�d��r|cS�$dS)Nr/)rurvrXrK)r!�member_name�members   rrnz StructureShape.event_stream_name�sS��#'�<�#5�#5�#7�#7�	#�	#��K���#�'�'�
�6�6�
#�"�"�"�"�
#��trc��|j�dd��sdS|j�di��}|�d��}|r|S|jS)Nr=Fr<�code)r\rKrI)r!�error_metadatar|s   r�
error_codezStructureShape.error_code�s`���}� � ��e�4�4�	��4���*�*�7�B�7�7���!�!�&�)�)���	��K��y�rc�8�|j�dd��S)Nr@Fr^r s r�is_document_typezStructureShape.is_document_type�s���}� � ��U�3�3�3rc�8�|j�dd��S)NrAFr^r s r�is_tagged_unionzStructureShape.is_tagged_union�s���}� � ��%�0�0�0rN)	rrrr	rurnr~r�r�rrrrsrs�s�����������^������^������^���4�4��^�4��1�1��^�1�1�1rrsc�$�eZdZed���ZdS)�	ListShapec�B�|�|jd��S)Nrz�rerLr s rrzzListShape.members���&�&�t�'8��'B�C�C�CrN)rrrr	rzrrrr�r��s2�������D�D��^�D�D�Drr�c�:�eZdZed���Zed���ZdS)�MapShapec�B�|�|jd��S)N�keyr�r s rr�zMapShape.keys���&�&�t�'8��'?�@�@�@rc�B�|�|jd��S)N�valuer�r s rr�zMapShape.value
s���&�&�t�'8��'A�B�B�BrN)rrrr	r�r�rrrr�r�sP�������A�A��^�A��C�C��^�C�C�Crr�c�$�eZdZed���ZdS)�StringShapec�8�|j�dg��S)Nr:r^r s rr:zStringShape.enums���}� � ���,�,�,rN)rrrr	r:rrrr�r�s-�������-�-��^�-�-�-rr�c�4�eZdZUeed<eeefed<dS)�StaticContextParameterrIr�N)rrr�str�__annotations__r�boolrrrr�r�s0�������

�I�I�I���s�������rr�c�$�eZdZUeed<eed<dS)�ContextParameterrIryN�rrrr�r�rrrr�r�s'�������

�I�I�I������rr�c�.�eZdZUeed<eed<eed<dS)�ClientContextParameterrIrFrGNr�rrrr�r�s0�������

�I�I�I�

�I�I�I������rr�c��eZdZdZdd�Zdd�Zd�Zed���Zd�Z	ed���Z
ed	���Zed
���Z
ed���Zed���Zed
���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zd�Zed���Zejd���Zd�ZdS)�ServiceModelzQ

    :ivar service_description: The parsed service description dictionary.

    Nc���||_|�di��|_t|�di����|_t
|_||_i|_dS)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_descriptionrKr\�
ShapeResolverrN�NOT_SET�_signature_version�
_service_name�_instance_cache)r!�service_description�service_names   rrSzServiceModel.__init__,sh��*%8��!�+�/�/�
�B�?�?��
�,��#�#�H�b�1�1� 
� 
���#*���)���!����rc�8�|j�||��Sr)rN�get_shape_by_name�r!rP�
member_traitss   r�	shape_forzServiceModel.shape_forKs"���#�5�5��
�
�
�	
rc�8�|j�|d��Sr)�_error_code_cacherK)r!r~s  r�shape_for_error_codez!ServiceModel.shape_for_error_codePs���%�)�)�*�d�;�;�;rc�6�i}|jD]}|j}|||<�|Sr)�error_shapesr~)r!�error_code_cache�error_shaper|s    rr�zServiceModel._error_code_cacheSs6�����,�	1�	1�K��)�D�%0��T�"�"��rc�6�|j�|��Srrarcs  rrbzServiceModel.resolve_shape_ref[rfrc�R�t|j�di����S)Nr���listr�rKr s r�shape_nameszServiceModel.shape_names^s#���D�-�1�1�(�B�?�?�@�@�@rc��g}|jD]G}|�|��}|j�dd��r|�|���H|S)Nr=F)r�r�r\rK�append)r!r�rPr�s    rr�zServiceModel.error_shapesbs`�����*�	1�	1�J��.�.��4�4�K��#�'�'��U�;�;�
1��#�#�K�0�0�0���rc��	|jd|}n#t$rt|���wxYwt|||��S�N�
operations)r��KeyErrorr�OperationModel)r!�operation_namerWs   r�operation_modelzServiceModel.operation_modelksV��	9��-�l�;�N�K�E�E���	9�	9�	9�(��8�8�8�	9�����e�T�>�:�:�:s��0c�8�|j�dd��S�NrGrH)r�rKr s rrGzServiceModel.documentationss���(�,�,�_�b�A�A�Arc�R�t|j�dg����Sr�r�r s r�operation_nameszServiceModel.operation_namesws#���D�-�1�1�,��C�C�D�D�Drc�,�|j�|jS|jS)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 rr�zServiceModel.service_name{s����)��%�%��'�'rc��	t|�d����S#t$rt|j����wxYw)N�	serviceId)r�)r�_get_metadata_propertyrrr�r s r�
service_idzServiceModel.service_id�sW��	I��T�8�8��E�E�F�F�F��+�	I�	I�	I�'�T�5G�H�H�H�H�	I���s	�!$� Ac�L�|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\rKr�)r!�signing_names  rr�zServiceModel.signing_name�s-���}�(�(��7�7�����/�L��rc�,�|�d��S)N�
apiVersion�r�r s r�api_versionzServiceModel.api_version�s���*�*�<�8�8�8rc�,�|�d��S)N�protocolr�r s rr�zServiceModel.protocol�s���*�*�:�6�6�6rc�,�|�d��S)N�endpointPrefixr�r s rr�zServiceModel.endpoint_prefix�s���*�*�+;�<�<�<rc�Z�|jD]"}|�|��}|jr|cS�#dSr)r�r��is_endpoint_discovery_operation�r!�	operationrWs   r�endpoint_discovery_operationz)ServiceModel.endpoint_discovery_operation�sJ���-�	�	�I��(�(��3�3�E��4�
�����
�	�	rc��|jD];}|�|��}|j�|j�d��rdS�<dS)Nr5TF)r�r��endpoint_discoveryrKr�s   r�endpoint_discovery_requiredz(ServiceModel.endpoint_discovery_required�sX���-�	�	�I��(�(��3�3�E��(�4��,�0�0��<�<�5��t�t���urc�t�|j�di��}d�|���D��S)NrCc�P�g|]#\}}t||d|d�����$S)rFrG)rIrFrG)r�)�.0�
param_name�	param_vals   r�
<listcomp>z:ServiceModel.client_context_parameters.<locals>.<listcomp>�sP��
�
�
�&�
�I�
#���v�&�'��8�
�
�
�
�
�
r)r�rKrv�r!�paramss  r�client_context_parametersz&ServiceModel.client_context_parameters�sF���*�.�.�/D�b�I�I��
�
�*0�����

�
�
�	
rc�d�	|j|S#t$rtd|�d|�����wxYw)N�"z," not defined in the metadata of the model: )r\r�r�r!rIs  rr�z#ServiceModel._get_metadata_property�sT��	��=��&�&���	�	�	�.�L�D�L�L�d�L�L���
�	���s�� /c�n�|jtur!|j�d��}||_|jS)N�signatureVersion)r�r�r\rK)r!�signature_versions  rr�zServiceModel.signature_version�s8���"�g�-�-� $�
� 1� 1�2D� E� E��&7�D�#��&�&rc��||_dSr)r�)r!r�s  rr�zServiceModel.signature_version�s��"'����rc�0�|jj�d|j�d�S)Nri�))rkrr�r s rrlzServiceModel.__repr__�s!���.�)�@�@�D�,=�@�@�@�@rr)rrrrorSr�r�r	r�rbr�r�rr�rGr�r�r�r�r�r�r�r�r�r�r�rqr��setterrlrrrr�r�%se��������"�"�"�"�>
�
�
�
�
<�<�<�� � ��^� �A�A�A��A�A��^�A�����^���;�;��^�;��B�B��^�B��E�E��^�E��(�(��^�(� �I�I��^�I��	�	��^�	��9�9��^�9��7�7��^�7��=�=��^�=�����^������^���	
�	
��^�	
�����'�'��X�'���(�(���(�A�A�A�A�Arr�c�$�eZdZd d�Zed���Zed���Zed���Zed���Z	ed���Z
ed���Zed	���Zed
���Z
ed���Zed���Zed
���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zed���Zd�Zd�Zd�Zed���Zed���Zd�Zd�Z d�Z!d�Z"dS)!r�Nc��||_||_||_|�d��|_|j|_|�di��|_dS)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_modelrIs    rrSzOperationModel.__init__�sW��8!0���+������*�-�-�f�5�5���%�.��
�#�'�'���3�3��	�	�	rc�,�|j�|jS|jSr)r��	wire_namer s rrIzOperationModel.name	s���>�%��>�!��>�!rc�6�|j�d��S)aRThe 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�rKr s rr�zOperationModel.wire_names���$�(�(��0�0�0rc��|jSr)r�r s rr�zOperationModel.service_models���"�"rc�8�|j�dd��Sr�r�r s rrGzOperationModel.documentation"s���$�(�(��"�=�=�=rc�8�|j�dd��S)N�
deprecatedFr�r s rr�zOperationModel.deprecated&s���$�(�(��u�=�=�=rc�8�|j�dd��S)N�endpointdiscoveryr�r s rr�z!OperationModel.endpoint_discovery*s���$�(�(�)<�d�C�C�Crc�8�|j�dd��S)N�endpointoperationFr�r s rr�z.OperationModel.is_endpoint_discovery_operation0s���$�(�(�)<�e�D�D�Drc�b�d|jvrdS|j�|jd��S)N�input�r�r�rbr s r�input_shapezOperationModel.input_shape4s=���$�/�/�/��4��"�4�4��!�'�*�
�
�	
rc�b�d|jvrdS|j�|jd��S)N�outputrr s r�output_shapezOperationModel.output_shape>s=���4�0�0�0��4��"�4�4��!�(�+�
�
�	
rc�^�|j}|sgSd�|j���D��S)Nc�D�g|]\}}d|jv�|jd�|��S)r;)r\�r�rI�shapes   rr�z5OperationModel.idempotent_members.<locals>.<listcomp>OsC��
�
�
���u�!�U�^�3�3���1�2�4�
�3�3�3r�rrurv)r!rs  r�idempotent_membersz!OperationModel.idempotent_membersIsG���&���	��I�
�
�!,�!4�!:�!:�!<�!<�
�
�
�	
rc�t�|j�di��}d�|���D��S)N�staticContextParamsc�\�g|])\}}t||�d�������*S)r�)rIr�)r�rK)r�rI�propss   rr�z<OperationModel.static_context_parameters.<locals>.<listcomp>YsE��
�
�
���e�
#��E�I�I�g�4F�4F�G�G�G�
�
�
r)r�rKrvr�s  r�static_context_parametersz(OperationModel.static_context_parametersVsD���&�*�*�+@�"�E�E��
�
�%�|�|�~�~�
�
�
�	
rc�d�|jsgSd�|jj���D��S)Nc��g|]?\}}d|jvr1d|jdv�t|jdd|�����@S)rBrI)rIry)r\r�r
s   rr�z5OperationModel.context_parameters.<locals>.<listcomp>csj��
�
�
�
��e����/�/��%�.��8�8�8�

��^�N�3�F�;� �
�
�
�9�8�8rrr s r�context_parametersz!OperationModel.context_parameters^sG����	��I�
�
�
 $�/�7�=�=�?�?�
�
�
�	
rc�6�|j�d��S)N�requestcompressionr�r s r�request_compressionz"OperationModel.request_compressionms���$�(�(�)=�>�>�>rc�6�|j�d��S)N�authtyper�r s r�	auth_typezOperationModel.auth_typeq����$�(�(��4�4�4rc�p���j�dg��}t�fd�|D����S)N�errorsc3�L�K�|]}�j�|��V��dSr)r�rb)r��sr!s  �r�	<genexpr>z.OperationModel.error_shapes.<locals>.<genexpr>xs4�����M�M��D�'�9�9�!�<�<�M�M�M�M�M�Mr)r�rKr�)r!r�s` rr�zOperationModel.error_shapesus>����&�*�*�8�R�8�8���M�M�M�M�f�M�M�M�M�M�Mrc�6�|j�d��S)N�endpointr�r s rr&zOperationModel.endpointzrrc�8�|j�dd��S)N�httpChecksumRequiredFr�r s r�http_checksum_requiredz%OperationModel.http_checksum_required~s���$�(�(�)?��G�G�Grc�8�|j�di��S)N�httpChecksumr�r s r�
http_checksumzOperationModel.http_checksum�s���$�(�(���<�<�<rc�.�|���duSr)�get_event_stream_inputr s r�has_event_stream_inputz%OperationModel.has_event_stream_input�s���*�*�,�,�D�8�8rc�.�|���duSr)�get_event_stream_outputr s r�has_event_stream_outputz&OperationModel.has_event_stream_output�s���+�+�-�-�T�9�9rc�6�|�|j��Sr)�_get_event_streamrr s rr.z%OperationModel.get_event_stream_input�s���%�%�d�&6�7�7�7rc�6�|�|j��Sr)r4r
r s rr1z&OperationModel.get_event_stream_output�s���%�%�d�&7�8�8�8rc�:�|�dS|j}|r
|j|SdS)zAReturns the event stream member's shape if any or None otherwise.N)rnru)r!r�
event_names   rr4z OperationModel._get_event_stream�s.���=��4��,�
��	-��=��,�,��trc�.�|���duSr)�get_streaming_inputr s r�has_streaming_inputz"OperationModel.has_streaming_input�s���'�'�)�)��5�5rc�.�|���duSr)�get_streaming_outputr s r�has_streaming_outputz#OperationModel.has_streaming_output�s���(�(�*�*�$�6�6rc�6�|�|j��Sr)�_get_streaming_bodyrr s rr9z"OperationModel.get_streaming_input�s���'�'��(8�9�9�9rc�6�|�|j��Sr)r?r
r s rr<z#OperationModel.get_streaming_output�s���'�'��(9�:�:�:rc�z�|�dS|j�d��}|�|j|}|jdkr|SdS)z?Returns the streaming member's shape if any; or None otherwise.Nr)�blob)rXrKrurJ)r!rr)�
payload_shapes    rr?z"OperationModel._get_streaming_body�sM���=��4��%�)�)�)�4�4����!�M�'�2�M��&�&�0�0�$�$��trc�0�|jj�d|j�d�S)Nz(name=r�rjr s rrlzOperationModel.__repr__�s ���.�)�=�=���=�=�=�=rr)#rrrrSr	rIrqr�r�rGr�r�r�rr
rrrrrr�r&r)r,r/r2r.r1r4r:r=r9r<r?rlrrrr�r��s�������#4�#4�#4�#4�J�"�"��^�"��1�1��X�1��#�#��X�#��>�>��^�>��>�>��^�>��D�D��^�D�
�E�E��^�E��
�
��^�
��
�
��^�
��

�

��^�

��
�
��^�
��
�
��^�
��?�?��^�?��5�5��^�5��N�N��^�N��5�5��^�5��H�H��^�H��=�=��^�=��9�9��^�9��:�:��^�:�8�8�8�9�9�9�����6�6��^�6��7�7��^�7�:�:�:�;�;�;�	�	�	�>�>�>�>�>rr�c�4�eZdZdZeeeed�Zd�Z	dd�Z
d�ZdS)r�zResolves shape references.)�	structurer��map�stringc�"�||_i|_dSr)�
_shape_map�_shape_cache)r!�	shape_maps  rrSzShapeResolver.__init__�s��#�������rNc�^�	|j|}n#t$rt|���wxYw	|j�|dt
��}n #t$rt
d|�����wxYw|r)|���}|�|��||||��}|S)NrFz&Shape is missing required key 'type': )	rJr�r
�
SHAPE_CLASSESrKr$r�copy�update)r!rPr�rQ�	shape_cls�results      rr�zShapeResolver.get_shape_by_name�s���	0��/�*�5�K�K���	0�	0�	0�#�J�/�/�/�	0����	��*�.�.�{�6�/B�E�J�J�I�I���	�	�	�#�F��F�F���
�	�����	.�%�*�*�,�,�K����}�-�-�-���:�{�D�9�9���
s�
�*�&A�A2c�(�t|��dkrd|vr|�|d��S|���}	|�d��}n #t$rtd|�����wxYw|�||��S)N�rz(Invalid model, missing shape reference: )�lenr�rOrVr�r)r!rdr�rPs    rrbzShapeResolver.resolve_shape_ref�s����y�>�>�Q���7�i�#7�#7��)�)�)�G�*<�=�=�=�%�N�N�,�,�M�
�*�.�.�w�7�7�
�
���
�
�
�0�J�y�J�J����
�����)�)�*�m�D�D�Ds�A�A;r)rrrrorsr�r�r�rNrSr�rbrrrr�r��sk������$�$�$����	��M��������"E�E�E�E�Err�c� �eZdZdZdd�Zd�ZdS)rMzEA ShapeResolver that will throw ValueErrors when shapes are resolved.Nc�(�td|�d����)NzAttempted to lookup shape '�!', but no shape map was provided.��
ValueErrorr�s   rr�z&UnresolvableShapeMap.get_shape_by_name�s"���W�*�W�W�W�
�
�	
rc�(�td|�d����)NzAttempted to resolve shape 'rXrYrcs  rrbz&UnresolvableShapeMap.resolve_shape_ref�s*���
!�9�
!�
!�
!�
�
�	
rr)rrrror�rbrrrrMrM�s=������O�O�
�
�
�
�

�
�
�
�
rrMc�T�eZdZdZdZdd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�ZdS)�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.

    )	rH�integer�booleanrB�float�	timestamp�long�double�charNc��t��|_t��|_|�!|j�d��|_dSdS)NrF)rru�ShapeNameGenerator�_name_generator�new_shape_namerIr�s  rrSz%DenormalizedStructureBuilder.__init__0sC��"�}�}���1�3�3����<��,�;�;�K�H�H�D�I�I�I��<rc��||_|S)zp

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

        :return: self

        )�_members)r!rus  r�with_membersz)DenormalizedStructureBuilder.with_members6s�� ��
��rc���t��}d|jd�}|�|||j��t	|���}t|j||j|���S)z�Build the model based on the provided members.

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

        rF)rFru)rL)rPrQrR)rrj�_build_modelrIr�rs)r!r��denormalized�resolvers    r�build_modelz(DenormalizedStructureBuilder.build_modelBsv��������}�
�
��	
���,���	�:�:�:� �6�2�2�2����y��t�y�)�#�
�
�
�	
rc�n�|ddkr|�||��||<dS|ddkr|�||��||<dS|ddkr|�||��||<dS|d|jvr|�|��||<dStd|d�����)NrFrFr�rGzUnknown shape type: )�_build_structure�_build_list�
_build_map�SCALAR_TYPES�
_build_scalarr)r!rWr�rPs    rrmz)DenormalizedStructureBuilder._build_modelVs�����=�K�'�'�!%�!6�!6�u�f�!E�!E�F�:����
�6�]�f�
$�
$�!%�!1�!1�%��!@�!@�F�:����
�6�]�e�
#�
#�!%�����!?�!?�F�:����
�6�]�d�/�
/�
/�!%�!3�!3�E�!:�!:�F�:����#�$J�5��=�$J�$J�K�K�Krc�0�t��}|�|��}||d<|�dt�������D]8\}}|�|��}d|i||<|�|||���9|S)Nrur)r�_build_initial_shaperKrv�_get_shape_namerm)r!rWr�rurrI�member_model�member_shape_names        rrrz-DenormalizedStructureBuilder._build_structurebs����-�-���)�)�%�0�0��"��i��"'�)�)�I�{�}�}�"E�"E�"K�"K�"M�"M�	G�	G��D�,� $� 4� 4�\� B� B��$�&7�8�G�D�M����l�F�4E�F�F�F�F��rc��|�|��}|�|��}d|i|d<|�|d||��|S)Nrrz�ryrxrm)r!rWr�r{rs     rrsz(DenormalizedStructureBuilder._build_listmsZ�� �0�0��7�7���)�)�%�0�0��"�$5�6��h�����%��/�6�3D�E�E�E��rc�,�|�|d��}|�|d��}|�|��}d|i|d<d|i|d<|�|d||��|�|d||��|S)Nr�r�rr})r!rWr��key_shape_name�value_shape_namers      rrtz'DenormalizedStructureBuilder._build_mapts����-�-�e�E�l�;�;���/�/��g��?�?���)�)�%�0�0����0��e��!�#3�4��g�����%��,���?�?�?����%��.�&�2B�C�C�C��rc�t�d|di}d|vr|d|d<tjD]}||vr||||<�|S)NrFrG)r$r[)r!rWrrYs    rrxz1DenormalizedStructureBuilder._build_initial_shape~s\���E�&�M�
���e�#�#�%*�?�%;�E�/�"��(�	*�	*�D��u�}�}�#�D�k��d����rc�,�|�|��Sr)rx�r!rWs  rrvz*DenormalizedStructureBuilder._build_scalar�s���(�(��/�/�/rc�Z�d|vr|dS|j�|d��S)NrPrF)rgrhr�s  rryz,DenormalizedStructureBuilder._get_shape_name�s3���5� � ���&�&��'�6�6�u�V�}�E�E�Err)rrrrorurSrkrprmrrrsrtrxrvryrrrr]r]�s�������"�"�H
�L�I�I�I�I�
�
�
�
�
�
�(
L�
L�
L�	�	�	�������	�	�	�0�0�0�F�F�F�F�Frr]c��eZdZdZd�Zd�ZdS)rfz�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�8�tt��|_dSr)r�int�_name_cacher s rrSzShapeNameGenerator.__init__�s��&�s�+�+����rc�x�|j|xxdz
cc<|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

        rT�Type)r��
capitalize)r!rJ�
current_indexs   rrhz!ShapeNameGenerator.new_shape_name�sP��4	
���#�#�#�q�(�#�#�#��(��3�
��&�&�(�(�=�=�m�=�=�=rN)rrrrorSrhrrrrfrf�s<��������,�,�,�>�>�>�>�>rrfN)&ro�collectionsr�typingrr�botocore.compatr�botocore.exceptionsrr�botocore.utilsr	r
r�objectr��	Exceptionr
rrrr�rr$rsr�r�r�r�r�r�r�r�r�rMr]rfrrr�<module>r�s��4�3�#�#�#�#�#�#�$�$�$�$�$�$�$�$�'�'�'�'�'�'���������P�O�O�O�O�O�O�O�O�O�
�&�(�(��	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�Y�	�	�	�	�	�	�	�	��	�	�	�*�*�*�*�*��*�*�*�
b�b�b�b�b�b�b�b�J'1�'1�'1�'1�'1�U�'1�'1�'1�TD�D�D�D�D��D�D�D�C�C�C�C�C�u�C�C�C�-�-�-�-�-�%�-�-�-������Z����
�����z����
�����Z����{A�{A�{A�{A�{A�{A�{A�{A�|T>�T>�T>�T>�T>�T>�T>�T>�n3E�3E�3E�3E�3E�3E�3E�3E�l
�
�
�
�
�
�
�
�QF�QF�QF�QF�QF�QF�QF�QF�h'>�'>�'>�'>�'>�'>�'>�'>�'>�'>r