U
    ^g%iT                     @   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 dd	lmZ G d
d de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 - Proxy
    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)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZG dd deZG dd deZdeeee	f eee
e d fddZed	d
ddZed
ddZed
ddZd d
ddZd d
ddZed
ddZ  ZS )InteractionInstancec                   @   s`   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdS )z"InteractionInstance.ResourceStatusacceptedZansweredbusycanceled	completedZdeletedZ	deliveredzdelivery-unknownfailedzin-progressZ	initiatedz	no-answerZqueuedZreceivedZ	receivingZringingZ	scheduledZsendingsentZundeliveredunknownN)__name__
__module____qualname__ACCEPTEDZANSWEREDZBUSYZCANCELEDZ	COMPLETEDZDELETEDZ	DELIVEREDZDELIVERY_UNKNOWNZFAILEDZIN_PROGRESSZ	INITIATEDZ	NO_ANSWERZQUEUEDZRECEIVEDZ	RECEIVINGZRINGINGZ	SCHEDULEDZSENDINGZSENTZUNDELIVEREDUNKNOWN r   r   o/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/proxy/v1/service/session/interaction.pyResourceStatus   s*   r    c                   @   s   e Zd ZdZdZdZdS )zInteractionInstance.TypemessageZvoicer   N)r   r   r   ZMESSAGEZVOICEr   r   r   r   r   Type2   s   r"   N)versionpayloadservice_sidsession_sidsidc                    s  t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _|d| _|d| _|d| _|d| _|d| _t|d| _t|d| _|d| _|||p
| jd| _d | _d S )Nr'   r&   r%   account_siddatatypeinbound_participant_sidinbound_resource_sidinbound_resource_statusinbound_resource_typeinbound_resource_urloutbound_participant_sidoutbound_resource_sidoutbound_resource_statusoutbound_resource_typeoutbound_resource_urldate_createddate_updatedurlr%   r&   r'   )super__init__getr'   r&   r%   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r
   Ziso8601_datetimer5   r6   r7   	_solution_context)selfr#   r$   r%   r&   r'   	__class__r   r   r:   M   sJ    
zInteractionInstance.__init__InteractionContextreturnc                 C   s6   | j dkr0t| j| jd | jd | jd d| _ | j S )z
        Generate an instance context for the instance, the context is capable of
        performing various actions. All instance actions are proxied to the context

        :returns: InteractionContext for this InteractionInstance
        Nr%   r&   r'   r8   )r=   rA   _versionr<   r>   r   r   r   _proxy   s    
zInteractionInstance._proxyc                 C   s
   | j  S )n
        Deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        )rF   deleterE   r   r   r   rH      s    zInteractionInstance.deletec                    s   | j  I dH S )
        Asynchronous coroutine that deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        N)rF   delete_asyncrE   r   r   r   rJ      s    z InteractionInstance.delete_asyncc                 C   s
   | j  S )c
        Fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        )rF   fetchrE   r   r   r   rL      s    zInteractionInstance.fetchc                    s   | j  I dH S )}
        Asynchronous coroutine to fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        N)rF   fetch_asyncrE   r   r   r   rN      s    zInteractionInstance.fetch_asyncc                 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>   s     z/InteractionInstance.__repr__.<locals>.<genexpr>z(<Twilio.Proxy.V1.InteractionInstance {}>joinr<   itemsrS   r>   contextr   r   r   __repr__   s    zInteractionInstance.__repr__)N)r   r   r   objectr    r"   r   r   strr   r   r:   propertyrF   boolrH   rJ   rL   rN   r^   __classcell__r   r   r?   r   r      s"   ! 
3				r   c                       sn   e Zd Zeeeed fddZedddZedddZe	dd	d
Z
e	dddZedddZ  ZS )rA   )r#   r%   r&   r'   c                    s.   t  | |||d| _djf | j| _dS )a  
        Initialize the InteractionContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) of the resource to fetch.
        :param session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) of the resource to fetch.
        :param sid: The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
        r8   zA/Services/{service_sid}/Sessions/{session_sid}/Interactions/{sid}Nr9   r:   r<   rS   _uri)r>   r#   r%   r&   r'   r?   r   r   r:      s    	zInteractionContext.__init__rB   c                 C   s   t i }| jjd| j|dS )rG   DELETEmethoduriheaders)r   ofrD   rH   re   r>   rj   r   r   r   rH      s    
zInteractionContext.deletec                    s$   t i }| jjd| j|dI dH S )rI   rf   rg   N)r   rk   rD   rJ   re   rl   r   r   r   rJ      s    
  zInteractionContext.delete_asyncc                 C   sL   t i }d|d< | jjd| j|d}t| j|| jd | jd | jd dS )	rK   application/jsonAcceptGETrg   r%   r&   r'   r8   )r   rk   rD   rL   re   r   r<   r>   rj   r$   r   r   r   rL      s    
zInteractionContext.fetchc                    sR   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd | jd d	S )
rM   rm   rn   ro   rg   Nr%   r&   r'   r8   )r   rk   rD   rN   re   r   r<   rp   r   r   r   rN     s    
  zInteractionContext.fetch_asyncc                 C   s$   d dd | j D }d|S )rO   rP   c                 s   s   | ]\}}d  ||V  qdS rQ   rR   rT   r   r   r   rX   &  s     z.InteractionContext.__repr__.<locals>.<genexpr>z'<Twilio.Proxy.V1.InteractionContext {}>rY   r\   r   r   r   r^      s    zInteractionContext.__repr__)r   r   r   r   r`   r:   rb   rH   rJ   r   rL   rN   r^   rc   r   r   r?   r   rA      s   rA   c                   @   s2   e Zd Zeeef edddZedddZdS )InteractionPage)r$   rC   c                 C   s   t | j|| jd | jd dS )zq
        Build an instance of InteractionInstance

        :param payload: Payload response from the API
        r%   r&   r%   r&   )r   rD   r<   )r>   r$   r   r   r   get_instance,  s    zInteractionPage.get_instancerB   c                 C   s   dS )rO   z!<Twilio.Proxy.V1.InteractionPage>r   rE   r   r   r   r^   9  s    zInteractionPage.__repr__N)	r   r   r   r   r`   r   r   rs   r^   r   r   r   r   rq   *  s   rq   c                       sh  e Zd Zeeed fddZd ee ee ee	 dddZ
d!ee ee ee	 ddd	Zd"ee ee ee	 dd
dZd#ee ee ee	 dddZejejejfeeef eeef eeef edddZejejej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edddZeedddZedddZ  ZS )$InteractionList)r#   r%   r&   c                    s,   t  | ||d| _djf | j| _dS )a{  
        Initialize the InteractionList

        :param version: Version that contains the resource
        :param service_sid: The SID of the parent [Service](https://www.twilio.com/docs/proxy/api/service) to read the resources from.
        :param session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) to read the resources from.

        rr   z;/Services/{service_sid}/Sessions/{session_sid}/InteractionsNrd   )r>   r#   r%   r&   r?   r   r   r:   D  s    	zInteractionList.__init__N)limit	page_sizerC   c                 C   s0   | j ||}| j|d d}| j ||d S )aa  
        Streams InteractionInstance 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
        rv   rv   ru   )rD   read_limitspagestreamr>   ru   rv   Zlimitsry   r   r   r   rz   Z  s    zInteractionList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ap  
        Asynchronously streams InteractionInstance 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
        rv   rw   Nru   )rD   rx   
page_asyncstream_asyncr{   r   r   r   r}   s  s    zInteractionList.stream_asyncc                 C   s   t | j||dS )a  
        Lists InteractionInstance 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
        ru   rv   )listrz   r>   ru   rv   r   r   r   r     s    zInteractionList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists InteractionInstance 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   )rU   recordr   r   r   
<listcomp>  s   z.InteractionList.list_async.<locals>.<listcomp>r~   N)r}   r   r   r   r   
list_async  s    
zInteractionList.list_async)
page_tokenpage_numberrv   rC   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )a{  
        Retrieve a single page of InteractionInstance 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 InteractionInstance
        Z	PageTokenr   ZPageSizeContent-Type!application/x-www-form-urlencodedrm   rn   ro   rh   ri   paramsrj   )r   rk   rD   ry   re   rq   r<   r>   r   r   rv   r)   rj   responser   r   r   ry     s       zInteractionList.pagec                    sT   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 InteractionInstance 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 InteractionInstance
        r   r   r   rm   rn   ro   r   N)r   rk   rD   r|   re   rq   r<   r   r   r   r   r|     s       zInteractionList.page_async)
target_urlrC   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of InteractionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InteractionInstance
        ro   )rD   domaintwiliorequestrq   r<   r>   r   r   r   r   r   get_page  s    	zInteractionList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a
  
        Asynchronously retrieve a specific page of InteractionInstance records from the API.
        Request is executed immediately

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

        :returns: Page of InteractionInstance
        ro   N)rD   r   r   Zrequest_asyncrq   r<   r   r   r   r   get_page_async  s    	zInteractionList.get_page_async)r'   rC   c                 C   s   t | j| jd | jd |dS z
        Constructs a InteractionContext

        :param sid: The Twilio-provided string that uniquely identifies the Interaction resource to fetch.
        r%   r&   r8   rA   rD   r<   r>   r'   r   r   r   r;     s    zInteractionList.getc                 C   s   t | j| jd | jd |dS r   r   r   r   r   r   __call__(  s    zInteractionList.__call__rB   c                 C   s   dS )rO   z!<Twilio.Proxy.V1.InteractionList>r   rE   r   r   r   r^   5  s    zInteractionList.__repr__)NN)NN)NN)NN)r   r   r   r   r`   r:   r   intr   r   rz   r	   r}   r   r   r   r   unsetr   r_   rq   ry   r|   r   r   rA   r;   r   r^   rc   r   r   r?   r   rt   B  sh           


#


!rt   N)__doc__r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   rA   rq   rt   r   r   r   r   <module>   s   $ 'k