
    piV                         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e      Z G d de      Z G d de      Z G d de      Zy)a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Flex
    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                   J    e Zd Z G d de      Z	 	 ddedeeef   de	e   f fdZ
edd       Zdefd	Zdefd
ZddZddZej&                  ej&                  fdedef   deeef   dd fdZej&                  ej&                  fdedef   deeef   dd fdZdefdZ xZS )WebChannelInstancec                       e Zd ZdZy)WebChannelInstance.ChatStatusinactiveN)__name__
__module____qualname__INACTIVE     e/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/flex_api/v1/web_channel.py
ChatStatusr      s    r   r   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _	        t        j                  |j                  d            | _
        d|xs | j
                  i| _        d | _        y )Naccount_sidflex_flow_sidr!   urldate_createddate_updated)super__init__getr#   r$   r!   r%   r   iso8601_datetimer&   r'   	_solution_context)selfr   r    r!   	__class__s       r   r)   zWebChannelInstance.__init__'   s     	!*1++m*D,3KK,H")++e"4")++e"40;0L0LKK'1
 1<0L0LKK'1

 3?$((
 6:r   returnc                     | j                   )t        | j                  | j                  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: WebChannelContext for this WebChannelInstance
        r!   r!   )r-   WebChannelContext_versionr,   r.   s    r   _proxyzWebChannelInstance._proxy<   s9     == -NN5)DM }}r   c                 6    | j                   j                         S )m
        Deletes the WebChannelInstance


        :returns: True if delete succeeds, False otherwise
        )r6   deleter5   s    r   r9   zWebChannelInstance.deleteK   s     {{!!##r   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the WebChannelInstance


        :returns: True if delete succeeds, False otherwise
        N)r6   delete_asyncr5   s    r   r<   zWebChannelInstance.delete_asyncT   s!      [[--////   '%'c                 6    | j                   j                         S )a
        Fetch the WebChannelInstance


        :returns: The fetched WebChannelInstance
        )r6   fetchr5   s    r   r@   zWebChannelInstance.fetch]   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w){
        Asynchronous coroutine to fetch the WebChannelInstance


        :returns: The fetched WebChannelInstance
        N)r6   fetch_asyncr5   s    r   rC   zWebChannelInstance.fetch_asyncf   s!      [[,,....r=   chat_statusr   post_engagement_datac                 <    | j                   j                  ||      S )
        Update the WebChannelInstance

        :param chat_status:
        :param post_engagement_data: The post-engagement data.

        :returns: The updated WebChannelInstance
        rD   rE   )r6   updater.   rD   rE   s      r   rI   zWebChannelInstance.updateo   s&     {{!!#!5 " 
 	
r   c                 X   K   | j                   j                  ||       d{   S 7 w)
        Asynchronous coroutine to update the WebChannelInstance

        :param chat_status:
        :param post_engagement_data: The post-engagement data.

        :returns: The updated WebChannelInstance
        rH   N)r6   update_asyncrJ   s      r   rM   zWebChannelInstance.update_async   s4      [[--#!5 . 
 
 	
 
s   !*(*c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r   	<genexpr>z.WebChannelInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z)<Twilio.FlexApi.V1.WebChannelInstance {}>joinr,   itemsrT   r.   contexts     r   __repr__zWebChannelInstance.__repr__   s6     ((SDNN<P<P<RSS:AA'JJr   )N)r0   r3   )r0   r   )r   r   r   objectr   r   r   strr   r   r)   propertyr6   boolr9   r<   r@   rC   r   unsetr   rI   rM   ra   __classcell__r/   s   @r   r   r      s   V  OS::)-c3h:>Fsm:*  $ $0D 0#/ GMll39<<
:FBC
 $CK0
 
	
( GMll39<<
:FBC
 $CK0
 
	
$K# Kr   r   c                       e Zd Zdedef fdZdefdZdefdZde	fdZ
de	fdZej                  ej                  fd	ed
ef   deeef   de	fdZej                  ej                  fd	ed
ef   deeef   de	fdZdefdZ xZS )r3   r   r!   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the WebChannelContext

        :param version: Version that contains the resource
        :param sid: The SID of the WebChannel resource to update.
        r!   z/WebChannels/{sid}Nr   )r(   r)   r,   rT   _uri)r.   r   r!   r/   s      r   r)   zWebChannelContext.__init__   s@     	! 3
 0(//A$..A	r   r0   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r8   DELETEmethoduriheaders)r   ofr4   r9   rk   r.   rq   s     r   r9   zWebChannelContext.delete   s1     ))B-}}##8G#TTr   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r;   rm   rn   N)r   rr   r4   r<   rk   rs   s     r   r<   zWebChannelContext.delete_async   sF      ))B-]]//G 0 
 
 	
 
s   AA
AA
c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )r?   application/jsonAcceptGETrn   r!   r2   )r   rr   r4   r@   rk   r   r,   r.   rq   r    s      r   r@   zWebChannelContext.fetch   s]     ))B-.--%%U		7%S!MMu%
 	
