HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/boto/dynamodb/__pycache__/batch.cpython-312.pyc
�

ckF[R&��h�ddlmZGd�de�ZGd�de�ZGd�de�ZGd�d	e�Zy
)�)�sixc�"�eZdZdZ		dd�Zd�Zy)�Batcha	
    Used to construct a BatchGet request.

    :ivar table: The Table object from which the item is retrieved.

    :ivar keys: A list of scalar or tuple values.  Each element in the
        list represents one Item to retrieve.  If the schema for the
        table has both a HashKey and a RangeKey, each element in the
        list should be a tuple consisting of (hash_key, range_key).  If
        the schema for the table contains only a HashKey, each element
        in the list should be a scalar value of the appropriate type
        for the table schema. NOTE: The maximum number of items that
        can be retrieved for a single operation is 100. Also, the
        number of items retrieved is constrained by a 1 MB size limit.

    :ivar attributes_to_get: A list of attribute names.
        If supplied, only the specified attribute names will
        be returned.  Otherwise, all attributes will be returned.

    :ivar consistent_read: Specify whether or not to use a
        consistent read. Defaults to False.

    Nc�<�||_||_||_||_y�N)�table�keys�attributes_to_get�consistent_read��selfrr	r
rs     �5/usr/lib/python3/dist-packages/boto/dynamodb/batch.py�__init__zBatch.__init__3s ����
���	�!2���.���c�l�i}g}|jD]h}t|t�r|\}}n|}d}|jjj|jj||�}|j|��j||d<|jr|j|d<|jrd|d<|Sd|d<|S)�O
        Convert the Batch object into the format required for Layer1.
        N�Keys�AttributesToGetT�ConsistentReadF)
r	�
isinstance�tupler�layer2�build_key_from_values�schema�appendr
r)r
�
batch_dict�key_list�key�hash_key�	range_key�ks       r�to_dictz
Batch.to_dict:s����
����9�9�	�C��#�u�%�&)�#��)��� �	��
�
�!�!�7�7��
�
�8I�8I�8@�)�M�A��O�O�A��	�&�
�6���!�!�,0�,B�,B�J�(�)����+/�J�'�(���,1�J�'�(��r�NF��__name__�
__module__�__qualname__�__doc__rr"�rrrrs���07;�!&�/�rrc��eZdZdZdd�Zd�Zy)�
BatchWritea
    Used to construct a BatchWrite request.  Each BatchWrite object
    represents a collection of PutItem and DeleteItem requests for
    a single Table.

    :ivar table: The Table object from which the item is retrieved.

    :ivar puts: A list of :class:`boto.dynamodb.item.Item` objects
        that you want to write to DynamoDB.

    :ivar deletes: A list of scalar or tuple values.  Each element in the
        list represents one Item to delete.  If the schema for the
        table has both a HashKey and a RangeKey, each element in the
        list should be a tuple consisting of (hash_key, range_key).  If
        the schema for the table contains only a HashKey, each element
        in the list should be a scalar value of the appropriate type
        for the table schema.
    Nc�>�||_|xsg|_|xsg|_yr)r�puts�deletes�r
rr-r.s    rrzBatchWrite.__init__gs����
��J�B��	��}�"��rc���g}|jD]>}d|jjj|�i}d|i}|j	|��@|j
D]n}t
|t�r|\}}n|}d}|jjj|jj||�}d|i}|j	d|i��p|jj|fS)r�Item�
PutRequestN�Key�
DeleteRequest)r-rr�
dynamize_itemrr.rrrr�name)r
�op_list�item�drrr r!s        rr"zBatchWrite.to_dictls������I�I�	�D�����*�*�8�8��>�?�A��q�!�A��N�N�1��	��<�<�		1�C��#�u�%�&)�#��)��� �	��
�
�!�!�7�7��
�
�8I�8I�8@�)�M�A���
�A��N�N�O�Q�/�0�		1��
�
����)�)r�NNr$r)rrr+r+Ss���&%�
*rr+c�4�eZdZdZd�Z		dd�Zd�Zd�Zd�Zy)	�	BatchListzs
    A subclass of a list object that contains a collection of
    :class:`boto.dynamodb.batch.Batch` objects.
    c�J�tj|�d|_||_yr)�listr�unprocessedr�r
