
    piA,                         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	e      Z G d
 de
      Z G d de      Zy)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                       e Zd Z G d de      Z	 	 ddedeeef   de	e   f fdZ
edd       Zdd	Z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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ZdefdZ xZS )UserInstancec                       e Zd ZdZdZy)UserInstance.StateTypeactivedeactivatedN)__name__
__module____qualname__ACTIVEDEACTIVATED     c/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/twilio/rest/frontline_api/v1/user.py	StateTyper      s    #r   r   versionpayloadsidc                    t         |   |       |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _        |j                  d      | _	        d|xs | j                  i| _
        d | _        y )Nr   identityfriendly_nameavatarstateis_availableurl)super__init__getr   r    r!   r"   r#   r$   r%   	_solution_context)selfr   r   r   	__class__s       r   r'   zUserInstance.__init__'   s     	!")++e"4'.{{:'>,3KK,H%,[[%:9@W9M
,3KK,G")++e"4 3?$((
 04r   returnc                     | j                   )t        | j                  | j                  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
        r   r   )r*   UserContext_versionr)   r+   s    r   _proxyzUserInstance._proxy9   s9     == 'NN5)DM }}r   c                 6    | j                   j                         S )U
        Fetch the UserInstance


        :returns: The fetched UserInstance
        )r3   fetchr2   s    r   r6   zUserInstance.fetchH   s     {{  ""r   c                 R   K   | j                   j                          d{   S 7 w)o
        Asynchronous coroutine to fetch the UserInstance


        :returns: The fetched UserInstance
        N)r3   fetch_asyncr2   s    r   r9   zUserInstance.fetch_asyncQ   s!      [[,,....s   '%'r!   r"   r#   r   r$   c                 @    | j                   j                  ||||      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$   )r3   updater+   r!   r"   r#   r$   s        r   r=   zUserInstance.updateZ   s,    " {{!!'%	 " 
 	
r   c                 \   K   | j                   j                  ||||       d{   S 7 w):  
        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
        r<   N)r3   update_asyncr>   s        r   rA   zUserInstance.update_asyncr   s:     " [[--'%	 . 
 
 	
 
s   #,*,c                     dj                  d | j                  j                         D              }dj                  |      S )f
        Provide a friendly representation

        :returns: Machine friendly representation
         c              3   F   K   | ]  \  }}d j                  ||        ywz{}={}Nformat.0kvs      r   	<genexpr>z(UserInstance.__repr__.<locals>.<genexpr>        SDAq7>>!Q/S   !z(<Twilio.FrontlineApi.V1.UserInstance {}>joinr)   itemsrH   r+   contexts     r   __repr__zUserInstance.__repr__   s6     ((SDNN<P<P<RSS9@@IIr   )N)r-   r0   )r-   r   )r   r   r   objectr   r   r   strr   r   r'   propertyr3   r6   r9   r   unsetr   boolr=   rA   rU   __classcell__r,   s   @r   r   r      sb   $F $ OS44)-c3h4>Fsm4$  #/ -3LL%+\\9?,2LL
S&[)
 c6k"
 -v56	

 D&L)
 

4 -3LL%+\\9?,2LL
S&[)
 c6k"
 -v56	

 D&L)
 

0J# Jr   r   c                       e Zd Zdedef fdZdefdZdef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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ZdefdZ xZS )r0   r   r   c                 x    t         |   |       d|i| _         dj                  di | j                  | _        y)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)   rH   _uri)r+   r   r   r,   s      r   r'   zUserContext.__init__   s?     	! 3
 *N));DNN;	r   r-   c                     t        j                  i       }d|d<   | j                  j                  d| j                  |      }t        | j                  || j                  d         S )r5   application/jsonAcceptGETmethoduriheadersr   r/   )r   ofr1   r6   r_   r   r)   r+   rg   r   s      r   r6   zUserContext.fetch   s]     ))B-.--%%U		7%SMMu%
 	
r   c                    K   t        j                  i       }d|d<   | j                  j                  d| j                  |       d{   }t        | j                  || j                  d         S 7 )w)r8   ra   rb   rc   rd   Nr   r/   )r   rh   r1   r9   r_   r   r)   ri   s      r   r9   zUserContext.fetch_async   sr      ))B-.11dii 2 
 
 MMu%
 	
	
s   AA4A2	*A4r!   r"   r#   r   r$   c                 6   t        j                  |||t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||      }t        | j                  || j                  d   	      S )
r;   FriendlyNameAvatarStateIsAvailable!application/x-www-form-urlencodedContent-Typera   rb   POSTre   rf   datarg   r   r/   )	r   rh   r   boolean_to_stringr1   r=   r_   r   r)   r+   r!   r"   r#   r$   ru   rg   r   s           r   r=   zUserContext.update   s    $ yy - (::<H	
 ))B-"E.--&&tyytW ' 
 DMM7u8MNNr   c                 R  K   t        j                  |||t        j                  |      d      }t        j                  i       }d|d<   d|d<   | j                  j                  d| j                  ||       d{   }t        | j                  || j                  d	   
      S 7 )w)r@   rl   rq   rr   ra   rb   rs   rt   Nr   r/   )	r   rh   r   rv   r1   rA   r_   r   r)   rw   s           r   rA   zUserContext.update_async   s     $ yy - (::<H	
 ))B-"E.22tyytW 3 
 
 DMM7u8MNN	
s   A9B';B%<*B'c                     dj                  d | j                  j                         D              }dj                  |      S )rC   rD   c              3   F   K   | ]  \  }}d j                  ||        ywrF   rG   rI   s      r   rM   z'UserContext.__repr__.<locals>.<genexpr>!  rN   rO   z'<Twilio.FrontlineApi.V1.UserContext {}>rP   rS   s     r   rU   zUserContext.__repr__  s6     ((SDNN<P<P<RSS8??HHr   )r   r   r   r   rW   r'   r   r6   r9   r   rY   r   rV   rZ   r=   rA   rU   r[   r\   s   @r   r0   r0      s<   < <c <
| 
(
< 
0 -3LL%+\\9?,2LL$OS&[)$O c6k"$O -v56	$O
 D&L)$O 
$OP -3LL%+\\9?,2LL$OS&[)$O c6k"$O -v56	$O
 D&L)$O 
$OLI# Ir   r0   c                   P     e Zd Zdef fdZdedefdZdedefdZdefdZ	 xZ
S )UserListr   c                 $    t         |   |       y)zf
        Initialize the UserList

        :param version: Version that contains the resource

        N)r&   r'   )r+   r   r,   s     r   r'   zUserList.__init__'  s     	!r   r   r-   c                 0    t        | j                  |      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/   r0   r1   r+   r   s     r   r(   zUserList.get0       4==c22r   c                 0    t        | j                  |      S r   r   r   s     r   __call__zUserList.__call__8  r   r   c                      y)rC   z!<Twilio.FrontlineApi.V1.UserList>r   r2   s    r   rU   zUserList.__repr__@  s     3r   )r   r   r   r   r'   rW   r0   r(   r   rU   r[   r\   s   @r   r|   r|   %  sA    " "3s 3{ 33C 3K 33# 3r   r|   N)__doc__typingr   r   r   r   twilio.baser   r   twilio.base.instance_contextr	   twilio.base.instance_resourcer
   twilio.base.list_resourcer   twilio.base.versionr   r   r0   r|   r   r   r   <module>r      sP    . - ) 8 : 2 'zJ# zJzNI/ NIb!3| !3r   