U
    ^g%i ~                     @   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G dd deZG dd deZG dd deZdeee	e
f ee	 d fd	d
ZeddddZedddZedddZd dddZd dddZejfeeef d dddZejfeeef d dddZe	dddZ  ZS )ToolInstancec                   @   s.   e Zd ZdZeeef dddZdd ZdS )z3ToolInstance.AssistantsV1ServiceCreatePolicyRequest
        :ivar description: The description of the policy.
        :ivar id: The Policy ID.
        :ivar name: The name of the policy.
        :ivar policy_details:
        :ivar type: The description of the policy.
        payloadc                 C   s@   | d| _| d| _| d| _| d| _| d| _d S Ndescriptionidnamepolicy_detailstypegetr   r   r   r   r   selfr    r   ]/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/assistants/v1/tool.py__init__$   s    z<ToolInstance.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C   s   | j | j| j| j| jdS Nr   r   r   r   r   r#   r   r   r   r    to_dict.   s    z;ToolInstance.AssistantsV1ServiceCreatePolicyRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r!   r%   r   r   r   r    &AssistantsV1ServiceCreatePolicyRequest   s   
r,   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z1ToolInstance.AssistantsV1ServiceCreateToolRequestq  
        :ivar assistant_id: The Assistant ID.
        :ivar description: The description of the tool.
        :ivar enabled: True if the tool is enabled.
        :ivar meta: The metadata related to method, url, input_schema to used with the Tool.
        :ivar name: The name of the tool.
        :ivar policy:
        :ivar type: The description of the tool.
        r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S Nassistant_idr   enabledmetar   policyr   r   r/   r   r0   r1   r   r2   r   r   r   r   r    r!   B   s    z:ToolInstance.AssistantsV1ServiceCreateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS N)r/   r   r0   r1   r   r2   r   r/   r   r0   r1   r   r2   r%   r   r$   r   r   r    r%   N   s    z9ToolInstance.AssistantsV1ServiceCreateToolRequest.to_dictNr&   r   r   r   r    $AssistantsV1ServiceCreateToolRequest7   s   
r6   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z1ToolInstance.AssistantsV1ServiceUpdateToolRequestj  
        :ivar assistant_id: The Assistant ID.
        :ivar description: The description of the tool.
        :ivar enabled: True if the tool is enabled.
        :ivar meta: The metadata related to method, url, input_schema to used with the Tool.
        :ivar name: The name of the tool.
        :ivar policy:
        :ivar type: The type of the tool.
        r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S r.   r3   r   r   r   r    r!   d   s    z:ToolInstance.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS r4   r5   r$   r   r   r    r%   p   s    z9ToolInstance.AssistantsV1ServiceUpdateToolRequest.to_dictNr&   r   r   r   r    $AssistantsV1ServiceUpdateToolRequestY   s   
r8   N)versionr   r   c                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _t|d
| _t|d| _|d| _d|p| ji| _d | _d S )Naccount_sidr   r0   r   r1   r   requires_authr   urldate_createddate_updatedpolicies)superr!   r   r:   r   r0   r   r1   r   r;   r   r<   r
   Ziso8601_datetimer=   r>   r?   	_solution_context)r   r9   r   r   	__class__r   r    r!      s*     zToolInstance.__init__ToolContextreturnc                 C   s&   | j dkr t| j| 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: ToolContext for this ToolInstance
        Nr   r   )rB   rE   _versionrA   r$   r   r   r    _proxy   s    