r   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)rB   rv   rw   rx   rn   Nr!   r2   )r   rr   r4   rC   rk   r   r,   ry   s      r   rC   zWebChannelContext.fetch_async   sr      ))B-.11dii 2 
 
 "MMu%
 	
	
s   AA4A2	*A4rD   r   rE   c                    t        j                  ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
rG   r   PostEngagementData!application/x-www-form-urlencodedContent-Typerv   rw   POSTro   rp   datarq   r!   r2   )r   rr   r4   rI   rk   r   r,   r.   rD   rE   r   rq   r    s         r   rI   zWebChannelContext.update   s     yy)&:
 ))B-"E.--&&tyytW ' 
 "$--dnnU>STTr   c                 (  K   t        j                  ||d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)rL   r|   r~   r   rv   rw   r   r   Nr!   r2   )r   rr   r4   rM   rk   r   r,   r   s         r   rM   zWebChannelContext.update_async  s      yy)&:
 ))B-"E.22tyytW 3 
 
 "$--dnnU>STT	
s   A$B&B'*Bc                     dj                  d | j                  j                         D              }dj                  |      S )rO   rP   c              3   F   K   | ]  \  }}d j                  ||        ywrR   rS   rU   s      r   rY   z-WebChannelContext.__repr__.<locals>.<genexpr>8  rZ   r[   z(<Twilio.FlexApi.V1.WebChannelContext {}>r\   r_   s     r   ra   zWebChannelContext.__repr__2  s6     ((SDNN<P<P<RSS9@@IIr   )r   r   r   r   rc   r)   re   r9   r<   r   r@   rC   r   rf   r   rb   rI   rM   ra   rg   rh   s   @r   r3   r3      s    B Bc B
U 
U
D 

) 
(
#5 
0 GMll39<<U:FBCU $CK0U 
	UD GMll39<<U:FBCU $CK0U 
	U@J# Jr   r3   c                   2    e Zd Zdeeef   defdZdefdZy)WebChannelPager    r0   c                 .    t        | j                  |      S )zp
        Build an instance of WebChannelInstance

        :param payload: Payload response from the API
        )r   r4   )r.   r    s     r   get_instancezWebChannelPage.get_instance>  s     "$--99r   c                      y)rO   z"<Twilio.FlexApi.V1.WebChannelPage>r   r5   s    r   ra   zWebChannelPage.__repr__F       4r   N)	r   r   r   r   rc   r   r   r   ra   r   r   r   r   r   <  s*    :DcN :7I :4# 4r   r   c                       e Zd Zdef fdZej                  ej                  fdededededeee	f   deee	f   d	e
fd
Zej                  ej                  fdededededeee	f   deee	f   d	e
fdZ	 	 ddee   dee   d	ee
   fdZ	 	 ddee   dee   d	ee
   fdZ	 	 ddee   dee   d	ee
   fdZ	 	 ddee   dee   d	ee
   fdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   d	efdZej                  ej                  ej                  fdeee	f   deee	f   deee	f   d	efdZded	efdZded	efdZded	efdZded	efdZd	efdZ xZS )WebChannelListr   c                 2    t         |   |       d| _        y)zl
        Initialize the WebChannelList

        :param version: Version that contains the resource

        z/WebChannelsN)r(   r)   rk   )r.   r   r/   s     r   r)   zWebChannelList.__init__Q  s     	!"	r   r$   identitycustomer_friendly_namechat_friendly_namechat_unique_namepre_engagement_datar0   c           	          t        j                  ||||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }	t        | j                  |	      S )a  
        Create the WebChannelInstance

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

        :returns: The created WebChannelInstance
        FlexFlowSidIdentityCustomerFriendlyNameChatFriendlyNameChatUniqueNamePreEngagementDatar   r~   rv   rw   r   r   )r   rr   r4   createrk   r   
