o
    f>hF                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZ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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Assistants
    This is the public Twilio REST API.

    NOTE: This class is auto generated by OpenAPI Generator.
    https://openapi-generator.tech
    Do not edit the class manually.
    )datetime)AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                
       s   e Zd ZdZ	ddedeeef dedee f fddZ	e
dddZdddZdddZd	efddZd	efddZd	efddZ  ZS )AssistantsToolInstanceaP  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource.
    :ivar description: The description of the tool.
    :ivar enabled: True if the tool is enabled.
    :ivar id: The tool ID.
    :ivar meta: The metadata related to method, url, input_schema to used with the Tool.
    :ivar name: The name of the tool.
    :ivar requires_auth: The authentication requirement for the tool.
    :ivar type: The type of the tool. ('WEBHOOK')
    :ivar url: The url of the tool resource.
    :ivar date_created: The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    Nversionpayloadassistant_ididc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _t|d
| _t|d| _||pS| jd| _d | _d S )Naccount_siddescriptionenabledr   metanamerequires_authtypeurldate_createddate_updatedr   r   )super__init__getr   r   r   r   r   r   r   r   r   r
   iso8601_datetimer   r   	_solution_context)selfr   r   r   r   	__class__ f/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/assistants/v1/assistant/assistants_tool.pyr"   (   s(   
zAssistantsToolInstance.__init__returnAssistantsToolContextc                 C   s.   | j du rt| j| jd | jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: AssistantsToolContext for this AssistantsToolInstance
        Nr   r   r    )r&   r-   _versionr%   r'   r*   r*   r+   _proxyG   s   
zAssistantsToolInstance._proxyc                 C   
   | j  S )j
        Create the AssistantsToolInstance


        :returns: The created AssistantsToolInstance
        )r0   creater/   r*   r*   r+   r3   W      
zAssistantsToolInstance.createc                       | j  I dH S )
        Asynchronous coroutine to create the AssistantsToolInstance


        :returns: The created AssistantsToolInstance
        N)r0   create_asyncr/   r*   r*   r+   r7   `      z#AssistantsToolInstance.create_asyncc                 C   r1   )q
        Deletes the AssistantsToolInstance


        :returns: True if delete succeeds, False otherwise
        )r0   deleter/   r*   r*   r+   r:   i   r4   zAssistantsToolInstance.deletec                    r5   )
        Asynchronous coroutine that deletes the AssistantsToolInstance


        :returns: True if delete succeeds, False otherwise
        N)r0   delete_asyncr/   r*   r*   r+   r<   r   r8   z#AssistantsToolInstance.delete_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr*   r*   r+   	<genexpr>       z2AssistantsToolInstance.__repr__.<locals>.<genexpr>z0<Twilio.Assistants.V1.AssistantsToolInstance {}>joinr%   itemsrC   r'   contextr*   r*   r+   __repr__{      
zAssistantsToolInstance.__repr__N)r,   r-   )r,   r   )__name__
__module____qualname____doc__r   r   strr   r   r"   propertyr0   r3   r7   boolr:   r<   rO   __classcell__r*   r*   r(   r+   r      s&    


				r   c                       sp   e Zd Zdededef fddZdefddZdefd	d
Zde	fddZ
de	fddZdefddZ  ZS )r-   r   r   r   c                    s0   t  | ||d| _djdi | j| _dS )z
        Initialize the AssistantsToolContext

        :param version: Version that contains the resource
        :param assistant_id: The assistant ID.
        :param id: The tool ID.
        r    z%/Assistants/{assistant_id}/Tools/{id}Nr*   r!   r"   r%   rC   _uri)r'   r   r   r   r(   r*   r+   r"      s
   zAssistantsToolContext.__init__r,   c                 C   s<   t i }| jjd| j|d}t| j|| jd | jd dS )r2   POSTmethoduridatar   r   r    r   ofr.   r3   r[   r   r%   r'   r`   r   r*   r*   r+   r3      s   
zAssistantsToolContext.createc                    sD   t i }| jjd| j|dI dH }t| j|| jd | jd dS )r6   r\   r]   Nr   r   r    r   rb   r.   r7   r[   r   r%   rc   r*   r*   r+   r7      s   
z"AssistantsToolContext.create_asyncc                 C   s   t i }| jjd| j|dS )r9   DELETEr^   r_   headers)r   rb   r.   r:   r[   r'   rg   r*   r*   r+   r:      s   
zAssistantsToolContext.deletec                    s&   t i }| jjd| j|dI dH S )r;   re   rf   N)r   rb   r.   r<   r[   rh   r*   r*   r+   r<      s
   
z"AssistantsToolContext.delete_asyncc                 C   r=   )r>   r?   c                 s   r@   rA   rB   rD   r*   r*   r+   rH      rI   z1AssistantsToolContext.__repr__.<locals>.<genexpr>z/<Twilio.Assistants.V1.AssistantsToolContext {}>rJ   rM   r*   r*   r+   rO      rP   zAssistantsToolContext.__repr__)rR   rS   rT   r   rV   r"   r   r3   r7   rX   r:   r<   rO   rY   r*   r*   r(   r+   r-      s    r-   c                   @   s4   e Zd Zdeeef defddZdefddZdS )AssistantsToolPager   r,   c                 C   s   t | j|| jd dS )zt
        Build an instance of AssistantsToolInstance

        :param payload: Payload response from the API
        r   r   )r   r.   r%   )r'   r   r*   r*   r+   get_instance      zAssistantsToolPage.get_instancec                 C      dS )r>   z)<Twilio.Assistants.V1.AssistantsToolPage>r*   r/   r*   r*   r+   rO         zAssistantsToolPage.__repr__N)	rR   rS   rT   r   rV   r   r   rk   rO   r*   r*   r*   r+   ri      s    
