o
    O`A                     @   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
 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)	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       sx   e Zd ZdZ fddZej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dd Zdd Zdd Z  ZS )WebhookListk 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 WebhookList

        :param Version version: Version that contains the resource
        :param service_sid: Service Sid.

        :returns: twilio.rest.verify.v2.service.webhook.WebhookList
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookList
        service_sidz /Services/{service_sid}/WebhooksN )superr	   __init__	_solutionformat_uri)selfversionr   	__class__r   i/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/twilio/rest/verify/v2/service/webhook.pyr      s   

zWebhookList.__init__c                 C   sJ   t |t|dd ||d}| jjd| j|d}t| j|| jd dS )a  
        Create the WebhookInstance

        :param unicode friendly_name: The string that you assigned to describe the webhook
        :param list[unicode] event_types: The array of events that this Webhook is subscribed to.
        :param unicode webhook_url: The URL associated with this Webhook.
        :param WebhookInstance.Status status: The webhook status

        :returns: The created WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookInstance
        c                 S      | S Nr   er   r   r   <lambda>4       z$WebhookList.create.<locals>.<lambda>FriendlyName
EventTypes
WebhookUrlStatusPOSTmethoduridatar   r   )	r   ofr   map_versioncreater   WebhookInstancer   r   friendly_nameevent_typeswebhook_urlstatusr&   payloadr   r   r   r+   &   s   zWebhookList.createNc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams WebhookInstance 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.verify.v2.service.webhook.WebhookInstance]
        	page_size)r3   limit)r*   read_limitspagestream)r   r4   r3   limitsr6   r   r   r   r7   =   s   zWebhookList.streamc                 C   s   t | j||dS )aa  
        Lists WebhookInstance 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.verify.v2.service.webhook.WebhookInstance]
        )r4   r3   )listr7   )r   r4   r3   r   r   r   r9   T   s   zWebhookList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of WebhookInstance 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 WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookPage
        )	PageTokenr   PageSizeGET)r$   r%   params)r   r(   r*   r6   r   WebhookPager   )r   
page_tokenpage_numberr3   r&   responser   r   r   r6   f   s   zWebhookList.pagec                 C   s"   | j jjd|}t| j || jS )a9  
        Retrieve a specific page of WebhookInstance records from the API.
        Request is executed immediately

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

        :returns: Page of WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookPage
        r<   )r*   domaintwiliorequestr>   r   )r   
target_urlrA   r   r   r   get_pagey   s
   

zWebhookList.get_pagec                 C      t | j| jd |dS a  
        Constructs a WebhookContext

        :param sid: The unique string that identifies the resource to fetch

        :returns: twilio.rest.verify.v2.service.webhook.WebhookContext
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookContext
        r   r   sidWebhookContextr*   r   r   rJ   r   r   r   get      	zWebhookList.getc                 C   rG   rH   rK   rM   r   r   r   __call__   rO   zWebhookList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z<Twilio.Verify.V2.WebhookList>r   r   r   r   r   __repr__      zWebhookList.__repr__)NN)__name__
__module____qualname____doc__r   r   unsetr+   r7   r9   r6   rF   rN   rP   rT   __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 )aX  
        Initialize the WebhookPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API
        :param service_sid: Service Sid.

        :returns: twilio.rest.verify.v2.service.webhook.WebhookPage
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookPage
        N)r   r>   r   r   )r   r   rA   solutionr   r   r   r      s   
zWebhookPage.__init__c                 C   s   t | j|| jd dS )a  
        Build an instance of WebhookInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.verify.v2.service.webhook.WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookInstance
        r   r'   )r,   r*   r   r   r2   r   r   r   get_instance   rO   zWebhookPage.get_instancec                 C   rQ   )rR   z<Twilio.Verify.V2.WebhookPage>r   rS   r   r   r   rT      rU   zWebhookPage.__repr__)rV   rW   rX   rY   r   r^   rT   r[   r   r   r   r   r>      s
    r>   c                       sR   e Zd ZdZ fddZejejejejfddZdd Zdd	 Z	d
d Z
  ZS )rL   r
   c                    s4   t t| | ||d| _djdi | j| _dS )au  
        Initialize the WebhookContext

        :param Version version: Version that contains the resource
        :param service_sid: Service Sid.
        :param sid: The unique string that identifies the resource to fetch

        :returns: twilio.rest.verify.v2.service.webhook.WebhookContext
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookContext
        rI   z&/Services/{service_sid}/Webhooks/{sid}Nr   )r   rL   r   r   r   r   )r   r   r   rJ   r   r   r   r      s   zWebhookContext.__init__c                 C   sR   t |t|dd ||d}| jjd| j|d}t| j|| jd | jd dS )	  
        Update the WebhookInstance

        :param unicode friendly_name: The string that you assigned to describe the webhook
        :param list[unicode] event_types: The array of events that this Webhook is subscribed to.
        :param unicode webhook_url: The URL associated with this Webhook.
        :param WebhookInstance.Status status: The webhook status

        :returns: The updated WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookInstance
        c                 S   r   r   r   r   r   r   r   r      r   z'WebhookContext.update.<locals>.<lambda>r   r"   r#   r   rJ   rI   )	r   r(   r   r)   r*   updater   r,   r   r-   r   r   r   r`      s   zWebhookContext.updatec                 C   s   | j jd| jdS )~
        Deletes the WebhookInstance

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        DELETEr$   r%   )r*   deleter   rS   r   r   r   rd     s   zWebhookContext.deletec                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the WebhookInstance

        :returns: The fetched WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookInstance
        r<   rc   r   rJ   rI   )r*   fetchr   r,   r   r]   r   r   r   rf     s   zWebhookContext.fetchc                 C   $   d dd | j D }d|S )rR    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr   r   r   	<genexpr>%      z*WebhookContext.__repr__.<locals>.<genexpr>z$<Twilio.Verify.V2.WebhookContext {}>joinr   itemsr   r   contextr   r   r   rT        
