B
    `5                 @   s   d 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	 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 )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                   sf   e Zd Z fddZdddZdddZejejejfdd	Zd
d Z	dd Z
dd Zdd Z  ZS )
MemberListc                s0   t t| | ||d| _djf | j| _dS )a  
        Initialize the MemberList

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created this resource
        :param queue_sid: The SID of the Queue the member is in

        :returns: twilio.rest.api.v2010.account.queue.member.MemberList
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberList
        )account_sid	queue_sidz7/Accounts/{account_sid}/Queues/{queue_sid}/Members.jsonN)superr   __init__	_solutionformat_uri)selfversionr	   r
   )	__class__ Y/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/api/v2010/account/queue/member.pyr      s    zMemberList.__init__Nc             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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.api.v2010.account.queue.member.MemberInstance]
        	page_size)r   limit)_versionZread_limitspagestream)r   r   r   Zlimitsr   r   r   r   r   $   s    zMemberList.streamc             C   s   t | j||dS )ad  
        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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.api.v2010.account.queue.member.MemberInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   ;   s    zMemberList.listc             C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of MemberInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberPage
        )Z	PageTokenr   ZPageSizeGET)methoduriparams)r   ofr   r   r   
MemberPager   )r   Z
page_tokenZpage_numberr   dataresponser   r   r   r   M   s    zMemberList.pagec             C   s"   | j jjd|}t| j || jS )a;  
        Retrieve a specific page of MemberInstance records from the API.
        Request is executed immediately

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

        :returns: Page of MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberPage
        r   )r   domainZtwiliorequestr    r   )r   
target_urlr"   r   r   r   get_page`   s    

zMemberList.get_pagec             C   s   t | j| jd | jd |dS )a  
        Constructs a MemberContext

        :param call_sid: The Call SID of the resource(s) to fetch

        :returns: twilio.rest.api.v2010.account.queue.member.MemberContext
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberContext
        r	   r
   )r	   r
   call_sid)MemberContextr   r   )r   r'   r   r   r   getq   s
    	zMemberList.getc             C   s   t | j| jd | jd |dS )a  
        Constructs a MemberContext

        :param call_sid: The Call SID of the resource(s) to fetch

        :returns: twilio.rest.api.v2010.account.queue.member.MemberContext
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberContext
        r	   r
   )r	   r
   r'   )r(   r   r   )r   r'   r   r   r   __call__   s
    	zMemberList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.MemberList>r   )r   r   r   r   __repr__   s    zMemberList.__repr__)NN)NN)__name__
__module____qualname__r   r   r   r   unsetr   r&   r)   r*   r+   __classcell__r   r   )r   r   r      s   

r   c                   s,   e Zd Z fddZdd Zdd Z  ZS )r    c                s   t t| || || _dS )a  
        Initialize the MemberPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param account_sid: The SID of the Account that created this resource
        :param queue_sid: The SID of the Queue the member is in

        :returns: twilio.rest.api.v2010.account.queue.member.MemberPage
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberPage
        N)r   r    r   r   )r   r   r"   Zsolution)r   r   r   r      s    zMemberPage.__init__c             C   s   t | j|| jd | jd dS )a  
        Build an instance of MemberInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.queue.member.MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        r	   r
   )r	   r
   )MemberInstancer   r   )r   payloadr   r   r   get_instance   s
    	zMemberPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Api.V2010.MemberPage>r   )r   r   r   r   r+      s    zMemberPage.__repr__)r,   r-   r.   r   r3   r+   r0   r   r   )r   r   r       s   r    c                   s:   e Zd Z fddZdd ZejfddZdd Z  Z	S )	r(   c                s2   t t| | |||d| _djf | j| _dS )a  
        Initialize the MemberContext

        :param Version version: Version that contains the resource
        :param account_sid: The SID of the Account that created the resource(s) to fetch
        :param queue_sid: The SID of the Queue in which to find the members
        :param call_sid: The Call SID of the resource(s) to fetch

        :returns: twilio.rest.api.v2010.account.queue.member.MemberContext
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberContext
        )r	   r
   r'   zB/Accounts/{account_sid}/Queues/{queue_sid}/Members/{call_sid}.jsonN)r   r(   r   r   r   r   )r   r   r	   r
   r'   )r   r   r   r      s    zMemberContext.__init__c             C   s8   | j jd| jd}t| j || jd | jd | jd dS )z
        Fetch the MemberInstance

        :returns: The fetched MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        r   )r   r   r	   r
   r'   )r	   r
   r'   )r   fetchr   r1   r   )r   r2   r   r   r   r4      s    zMemberContext.fetchc             C   sJ   t ||d}| jjd| j|d}t| j|| jd | jd | jd dS )a*  
        Update the MemberInstance

        :param unicode url: The absolute URL of the Queue resource
        :param unicode method: How to pass the update request data

        :returns: The updated MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        )UrlMethodPOST)r   r   r!   r	   r
   r'   )r	   r
   r'   )r   r   r   updater   r1   r   )r   urlr   r!   r2   r   r   r   r8      s    
