o
    f>h{J                     @   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 - Conversations
    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                       sN   e Zd ZG dd deZ	 dedeeef f fddZ	defdd	Z
  ZS )
ParticipantConversationInstancec                   @   s   e Zd ZdZdZdZdS )z%ParticipantConversationInstance.StateinactiveactiveclosedN)__name__
__module____qualname__INACTIVEACTIVECLOSED r   r   h/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/participant_conversation.pyState   s    r   versionpayloadc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _t|d| _t|d| _|d| _|d| _|d| _|d| _d S )Naccount_sidchat_service_sidparticipant_sidparticipant_user_sidparticipant_identityparticipant_messaging_bindingconversation_sidconversation_unique_nameconversation_friendly_nameconversation_attributesconversation_date_createdconversation_date_updatedconversation_created_byconversation_stateconversation_timerslinks)super__init__getr   r    r!   r"   r#   r$   r%   r&   r'   r(   r
   iso8601_datetimer)   r*   r+   r,   r-   r.   )selfr   r   	__class__r   r   r0   3   s@   z(ParticipantConversationInstance.__init__returnc                 C      dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z9<Twilio.Conversations.V1.ParticipantConversationInstance>r   r3   r   r   r   __repr__Y   s   z(ParticipantConversationInstance.__repr__)r   r   r   objectr   r   r   strr   r0   r:   __classcell__r   r   r4   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 )ParticipantConversationPager   r6   c                 C   s   t | j|S )z}
        Build an instance of ParticipantConversationInstance

        :param payload: Payload response from the API
        )r   _version)r3   r   r   r   r   get_instancee   s   z(ParticipantConversationPage.get_instancec                 C   r7   )r8   z5<Twilio.Conversations.V1.ParticipantConversationPage>r   r9   r   r   r   r:   m      z$ParticipantConversationPage.__repr__N)	r   r   r   r   r<   r   r   r@   r:   r   r   r   r   r>   c   s    r>   c                       s4  e Zd Zdef fddZejejddfdeee	f deee	f de
e de
e d	ee f
d
dZejejddfdeee	f deee	f de
e de
e d	ee f
ddZejejddfdeee	f deee	f de
e de
e d	ee f
ddZejejddfdeee	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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ee	f d	efddZej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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 )ParticipantConversationListr   c                    s   t  | d| _dS )zy
        Initialize the ParticipantConversationList

        :param version: Version that contains the resource

        z/ParticipantConversationsN)r/   r0   _uri)r3   r   r4   r   r   r0   x   s   
z$ParticipantConversationList.__init__Nidentityaddresslimit	page_sizer6   c                 C   s4   | j ||}| j|||d d}| j ||d S )a  
        Streams ParticipantConversationInstance 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 identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param str address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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
        rG   rD   rE   rG   rF   )r?   read_limitspagestreamr3   rD   rE   rF   rG   limitsrJ   r   r   r   rK      s
   
z"ParticipantConversationList.streamc                    s<   | j ||}| j|||d dI dH }| j ||d S )a  
        Asynchronously streams ParticipantConversationInstance 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 identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param str address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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
        rG   rH   NrF   )r?   rI   
page_asyncstream_asyncrL   r   r   r   rO      s   
z(ParticipantConversationList.stream_asyncc                 C   s   t | j||||dS )a)  
        Lists ParticipantConversationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param str address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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
        rD   rE   rF   rG   )listrK   r3   rD   rE   rF   rG   r   r   r   rQ      s   z ParticipantConversationList.listc                    s*   dd | j ||||dI dH 2 I dH S )a8  
        Asynchronously lists ParticipantConversationInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param str identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param str address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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   ).0recordr   r   r   
<listcomp>   s
    z:ParticipantConversationList.list_async.<locals>.<listcomp>rP   N)rO   rR   r   r   r   
list_async   s   
z&ParticipantConversationList.list_async
page_tokenpage_numberc           	      C   sN   t |||||d}t ddi}d|d< | jjd| j||d}t| j|S )a  
        Retrieve a single page of ParticipantConversationInstance records from the API.
        Request is executed immediately

        :param identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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 ParticipantConversationInstance
        IdentityAddress	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofr?   rJ   rC   r>   	r3   rD   rE   rW   rX   rG   datarg   responser   r   r   rJ     s   

z ParticipantConversationList.pagec           	         sV   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 ParticipantConversationInstance records from the API.
        Request is executed immediately

        :param identity: A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.
        :param address: A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.
        :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 ParticipantConversationInstance
        rY   r^   r_   r`   ra   rb   rc   N)r   rh   r?   rN   rC   r>   ri   r   r   r   rN   )  s   

z&ParticipantConversationList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )a  
        Retrieve a specific page of ParticipantConversationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ParticipantConversationInstance
        rb   )r?   domaintwiliorequestr>   r3   rl   rk   r   r   r   get_pageP  s   	z$ParticipantConversationList.get_pagec                    s&   | j jjd|I dH }t| j |S )a"  
        Asynchronously retrieve a specific page of ParticipantConversationInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ParticipantConversationInstance
        rb   N)r?   rm   rn   request_asyncr>   rp   r   r   r   get_page_async\  s   	z*ParticipantConversationList.get_page_asyncc                 C   r7   )r8   z5<Twilio.Conversations.V1.ParticipantConversationList>r   r9   r   r   r   r:   h  rA   z$ParticipantConversationList.__repr__)r   r   r   r   r0   r   unsetr   r<   r;   r   intr   r   rK   r	   rO   r   rQ   rV   r>   rJ   rN   rq   rs   r:   r=   r   r   r4   r   rB   v   s    


!


!


"


#





)





'rB   N)__doc__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>   rB   r   r   r   r   <module>   s    $J