o
    f>h-                     @   s   d Z ddlmZ ddlmZ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 - Flex
    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.
    )datetime)AnyDictListOptionalUnion)deserializevalues)InstanceContext)InstanceResource)ListResource)Versionc                
       s   e Zd ZdZ		ddedeeef dee 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fdeeef deeef deeef d	d fddZejejejfdeeef deeef deeef d	d fddZd	efddZ  ZS )FlexUserInstancea  
    :ivar account_sid: The unique SID of the account that created the resource.
    :ivar instance_sid: The unique ID created by Twilio to identify a Flex instance.
    :ivar user_sid: The unique SID identifier of the Twilio Unified User.
    :ivar flex_user_sid: The unique SID identifier of the Flex User.
    :ivar worker_sid: The unique SID identifier of the worker.
    :ivar workspace_sid: The unique SID identifier of the workspace.
    :ivar flex_team_sid: The unique SID identifier of the Flex Team.
    :ivar username: Username of the User.
    :ivar email: Email of the User.
    :ivar locale: The locale preference of the user.
    :ivar roles: The roles of the user.
    :ivar created_date: The date that this user was created, given in ISO 8601 format.
    :ivar updated_date: The date that this user was updated, given in ISO 8601 format.
    :ivar version: The current version of the user.
    :ivar url:
    Nversionpayloadinstance_sidflex_user_sidc                    s   t  | |d| _|d| _|d| _|d| _|d| _|d| _|d| _	|d| _
|d	| _|d
| _|d| _t|d| _t|d| _t|d| _|d| _|pm| j|pq| jd| _d | _d S )Naccount_sidr   user_sidr   
worker_sidworkspace_sidflex_team_sidusernameemaillocalerolescreated_dateupdated_dater   urlr   r   )super__init__getr   r   r   r   r   r   r   r   r   r   r   r   iso8601_datetimer   r   integerr   r   	_solution_context)selfr   r   r   r   	__class__ T/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/flex_api/v2/flex_user.pyr!   +   s0   
zFlexUserInstance.__init__returnFlexUserContextc                 C   s.   | j du rt| j| jd | 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: FlexUserContext for this FlexUserInstance
        Nr   r   r   )r&   r-   _versionr%   r'   r*   r*   r+   _proxyN   s   
zFlexUserInstance._proxyc                 C   s
   | j  S )]
        Fetch the FlexUserInstance


        :returns: The fetched FlexUserInstance
        )r0   fetchr/   r*   r*   r+   r2   ^   s   
zFlexUserInstance.fetchc                    s   | j  I dH S )w
        Asynchronous coroutine to fetch the FlexUserInstance


        :returns: The fetched FlexUserInstance
        N)r0   fetch_asyncr/   r*   r*   r+   r4   g   s   zFlexUserInstance.fetch_asyncr   r   r   c                 C   s   | j j|||dS )  
        Update the FlexUserInstance

        :param email: Email of the User.
        :param user_sid: The unique SID identifier of the Twilio Unified User.
        :param locale: The locale preference of the user.

        :returns: The updated FlexUserInstance
        r   r   r   )r0   updater'   r   r   r   r*   r*   r+   r7   p   s
   zFlexUserInstance.updatec                    s   | j j|||dI dH S )*  
        Asynchronous coroutine to update the FlexUserInstance

        :param email: Email of the User.
        :param user_sid: The unique SID identifier of the Twilio Unified User.
        :param locale: The locale preference of the user.

        :returns: The updated FlexUserInstance
        r6   N)r0   update_asyncr8   r*   r*   r+   r:      s   zFlexUserInstance.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,FlexUserInstance.__repr__.<locals>.<genexpr>z'<Twilio.FlexApi.V2.FlexUserInstance {}>joinr%   itemsrA   r'   contextr*   r*   r+   __repr__      
zFlexUserInstance.__repr__)NN)r,   r-   )r,   r   )__name__
__module____qualname____doc__r   r   strr   r   r!   propertyr0   r2   r4   r	   unsetr   objectr7   r:   rM   __classcell__r*   r*   r(   r+   r      sT    
#

	







r   c                	       s   e Zd Zde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
fdeeef deeef deeef defddZe	j
e	j
e	j
fdeeef deeef deeef defddZdefddZ  ZS )r-   r   r   r   c                    s0   t  | ||d| _djdi | j| _dS )a  
        Initialize the FlexUserContext

        :param version: Version that contains the resource
        :param instance_sid: The unique ID created by Twilio to identify a Flex instance.
        :param flex_user_sid: The unique id for the flex user.
        r   z//Instances/{instance_sid}/Users/{flex_user_sid}Nr*   )r    r!   r%   rA   _uri)r'   r   r   r   r(   r*   r+   r!      s   zFlexUserContext.__init__r,   c                 C   sD   t i }d|d< | jjd| j|d}t| j|| jd | jd dS )r1   application/jsonAcceptGETmethoduriheadersr   r   r   )r	   ofr.   r2   rX   r   r%   r'   r_   r   r*   r*   r+   r2      s   
zFlexUserContext.fetchc                    sL   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r3   rY   rZ   r[   r\   Nr   r   r   )r	   r`   r.   r4   rX   r   r%   ra   r*   r*   r+   r4      s   
zFlexUserContext.fetch_asyncr   r   r   c                 C   s`   t |||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )r5   EmailUserSidLocale!application/x-www-form-urlencodedContent-TyperY   rZ   POSTr]   r^   datar_   r   r   r   )r	   r`   r.   r7   rX   r   r%   r'   r   r   r   rj   r_   r   r*   r*   r+   r7      s$   

zFlexUserContext.updatec                    sh   t |||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )r9   rb   rf   rg   rY   rZ   rh   ri   Nr   r   r   )r	   r`   r.   r:   rX   r   r%   rk   r*   r*   r+   r:     s&   

zFlexUserContext.update_asyncc                 C   r;   )r<   r=   c                 s   r>   r?   r@   rB   r*   r*   r+   rF   ;  rG   z+FlexUserContext.__repr__.<locals>.<genexpr>z&<Twilio.FlexApi.V2.FlexUserContext {}>rH   rK   r*   r*   r+   rM   5  rN   zFlexUserContext.__repr__)rO   rP   rQ   r   rS   r!   r   r2   r4   r	   rU   r   rV   r7   r:   rM   rW   r*   r*   r(   r+   r-      s:    



*



(r-   c                       s\   e Zd Zdef fddZdededefddZdededefd	d
ZdefddZ	  Z
S )FlexUserListr   c                    s   t  | dS )zj
        Initialize the FlexUserList

        :param version: Version that contains the resource

        N)r    r!   )r'   r   r(   r*   r+   r!   A  s   zFlexUserList.__init__r   r   r,   c                 C      t | j||dS z
        Constructs a FlexUserContext

        :param instance_sid: The unique ID created by Twilio to identify a Flex instance.
        :param flex_user_sid: The unique id for the flex user.
        r   r-   r.   r'   r   r   r*   r*   r+   r"   J     zFlexUserList.getc                 C   rm   rn   ro   rp   r*   r*   r+   __call__U  rq   zFlexUserList.__call__c                 C   s   dS )r<   z <Twilio.FlexApi.V2.FlexUserList>r*   r/   r*   r*   r+   rM   `  s   zFlexUserList.__repr__)rO   rP   rQ   r   r!   rS   r-   r"   rr   rM   rW   r*   r*   r(   r+   rl   ?  s
    	rl   N)rR   r   typingr   r   r   r   r   twilio.baser   r	   twilio.base.instance_contextr
   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   r   r-   rl   r*   r*   r*   r+   <module>   s      