
    m>hS                         d 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 - Events
    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.
    )AnyDictListOptionalUnionIteratorAsyncIterator)deserializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec            
            e Zd Zd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ej$                  fdeeef   dd fdZej$                  fdeeef   dd fdZdefdZ xZS )SubscribedEventInstancea<  
    :ivar account_sid: The unique SID identifier of the Account.
    :ivar type: Type of event being subscribed to.
    :ivar schema_version: The schema version that the Subscription should use.
    :ivar subscription_sid: The unique SID identifier of the Subscription.
    :ivar url: The URL of this resource.
    versionpayloadsubscription_sidtypec                 d   t         |   |       |j                  d      | _        |j                  d      | _        t        j                  |j                  d            | _        |j                  d      | _        |j                  d      | _	        ||xs | j                  d| _
        d | _        y )Naccount_sidr   schema_versionr   urlr   r   )super__init__getr   r   r
   integerr   r   r   	_solution_context)selfr   r   r   r   	__class__s        w/var/www/html/DP/alpha_backend/venv/lib/python3.12/site-packages/twilio/rest/events/v1/subscription/subscribed_event.pyr   z SubscribedEventInstance.__init__!   s     	!*1++m*D#*;;v#6	-8-@-@KK().
 07{{;M/N")++e"4 !1%DII
 ;?    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: SubscribedEventContext for this SubscribedEventInstance
        r   r   r   )r!   SubscribedEventContext_versionr    r"   s    r$   _proxyzSubscribedEventInstance._proxy8   sF     == 2!%0B!C^^F+DM
 }}r%   c                 6    | j                   j                         S )r
        Deletes the SubscribedEventInstance


        :returns: True if delete succeeds, False otherwise
        )r+   deleter*   s    r$   r.   zSubscribedEventInstance.deleteH   s     {{!!##r%   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine that deletes the SubscribedEventInstance


        :returns: True if delete succeeds, False otherwise
        N)r+   delete_asyncr*   s    r$   r1   z$SubscribedEventInstance.delete_asyncQ   s!      [[--////   '%'c                 6    | j                   j                         S )k
        Fetch the SubscribedEventInstance


        :returns: The fetched SubscribedEventInstance
        )r+   fetchr*   s    r$   r5   zSubscribedEventInstance.fetchZ   s     {{  ""r%   c                 R   K   | j                   j                          d{   S 7 w)
        Asynchronous coroutine to fetch the SubscribedEventInstance


        :returns: The fetched SubscribedEventInstance
        N)r+   fetch_asyncr*   s    r$   r8   z#SubscribedEventInstance.fetch_asyncc   s!      [[,,....r2   r   c                 :    | j                   j                  |      S )
        Update the SubscribedEventInstance

        :param schema_version: The schema version that the Subscription should use.

        :returns: The updated SubscribedEventInstance
        r   )r+   updater"   r   s     r$   r<   zSubscribedEventInstance.updatel   s#     {{!!) " 
 	
r%   c                 V   K   | j                   j                  |       d{   S 7 w)
        Asynchronous coroutine to update the SubscribedEventInstance

        :param schema_version: The schema version that the Subscription should use.

        :returns: The updated SubscribedEventInstance
        r;   N)r+   update_asyncr=   s     r$   r@   z$SubscribedEventInstance.update_asyncz   s1      [[--) . 
 
 	
 
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>z3SubscribedEventInstance.__repr__.<locals>.<genexpr>   "     S<RDAq7>>!Q/<R   !z-<Twilio.Events.V1.SubscribedEventInstance {}>joinr    itemsrG   r"   contexts     r$   __repr__z SubscribedEventInstance.__repr__   s6     ((SDNN<P<P<RSS>EEgNNr%   )N)r&   r(   )r&   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr+   boolr.   r1   r5   r8   r   unsetr   intobjectr<   r@   rT   __classcell__r#   s   @r$   r   r      s     #?? c3h? 	?
 sm?.  $ $0D 0#/ 4:<<
#CK0
	"
 4:<<
#CK0
	"
O# Or%   r   c                        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ej                  fd
eeef   de	fdZej                  fd
eeef   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)z
        Initialize the SubscribedEventContext

        :param version: Version that contains the resource
        :param subscription_sid: The unique SID identifier of the Subscription.
        :param type: Type of event being subscribed to.
        r   z9/Subscriptions/{subscription_sid}/SubscribedEvents/{type}N r   r   r    rG   _uri)r"   r   r   r   r#   s       r$   r   zSubscribedEventContext.__init__   sG     	! !1
 WOVV 
