o
    f>h/                     @   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dedeee	f de
e d	e
e f fd
dZedddZejejejfdedef dedef deeef dd fddZejejejfdedef dedef deeef dd fddZdefddZ  ZS )ChannelInstancec                   @      e Zd ZdZdZdS )ChannelInstance.ChannelTypepublicprivateN)__name__
__module____qualname__PUBLICPRIVATE r   r   N/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/chat/v3/channel.pyChannelType       r   c                   @   r   )"ChannelInstance.WebhookEnabledTypetruefalseN)r   r   r   TRUEFALSEr   r   r   r   WebhookEnabledType   r   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| _|pj| j|pn| 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   iso8601_datetimer*   r+   r,   integerr-   r.   r/   r0   	_solution_context)selfr!   r"   r#   r$   	__class__r   r   r3   3   s6   
zChannelInstance.__init__returnChannelContextc                 C   s.   | j du 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$   r1   )r8   r=   _versionr7   r9   r   r   r   _proxyY   s   
zChannelInstance._proxyx_twilio_webhook_enabledr   r)   r   r/   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
        rA   r)   r/   )r@   updater9   rA   r)   r/   r   r   r   rD   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
        rC   N)r@   update_asyncrE   r   r   r   rG      s   zChannelInstance.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>       z+ChannelInstance.__repr__.<locals>.<genexpr>z#<Twilio.Chat.V3.ChannelInstance {}>joinr7   itemsrN   r9   contextr   r   r   __repr__      
zChannelInstance.__repr__)NN)r<   r=   )r   r   r   objectr   r    r   r   strr   r   r3   propertyr@   r   unsetr   rD   rG   rZ   __classcell__r   r   r:   r   r      s\    
&





r   c                	       s   e Zd Zdededef fddZejejejfdede	f ded	e	f d
eee	f de
fddZejejejfdede	f ded	e	f d
eee	f de
fddZdefddZ  ZS )r=   r!   r#   r$   c                    s0   t  | ||d| _djdi | 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.
        r1   z&/Services/{service_sid}/Channels/{sid}Nr   )r2   r3   r7   rN   _uri)r9   r!   r#   r$   r:   r   r   r3      s
   zChannelContext.__init__rA   r   r)   r   r/   r<   c                 C   s~   t ||d}t i }|t ju st|tr|r||d< d|d< d|d< | jjd| j||d}t| j|| j	d	 | j	d
 dS )rB   TypeMessagingServiceSidX-Twilio-Webhook-Enabled!application/x-www-form-urlencodedContent-Typeapplication/jsonAcceptPOSTmethoduridataheadersr#   r$   r1   )
r   ofr_   
isinstancer]   r>   rD   ra   r   r7   r9   rA   r)   r/   rn   ro   r"   r   r   r   rD      s.   


zChannelContext.updatec                    s   t ||d}t i }|t ju st|tr|r||d< d|d< d|d< | jjd| j||dI d	H }t| j|| j	d
 | j	d dS )rF   rb   re   rf   rg   rh   ri   rj   rk   Nr#   r$   r1   )
r   rp   r_   rq   r]   r>   rG   ra   r   r7   rr   r   r   r   rG      s0   


zChannelContext.update_asyncc                 C   rH   )rI   rJ   c                 s   rK   rL   rM   rO   r   r   r   rS     rT   z*ChannelContext.__repr__.<locals>.<genexpr>z"<Twilio.Chat.V3.ChannelContext {}>rU   rX   r   r   r   rZ     r[   zChannelContext.__repr__)r   r   r   r   r]   r3   r   r_   r   r\   r   rD   rG   rZ   r`   r   r   r:   r   r=      s>    


6


2r=   c                       s\   e Zd Zdef fddZdededefddZdededefd	d
ZdefddZ	  Z
S )ChannelListr!   c                    s   t  | dS )zi
        Initialize the ChannelList

        :param version: Version that contains the resource

        N)r2   r3   )r9   r!   r:   r   r   r3   $     zChannelList.__init__r#   r$   r<   c                 C      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.
        r1   r=   r>   r9   r#   r$   r   r   r   r4   -  rt   zChannelList.getc                 C   ru   rv   rw   rx   r   r   r   __call__6  rt   zChannelList.__call__c                 C   s   dS )rI   z<Twilio.Chat.V3.ChannelList>r   r?   r   r   r   rZ   ?  s   zChannelList.__repr__)r   r   r   r   r3   r]   r=   r4   ry   rZ   r`   r   r   r:   r   rs   "  s
    			rs   N)__doc__r   typingr   r   r   r   twilio.baser   r   twilio.base.instance_contextr	   twilio.base.instance_resourcer
   twilio.base.list_resourcer   twilio.base.versionr   r   r=   rs   r   r   r   r   <module>   s     
 