ri   c                	       s  e Zd Zdedef fddZdefddZdefdd	Z	
	
d'de	e
 de	e
 dee fddZ	
	
d'de	e
 de	e
 dee fddZ	
	
d'de	e
 de	e
 dee fddZ	
	
d'de	e
 de	e
 dee fddZejejejfdeeef dee
ef dee
ef defddZejejejfdeeef dee
ef dee
ef defddZdedefddZdedefddZd edefd!d"Zd edefd#d$Zdefd%d&Z  ZS )(AssistantsToolListr   r   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the AssistantsToolList

        :param version: Version that contains the resource
        :param assistant_id: The assistant ID.

        r   z /Assistants/{assistant_id}/ToolsNr*   rZ   )r'   r   r   r(   r*   r+   r"      s   zAssistantsToolList.__init__r,   c                 C   s8   t ddi}| jjd| j|d}t| j|| jd dS )r2   Content-Type!application/x-www-form-urlencodedr\   rf   r   rj   ra   r'   rg   r   r*   r*   r+   r3   	  s
   zAssistantsToolList.createc                    s@   t ddi}| jjd| j|dI dH }t| j|| jd dS )zy
        Asynchronously create the AssistantsToolInstance


        :returns: The created AssistantsToolInstance
        rp   rq   r\   rf   Nr   rj   rd   rr   r*   r*   r+   r7     s   zAssistantsToolList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| j ||d S )ad  
        Streams AssistantsToolInstance 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rt   rt   rs   )r.   read_limitspagestreamr'   rs   rt   limitsrw   r*   r*   r+   rx   +  s   zAssistantsToolList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )as  
        Asynchronously streams AssistantsToolInstance 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        rt   ru   Nrs   )r.   rv   
page_asyncstream_asyncry   r*   r*   r+   r|   D  s   zAssistantsToolList.stream_asyncc                 C   s   t | j||dS )a  
        Lists AssistantsToolInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        rs   rt   )listrx   r'   rs   rt   r*   r*   r+   r~   ]  s   zAssistantsToolList.listc                    s&   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists AssistantsToolInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S rQ   r*   )rE   recordr*   r*   r+   
<listcomp>  s
    z1AssistantsToolList.list_async.<locals>.<listcomp>r}   N)r|   r   r*   r*   r+   
list_asyncw  s   
zAssistantsToolList.list_async
page_tokenpage_numberc                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a  
        Retrieve a single page of AssistantsToolInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of AssistantsToolInstance
        	PageTokenr   PageSizerp   rq   application/jsonAcceptGETr^   r_   paramsrg   )r   rb   r.   rw   r[   ri   r%   r'   r   r   rt   r`   rg   responser*   r*   r+   rw     s   
zAssistantsToolList.pagec                    sV   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|| jS )	a  
        Asynchronously retrieve a single page of AssistantsToolInstance records from the API.
        Request is executed immediately

        :param page_token: PageToken provided by the API
        :param page_number: Page Number, this value is simply for client state
        :param page_size: Number of records to return, defaults to 50

        :returns: Page of AssistantsToolInstance
        r   rp   rq   r   r   r   r   N)r   rb   r.   r{   r[   ri   r%   r   r*   r*   r+   r{     s   
zAssistantsToolList.page_async
target_urlc                 C   s"   | j jjd|}t| j || jS )a  
        Retrieve a specific page of AssistantsToolInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssistantsToolInstance
        r   )r.   domaintwiliorequestri   r%   r'   r   r   r*   r*   r+   get_page  s   	zAssistantsToolList.get_pagec                    s*   | j jjd|I dH }t| j || jS )a  
        Asynchronously retrieve a specific page of AssistantsToolInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssistantsToolInstance
        r   N)r.   r   r   request_asyncri   r%   r   r*   r*   r+   get_page_async  s   	z!AssistantsToolList.get_page_asyncr   c                 C      t | j| jd |dS zU
        Constructs a AssistantsToolContext

        :param id: The tool ID.
        r   r    r-   r.   r%   r'   r   r*   r*   r+   r#     rl   zAssistantsToolList.getc                 C   r   r   r   r   r*   r*   r+   __call__  rl   zAssistantsToolList.__call__c                 C   rm   )r>   z)<Twilio.Assistants.V1.AssistantsToolList>r*   r/   r*   r*   r+   rO      rn   zAssistantsToolList.__repr__)NN) rR   rS   rT   r   rV   r"   r   r3   r7   r   intr   rx   r	   r|   r   r~   r   r   unsetr   objectri   rw   r{   r   r   r-   r#   r   rO   rY   r*   r*   r(   r+   ro      s    







#



!

ro   N)rU   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r-   ri   ro   r*   r*   r*   r+   <module>   s    $l]