o d@sRddlZddlZddlmZddlmZedZddZd dd Z d d d Z dS)N) xform_name)ResourceLoadExceptionz \[(.*)\]$cCsB|jjdurt|dr|n t|jjdt||jjS)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``. Nloadz has no load method!) metadatahasattrrr __class____name__jmespathsearch)parentpathrq/private/var/folders/v1/_jykv66s6qd26_69j1njbrl80000gr/T/pip-target-p1gutpg6/lib/python/boto3/resources/params.pyget_data_members    rcCs|duri}|jD];}|j}|j}|dkrt|t|j}n|dkr)t||j}n|dvr1|j}n |dkr6q t d|t ||||q |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)stringintegerbooleaninputzUnsupported source type: ) paramssourcetargetgetattrrnamerrvalueNotImplementedErrorbuild_param_structure)r Z request_modelrindexparamrrrrrrcreate_request_parameters3s  r!c CsP|}|d}t|D]\}}t|}|r|dr>|ddkr)|dd}nt|d}|dtt|d }nd}|dd}||vsQt||t sUg||<|dur_t||}t|||krv|| it|||ksg|t|dkr||||<q |||}q ||vri||<|t|dkr|||<q ||}q dS)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'}]}} .*Nz[]) split enumerateINDEX_REr groupintlenstr isinstancelistappend) rrrrpospartsipartresultrrrrds8       r)NN)N) rer Zbotocorer exceptionsrcompiler)rr!rrrrrs     1