o
    f>hc                     @   s   d Z ddl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 G dd	 d	eZG d
d de
ZG dd deZdS )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.
    )AnyDictOptionalUnion)	serializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s&  e Zd ZdZdedeeef def fddZe	d"d	d
Z
d#ddZd#ddZejejejejejejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef dd fddZejejejejejejejejejejejejejfdeeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef dd fddZdefd d!Z  ZS )$NotificationInstancea  
    :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration.
    :ivar chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to.
    :ivar new_message: The Push Notification configuration for New Messages.
    :ivar added_to_conversation: The Push Notification configuration for being added to a Conversation.
    :ivar removed_from_conversation: The Push Notification configuration for being removed from a Conversation.
    :ivar log_enabled: Weather the notification logging is enabled.
    :ivar url: An absolute API resource URL for this configuration.
    versionpayloadchat_service_sidc                    st   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d|i| _
d | _d S )Naccount_sidr   new_messageadded_to_conversationremoved_from_conversationlog_enabledurl)super__init__getr   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__ r/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/service/configuration/notification.pyr   "   s   
zNotificationInstance.__init__returnNotificationContextc                 C   s&   | j du rt| j| jd 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: NotificationContext for this NotificationInstance
        Nr   r   )r   r!   _versionr   r   r   r   r   _proxy8   s   
zNotificationInstance._proxyc                 C   s
   | j  S )e
        Fetch the NotificationInstance


        :returns: The fetched NotificationInstance
        )r%   fetchr$   r   r   r   r'   G   s   
zNotificationInstance.fetchc                    s   | j  I dH S )
        Asynchronous coroutine to fetch the NotificationInstance


        :returns: The fetched NotificationInstance
        N)r%   fetch_asyncr$   r   r   r   r)   P   s   z NotificationInstance.fetch_asyncr   new_message_enablednew_message_templatenew_message_soundnew_message_badge_count_enabledadded_to_conversation_enabledadded_to_conversation_templateadded_to_conversation_sound!removed_from_conversation_enabled"removed_from_conversation_templateremoved_from_conversation_soundnew_message_with_media_enablednew_message_with_media_templatec                 C   s&   | j j|||||||||	|
|||dS )  
        Update the NotificationInstance

        :param log_enabled: Weather the notification logging is enabled.
        :param new_message_enabled: Whether to send a notification when a new message is added to a conversation. The default is `false`.
        :param new_message_template: The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`.
        :param new_message_sound: The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`.
        :param new_message_badge_count_enabled: Whether the new message badge is enabled. The default is `false`.
        :param added_to_conversation_enabled: Whether to send a notification when a participant is added to a conversation. The default is `false`.
        :param added_to_conversation_template: The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`.
        :param added_to_conversation_sound: The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`.
        :param removed_from_conversation_enabled: Whether to send a notification to a user when they are removed from a conversation. The default is `false`.
        :param removed_from_conversation_template: The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`.
        :param removed_from_conversation_sound: The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`.
        :param new_message_with_media_enabled: Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`.
        :param new_message_with_media_template: The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`.

        :returns: The updated NotificationInstance
        r   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   )r%   updater   r   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r   r   r   r8   Y   s   #zNotificationInstance.updatec                    s.   | j j|||||||||	|
|||dI dH S )  
        Asynchronous coroutine to update the NotificationInstance

        :param log_enabled: Weather the notification logging is enabled.
        :param new_message_enabled: Whether to send a notification when a new message is added to a conversation. The default is `false`.
        :param new_message_template: The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`.
        :param new_message_sound: The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`.
        :param new_message_badge_count_enabled: Whether the new message badge is enabled. The default is `false`.
        :param added_to_conversation_enabled: Whether to send a notification when a participant is added to a conversation. The default is `false`.
        :param added_to_conversation_template: The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`.
        :param added_to_conversation_sound: The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`.
        :param removed_from_conversation_enabled: Whether to send a notification to a user when they are removed from a conversation. The default is `false`.
        :param removed_from_conversation_template: The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`.
        :param removed_from_conversation_sound: The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`.
        :param new_message_with_media_enabled: Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`.
        :param new_message_with_media_template: The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`.

        :returns: The updated NotificationInstance
        r7   N)r%   update_asyncr9   r   r   r   r;      s    #z!NotificationInstance.update_asyncc                 C   $   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s        | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>       z0NotificationInstance.__repr__.<locals>.<genexpr>z1<Twilio.Conversations.V1.NotificationInstance {}>joinr   itemsrB   r   contextr   r   r   __repr__      
