o
    f>hT                     @   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dedeee	f ded	ed
e
e f
 fddZedddZdefddZdefddZdddZdddZdef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acceptedansweredbusycanceled	completeddeleted	deliveredzdelivery-unknownfailedzin-progress	initiatedz	no-answerqueuedreceived	receivingringing	scheduledsendingsentundeliveredunknownN)__name__
__module____qualname__ACCEPTEDANSWEREDBUSYCANCELED	COMPLETEDDELETED	DELIVEREDDELIVERY_UNKNOWNFAILEDIN_PROGRESS	INITIATED	NO_ANSWERQUEUEDRECEIVED	RECEIVINGRINGING	SCHEDULEDSENDINGSENTUNDELIVEREDUNKNOWN r<   r<   c/var/www/html/venv/lib/python3.10/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messagevoicer#   N)r$   r%   r&   MESSAGEVOICEr;   r<   r<   r<   r=   Type2   s    rC   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 )NrH   rG   rF   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rF   rG   rH   )super__init__getrH   rG   rF   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   r
   iso8601_datetimerV   rW   rX   	_solution_context)selfrD   rE   rF   rG   rH   	__class__r<   r=   r[   M   sJ   
zInteractionInstance.__init__returnInteractionContextc                 C   s6   | j du rt| 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
        NrF   rG   rH   rY   )r_   rd   _versionr^   r`   r<   r<   r=   _proxy   s   
zInteractionInstance._proxyc                 C   
   | j  S )n
        Deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        )rg   deleterf   r<   r<   r=   rj         
zInteractionInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the InteractionInstance


        :returns: True if delete succeeds, False otherwise
        N)rg   delete_asyncrf   r<   r<   r=   rn         z InteractionInstance.delete_asyncc                 C   rh   )c
        Fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        )rg   fetchrf   r<   r<   r=   rq      rk   zInteractionInstance.fetchc                    rl   )}
        Asynchronous coroutine to fetch the InteractionInstance


        :returns: The fetched InteractionInstance
        N)rg   fetch_asyncrf   r<   r<   r=   rs      ro   zInteractionInstance.fetch_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr<   r<   r=   	<genexpr>       z/InteractionInstance.__repr__.<locals>.<genexpr>z(<Twilio.Proxy.V1.InteractionInstance {}>joinr^   itemsrz   r`   contextr<   r<   r=   __repr__      
zInteractionInstance.__repr__N)rc   rd   )rc   r   )r$   r%   r&   objectr>   rC   r   r   strr   r   r[   propertyrg   boolrj   rn   rq   rs   r   __classcell__r<   r<   ra   r=   r      s.    
3	
	
		r   c                       st   e Zd Zdedededef fddZdefdd	Zdefd
dZde	fddZ
de	fddZdefddZ  ZS )rd   rD   rF   rG   rH   c                    s2   t  | |||d| _djdi | 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.
        rY   zA/Services/{service_sid}/Sessions/{session_sid}/Interactions/{sid}Nr<   rZ   r[   r^   rz   _uri)r`   rD   rF   rG   rH   ra   r<   r=   r[      s   	zInteractionContext.__init__rc   c                 C   s   t i }| jjd| j|dS )ri   DELETEmethoduriheaders)r   ofre   rj   r   r`   r   r<   r<   r=   rj      s   
zInteractionContext.deletec                    s&   t i }| jjd| j|dI dH S )rm   r   r   N)r   r   re   rn   r   r   r<   r<   r=   rn      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 )	rp   application/jsonAcceptGETr   rF   rG   rH   rY   )r   r   re   rq   r   r   r^   r`   r   rE   r<   r<   r=   rq      s   
zInteractionContext.fetchc                    sT   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd | jd d	S )
rr   r   r   r   r   NrF   rG   rH   rY   )r   r   re   rs   r   r   r^   r   r<   r<   r=   rs     s   
zInteractionContext.fetch_asyncc                 C   rt   )ru   rv   c                 s   rw   rx   ry   r{   r<   r<   r=   r   &  r   z.InteractionContext.__repr__.<locals>.<genexpr>z'<Twilio.Proxy.V1.InteractionContext {}>r   r   r<   r<   r=   r      r   zInteractionContext.__repr__)r$   r%   r&   r   r   r[   r   rj   rn   r   rq   rs   r   r   r<   r<   ra   r=   rd      s    rd   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 )InteractionPagerE   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
        rF   rG   rF   rG   )r   re   r^   )r`   rE   r<   r<   r=   get_instance,  s   zInteractionPage.get_instancec                 C      dS )ru   z!<Twilio.Proxy.V1.InteractionPage>r<   rf   r<   r<   r=   r   9     zInteractionPage.__repr__N)	r$   r%   r&   r   r   r   r   r   r   r<   r<   r<   r=   r   *  s    r   c                	       s  e Zd Zdededef fddZ		d$dee dee d	ee	 fd
dZ
		d$dee dee d	ee	 fddZ		d$dee dee d	ee	 fddZ		d$dee dee d	ee	 fddZejejej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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d	efddZded	efd d!Zd	efd"d#Z  ZS )%InteractionListrD   rF   rG   c                    s0   t  | ||d| _djdi | 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.

        r   z;/Services/{service_sid}/Sessions/{session_sid}/InteractionsNr<   r   )r`   rD   rF   rG   ra   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
        r   r   r   )re   read_limitspagestreamr`   r   r   limitsr   r<   r<   r=   r   Z  s   zInteractionList.streamc                    s8   | 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
        r   r   Nr   )re   r   
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
        r   r   )listr   r`   r   r   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 r   r<   )r|   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_numberc                 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
        	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedr   r   r   r   r   paramsr   )r   r   re   r   r   r   r^   r`   r   r   r   rJ   r   responser<   r<   r=   r     s   
zInteractionList.pagec                    sV   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   r   r   r   r   N)r   r   re   r   r   r   r^   r   r<   r<   r=   r     s   
zInteractionList.page_async
target_urlc                 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
        r   )re   domaintwiliorequestr   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
        r   N)re   r   r   request_asyncr   r^   r   r<   r<   r=   get_page_async  s   	zInteractionList.get_page_asyncrH   c                 C      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.
        rF   rG   rY   rd   re   r^   r`   rH   r<   r<   r=   r\        zInteractionList.getc                 C   r   r   r   r   r<   r<   r=   __call__(  r   zInteractionList.__call__c                 C   r   )ru   z!<Twilio.Proxy.V1.InteractionList>r<   rf   r<   r<   r=   r   5  r   zInteractionList.__repr__)NN)r$   r%   r&   r   r   r[   r   intr   r   r   r	   r   r   r   r   r   unsetr   r   r   r   r   r   r   rd   r\   r   r   r   r<   r<   ra   r=   r   B  s    







#



!r   N)__doc__r   typingr   r   r   r   r   r   r	   twilio.baser
   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   rd   r   r   r<   r<   r<   r=   <module>   s    $ 'k