o
    e75                     @   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                       s   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ejejejejfddZ
dd Zdd Zdd Z  ZS )ChannelListc                    s.   t t| | i | _djdi | j| _dS )z
        Initialize the ChannelList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.flex_api.v1.channel.ChannelList
        :rtype: twilio.rest.flex_api.v1.channel.ChannelList
        z	/ChannelsN )superr   __init__	_solutionformat_uri)selfversion	__class__r	   R/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v1/channel.pyr      s   	zChannelList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams ChannelInstance 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.channel.ChannelInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r	   r	   r   r   "   s   zChannelList.streamc                 C   s   t | j||dS )a[  
        Lists ChannelInstance 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.channel.ChannelInstance]
        )r   r   )listr   )r   r   r   r	   r	   r   r   9   s   zChannelList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of ChannelInstance 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 ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   ChannelPager   )r   
page_tokenpage_numberr   dataresponser	   r	   r   r   K   s   zChannelList.pagec                 C   s"   | j jjd|}t| j || jS )a3  
        Retrieve a specific page of ChannelInstance records from the API.
        Request is executed immediately

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

        :returns: Page of ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelPage
        r   )r   domaintwiliorequestr#   r   )r   
target_urlr'   r	   r	   r   get_page^   s
   

zChannelList.get_pagec                 C   s@   t |||||||||	|
d
}| jjd| j|d}t| j|S )a  
        Create the ChannelInstance

        :param unicode flex_flow_sid: The SID of the Flex Flow
        :param unicode identity: The identity value that identifies the new resource's chat User
        :param unicode chat_user_friendly_name: The chat participant's friendly name
        :param unicode chat_friendly_name: The chat channel's friendly name
        :param unicode target: The Target Contact Identity
        :param unicode chat_unique_name: The chat channel's unique name
        :param unicode pre_engagement_data: The pre-engagement data
        :param unicode task_sid: The SID of the TaskRouter Task
        :param unicode task_attributes: The Task attributes to be added for the TaskRouter Task
        :param bool long_lived: Whether to create the channel as long-lived

        :returns: The created ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelInstance
        )
FlexFlowSidIdentityChatUserFriendlyNameChatFriendlyNameTargetChatUniqueNamePreEngagementDataTaskSidTaskAttributes	LongLivedPOST)r   r    r&   )r   r"   r   creater   ChannelInstance)r   flex_flow_sididentitychat_user_friendly_namechat_friendly_nametargetchat_unique_namepre_engagement_datatask_sidtask_attributes
long_livedr&   payloadr	   r	   r   r8   o   s   zChannelList.createc                 C      t | j|dS a  
        Constructs a ChannelContext

        :param sid: The SID that identifies the Flex chat channel resource to fetch

        :returns: twilio.rest.flex_api.v1.channel.ChannelContext
        :rtype: twilio.rest.flex_api.v1.channel.ChannelContext
        sidChannelContextr   r   rH   r	   r	   r   get      	zChannelList.getc                 C   rE   rF   rI   rK   r	   r	   r   __call__   rM   zChannelList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.FlexApi.V1.ChannelList>r	   r   r	   r	   r   __repr__      zChannelList.__repr__)NN)__name__
__module____qualname__r   r   r   r   unsetr   r,   r8   rL   rN   rR   __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 ChannelPage

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

        :returns: twilio.rest.flex_api.v1.channel.ChannelPage
        :rtype: twilio.rest.flex_api.v1.channel.ChannelPage
        N)r
   r#   r   r   )r   r   r'   solutionr   r	   r   r      s   

zChannelPage.__init__c                 C   s   t | j|S )z
        Build an instance of ChannelInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.flex_api.v1.channel.ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelInstance
        )r9   r   r   rD   r	   r	   r   get_instance   s   	zChannelPage.get_instancec                 C   rO   )rP   z<Twilio.FlexApi.V1.ChannelPage>r	   rQ   r	   r	   r   rR      rS   zChannelPage.__repr__)rT   rU   rV   r   r[   rR   rX   r	   r	   r   r   r#      s    r#   c                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	rJ   c                    s2   t t| | d|i| _djdi | j| _dS )aH  
        Initialize the ChannelContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the Flex chat channel resource to fetch

        :returns: twilio.rest.flex_api.v1.channel.ChannelContext
        :rtype: twilio.rest.flex_api.v1.channel.ChannelContext
        rH   z/Channels/{sid}Nr	   )r
   rJ   r   r   r   r   )r   r   rH   r   r	   r   r      s   

zChannelContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the ChannelInstance

        :returns: The fetched ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelInstance
        r   r   r    rH   rG   )r   fetchr   r9   r   rZ   r	   r	   r   r^      s   zChannelContext.fetchc                 C   s   | j jd| jdS )~
        Deletes the ChannelInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr]   )r   deleter   rQ   r	   r	   r   ra      s   zChannelContext.deletec                 C   $   d dd | j D }d|S )rP    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr	   r	   r   	<genexpr>	      z*ChannelContext.__repr__.<locals>.<genexpr>z%<Twilio.FlexApi.V1.ChannelContext {}>joinr   itemsr   r   contextr	   r	   r   rR        
zChannelContext.__repr__)rT   rU   rV   r   r^   ra   rR   rX   r	   r	   r   r   rJ      s
    	rJ   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edd Zedd Zdd Zdd Zdd Z  ZS )r9   Nc                    s   t t| | |d|d|d|d|d|dt|dt|dd	| _d
| _d|p<| jd i| _d
S )z
        Initialize the ChannelInstance

        :returns: twilio.rest.flex_api.v1.channel.ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelInstance
        account_sidr:   rH   user_sidrA   urldate_createddate_updated)rs   r:   rH   rt   rA   ru   rv   rw   N)	r
   r9   r   rL   r   iso8601_datetime_properties_contextr   )r   r   rD   rH   r   r	   r   r     s   zChannelInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a)  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: ChannelContext for this ChannelInstance
        :rtype: twilio.rest.flex_api.v1.channel.ChannelContext
        NrH   rG   )rz   rJ   r   r   rQ   r	   r	   r   _proxy(  s   
	zChannelInstance._proxyc                 C   
   | j d S )z{
        :returns: The SID of the Account that created the resource and owns this Workflow
        :rtype: unicode
        rs   ry   rQ   r	   r	   r   rs   5     
zChannelInstance.account_sidc                 C   r|   )zL
        :returns: The SID of the Flex Flow
        :rtype: unicode
        r:   r}   rQ   r	   r	   r   r:   =  r~   zChannelInstance.flex_flow_sidc                 C   r|   )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rH   r}   rQ   r	   r	   r   rH   E  r~   zChannelInstance.sidc                 C   r|   )zL
        :returns: The SID of the chat user
        :rtype: unicode
        rt   r}   rQ   r	   r	   r   rt   M  r~   zChannelInstance.user_sidc                 C   r|   )zR
        :returns: The SID of the TaskRouter Task
        :rtype: unicode
        rA   r}   rQ   r	   r	   r   rA   U  r~   zChannelInstance.task_sidc                 C   r|   )zf
        :returns: The absolute URL of the Flex chat channel resource
        :rtype: unicode
        ru   r}   rQ   r	   r	   r   ru   ]  r~   zChannelInstance.urlc                 C   r|   )z}
        :returns: The ISO 8601 date and time in GMT when the Flex chat channel was created
        :rtype: datetime
        rv   r}   rQ   r	   r	   r   rv   e  r~   zChannelInstance.date_createdc                 C   r|   )z
        :returns: The ISO 8601 date and time in GMT when the Flex chat channel was last updated
        :rtype: datetime
        rw   r}   rQ   r	   r	   r   rw   m  r~   zChannelInstance.date_updatedc                 C   
   | j  S )r\   )r{   r^   rQ   r	   r	   r   r^   u     
zChannelInstance.fetchc                 C   r   )r_   )r{   ra   rQ   r	   r	   r   ra   ~  r   zChannelInstance.deletec                 C   rb   )rP   rc   c                 s   rd   re   rf   rg   r	   r	   r   rk     rl   z+ChannelInstance.__repr__.<locals>.<genexpr>z&<Twilio.FlexApi.V1.ChannelInstance {}>rm   rp   r	   r	   r   rR     rr   zChannelInstance.__repr__)N)rT   rU   rV   r   propertyr{   rs   r:   rH   rt   rA   ru   rv   rw   r^   ra   rR   rX   r	   r	   r   r   r9     s.    








		r9   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r#   rJ   r9   r	   r	   r	   r   <module>   s    &&1