
    pi+                         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  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)InstanceResource)ListResource)Version)Pagec                   F     e Zd ZdZdedeeef   def fdZdefdZ	 xZ
S )ChunkInstancea  
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource.
    :ivar content: The chunk content.
    :ivar metadata: The metadata of the chunk.
    :ivar date_created: The date and time in GMT when the Chunk 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 Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    versionpayloadidc                 ^   t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _	        d|i| _
        y )Naccount_sidcontentmetadatadate_createddate_updatedr   )super__init__getr   r   r   r   iso8601_datetimer   r   	_solution)selfr   r   r   	__class__s       k/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/assistants/v1/knowledge/chunk.pyr   zChunkInstance.__init__"   s    !*1++m*D&-kk)&<5<[[5L0;0L0LKK'1
 1<0L0LKK'1

 "
    returnc                     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>z)ChunkInstance.__repr__.<locals>.<genexpr>9   s     SDAq7>>!Q/Ss   !z'<Twilio.Assistants.V1.ChunkInstance {}>)joinr    itemsr*   )r!   contexts     r#   __repr__zChunkInstance.__repr__3   s6     ((SDNN<P<P<RSS8??HHr$   )__name__
__module____qualname____doc__r   r   strr   r   r2   __classcell__r"   s   @r#   r   r      s8    
 
$sCx. 
c 
"I# Ir$   r   c                   2    e Zd Zdeeef   defdZdefdZy)	ChunkPager   r%   c                 L    t        | j                  || j                  d         S )zk
        Build an instance of ChunkInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr    )r!   r   s     r#   get_instancezChunkPage.get_instance?   s      T]]Gt8LMMr$   c                      y)r'   z <Twilio.Assistants.V1.ChunkPage> r!   s    r#   r2   zChunkPage.__repr__G        2r$   N)	r3   r4   r5   r   r7   r   r   r>   r2   r@   r$   r#   r;   r;   =   s,    NDcN N} N2# 2r$   r;   c            	           e Zd Zdedef 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fdZ xZS )	ChunkListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the ChunkList

        :param version: Version that contains the resource
        :param id: The knowledge ID.

        r   z/Knowledge/{id}/ChunksNr@   )r   r   r    r*   _uri)r!   r   r   r"   s      r#   r   zChunkList.__init__R   s@     	! "
 4,33EdnnE	r$   limit	page_sizer%   c                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )a[  
        Streams ChunkInstance 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   limitsrL   s        r#   rM   zChunkList.streamb   sJ    ( **5)<yy6+#6y7}}##D&/::r$   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)aj  
        Asynchronously streams ChunkInstance 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   rJ   NrG   )r=   rK   
page_asyncstream_asyncrN   s        r#   rR   zChunkList.stream_async{   sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists ChunkInstance 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   )listrM   )r!   rG   rH   s      r#   rU   zChunkList.list   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 ChunkInstance 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
        rT   N)rR   )r!   rG   rH   records       r#   
list_asynczChunkList.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 )ao  
        Retrieve a single page of ChunkInstance 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 ChunkInstance
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofr=   rL   rF   r;   r    r!   rY   rZ   rH   datarh   responses          r#   rL   zChunkList.page   s      yy'#%
 ))^-PQR.==%%diig & 
 $..AAr$   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 ChunkInstance 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 ChunkInstance
        r\   r_   r`   ra   rb   rc   rd   N)r   ri   r=   rQ   rF   r;   r    rj   s          r#   rQ   zChunkList.page_async   s       yy'#%
 ))^-PQR.11diig 2 
 
 $..AA
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of ChunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ChunkInstance
        rc   )r=   domaintwiliorequestr;   r    r!   rn   rl   s      r#   get_pagezChunkList.get_page  s=     ==''..66ujI$..AAr$   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)z
        Asynchronously retrieve a specific page of ChunkInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ChunkInstance
        rc   N)r=   rp   rq   request_asyncr;   r    rs   s      r#   get_page_asynczChunkList.get_page_async  sJ      --44BB5*UU$..AA Vs   4AA&Ac                      y)r'   z <Twilio.Assistants.V1.ChunkList>r@   rA   s    r#   r2   zChunkList.__repr__#  rB   r$   )NN)r3   r4   r5   r   r7   r   r   intr	   r   rM   r
   rR   r   rU   rX   r   unsetr   objectr;   rL   rQ   rt   rw   r2   r8   r9   s   @r#   rD   rD   P   s   F FS F$  $#';}; C=; 
-	 	;6  $#'A}A C=A 
}	%	A6  $#'
}
 C=
 
m		
8  $#'
}
 C=
 
m		
: *0*0,,(.	B#v+&B 3;'B f%	B
 
BF *0*0,,(.	B#v+&B 3;'B f%	B
 
BB
B3 
B9 
B
Bs 
By 
B2# 2r$   rD   N)r6   r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r;   rD   r@   r$   r#   <module>r      sQ     L L L + : 2 ' !!I$ !IH2 2&Y2 Y2r$   