
    gY                         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y)BindingInstance.BindingTypeapngcmfcmN)__name__
__module____qualname__APNGCMFCM     i/var/www/html/Manimaran/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-   r.   r/   r0   r1   	_solution_context)selfr$   r%   r&   r'   	__class__s        r"   r4   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'   r2   )r8   BindingContext_versionr7   r9   s    r"   _proxyzBindingInstance._proxyO   sF     == *!%0B!CNN5)DM
 }}r!   c                 6    | j                   j                         S )j
        Deletes the BindingInstance


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


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


        :returns: The fetched BindingInstance
        N)r@   fetch_asyncr?   s    r"   rM   zBindingInstance.fetch_asyncz   s!      [[,,....rG   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>   "     S<RDAq7>>!Q/<R   !z,<Twilio.Conversations.V1.BindingInstance {}>joinr7   itemsrT   r9   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   r4   propertyr@   boolrC   rF   rJ   rM   ra   __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.
        r2   z+/Services/{chat_service_sid}/Bindings/{sid}Nr    r3   r4   r7   rT   _uri)r9   r$   r&   r'   r:   s       r"   r4   zBindingContext.__init__   sG     	! !1
 IAHH 
nn
	r!   r;   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )rB   DELETEmethoduriheaders)r   ofr>   rC   rl   r9   rr   s     r"   rC   zBindingContext.delete   s1     ))B-}}##8G#TTr!   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)rE   rn   ro   N)r   rs   r>   rF   rl   rt   s     r"   rF   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 )rI   application/jsonAcceptGETro   r&   r'   r2   )r   rs   r>   rJ   rl   r   r7   r9   rr   r%   s      r"   rJ   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)	rL   rw   rx   ry   ro   Nr&   r'   r2   )r   rs   r>   rM   rl   r   r7   rz   s      r"   rM   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 )rO   rP   c              3   F   K   | ]  \  }}d j                  ||        ywrR   rS   rU   s      r"   rY   z*BindingContext.__repr__.<locals>.<genexpr>   rZ   r[   z+<Twilio.Conversations.V1.BindingContext {}>r\   r_   s     r"   ra   zBindingContext.__repr__   s6     ((SDNN<P<P<RSS<CCGLLr!   )r   r   r   r   rd   r4   rf   rC   rF   r   rJ   rM   ra   rg   rh   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>   r7   )r9   r%   s     r"   get_instancezBindingPage.get_instance   s&     MM7T^^DV5W
 	
r!   c                      y)rO   z%<Twilio.Conversations.V1.BindingPage>r    r?   s    r"   ra   zBindingPage.__repr__        7r!   N)	r   r   r   r   rd   r   r   r   ra   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    rk   )r9   r$   r&   r:   s      r"   r4   zBindingList.__init__	  sB     	!  0
 C;BBTT^^T	r!   Nr/   r   r.   limit	page_sizer;   c                     | j                   j                  ||      }| j                  |||d         }| j                   j                  ||d         S )az  
        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 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/   r.   r   r   )r>   read_limitspagestreamr9   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)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`, or `fcm`.  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_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 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/   r.   r   r   )listr   )r9   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 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   )r9   r/   r.   r   r   records         r"   
list_asynczBindingList.list_asyncw  s_     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 )
aX  
        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 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 rb   r    es    r"   <lambda>z"BindingList.page.<locals>.<lambda>      Qr!   c                     | S rb   r    r   s    r"   r   z"BindingList.page.<locals>.<lambda>      ar!   r#   Identity	PageTokenr   PageSizeContent-Type!application/x-www-form-urlencodedrw   rx   ry   rp   rq   paramsrr   )	r   rs   r   mapr>   r   rl   r   r7   	r9   r/   r.   r   r   r   datarr   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)ag  
        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 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 rb   r    r   s    r"   r   z(BindingList.page_async.<locals>.<lambda>  r   r!   c                     | S rb   r    r   s    r"   r   z(BindingList.page_async.<locals>.<lambda>  r   r!   r   r   r   rw   rx   ry   r   N)	r   rs   r   r   r>   r   rl   r   r7   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
        ry   )r>   domaintwiliorequestr   r7   r9   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
        ry   N)r>   r   r   request_asyncr   r7   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&   r2   r=   r>   r7   r9   r'   s     r"   r5   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)rO   z%<Twilio.Conversations.V1.BindingList>r    r?   s    r"   ra   zBindingList.__repr__  r   r!   )r   r   r   r   rd   r4   r   unsetr   r   rc   r   intr	   r   r   r
   r   r   r   r   r   r   r   r   r=   r5   r   ra   rg   rh   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 ' !qN& qNhbM_ bMJ7$ 7*Q7, Q7r!   