o
    eG                     @   s   d Z ddlmZ ddl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G d
d deZG dd deZG dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd ZdZ fddZejddfddZejddfddZejejejejfd	d
Z	dd Z
ejfddZdd Zdd Zdd Z  ZS )
SampleList PLEASE NOTE that this class contains preview products that are subject
    to change. Use them with caution. If you currently do not have developer
    preview access, please contact help@twilio.com. c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the SampleList

        :param Version version: Version that contains the resource
        :param assistant_sid: The SID of the Assistant that is the parent of the Task associated with the resource
        :param task_sid: The SID of the Task associated with the resource

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleList
        assistant_sidtask_sidz4/Assistants/{assistant_sid}/Tasks/{task_sid}/SamplesN )superr   __init__	_solutionformat_uri)selfversionr   r   	__class__r   a/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/autopilot/v1/assistant/task/sample.pyr      s   zSampleList.__init__Nc                 C   s2   | j ||}| j||d d}| j ||d S )a9  
        Streams SampleInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param unicode language: The ISO language-country string that specifies the language used for the sample
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, stream() will attempt to read the
                              limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance]
        	page_size)languager   limit)_versionread_limitspagestream)r   r   r   r   limitsr   r   r   r   r   '   s   zSampleList.streamc                 C   s   t | j|||dS )a  
        Lists SampleInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode language: The ISO language-country string that specifies the language used for the sample
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, list() will attempt to read the limit
                              with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance]
        )r   r   r   )listr   )r   r   r   r   r   r   r   r    ?   s   zSampleList.listc                 C   s8   t ||||d}| jjd| j|d}t| j|| jS )a8  
        Retrieve a single page of SampleInstance records from the API.
        Request is executed immediately

        :param unicode language: The ISO language-country string that specifies the language used for the sample
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SamplePage
        )Language	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   
SamplePager   )r   r   
page_tokenpage_numberr   dataresponser   r   r   r   R   s   zSampleList.pagec                 C   s"   | j jjd|}t| j || jS )a?  
        Retrieve a specific page of SampleInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SamplePage
        r$   )r   domaintwiliorequestr)   r   )r   
target_urlr-   r   r   r   get_pagek   s
   

zSampleList.get_pagec                 C   sD   t |||d}| jjd| j|d}t| j|| jd | jd dS )a  
        Create the SampleInstance

        :param unicode language: The ISO language-country string that specifies the language used for the new sample
        :param unicode tagged_text: The text example of how end users might express the task
        :param unicode source_channel: The communication channel from which the new sample was captured

        :returns: The created SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        r!   
TaggedTextSourceChannelPOSTr%   r&   r,   r   r   r
   )r   r(   r   creater   SampleInstancer   r   r   tagged_textsource_channelr,   payloadr   r   r   r8   |   s   zSampleList.createc                 C      t | j| jd | jd |dS a  
        Constructs a SampleContext

        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext
        r   r   r   r   sidSampleContextr   r   r   rA   r   r   r   get      	zSampleList.getc                 C   r>   r?   rB   rD   r   r   r   __call__   rF   zSampleList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z <Twilio.Autopilot.V1.SampleList>r   r   r   r   r   __repr__      zSampleList.__repr__)__name__
__module____qualname____doc__r   r   unsetr   r    r   r2   r8   rE   rG   rK   __classcell__r   r   r   r   r      s    
r   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )r)   r	   c                    s   t t| || || _dS )a  
        Initialize the SamplePage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param assistant_sid: The SID of the Assistant that is the parent of the Task associated with the resource
        :param task_sid: The SID of the Task associated with the resource

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SamplePage
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SamplePage
        N)r   r)   r   r   )r   r   r-   solutionr   r   r   r      s   
zSamplePage.__init__c                 C   s   t | j|| jd | jd dS )a  
        Build an instance of SampleInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        r   r   r
   )r9   r   r   r   r=   r   r   r   get_instance   s   	zSamplePage.get_instancec                 C   rH   )rI   z <Twilio.Autopilot.V1.SamplePage>r   rJ   r   r   r   rK      rL   zSamplePage.__repr__)rM   rN   rO   rP   r   rU   rK   rR   r   r   r   r   r)      s
    r)   c                       sN   e Zd ZdZ fddZdd ZejejejfddZdd	 Z	d
