B
    `6                 @   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                   sx   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	ejejfddZ
dd Zdd Zdd Z  ZS )WebChannelListc                s*   t t| | i | _djf | j| _dS )z
        Initialize the WebChannelList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelList
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelList
        z/WebChannelsN)superr   __init__	_solutionformat_uri)selfversion)	__class__ R/home/dcms/DCMS/lib/python3.7/site-packages/twilio/rest/flex_api/v1/web_channel.pyr
      s    	zWebChannelList.__init__Nc             C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams WebChannelInstance 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.flex_api.v1.web_channel.WebChannelInstance]
        	page_size)r   limit)_versionZread_limitspagestream)r   r   r   Zlimitsr   r   r   r   r   "   s    zWebChannelList.streamc             C   s   t | j||dS )ae  
        Lists WebChannelInstance 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.flex_api.v1.web_channel.WebChannelInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   9   s    zWebChannelList.listc             C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of WebChannelInstance 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 WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelPage
        )Z	PageTokenr   ZPageSizeGET)methoduriparams)r   ofr   r   r   WebChannelPager   )r   Z
page_tokenZpage_numberr   dataresponser   r   r   r   K   s    zWebChannelList.pagec             C   s"   | j jjd|}t| j || jS )a@  
        Retrieve a specific page of WebChannelInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelPage
        r   )r   domainZtwiliorequestr   r   )r   
target_urlr    r   r   r   get_page^   s    

zWebChannelList.get_pagec       	   	   C   s8   t ||||||d}| jjd| j|d}t| j|S )aG  
        Create the WebChannelInstance

        :param unicode flex_flow_sid: The SID of the Flex Flow
        :param unicode identity: The chat identity
        :param unicode customer_friendly_name: The chat participant's friendly name
        :param unicode chat_friendly_name: The chat channel's friendly name
        :param unicode chat_unique_name: The chat channel's unique name
        :param unicode pre_engagement_data: The pre-engagement data

        :returns: The created WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        )ZFlexFlowSidZIdentityZCustomerFriendlyNameZChatFriendlyNameZChatUniqueNameZPreEngagementDataPOST)r   r   r   )r   r   r   creater   WebChannelInstance)	r   flex_flow_sididentityZcustomer_friendly_nameZchat_friendly_nameZchat_unique_nameZpre_engagement_datar   payloadr   r   r   r&   o   s    
zWebChannelList.createc             C   s   t | j|dS )a   
        Constructs a WebChannelContext

        :param sid: The SID of the WebChannel resource to fetch

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        )sid)WebChannelContextr   )r   r+   r   r   r   get   s    	zWebChannelList.getc             C   s   t | j|dS )a   
        Constructs a WebChannelContext

        :param sid: The SID of the WebChannel resource to fetch

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        )r+   )r,   r   )r   r+   r   r   r   __call__   s    	zWebChannelList.__call__c             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.FlexApi.V1.WebChannelList>r   )r   r   r   r   __repr__   s    zWebChannelList.__repr__)NN)NN)__name__
__module____qualname__r
   r   r   r   unsetr   r$   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 )a4  
        Initialize the WebChannelPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelPage
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelPage
        N)r	   r   r
   r   )r   r   r    Zsolution)r   r   r   r
      s    
zWebChannelPage.__init__c             C   s   t | j|S )a  
        Build an instance of WebChannelInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        )r'   r   )r   r*   r   r   r   get_instance   s    	zWebChannelPage.get_instancec             C   s   dS )zz
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.FlexApi.V1.WebChannelPage>r   )r   r   r   r   r/      s    zWebChannelPage.__repr__)r0   r1   r2   r
   r5   r/   r4   r   r   )r   r   r      s   r   c                   sF   e Zd Z fddZdd ZejejfddZdd Zd	d
 Z	  Z
S )r,   c                s.   t t| | d|i| _djf | j| _dS )aE  
        Initialize the WebChannelContext

        :param Version version: Version that contains the resource
        :param sid: The SID of the WebChannel resource to fetch

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        r+   z/WebChannels/{sid}N)r	   r,   r
   r   r   r   )r   r   r+   )r   r   r   r
      s    

zWebChannelContext.__init__c             C   s(   | j jd| jd}t| j || jd dS )z
        Fetch the WebChannelInstance

        :returns: The fetched WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        r   )r   r   r+   )r+   )r   fetchr   r'   r   )r   r*   r   r   r   r6      s    zWebChannelContext.fetchc             C   s:   t ||d}| jjd| j|d}t| j|| jd dS )a9  
        Update the WebChannelInstance

        :param WebChannelInstance.ChatStatus chat_status: The chat status
        :param unicode post_engagement_data: The post-engagement data

        :returns: The updated WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        )
ChatStatusZPostEngagementDatar%   )r   r   r   r+   )r+   )r   r   r   updater   r'   r   )r   chat_statuspost_engagement_datar   r*   r   r   r   r8      s    
zWebChannelContext.updatec             C   s   | j jd| jdS )z
        Deletes the WebChannelInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETE)r   r   )r   deleter   )r   r   r   r   r<      s    zWebChannelContext.deletec             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-WebChannelContext.__repr__.<locals>.<genexpr>z(<Twilio.FlexApi.V1.WebChannelContext {}>)joinr   itemsr   )r   contextr   r   r   r/     s    zWebChannelContext.__repr__)r0   r1   r2   r
   r6   r   r3   r8   r<   r/   r4   r   r   )r   r   r,      s
   	r,   c                   s   e Zd ZG dd de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ejfddZdd Zdd Z  ZS )r'   c               @   s   e Zd ZdZdS )zWebChannelInstance.ChatStatusZinactiveN)r0   r1   r2   ZINACTIVEr   r   r   r   r7     s   r7   Nc          
      sr   t t| | |d|d|d|dt|dt|dd| _d| _d|ph| jd i| _dS )	z
        Initialize the WebChannelInstance

        :returns: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        account_sidr(   r+   urldate_createddate_updated)rE   r(   r+   rF   rG   rH   N)	r	   r'   r
   r-   r   iso8601_datetime_properties_contextr   )r   r   r*   r+   )r   r   r   r
     s    zWebChannelInstance.__init__c             C   s&   | j dkr t| j| jd d| _ | j S )a6  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: WebChannelContext for this WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelContext
        Nr+   )r+   )rK   r,   r   r   )r   r   r   r   _proxy/  s    	
zWebChannelInstance._proxyc             C   s
   | j d S )z{
        :returns: The SID of the Account that created the resource and owns this Workflow
        :rtype: unicode
        rE   )rJ   )r   r   r   r   rE   <  s    zWebChannelInstance.account_sidc             C   s
   | j d S )zL
        :returns: The SID of the Flex Flow
        :rtype: unicode
        r(   )rJ   )r   r   r   r   r(   D  s    z WebChannelInstance.flex_flow_sidc             C   s
   | j d S )zm
        :returns: The unique string that identifies the WebChannel resource
        :rtype: unicode
        r+   )rJ   )r   r   r   r   r+   L  s    zWebChannelInstance.sidc             C   s
   | j d S )z_
        :returns: The absolute URL of the WebChannel resource
        :rtype: unicode
        rF   )rJ   )r   r   r   r   rF   T  s    zWebChannelInstance.urlc             C   s
   | j d S )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rG   )rJ   )r   r   r   r   rG   \  s    zWebChannelInstance.date_createdc             C   s
   | j d S )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rH   )rJ   )r   r   r   r   rH   d  s    zWebChannelInstance.date_updatedc             C   s
   | j  S )z
        Fetch the WebChannelInstance

        :returns: The fetched WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        )rL   r6   )r   r   r   r   r6   l  s    zWebChannelInstance.fetchc             C   s   | j j||dS )a9  
        Update the WebChannelInstance

        :param WebChannelInstance.ChatStatus chat_status: The chat status
        :param unicode post_engagement_data: The post-engagement data

        :returns: The updated WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        )r9   r:   )rL   r8   )r   r9   r:   r   r   r   r8   u  s    
zWebChannelInstance.updatec             C   s
   | j  S )z
        Deletes the WebChannelInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        )rL   r<   )r   r   r   r   r<     s    zWebChannelInstance.deletec             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   rA     s    z.WebChannelInstance.__repr__.<locals>.<genexpr>z)<Twilio.FlexApi.V1.WebChannelInstance {}>)rB   r   rC   r   )r   rD   r   r   r   r/     s    zWebChannelInstance.__repr__)N)r0   r1   r2   objectr7   r
   propertyrL   rE   r(   r+   rF   rG   rH   r6   r   r3   r8   r<   r/   r4   r   r   )r   r   r'     s   		r'   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,   r'   r   r   r   r   <module>   s    &A