o
    0_Wcg  ã                   @   s†   d dl Z d dlZd dlZd dlZd dlmZ ejr9d dlmZmZm	Z	m
Z
mZ d dlmZ d dlmZ d dlmZ G dd„ deƒZdS )	é    N)ÚEnum)ÚDictÚListÚOptionalÚUnionÚAny)Údatetime)ÚApplication)ÚUserc                   @   sf   e Zd ZdZddddddœZdd	d
dddœZdZddd„Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZdS )ÚSessionuì  
    Represents a single execution of the alexa service


    :param new: A boolean value indicating whether this is a new session. Returns true for a new session or false for an existing session.
    :type new: (optional) bool
    :param session_id: A string that represents a unique identifier per a userâ€™s active session.
    :type session_id: (optional) str
    :param user: An object that describes the user making the request.
    :type user: (optional) ask_sdk_model.user.User
    :param attributes: A map of key-value pairs. The attributes map is empty for requests where a new session has started with the property new set to true. When returning your response, you can include data you need to persist during the session in the sessionAttributes property. The attributes you provide are then passed back to your skill on the next request.
    :type attributes: (optional) dict(str, object)
    :param application: 
    :type application: (optional) ask_sdk_model.application.Application

    ÚboolÚstrzask_sdk_model.user.Userzdict(str, object)z%ask_sdk_model.application.Application)ÚnewÚ
session_idÚuserÚ
attributesÚapplicationr   Z	sessionIdr   r   r   FNc                 C   s(   d| _ || _|| _|| _|| _|| _dS )u  Represents a single execution of the alexa service

        :param new: A boolean value indicating whether this is a new session. Returns true for a new session or false for an existing session.
        :type new: (optional) bool
        :param session_id: A string that represents a unique identifier per a userâ€™s active session.
        :type session_id: (optional) str
        :param user: An object that describes the user making the request.
        :type user: (optional) ask_sdk_model.user.User
        :param attributes: A map of key-value pairs. The attributes map is empty for requests where a new session has started with the property new set to true. When returning your response, you can include data you need to persist during the session in the sessionAttributes property. The attributes you provide are then passed back to your skill on the next request.
        :type attributes: (optional) dict(str, object)
        :param application: 
        :type application: (optional) ask_sdk_model.application.Application
        N)Z_Session__discriminator_valuer   r   r   r   r   )Úselfr   r   r   r   r   © r   ú7D:\Flask\env\Lib\site-packages\ask_sdk_model/session.pyÚ__init__@   s   
zSession.__init__c                 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!Session.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   j   s
   ÿÿ)ÚsixÚ	iteritemsÚdeserialized_typesÚgetattrr   ÚlistÚmapr   r   r   r   ÚdictÚitems)r   ÚresultÚattrÚ_r   r   r   r   r   W   s&   

ý


û
zSession.to_dictc                 C   s   t  |  ¡ ¡S )z.Returns the string representation of the model)ÚpprintÚpformatr   ©r   r   r   r   Úto_stru   s   zSession.to_strc                 C   s   |   ¡ S )zFor `print` and `pprint`)r.   r-   r   r   r   Ú__repr__z   s   zSession.__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Session.__eq__c                 C   s
   | |k S )z*Returns true if both objects are not equalr   r1   r   r   r   Ú__ne__‡   s   
zSession.__ne__)NNNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r"   Zattribute_mapZsupports_multiple_typesr   r   r.   r/   r3   r4   r   r   r   r   r      s*    û	û
r   )r+   Úrer    ÚtypingÚenumr   ÚTYPE_CHECKINGr   r   r   r   r   r   Zask_sdk_model.applicationr	   ZApplication_fbe81c42Zask_sdk_model.userr
   ZUser_8987f2deÚobjectr   r   r   r   r   Ú<module>   s   