zMemberContext.updatec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
         c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   ).0kvr   r   r   	<genexpr>
  s    z)MemberContext.__repr__.<locals>.<genexpr>z#<Twilio.Api.V2010.MemberContext {}>)joinr   itemsr   )r   contextr   r   r   r+     s    zMemberContext.__repr__)
r,   r-   r.   r   r4   r   r/   r8   r+   r0   r   r   )r   r   r(      s   r(   c                   s   e Zd Zd fdd	Zedd Zedd Zedd	 Zed
d Zedd Z	edd Z
edd Zdd ZejfddZdd Z  ZS )r1   Nc          	      s|   t t| | |dt|dt|d|dt|d|dd| _d| _|||pp| jd d	| _	dS )
z
        Initialize the MemberInstance

        :returns: twilio.rest.api.v2010.account.queue.member.MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        r'   date_enqueuedpositionr   	wait_timer
   )r'   rB   rC   r   rD   r
   N)r	   r
   r'   )
r   r1   r   r)   r   Zrfc2822_datetimeinteger_properties_contextr   )r   r   r2   r	   r
   r'   )r   r   r   r     s    zMemberInstance.__init__c             C   s6   | j dkr0t| j| jd | jd | jd d| _ | j S )a1  
        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
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberContext
        Nr	   r
   r'   )r	   r
   r'   )rG   r(   r   r   )r   r   r   r   _proxy+  s    	
zMemberInstance._proxyc             C   s
   | j d S )zg
        :returns: The SID of the Call the resource is associated with
        :rtype: unicode
        r'   )rF   )r   r   r   r   r'   =  s    zMemberInstance.call_sidc             C   s
   | j d S )zU
        :returns: The date the member was enqueued
        :rtype: datetime
        rB   )rF   )r   r   r   r   rB   E  s    zMemberInstance.date_enqueuedc             C   s
   | j d S )z`
        :returns: This member's current position in the queue.
        :rtype: unicode
        rC   )rF   )r   r   r   r   rC   M  s    zMemberInstance.positionc             C   s
   | j d S )zq
        :returns: The URI of the resource, relative to `https://api.twilio.com`
        :rtype: unicode
        r   )rF   )r   r   r   r   r   U  s    zMemberInstance.uric             C   s
   | j d S )zk
        :returns: The number of seconds the member has been in the queue.
        :rtype: unicode
        rD   )rF   )r   r   r   r   rD   ]  s    zMemberInstance.wait_timec             C   s
   | j d S )zY
        :returns: The SID of the Queue the member is in
        :rtype: unicode
        r
   )rF   )r   r   r   r   r
   e  s    zMemberInstance.queue_sidc             C   s
   | j  S )z
        Fetch the MemberInstance

        :returns: The fetched MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        )rH   r4   )r   r   r   r   r4   m  s    zMemberInstance.fetchc             C   s   | j j||dS )a*  
        Update the MemberInstance

        :param unicode url: The absolute URL of the Queue resource
        :param unicode method: How to pass the update request data

        :returns: The updated MemberInstance
        :rtype: twilio.rest.api.v2010.account.queue.member.MemberInstance
        )r   )rH   r8   )r   r9   r   r   r   r   r8   v  s    
zMemberInstance.updatec             C   s$   d dd | j D }d|S )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        r:   c             s   s   | ]\}}d  ||V  qdS )z{}={}N)r   )r;   r<   r=   r   r   r   r>     s    z*MemberInstance.__repr__.<locals>.<genexpr>z$<Twilio.Api.V2010.MemberInstance {}>)r?   r   r@   r   )r   rA   r   r   r   r+     s    zMemberInstance.__repr__)N)r,   r-   r.   r   propertyrH   r'   rB   rC   r   rD   r
   r4   r   r/   r8   r+   r0   r   r   )r   r   r1     s   	r1   N)__doc__Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.pager   r   r    r(   r1   r   r   r   r   <module>   s    -F