U
    ^g%ivG                     @   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eeeef eee d fddZ	e
dddd	Zd dd
dZd dddZedddZedddZed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| _||p| 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
   Ziso8601_datetimer   r   	_solution_context)selfr   r   r   r   	__class__ r/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/assistants/v1/assistant/assistants_tool.pyr"   (   s(    zAssistantsToolInstance.__init__AssistantsToolContextreturnc                 C   s.   | j dk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   s
   | j  S )j
        Create the AssistantsToolInstance


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


        :returns: The created AssistantsToolInstance
        N)r0   create_asyncr/   r)   r)   r*   r4   `   s    z#AssistantsToolInstance.create_asyncc                 C   s
   | j  S )q
        Deletes the AssistantsToolInstance


        :returns: True if delete succeeds, False otherwise
        )r0   deleter/   r)   r)   r*   r6   i   s    zAssistantsToolInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the AssistantsToolInstance


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

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr)   r)   r*   	<genexpr>   s     z2AssistantsToolInstance.__repr__.<locals>.<genexpr>z0<Twilio.Assistants.V1.AssistantsToolInstance {}>joinr$   itemsr=   r&   contextr)   r)   r*   __repr__{   s    zAssistantsToolInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r"   propertyr0   r2   r4   boolr6   r8   rH   __classcell__r)   r)   r'   r*   r      s    
				r   c                       sl   e Zd Zeeed fddZedddZedddZe	dd	d
Z
e	dddZedddZ  ZS )r+   )r   r   r   c                    s,   t  | ||d| _djf | 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}Nr!   r"   r$   r=   _uri)r&   r   r   r   r'   r)   r*   r"      s
    zAssistantsToolContext.__init__r,   c                 C   sH   t i }t i }| jjd| j||d}t| j|| jd | jd dS )r1   POSTmethoduridataheadersr   r   r    r   ofr.   r2   rR   r   r$   r&   rW   rX   r   r)   r)   r*   r2      s    

   zAssistantsToolContext.createc                    sN   t i }t i }| jjd| j||dI dH }t| j|| jd | jd dS )r3   rS   rT   Nr   r   r    r   rZ   r.   r4   rR   r   r$   r[   r)   r)   r*   r4      s    

   z"AssistantsToolContext.create_asyncc                 C   s   t i }| jjd| j|dS )r5   DELETErU   rV   rX   )r   rZ   r.   r6   rR   r&   rX   r)   r)   r*   r6      s    
zAssistantsToolContext.deletec                    s$   t i }| jjd| j|dI dH S )r7   r]   r^   N)r   rZ   r.   r8   rR   r_   r)   r)   r*   r8      s    
  z"AssistantsToolContext.delete_asyncc                 C   s$   d dd | j D }d|S )r9   r:   c                 s   s   | ]\}}d  ||V  qdS r;   r<   r>   r)   r)   r*   rB      s     z1AssistantsToolContext.__repr__.<locals>.<genexpr>z/<Twilio.Assistants.V1.AssistantsToolContext {}>rC   rF   r)   r)   r*   rH      s    zAssistantsToolContext.__repr__)rI   rJ   rK   r   rM   r"   r   r2   r4   rO   r6   r8   rH   rP   r)   r)   r'   r*   r+      s   r+   c                   @   s2   e Zd Zeeef edddZedddZdS )AssistantsToolPage)r   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   s
      zAssistantsToolPage.get_instancer,   c                 C   s   dS )r9   z)<Twilio.Assistants.V1.AssistantsToolPage>r)   r/   r)   r)   r*   rH      s    zAssistantsToolPage.__repr__N)	rI   rJ   rK   r   rM   r   r   rb   rH   r)   r)   r)   r*   r`      s   
r`   c                       s  e Zd Zeed fddZedddZedddZd$e	e
 e	e
 ee d
ddZd%e	e
 e	e
 ee d
ddZd&e	e
 e	e
 ee d
ddZd'e	e
 e	e
 ee d
ddZejejejfeeef ee
ef ee
ef edddZejejejfeeef ee
ef ee
ef edddZeedddZeedddZeedddZeedd d!Zedd"d#Z  ZS )(AssistantsToolList)r   r   c                    s*   t  | d|i| _djf | 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}/ToolsNrQ   )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 )r1   Content-Type!application/x-www-form-urlencodedrS   r^   r   ra   rY   r&   rX   r   r)   r)   r*   r2     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
        rd   re   rS   r^   Nr   ra   r\   rf   r)   r)   r*   r4     s        zAssistantsToolList.create_asyncN)limit	page_sizer-   c                 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
        rh   rh   rg   )r.   read_limitspagestreamr&   rg   rh   Zlimitsrk   r)   r)   r*   rl   1  s    zAssistantsToolList.streamc                    s6   | 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
        rh   ri   Nrg   )r.   rj   
page_asyncstream_asyncrm   r)   r)   r*   ro   J  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
        rg   rh   )listrl   r&   rg   rh   r)   r)   r*   rq   c  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 )Nr)   )r?   recordr)   r)   r*   
<listcomp>  s   z1AssistantsToolList.list_async.<locals>.<listcomp>rp   N)ro   rr   r)   r)   r*   
list_async}  s    
zAssistantsToolList.list_async)
page_tokenpage_numberrh   r-   c                 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
        Z	PageTokenr   ZPageSizerd   re   application/jsonAcceptGETrU   rV   paramsrX   )r   rZ   r.   rk   rR   r`   r$   r&   rv   rw   rh   rW   rX   responser)   r)   r*   rk     s       zAssistantsToolList.pagec                    sT   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
        rx   rd   re   ry   rz   r{   r|   N)r   rZ   r.   rn   rR   r`   r$   r~   r)   r)   r*   rn     s       zAssistantsToolList.page_async)
target_urlr-   c                 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requestr`   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   Zrequest_asyncr`   r$   r   r)   r)   r*   get_page_async  s    	z!AssistantsToolList.get_page_async)r   r-   c                 C   s   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#     s
      zAssistantsToolList.getc                 C   s   t | j| jd |dS r   r   r   r)   r)   r*   __call__  s
      zAssistantsToolList.__call__c                 C   s   dS )r9   z)<Twilio.Assistants.V1.AssistantsToolList>r)   r/   r)   r)   r*   rH     s    zAssistantsToolList.__repr__)NN)NN)NN)NN) rI   rJ   rK   r   rM   r"   r   r2   r4   r   intr   rl   r	   ro   r   rq   ru   r   unsetr   objectr`   rk   rn   r   r   r+   r#   r   rH   rP   r)   r)   r'   r*   rc      sl           


#


!

rc   N)rL   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r+   r`   rc   r)   r)   r)   r*   <module>   s   $lc