r.   r$   r   r   r   r   r   r   rq   r    s
             r   r   zWebChannelList.create\  s    , yy,$(>$6"2%8	
 ))^-PQR"E.--&&tyytW ' 
 "$--99r   c           	        K   t        j                  ||||||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }	t        | j                  |	      S 7 w)	a  
        Asynchronously create the WebChannelInstance

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

        :returns: The created WebChannelInstance
        r   r   r~   rv   rw   r   r   N)r   rr   r4   create_asyncrk   r   r   s
             r   r   zWebChannelList.create_async  s     , yy,$(>$6"2%8	
 ))^-PQR"E.22tyytW 3 
 
 "$--99	
s   A*B	,B-B	limit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   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 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
        r   r   r   )r4   read_limitspagestreamr.   r   r   limitsr   s        r   r   zWebChannelList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)ao  
        Asynchronously 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 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
        r   r   Nr   )r4   r   
page_asyncstream_asyncr   s        r   r   zWebChannelList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        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 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
        r   r   )listr   )r.   r   r   s      r   r   zWebChannelList.list  s(    & KK#  
 	
r   c                 z   K   | j                  ||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        Asynchronously 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 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
        r   N)r   )r.   r   r   records       r   
list_asynczWebChannelList.list_async   sT     * '+&7&7# '8 ' !
 
 !
 
 	
 
s0   ;.;620
26;26;
page_tokenpage_numberc                     t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||      }t        | j                  |      S )ay  
        Retrieve a single page of WebChannelInstance 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 WebChannelInstance
        	PageTokenr   PageSizer   r~   rv   rw   rx   ro   rp   paramsrq   )r   rr   r4   r   rk   r   r.   r   r   r   r   rq   responses          r   r   zWebChannelList.page  sy      yy'#%
 ))^-PQR.==%%diig & 
 dmmX66r   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  |      S 7 w)	a  
        Asynchronously retrieve a single page of WebChannelInstance 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 WebChannelInstance
        r   r   r~   rv   rw   rx   r   N)r   rr   r4   r   rk   r   r   s          r   r   zWebChannelList.page_async<  s       yy'#%
 ))^-PQR.11diig 2 
 
 dmmX66
s   A"B$A?%B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   |      S )z
        Retrieve a specific page of WebChannelInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebChannelInstance
        rx   )r4   domaintwiliorequestr   r.   r   r   s      r   get_pagezWebChannelList.get_page]  s7     ==''..66ujIdmmX66r   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   |      S 7 w)a  
        Asynchronously retrieve a specific page of WebChannelInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebChannelInstance
        rx   N)r4   r   r   request_asyncr   r   s      r   get_page_asynczWebChannelList.get_page_asynci  sD      --44BB5*UUdmmX66 Vs   4AAAr!   c                 0    t        | j                  |      S zs
        Constructs a WebChannelContext

        :param sid: The SID of the WebChannel resource to update.
        r2   r3   r4   r.   r!   s     r   r*   zWebChannelList.getu       !C88r   c                 0    t        | j                  |      S r   r   r   s     r   __call__zWebChannelList.__call__}  r   r   c                      y)rO   z"<Twilio.FlexApi.V1.WebChannelList>r   r5   s    r   ra   zWebChannelList.__repr__  r   r   )NN) r   r   r   r   r)   r   rf   rc   r   rb   r   r   r   r   intr	   r   r
   r   r   r   r   r   r   r   r   r   r3   r*   r   ra   rg   rh   s   @r   r   r   O  s   	# 	#" 06||28,,*:*: *: !$	*:
  *:  V,*: #3;/*: 
*:d 06||28,,*:*: *: !$	*:
  *:  V,*: #3;/*: 
*:\  $#';}; C=; 
$	%	;6  $#'A}A C=A 
)	*	A6  $#'
}
 C=
 
 	!	
8  $#'
}
 C=
 
 	!	
: *0*0,,(.	7#v+&7 3;'7 f%	7
 
7F *0*0,,(.	7#v+&7 3;'7 f%	7
 
7B
73 
7> 
7
7s 
7~ 
79s 90 99C 9$5 94# 4r   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r3   r   r   r   r   r   <module>r      sg     L L L + 8 : 2 ' !AK) AKH\J \J~4T 4&|4\ |4r   