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 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 - Api
    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dZdeeeef eeee d fddZ	e
dddd	Zd dd
dZd dddZejfeeeef d dddZejfeeeef d dddZedddZ  ZS )MemberInstancea  
    :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Member resource is associated with.
    :ivar date_enqueued: The date that the member was enqueued, given in RFC 2822 format.
    :ivar position: This member's current position in the queue.
    :ivar uri: The URI of the resource, relative to `https://api.twilio.com`.
    :ivar wait_time: The number of seconds the member has been in the queue.
    :ivar queue_sid: The SID of the Queue the member is in.
    N)versionpayloadaccount_sid	queue_sidcall_sidc                    s   t  | |d| _t|d| _t|d| _|d| _	t|d| _
|d| _|||pr| jd| _d | _d S )Nr   date_enqueuedpositionuri	wait_timer   r   r   r   )super__init__getr   r
   Zrfc2822_datetimer   integerr   r   r   r   	_solution_context)selfr   r   r   r   r   	__class__ i/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/api/v2010/account/queue/member.pyr   #   s    zMemberInstance.__init__MemberContext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: MemberContext for this MemberInstance
        Nr   r   r   r   )r!   r'   _versionr    r"   r%   r%   r&   _proxy=   s    
zMemberInstance._proxyc                 C   s
   | j  S )Y
        Fetch the MemberInstance


        :returns: The fetched MemberInstance
        )r,   fetchr+   r%   r%   r&   r.   N   s    zMemberInstance.fetchc                    s   | j  I dH S )s
        Asynchronous coroutine to fetch the MemberInstance


        :returns: The fetched MemberInstance
        N)r,   fetch_asyncr+   r%   r%   r&   r0   W   s    zMemberInstance.fetch_asyncurlmethodr)   c                 C   s   | j j||dS )]  
        Update the MemberInstance

        :param url: The absolute URL of the Queue resource.
        :param method: How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters.

        :returns: The updated MemberInstance
        r2   r3   )r,   updater"   r2   r3   r%   r%   r&   r6   `   s    zMemberInstance.updatec                    s   | j j||dI dH S )w  
        Asynchronous coroutine to update the MemberInstance

        :param url: The absolute URL of the Queue resource.
        :param method: How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters.

        :returns: The updated MemberInstance
        r5   N)r,   update_asyncr7   r%   r%   r&   r9   p   s    zMemberInstance.update_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*MemberInstance.__repr__.<locals>.<genexpr>z$<Twilio.Api.V2010.MemberInstance {}>joinr    itemsr>   r"   contextr%   r%   r&   __repr__   s    zMemberInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr,   r.   r0   r   unsetr   objectr6   r9   rI   __classcell__r%   r%   r#   r&   r      s4    
	
 
 
r   c                       s   e Zd Zeeeed fddZedddZedddZe	j
feeeef ed	d
dZe	j
feeeef ed	ddZedddZ  ZS )r'   )r   r   r   r   c                    s.   t  | |||d| _djf | j| _dS )a  
        Initialize the MemberContext

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to update.
        :param queue_sid: The SID of the Queue in which to find the members to update.
        :param call_sid: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to update.
        r   zB/Accounts/{account_sid}/Queues/{queue_sid}/Members/{call_sid}.jsonNr   r   r    r>   _uri)r"   r   r   r   r   r#   r%   r&   r      s    zMemberContext.__init__r(   c                 C   sL   t i }d|d< | jjd| j|d}t| j|| jd | jd | jd dS )	r-   application/jsonAcceptGETr3   r   headersr   r   r   r   )r   ofr*   r.   rT   r   r    r"   rY   r   r%   r%   r&   r.      s    
