o
    È·eŠ  ã                   @   s   G d d„ de ƒZdS )c                   @   sr   e Zd ZdZdd„ Zdd„ Zeddd„ƒZed	d
„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZdd„ ZdS )ÚSchemaa"  
    Represents a DynamoDB schema.

    :ivar hash_key_name: The name of the hash key of the schema.
    :ivar hash_key_type: The DynamoDB type specification for the
        hash key of the schema.
    :ivar range_key_name: The name of the range key of the schema
        or None if no range key is defined.
    :ivar range_key_type: The DynamoDB type specification for the
        range key of the schema or None if no range key is defined.
    :ivar dict: The underlying Python dictionary that needs to be
        passed to Layer1 methods.
    c                 C   s
   || _ d S ©N©Ú_dict)ÚselfÚschema_dict© r   úK/var/www/ideatree/venv/lib/python3.10/site-packages/boto/dynamodb/schema.pyÚ__init__(   s   
zSchema.__init__c                 C   s(   | j rd| j| j f }|S d| j }|S )NzSchema(%s:%s)z
Schema(%s))Úrange_key_nameÚhash_key_name)r   Úsr   r   r   Ú__repr__+   s
   
ÿzSchema.__repr__Nc                 C   sF   d|d |d dœi}|dur|d |d dœ|d< | dƒ}||_ |S )aÉ  Convenience method to create a schema object.

        Example usage::

            schema = Schema.create(hash_key=('foo', 'N'))
            schema2 = Schema.create(hash_key=('foo', 'N'),
                                    range_key=('bar', 'S'))

        :type hash_key: tuple
        :param hash_key: A tuple of (hash_key_name, hash_key_type)

        :type range_key: tuple
        :param hash_key: A tuple of (range_key_name, range_key_type)

        ÚHashKeyElementé    é   )ÚAttributeNameÚAttributeTypeNÚRangeKeyElementr   )ÚclsÚhash_keyÚ	range_keyÚreconstructedÚinstancer   r   r   Úcreate2   s   þÿ
þzSchema.createc                 C   s   | j S r   r   ©r   r   r   r   ÚdictR   s   zSchema.dictc                 C   ó   | j d d S )Nr   r   r   r   r   r   r   r   V   ó   zSchema.hash_key_namec                 C   r   )Nr   r   r   r   r   r   r   Úhash_key_typeZ   r   zSchema.hash_key_typec                 C   ó    d }d| j v r| j d d }|S )Nr   r   r   )r   Únamer   r   r   r
   ^   ó   
zSchema.range_key_namec                 C   r   )Nr   r   r   )r   Útyper   r   r   Úrange_key_typee   r!   zSchema.range_key_typec                 C   s0   | j |j ko| j|jko| j|jko| j|jkS r   )r   r   r
   r#   )r   Úotherr   r   r   Ú__eq__l   s   
ÿ
þ
ýzSchema.__eq__r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r   Úclassmethodr   Úpropertyr   r   r   r
   r#   r%   r   r   r   r   r      s"    




r   N)Úobjectr   r   r   r   r   Ú<module>   s   