
    piI                         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e      Z G d de      Z G d de      Z G d de      Zy)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            
            e Zd ZdZ	 ddedeeef   dedee   f fdZ	e
dd       Zdd	Zdd
ZdefdZdefdZdefdZ xZS )AssistantsKnowledgeInstancea  
    :ivar description: The type of knowledge source.
    :ivar id: The description of knowledge.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
    :ivar knowledge_source_details: The details of the knowledge source based on the type.
    :ivar name: The name of the knowledge source.
    :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED')
    :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File')
    :ivar url: The url of the knowledge resource.
    :ivar embedding_model: The embedding model to be used for the knowledge source.
    :ivar date_created: The date and time in GMT when the Knowledge 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 Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    versionpayloadassistant_ididc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        |j                  d      | _
        |j                  d	      | _        t        j                  |j                  d
            | _        t        j                  |j                  d            | _        ||xs | j                  d| _        d | _        y )Ndescriptionr   account_sidknowledge_source_detailsnamestatustypeurlembedding_model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__s        z/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/assistants/v1/assistant/assistants_knowledge.pyr%   z$AssistantsKnowledgeInstance.__init__(   s    	!*1++m*D!(T!2*1++m*DEL[[&F
% $+;;v#6	%,[[%:#*;;v#6	")++e"4.5kk:K.L0;0L0LKK'1
 1<0L0LKK'1

 )-
 ?C    returnc                     | j                   7t        | j                  | j                  d   | j                  d         | _         | j                   S )a  
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: AssistantsKnowledgeContext for this AssistantsKnowledgeInstance
        r   r   r#   )r)   AssistantsKnowledgeContext_versionr(   r*   s    r,   _proxyz"AssistantsKnowledgeInstance._proxyI   sE     == 6!^^N;>>$'DM
 }}r-   c                 6    | j                   j                         S )t
        Create the AssistantsKnowledgeInstance


        :returns: The created AssistantsKnowledgeInstance
        )r3   creater2   s    r,   r6   z"AssistantsKnowledgeInstance.createY        {{!!##r-   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to create the AssistantsKnowledgeInstance


        :returns: The created AssistantsKnowledgeInstance
        N)r3   create_asyncr2   s    r,   r:   z(AssistantsKnowledgeInstance.create_asyncb   !      [[--////   '%'c                 6    | j                   j                         S )v
        Deletes the AssistantsKnowledgeInstance


        :returns: True if delete succeeds, False otherwise
        )r3   deleter2   s    r,   r?   z"AssistantsKnowledgeInstance.deletek   r7   r-   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the AssistantsKnowledgeInstance


        :returns: True if delete succeeds, False otherwise
        N)r3   delete_asyncr2   s    r,   rB   z(AssistantsKnowledgeInstance.delete_asynct   r;   r<   c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r,   	<genexpr>z7AssistantsKnowledgeInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z5<Twilio.Assistants.V1.AssistantsKnowledgeInstance {}>joinr(   itemsrI   r*   contexts     r,   __repr__z$AssistantsKnowledgeInstance.__repr__}   s6     ((SDNN<P<P<RSSFMMgVVr-   )N)r.   r0   )r.   r   )__name__
__module____qualname____doc__r   r   strr   r   r%   propertyr3   r6   r:   boolr?   rB   rV   __classcell__r+   s   @r,   r   r      s    & !CC c3hC 	C
 SMCB  $0$ $0D 0W# Wr-   r   c                   h     e Zd Zdededef fdZdefdZdefdZde	fdZ
de	fd	Zdefd
Z xZS )r0   r   r   r   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)z
        Initialize the AssistantsKnowledgeContext

        :param version: Version that contains the resource
        :param assistant_id: The assistant ID.
        :param id: The knowledge ID.
        r#   z)/Assistants/{assistant_id}/Knowledge/{id}N r$   r%   r(   rI   _uri)r*   r   r   r   r+   s       r,   r%   z#AssistantsKnowledgeContext.__init__   sB     	! )
 G?FFXX	r-   r.   c                    t        j                  i       }t        j                  i       }| j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d         S )r5   POSTmethoduridataheadersr   r   r#   r   ofr1   r6   rd   r   r(   r*   rj   rk   r   s       r,   r6   z!AssistantsKnowledgeContext.create   su     yy}))B---&&tyytW ' 
 +MM7~~d#	
 	