d Z
  ZS )rC   r	   c                    s6   t t| | |||d| _djdi | j| _dS )a)  
        Initialize the SampleContext

        :param Version version: Version that contains the resource
        :param assistant_sid: The SID of the Assistant that is the parent of the Task associated with the resource to fetch
        :param task_sid: The SID of the Task associated with the Sample resource to create
        :param sid: The unique string that identifies the resource

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext
        r@   z:/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}Nr   )r   rC   r   r   r   r   )r   r   r   r   rA   r   r   r   r      s   zSampleContext.__init__c                 C   s8   | j jd| jd}t| j || jd | jd | jd dS )
        Fetch the SampleInstance

        :returns: The fetched SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        r$   r%   r&   r   r   rA   r@   )r   fetchr   r9   r   rT   r   r   r   rX     s   zSampleContext.fetchc                 C   sL   t |||d}| jjd| j|d}t| j|| jd | jd | jd dS )  
        Update the SampleInstance

        :param unicode language: The ISO language-country string that specifies the language used for the sample
        :param unicode tagged_text: The text example of how end users might express the task
        :param unicode source_channel: The communication channel from which the sample was captured

        :returns: The updated SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        r3   r6   r7   r   r   rA   r@   )r   r(   r   updater   r9   r   r:   r   r   r   rZ     s   zSampleContext.updatec                 C   s   | j jd| jdS )}
        Deletes the SampleInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErW   )r   deleter   rJ   r   r   r   r]   ,  s   zSampleContext.deletec                 C   $   d dd | j D }d|S )rI    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr><      z)SampleContext.__repr__.<locals>.<genexpr>z&<Twilio.Autopilot.V1.SampleContext {}>joinr   itemsr   r   contextr   r   r   rK   5     
zSampleContext.__repr__)rM   rN   rO   rP   r   rX   r   rQ   rZ   r]   rK   rR   r   r   r   r   rC      s    
	rC   c                       s   e Zd ZdZd# fdd	Zedd Zedd Zed	d
 Zedd Z	edd Z
edd Zedd Zedd Zedd Zedd Zedd Zdd ZejejejfddZdd  Zd!d" Z  ZS )$r9   r	   Nc                    s   t t| | |dt|dt|d|d|d|d|d|d|d	|d
d
| _d| _|||pE| jd d| _dS )z
        Initialize the SampleInstance

        :returns: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
        account_siddate_createddate_updatedr   r   r   rA   r;   urlr<   )
ro   rp   rq   r   r   r   rA   r;   rr   r<   Nr@   )	r   r9   r   rE   r   iso8601_datetime_properties_contextr   )r   r   r=   r   r   rA   r   r   r   r   E  s"   zSampleInstance.__init__c                 C   s6   | j du rt| j| jd | jd | jd d| _ | j S )a5  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: SampleContext for this SampleInstance
        :rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleContext
        Nr   r   rA   r@   )ru   rC   r   r   rJ   r   r   r   _proxyd  s   
	zSampleInstance._proxyc                 C   
   | j d S )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        ro   rt   rJ   r   r   r   ro   v     
zSampleInstance.account_sidc                 C   rw   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        rp   rx   rJ   r   r   r   rp   ~  ry   zSampleInstance.date_createdc                 C   rw   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        rq   rx   rJ   r   r   r   rq     ry   zSampleInstance.date_updatedc                 C   rw   )zd
        :returns: The SID of the Task associated with the resource
        :rtype: unicode
        r   rx   rJ   r   r   r   r     ry   zSampleInstance.task_sidc                 C   rw   )z
        :returns: An ISO language-country string that specifies the language used for the sample
        :rtype: unicode
        r   rx   rJ   r   r   r   r     ry   zSampleInstance.languagec                 C   rw   )z
        :returns: The SID of the Assistant that is the parent of the Task associated with the resource
        :rtype: unicode
        r   rx   rJ   r   r   r   r     ry   zSampleInstance.assistant_sidc                 C   rw   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rA   rx   rJ   r   r   r   rA     ry   zSampleInstance.sidc                 C   rw   )zl
        :returns: The text example of how end users might express the task
        :rtype: unicode
        r;   rx   rJ   r   r   r   r;     ry   zSampleInstance.tagged_textc                 C   rw   )z[
        :returns: The absolute URL of the Sample resource
        :rtype: unicode
        rr   rx   rJ   r   r   r   rr     ry   zSampleInstance.urlc                 C   rw   )zp
        :returns: The communication channel from which the sample was captured
        :rtype: unicode
        r<   rx   rJ   r   r   r   r<     ry   zSampleInstance.source_channelc                 C   
   | j  S )rV   )rv   rX   rJ   r   r   r   rX        
zSampleInstance.fetchc                 C   s   | j j|||dS )rY   )r   r;   r<   )rv   rZ   )r   r   r;   r<   r   r   r   rZ     s   zSampleInstance.updatec                 C   rz   )r[   )rv   r]   rJ   r   r   r   r]     r{   zSampleInstance.deletec                 C   r^   )rI   r_   c                 s   r`   ra   rb   rc   r   r   r   rg     rh   z*SampleInstance.__repr__.<locals>.<genexpr>z'<Twilio.Autopilot.V1.SampleInstance {}>ri   rl   r   r   r   rK     rn   zSampleInstance.__repr__)N)rM   rN   rO   rP   r   propertyrv   ro   rp   rq   r   r   r   rA   r;   rr   r<   rX   r   rQ   rZ   r]   rK   rR   r   r   r   r   r9   @  s>    










	
	r9   N)rP   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r)   rC   r9   r   r   r   r   <module>   s    ,0T