zWebhookContext.__repr__)rV   rW   rX   rY   r   r   rZ   r`   rd   rf   rT   r[   r   r   r   r   rL      s    
	rL   c                       s  e Zd ZdZG dd deZG dd de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edd Zedd Zedd Zedd Zedd Zedd  Zejejejejfd!d"Zd#d$ Zd%d& Zd'd( Z  ZS )*r,   r
   c                   @      e Zd ZdZdZdS )zWebhookInstance.StatusenableddisabledN)rV   rW   rX   ENABLEDDISABLEDr   r   r   r   r!   -      r!   c                   @   rx   )zWebhookInstance.Methodsr<   r"   N)rV   rW   rX   r<   r"   r   r   r   r   Methods1  r}   r~   Nc                    s   t t| | |d|d|d|d|d|d|d|dt|d	t|d
|dd| _d| _||pH| jd d| _dS )z
        Initialize the WebhookInstance

        :returns: twilio.rest.verify.v2.service.webhook.WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookInstance
        rJ   r   account_sidr.   r/   r1   r0   webhook_methoddate_createddate_updatedurl)rJ   r   r   r.   r/   r1   r0   r   r   r   r   NrI   )	r   r,   r   rN   r   iso8601_datetime_properties_contextr   )r   r   r2   r   rJ   r   r   r   r   5  s   zWebhookInstance.__init__c                 C   s.   | j du rt| j| jd | jd d| _ | j S )a/  
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: WebhookContext for this WebhookInstance
        :rtype: twilio.rest.verify.v2.service.webhook.WebhookContext
        Nr   rJ   rI   )r   rL   r*   r   rS   r   r   r   _proxyQ  s   
	zWebhookInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rJ   r   rS   r   r   r   rJ   b     
zWebhookInstance.sidc                 C   r   )z@
        :returns: Service Sid.
        :rtype: unicode
        r   r   rS   r   r   r   r   j  r   zWebhookInstance.service_sidc                 C   r   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        r   r   rS   r   r   r   r   r  r   zWebhookInstance.account_sidc                 C   r   )zh
        :returns: The string that you assigned to describe the webhook
        :rtype: unicode
        r.   r   rS   r   r   r   r.   z  r   zWebhookInstance.friendly_namec                 C   r   )zq
        :returns: The array of events that this Webhook is subscribed to.
        :rtype: list[unicode]
        r/   r   rS   r   r   r   r/     r   zWebhookInstance.event_typesc                 C   r   )zU
        :returns: The webhook status
        :rtype: WebhookInstance.Status
        r1   r   rS   r   r   r   r1     r   zWebhookInstance.statusc                 C   r   )zY
        :returns: The URL associated with this Webhook.
        :rtype: unicode
        r0   r   rS   r   r   r   r0     r   zWebhookInstance.webhook_urlc                 C   r   )zs
        :returns: The method used when calling the webhook's URL.
        :rtype: WebhookInstance.Methods
        r   r   rS   r   r   r   r     r   zWebhookInstance.webhook_methodc                 C   r   )zt
        :returns: The RFC 2822 date and time in GMT when the resource was created
        :rtype: datetime
        r   r   rS   r   r   r   r     r   zWebhookInstance.date_createdc                 C   r   )zy
        :returns: The RFC 2822 date and time in GMT when the resource was last updated
        :rtype: datetime
        r   r   rS   r   r   r   r     r   zWebhookInstance.date_updatedc                 C   r   )z\
        :returns: The absolute URL of the Webhook resource
        :rtype: unicode
        r   r   rS   r   r   r   r     r   zWebhookInstance.urlc                 C   s   | j j||||dS )r_   )r.   r/   r0   r1   )r   r`   )r   r.   r/   r0   r1   r   r   r   r`     s   zWebhookInstance.updatec                 C   
   | j  S )ra   )r   rd   rS   r   r   r   rd        
zWebhookInstance.deletec                 C   r   )re   )r   rf   rS   r   r   r   rf     r   zWebhookInstance.fetchc                 C   rg   )rR   rh   c                 s   ri   rj   rk   rl   r   r   r   rp     rq   z+WebhookInstance.__repr__.<locals>.<genexpr>z%<Twilio.Verify.V2.WebhookInstance {}>rr   ru   r   r   r   rT     rw   zWebhookInstance.__repr__r   )rV   rW   rX   rY   objectr!   r~   r   propertyr   rJ   r   r   r.   r/   r1   r0   r   r   r   r   r   rZ   r`   rd   rf   rT   r[   r   r   r   r   r,   )  sF    












		r,   N)rY   twilio.baser   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r	   r>   rL   r,   r   r   r   r   <module>   s    )V