o
    f>h ~                     @   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 ded	ee	e
f d
ee	 f fddZed!ddZdefddZdefddZd"ddZd"ddZejfdeeef dd fddZejfdeeef dd fddZde	fddZ  ZS )#ToolInstancec                   @   .   e Zd ZdZdeeef f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   @   | d| _| d| _| d| _| d| _| d| _d S Ndescriptionidnamepolicy_detailstypegetr   r   r   r   r   selfr    r    Q/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/assistants/v1/tool.py__init__$      z<ToolInstance.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C      | j | j| j| j| jdS Nr   r   r   r   r   r&   r   r    r    r!   to_dict.      z;ToolInstance.AssistantsV1ServiceCreatePolicyRequest.to_dictN	__name__
__module____qualname____doc__r   strr   r"   r(   r    r    r    r!   &AssistantsV1ServiceCreatePolicyRequest       
r0   c                   @   r   )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   X   | d| _| d| _| d| _| d| _| d| _| d| _| d| _d S Nassistant_idr   enabledmetar   policyr   r   r5   r   r6   r7   r   r8   r   r   r    r    r!   r"   B      z:ToolInstance.AssistantsV1ServiceCreateToolRequest.__init__c                 C   4   | j | j| j| j| j| jd ur| j nd | jdS N)r5   r   r6   r7   r   r8   r   r5   r   r6   r7   r   r8   r(   r   r'   r    r    r!   r(   N      z9ToolInstance.AssistantsV1ServiceCreateToolRequest.to_dictNr*   r    r    r    r!   $AssistantsV1ServiceCreateToolRequest7       
r?   c                   @   r   )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   r3   r4   r9   r   r    r    r!   r"   d   r:   z:ToolInstance.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   r;   r<   r=   r'   r    r    r!   r(   p   r>   z9ToolInstance.AssistantsV1ServiceUpdateToolRequest.to_dictNr*   r    r    r    r!   $AssistantsV1ServiceUpdateToolRequestY   r@   rB   Nversionr   r   c                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _t|d
| _t|d| _|d| _d|pY| ji| _d | _d S )Naccount_sidr   r6   r   r7   r   requires_authr   urldate_createddate_updatedpolicies)superr"   r   rD   r   r6   r   r7   r   rE   r   rF   r
   iso8601_datetimerG   rH   rI   	_solution_context)r   rC   r   r   	__class__r    r!   r"      s(   

zToolInstance.__init__returnToolContextc                 C   s&   | j du 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   )rM   rQ   _versionrL   r'   r    r    r!   _proxy   s   
zToolInstance._proxyc                 C   
   | j  S )g
        Deletes the ToolInstance


        :returns: True if delete succeeds, False otherwise
        )rT   deleter'   r    r    r!   rW         
zToolInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the ToolInstance


        :returns: True if delete succeeds, False otherwise
        N)rT   delete_asyncr'   r    r    r!   r[         zToolInstance.delete_asyncc                 C   rU   )U
        Fetch the ToolInstance


        :returns: The fetched ToolInstance
        )rT   fetchr'   r    r    r!   r^      rX   zToolInstance.fetchc                    rY   )o
        Asynchronous coroutine to fetch the ToolInstance


        :returns: The fetched ToolInstance
        N)rT   fetch_asyncr'   r    r    r!   r`      r\   zToolInstance.fetch_async)assistants_v1_service_update_tool_requestc                 C   s   | j j|dS )
        Update the ToolInstance

        :param assistants_v1_service_update_tool_request:

        :returns: The updated ToolInstance
        ra   )rT   updater   ra   r    r    r!   rd      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
        rc   N)rT   update_asyncre   r    r    r!   rg      s   zToolInstance.update_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>       z(ToolInstance.__repr__.<locals>.<genexpr>z&<Twilio.Assistants.V1.ToolInstance {}>joinrL   itemsrn   r   contextr    r    r!   __repr__      
zToolInstance.__repr__N)rP   rQ   )rP   r   )r+   r,   r-   objectr0   r?   rB   r   r   r/   r   r   r"   propertyrT   boolrW   r[   r^   r`   r   unsetr   rd   rg   rz   __classcell__r    r    rN   r!   r      sH    ""
	
	
	

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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ejfdeeef defddZejfdeeef defddZdefddZ  ZS )rQ   c                   @   r   )z2ToolContext.AssistantsV1ServiceCreatePolicyRequestr   r   c                 C   r   r   r   r   r    r    r!   r"     r#   z;ToolContext.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C   r$   r%   r&   r'   r    r    r!   r(     r)   z:ToolContext.AssistantsV1ServiceCreatePolicyRequest.to_dictNr*   r    r    r    r!   r0     r1   r0   c                   @   r   )z0ToolContext.AssistantsV1ServiceCreateToolRequestr2   r   c                 C   r3   r4   r9   r   r    r    r!   r"   -  r:   z9ToolContext.AssistantsV1ServiceCreateToolRequest.__init__c                 C   r;   r<   r=   r'   r    r    r!   r(   9  r>   z8ToolContext.AssistantsV1ServiceCreateToolRequest.to_dictNr*   r    r    r    r!   r?   "  r@   r?   c                   @   r   )z0ToolContext.AssistantsV1ServiceUpdateToolRequestrA   r   c                 C   r3   r4   r9   r   r    r    r!   r"   O  r:   z9ToolContext.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   r;   r<   r=   r'   r    r    r!   r(   [  r>   z8ToolContext.AssistantsV1ServiceUpdateToolRequest.to_dictNr*   r    r    r    r!   rB   D  r@   rB   rC   r   c                    s.   t  | d|i| _djdi | j| _dS )z{
        Initialize the ToolContext

        :param version: Version that contains the resource
        :param id:
        r   z/Tools/{id}Nr    )rJ   r"   rL   rn   _uri)r   rC   r   rN   r    r!   r"   f  s   zToolContext.__init__rP   c                 C   s   t i }| jjd| j|dS )rV   DELETEmethoduriheaders)r   ofrS   rW   r   r   r   r    r    r!   rW   u  s   
zToolContext.deletec                    s&   t i }| jjd| j|dI dH S )rZ   r   r   N)r   r   rS   r[   r   r   r    r    r!   r[     s
   
zToolContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r]   application/jsonAcceptGETr   r   rR   )r   r   rS   r^   r   r   rL   r   r   r   r    r    r!   r^     s   
zToolContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r_   r   r   r   r   Nr   rR   )r   r   rS   r`   r   r   rL   r   r    r    r!   r`     s   
zToolContext.fetch_asyncra   c                 C   sN   |  }ti }d|d< d|d< | jjd| j||d}t| j|| jd dS )rb   r   Content-Typer   PUTr   r   datar   r   rR   )r(   r   r   rS   rd   r   r   rL   r   ra   r   r   r   r    r    r!   rd     s   

zToolContext.updatec                    sV   |  }ti }d|d< d|d< | jjd| j||dI dH }t| j|| jd dS )	rf   r   r   r   r   r   Nr   rR   )r(   r   r   rS   rg   r   r   rL   r   r    r    r!   rg     s   

zToolContext.update_asyncc                 C   rh   )ri   rj   c                 s   rk   rl   rm   ro   r    r    r!   rs     rt   z'ToolContext.__repr__.<locals>.<genexpr>z%<Twilio.Assistants.V1.ToolContext {}>ru   rx   r    r    r!   rz     r{   zToolContext.__repr__)r+   r,   r-   r}   r0   r?   rB   r   r/   r"   r   rW   r[   r   r^   r`   r   r   r   rd   rg   rz   r   r    r    rN   r!   rQ     s4    ""

rQ   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 )ToolPager   rP   c                 C   s   t | j|S )zj
        Build an instance of ToolInstance

        :param payload: Payload response from the API
        )r   rS   r   r    r    r!   get_instance  s   zToolPage.get_instancec                 C      dS )ri   z<Twilio.Assistants.V1.ToolPage>r    r'   r    r    r!   rz        zToolPage.__repr__N)	r+   r,   r-   r   r/   r   r   r   rz   r    r    r    r!   r     s    r   c                       sL  e Zd ZG dd deZG dd deZG dd deZdef fdd	Zd
