U
    ^g%ic                     @   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eeeef ed fddZe	ddddZ
d dd	d
Zd 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eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef d 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eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef d dddZed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__ ~/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/conversations/v1/service/configuration/notification.pyr   "   s      zNotificationInstance.__init__NotificationContextreturnc                 C   s&   | j dk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_asyncr   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_templater"   c                 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/   r0   r1   r2   r3   r4   r5   r6   r7   )r&   updater   r   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r   r   r   r:   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
        r9   N)r&   update_asyncr;   r   r   r   r=      s    #z!NotificationInstance.update_asyncc                 C   s$   d dd | j D }d|S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c                 s   s   | ]\}}d  ||V  qdS z{}={}Nformat.0kvr   r   r   	<genexpr>   s     z0NotificationInstance.__repr__.<locals>.<genexpr>z1<Twilio.Conversations.V1.NotificationInstance {}>joinr   itemsrB   r   contextr   r   r   __repr__   s    zNotificationInstance.__repr__)__name__
__module____qualname____doc__r   r   strr   r   propertyr&   r(   r*   r   unsetr   boolobjectr:   r=   rM   __classcell__r   r   r   r   r      s    
 	












5












3r   c                       s  e Zd Zeed fddZedddZe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eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef e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eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef eeef ed	ddZedddZ  ZS )r    r   r   c                    s*   t  | d|i| _djf | 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/NotificationsN)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(   rY   r   r   r   ra   r   r   r   r   r(      s    
zNotificationContext.fetchc                    sB   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   rb   r$   r*   rY   r   r   rc   r   r   r   r*      s    
  zNotificationContext.fetch_asyncr+   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 )
r8   Z
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_   r`   datara   r   r#   )	r   rb   r   boolean_to_stringr$   r:   rY   r   r   r   r   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   ri   ra   r   r   r   r   r:     sL    $
     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<   rd   re   rf   r[   r\   rg   rh   Nr   r#   )	r   rb   r   rj   r$   r=   rY   r   r   rk   r   r   r   r=   Q  sL    $
     z NotificationContext.update_asyncc                 C   s$   d dd | j D }d|S )r>   r?   c                 s   s   | ]\}}d  ||V  qdS r@   rA   rC   r   r   r   rG     s     z/NotificationContext.__repr__.<locals>.<genexpr>z0<Twilio.Conversations.V1.NotificationContext {}>rH   rK   r   r   r   rM     s    zNotificationContext.__repr__)rN   rO   rP   r   rR   r   r   r(   r*   r   rT   r   rU   rV   r:   r=   rM   rW   r   r   r   r   r       s|   












M












Kr    c                       sN   e Zd Zeed fddZedddZedddZedd	d
Z	  Z
S )NotificationListrX   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   rZ   r   r   r   r     s     zNotificationList.__init__r!   c                 C   s   t | j| jd dS z3
        Constructs a NotificationContext

        r   r#   r    r$   r   r%   r   r   r   r     s     zNotificationList.getc                 C   s   t | j| jd dS rm   rn   r%   r   r   r   __call__  s     zNotificationList.__call__c                 C   s   dS )r>   z*<Twilio.Conversations.V1.NotificationList>r   r%   r   r   r   rM     s    zNotificationList.__repr__)rN   rO   rP   r   rR   r   r    r   ro   rM   rW   r   r   r   r   rl     s   		rl   N)rQ   typingr   r   r   r   Ztwilio.baser   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer	   Ztwilio.base.list_resourcer
   Ztwilio.base.versionr   r   r    rl   r   r   r   r   <module>   s    3 ^