Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/boto3/resources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/boto3/resources/__pycache__/response.cpython-38.pyc
U

Q��gv-�@sZddlZddlmZddlmZdd�Zddd�Zd	d
�ZGdd�d�ZGd
d�d�Z	dS)�N)�
xform_name�)�get_data_membercCs|D]}|dkrdSqdS)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�elementrr�E/opt/cppython/lib/python3.8/site-packages/boto3/resources/response.py�all_not_nonesr	c	Cs�g}|D]�}|j}|j}|dkr0t�|j|�}nb|dkrHt�|j|�}nJ|dkrbt|t|j��}n0|dkrxt||j�}n|dkr�qnt	d|����|�
t|�|f�q|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.
    �responseZrequestParameter�
identifier�data�inputzUnsupported source type: )�source�target�jmespath�search�path�getattrr�namer�NotImplementedError�append)	�identifiers�parent�params�raw_response�resultsrrr�valuerrr�build_identifiers s"rcCs�d}|�|�}|j}|rp|�d�D]L}|�d�}|jdkrF|j|}q"|jdkrX|j}q"td|j�d|����q"|jdkr�i}n|jdkr�g}n|jdkr�i}|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]$Z	structure�listzSearch path hits shape type z from �map)�operation_modelZoutput_shape�split�strip�	type_name�members�memberr)�search_path�operation_name�
service_modelr
r!�shape�itemrrr�build_empty_responseNs(



�


r,c@s eZdZdZdd�Zdd�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
    cCs
||_dS�N)r')�selfr'rrr�__init__�szRawHandler.__init__cCs"|jr|jdkrt�|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)r/rrr
rrr�__call__�s
zRawHandler.__call__N)�__name__�
__module__�__qualname__�__doc__r0r3rrrrr-sr-c@s*eZdZdZd	dd�Zdd�Zdd�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).
    NcCs"||_||_||_||_||_dSr.)r'�factory�resource_modelr(�service_context)r/r'r9r:r;r(rrrr0�s
zResourceHandler.__init__c
	Cs�|jj}|jj�|�}|jj|||jd�}|}d}|jrFt�	|j|�}t
t|jj|||��}	dd�|	�
�D�}
|
r�g}tt|
d��D]*}d}|r�||}|�|�|||	|��q�n@t|	�
��r�|�|||	|�}n"d}|jdk	r�t|j|j|jj�}|S)r1)�
resource_nameZsingle_resource_json_definitionr;NcSsg|]}t|t�r|�qSr)�
isinstancer)�.0�vrrr�
<listcomp>�s
z,ResourceHandler.__call__.<locals>.<listcomp>r)r:�typer;Zresource_json_definitions�getr9Zload_from_definitionr'rr�dictrr�values�range�lenr�handle_response_itemr	r(r,r))
r/rrr
r<Zjson_definition�resource_clsrZsearch_responser�plural�iZ
response_itemrrrr3�sf	�������
�zResourceHandler.__call__c	CsXd|jji}|��D]$\}}t|t�r0|�d�}|||<q|f|�}|dk	rT||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.
        �clientrN)�metarK�itemsr=r�popr)	r/rHrrZ
resource_data�kwargsrr�resourcerrrrGs�



z$ResourceHandler.handle_response_item)N)r4r5r6r7r0r3rGrrrrr8�s
�
Tr8)NN)
rZbotocorerrrr	rr,r-r8rrrr�<module>s
.1

F1le Man4ger