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/dynamodb2/__pycache__/fields.cpython-312.pyc
�

ckF[d ���ddlmZGd�de�ZGd�de�ZGd�de�ZGd�d	e�ZGd
�de�ZGd�d
e�ZGd�de�Z	Gd�de�Z
Gd�de
�ZGd�de
�ZGd�de
e	�Z
y)�)�STRINGc�*�eZdZdZdZefd�Zd�Zd�Zy)�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.
    Nc� �||_||_y)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	s   �7/usr/lib/python3/dist-packages/boto/dynamodb2/fields.py�__init__zBaseSchemaField.__init__
s����	�"���c�4�|j|jd�S)z�
        Returns the attribute definition structure DynamoDB expects.

        Example::

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

        ��
AttributeName�
AttributeTyper�r
s r�
definitionzBaseSchemaField.definitions��"�Y�Y�!�^�^�
�	
r
c�4�|j|jd�S)z�
        Returns the schema structure DynamoDB expects.

        Example::

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

        )r�KeyType)r�	attr_typers r�schemazBaseSchemaField.schema-s��"�Y�Y��~�~�
�	
r
)	�__name__�
__module__�__qualname__�__doc__rrrrr�r
rrrs ����I�'-�#�
�$
r
rc��eZdZdZdZy)�HashKeyz�
    An field representing a hash key.

    Example::

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

    �HASHN�rrrrrrr
rrr@s��	��Ir
rc��eZdZdZdZy)�RangeKeyz�
    An field representing a range key.

    Example::

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

    �RANGENr rr
rr"r"Ns��	��Ir
r"c�"�eZdZdZd�Zd�Zd�Zy)�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.
    c� �||_||_y�N)r�parts)r
rr(s   rrzBaseIndexField.__init__cs����	���
r
c�|�g}|jD]*}|j|j|jd���,|S)z�
        Returns the attribute definition structure DynamoDB expects.

        Example::

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

        r)r(�appendrr	)r
r�parts   rrzBaseIndexField.definitiongsE���
��J�J�	�D����!%���!%����
�	��r
c��g}|jD]!}|j|j���#|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+s   rrzBaseIndexField.schema~sV��*�
��J�J�	-�D����d�k�k�m�,�	-����#� �$�"6�"6��
�	
r
N)rrrrrrrrr
rr%r%\s�����. 
r
r%c��eZdZdZdZy)�AllIndexz�
    An index signifying all fields should be in the index.

    Example::

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

    �ALLN�rrrrr1rr
rr4r4�s��
��Or
r4c��eZdZdZdZy)�
KeysOnlyIndexz�
    An index signifying only key fields should be in the index.

    Example::

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

    �	KEYS_ONLYNr6rr
rr8r8�s��
�"�Or
r8c�0��eZdZdZdZ�fd�Z�fd�Z�xZS)�IncludeIndexz�
    An index signifying only certain fields should be in the index.

    Example::

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

    �INCLUDEc�Z��|jdg�|_tt|�|i|��y)N�includes)�pop�includes_fields�superr;r)r
�args�kwargs�	__class__s   �rrzIncludeIndex.__init__�s*���%�z�z�*�b�9���
�l�D�*�D�;�F�;r
c�P��tt|��}|j|dd<|S)Nr0�NonKeyAttributes)rAr;rr@�r
�schema_datarDs  �rrzIncludeIndex.schema�s.����L�$�6�8��8<�8L�8L��L�!�"4�5��r
)rrrrr1rr�
__classcell__�rDs@rr;r;�s���
� �O�<��r
r;c�6��eZdZdZddd�Z�fd�Z�fd�Z�xZS)�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�writec�b��|jdd�}|�||_tt|�|i|��y�N�
throughput)r?rRrArLr)r
rBrCrRrDs    �rrzGlobalBaseIndexField.__init__�s5����Z�Z��d�3�
��!�(�D�O�
�"�D�2�D�C�F�Cr
c���tt|��}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
                }
            }

        rNrO)�ReadCapacityUnits�WriteCapacityUnits�ProvisionedThroughput)rArLr�intrRrGs  �rrzGlobalBaseIndexField.schema�sL���2�0�$�>�@��!$�T�_�_�V�%<�!=�"%�d�o�o�g�&>�"?�0
��+�,��r
)rrrrrRrrrIrJs@rrLrL�s'�������J�
D��r
rLc��eZdZdZdZy)�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,
        ... })

    r5Nr6rr
rrYrYs����Or
rYc��eZdZdZdZy)�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,
        ... })

    r9Nr6rr
rr[r[s���"�Or
r[c� �eZdZdZdZd�Zd�Zy)�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,
        ... })

    r<c��|jdd�}tj|g|��i|��|r||d<tj|g|��i|��yrQ)r?r;rrL)r
rBrCrRs    rrzGlobalIncludeIndex.__init__EsO���Z�Z��d�3�
����d�4�T�4�V�4��#-�F�<� ��%�%�d�<�T�<�V�<r
c�x�tj|�}|jtj|��|Sr')r;r�updaterL)r
rHs  rrzGlobalIncludeIndex.schemaLs2��"�)�)�$�/�����/�6�6�t�<�=��r
N)rrrrr1rrrr
rr]r]2s���  �O�=�r
r]N)�boto.dynamodb2.typesr�objectrrr"r%r4r8r;rLrYr[r]rr
r�<module>rcs���'�9
�f�9
�x�o�����B
�V�B
�J�~��"�N�"��>��02�>�2�j�)��&"�.�"�&�-�|�r