U
    cc                     @   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	rjd 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 )zObject 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   </tmp/pip-unpacked-wheel-urk6bcke/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 ]\}}t| |}t|trDttdd |||< qt|trZ|j||< qt	|drr|
 ||< qt|trt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rB| 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   