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 ejr?d 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 d dlmZ G dd	 d	eZdS )
    N)Enum)DictListOptionalUnionAny)datetime)Request)Context)Sessionc                   @   sb   e Zd ZdZdddddZ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 )RequestEnvelopeu  
    Request wrapper for all requests sent to your Skill.


    :param version: The version specifier for the request.
    :type version: (optional) str
    :param session: The session object provides additional context associated with the request.
    :type session: (optional) ask_sdk_model.session.Session
    :param context: The context object provides your skill with information about the current state of the Alexa service and device at the time the request is sent to your service. This is included on all requests. For requests sent in the context of a session (LaunchRequest and IntentRequest), the context object duplicates the user and application information that is also available in the session.
    :type context: (optional) ask_sdk_model.context.Context
    :param request: A request object that provides the details of the user’s request.
    :type request: (optional) ask_sdk_model.request.Request

    strzask_sdk_model.session.Sessionzask_sdk_model.context.Contextzask_sdk_model.request.Request)versionsessioncontextrequestr   r   r   r   FNc                 C   s"   d| _ || _|| _|| _|| _dS )u  Request wrapper for all requests sent to your Skill.

        :param version: The version specifier for the request.
        :type version: (optional) str
        :param session: The session object provides additional context associated with the request.
        :type session: (optional) ask_sdk_model.session.Session
        :param context: The context object provides your skill with information about the current state of the Alexa service and device at the time the request is sent to your service. This is included on all requests. For requests sent in the context of a session (LaunchRequest and IntentRequest), the context object duplicates the user and application information that is also available in the session.
        :type context: (optional) ask_sdk_model.context.Context
        :param request: A request object that provides the details of the user’s request.
        :type request: (optional) ask_sdk_model.request.Request
        N)Z%_RequestEnvelope__discriminator_valuer   r   r   r   )selfr   r   r   r    r   @D:\Flask\env\Lib\site-packages\ask_sdk_model/request_envelope.py__init__=   s
   
zRequestEnvelope.__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>Z   s    z)RequestEnvelope.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   d   s
   )six	iteritemsdeserialized_typesgetattrr   listmapr   r   r   r   dictitems)r   resultattr_r   r   r   r   r   Q   s&   





zRequestEnvelope.to_dictc                 C   s   t |  S )z.Returns the string representation of the model)pprintpformatr   r   r   r   r   to_stro   s   zRequestEnvelope.to_strc                 C   s   |   S )zFor `print` and `pprint`)r-   r,   r   r   r   __repr__t   s   zRequestEnvelope.__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__y   s   
zRequestEnvelope.__eq__c                 C   s
   | |k S )z*Returns true if both objects are not equalr   r0   r   r   r   __ne__   s   
zRequestEnvelope.__ne__)NNNN)__name__
__module____qualname____doc__r!   Zattribute_mapZsupports_multiple_typesr   r   r-   r.   r2   r3   r   r   r   r   r      s&    
r   )r*   rer   typingenumr   TYPE_CHECKINGr   r   r   r   r   r   Zask_sdk_model.requestr	   ZRequest_601a68c0Zask_sdk_model.contextr
   ZContext_d885cf00Zask_sdk_model.sessionr   ZSession_c56c91ceobjectr   r   r   r   r   <module>   s   