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/dynamodb/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


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

Q��gm2�@s�ddlZddlmZddlmZddlmZmZddlm	Z	m
Z
dd�ZGdd	�d	e�Z
d
d�ZGdd
�d
�ZGdd�d�ZGdd�d�ZGdd�d�ZdS)�N)�collections_abc)�DocumentModifiedShape)�
ConditionBase�ConditionExpressionBuilder)�TypeDeserializer�TypeSerializercKs|�dt�dS)Nr)�insert�DynamoDBHighLevelResource)Zbase_classes�kwargs�r�E/opt/cppython/lib/python3.8/site-packages/boto3/dynamodb/transform.py�register_high_level_interfacesr
c@seZdZdZdd�ZdS)�_ForgetfulDictz�A dictionary that discards any items set on it. For use as `memo` in
    `copy.deepcopy()` when every instance of a repeated object in the deepcopied
    data structure should result in a separate copy.
    cCsdS�Nr)�self�key�valuerrr�__setitem__sz_ForgetfulDict.__setitem__N)�__name__�
__module__�__qualname__�__doc__rrrrrrsrcKstj|t�d�S)N)�memo)�copy�deepcopyr)�paramsr
rrr�copy_dynamodb_params#srcseZdZ�fdd�Z�ZS)r	cst�j||�|jjjjjdtdd�t�|_|jjjjjd|jj	dd�|jjjjjd|jj
dd�|jjjjjd|jjdd�td	d
ddd
�}tddddd
�}tddddd
�}|jjjjjd|j
dd�|jjjjjd|j
dd�|jjjjjd|j
dd�dS)Nzprovide-client-params.dynamodbzdynamodb-create-params-copy)�	unique_idzbefore-parameter-build.dynamodbzdynamodb-condition-expressionzdynamodb-attr-value-inputzafter-call.dynamodbzdynamodb-attr-value-output�AttributeValuezvalid DynamoDB typez�- The value of the attribute. The valid value types are listed in the :ref:`DynamoDB Reference Guide<ref_valid_dynamodb_types>`.z`'string'|123|Binary(b'bytes')|True|None|set(['string'])|set([123])|set([Binary(b'bytes')])|[]|{})�new_typeZnew_descriptionZnew_example_value�
KeyExpressionz?condition from :py:class:`boto3.dynamodb.conditions.Key` methodz�The condition(s) a key(s) must meet. Valid conditions are listed in the :ref:`DynamoDB Reference Guide<ref_dynamodb_conditions>`.zKey('mykey').eq('myvalue')�ConditionExpressionz@condition from :py:class:`boto3.dynamodb.conditions.Attr` methodz�The condition(s) an attribute(s) must meet. Valid conditions are listed in the :ref:`DynamoDB Reference Guide<ref_dynamodb_conditions>`.z!Attr('myattribute').eq('myvalue')z"docs.*.dynamodb.*.complete-sectionzdynamodb-attr-value-docszdynamodb-key-expression-docszdynamodb-cond-expression-docs)�super�__init__�meta�client�events�registerr�TransformationInjectorZ	_injector�inject_condition_expressions�inject_attribute_value_input�inject_attribute_value_outputrZ(replace_documentation_for_matching_shape)r�argsr
Zattr_value_shape_docsZkey_expression_shape_docsZcon_expression_shape_docs��	__class__rrr#(sn����������z"DynamoDBHighLevelResource.__init__)rrrr#�
__classcell__rrr-rr	'sr	c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)r(z>Injects the transformations into the user provided parameters.NcCs\||_|dkrt�|_||_|dkr,t�|_||_|dkrBt�|_||_|dkrXt�|_dSr)�_transformer�ParameterTransformer�_condition_builderr�_serializerr�
_deserializerr)rZtransformer�condition_builder�
serializerZdeserializerrrrr#�szTransformationInjector.__init__c	Ks�|j��i}i}t|j||dd�}|j�||j|d�t|j||dd�}|j�||j|d�d}d}||kr~||�|�n|r�|||<||kr�||�|�n|r�|||<dS)	a7Injects the condition expression transformation into the parameters

        This injection includes transformations for ConditionExpression shapes
        and KeyExpression shapes. It also handles any placeholder names and
        values that are generated when transforming the condition expressions.
        F)�placeholder_names�placeholder_values�is_key_conditionr!Tr ZExpressionAttributeNamesZExpressionAttributeValuesN)r2�reset�!ConditionExpressionTransformationr0�	transform�input_shape�update)	rr�modelr
Zgenerated_namesZgenerated_values�transformationZexpr_attr_names_inputZexpr_attr_values_inputrrrr)�sJ
����z3TransformationInjector.inject_condition_expressionscKs|j�||j|jjd�dS)z3Injects DynamoDB serialization into parameter inputrN)r0r<r=r3�	serialize)rrr?r
rrrr*�s�z3TransformationInjector.inject_attribute_value_inputcKs&|jdk	r"|j�||j|jjd�dS)z/Injects DynamoDB deserialization into responsesNr)Zoutput_shaper0r<r4Zdeserialize)r�parsedr?r
rrrr+�s
�z4TransformationInjector.inject_attribute_value_output)NNNN)rrrrr#r)r*r+rrrrr(�s�
2	r(c@s"eZdZdZddd�Zdd�ZdS)	r;z�Provides a transformation for condition expressions

    The ``ParameterTransformer`` class can call this class directly
    to transform the condition expressions in the parameters provided.
    FcCs||_||_||_||_dSr)r2�_placeholder_names�_placeholder_values�_is_key_condition)rr5r7r8r9rrrr#�sz*ConditionExpressionTransformation.__init__cCsBt|t�r>|jj||jd�}|j�|j�|j�|j	�|j
S|S)N)r9)�
isinstancerr2Zbuild_expressionrErCr>Zattribute_name_placeholdersrDZattribute_value_placeholdersZcondition_expression)rrZbuilt_expressionrrr�__call__�s
���z*ConditionExpressionTransformation.__call__N)F)rrrrr#rGrrrrr;�s�
r;c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r1z?Transforms the input to and output from botocore based on shapecCs|�||||�dS)a�Transforms the dynamodb input to or output from botocore

        It applies a specified transformation whenever a specific shape name
        is encountered while traversing the parameters in the dictionary.

        :param params: The parameters structure to transform.
        :param model: The operation model.
        :param transformation: The function to apply the parameter
        :param target_shape: The name of the shape to apply the
            transformation to
        N)�_transform_parameters)rrr?r@�target_shaperrrr<szParameterTransformer.transformcCs,|j}|dkr(t|d|���||||�dS)N)Z	structure�map�listZ_transform_)�	type_name�getattr)rr?rr@rIrLrrrrH#s�z*ParameterTransformer._transform_parameterscCsft|tj�sdS|D]L}||jkr|j|}|j}||krL|||�||<q|�|||||�qdSr)rFr�Mapping�members�namerH)rr?rr@rI�param�member_model�member_shaperrr�_transform_structure,s

�z)ParameterTransformer._transform_structurec	Cs\t|tj�sdS|j}|j}|��D]2\}}||krB||�||<q$|�|||||�q$dSr)rFrrNrrP�itemsrH)	rr?rr@rIZvalue_modelZvalue_shaperrrrr�_transform_map?s�z#ParameterTransformer._transform_mapc	Cs\t|tj�sdS|j}|j}t|�D]2\}}||krB||�||<q$|�|||||�q$dSr)rFr�MutableSequence�memberrP�	enumeraterH)	rr?rr@rIrRrS�i�itemrrr�_transform_listLs�z$ParameterTransformer._transform_listN)	rrrrr<rHrTrVr\rrrrr1s	
r1)rZboto3.compatrZboto3.docs.utilsrZboto3.dynamodb.conditionsrrZboto3.dynamodb.typesrrr
�dictrrr	r(r;r1rrrr�<module>
s
d`'

F1le Man4ger