r-   c                 *  K   t        j                  i       }t        j                  i       }| j                  j                  d| j                  ||       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)r9   rf   rg   Nr   r   r#   r   rm   r1   r:   rd   r   r(   rn   s       r,   r:   z'AssistantsKnowledgeContext.create_async   s      yy}))B-22tyytW 3 
 
 +MM7~~d#	
 	
	
s   ABB8Bc                 |    t        j                  i       }| j                  j                  d| j                  |      S )r>   DELETErh   ri   rk   )r   rm   r1   r?   rd   r*   rk   s     r,   r?   z!AssistantsKnowledgeContext.delete   s1     ))B-}}##8G#TTr-   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rA   rr   rs   N)r   rm   r1   rB   rd   rt   s     r,   rB   z'AssistantsKnowledgeContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     dj                  d | j                  j                         D              }dj                  |      S )rD   rE   c              3   F   K   | ]  \  }}d j                  ||        ywrG   rH   rJ   s      r,   rN   z6AssistantsKnowledgeContext.__repr__.<locals>.<genexpr>   rO   rP   z4<Twilio.Assistants.V1.AssistantsKnowledgeContext {}>rQ   rT   s     r,   rV   z#AssistantsKnowledgeContext.__repr__   s6     ((SDNN<P<P<RSSELLWUUr-   )rW   rX   rY   r   r[   r%   r   r6   r:   r]   r?   rB   rV   r^   r_   s   @r,   r0   r0      sc    Y Ys Y Y"
3 
,
$? 
,
U 
U
D 
V# Vr-   r0   c                   2    e Zd Zdeeef   defdZdefdZy)AssistantsKnowledgePager   r.   c                 L    t        | j                  || j                  d         S )zy
        Build an instance of AssistantsKnowledgeInstance

        :param payload: Payload response from the API
        r   r   )r   r1   r(   )r*   r   s     r,   get_instancez$AssistantsKnowledgePage.get_instance   s%     +MM71O
 	
r-   c                      y)rD   z.<Twilio.Assistants.V1.AssistantsKnowledgePage>rb   r2   s    r,   rV   z AssistantsKnowledgePage.__repr__        @r-   N)	rW   rX   rY   r   r[   r   r   r|   rV   rb   r-   r,   ry   ry      s,    
DcN 
7R 
@# @r-   ry   c            	       0    e Zd Zdedef fdZdefdZdefdZ	 	 dde	e
   de	e
   dee   fd	Z	 	 dde	e
   de	e
   dee   fd
Z	 	 dde	e
   de	e
   dee   fdZ	 	 dde	e
   de	e
   dee   f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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ZdedefdZdedefdZdedefdZdedefdZdefdZ xZS )AssistantsKnowledgeListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the AssistantsKnowledgeList

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

        r   z$/Assistants/{assistant_id}/KnowledgeNrb   rc   )r*   r   r   r+   s      r,   r%   z AssistantsKnowledgeList.__init__  sA     	! L
 B:AASDNNS	r-   r.   c                     t        j                  ddi      }| j                  j                  d| j                  |      }t        | j                  || j                  d         S )r5   Content-Type!application/x-www-form-urlencodedrf   rs   r   r{   rl   r*   rk   r   s      r,   r6   zAssistantsKnowledgeList.create  sX     ))^-PQR--&&f$))W&U*MM71O
 	
r-   c                    K   t        j                  ddi      }| j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)z
        Asynchronously create the AssistantsKnowledgeInstance


        :returns: The created AssistantsKnowledgeInstance
        r   r   rf   rs   Nr   r{   rp   r   s      r,   r:   z$AssistantsKnowledgeList.create_async!  sm      ))^-PQR22tyy' 3 
 
 +MM71O
 	
	
