o
    f>hM                     @   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                       sR   e Zd ZG dd deZ	 dedeeef de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   p/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/service/participant_conversation.pyState   s    r   versionpayloadchat_service_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _t|d| _t|d| _|d| _|d| _|d| _|d| _d|i| _d S )Naccount_sidr   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.   	_solution)selfr   r   r   	__class__r   r   r0   3   sD   
z(ParticipantConversationInstance.__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>e   s    z;ParticipantConversationInstance.__repr__.<locals>.<genexpr>z<<Twilio.Conversations.V1.ParticipantConversationInstance {}>)joinr3   itemsr:   )r4   contextr   r   r   __repr___   s   z(ParticipantConversationInstance.__repr__)r   r   r   objectr   r   r   strr   r0   rB   __classcell__r   r   r5   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   r7   c                 C   s   t | j|| jd dS )z}
        Build an instance of ParticipantConversationInstance

        :param payload: Payload response from the API
        r   )r   )r   _versionr3   )r4   r   r   r   r   get_instancem   s   z(ParticipantConversationPage.get_instancec                 C      dS )r8   z5<Twilio.Conversations.V1.ParticipantConversationPage>r   r4   r   r   r   rB   w      z$ParticipantConversationPage.__repr__N)	r   r   r   r   rD   r   r   rH   rB   r   r   r   r   rF   k   s    
rF   c                       s8  e Zd Zde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   r   c                    s.   t  | d|i| _djdi | j| _dS )a;  
        Initialize the ParticipantConversationList

        :param version: Version that contains the resource
        :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant Conversations resource is associated with.

        r   z5/Services/{chat_service_sid}/ParticipantConversationsNr   )r/   r0   r3   r:   _uri)r4   r   r   r5   r   r   r0      s   z$ParticipantConversationList.__init__Nidentityaddresslimit	page_sizer7   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
        rQ   rN   rO   rQ   rP   )rG   read_limitspagestreamr4   rN   rO   rP   rQ   limitsrT   r   r   r   rU      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
        rQ   rR   NrP   )rG   rS   
page_asyncstream_asyncrV   r   r   r   rY      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
        rN   rO   rP   rQ   )listrU   r4   rN   rO   rP   rQ   r   r   r   r[      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   )r;   recordr   r   r   
<listcomp>	  s
    z:ParticipantConversationList.list_async.<locals>.<listcomp>rZ   N)rY   r\   r   r   r   
list_async   s   
z&ParticipantConversationList.list_async
page_tokenpage_numberc           	      C   sR   t |||||d}t ddi}d|d< | jjd| j||d}t| j|| 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   ofrG   rT   rM   rF   r3   	r4   rN   rO   r`   ra   rQ   datarp   responser   r   r   rT     s   

z ParticipantConversationList.pagec           	         sZ   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 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
        rb   rg   rh   ri   rj   rk   rl   N)r   rq   rG   rX   rM   rF   r3   rr   r   r   r   rX   :  s   

z&ParticipantConversationList.page_async
target_urlc                 C   s"   | j jjd|}t| j || 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
        rk   )rG   domaintwiliorequestrF   r3   r4   ru   rt   r   r   r   get_pagea  s   	z$ParticipantConversationList.get_pagec                    s*   | j jjd|I dH }t| j || 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
        rk   N)rG   rv   rw   request_asyncrF   r3   ry   r   r   r   get_page_asyncm  s   	z*ParticipantConversationList.get_page_asyncc                 C   rI   )r8   z5<Twilio.Conversations.V1.ParticipantConversationList>r   rJ   r   r   r   rB   y  rK   z$ParticipantConversationList.__repr__)r   r   r   r   rD   r0   r   unsetr   rC   r   intr   r   rU   r	   rY   r   r[   r_   rF   rT   rX   rz   r|   rB   rE   r   r   r5   r   rL      s    


!


!


"


#





)





'rL   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   rF   rL   r   r   r   r   <module>   s    $R