rs  rrzBatchList.__init__�s���
�
�d�������rNc�>�|jt||||��y)aO
        Add a Batch to this BatchList.

        :type table: :class:`boto.dynamodb.table.Table`
        :param table: The Table object in which the items are contained.

        :type keys: list
        :param keys: A list of scalar or tuple values.  Each element in the
            list represents one Item to retrieve.  If the schema for the
            table has both a HashKey and a RangeKey, each element in the
            list should be a tuple consisting of (hash_key, range_key).  If
            the schema for the table contains only a HashKey, each element
            in the list should be a scalar value of the appropriate type
            for the table schema. NOTE: The maximum number of items that
            can be retrieved for a single operation is 100. Also, the
            number of items retrieved is constrained by a 1 MB size limit.

        :type attributes_to_get: list
        :param attributes_to_get: A list of attribute names.
            If supplied, only the specified attribute names will
            be returned.  Otherwise, all attributes will be returned.
        N)rrrs     r�	add_batchzBatchList.add_batch�s��0	
���E�%��'8�/�J�Krc�j�|dd�=|jsytj|j�D]p\}}|d}|jj	|�}g}|D]%}|d}d}d|vr|d}|j||f��'d}	d|vr|d}	|j
|||	���r|j�S)a
        Resubmit the batch to get the next result set. The request object is
        rebuild from scratch meaning that all batch added between ``submit``
        and ``resubmit`` will be lost.

        Note: This method is experimental and subject to changes in future releases
        Nr�HashKeyElement�RangeKeyElementr)r
)r?r�	iteritemsr�	get_tablerrB�submit)
r
�
table_name�	table_req�
table_keysrr	r�h�rr
s
          r�resubmitzBatchList.resubmit�s���
��G�����%(�]�]�4�3C�3C�%D�	M�!�J�	�"�6�*�J��K�K�)�)�*�5�E��D�!�
$���(�)����$��+��-�.�A����Q��F�#�
$�!%�� �I�-�$-�.?�$@�!��N�N�5�$�:K�N�L�!	M�$�{�{�}�rc�X�|jj|�}d|vr
|d|_|S)N�UnprocessedKeys)r�batch_get_itemr?)r
�ress  rrHzBatchList.submit�s1���k�k�(�(��.����#�"�#4�5�D���
rc�v�i}|D]1}|j�}|ds�|||jj<�3|S)zM
        Convert a BatchList object into format required for Layer1.
        r)r"rr6)r
r9�batch�bs    rr"zBatchList.to_dict�sE��
���	(�E��
�
��A���y�&'��%�+�+�"�"�#�	(��rr#)	r%r&r'r(rrBrNrHr"r)rrr<r<�s*���
�
8<�"'�L�4�B�	rr<c�*�eZdZdZd�Zdd�Zd�Zd�Zy)�BatchWriteListzx
    A subclass of a list object that contains a collection of
    :class:`boto.dynamodb.batch.BatchWrite` objects.
    c�<�tj|�||_yr)r>rrr@s  rrzBatchWriteList.__init__�s���
�
�d����rNc�<�|jt|||��y)aW
        Add a BatchWrite to this BatchWriteList.

        :type table: :class:`boto.dynamodb.table.Table`
        :param table: The Table object in which the items are contained.

        :type puts: list of :class:`boto.dynamodb.item.Item` objects
        :param puts: A list of items that you want to write to DynamoDB.

        :type deletes: A list
        :param deletes: A list of scalar or tuple values.  Each element
            in the list represents one Item to delete.  If the schema
            for the table has both a HashKey and a RangeKey, each
            element in the list should be a tuple consisting of
            (hash_key, range_key).  If the schema for the table
            contains only a HashKey, each element in the list should
            be a scalar value of the appropriate type for the table
            schema.
        N)rr+r/s    rrBzBatchWriteList.add_batch�s��(	
���J�u�d�G�4�5rc�8�|jj|�Sr)r�batch_write_item)r
s rrHzBatchWriteList.submit�s���{�{�+�+�D�1�1rc�H�i}|D]}|j�\}}|||<�|S)zR
        Convert a BatchWriteList object into format required for Layer1.
        )r")r
r9rTrIrs     rr"zBatchWriteList.to_dict�s8��
���	'�E�%*�]�]�_�"�J�
�&�A�j�M�	'��rr:)r%r&r'r(rrBrHr"r)rrrWrW�s���
�6�,2�rrWN)�boto.compatr�objectrr+r>r<rWr)rr�<module>r_s?��.�6�F�6�r,*��,*�^U��U�p+�T�+r