a
    !fF*                     @   s   d Z ddlmZmZmZmZ ddl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)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.StateTypeactiveZdeactivatedN)__name__
__module____qualname__ZACTIVEZDEACTIVATED r   r   b/var/www/html/python-backend/venv/lib/python3.9/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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: 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>       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   rG   __classcell__r   r   r#   r   r      s@    	







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 i | 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(   | j jd| jd}t| j || jd dS )r,   GETmethodurir   r(   )r)   r-   rN   r   r    r"   r   r   r   r   r-      s    zUserContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r.   rO   rP   Nr   r(   )r)   r/   rN   r   r    rS   r   r   r   r/      s    zUserContext.fetch_asyncr   r0   c                 C   s>   t ||||d}| jjd| j|d}t| j|| jd dS )r1   ZFriendlyNameZAvatarStateZIsAvailablePOSTrQ   rR   datar   r(   )r   ofr)   r3   rN   r   r    r"   r   r   r   r   rX   r   r   r   r   r3      s    	zUserContext.updatec                    sD   t ||||d}| jjd| j|dI dH }t| j|| jd dS )r5   rT   rV   rW   Nr   r(   )r   rY   r)   r6   rN   r   r    rZ   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@     rA   z'UserContext.__repr__.<locals>.<genexpr>z'<Twilio.FrontlineApi.V1.UserContext {}>rB   rE   r   r   r   rG     s    zUserContext.__repr__)r   r   r   r
   rI   r   r   r-   r/   r   rK   r   rH   rL   r3   r6   rG   rM   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   "  s    zUserList.getc                 C   s   t | j|dS r\   r]   r^   r   r   r   __call__*  s    zUserList.__call__r&   c                 C   s   dS )r7   z!<Twilio.FrontlineApi.V1.UserList>r   r*   r   r   r   rG   2  s    zUserList.__repr__)r   r   r   r
   r   rI   r%   r   r_   rG   rM   r   r   r#   r   r[     s   	r[   N)__doc__typingr   r   r   r   Ztwilio.baser   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   | 