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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

ckF[d �@s�ddlmZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Z	Gdd�de�Z
Gdd�de
�ZGdd�de
�ZGdd�de
e	�Z
dS)�)�STRINGc@s0eZdZdZdZefdd�Zdd�Zdd�ZdS)	�BaseSchemaFieldz�
    An abstract class for defining schema fields.

    Contains most of the core functionality for the field. Subclasses must
    define an ``attr_type`` to pass to DynamoDB.
    NcCs||_||_dS)aN
        Creates a Python schema field, to represent the data to pass to
        DynamoDB.

        Requires a ``name`` parameter, which should be a string name of the
        field.

        Optionally accepts a ``data_type`` parameter, which should be a
        constant from ``boto.dynamodb2.types``. (Default: ``STRING``)
        N��name�	data_type)�selfrr�r�7/usr/lib/python3/dist-packages/boto/dynamodb2/fields.py�__init__
s
zBaseSchemaField.__init__cC�|j|jd�S)z�
        Returns the attribute definition structure DynamoDB expects.

        Example::

            >>> field.definition()
            {
                'AttributeName': 'username',
                'AttributeType': 'S',
            }

        ��
AttributeName�
AttributeTyper�rrrr	�
definition��zBaseSchemaField.definitioncCr)z�
        Returns the schema structure DynamoDB expects.

        Example::

            >>> field.schema()
            {
                'AttributeName': 'username',
                'KeyType': 'HASH',
            }

        )r
�KeyType)r�	attr_typerrrr	�schema-rzBaseSchemaField.schema)	�__name__�
__module__�__qualname__�__doc__rrr
rrrrrr	rsrc@�eZdZdZdZdS)�HashKeyz�
    An field representing a hash key.

    Example::

        >>> from boto.dynamodb2.types import NUMBER
        >>> HashKey('username')
        >>> HashKey('date_joined', data_type=NUMBER)

    �HASHN�rrrrrrrrr	r@�
rc@r)�RangeKeyz�
    An field representing a range key.

    Example::

        >>> from boto.dynamodb2.types import NUMBER
        >>> HashKey('username')
        >>> HashKey('date_joined', data_type=NUMBER)

    �RANGENrrrrr	rNrrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�BaseIndexFieldz�
    An abstract class for defining schema indexes.

    Contains most of the core functionality for the index. Subclasses must
    define a ``projection_type`` to pass to DynamoDB.
    cCs||_||_dS�N)r�parts)rrr"rrr	r
cs
zBaseIndexField.__init__cCs(g}|jD]}|�|j|jd��q|S)z�
        Returns the attribute definition structure DynamoDB expects.

        Example::

            >>> index.definition()
            {
                'AttributeName': 'username',
                'AttributeType': 'S',
            }

        r)r"�appendrr)rr�partrrr	rgs

�zBaseIndexField.definitioncCs2g}|jD]	}|�|���q|j|d|jid�S)a�
        Returns the schema structure DynamoDB expects.

        Example::

            >>> index.schema()
            {
                'IndexName': 'LastNameIndex',
                'KeySchema': [
                    {
                        'AttributeName': 'username',
                        'KeyType': 'HASH',
                    },
                ],
                'Projection': {
                    'ProjectionType': 'KEYS_ONLY',
                }
            }

        �ProjectionType)�	IndexName�	KeySchema�
Projection)r"r#rr�projection_type)r�
key_schemar$rrr	r~s
��zBaseIndexField.schemaN)rrrrr
rrrrrr	r \s
r c@r)�AllIndexz�
    An index signifying all fields should be in the index.

    Example::

        >>> AllIndex('MostRecentlyJoined', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ])

    �ALLN�rrrrr)rrrr	r+��r+c@r)�
KeysOnlyIndexz�
    An index signifying only key fields should be in the index.

    Example::

        >>> KeysOnlyIndex('MostRecentlyJoined', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ])

    �	KEYS_ONLYNr-rrrr	r/�r.r/cs0eZdZdZdZ�fdd�Z�fdd�Z�ZS)�IncludeIndexz�
    An index signifying only certain fields should be in the index.

    Example::

        >>> IncludeIndex('GenderIndex', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ], includes=['gender'])

    �INCLUDEcs(|�dg�|_tt|�j|i|��dS)N�includes)�pop�includes_fields�superr1r
)r�args�kwargs��	__class__rr	r
�szIncludeIndex.__init__cs tt|���}|j|dd<|S)Nr(�NonKeyAttributes)r6r1rr5�r�schema_datar9rr	r�szIncludeIndex.schema)rrrrr)r
r�
__classcell__rrr9r	r1�s
r1cs6eZdZdZddd�Z�fdd�Z�fdd�Z�ZS)�GlobalBaseIndexFieldz�
    An abstract class for defining global indexes.

    Contains most of the core functionality for the index. Subclasses must
    define a ``projection_type`` to pass to DynamoDB.
    �)�read�writecs4|�dd�}|dur
||_tt|�j|i|��dS�N�
throughput)r4rDr6r?r
�rr7r8rDr9rr	r
�szGlobalBaseIndexField.__init__cs4tt|���}t|jd�t|jd�d�|d<|S)ax
        Returns the schema structure DynamoDB expects.

        Example::

            >>> index.schema()
            {
                'IndexName': 'LastNameIndex',
                'KeySchema': [
                    {
                        'AttributeName': 'username',
                        'KeyType': 'HASH',
                    },
                ],
                'Projection': {
                    'ProjectionType': 'KEYS_ONLY',
                },
                'ProvisionedThroughput': {
                    'ReadCapacityUnits': 5,
                    'WriteCapacityUnits': 5
                }
            }

        rArB)�ReadCapacityUnits�WriteCapacityUnits�ProvisionedThroughput)r6r?r�intrDr<r9rr	r�s

�zGlobalBaseIndexField.schema)rrrrrDr
rr>rrr9r	r?�s�r?c@r)�GlobalAllIndexaE
    An index signifying all fields should be in the index.

    Example::

        >>> GlobalAllIndex('MostRecentlyJoined', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ],
        ... throughput={
        ...     'read': 2,
        ...     'write': 1,
        ... })

    r,Nr-rrrr	rJ�rJc@r)�GlobalKeysOnlyIndexaO
    An index signifying only key fields should be in the index.

    Example::

        >>> GlobalKeysOnlyIndex('MostRecentlyJoined', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ],
        ... throughput={
        ...     'read': 2,
        ...     'write': 1,
        ... })

    r0Nr-rrrr	rLrKrLc@s$eZdZdZdZdd�Zdd�ZdS)�GlobalIncludeIndexal
    An index signifying only certain fields should be in the index.

    Example::

        >>> GlobalIncludeIndex('GenderIndex', parts=[
        ...     HashKey('username'),
        ...     RangeKey('date_joined')
        ... ],
        ... includes=['gender'],
        ... throughput={
        ...     'read': 2,
        ...     'write': 1,
        ... })

    r2cOsL|�dd�}tj|g|�Ri|��|r||d<tj|g|�Ri|��dSrC)r4r1r
r?rErrr	r
Es
zGlobalIncludeIndex.__init__cCst�|�}|�t�|��|Sr!)r1r�updater?r<rrr	rLs
zGlobalIncludeIndex.schemaN)rrrrr)r
rrrrr	rM2s
rMN)�boto.dynamodb2.typesr�objectrrrr r+r/r1r?rJrLrMrrrr	�<module>s<E5

https://t.me/RX1948 - 2025