
    piY                         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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 - Conversations
    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	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec            
            e Zd Z G d de      Z	 	 ddedeeef   de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defdZ xZS )BindingInstancec                       e Zd ZdZdZdZdZy)BindingInstance.BindingTypeapngcmfcmtwilsockN)__name__
__module____qualname__APNGCMFCMTWILSOCK     n/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/conversations/v1/service/binding.pyBindingTyper      s    r#   r%   versionpayloadchat_service_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _	        t        j                  |j                  d            | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )Nr)   account_sidr(   credential_siddate_createddate_updatedendpointidentitybinding_typemessage_typesurlr(   r)   )super__init__getr)   r+   r(   r,   r   iso8601_datetimer-   r.   r/   r0   r1   r2   r3   	_solution_context)selfr&   r'   r(   r)   	__class__s        r$   r6   zBindingInstance.__init__/   s    	!")++e"4*1++m*D/6{{;M/N-4[[9I-J0;0L0LKK'1
 1<0L0LKK'1
 (/{{:'>'.{{:'>EL[[F
 3:++o2N")++e"4 !1?$((
 37r#   returnc                     | j                   7t        | j                  | j                  d   | 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: BindingContext for this BindingInstance
        r(   r)   r4   )r:   BindingContext_versionr9   r;   s    r$   _proxyzBindingInstance._proxyP   sF     == *!%0B!CNN5)DM
 }}r#   c                 6    | j                   j                         S )j
        Deletes the BindingInstance


        :returns: True if delete succeeds, False otherwise
        )rB   deleterA   s    r$   rE   zBindingInstance.delete`   s     {{!!##r#   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the BindingInstance


        :returns: True if delete succeeds, False otherwise
        N)rB   delete_asyncrA   s    r$   rH   zBindingInstance.delete_asynci   s!      [[--////   '%'c                 6    | j                   j                         S )[
        Fetch the BindingInstance


        :returns: The fetched BindingInstance
        )rB   fetchrA   s    r$   rL   zBindingInstance.fetchr   s     {{  ""r#   c                 R   K   | j                   j                          d{   S 7 w)u
        Asynchronous coroutine to fetch the BindingInstance


        :returns: The fetched BindingInstance
        N)rB   fetch_asyncrA   s    r$   rO   zBindingInstance.fetch_async{   s!      [[,,....rI   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+BindingInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z,<Twilio.Conversations.V1.BindingInstance {}>joinr9   itemsrV   r;   contexts     r$   __repr__zBindingInstance.__repr__   s6     ((SDNN<P<P<RSS=DDWMMr#   N)r=   r?   )r=   r   )r   r   r   objectr%   r   r   strr   r   r6   propertyrB   boolrE   rH   rL   rO   rc   __classcell__r<   s   @r$   r   r      s    f & "77 c3h7 	7
 c]7B  $ $0D 0#/N# Nr#   r   c                   h     e Zd Zde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defd
Z xZS )r?   r&   r(   r)   c                 z    t         |   |       ||d| _         dj                  di | j                  | _        y)am  
        Initialize the BindingContext

        :param version: Version that contains the resource
        :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Binding resource is associated with.
        :param sid: A 34 character string that uniquely identifies this resource.
        r4   z+/Services/{chat_service_sid}/Bindings/{sid}Nr"   r5   r6   r9   rV   _uri)r;   r&   r(   r)   r<   s       r$   r6   zBindingContext.__init__   sG     	! !1
 IAHH 
nn
	r#   r=   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rD   DELETEmethoduriheaders)r   ofr@   rE   rn   r;   rt   s     r$   rE   zBindingContext.delete   s1     ))B-}}##8G#TTr#   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rG   rp   rq   N)r   ru   r@   rH   rn   rv   s     r$   rH   zBindingContext.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   | j                  d         S )rK   application/jsonAcceptGETrq   r(   r)   r4   )r   ru   r@   rL   rn   r   r9   r;   rt   r'   s      r$   rL   zBindingContext.fetch   sj     ))B-.--%%U		7%SMM!^^,>?u%	
 	
r#   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rN   ry   rz   r{   rq   Nr(   r)   r4   )r   ru   r@   rO   rn   r   r9   r|   s      r$   rO   zBindingContext.fetch_async   s      ))B-.11dii 2 
 
 MM!^^,>?u%	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rQ   rR   c              3   F   K   | ]  \  }}d j                  ||        ywrT   rU   rW   s      r$   r[   z*BindingContext.__repr__.<locals>.<genexpr>   r\   r]   z+<Twilio.Conversations.V1.BindingContext {}>r^   ra   s     r$   rc   zBindingContext.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr#   )r   r   r   r   rf   r6   rh   rE   rH   r   rL   rO   rc   ri   rj   s   @r$   r?   r?      s]    
 
3 
S 
&
U 
U
D 

 
*
? 
.M# Mr#   r?   c                   2    e Zd Zdeeef   defdZdefdZy)BindingPager'   r=   c                 L    t        | j                  || j                  d         S )zm
        Build an instance of BindingInstance

        :param payload: Payload response from the API
        r(   )r(   )r   r@   r9   )r;   r'   s     r$   get_instancezBindingPage.get_instance   s&     MM7T^^DV5W
 	
r#   c                      y)rQ   z%<Twilio.Conversations.V1.BindingPage>r"   rA   s    r$   rc   zBindingPage.__repr__        7r#   N)	r   r   r   r   rf   r   r   r   rc   r"   r#   r$   r   r      s)    
DcN 
 
7# 7r#   r   c                       e Zd Zdedef fdZej                  ej                  ddfdee	d   e
f   dee	e   e
f   dee   d	ee   d
ee   f
dZej                  ej                  ddfdee	d   e
f   dee	e   e
f   dee   d	ee   d
ee   f
dZej                  ej                  ddfdee	d   e
f   dee	e   e
f   dee   d	ee   d
e	e   f
dZej                  ej                  ddfdee	d   e
f   dee	e   e
f   dee   d	ee   d
e	e   f
dZej                  ej                  ej                  ej                  ej                  fdee	d   e
f   dee	e   e
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                  ej                  ej                  fdee	d   e
f   dee	e   e
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 )BindingListr&   r(   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)a  
        Initialize the BindingList

        :param version: Version that contains the resource
        :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Binding resource is associated with.

        r(   z%/Services/{chat_service_sid}/BindingsNr"   rm   )r;   r&   r(   r<   s      r$   r6   zBindingList.__init__
  sB     	!  0
 C;BBTT^^T	r#   Nr1   r   r0   limit	page_sizer=   c                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )a  
        Streams BindingInstance 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 List[&quot;BindingInstance.BindingType&quot;] binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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   r1   r0   r   r   )r@   read_limitspagestreamr;   r1   r0   r   r   limitsr   s          r$   r   zBindingList.stream  sV    0 **5)<yy%F;DW  
 }}##D&/::r#   c                    K   | j                   j                  ||      }| j                  |||d          d{   }| j                   j                  ||d         S 7 #w)a  
        Asynchronously streams BindingInstance 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 List[&quot;BindingInstance.BindingType&quot;] binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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   )r@   r   
page_asyncstream_asyncr   s          r$   r   zBindingList.stream_async9  sd     0 **5)<__%F;DW % 
 
 }}))$w@@	
s   7AA$Ac                 >    t        | j                  ||||            S )a#  
        Lists BindingInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param List[&quot;BindingInstance.BindingType&quot;] binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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
        r1   r0   r   r   )listr   )r;   r1   r0   r   r   s        r$   r   zBindingList.listX  s.    . KK)!#	  
 	
r#   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a2  
        Asynchronously lists BindingInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param List[&quot;BindingInstance.BindingType&quot;] binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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;   r1   r0   r   r   records         r$   
list_asynczBindingList.list_asyncx  sZ     2 '+&7&7)!#	 '8 ' !
 
 !
 
 	
 
s0   =0=842
48=48=
page_tokenpage_numberc                 X   t        j                  t        j                  |d       t        j                  |d       |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||	      }t        | j                  || j                        S )
ad  
        Retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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 BindingInstance
        c                     | S rd   r"   es    r$   <lambda>z"BindingList.page.<locals>.<lambda>      Q r#   c                     | S rd   r"   r   s    r$   r   z"BindingList.page.<locals>.<lambda>      a r#   r%   Identity	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedry   rz   r{   rr   rs   paramsrt   )	r   ru   r   mapr@   r   rn   r   r9   	r;   r1   r0   r   r   r   datart   responses	            r$   r   zBindingList.page  s    ( yy(}}\;G%MM(K@'#%
 ))^-PQR.==%%diig & 
 4==(DNNCCr#   c                 t  K   t        j                  t        j                  |d       t        j                  |d       |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||	       d
{   }t        | j                  || j                        S 7 %w)as  
        Asynchronously retrieve a single page of BindingInstance records from the API.
        Request is executed immediately

        :param binding_type: The push technology used by the Binding resources to read.  Can be: `apn`, `gcm`, `fcm`, or `twilsock`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param identity: The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details.
        :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 BindingInstance
        c                     | S rd   r"   r   s    r$   r   z(BindingList.page_async.<locals>.<lambda>  r   r#   c                     | S rd   r"   r   s    r$   r   z(BindingList.page_async.<locals>.<lambda>  r   r#   r   r   r   ry   rz   r{   r   N)	r   ru   r   r   r@   r   rn   r   r9   r   s	            r$   r   zBindingList.page_async  s     ( yy(}}\;G%MM(K@'#%
 ))^-PQR.11diig 2 
 
 4==(DNNCC
s   BB8B6&B8
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )z
        Retrieve a specific page of BindingInstance records from the API.
        Request is executed immediately

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

        :returns: Page of BindingInstance
        r{   )r@   domaintwiliorequestr   r9   r;   r   r   s      r$   get_pagezBindingList.get_page  s=     ==''..66ujI4==(DNNCCr#   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of BindingInstance records from the API.
        Request is executed immediately

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

        :returns: Page of BindingInstance
        r{   N)r@   r   r   request_asyncr   r9   r   s      r$   get_page_asynczBindingList.get_page_async  sJ      --44BB5*UU4==(DNNCC Vs   4AA&Ar)   c                 L    t        | j                  | j                  d   |      S z
        Constructs a BindingContext

        :param sid: A 34 character string that uniquely identifies this resource.
        r(   r4   r?   r@   r9   r;   r)   s     r$   r7   zBindingList.get  '     MMDNN;M,NTW
 	
r#   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r$   __call__zBindingList.__call__	  r   r#   c                      y)rQ   z%<Twilio.Conversations.V1.BindingList>r"   rA   s    r$   rc   zBindingList.__repr__  r   r#   )r   r   r   r   rf   r6   r   unsetr   r   re   r   intr	   r   r   r
   r   r   r   r   r   r   r   r   r?   r7   r   rc   ri   rj   s   @r$   r   r     s   U U3 U$ LR<<-3\\##';D!>?GH; S	6)*; }	;
 C=; 
/	";B LR<<-3\\##'AD!>?GHA S	6)*A }	A
 C=A 
	'AB LR<<-3\\##'
D!>?GH
 S	6)*
 }	

 C=
 
o	
D LR<<-3\\##'
D!>?GH
 S	6)*
 }	

 C=
 
o	
F LR<<-3\\)/*0,,(.%DD!>?GH%D S	6)*%D #v+&	%D
 3;'%D f%%D 
%DR LR<<-3\\)/*0,,(.%DD!>?GH%D S	6)*%D #v+&	%D
 3;'%D f%%D 
%DN
D3 
D; 
D
Ds 
D{ 
D
s 
~ 

C 
N 
7# 7r#   r   N)__doc__r   typingr   r   r   r   r   r	   r
   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r?   r   r   r"   r#   r$   <module>r      sj     L L L 6 6 8 : 2 ' !rN& rNjbM_ bMJ7$ 7*Q7, Q7r#   