a
    !f3I                     @   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                       sJ   e Zd ZG dd deZeeeef d fddZ	edddZ
  ZS )	ParticipantConversationInstancec                   @   s   e Zd ZdZdZdZdS )z%ParticipantConversationInstance.StateZinactiveactiveclosedN)__name__
__module____qualname__ZINACTIVEZACTIVEZCLOSED r   r   v/var/www/html/python-backend/venv/lib/python3.9/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   r,   3   s@    z(ParticipantConversationInstance.__init__returnc                 C   s   dS )f
        Provide a friendly representation

        :returns: Machine friendly representation
        z9<Twilio.Conversations.V1.ParticipantConversationInstance>r   r/   r   r   r   __repr__Y   s    z(ParticipantConversationInstance.__repr__)r   r   r   objectr   r   r   strr   r,   r6   __classcell__r   r   r0   r   r      s   &r   c                   @   s2   e Zd Zeeef edddZedddZdS )ParticipantConversationPage)r   r3   c                 C   s   t | j|S )z}
        Build an instance of ParticipantConversationInstance

        :param payload: Payload response from the API
        )r   _version)r/   r   r   r   r   get_instanced   s    z(ParticipantConversationPage.get_instancer2   c                 C   s   dS )r4   z5<Twilio.Conversations.V1.ParticipantConversationPage>r   r5   r   r   r   r6   l   s    z$ParticipantConversationPage.__repr__N)	r   r   r   r   r8   r   r   r<   r6   r   r   r   r   r:   c   s   r:   c                       s  e Zd Zed fddZejejddfeee	f eee	f e
e e
e ee dddZejejddfeee	f eee	f e
e e
e ee ddd	Zejejddfeee	f eee	f e
e e
e ee dd
dZejejddfeee	f eee	f e
e e
e ee dddZejejejejejfeee	f eee	f eee	f eee	f eee	f edddZejejejejejfeee	f eee	f eee	f eee	f eee	f edddZeedddZeedddZedddZ  ZS )ParticipantConversationList)r   c                    s   t  | d| _dS )zy
        Initialize the ParticipantConversationList

        :param version: Version that contains the resource

        z/ParticipantConversationsN)r+   r,   _uri)r/   r   r0   r   r   r,   v   s    z$ParticipantConversationList.__init__N)identityaddresslimit	page_sizer3   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
        rB   r?   r@   rB   rA   )r;   read_limitspagestreamr/   r?   r@   rA   rB   ZlimitsrE   r   r   r   rF      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
        rB   rC   NrA   )r;   rD   
page_asyncstream_asyncrG   r   r   r   rI      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
        r?   r@   rA   rB   )listrF   r/   r?   r@   rA   rB   r   r   r   rK      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>rJ   N)rI   rL   r   r   r   
list_async   s    
z&ParticipantConversationList.list_async)r?   r@   
page_tokenpage_numberrB   r3   c                 C   s6   t |||||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
        ZIdentityZAddressZ	PageTokenr   ZPageSizeGETmethoduriparams)r   ofr;   rE   r>   r:   r/   r?   r@   rQ   rR   rB   dataresponser   r   r   rE      s    
z ParticipantConversationList.pagec                    s<   t |||||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
        rS   rT   rU   N)r   rY   r;   rH   r>   r:   rZ   r   r   r   rH   !  s    
z&ParticipantConversationList.page_async)
target_urlr3   c                 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
        rT   )r;   domaintwiliorequestr:   r/   r]   r\   r   r   r   get_pageD  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
        rT   N)r;   r^   r_   Zrequest_asyncr:   ra   r   r   r   get_page_asyncP  s    	z*ParticipantConversationList.get_page_asyncr2   c                 C   s   dS )r4   z5<Twilio.Conversations.V1.ParticipantConversationList>r   r5   r   r   r   r6   \  s    z$ParticipantConversationList.__repr__)r   r   r   r   r,   r   unsetr   r8   r7   r   intr   r   rF   r	   rI   r   rK   rP   r:   rE   rH   rb   rc   r6   r9   r   r   r0   r   r=   u   s   

!

!

"

#




#




#r=   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r:   r=   r   r   r   r   <module>   s   $I