U
    ^g%iA,                     @   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 - Frontline
    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G dd deZdeeeef e	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feeef eeef edef eeef d dddZejejejejfeeef eeef edef eeef d dddZedddZ  ZS )UserInstancec                   @   s   e Zd ZdZdZdS )UserInstance.StateTypeZactiveZdeactivatedN)__name__
__module____qualname__ZACTIVEZDEACTIVATED r   r   `/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/frontline_api/v1/user.py	StateType   s   r   N)versionpayloadsidc                    sz   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	d|pj| ji| _
d | _d S )Nr   identityfriendly_nameavatarstateis_availableurl)super__init__getr   r   r   r   r   r   r   	_solution_context)selfr   r   r   	__class__r   r   r   '   s     zUserInstance.__init__UserContext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: UserContext for this UserInstance
        Nr   r   )r!   r%   _versionr    r"   r   r   r   _proxy9   s    
zUserInstance._proxyc                 C   s
   | j  S )U
        Fetch the UserInstance


        :returns: The fetched UserInstance
        )r+   fetchr*   r   r   r   r-   H   s    zUserInstance.fetchc                    s   | j  I dH S )o
        Asynchronous coroutine to fetch the UserInstance


        :returns: The fetched UserInstance
        N)r+   fetch_asyncr*   r   r   r   r/   Q   s    zUserInstance.fetch_asyncr   r   r   r   r   r'   c                 C   s   | j j||||dS )   
        Update the UserInstance

        :param friendly_name: The string that you assigned to describe the User.
        :param avatar: The avatar URL which will be shown in Frontline application.
        :param state:
        :param is_available: Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing).

        :returns: The updated UserInstance
        r   r   r   r   )r+   updater"   r   r   r   r   r   r   r   r3   Z   s    zUserInstance.updatec                    s   | j j||||dI dH S ):  
        Asynchronous coroutine to update the UserInstance

        :param friendly_name: The string that you assigned to describe the User.
        :param avatar: The avatar URL which will be shown in Frontline application.
        :param state:
        :param is_available: Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing).

        :returns: The updated UserInstance
        r2   N)r+   update_asyncr4   r   r   r   r6   r   s    zUserInstance.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(UserInstance.__repr__.<locals>.<genexpr>z(<Twilio.FrontlineApi.V1.UserInstance {}>joinr    itemsr;   r"   contextr   r   r   __repr__   s    zUserInstance.__repr__)N)r   r   r   objectr   r   r   strr   r   r   propertyr+   r-   r/   r   unsetr   boolr3   r6   rF   __classcell__r   r   r#   r   r      sD     
 	







r   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
feeef eeef ed	ef eeef ed
ddZe	j
e	j
e	j
e	j
feeef eeef ed	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 )z
        Initialize the UserContext

        :param version: Version that contains the resource
        :param sid: The SID of the User resource to update. This value can be either the `sid` or the `identity` of the User resource to update.
        r   z/Users/{sid}N)r   r   r    r;   _uri)r"   r   r   r#   r   r   r      s
     zUserContext.__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-   rM   r   r    r"   rT   r   r   r   r   r-      s    
zUserContext.fetchc                    sB   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r.   rN   rO   rP   rQ   Nr   r(   )r   rU   r)   r/   rM   r   r    rV   r   r   r   r/      s    
  zUserContext.fetch_asyncr   r0   c                 C   s`   t |||t|d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r1   ZFriendlyNameZAvatarStateZIsAvailable!application/x-www-form-urlencodedContent-TyperN   rO   POSTrR   rS   datarT   r   r(   )	r   rU   r   boolean_to_stringr)   r3   rM   r   r    r"   r   r   r   r   r]   rT   r   r   r   r   r3      s"    
   zUserContext.updatec                    sf   t |||t|d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r5   rW   rY   rZ   rN   rO   r[   r\   Nr   r(   )	r   rU   r   r^   r)   r6   rM   r   r    r_   r   r   r   r6      s"    
   zUserContext.update_asyncc                 C   s$   d dd | j D }d|S )r7   r8   c                 s   s   | ]\}}d  ||V  qdS r9   r:   r<   r   r   r   r@   !  s     z'UserContext.__repr__.<locals>.<genexpr>z'<Twilio.FrontlineApi.V1.UserContext {}>rA   rD   r   r   r   rF     s    zUserContext.__repr__)r   r   r   r   rH   r   r   r-   r/   r   rJ   r   rG   rK   r3   r6   rF   rL   r   r   r#   r   r%      s4   



(



&r%   c                       sP   e Zd Zed fddZeedddZeedddZed	d
dZ	  Z
S )UserList)r   c                    s   t  | dS )zf
        Initialize the UserList

        :param version: Version that contains the resource

        N)r   r   )r"   r   r#   r   r   r   '  s    zUserList.__init__)r   r'   c                 C   s   t | j|dS z
        Constructs a UserContext

        :param sid: The SID of the User resource to update. This value can be either the `sid` or the `identity` of the User resource to update.
        r(   r%   r)   r"   r   r   r   r   r   0  s    zUserList.getc                 C   s   t | j|dS ra   rb   rc   r   r   r   __call__8  s    zUserList.__call__r&   c                 C   s   dS )r7   z!<Twilio.FrontlineApi.V1.UserList>r   r*   r   r   r   rF   @  s    zUserList.__repr__)r   r   r   r   r   rH   r%   r   rd   rF   rL   r   r   r#   r   r`   %  s   	r`   N)__doc__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%   r`   r   r   r   r   <module>   s   } 