
    pisX                         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 - Chat
    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y)BindingInstance.BindingTypegcmapnfcmN)__name__
__module____qualname__GCMAPNFCM     e/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/chat/v2/service/binding.pyBindingTyper      s    r!   r#   versionpayloadservice_sidsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        t        j                  |j                  d            | _	        |j                  d      | _
        |j                  d      | _        |j                  d      | _        |j                  d	      | _        |j                  d
      | _        |j                  d      | _        |j                  d      | _        ||xs | j                  d| _        d | _        y )Nr'   account_sidr&   date_createddate_updatedendpointidentitycredential_sidbinding_typemessage_typesurllinksr&   r'   )super__init__getr'   r)   r&   r   iso8601_datetimer*   r+   r,   r-   r.   r/   r0   r1   r2   	_solution_context)selfr$   r%   r&   r'   	__class__s        r"   r5   zBindingInstance.__init__/   s"    	!")++e"4*1++m*D*1++m*D0;0L0LKK'1
 1<0L0LKK'1
 (/{{:'>'.{{:'>-4[[9I-JEL[[F
 3:++o2N")++e"429++g2F
 '?$((
 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'   r3   )r9   BindingContext_versionr8   r:   s    r"   _proxyzBindingInstance._proxyQ   sE     == * NN=9NN5)DM
 }}r!   c                 6    | j                   j                         S )j
        Deletes the BindingInstance


        :returns: True if delete succeeds, False otherwise
        )rA   deleter@   s    r"   rD   zBindingInstance.deletea   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)rA   delete_asyncr@   s    r"   rG   zBindingInstance.delete_asyncj   s!      [[--////   '%'c                 6    | j                   j                         S )[
        Fetch the BindingInstance


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


        :returns: The fetched BindingInstance
        N)rA   fetch_asyncr@   s    r"   rN   zBindingInstance.fetch_async|   s!      [[,,....rH   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.Chat.V2.BindingInstance {}>joinr8   itemsrU   r:   contexts     r"   __repr__zBindingInstance.__repr__   s6     ((SDNN<P<P<RSS4;;GDDr!   N)r<   r>   )r<   r   )r   r   r   objectr#   r   r   strr   r   r5   propertyrA   boolrD   rG   rK   rN   rb   __classcell__r;   s   @r"   r   r      s    f 
( " 7 7 c3h 7 	 7
 c] 7D  $ $0D 0#/E# E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)a:  
        Initialize the BindingContext

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the Binding resource from.
        :param sid: The SID of the Binding resource to fetch.
        r3   z&/Services/{service_sid}/Bindings/{sid}Nr    r4   r5   r8   rU   _uri)r:   r$   r&   r'   r;   s       r"   r5   zBindingContext.__init__   sB     	! '
 D<CCUdnnU	r!   r<   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rC   DELETEmethoduriheaders)r   ofr?   rD   rm   r:   rs   s     r"   rD   zBindingContext.delete   s1     ))B-}}##8G#TTr!   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rF   ro   rp   N)r   rt   r?   rG   rm   ru   s     r"   rG   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 )rJ   application/jsonAcceptGETrp   r&   r'   r3   )r   rt   r?   rK   rm   r   r8   r:   rs   r%   s      r"   rK   zBindingContext.fetch   si     ))B-.--%%U		7%SMM}5u%	
 	
r!   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	rM   rx   ry   rz   rp   Nr&   r'   r3   )r   rt   r?   rN   rm   r   r8   r{   s      r"   rN   zBindingContext.fetch_async   s~      ))B-.11dii 2 
 
 MM}5u%	
 	
	
s   ABB 	8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rP   rQ   c              3   F   K   | ]  \  }}d j                  ||        ywrS   rT   rV   s      r"   rZ   z*BindingContext.__repr__.<locals>.<genexpr>   r[   r\   z"<Twilio.Chat.V2.BindingContext {}>r]   r`   s     r"   rb   zBindingContext.__repr__   s6     ((SDNN<P<P<RSS3::7CCr!   )r   r   r   r   re   r5   rg   rD   rG   r   rK   rN   rb   rh   ri   s   @r"   r>   r>      sa    V Vc V V"
U 
U
D 

 
*
? 
.D# D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?   r8   )r:   r%   s     r"   get_instancezBindingPage.get_instance   s%     MM7}0M
 	
r!   c                      y)rP   z<Twilio.Chat.V2.BindingPage>r    r@   s    r"   rb   zBindingPage.__repr__        .r!   N)	r   r   r   r   re   r   r   r   rb   r    r!   r"   r   r      s)    
DcN 
 
.# .r!   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)z
        Initialize the BindingList

        :param version: Version that contains the resource
        :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the Binding resources from.

        r&   z /Services/{service_sid}/BindingsNr    rl   )r:   r$   r&   r;   s      r"   r5   zBindingList.__init__	  s@     	! ;
 >6==OO	r!   Nr/   r   r-   limit	page_sizer<   c                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )ab  
        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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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/   r-   r   r   )r?   read_limitspagestreamr:   r/   r-   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)aq  
        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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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_async8  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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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/   r-   r   r   )listr   )r:   r/   r-   r   r   s        r"   r   zBindingList.listW  s.    . KK)!#	  
 	
r!   c                 ~   K   | j                  ||||       d{   2 cg c3 d{   }|7 7 	6 c}S c c}w w)a  
        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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param List[str] identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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:   r/   r-   r   r   records         r"   
list_asynczBindingList.list_asyncw  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 )
a@  
        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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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 rc   r    es    r"   <lambda>z"BindingList.page.<locals>.<lambda>      Q r!   c                     | S rc   r    r   s    r"   r   z"BindingList.page.<locals>.<lambda>      a r!   r#   Identity	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrx   ry   rz   rq   rr   paramsrs   )	r   rt   r   mapr?   r   rm   r   r8   	r:   r/   r-   r   r   r   datars   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)aO  
        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`, or `fcm`.  See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info.
        :param identity: The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/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 rc   r    r   s    r"   r   z(BindingList.page_async.<locals>.<lambda>  r   r!   c                     | S rc   r    r   s    r"   r   z(BindingList.page_async.<locals>.<lambda>  r   r!   r   r   r   rx   ry   rz   r   N)	r   rt   r   r   r?   r   rm   r   r8   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
        rz   )r?   domaintwiliorequestr   r8   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
        rz   N)r?   r   r   request_asyncr   r8   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 zl
        Constructs a BindingContext

        :param sid: The SID of the Binding resource to fetch.
        r&   r3   r>   r?   r8   r:   r'   s     r"   r6   zBindingList.get  %     MMt~~m'D#
 	
r!   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r"   __call__zBindingList.__call__  r   r!   c                      y)rP   z<Twilio.Chat.V2.BindingList>r    r@   s    r"   rb   zBindingList.__repr__  r   r!   )r   r   r   r   re   r5   r   unsetr   r   rd   r   intr	   r   r   r
   r   r   r   r   r   r   r   r   r>   r6   r   rb   rh   ri   s   @r"   r   r     s   P Pc P$ 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 
.# .r!   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 ' !sE& sEl`D_ `DF.$ .*Q., Q.r!   