U
    ^g%i/                     @   s   d Z ddlm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 - Chat
    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.
    )datetime)AnyDictOptionalUnion)deserializevalues)InstanceContext)InstanceResource)ListResource)Versionc                       s   e Zd ZG dd deZG dd deZdeeee	f e
e e
e d fddZed	d
ddZejejejfedef edef eeef d dddZejejejfedef edef eeef d dddZed
ddZ  ZS )ChannelInstancec                   @   s   e Zd ZdZdZdS )ChannelInstance.ChannelTypepublicprivateN)__name__
__module____qualname__ZPUBLICZPRIVATE r   r   Z/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/chat/v3/channel.pyChannelType   s   r   c                   @   s   e Zd ZdZdZdS )"ChannelInstance.WebhookEnabledTypetruefalseN)r   r   r   TRUEFALSEr   r   r   r   WebhookEnabledType   s   r   N)versionpayloadservice_sidsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	t
|d| _t
|d	| _|d
| _t
|d| _t
|d| _|d| _|d| _|p| j|p| jd| _d | _d S )Nr    account_sidr   friendly_nameunique_name
attributestypedate_createddate_updated
created_bymembers_countmessages_countmessaging_service_sidurlr   r    )super__init__getr    r!   r   r"   r#   r$   r%   r   Ziso8601_datetimer&   r'   r(   integerr)   r*   r+   r,   	_solution_context)selfr   r   r   r    	__class__r   r   r/   3   s6    zChannelInstance.__init__ChannelContextreturnc                 C   s.   | j dkr(t| j| jd | 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: ChannelContext for this ChannelInstance
        Nr   r    r-   )r3   r7   _versionr2   r4   r   r   r   _proxyY   s    
zChannelInstance._proxyr   r   x_twilio_webhook_enabledr%   r+   r9   c                 C   s   | j j|||dS )o  
        Update the ChannelInstance

        :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header
        :param type:
        :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to.

        :returns: The updated ChannelInstance
        r>   r%   r+   )r<   updater4   r>   r%   r+   r   r   r   rA   i   s
    zChannelInstance.updatec                    s   | j j|||dI dH S )  
        Asynchronous coroutine to update the ChannelInstance

        :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header
        :param type:
        :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to.

        :returns: The updated ChannelInstance
        r@   N)r<   update_asyncrB   r   r   r   rD      s
    zChannelInstance.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     z+ChannelInstance.__repr__.<locals>.<genexpr>z#<Twilio.Chat.V3.ChannelInstance {}>joinr2   itemsrI   r4   contextr   r   r   __repr__   s    zChannelInstance.__repr__)NN)r   r   r   objectr   r   r   r   strr   r   r/   propertyr<   r   unsetr   rA   rD   rT   __classcell__r   r   r5   r   r      sF     
&



r   c                       s   e Zd Zeeed fddZejejejfede	f ede	f eee	f e
dddZejejejfede	f ede	f eee	f e
dd	d
ZedddZ  ZS )r7   )r   r   r    c                    s,   t  | ||d| _djf | j| _dS )a  
        Initialize the ChannelContext

        :param version: Version that contains the resource
        :param service_sid: The unique SID identifier of the Service.
        :param sid: A 34 character string that uniquely identifies this Channel.
        r-   z&/Services/{service_sid}/Channels/{sid}N)r.   r/   r2   rI   _uri)r4   r   r   r    r5   r   r   r/      s
    zChannelContext.__init__r   r   r=   c                 C   s~   t ||d}t i }|t jks:t|tr2|r:||d< d|d< d|d< | jjd| j||d}t| j|| j	d	 | j	d
 dS )r?   TypeZMessagingServiceSidX-Twilio-Webhook-Enabled!application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethoduridataheadersr   r    r-   )
r   ofrX   
isinstancerV   r:   rA   rZ   r   r2   r4   r>   r%   r+   rf   rg   r   r   r   r   rA      s6    
   zChannelContext.updatec                    s   t ||d}t i }|t jks:t|tr2|r:||d< d|d< d|d< | jjd| j||dI d	H }t| j|| j	d
 | j	d dS )rC   r[   r]   r^   r_   r`   ra   rb   rc   Nr   r    r-   )
r   rh   rX   ri   rV   r:   rD   rZ   r   r2   rj   r   r   r   rD      s6    
   zChannelContext.update_asyncr8   c                 C   s$   d dd | j D }d|S )rE   rF   c                 s   s   | ]\}}d  ||V  qdS rG   rH   rJ   r   r   r   rN     s     z*ChannelContext.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V3.ChannelContext {}>rO   rR   r   r   r   rT     s    zChannelContext.__repr__)r   r   r   r   rV   r/   r   rX   r   rU   r   rA   rD   rT   rY   r   r   r5   r   r7      s0   

6

2r7   c                       sT   e Zd Zed fddZeeedddZeeedddZed	d
dZ	  Z
S )ChannelList)r   c                    s   t  | dS )zi
        Initialize the ChannelList

        :param version: Version that contains the resource

        N)r.   r/   )r4   r   r5   r   r   r/   $  s    zChannelList.__init__)r   r    r9   c                 C   s   t | j||dS z
        Constructs a ChannelContext

        :param service_sid: The unique SID identifier of the Service.
        :param sid: A 34 character string that uniquely identifies this Channel.
        r-   r7   r:   r4   r   r    r   r   r   r0   -  s    zChannelList.getc                 C   s   t | j||dS rl   rm   rn   r   r   r   __call__6  s    zChannelList.__call__r8   c                 C   s   dS )rE   z<Twilio.Chat.V3.ChannelList>r   r;   r   r   r   rT   ?  s    zChannelList.__repr__)r   r   r   r   r/   rV   r7   r0   ro   rT   rY   r   r   r5   r   rk   "  s   			rk   N)__doc__r   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   r7   rk   r   r   r   r   <module>   s    
 