nn
	r%   r&   c                 |    t        j                  i       }| j                  j                  d| j                  |      S )r-   DELETEmethoduriheaders)r   ofr)   r.   re   r"   rk   s     r$   r.   zSubscribedEventContext.delete   s1     ))B-}}##8G#TTr%   c                    K   t        j                  i       }| j                  j                  d| j                  |       d{   S 7 w)r0   rg   rh   N)r   rl   r)   r1   re   rm   s     r$   r1   z#SubscribedEventContext.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 )r4   application/jsonAcceptGETrh   r   r   r   )r   rl   r)   r5   re   r   r    r"   rk   r   s      r$   r5   zSubscribedEventContext.fetch   sj     ))B-.--%%U		7%S&MM!^^,>?'	
 	
r%   c                   K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d   | j                  d         S 7 7w)	r7   rp   rq   rr   rh   Nr   r   r   )r   rl   r)   r8   re   r   r    rs   s      r$   r8   z"SubscribedEventContext.fetch_async   s      ))B-.11dii 2 
 
 'MM!^^,>?'	
 	
	
s   ABB 	8Br   c                 &   t        j                  d|i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   | j                  d	   
      S )r:   SchemaVersion!application/x-www-form-urlencodedContent-Typerp   rq   POSTri   rj   datark   r   r   r   )r   rl   r)   r<   re   r   r    r"   r   r{   rk   r   s        r$   r<   zSubscribedEventContext.update   s     yy

 ))B-"E.--&&tyytW ' 
 'MM!^^,>?'	
 	
r%   c                 B  K   t        j                  d|i      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   | j                  d
         S 7 7w)r?   rv   rw   rx   rp   rq   ry   rz   Nr   r   r   )r   rl   r)   r@   re   r   r    r|   s        r$   r@   z#SubscribedEventContext.update_async  s      yy

 ))B-"E.22tyytW 3 
 
 'MM!^^,>?'	
 	
	
s   A#B%B&8Bc                     dj                  d | j                  j                         D              }dj                  |      S )rB   rC   c              3   F   K   | ]  \  }}d j                  ||        ywrE   rF   rH   s      r$   rL   z2SubscribedEventContext.__repr__.<locals>.<genexpr>5  rM   rN   z,<Twilio.Events.V1.SubscribedEventContext {}>rO   rR   s     r$   rT   zSubscribedEventContext.__repr__/  s6     ((SDNN<P<P<RSS=DDWMMr%   )rU   rV   rW   r   rY   r   r[   r.   r1   r   r5   r8   r   r\   r   r]   r^   r<   r@   rT   r_   r`   s   @r$   r(   r(      s    
 
3 
c 
&
U 
U
D 

. 
*
#: 
0 4:<<
#CK0
	 
D 4:<<
#CK0
	 
BN# Nr%   r(   c                   2    e Zd Zdeeef   defdZdefdZy)SubscribedEventPager   r&   c                 L    t        | j                  || j                  d         S )zu
        Build an instance of SubscribedEventInstance

        :param payload: Payload response from the API
        r   r   )r   r)   r    )r"   r   s     r$   get_instancez SubscribedEventPage.get_instance;  s&     'MM7T^^DV5W
 	
r%   c                      y)rB   z&<Twilio.Events.V1.SubscribedEventPage>rc   r*   s    r$   rT   zSubscribedEventPage.__repr__E       8r%   N)	rU   rV   rW   r   rY   r   r   r   rT   rc   r%   r$   r   r   9  s*    
DcN 
7N 
8# 8r%   r   c            	           e Zd Zdedef fdZej                  fdedee	e
f   defdZej                  fde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 )SubscribedEventListr   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)z
        Initialize the SubscribedEventList

        :param version: Version that contains the resource
        :param subscription_sid: The unique SID identifier of the Subscription.

        r   z2/Subscriptions/{subscription_sid}/SubscribedEventsNrc   rd   )r"   r   r   r#   s      r$   r   zSubscribedEventList.__init__P  sG     	!  0
 PHOO 
nn
	r%   r   r   r&   c                    t        j                  ||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
z
        Create the SubscribedEventInstance

        :param type: Type of event being subscribed to.
        :param schema_version: The schema version that the Subscription should use.

        :returns: The created SubscribedEventInstance
        Typerv   rx   rw   rp   rq   ry   rz   r   r   )r   rl   r)   createre   r   r    r"   r   r   r{   rk   r   s         r$   r   zSubscribedEventList.createb  s     yy!/
 ))^-PQR"E.--&&tyytW ' 
 'MM7T^^DV5W
 	
