o
    e:                     @   s   d 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	 ddl
mZ G dd	 d	e	ZG d
d deZG dd deZG dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       sx   e Zd ZdZ fddZdddZdddZejejejfd	d
Z	dd Z
ejfddZdd Zdd Zdd Z  ZS )SubscribedEventListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s2   t t| | d|i| _djdi | j| _dS )a^  
        Initialize the SubscribedEventList

        :param Version version: Version that contains the resource
        :param subscription_sid: Subscription SID.

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventList
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventList
        subscription_sidz2/Subscriptions/{subscription_sid}/SubscribedEventsN )superr   __init__	_solutionformat_uri)selfversionr
   	__class__r   f/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/events/v1/subscription/subscribed_event.pyr      s   

zSubscribedEventList.__init__Nc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        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 int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int 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
        :rtype: list[twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance]
        	page_size)r   limit)_versionread_limitspagestream)r   r   r   limitsr   r   r   r   r   %   s   zSubscribedEventList.streamc                 C   s   t | j||d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 int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int 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: Generator that will yield up to limit results
        :rtype: list[twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance]
        )r   r   )listr   )r   r   r   r   r   r   r   <   s   zSubscribedEventList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of SubscribedEventInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventPage
        )	PageTokenr   PageSizeGET)methoduriparams)r   ofr   r   r   SubscribedEventPager   )r   
page_tokenpage_numberr   dataresponser   r   r   r   N   s   zSubscribedEventList.pagec                 C   s"   | j jjd|}t| j || jS )a_  
        Retrieve a specific page of SubscribedEventInstance records from the API.
        Request is executed immediately

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

        :returns: Page of SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventPage
        r    )r   domaintwiliorequestr%   r   )r   
target_urlr)   r   r   r   get_pagea   s
   

zSubscribedEventList.get_pagec                 C   s:   t ||d}| jjd| j|d}t| j|| jd dS )ad  
        Create the SubscribedEventInstance

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

        :returns: The created SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        )TypeSchemaVersionPOSTr!   r"   r(   r
   r
   )r   r$   r   creater   SubscribedEventInstancer   )r   typeschema_versionr(   payloadr   r   r   r4   r   s   
zSubscribedEventList.createc                 C      t | j| jd |dS a'  
        Constructs a SubscribedEventContext

        :param type: Type of event being subscribed to.

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventContext
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventContext
        r
   r
   r6   SubscribedEventContextr   r   r   r6   r   r   r   get   
   	zSubscribedEventList.getc                 C   r9   r:   r<   r>   r   r   r   __call__   r@   zSubscribedEventList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z&<Twilio.Events.V1.SubscribedEventList>r   r   r   r   r   __repr__      zSubscribedEventList.__repr__)NN)__name__
__module____qualname____doc__r   r   r   r   unsetr   r.   r4   r?   rA   rE   __classcell__r   r   r   r   r      s    


r   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )r%   r	   c                    s   t t| || || _dS )a  
        Initialize the SubscribedEventPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param subscription_sid: Subscription SID.

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventPage
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventPage
        N)r   r%   r   r   )r   r   r)   solutionr   r   r   r      s   
zSubscribedEventPage.__init__c                 C   s   t | j|| jd dS )a5  
        Build an instance of SubscribedEventInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        r
   r3   )r5   r   r   r   r8   r   r   r   get_instance   s
   	z SubscribedEventPage.get_instancec                 C   rB   )rC   z&<Twilio.Events.V1.SubscribedEventPage>r   rD   r   r   r   rE      rF   zSubscribedEventPage.__repr__)rG   rH   rI   rJ   r   rO   rE   rL   r   r   r   r   r%      s
    r%   c                       sF   e Zd ZdZ fddZdd ZejfddZdd	 Z	d
