� K�gv-��n�ddlZddlmZddlmZd�Zd d�Zd�ZGd�d ��ZGd �d ��Z dS) �N)� xform_name�)�get_data_memberc��|D]}|�dS�dS)z� Return True if all elements of the iterable are not None (or if the iterable is empty). This is like the built-in ``all``, except checks against None, so 0 and False are allowable values. NFT�)�iterable�elements �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/boto3/resources/response.py� all_not_noner s)�� ���� �?��5�5� � �4�c��g}|D]�}|j}|j}|dkrtj|j|��}n|dkrtj|j|��}n^|dkr#t |t |j����}n5|dkrt||j��}n|dkr��td|�����|� t |��|f����|S)a� Builds a mapping of identifier names to values based on the identifier source location, type, and target. Identifier values may be scalars or lists depending on the source type and location. :type identifiers: list :param identifiers: List of :py:class:`~boto3.resources.model.Parameter` definitions :type parent: ServiceResource :param parent: The resource instance to which this action is attached. :type params: dict :param params: Request parameters sent to the service. :type raw_response: dict :param raw_response: Low-level operation response. :rtype: list :return: An ordered list of ``(name, value)`` identifier tuples. �response�requestParameter� identifier�data�inputzUnsupported source type: ) �source�target�jmespath�search�path�getattrr�namer�NotImplementedError�append) � identifiers�parent�params� raw_response�resultsrrr�values r �build_identifiersr" s���&�G�!�4�4� ��"���"�� �Z� � ��O�J�O�\�B�B�E�E� �)� )� )��O�J�O�V�<�<�E�E� �|� #� #��F�J�z��$?�$?�@�@�E�E� �v� � �$�F�J�O�<�<�E�E� �w� � � �%�&J�&�&J�&J�K�K� K���� �6�*�*�E�2�3�3�3�3� �Nr c�|�d}|�|��}|j}|rr|�d��D]\}|�d��}|jdkr|j|}�0|jdkr|j}�Ctd|j�d|�����|jdkri}n|jdkrg}n |jdkri}|S) a� Creates an appropriate empty response for the type that is expected, based on the service model's shape type. For example, a value that is normally a list would then return an empty list. A structure would return an empty dict, and a number would return None. :type search_path: string :param search_path: JMESPath expression to search in the response :type operation_name: string :param operation_name: Name of the underlying service operation. :type service_model: :ref:`botocore.model.ServiceModel` :param service_model: The Botocore service model :rtype: dict, list, or None :return: An appropriate empty value N�.z [0123456789]$� structure�listzSearch path hits shape type z from �map)�operation_model� output_shape�split�strip� type_name�members�memberr)� search_path�operation_name� service_modelrr(�shape�items r �build_empty_responser4Ns��� �H�#�3�3�N�C�C�O� � (�E���  �%�%�c�*�*� � �D��:�:�o�.�.�D���+�-�-�� �d�+�����F�*�*�� ���)�P�5�?�P�P�$�P�P����  ��+�%�%���� ��F� "� "���� ��E� !� !��� �Or c��eZdZdZd�Zd�ZdS)� RawHandleraG A raw action response handler. This passed through the response dictionary, optionally after performing a JMESPath search if one has been defined for the action. :type search_path: string :param search_path: JMESPath expression to search in the response :rtype: dict :return: Service response c��||_dS�N)r/)�selfr/s r �__init__zRawHandler.__init__�s��&����r c�^�|jr%|jdkrtj|j|��}|S)�, :type parent: ServiceResource :param parent: The resource instance to which this action is attached. :type params: dict :param params: Request parameters sent to the service. :type response: dict :param response: Low-level operation response. �$)r/rr)r9rrrs r �__call__zRawHandler.__call__�s6�� � � C�� 0�C� 7� 7���t�'7��B�B�H��r N)�__name__� __module__� __qualname__�__doc__r:r>rr r r6r6s<������ � �'�'�'� � � � � r r6c�(�eZdZdZ dd�Zd�Zd�ZdS)�ResourceHandleraf Creates a new resource or list of new resources from the low-level response based on the given response resource definition. :type search_path: string :param search_path: JMESPath expression to search in the response :type factory: ResourceFactory :param factory: The factory that created the resource class to which this action is attached. :type resource_model: :py:class:`~boto3.resources.model.ResponseResource` :param resource_model: Response resource model. :type service_context: :py:class:`~boto3.utils.ServiceContext` :param service_context: Context about the AWS service :type operation_name: string :param operation_name: Name of the underlying service operation, if it exists. :rtype: ServiceResource or list :return: New resource instance(s). Nc�L�||_||_||_||_||_dSr8)r/�factory�resource_modelr0�service_context)r9r/rFrGrHr0s r r:zResourceHandler.__init__�s1��'����� �,���,���.����r c � �|jj}|jj�|��}|j�|||j���}|}d}|jrtj |j|��}tt|jj |||����} d�| � ��D��} | r_g}tt| d����D]9} d} |r|| } |�|�||| | �����:nht%| � ����r|�||| |��}n.d}|j�%t)|j|j|jj��}|S)r<)� resource_name�single_resource_json_definitionrHNc�<�g|]}t|t���|��Sr)� isinstancer&)�.0�vs r � <listcomp>z,ResourceHandler.__call__.<locals>.<listcomp>�s'��I�I�I��Z��4�5H�5H�I�!�I�I�Ir r)rG�typerH�resource_json_definitions�getrF�load_from_definitionr/rr�dictr"r�values�range�lenr�handle_response_itemr r0r4r1) r9rrrrJ�json_definition� resource_clsr�search_responser�plural�i� response_items r r>zResourceHandler.__call__�s����+�0� ��.�H�L�L� � � �� �|�8�8�'�,;� �0�9� � � �  � ��� � � N�&�o�d�.>� �M�M�O�� ��#�/���� � � � � �J�I�[�/�/�1�1�I�I�I�� �$ ��H��3�v�a�y�>�>�*�*� � ��!%� �"�7�$3�A�$6�M�����-�-�$�f�k�=������� ��+�,�,�.�.� /� /� ��0�0��f�k�?���H�H��H��"�.�0��$��'��(�6���� �r c���d|jji}|���D]4\}}t|t��r|�d��}|||<�5|di|��}|� ||j_|S)a� Handles the creation of a single response item by setting parameters and creating the appropriate resource instance. :type resource_cls: ServiceResource subclass :param resource_cls: The resource class to instantiate. :type parent: ServiceResource :param parent: The resource instance to which this action is attached. :type identifiers: dict :param identifiers: Map of identifier names to value or values. :type resource_data: dict or None :param resource_data: Data for resource attributes. :rtype: ServiceResource :return: New resource instance. �clientrNr)�metara�itemsrMr&�popr) r9r[rr� resource_data�kwargsrr!�resources r rYz$ResourceHandler.handle_response_items���& �f�k�(� ��'�,�,�.�.� !� !�K�D�%��%��&�&� %�� � �!� � �� �F�4�L�L��<�)�)�&�)�)�� � $�!.�H�M� ��r r8)r?r@rArBr:r>rYrr r rDrD�sY��������>� /� /� /� /�R�R�R�h"�"�"�"�"r rD)NN) r�botocorerrrr r"r4r6rDrr r �<module>ris�������������#�#�#�#�#�#� � � �+�+�+�+�\.�.�.�b��������>^�^�^�^�^�^�^�^�^�^r
Memory