r%   c                 ,  K   t        j                  ||d      }t        j                  ddi      }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)a  
        Asynchronously create the SubscribedEventInstance

        :param type: Type of event being subscribed to.
        :param schema_version: The schema version that the Subscription should use.

        :returns: The created SubscribedEventInstance
        r   rx   rw   rp   rq   ry   rz   Nr   r   )r   rl   r)   create_asyncre   r   r    r   s         r$   r   z SubscribedEventList.create_async  s      yy!/
 ))^-PQR"E.22tyytW 3 
 
 'MM7T^^DV5W
 	
	
s   A&B(B)*Blimit	page_sizec                     | j                   j                  ||      }| j                  |d         }| j                   j                  ||d         S )ae  
        Streams SubscribedEventInstance 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   )r)   read_limitspagestreamr"   r   r   limitsr   s        r$   r   zSubscribedEventList.stream  sJ    ( **5)<yy6+#6y7}}##D&/::r%   c                    K   | j                   j                  ||      }| j                  |d          d{   }| j                   j                  ||d         S 7 #w)at  
        Asynchronously streams SubscribedEventInstance 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   )r)   r   
page_asyncstream_asyncr   s        r$   r   z SubscribedEventList.stream_async  sW     ( **5)<__vk/B_CC}}))$w@@ Ds   5AA$Ac                 :    t        | j                  ||            S )a  
        Lists SubscribedEventInstance 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SubscribedEventList.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 SubscribedEventInstance 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SubscribedEventList.list_async  sY     * '+&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                  || j                        S )a  
        Retrieve a single page of SubscribedEventInstance 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 SubscribedEventInstance
        	PageTokenr   PageSizerx   rw   rp   rq   rr   ri   rj   paramsrk   )r   rl   r)   r   re   r   r    r"   r   r   r   r{   rk   responses          r$   r   zSubscribedEventList.page	  s      yy'#%
 ))^-PQR.==%%diig & 
 #4==(DNNKKr%   c                   K   t        j                  |||d      }t        j                  ddi      }d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                        S 7 %w)	a  
        Asynchronously retrieve a single page of SubscribedEventInstance 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 SubscribedEventInstance
        r   rx   rw   rp   rq   rr   r   N)r   rl   r)   r   re   r   r    r   s          r$   r   zSubscribedEventList.page_async*  s       yy'#%
 ))^-PQR.11diig 2 
 
 #4==(DNNKK
s   A"B$B
%&B
target_urlc                     | j                   j                  j                  j                  d|      }t	        | j                   || j
                        S )a  
        Retrieve a specific page of SubscribedEventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SubscribedEventInstance
        rr   )r)   domaintwiliorequestr   r    r"   r   r   s      r$   get_pagezSubscribedEventList.get_pageK  s=     ==''..66ujI"4==(DNNKKr%   c                    K   | j                   j                  j                  j                  d|       d{   }t	        | j                   || j
                        S 7 %w)a  
        Asynchronously retrieve a specific page of SubscribedEventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SubscribedEventInstance
        rr   N)r)   r   r   request_asyncr   r    r   s      r$   get_page_asyncz"SubscribedEventList.get_page_asyncW  sJ      --44BB5*UU"4==(DNNKK Vs   4AA&Ac                 L    t        | j                  | j                  d   |      S zn
        Constructs a SubscribedEventContext

        :param type: Type of event being subscribed to.
        r   r   r(   r)   r    r"   r   s     r$   r   zSubscribedEventList.getc  (     &MM!^^,>?
 	
r%   c                 L    t        | j                  | j                  d   |      S r   r   r   s     r$   __call__zSubscribedEventList.__call__o  r   r%   c                      y)rB   z&<Twilio.Events.V1.SubscribedEventList>rc   r*   s    r$   rT   zSubscribedEventList.__repr__{  r   r%   )NN) rU   rV   rW   r   rY   r   r   r\   r   r]   r^   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r(   r   r   rT   r_   r`   s   @r$   r   r   N  s   
 
3 
& ?Ell

).sF{);
	 
B ?Ell

).sF{);
	 
D  $#';}; C=; 
)	*	;6  $#'A}A C=A 
.	/	A6  $#'
}
 C=
 
%	&	
8  $#'
}
 C=
 
%	&	
: *0*0,,(.	L#v+&L 3;'L f%	L
 
LF *0*0,,(.	L#v+&L 3;'L f%	L
 
LB
L3 
L+> 
L
Ls 
L7J 
L

 

 6 



S 

%; 

8# 8r%   r   N)rX   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   r(   r   r   rc   r%   r$   <module>r      se    M L L + 8 : 2 ' !wO. wOtdN_ dNN8$ 8*s8, s8r%   