d Z
  ZS )r=   r	   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the SubscribedEventContext

        :param Version version: Version that contains the resource
        :param subscription_sid: Subscription SID.
        :param type: Type of event being subscribed to.

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventContext
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventContext
        r;   z9/Subscriptions/{subscription_sid}/SubscribedEvents/{type}Nr   )r   r=   r   r   r   r   )r   r   r
   r6   r   r   r   r      s   zSubscribedEventContext.__init__c                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the SubscribedEventInstance

        :returns: The fetched SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        r    r!   r"   r
   r6   r;   )r   fetchr   r5   r   rN   r   r   r   rR      s   zSubscribedEventContext.fetchc                 C   s@   t d|i}| jjd| j|d}t| j|| jd | jd dS )$  
        Update the SubscribedEventInstance

        :param unicode schema_version: The schema version that the subscription should use.

        :returns: The updated SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        r0   r1   r2   r
   r6   r;   )r   r$   r   updater   r5   r   )r   r7   r(   r8   r   r   r   rT      s   	zSubscribedEventContext.updatec                 C   s   | j jd| jdS )
        Deletes the SubscribedEventInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETErQ   )r   deleter   rD   r   r   r   rW     s   zSubscribedEventContext.deletec                 C   $   d dd | j D }d|S )rC    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>$      z2SubscribedEventContext.__repr__.<locals>.<genexpr>z,<Twilio.Events.V1.SubscribedEventContext {}>joinr   itemsr   r   contextr   r   r   rE        
zSubscribedEventContext.__repr__)rG   rH   rI   rJ   r   rR   r   rK   rT   rW   rE   rL   r   r   r   r   r=      s    	r=   c                       s   e Zd ZdZd fdd	Zedd Zedd Zed	d
 Zedd Z	edd Z
edd Zdd ZejfddZdd Zdd Z  ZS )r5   r	   Nc                    sf   t t| | |d|dt|d|d|dd| _d| _||p-| jd d| _dS )	z
        Initialize the SubscribedEventInstance

        :returns: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventInstance
        account_sidr6   r7   r
   url)ri   r6   r7   r
   rj   Nr;   )	r   r5   r   r?   r   integer_properties_contextr   )r   r   r8   r
   r6   r   r   r   r   ,  s   	z SubscribedEventInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )aU  
        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
        :rtype: twilio.rest.events.v1.subscription.subscribed_event.SubscribedEventContext
        Nr
   r6   r;   )rm   r=   r   r   rD   r   r   r   _proxyB  s   
	zSubscribedEventInstance._proxyc                 C   
   | j d S )z@
        :returns: Account SID.
        :rtype: unicode
        ri   rl   rD   r   r   r   ri   S     
z#SubscribedEventInstance.account_sidc                 C   ro   )zV
        :returns: Type of event being subscribed to.
        :rtype: unicode
        r6   rp   rD   r   r   r   r6   [  rq   zSubscribedEventInstance.typec                 C   ro   )zh
        :returns: The schema version that the subscription should use.
        :rtype: unicode
        r7   rp   rD   r   r   r   r7   c  rq   z&SubscribedEventInstance.schema_versionc                 C   ro   )zE
        :returns: Subscription SID.
        :rtype: unicode
        r
   rp   rD   r   r   r   r
   k  rq   z(SubscribedEventInstance.subscription_sidc                 C   ro   )zM
        :returns: The URL of this resource.
        :rtype: unicode
        rj   rp   rD   r   r   r   rj   s  rq   zSubscribedEventInstance.urlc                 C   
   | j  S )rP   )rn   rR   rD   r   r   r   rR   {     
zSubscribedEventInstance.fetchc                 C   s   | j j|dS )rS   )r7   )rn   rT   )r   r7   r   r   r   rT     s   	zSubscribedEventInstance.updatec                 C   rr   )rU   )rn   rW   rD   r   r   r   rW     rs   zSubscribedEventInstance.deletec                 C   rX   )rC   rY   c                 s   rZ   r[   r\   r]   r   r   r   ra     rb   z3SubscribedEventInstance.__repr__.<locals>.<genexpr>z-<Twilio.Events.V1.SubscribedEventInstance {}>rc   rf   r   r   r   rE     rh   z SubscribedEventInstance.__repr__)N)rG   rH   rI   rJ   r   propertyrn   ri   r6   r7   r
   rj   rR   r   rK   rT   rW   rE   rL   r   r   r   r   r5   (  s&    





		r5   N)rJ   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r%   r=   r5   r   r   r   r   <module>   s    -M