o
    >_Wc  ã                   @   s~   d dl Z d dlmZ d dlmZ d dlmZ e jr5d dl 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)ÚSkillBuilder)ÚDefaultApiClient)ÚDynamoDbAdapter)ÚCallableÚDictÚAny)ÚRequestEnvelope)ÚSkillConfiguration)ÚServiceResourcec                       s6   e Zd ZdZ		d‡ fdd„	Ze‡ fdd„ƒZ‡  ZS )ÚStandardSkillBuilderaq  Skill Builder with api client and db adapter coupling to Skill.

    Standard Skill Builder is an implementation of
    :py:class:`ask_sdk_core.skill_builder.SkillBuilder`
    with coupling of DynamoDb Persistence Adapter settings and a Default
    Api Client added to the :py:class:`ask_sdk_core.skill.Skill`.

    :param table_name: Name of the table to be created or used
    :type table_name: str
    :param auto_create_table: Should the adapter try to create the table if
        it doesn't exist.
    :type auto_create_table: bool
    :param partition_keygen: Callable function that takes a request
        envelope and provides a unique partition key value.
    :type partition_keygen: Callable[[RequestEnvelope], str]
    :param dynamodb_client: Resource to be used, to perform dynamo
        operations.
    :type dynamodb_client: boto3.resources.base.ServiceResource
    Nc                    s*   t t| ƒ ¡  || _|| _|| _|| _dS )a¿  Skill Builder with api client and db adapter coupling to Skill.

        Standard Skill Builder is an implementation of
        :py:class:`ask_sdk_core.skill_builder.SkillBuilder`
        with coupling of DynamoDb Persistence Adapter settings and a Default
        Api Client added to the :py:class:`ask_sdk_core.skill.Skill`.

        :param table_name: Name of the table to be created or used
        :type table_name: str
        :param auto_create_table: Should the adapter try to create the table if
            it doesn't exist.
        :type auto_create_table: bool
        :param partition_keygen: Callable function that takes a request
            envelope and provides a unique partition key value.
        :type partition_keygen: Callable[[ask_sdk_model.RequestEnvelope], str]
        :param dynamodb_client: Resource to be used, to perform dynamo
            operations.
        :type dynamodb_client: boto3.resources.base.ServiceResource
        N)Úsuperr   Ú__init__Ú
table_nameÚauto_create_tableÚpartition_keygenÚdynamodb_client)Úselfr   r   r   r   ©Ú	__class__© ú2D:\Flask\env\Lib\site-packages\ask_sdk/standard.pyr   4   s
   
zStandardSkillBuilder.__init__c                    sl   t t| ƒj}tƒ |_| jdur4d| ji}| jr| j|d< | jr$| j|d< | jr,| j|d< t	di |¤Ž|_
|S )zWCreate the skill configuration object using the registered
        components.
        Nr   Zcreate_tabler   Zdynamodb_resourcer   )r   r   Úskill_configurationr   Z
api_clientr   r   r   r   r   Zpersistence_adapter)r   Zskill_configÚkwargsr   r   r   r   Q   s   




z(StandardSkillBuilder.skill_configuration)NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   Ú__classcell__r   r   r   r   r      s    þr   )ÚtypingZask_sdk_core.skill_builderr   Zask_sdk_core.api_clientr   Zask_sdk_dynamodb.adapterr   ÚTYPE_CHECKINGr   r   r   Zask_sdk_modelr   r	   Zboto3.resources.baser
   r   r   r   r   r   Ú<module>   s   