o
    0_Wc  ã                   @   s~   d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZ ej	r5d dlm
Z
mZmZmZmZ d dlmZ G dd„ deƒZdS )é    N)ÚEnum)ÚABCMetaÚabstractmethod)ÚDictÚListÚOptionalÚUnionÚAny)Údatetimec                   @   sx   e Zd ZdZddiZddiZdZdddœZdZe	Z
edd
d„ƒZedd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )Ú	SlotValuea%  
    Object representing the value captured in the slot.


    :param object_type: Type of value that was captured. Can be &#39;Simple&#39;,&#39;List&#39; or &#39;Composite&#39;.
    :type object_type: (optional) str

    .. note::

        This is an abstract class. Use the following mapping, to figure out
        the model class to be instantiated, that sets ``type`` variable.

        | List: :py:class:`ask_sdk_model.list_slot_value.ListSlotValue`,
        |
        | Simple: :py:class:`ask_sdk_model.simple_slot_value.SimpleSlotValue`

    Úobject_typeÚstrÚtypeFz+ask_sdk_model.list_slot_value.ListSlotValuez/ask_sdk_model.simple_slot_value.SimpleSlotValue)r   ZSimpleNc                 C   s   d| _ || _dS )zãObject representing the value captured in the slot.

        :param object_type: Type of value that was captured. Can be &#39;Simple&#39;,&#39;List&#39; or &#39;Composite&#39;.
        :type object_type: (optional) str
        N)Z_SlotValue__discriminator_valuer   )Úselfr   © r   ú:D:\Flask\env\Lib\site-packages\ask_sdk_model/slot_value.pyÚ__init__A   s   
zSlotValue.__init__c                 C   s   || j  }| j |¡S )z:Returns the real base class specified by the discriminator)Újson_discriminator_keyÚdiscriminator_value_class_mapÚget)ÚclsÚdataZdiscriminator_valuer   r   r   Úget_real_child_modelM   s   
zSlotValue.get_real_child_modelc                 C   s¦   i }t  | j¡D ]H\}}t| |ƒ}t|tƒr"ttdd„ |ƒƒ||< qt|tƒr-|j||< qt	|dƒr9| 
¡ ||< qt|tƒrLttdd„ | ¡ ƒƒ||< q|||< q|S )z&Returns the model properties as a dictc                 S   s&   t | dƒr	|  ¡ S t| tƒr| jS | S )NÚto_dict©Úhasattrr   Ú
isinstancer   Úvalue)Úxr   r   r   Ú<lambda>]   s    z#SlotValue.to_dict.<locals>.<lambda>r   c                 S   sF   t | d dƒr| d | d  ¡ fS t| d tƒr!| d | d jfS | S )Né   r   r   r   )Úitemr   r   r   r   g   s
   ÿÿ)ÚsixÚ	iteritemsÚdeserialized_typesÚgetattrr   ÚlistÚmapr   r   r   r   ÚdictÚitems)r   ÚresultÚattrÚ_r   r   r   r   r   T   s&   

ý


û
zSlotValue.to_dictc                 C   s   t  |  ¡ ¡S )z.Returns the string representation of the model)ÚpprintÚpformatr   ©r   r   r   r   Úto_strr   s   zSlotValue.to_strc                 C   s   |   ¡ S )zFor `print` and `pprint`)r0   r/   r   r   r   Ú__repr__w   s   zSlotValue.__repr__c                 C   s   t |tƒsdS | j|jkS )z&Returns true if both objects are equalF)r   r   Ú__dict__©r   Úotherr   r   r   Ú__eq__|   s   
zSlotValue.__eq__c                 C   s
   | |k S )z*Returns true if both objects are not equalr   r3   r   r   r   Ú__ne__„   s   
zSlotValue.__ne__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r$   Zattribute_mapZsupports_multiple_typesr   r   r   Ú__metaclass__r   r   Úclassmethodr   r   r0   r1   r5   r6   r   r   r   r   r      s*    ÿÿþ
r   )r-   Úrer"   ÚtypingÚenumr   Úabcr   r   ÚTYPE_CHECKINGr   r   r   r   r	   r
   Úobjectr   r   r   r   r   Ú<module>   s   