zToolInstance._proxyc                 C   s
   | j  S )g
        Deletes the ToolInstance


        :returns: True if delete succeeds, False otherwise
        )rJ   deleter$   r   r   r    rL      s    zToolInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the ToolInstance


        :returns: True if delete succeeds, False otherwise
        N)rJ   delete_asyncr$   r   r   r    rN      s    zToolInstance.delete_asyncc                 C   s
   | j  S )U
        Fetch the ToolInstance


        :returns: The fetched ToolInstance
        )rJ   fetchr$   r   r   r    rP      s    zToolInstance.fetchc                    s   | j  I dH S )o
        Asynchronous coroutine to fetch the ToolInstance


        :returns: The fetched ToolInstance
        N)rJ   fetch_asyncr$   r   r   r    rR      s    zToolInstance.fetch_async)assistants_v1_service_update_tool_requestrG   c                 C   s   | j j|dS )
        Update the ToolInstance

        :param assistants_v1_service_update_tool_request:

        :returns: The updated ToolInstance
        rT   )rJ   updater   rT   r   r   r    rW      s    zToolInstance.updatec                    s   | j j|dI dH S )
        Asynchronous coroutine to update the ToolInstance

        :param assistants_v1_service_update_tool_request:

        :returns: The updated ToolInstance
        rV   N)rJ   update_asyncrX   r   r   r    rZ      s    zToolInstance.update_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     z(ToolInstance.__repr__.<locals>.<genexpr>z&<Twilio.Assistants.V1.ToolInstance {}>joinrA   itemsr_   r   contextr   r   r    __repr__   s    zToolInstance.__repr__)N)r'   r(   r)   objectr,   r6   r8   r   r   r+   r   r   r!   propertyrJ   boolrL   rN   rP   rR   r   unsetr   rW   rZ   rj   __classcell__r   r   rC   r    r      s<   "2  
 			r   c                       s   e Zd ZG dd deZG dd deZG dd deZ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jfeeef edddZejfeeef edddZed
ddZ  ZS )rE   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z2ToolContext.AssistantsV1ServiceCreatePolicyRequestr   r   c                 C   s@   | d| _| d| _| d| _| d| _| d| _d S r   r   r   r   r   r    r!     s    z;ToolContext.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C   s   | j | j| j| j| jdS r"   r#   r$   r   r   r    r%     s    z:ToolContext.AssistantsV1ServiceCreatePolicyRequest.to_dictNr&   r   r   r   r    r,     s   
r,   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z0ToolContext.AssistantsV1ServiceCreateToolRequestr-   r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S r.   r3   r   r   r   r    r!   -  s    z9ToolContext.AssistantsV1ServiceCreateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS r4   r5   r$   r   r   r    r%   9  s    z8ToolContext.AssistantsV1ServiceCreateToolRequest.to_dictNr&   r   r   r   r    r6   "  s   
r6   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z0ToolContext.AssistantsV1ServiceUpdateToolRequestr7   r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S r.   r3   r   r   r   r    r!   O  s    z9ToolContext.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS r4   r5   r$   r   r   r    r%   [  s    z8ToolContext.AssistantsV1ServiceUpdateToolRequest.to_dictNr&   r   r   r   r    r8   D  s   
r8   )r9   r   c                    s*   t  | d|i| _djf | j| _dS )z{
        Initialize the ToolContext

        :param version: Version that contains the resource
        :param id:
        r   z/Tools/{id}N)r@   r!   rA   r_   _uri)r   r9   r   rC   r   r    r!   f  s
     zToolContext.__init__rF   c                 C   s   t i }| jjd| j|dS )rK   DELETEmethoduriheaders)r   ofrI   rL   rp   r   ru   r   r   r    rL   u  s    
zToolContext.deletec                    s$   t i }| jjd| j|dI dH S )rM   rq   rr   N)r   rv   rI   rN   rp   rw   r   r   r    rN     s    
  zToolContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )rO   application/jsonAcceptGETrr   r   rH   )r   rv   rI   rP   rp   r   rA   r   ru   r   r   r   r    rP     s    
zToolContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )rQ   rx   ry   rz   rr   Nr   rH   )r   rv   rI   rR   rp   r   rA   r{   r   r   r    rR     s    
  zToolContext.fetch_asyncrS   c                 C   sN   |  }ti }d|d< d|d< | jjd| j||d}t| j|| jd dS )rU   rx   Content-Typery   PUTrs   rt   dataru   r   rH   )r%   r   rv   rI   rW   rp   r   rA   r   rT   r   ru   r   r   r   r    rW     s    
   zToolContext.updatec                    sT   |  }ti }d|d< d|d< | jjd| j||dI dH }t| j|| jd dS )	rY   rx   r|   ry   r}   r~   Nr   rH   )r%   r   rv   rI   rZ   rp   r   rA   r   r   r   r    rZ     s    
   zToolContext.update_asyncc                 C   s$   d dd | j D }d|S )r[   r\   c                 s   s   | ]\}}d  ||V  qdS r]   r^   r`   r   r   r    rd     s     z'ToolContext.__repr__.<locals>.<genexpr>z%<Twilio.Assistants.V1.ToolContext {}>re   rh   r   r   r    rj     s    zToolContext.__repr__)r'   r(   r)   rk   r,   r6   r8   r   r+   r!   rm   rL   rN   r   rP   rR   r   rn   r   rW   rZ   rj   ro   r   r   rC   r    rE     s.   ""rE   c                   @   s2   e Zd Zeeef edddZedddZdS )ToolPage)r   rG   c                 C   s   t | j|S )zj
        Build an instance of ToolInstance

        :param payload: Payload response from the API
        )r   rI   r   r   r   r    get_instance  s    zToolPage.get_instancerF   c                 C   s   dS )r[   z<Twilio.Assistants.V1.ToolPage>r   r$   r   r   r    rj     s    zToolPage.__repr__N)	r'   r(   r)   r   r+   r   r   r   rj   r   r   r   r    r     s   r   c                       s  e Zd ZG dd deZG dd deZG dd deZed fdd	Zee	d
ddZ
ee	d
ddZejddfeeef ee ee ee	 dddZejddfeeef ee ee ee	 dddZejddfeeef ee ee ee	 dddZejddfeeef ee ee ee	 dddZejejejejfeeef eeef eeef eeef edddZejejejejfeee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 )+ToolListc                   @   s.   e Zd ZdZeeef dddZdd ZdS )z/ToolList.AssistantsV1ServiceCreatePolicyRequestr   r   c                 C   s@   | d| _| d| _| d| _| d| _| d| _d S r   r   r   r   r   r    r!     s    z8ToolList.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C   s   | j | j| j| j| jdS r"   r#   r$   r   r   r    r%   !  s    z7ToolList.AssistantsV1ServiceCreatePolicyRequest.to_dictNr&   r   r   r   r    r,     s   
r,   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z-ToolList.AssistantsV1ServiceCreateToolRequestr-   r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S r.   r3   r   r   r   r    r!   5  s    z6ToolList.AssistantsV1ServiceCreateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS r4   r5   r$   r   r   r    r%   A  s    z5ToolList.AssistantsV1ServiceCreateToolRequest.to_dictNr&   r   r   r   r    r6   *  s   
r6   c                   @   s.   e Zd ZdZeeef dddZdd ZdS )z-ToolList.AssistantsV1ServiceUpdateToolRequestr7   r   c                 C   sX   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S r.   r3   r   r   r   r    r!   W  s    z6ToolList.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   s4   | j | j| j| j| j| jd k	r(| j nd | jdS r4   r5   r$   r   r   r    r%   c  s    z5ToolList.AssistantsV1ServiceUpdateToolRequest.to_dictNr&   r   r   r   r    r8   L  s   
r8   )r9   c                    s   t  | d| _dS )zf
        Initialize the ToolList

        :param version: Version that contains the resource

        z/ToolsN)r@   r!   rp   )r   r9   rC   r   r    r!   n  s    zToolList.__init__))assistants_v1_service_create_tool_requestrG   c                 C   sH   |  }tddi}d|d< d|d< | jjd| j||d}t| j|S )z
        Create the ToolInstance

        :param assistants_v1_service_create_tool_request:

        :returns: The created ToolInstance
        r|   !application/x-www-form-urlencodedrx   ry   POSTr~   )r%   r   rv   rI   createrp   r   r   r   r   ru   r   r   r   r    r   y  s       zToolList.createc                    sN   |  }tddi}d|d< d|d< | jjd| j||dI dH }t| j|S )z
        Asynchronously create the ToolInstance

        :param assistants_v1_service_create_tool_request:

        :returns: The created ToolInstance
        r|   r   rx   ry   r   r~   N)r%   r   rv   rI   create_asyncrp   r   r   r   r   r    r     s       zToolList.create_asyncN)r/   limit	page_sizerG   c                 C   s2   | j ||}| j||d d}| j ||d S )a{  
        Streams ToolInstance 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 str assistant_id:
        :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
        r   r/   r   r   )rI   read_limitspagestreamr   r/   r   r   Zlimitsr   r   r   r    r     s    zToolList.streamc                    s8   | j ||}| j||d dI dH }| j ||d S )a  
        Asynchronously streams ToolInstance 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 str assistant_id:
        :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
        r   r   Nr   )rI   r   
page_asyncstream_asyncr   r   r   r    r     s     zToolList.stream_asyncc                 C   s   t | j|||dS )a  
        Lists ToolInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str assistant_id:
        :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
        r/   r   r   )listr   r   r/   r   r   r   r   r    r     s    zToolList.listc                    s&   dd | j |||dI dH 2 I dH S )a'  
        Asynchronously lists ToolInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str assistant_id:
        :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   )ra   recordr   r   r    
<listcomp>  s   z'ToolList.list_async.<locals>.<listcomp>r   N)r   r   r   r   r    
list_async   s    
zToolList.list_async)r/   
page_tokenpage_numberr   rG   c                 C   sL   t ||||d}t ddi}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of ToolInstance records from the API.
        Request is executed immediately

        :param assistant_id:
        :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 ToolInstance
        ZAssistantIdZ	PageTokenr   ZPageSizer|   r   rx   ry   rz   rs   rt   paramsru   )r   rv   rI   r   rp   r   r   r/   r   r   r   r   ru   responser   r   r    r     s     	   zToolList.pagec                    sR   t ||||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously retrieve a single page of ToolInstance records from the API.
        Request is executed immediately

        :param assistant_id:
        :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 ToolInstance
        r   r|   r   rx   ry   rz   r   N)r   rv   rI   r   rp   r   r   r   r   r    r   B  s     	   zToolList.page_async)
target_urlrG   c                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of ToolInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ToolInstance
        rz   )rI   domaintwiliorequestr   r   r   r   r   r   r    get_pagef  s    	zToolList.get_pagec                    s$   | j jjd|I dH }t| j |S )z
        Asynchronously retrieve a specific page of ToolInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ToolInstance
        rz   N)rI   r   r   Zrequest_asyncr   r   r   r   r    get_page_asyncr  s    	zToolList.get_page_async)r   rG   c                 C   s   t | j|dS z>
        Constructs a ToolContext

        :param id:
        rH   rE   rI   r   r   r   r   r    r   ~  s    zToolList.getc                 C   s   t | j|dS r   r   r   r   r   r    __call__  s    zToolList.__call__rF   c                 C   s   dS )r[   z<Twilio.Assistants.V1.ToolList>r   r$   r   r   r    rj     s    zToolList.__repr__)#r'   r(   r)   rk   r,   r6   r8   r   r!   r   r   r   r   rn   r   r+   r   intr   r   r	   r   r   r   r   r   r   r   r   r   rE   r   r   rj   ro   r   r   rC   r    r     s   ""



 



&



$r   N)r*   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   rE   r   r   r   r   r   r    <module>   s   $ l v