zMemberContext.fetchc                    sR   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd | jd d	S )
r/   rU   rV   rW   rX   Nr   r   r   r   )r   rZ   r*   r0   rT   r   r    r[   r%   r%   r&   r0      s    
  zMemberContext.fetch_asyncr1   c                 C   sf   t ||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 | jd
 dS )r4   UrlZMethod!application/x-www-form-urlencodedContent-TyperU   rV   POSTr3   r   datarY   r   r   r   r   )r   rZ   r*   r6   rT   r   r    r"   r2   r3   rb   rY   r   r%   r%   r&   r6      s*    
   zMemberContext.updatec                    sl   t ||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 | jd dS )r8   r\   r^   r_   rU   rV   r`   ra   Nr   r   r   r   )r   rZ   r*   r9   rT   r   r    rc   r%   r%   r&   r9      s*    
   zMemberContext.update_asyncc                 C   s$   d dd | j D }d|S )r:   r;   c                 s   s   | ]\}}d  ||V  qdS r<   r=   r?   r%   r%   r&   rC   !  s     z)MemberContext.__repr__.<locals>.<genexpr>z#<Twilio.Api.V2010.MemberContext {}>rD   rG   r%   r%   r&   rI     s    zMemberContext.__repr__)rJ   rK   rL   r   rN   r   r   r.   r0   r   rP   r   rQ   r6   r9   rI   rR   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 )
MemberPage)r   r)   c                 C   s   t | j|| jd | jd dS )zl
        Build an instance of MemberInstance

        :param payload: Payload response from the API
        r   r   r   r   )r   r*   r    )r"   r   r%   r%   r&   get_instance'  s    zMemberPage.get_instancer(   c                 C   s   dS )r:   z<Twilio.Api.V2010.MemberPage>r%   r+   r%   r%   r&   rI   4  s    zMemberPage.__repr__N)	rJ   rK   rL   r   rN   r   r   rf   rI   r%   r%   r%   r&   rd   %  s   rd   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 )$
MemberList)r   r   r   c                    s,   t  | ||d| _djf | j| _dS )aC  
        Initialize the MemberList

        :param version: Version that contains the resource
        :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to read.
        :param queue_sid: The SID of the Queue in which to find the members

        re   z7/Accounts/{account_sid}/Queues/{queue_sid}/Members.jsonNrS   )r"   r   r   r   r#   r%   r&   r   ?  s    	zMemberList.__init__N)limit	page_sizer)   c                 C   s0   | j ||}| j|d d}| j ||d S )a\  
        Streams MemberInstance 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
        ri   ri   rh   )r*   read_limitspagestreamr"   rh   ri   Zlimitsrl   r%   r%   r&   rm   S  s    zMemberList.streamc                    s6   | j ||}| j|d dI dH }| j ||d S )ak  
        Asynchronously streams MemberInstance 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
        ri   rj   Nrh   )r*   rk   
page_asyncstream_asyncrn   r%   r%   r&   rp   l  s    zMemberList.stream_asyncc                 C   s   t | j||dS )a  
        Lists MemberInstance 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
        rh   ri   )listrm   r"   rh   ri   r%   r%   r&   rr     s    zMemberList.listc                    s$   dd | j ||dI dH 2 I dH S )a  
        Asynchronously lists MemberInstance 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%   )r@   recordr%   r%   r&   
<listcomp>  s   z)MemberList.list_async.<locals>.<listcomp>rq   N)rp   rs   r%   r%   r&   
list_async  s    
zMemberList.list_async)
page_tokenpage_numberri   r)   c                 C   sN   t |||d}t ddi}d|d< | jjd| j||d}t| j|| jS )aq  
        Retrieve a single page of MemberInstance 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 MemberInstance
        Z	PageTokenr   ZPageSizer_   r^   rU   rV   rW   r3   r   paramsrY   )r   rZ   r*   rl   rT   rd   r    r"   rw   rx   ri   rb   rY   responser%   r%   r&   rl     s       zMemberList.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 MemberInstance 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 MemberInstance
        ry   r_   r^   rU   rV   rW   rz   N)r   rZ   r*   ro   rT   rd   r    r|   r%   r%   r&   ro     s       zMemberList.page_async)
target_urlr)   c                 C   s"   | j jjd|}t| j || jS )z
        Retrieve a specific page of MemberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MemberInstance
        rW   )r*   domaintwiliorequestrd   r    r"   r~   r}   r%   r%   r&   get_page  s    	zMemberList.get_pagec                    s(   | j jjd|I dH }t| j || jS )a   
        Asynchronously retrieve a specific page of MemberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MemberInstance
        rW   N)r*   r   r   Zrequest_asyncrd   r    r   r%   r%   r&   get_page_async  s    	zMemberList.get_page_async)r   r)   c                 C   s   t | j| jd | jd |dS z
        Constructs a MemberContext

        :param call_sid: The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to update.
        r   r   r   r'   r*   r    r"   r   r%   r%   r&   r     s    zMemberList.getc                 C   s   t | j| jd | jd |dS r   r   r   r%   r%   r&   __call__!  s    zMemberList.__call__r(   c                 C   s   dS )r:   z<Twilio.Api.V2010.MemberList>r%   r+   r%   r%   r&   rI   .  s    zMemberList.__repr__)NN)NN)NN)NN)rJ   rK   rL   r   rN   r   r   intr   r   rm   r	   rp   r   rr   rv   r   rP   r   rQ   rd   rl   ro   r   r   r'   r   r   rI   rR   r%   r%   r#   r&   rg   =  sh           


#


!rg   N)rM   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   r'   rd   rg   r%   r%   r%   r&   <module>   s   $q 