s   AA1A/*A1limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )ai  
        Streams AssistantsKnowledgeInstance 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
        r   r   r   )r1   read_limitspagestreamr*   r   r   limitsr   s        r,   r   zAssistantsKnowledgeList.stream3  sJ    ( **5)<yy6+#6y7}}##D&/::r-   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ax  
        Asynchronously streams AssistantsKnowledgeInstance 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
        r   r   Nr   )r1   r   
page_asyncstream_asyncr   s        r,   r   z$AssistantsKnowledgeList.stream_asyncL  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists AssistantsKnowledgeInstance 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
        r   r   )listr   )r*   r   r   s      r,   r   zAssistantsKnowledgeList.liste  s(    & KK#  
 	
r-   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously lists AssistantsKnowledgeInstance 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
        r   N)r   )r*   r   r   records       r,   
list_asyncz"AssistantsKnowledgeList.list_async  sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                        S )a  
        Retrieve a single page of AssistantsKnowledgeInstance 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 AssistantsKnowledgeInstance
        	PageTokenr   PageSizer   r   application/jsonAcceptGETrh   ri   paramsrk   )r   rm   r1   r   rd   ry   r(   r*   r   r   r   rj   rk   responses          r,   r   zAssistantsKnowledgeList.page  s      yy'#%
 ))^-PQR.==%%diig & 
 't}}hOOr-   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of AssistantsKnowledgeInstance 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 AssistantsKnowledgeInstance
        r   r   r   r   r   r   r   N)r   rm   r1   r   rd   ry   r(   r   s          r,   r   z"AssistantsKnowledgeList.page_async  s       yy'#%
 ))^-PQR.11diig 2 
 
 't}}hOO
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )a  
        Retrieve a specific page of AssistantsKnowledgeInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssistantsKnowledgeInstance
        r   )r1   domaintwiliorequestry   r(   r*   r   r   s      r,   get_pagez AssistantsKnowledgeList.get_page  s=     ==''..66ujI&t}}hOOr-   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of AssistantsKnowledgeInstance records from the API.
        Request is executed immediately

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

        :returns: Page of AssistantsKnowledgeInstance
        r   N)r1   r   r   request_asyncry   r(   r   s      r,   get_page_asyncz&AssistantsKnowledgeList.get_page_async  sJ      --44BB5*UU&t}}hOO Vs   4AA&Ar   c                 L    t        | j                  | j                  d   |      S z_
        Constructs a AssistantsKnowledgeContext

        :param id: The knowledge ID.
        r   r#   r0   r1   r(   r*   r   s     r,   r&   zAssistantsKnowledgeList.get  %     *MM~(F2
 	
r-   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r,   __call__z AssistantsKnowledgeList.__call__  r   r-   c                      y)rD   z.<Twilio.Assistants.V1.AssistantsKnowledgeList>rb   r2   s    r,   rV   z AssistantsKnowledgeList.__repr__  r~   r-   )NN) rW   rX   rY   r   r[   r%   r   r6   r:   r   intr	   r   r
   r   r   r   r   r   unsetr   objectry   r   r   r   r   r0   r&   r   rV   r^   r_   s   @r,   r   r      s=   T Ts T 
3 
 
$? 
(  $#';}; C=; 
-	.	;6  $#'A}A C=A 
2	3	A6  $#'
}
 C=
 
)	*	
8  $#'
}
 C=
 
)	*	
: *0*0,,(.	P#v+&P 3;'P f%	P
 
!PF *0*0,,(.	P#v+&P 3;'P f%	P
 
!PB
P3 
P+B 
P
Ps 
P7N 
P
c 
8 

3 
#= 
@# @r-   r   N)rZ   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   r0   ry   r   rb   r-   r,   <module>r      sk     L L L + 8 : 2 ' !kW"2 kW\`V `VF@d @*O@l O@r-   