
    vKgm2                         S SK r S SKJr  S SKJr  S SKJrJr  S SKJ	r	J
r
  S r " S S\5      rS	 r " S
 S5      r " S S5      r " S S5      r " S S5      rg)    N)collections_abc)DocumentModifiedShape)ConditionBaseConditionExpressionBuilder)TypeDeserializerTypeSerializerc                 0    U R                  S[        5        g )Nr   )insertDynamoDBHighLevelResource)base_classeskwargss     X/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/boto3/dynamodb/transform.pyregister_high_level_interfacer      s    45    c                       \ rS rSrSrS rSrg)_ForgetfulDict   zA 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.
c                     g N )selfkeyvalues      r   __setitem___ForgetfulDict.__setitem__   s    r   r   N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes__r   r   r   r   r      s    
r   r   c                 <    [         R                  " U [        5       S9$ )N)memo)copydeepcopyr   )paramsr   s     r   copy_dynamodb_paramsr'   #   s    ==n&677r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   '   c                 f  > [         TU ]  " U0 UD6  U R                  R                  R                  R                  R                  S[        SS9  [        5       U l        U R                  R                  R                  R                  R                  SU R                  R                  SS9  U R                  R                  R                  R                  R                  SU R                  R                  SS9  U R                  R                  R                  R                  R                  SU R                  R                  SS9  [        S	S
SSS9n[        SSSSS9n[        SSSSS9nU R                  R                  R                  R                  R                  SUR                  SS9  U R                  R                  R                  R                  R                  SUR                  SS9  U R                  R                  R                  R                  R                  SUR                  SS9  g )Nzprovide-client-params.dynamodbzdynamodb-create-params-copy)	unique_idzbefore-parameter-build.dynamodbzdynamodb-condition-expressionzdynamodb-attr-value-inputzafter-call.dynamodbzdynamodb-attr-value-outputAttributeValuezvalid 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_typenew_descriptionnew_example_valueKeyExpressionz?condition from :py:class:`boto3.dynamodb.conditions.Key` methodzThe condition(s) a key(s) must meet. Valid conditions are listed in the :ref:`DynamoDB Reference Guide<ref_dynamodb_conditions>`.zKey('mykey').eq('myvalue')ConditionExpressionz@condition from :py:class:`boto3.dynamodb.conditions.Attr` methodzThe 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-sectionzdynamodb-attr-value-docszdynamodb-key-expression-docszdynamodb-cond-expression-docs)super__init__metaclienteventsregisterr'   TransformationInjector	_injectorinject_condition_expressionsinject_attribute_value_inputinject_attribute_value_outputr   (replace_documentation_for_matching_shape)r   argsr   attr_value_shape_docskey_expression_shape_docscon_expression_shape_docs	__class__s         r   r3   "DynamoDBHighLevelResource.__init__(   s   $)&) 			$$--, 3 	. 	
 01 			$$---NN775 	. 	
 			$$---NN771 	. 	
 			$$--!NN882 	. 	
 !6*M
>!
 %:L ?%
! %:!L F%
! 			$$--0!JJ0 	. 	
 			$$--0%NN4 	. 	
 			$$--0%NN5 	. 	
r   )r9   )r   r   r   r   r3   r!   __classcell__)rB   s   @r   r   r   '   s    `
 `
r   r   c                   <    \ rS rSrSr    S	S jrS rS rS rSr	g)
r8      z>Injects the transformations into the user provided parameters.Nc                     Xl         Uc  [        5       U l         X l        Uc  [        5       U l        X0l        Uc  [        5       U l        X@l        Uc  [        5       U l        g g r   )_transformerParameterTransformer_condition_builderr   _serializerr   _deserializerr   )r   transformercondition_builder
serializerdeserializers        r   r3   TransformationInjector.__init__   se     ( 4 6D"3$&@&BD#%-/D)!1!3D  r   c                    U R                   R                  5         0 n0 n[        U R                   UUSS9nU R                  R	                  XR
                  US5        [        U R                   UUSS9nU R                  R	                  XR
                  US5        SnSnXq;   a  X   R                  U5        OU(       a  XAU'   X;   a  X   R                  U5        gU(       a  XQU'   gg)	a  Injects 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_conditionr1   Tr0   ExpressionAttributeNamesExpressionAttributeValuesN)rJ   reset!ConditionExpressionTransformationrH   	transforminput_shapeupdate)	r   r&   modelr   generated_namesgenerated_valuestransformationexpr_attr_names_inputexpr_attr_values_inputs	            r   r:   3TransformationInjector.inject_condition_expressions   s     	%%' ;##-/"	
 	##%%~7L	

 ;##-/!	
 	##%%~	
 !;!< !*)00A0?,-!+*112BC1A-.  r   c                 |    U R                   R                  UUR                  U R                  R                  S5        g)z3Injects DynamoDB serialization into parameter inputr,   N)rH   rZ   r[   rK   	serialize)r   r&   r]   r   s       r   r;   3TransformationInjector.inject_attribute_value_input   s4    ##&&		
r   c                     UR                   b=  U R                  R                  UUR                   U R                  R                  S5        gg)z/Injects DynamoDB deserialization into responsesNr,   )output_shaperH   rZ   rL   deserialize)r   parsedr]   r   s       r   r<   4TransformationInjector.inject_attribute_value_output   sE    )''"""".. 	 *r   )rJ   rL   rK   rH   )NNNN)
r   r   r   r   r    r3   r:   r;   r<   r!   r   r   r   r8   r8      s)    H 4.0Bd
r   r8   c                   *    \ rS rSrSr SS jrS rSrg)rY      zProvides a transformation for condition expressions

The ``ParameterTransformer`` class can call this class directly
to transform the condition expressions in the parameters provided.
c                 4    Xl         X l        X0l        X@l        g r   )rJ   _placeholder_names_placeholder_values_is_key_condition)r   rN   rS   rT   rU   s        r   r3   *ConditionExpressionTransformation.__init__   s     #4"3#5 !1r   c                 "   [        U[        5      (       ay  U R                  R                  XR                  S9nU R
                  R                  UR                  5        U R                  R                  UR                  5        UR                  $ U$ )N)rU   )
isinstancer   rJ   build_expressionrq   ro   r\   attribute_name_placeholdersrp   attribute_value_placeholderscondition_expression)r   r   built_expressions      r   __call__*ConditionExpressionTransformation.__call__   s    e]++  $66GG(>(>  H   ##** << $$++ == $888r   )rJ   rq   ro   rp   N)F)r   r   r   r   r    r3   rz   r!   r   r   r   rY   rY      s     
2r   rY   c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
rI   i  z?Transforms the input to and output from botocore based on shapec                 (    U R                  X!X45        g)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)r   r&   r]   r`   target_shapes        r   rZ   ParameterTransformer.transform  s     	""5.Or   c                 V    UR                   nUS;   a  [        U SU 35      " XX45        g g )N)	structuremaplist_transform_)	type_namegetattr)r   r]   r&   r`   r   r   s         r   r~   *ParameterTransformer._transform_parameters#  s6     OO	44DK	{34~ 5r   c                     [        U[        R                  5      (       d  g U HX  nXQR                  ;   d  M  UR                  U   nUR                  nXt:X  a  U" X%   5      X%'   MB  U R                  UX%   UU5        MZ     g r   )rt   r   Mappingmembersnamer~   )r   r]   r&   r`   r   parammember_modelmember_shapes           r   _transform_structure)ParameterTransformer._transform_structure,  sw     &/"9"9::E%$}}U3+00/$26=$AFM..$&$	 r   c                     [        U[        R                  5      (       d  g UR                  nUR                  nUR                  5        H+  u  pxXd:X  a  U" U5      X''   M  U R                  XRU   X45        M-     g r   )rt   r   r   r   r   itemsr~   )	r   r]   r&   r`   r   value_modelvalue_shaper   r   s	            r   _transform_map#ParameterTransformer._transform_map?  sg    &/"9"9::kk!&& ,,.JC*,U3**n	 )r   c                     [        U[        R                  5      (       d  g UR                  nUR                  n[        U5       H+  u  pxXd:X  a  U" U5      X''   M  U R                  XRU   X45        M-     g r   )rt   r   MutableSequencememberr   	enumerater~   )	r   r]   r&   r`   r   r   r   iitems	            r   _transform_list$ParameterTransformer._transform_listL  sf    &/"A"ABB||#(( (GA+*40	** )^	 )r   r   N)r   r   r   r   r    rZ   r~   r   r   r   r!   r   r   r   rI   rI     s    IP&r   rI   )r$   boto3.compatr   boto3.docs.utilsr   boto3.dynamodb.conditionsr   r   boto3.dynamodb.typesr   r   r   dictr   r'   r   r8   rY   rI   r   r   r   <module>r      s]     ( 2 O A6T 8a
 a
H] ]@$ $NE Er   