ede	fddZ
d
ede	fddZejddfdeeef dee dee dee	 fddZejddfdeeef dee dee dee	 fddZejddfdeeef dee dee dee	 fddZejddfdeeef dee dee dee	 fddZejejejejfdeee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ejfdeee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 ).ToolListc                   @   r   )z/ToolList.AssistantsV1ServiceCreatePolicyRequestr   r   c                 C   r   r   r   r   r    r    r!   r"     r#   z8ToolList.AssistantsV1ServiceCreatePolicyRequest.__init__c                 C   r$   r%   r&   r'   r    r    r!   r(   !  r)   z7ToolList.AssistantsV1ServiceCreatePolicyRequest.to_dictNr*   r    r    r    r!   r0     r1   r0   c                   @   r   )z-ToolList.AssistantsV1ServiceCreateToolRequestr2   r   c                 C   r3   r4   r9   r   r    r    r!   r"   5  r:   z6ToolList.AssistantsV1ServiceCreateToolRequest.__init__c                 C   r;   r<   r=   r'   r    r    r!   r(   A  r>   z5ToolList.AssistantsV1ServiceCreateToolRequest.to_dictNr*   r    r    r    r!   r?   *  r@   r?   c                   @   r   )z-ToolList.AssistantsV1ServiceUpdateToolRequestrA   r   c                 C   r3   r4   r9   r   r    r    r!   r"   W  r:   z6ToolList.AssistantsV1ServiceUpdateToolRequest.__init__c                 C   r;   r<   r=   r'   r    r    r!   r(   c  r>   z5ToolList.AssistantsV1ServiceUpdateToolRequest.to_dictNr*   r    r    r    r!   rB   L  r@   rB   rC   c                    s   t  | d| _dS )zf
        Initialize the ToolList

        :param version: Version that contains the resource

        z/ToolsN)rJ   r"   r   )r   rC   rN   r    r!   r"   n  s   
zToolList.__init__)assistants_v1_service_create_tool_requestrP   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-urlencodedr   r   POSTr   )r(   r   r   rS   creater   r   r   r   r   r   r   r    r    r!   r   y  s   
zToolList.createc                    sP   |  }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   r   r   r   r   N)r(   r   r   rS   create_asyncr   r   r   r    r    r!   r     s   
zToolList.create_asyncNr5   limit	page_sizec                 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   r5   r   r   )rS   read_limitspagestreamr   r5   r   r   limitsr   r    r    r!   r     s   zToolList.streamc                    s:   | 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   )rS   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
        r5   r   r   )listr   r   r5   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 r|   r    )rp   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
page_tokenpage_numberc                 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
        AssistantId	PageTokenr   PageSizer   r   r   r   r   r   r   paramsr   )r   r   rS   r   r   r   r   r5   r   r   r   r   r   responser    r    r!   r     s   	
zToolList.pagec                    sT   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   r   r   r   r   N)r   r   rS   r   r   r   r   r    r    r!   r   B  s   	
zToolList.page_async
target_urlc                 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
        r   )rS   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
        r   N)rS   r   r   request_asyncr   r   r    r    r!   get_page_asyncr  s   	zToolList.get_page_asyncr   c                 C      t | j|dS z>
        Constructs a ToolContext

        :param id:
        rR   rQ   rS   r   r   r    r    r!   r   ~     zToolList.getc                 C   r   r   r   r   r    r    r!   __call__  r   zToolList.__call__c                 C   r   )ri   z<Twilio.Assistants.V1.ToolList>r    r'   r    r    r!   rz     r   zToolList.__repr__)#r+   r,   r-   r}   r0   r?   rB   r   r"   r   r   r   r   r   r   r/   r   intr   r   r	   r   r   r   r   r   r   r   r   r   rQ   r   r   rz   r   r    r    rN   r!   r     s    ""









 




&




$r   N)r.   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   rQ   r   r   r    r    r    r!   <module>   s    $ l v