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/python37/lib/python3.7/site-packages/boto3/resources/__pycache__/params.cpython-37.pyc
B

�P�e��@sRddlZddlZddlmZddlmZe�d�Zdd�Zddd	�Z	d
d
d�Z
dS)�N)�
xform_name�)�ResourceLoadExceptionz	\[(.*)\]$cCsB|jjdkr2t|d�r |��nt|jj�d���t�||jj�S)aE
    Get a data member from a parent using a JMESPath search query,
    loading the parent if required. If the parent cannot be loaded
    and no data is present then an exception is raised.

    :type parent: ServiceResource
    :param parent: The resource instance to which contains data we
                   are interested in.
    :type path: string
    :param path: The JMESPath expression to query
    :raises ResourceLoadException: When no data is present and the
                                   resource cannot be loaded.
    :returns: The queried data or ``None``.
    N�loadz has no load method!)	�meta�data�hasattrrr�	__class__�__name__�jmespath�search)�parent�path�r�G/opt/alt/python37/lib/python3.7/site-packages/boto3/resources/params.py�get_data_members

rcCs�|dkri}x�|jD]x}|j}|j}|dkr>t|t|j��}n@|dkrTt||j�}n*|dkrd|j}n|dkrpqnt	d|����t
||||�qW|S)aX
    Handle request parameters that can be filled in from identifiers,
    resource data members or constants.

    By passing ``params``, you can invoke this method multiple times and
    build up a parameter dict over time, which is particularly useful
    for reverse JMESPath expressions that append to lists.

    :type parent: ServiceResource
    :param parent: The resource instance to which this action is attached.
    :type request_model: :py:class:`~boto3.resources.model.Request`
    :param request_model: The action request model.
    :type params: dict
    :param params: If set, then add to this existing dict. It is both
                   edited in-place and returned.
    :type index: int
    :param index: The position of an item within a list
    :rtype: dict
    :return: Pre-filled parameters to be sent to the request operation.
    N�
identifierr)�string�integer�boolean�inputzUnsupported source type: )�params�source�target�getattrr�namerr�value�NotImplementedError�build_param_structure)r
Z
request_modelr�index�paramrrrrrr�create_request_parameters3s r!c	CsV|}|�d�}�x@t|�D�]2\}}t�|�}|�r|�d�r�|�d�dkrZ|dd�}q�t|�d��}|dtt|�d��}nd}|dd�}||ks�t||t	�s�g||<|dkr�t||�}x"t||�|kr�||�
i�q�W|t|�dk�r
||||<n|||}q||k�r*i||<|t|�dk�rF|||<q||}qWdS)a
    This method provides a basic reverse JMESPath implementation that
    lets you go from a JMESPath-like string to a possibly deeply nested
    object. The ``params`` are mutated in-place, so subsequent calls
    can modify the same element by its index.

        >>> build_param_structure(params, 'test[0]', 1)
        >>> print(params)
        {'test': [1]}

        >>> build_param_structure(params, 'foo.bar[0].baz', 'hello world')
        >>> print(params)
        {'test': [1], 'foo': {'bar': [{'baz': 'hello, world'}]}}

    �.��*N���z[]���)�split�	enumerate�INDEX_REr�group�int�len�str�
isinstance�list�append)	rrrr�pos�parts�i�part�resultrrrrds4




r)NN)N)�rerZbotocorer�
exceptionsr�compiler)rr!rrrrr�<module>s

1