o
    /iF*                     @   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dedeeef de	e f fddZ
edddZdddZdddZejejejejfdeeef deeef dedef deeef d	d f
ddZejejejejfdeeef dee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 )UserInstancec                   @   s   e Zd ZdZdZdS )UserInstance.StateTypeactivedeactivatedN)__name__
__module____qualname__ACTIVEDEACTIVATED r   r   \/var/www/html/philips/venv/lib/python3.10/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|p5| 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__returnUserContextc                 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   r1   Q   s   zUserInstance.fetch_asyncr   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   r4   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
        r3   N)r-   update_asyncr5   r   r   r   r7   r   s   zUserInstance.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(UserInstance.__repr__.<locals>.<genexpr>z(<Twilio.FrontlineApi.V1.UserInstance {}>joinr#   itemsr>   r%   contextr   r   r   __repr__      
zUserInstance.__repr__)N)r(   r)   )r(   r   )r   r   r   objectr   r
   r   strr   r   r!   propertyr-   r/   r1   r   unsetr   boolr4   r7   rJ   __classcell__r   r   r&   r   r      s\    


	









r   c                       s   e Zd Zdedef fddZdefddZdefdd	Ze	j
e	j
e	j
e	j
fd
eeef deeef dedef deeef def
ddZe	j
e	j
e	j
e	j
fd
eeef dee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   c                    s.   t  | d|i| _djd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}Nr   )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/   rR   r   r#   r%   r   r   r   r   r/      s   zUserContext.fetchc                    s0   | j jd| jdI dH }t| j || jd dS )r0   rS   rT   Nr   r*   )r+   r1   rR   r   r#   rW   r   r   r   r1      s   zUserContext.fetch_asyncr   r   r   r   r   c                 C   s>   t ||||d}| jjd| j|d}t| j|| jd dS )r2   FriendlyNameAvatarStateIsAvailablePOSTrU   rV   datar   r*   )r   ofr+   r4   rR   r   r#   r%   r   r   r   r   r_   r   r   r   r   r4      s   	zUserContext.updatec                    sF   t ||||d}| jjd| j|dI dH }t| j|| jd dS )r6   rX   r]   r^   Nr   r*   )r   r`   r+   r7   rR   r   r#   ra   r   r   r   r7      s   	zUserContext.update_asyncc                 C   r8   )r9   r:   c                 s   r;   r<   r=   r?   r   r   r   rC     rD   z'UserContext.__repr__.<locals>.<genexpr>z'<Twilio.FrontlineApi.V1.UserContext {}>rE   rH   r   r   r   rJ     rK   zUserContext.__repr__)r   r   r   r
   rM   r!   r   r/   r1   r   rO   r   rL   rP   r4   r7   rJ   rQ   r   r   r&   r   r)      sF    




$




"r)   c                       sT   e Zd Zdef fddZdedefddZdedefdd	Zdefd
dZ	  Z
S )UserListr   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      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"   "     zUserList.getc                 C   rc   rd   re   rf   r   r   r   __call__*  rg   zUserList.__call__c                 C   s   dS )r9   z!<Twilio.FrontlineApi.V1.UserList>r   r,   r   r   r   rJ   2  s   zUserList.__repr__)r   r   r   r
   r!   rM   r)   r"   rh   rJ   rQ   r   r   r&   r   rb     s
    	rb   N)__doc__typingr   r   r   r   twilio.baser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer	   twilio.base.versionr
   r   r)   rb   r   r   r   r   <module>   s    | 