o
    e6                     @   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di | 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	   V/var/www/html/venv/lib/python3.10/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)_versionread_limitspagestream)r   r   r   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
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   WebChannelPager   )r   
page_token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   domain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
        )FlexFlowSidIdentityCustomerFriendlyNameChatFriendlyNameChatUniqueNamePreEngagementDataPOSTr   r    r&   )r   r"   r   creater   WebChannelInstance)	r   flex_flow_sididentitycustomer_friendly_namechat_friendly_namechat_unique_namepre_engagement_datar&   payloadr	   r	   r   r5   o   s   	zWebChannelList.createc                 C      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   rA   r	   r	   r   get      	zWebChannelList.getc                 C   r>   r?   rB   rD   r	   r	   r   __call__   rF   zWebChannelList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.FlexApi.V1.WebChannelList>r	   r   r	   r	   r   __repr__      zWebChannelList.__repr__)NN)__name__
__module____qualname__r   r   r   r   unsetr   r,   r5   rE   rG   rK   __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'   solutionr   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
        )r6   r   r   r=   r	   r	   r   get_instance   s   	zWebChannelPage.get_instancec                 C   rH   )rI   z"<Twilio.FlexApi.V1.WebChannelPage>r	   rJ   r	   r	   r   rK      rL   zWebChannelPage.__repr__)rM   rN   rO   r   rT   rK   rQ   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 )rC   c                    s2   t t| | d|i| _djdi | 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
        rA   z/WebChannels/{sid}Nr	   )r
   rC   r   r   r   r   )r   r   rA   r   r	   r   r      s   

zWebChannelContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the WebChannelInstance

        :returns: The fetched WebChannelInstance
        :rtype: twilio.rest.flex_api.v1.web_channel.WebChannelInstance
        r   r   r    rA   r@   )r   fetchr   r6   r   rS   r	   r	   r   rW      s   zWebChannelContext.fetchc                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )9  
        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
        )
ChatStatusPostEngagementDatar3   r4   rA   r@   )r   r"   r   updater   r6   r   )r   chat_statuspost_engagement_datar&   r=   r	   r	   r   r[      s   
zWebChannelContext.updatec                 C   s   | j jd| jdS )
        Deletes the WebChannelInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErV   )r   deleter   rJ   r	   r	   r   r`      s   zWebChannelContext.deletec                 C   $   d dd | j D }d|S )rI    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr	   r	   r   	<genexpr>      z-WebChannelContext.__repr__.<locals>.<genexpr>z(<Twilio.FlexApi.V1.WebChannelContext {}>joinr   itemsr   r   contextr	   r	   r   rK        
zWebChannelContext.__repr__)rM   rN   rO   r   rW   r   rP   r[   r`   rK   rQ   r	   r	   r   r   rC      s    	rC   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 )r6   c                   @   s   e Zd ZdZdS )zWebChannelInstance.ChatStatusinactiveN)rM   rN   rO   INACTIVEr	   r	   r	   r   rY     s    rY   Nc              
      sr   t t| | |d|d|d|dt|dt|dd| _d| _d|p4| 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_sidr7   rA   urldate_createddate_updated)rt   r7   rA   ru   rv   rw   N)	r
   r6   r   rE   r   iso8601_datetime_properties_contextr   )r   r   r=   rA   r   r	   r   r     s   
zWebChannelInstance.__init__c                 C   s&   | j du 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
        NrA   r@   )rz   rC   r   r   rJ   r	   r	   r   _proxy/  s   
	zWebChannelInstance._proxyc                 C   
   | j d S )z{
        :returns: The SID of the Account that created the resource and owns this Workflow
        :rtype: unicode
        rt   ry   rJ   r	   r	   r   rt   <     
zWebChannelInstance.account_sidc                 C   r|   )zL
        :returns: The SID of the Flex Flow
        :rtype: unicode
        r7   r}   rJ   r	   r	   r   r7   D  r~   z WebChannelInstance.flex_flow_sidc                 C   r|   )zm
        :returns: The unique string that identifies the WebChannel resource
        :rtype: unicode
        rA   r}   rJ   r	   r	   r   rA   L  r~   zWebChannelInstance.sidc                 C   r|   )z_
        :returns: The absolute URL of the WebChannel resource
        :rtype: unicode
        ru   r}   rJ   r	   r	   r   ru   T  r~   zWebChannelInstance.urlc                 C   r|   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rv   r}   rJ   r	   r	   r   rv   \  r~   zWebChannelInstance.date_createdc                 C   r|   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rw   r}   rJ   r	   r	   r   rw   d  r~   zWebChannelInstance.date_updatedc                 C   
   | j  S )rU   )r{   rW   rJ   r	   r	   r   rW   l     
zWebChannelInstance.fetchc                 C   s   | j j||dS )rX   )r\   r]   )r{   r[   )r   r\   r]   r	   r	   r   r[   u  s   
zWebChannelInstance.updatec                 C   r   )r^   )r{   r`   rJ   r	   r	   r   r`     r   zWebChannelInstance.deletec                 C   ra   )rI   rb   c                 s   rc   rd   re   rf   r	   r	   r   rj     rk   z.WebChannelInstance.__repr__.<locals>.<genexpr>z)<Twilio.FlexApi.V1.WebChannelInstance {}>rl   ro   r	   r	   r   rK     rq   zWebChannelInstance.__repr__)N)rM   rN   rO   objectrY   r   propertyr{   rt   r7   rA   ru   rv   rw   rW   r   rP   r[   r`   rK   rQ   r	   r	   r   r   r6     s*    






		r6   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r#   rC   r6   r	   r	   r	   r   <module>   s    &A