U
    ^g%iM                     @   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                       sL   e Zd ZG dd deZeeeef e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inactiveZactiveclosedN)__name__
__module____qualname__ZINACTIVEZACTIVEZCLOSED r   r   |/var/www/html/api-medvista/venv/lib/python3.8/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
   Ziso8601_datetimer$   r%   r&   r'   r(   r)   	_solution)selfr   r   r   	__class__r   r   r+   3   sF     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 {}>)joinr-   itemsr5   )r.   contextr   r   r   __repr___   s    z(ParticipantConversationInstance.__repr__)r   r   r   objectr   r   r   strr   r+   r=   __classcell__r   r   r/   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   r2   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   _versionr-   )r.   r   r   r   r   get_instancem   s
      z(ParticipantConversationPage.get_instancer1   c                 C   s   dS )r3   z5<Twilio.Conversations.V1.ParticipantConversationPage>r   r.   r   r   r   r=   w   s    z$ParticipantConversationPage.__repr__N)	r   r   r   r   r?   r   r   rC   r=   r   r   r   r   rA   k   s   
rA   c                       s  e Zd Ze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   r   c                    s*   t  | d|i| _djf | 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}/ParticipantConversationsN)r*   r+   r-   r5   _uri)r.   r   r   r/   r   r   r+      s     z$ParticipantConversationList.__init__N)identityaddresslimit	page_sizer2   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
        rJ   rG   rH   rJ   rI   )rB   read_limitspagestreamr.   rG   rH   rI   rJ   ZlimitsrM   r   r   r   rN      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
        rJ   rK   NrI   )rB   rL   
page_asyncstream_asyncrO   r   r   r   rQ      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
        rG   rH   rI   rJ   )listrN   r.   rG   rH   rI   rJ   r   r   r   rS      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   )r6   recordr   r   r   
<listcomp>	  s   z:ParticipantConversationList.list_async.<locals>.<listcomp>rR   N)rQ   rT   r   r   r   
list_async   s    
z&ParticipantConversationList.list_async)rG   rH   
page_tokenpage_numberrJ   r2   c           	      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
        ZIdentityZAddressZ	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedapplication/jsonAcceptGETmethoduriparamsheaders)r   ofrB   rM   rF   rA   r-   	r.   rG   rH   rX   rY   rJ   datard   responser   r   r   rM     s"    
   z ParticipantConversationList.pagec           	         sX   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
        rZ   r[   r\   r]   r^   r_   r`   N)r   re   rB   rP   rF   rA   r-   rf   r   r   r   rP   :  s"    
   z&ParticipantConversationList.page_async)
target_urlr2   c                 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
        r_   )rB   domaintwiliorequestrA   r-   r.   ri   rh   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
        r_   N)rB   rj   rk   Zrequest_asyncrA   r-   rm   r   r   r   get_page_asyncm  s    	z*ParticipantConversationList.get_page_asyncr1   c                 C   s   dS )r3   z5<Twilio.Conversations.V1.ParticipantConversationList>r   rD   r   r   r   r=   y  s    z$ParticipantConversationList.__repr__)r   r   r   r   r?   r+   r   unsetr   r>   r   intr   r   rN   r	   rQ   r   rS   rW   rA   rM   rP   rn   ro   r=   r@   r   r   r/   r   rE      s   

!

!

"

#




)




'rE   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   rA   rE   r   r   r   r   <module>   s   $R