U
    cc                     @   sz   d dl Z d dlZd dlZd dlZd dlmZ ejrfd dlmZmZm	Z	m
Z
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)Scopec                   @   sZ   e Zd ZdZdddZ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 )Permissionsu  
    Contains a consentToken allowing the skill access to information that the customer has consented to provide, such as address information. Note that the consentToken is deprecated. Use the apiAccessToken available in the context object to determine the user’s permissions.


    :param consent_token: A token listing all the permissions granted for this user.
    :type consent_token: (optional) str
    :param scopes: A map where the key is a LoginWithAmazon(LWA) scope and value is a list of key:value pairs which describe the state of user actions on the LWA scope. For e.g. \&quot;scopes\&quot; :{ \&quot;alexa::devices:all:geolocation:read\&quot;:{\&quot;status\&quot;:\&quot;GRANTED\&quot;}} This value of \&quot;alexa::devices:all:geolocation:read\&quot; will determine if the Geolocation data access is granted by the user, or else it will show a card of type AskForPermissionsConsent to the user to get this permission.
    :type scopes: (optional) dict(str, ask_sdk_model.scope.Scope)

    strz$dict(str, ask_sdk_model.scope.Scope))consent_tokenscopesZconsentTokenr   FNc                 C   s   d| _ || _|| _dS )u  Contains a consentToken allowing the skill access to information that the customer has consented to provide, such as address information. Note that the consentToken is deprecated. Use the apiAccessToken available in the context object to determine the user’s permissions.

        :param consent_token: A token listing all the permissions granted for this user.
        :type consent_token: (optional) str
        :param scopes: A map where the key is a LoginWithAmazon(LWA) scope and value is a list of key:value pairs which describe the state of user actions on the LWA scope. For e.g. \&quot;scopes\&quot; :{ \&quot;alexa::devices:all:geolocation:read\&quot;:{\&quot;status\&quot;:\&quot;GRANTED\&quot;}} This value of \&quot;alexa::devices:all:geolocation:read\&quot; will determine if the Geolocation data access is granted by the user, or else it will show a card of type AskForPermissionsConsent to the user to get this permission.
        :type scopes: (optional) dict(str, ask_sdk_model.scope.Scope)
        N)Z!_Permissions__discriminator_valuer   r   )selfr   r    r   =/tmp/pip-unpacked-wheel-urk6bcke/ask_sdk_model/permissions.py__init__3   s    	zPermissions.__init__c                 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>J   s   z%Permissions.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   T   s
    )six	iteritemsdeserialized_typesgetattrr   listmapr   r   r   r   dictitems)r   resultattr_r   r   r   r   r   A   s&    





zPermissions.to_dictc                 C   s   t |  S )z.Returns the string representation of the model)pprintpformatr   r   r   r   r   to_str_   s    zPermissions.to_strc                 C   s   |   S )zFor `print` and `pprint`)r)   r(   r   r   r   __repr__d   s    zPermissions.__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__i   s    
zPermissions.__eq__c                 C   s
   | |k S )z*Returns true if both objects are not equalr   r,   r   r   r   __ne__q   s    zPermissions.__ne__)NN)__name__
__module____qualname____doc__r   Zattribute_mapZsupports_multiple_typesr   r   r)   r*   r.   r/   r   r   r   r   r
      s   
r
   )r&   rer   typingenumr   TYPE_CHECKINGr   r   r   r   r   r   Zask_sdk_model.scoper	   ZScope_ed061ccaobjectr
   r   r   r   r   <module>   s   