zNotificationInstance.__repr__)r    r!   )r    r   )__name__
__module____qualname____doc__r   r   strr   r   propertyr%   r'   r)   r   unsetr   boolobjectr8   r;   rN   __classcell__r   r   r   r   r      s    



	







	






5







	






3r   c                       s  e Zd Zdedef fddZdefddZdefdd	Ze	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
fd
eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef defddZe	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
e	j
fd
eeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef deeef defddZdefddZ  ZS )r!   r   r   c                    s.   t  | d|i| _djdi | j| _dS )a  
        Initialize the NotificationContext

        :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 Configuration applies to.
        r   z8/Services/{chat_service_sid}/Configuration/NotificationsNr   )r   r   r   rB   _urir   r   r   r   r   r   r      s   zNotificationContext.__init__r    c                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r&   application/jsonAcceptGETmethoduriheadersr   r"   )r   ofr#   r'   rZ   r   r   r   rb   r   r   r   r   r'      s   
zNotificationContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r(   r\   r]   r^   r_   Nr   r"   )r   rc   r#   r)   rZ   r   r   rd   r   r   r   r)      s   
zNotificationContext.fetch_asyncr   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   c                 C   s   t t|t|||t|t|||t|	|
|t||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r6   
LogEnabledzNewMessage.EnabledzNewMessage.TemplatezNewMessage.SoundzNewMessage.BadgeCountEnabledzAddedToConversation.EnabledzAddedToConversation.TemplatezAddedToConversation.SoundzRemovedFromConversation.Enabledz RemovedFromConversation.TemplatezRemovedFromConversation.SoundzNewMessage.WithMedia.EnabledzNewMessage.WithMedia.Template!application/x-www-form-urlencodedContent-Typer\   r]   POSTr`   ra   datarb   r   r"   )	r   rc   r   boolean_to_stringr#   r8   rZ   r   r   r   r   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   rk   rb   r   r   r   r   r8     sB   $

zNotificationContext.updatec                    s   t t|t|||t|t|||t|	|
|t||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r:   re   rg   rh   r\   r]   ri   rj   Nr   r"   )	r   rc   r   rl   r#   r;   rZ   r   r   rm   r   r   r   r;   Q  sD   $

z NotificationContext.update_asyncc                 C   r<   )r=   r>   c                 s   r?   r@   rA   rC   r   r   r   rG     rH   z/NotificationContext.__repr__.<locals>.<genexpr>z0<Twilio.Conversations.V1.NotificationContext {}>rI   rL   r   r   r   rN     rO   zNotificationContext.__repr__)rP   rQ   rR   r   rT   r   r   r'   r)   r   rV   r   rW   rX   r8   r;   rN   rY   r   r   r   r   r!      s    







	






M







	






Kr!   c                       sP   e Zd Zdedef fddZdefddZdefdd	Zdefd
dZ	  Z
S )NotificationListr   r   c                    s   t  | d|i| _dS )a  
        Initialize the NotificationList

        :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 Configuration applies to.

        r   N)r   r   r   r[   r   r   r   r     s   
zNotificationList.__init__r    c                 C      t | j| jd dS z3
        Constructs a NotificationContext

        r   r"   r!   r#   r   r$   r   r   r   r        zNotificationList.getc                 C   ro   rp   rq   r$   r   r   r   __call__  rr   zNotificationList.__call__c                 C   s   dS )r=   z*<Twilio.Conversations.V1.NotificationList>r   r$   r   r   r   rN     s   zNotificationList.__repr__)rP   rQ   rR   r   rT   r   r!   r   rs   rN   rY   r   r   r   r   rn     s
    		rn   N)rS   typingr   r   r   r   twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer	   twilio.base.list_resourcer
   twilio.base.versionr   r   r!   rn   r   r   r   r   <module>   s     3 ^