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 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)InstanceResource)ListResource)Version)Pagec                       sD   e Zd ZdZdedeeef def fddZdefdd	Z	  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                    sb   t  | |d| _|d| _|d| _t|d| _t|d| _	d|i| _
d S )Naccount_sidcontentmetadatadate_createddate_updatedr   )super__init__getr   r   r   r
   iso8601_datetimer   r   	_solution)selfr   r   r   	__class__ \/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/assistants/v1/knowledge/chunk.pyr   "   s   
zChunkInstance.__init__returnc                 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>9   s    z)ChunkInstance.__repr__.<locals>.<genexpr>z'<Twilio.Assistants.V1.ChunkInstance {}>)joinr   itemsr&   )r   contextr!   r!   r"   __repr__3   s   
zChunkInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   r.   __classcell__r!   r!   r   r"   r      s    "r   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 )	ChunkPager   r#   c                 C   s   t | j|| jd dS )zk
        Build an instance of ChunkInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr   )r   r   r!   r!   r"   get_instance?   s   zChunkPage.get_instancec                 C      dS )r$   z <Twilio.Assistants.V1.ChunkPage>r!   r   r!   r!   r"   r.   G      zChunkPage.__repr__N)	r/   r0   r1   r   r3   r   r   r7   r.   r!   r!   r!   r"   r5   =   s    r5   c                	       sx  e Zd Zdedef fddZ		ddee dee dee	 fd	d
Z
		ddee dee dee	 fddZ		ddee dee dee	 fddZ		ddee dee dee	 fd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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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 )	ChunkListr   r   c                    s.   t  | d|i| _djdi | j| _dS )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   r!   r"   r   R   s   zChunkList.__init__Nlimit	page_sizer#   c                 C   s0   | j ||}| j|d d}| 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
        r>   r>   r=   )r6   read_limitspagestreamr   r=   r>   limitsrA   r!   r!   r"   rB   b   s   zChunkList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )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
        r>   r?   Nr=   )r6   r@   
page_asyncstream_asyncrC   r!   r!   r"   rF   {   s   zChunkList.stream_asyncc                 C   s   t | j||d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
        r=   r>   )listrB   r   r=   r>   r!   r!   r"   rH      s   zChunkList.listc                    s&   dd | j ||dI dH 2 I dH S )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
        c                    s   g | z3 d H W }|q6 S )Nr!   )r'   recordr!   r!   r"   
<listcomp>   s
    z(ChunkList.list_async.<locals>.<listcomp>rG   N)rF   rI   r!   r!   r"   
list_async   s   
zChunkList.list_async
page_tokenpage_numberc                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}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   ofr6   rA   r<   r5   r   r   rM   rN   r>   datar[   responser!   r!   r"   rA      s   
zChunkList.pagec                    sV   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 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
        rO   rR   rS   rT   rU   rV   rW   N)r   r\   r6   rE   r<   r5   r   r]   r!   r!   r"   rE      s   
zChunkList.page_async
target_urlc                 C   s"   | 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
        rV   )r6   domaintwiliorequestr5   r   r   r`   r_   r!   r!   r"   get_page  s   	zChunkList.get_pagec                    s*   | j jjd|I dH }t| j || jS )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
        rV   N)r6   ra   rb   request_asyncr5   r   rd   r!   r!   r"   get_page_async  s   	zChunkList.get_page_asyncc                 C   r8   )r$   z <Twilio.Assistants.V1.ChunkList>r!   r9   r!   r!   r"   r.   #  r:   zChunkList.__repr__)NN)r/   r0   r1   r   r3   r   r   intr   r   rB   r	   rF   r   rH   rL   r   unsetr   objectr5   rA   rE   re   rg   r.   r4   r!   r!   r   r"   r;   P   s    







#



!r;   N)r2   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   r5   r;   r!   r!   r!   r"   <module>   s    $$