o
    e%                     @   s   d 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G dd deZdS )za
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
    )values)InstanceContext)InstanceResource)ListResource)Pagec                       s8   e Zd ZdZ fddZdd Zdd Zdd	 Z  ZS )
UserListk PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. c                    s   t t| | i | _dS )z
        Initialize the UserList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.frontline_api.v1.user.UserList
        :rtype: twilio.rest.frontline_api.v1.user.UserList
        N)superr   __init__	_solution)selfversion	__class__ T/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/frontline_api/v1/user.pyr
      s   	
zUserList.__init__c                 C      t | j|dS z
        Constructs a UserContext

        :param sid: The SID of the User resource to fetch

        :returns: twilio.rest.frontline_api.v1.user.UserContext
        :rtype: twilio.rest.frontline_api.v1.user.UserContext
        sidUserContext_versionr   r   r   r   r   get"      	zUserList.getc                 C   r   r   r   r   r   r   r   __call__-   r   zUserList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z!<Twilio.FrontlineApi.V1.UserList>r   r   r   r   r   __repr__8      zUserList.__repr__)	__name__
__module____qualname____doc__r
   r   r   r    __classcell__r   r   r   r   r      s    r   c                       s0   e Zd ZdZ fddZdd Zdd Z  ZS )UserPager   c                    s   t t| || || _dS )a  
        Initialize the UserPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.frontline_api.v1.user.UserPage
        :rtype: twilio.rest.frontline_api.v1.user.UserPage
        N)r	   r'   r
   r   )r   r   responsesolutionr   r   r   r
   F   s   

zUserPage.__init__c                 C   s   t | j|S )z
        Build an instance of UserInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.frontline_api.v1.user.UserInstance
        :rtype: twilio.rest.frontline_api.v1.user.UserInstance
        )UserInstancer   r   payloadr   r   r   get_instanceU   s   	zUserPage.get_instancec                 C   r   )r   z!<Twilio.FrontlineApi.V1.UserPage>r   r   r   r   r   r    `   r!   zUserPage.__repr__)r"   r#   r$   r%   r
   r-   r    r&   r   r   r   r   r'   B   s
    r'   c                       sJ   e Zd ZdZ fddZdd ZejejejejfddZdd	 Z	  Z
S )
r   r   c                    s2   t t| | d|i| _djdi | j| _dS )a)  
        Initialize the UserContext

        :param Version version: Version that contains the resource
        :param sid: The SID of the User resource to fetch

        :returns: twilio.rest.frontline_api.v1.user.UserContext
        :rtype: twilio.rest.frontline_api.v1.user.UserContext
        r   z/Users/{sid}Nr   )r	   r   r
   r   format_uri)r   r   r   r   r   r   r
   n   s   

zUserContext.__init__c                 C   s(   | j jd| jd}t| j || jd dS )
        Fetch the UserInstance

        :returns: The fetched UserInstance
        :rtype: twilio.rest.frontline_api.v1.user.UserInstance
        GET)methodurir   r   )r   fetchr/   r*   r   r+   r   r   r   r4   ~   s   zUserContext.fetchc                 C   s>   t ||||d}| jjd| j|d}t| j|| jd dS )  
        Update the UserInstance

        :param unicode friendly_name: The string that you assigned to describe the User
        :param unicode avatar: The avatar URL which will be shown in Frontline application
        :param UserInstance.StateType state: Current state of this user
        :param bool is_available: Whether the User is available for new conversations

        :returns: The updated UserInstance
        :rtype: twilio.rest.frontline_api.v1.user.UserInstance
        )FriendlyNameAvatarStateIsAvailablePOST)r2   r3   datar   r   )r   ofr   updater/   r*   r   )r   friendly_nameavatarstateis_availabler;   r,   r   r   r   r=      s   zUserContext.updatec                 C   $   d dd | j D }d|S )r    c                 s        | ]\}}d  ||V  qdS z{}={}Nr.   .0kvr   r   r   	<genexpr>       z'UserContext.__repr__.<locals>.<genexpr>z'<Twilio.FrontlineApi.V1.UserContext {}>joinr   itemsr.   r   contextr   r   r   r          
zUserContext.__repr__)r"   r#   r$   r%   r
   r4   r   unsetr=   r    r&   r   r   r   r   r   j   s    
r   c                       s   e Zd ZdZG dd deZd fdd	Zedd Zed	d
 Z	edd Z
edd Zedd Zedd Zedd Zedd Zdd ZejejejejfddZdd Z  ZS )r*   r   c                   @   s   e Zd ZdZdZdS )zUserInstance.StateTypeactivedeactivatedN)r"   r#   r$   ACTIVEDEACTIVATEDr   r   r   r   	StateType   s    rX   Nc              	      sn   t t| | |d|d|d|d|d|d|dd| _d	| _d|p2| jd i| _d	S )
z
        Initialize the UserInstance

        :returns: twilio.rest.frontline_api.v1.user.UserInstance
        :rtype: twilio.rest.frontline_api.v1.user.UserInstance
        r   identityr>   r?   r@   rA   url)r   rY   r>   r?   r@   rA   rZ   N)r	   r*   r
   r   _properties_contextr   )r   r   r,   r   r   r   r   r
      s   zUserInstance.__init__c                 C   s&   | j du rt| j| jd d| _ | j S )a"  
        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
        :rtype: twilio.rest.frontline_api.v1.user.UserContext
        Nr   r   )r\   r   r   r   r   r   r   r   _proxy   s   
	zUserInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        r   r[   r   r   r   r   r         
zUserInstance.sidc                 C   r^   )zb
        :returns: The string that identifies the resource's User
        :rtype: unicode
        rY   r_   r   r   r   r   rY      r`   zUserInstance.identityc                 C   r^   )ze
        :returns: The string that you assigned to describe the User
        :rtype: unicode
        r>   r_   r   r   r   r   r>      r`   zUserInstance.friendly_namec                 C   r^   )zo
        :returns: The avatar URL which will be shown in Frontline application
        :rtype: unicode
        r?   r_   r   r   r   r   r?      r`   zUserInstance.avatarc                 C   r^   )z]
        :returns: Current state of this user
        :rtype: UserInstance.StateType
        r@   r_   r   r   r   r   r@      r`   zUserInstance.statec                 C   r^   )zd
        :returns: Whether the User is available for new conversations
        :rtype: bool
        rA   r_   r   r   r   r   rA     r`   zUserInstance.is_availablec                 C   r^   )zR
        :returns: An absolute URL for this user.
        :rtype: unicode
        rZ   r_   r   r   r   r   rZ   	  r`   zUserInstance.urlc                 C   s
   | j  S )r0   )r]   r4   r   r   r   r   r4     s   
zUserInstance.fetchc                 C   s   | j j||||dS )r5   )r>   r?   r@   rA   )r]   r=   )r   r>   r?   r@   rA   r   r   r   r=     s   zUserInstance.updatec                 C   rB   )r   rC   c                 s   rD   rE   rF   rG   r   r   r   rK   5  rL   z(UserInstance.__repr__.<locals>.<genexpr>z(<Twilio.FrontlineApi.V1.UserInstance {}>rM   rP   r   r   r   r    .  rR   zUserInstance.__repr__)N)r"   r#   r$   r%   objectrX   r
   propertyr]   r   rY   r>   r?   r@   rA   rZ   r4   r   rS   r=   r    r&   r   r   r   r   r*      s2    







	
r*   N)r%   twilio.baser   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r'   r   r*   r   r   r   r   <module>   s   2(B