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
      /       /
    )	serialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s4   e Zd Z fddZdd Zdd Zdd Z  ZS )	WebhookListc                    s   t t| | i | _dS )a  
        Initialize the WebhookList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookList
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookList
        N)superr   __init__	_solutionselfversion	__class__ e/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/configuration/webhook.pyr
      s   	
zWebhookList.__init__c                 C   
   t | jS z
        Constructs a WebhookContext

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookContext
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookContext
        WebhookContext_versionr   r   r   r   get!      
zWebhookList.getc                 C   r   r   r   r   r   r   r   __call__*   r   zWebhookList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z%<Twilio.Conversations.V1.WebhookList>r   r   r   r   r   __repr__3      zWebhookList.__repr__)__name__
__module____qualname__r
   r   r   r   __classcell__r   r   r   r   r      s
    		r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )WebhookPagec                    s   t t| || || _dS )aI  
        Initialize the WebhookPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookPage
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookPage
        N)r	   r$   r
   r   )r   r   responsesolutionr   r   r   r
   ?   s   

zWebhookPage.__init__c                 C   s   t | j|S )a  
        Build an instance of WebhookInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        )WebhookInstancer   r   payloadr   r   r   get_instanceN   s   	zWebhookPage.get_instancec                 C   r   )r   z%<Twilio.Conversations.V1.WebhookPage>r   r   r   r   r   r   Y   r   zWebhookPage.__repr__)r    r!   r"   r
   r*   r   r#   r   r   r   r   r$   =   s    r$   c                       sJ   e Zd Z fddZdd ZejejejejejfddZdd Z  Z	S )	r   c                    s.   t t| | i | _djdi | j| _dS )a  
        Initialize the WebhookContext

        :param Version version: Version that contains the resource

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookContext
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookContext
        z/Configuration/WebhooksNr   )r	   r   r
   r   format_urir   r   r   r   r
   e   s   	zWebhookContext.__init__c                 C   s   | j jd| jd}t| j |S )
        Fetch the WebhookInstance

        :returns: The fetched WebhookInstance
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        GET)methoduri)r   fetchr,   r'   r(   r   r   r   r1   t   s   zWebhookContext.fetchc                 C   sB   t |t|dd |||d}| jjd| j|d}t| j|S )  
        Update the WebhookInstance

        :param unicode method: The HTTP method to be used when sending a webhook request.
        :param list[unicode] filters: The list of webhook event triggers that are enabled for this Service.
        :param unicode pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
        :param unicode post_webhook_url: The absolute url the post-event webhook request should be sent to.
        :param WebhookInstance.Target target: The routing target of the webhook.

        :returns: The updated WebhookInstance
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        c                 S   s   | S )Nr   )er   r   r   <lambda>   s    z'WebhookContext.update.<locals>.<lambda>)MethodFiltersPreWebhookUrlPostWebhookUrlTargetPOST)r/   r0   data)r   ofr   mapr   updater,   r'   )r   r/   filterspre_webhook_urlpost_webhook_urltargetr;   r)   r   r   r   r>      s   zWebhookContext.updatec                 C   $   d dd | j D }d|S )r    c                 s        | ]\}}d  ||V  qdS z{}={}Nr+   .0kvr   r   r   	<genexpr>       z*WebhookContext.__repr__.<locals>.<genexpr>z+<Twilio.Conversations.V1.WebhookContext {}>joinr   itemsr+   r   contextr   r   r   r         
zWebhookContext.__repr__)
r    r!   r"   r
   r1   r   unsetr>   r   r#   r   r   r   r   r   c   s    
r   c                       s   e Zd ZG dd deZG dd deZ 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dd ZejejejejejfddZdd Z  ZS )r'   c                   @      e Zd ZdZdZdS )zWebhookInstance.TargetwebhookflexN)r    r!   r"   WEBHOOKFLEXr   r   r   r   r9          r9   c                   @   rU   )zWebhookInstance.Methodr.   r:   N)r    r!   r"   r.   r:   r   r   r   r   r5      rZ   r5   c              	      s`   t t| | |d|d|d|d|d|d|dd| _d	| _i | _d	S )
z
        Initialize the WebhookInstance

        :returns: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        :rtype: twilio.rest.conversations.v1.configuration.webhook.WebhookInstance
        account_sidr/   r?   r@   rA   rB   url)r[   r/   r?   r@   rA   rB   r\   N)r	   r'   r
   r   _properties_contextr   )r   r   r)   r   r   r   r
      s   
zWebhookInstance.__init__c                 C   s   | j du rt| j| _ | 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.conversations.v1.configuration.webhook.WebhookContext
        N)r^   r   r   r   r   r   r   _proxy   s   
	zWebhookInstance._proxyc                 C   
   | j d S )zs
        :returns: The unique ID of the Account responsible for this conversation.
        :rtype: unicode
        r[   r]   r   r   r   r   r[         
zWebhookInstance.account_sidc                 C   r`   )z}
        :returns: The HTTP method to be used when sending a webhook request.
        :rtype: WebhookInstance.Method
        r/   ra   r   r   r   r   r/      rb   zWebhookInstance.methodc                 C   r`   )z
        :returns: The list of webhook event triggers that are enabled for this Service.
        :rtype: list[unicode]
        r?   ra   r   r   r   r   r?      rb   zWebhookInstance.filtersc                 C   r`   )zu
        :returns: The absolute url the pre-event webhook request should be sent to.
        :rtype: unicode
        r@   ra   r   r   r   r   r@      rb   zWebhookInstance.pre_webhook_urlc                 C   r`   )zv
        :returns: The absolute url the post-event webhook request should be sent to.
        :rtype: unicode
        rA   ra   r   r   r   r   rA      rb   z WebhookInstance.post_webhook_urlc                 C   r`   )ze
        :returns: The routing target of the webhook.
        :rtype: WebhookInstance.Target
        rB   ra   r   r   r   r   rB      rb   zWebhookInstance.targetc                 C   r`   )zU
        :returns: An absolute URL for this webhook.
        :rtype: unicode
        r\   ra   r   r   r   r   r\     rb   zWebhookInstance.urlc                 C   s
   | j  S )r-   )r_   r1   r   r   r   r   r1     r   zWebhookInstance.fetchc                 C   s   | j j|||||dS )r2   )r/   r?   r@   rA   rB   )r_   r>   )r   r/   r?   r@   rA   rB   r   r   r   r>     s   zWebhookInstance.updatec                 C   rC   )r   rD   c                 s   rE   rF   rG   rH   r   r   r   rL   3  rM   z+WebhookInstance.__repr__.<locals>.<genexpr>z,<Twilio.Conversations.V1.WebhookInstance {}>rN   rQ   r   r   r   r   ,  rS   zWebhookInstance.__repr__)r    r!   r"   objectr9   r5   r
   propertyr_   r[   r/   r?   r@   rA   rB   r\   r1   r   rT   r>   r   r#   r   r   r   r   r'      s4    







	
r'   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r$   r   r'   r   r   r   r   <module>   s   ,&B