U
    ^g%i-                     @   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eeeef ee 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feeef eeef eeef d dddZejejejfeeef eeef eeef d dddZed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| _|p| j|p| 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   Ziso8601_datetimer   r   integerr   r   	_solution_context)selfr   r   r   r   	__class__ `/var/www/html/api-medvista/venv/lib/python3.8/site-packages/twilio/rest/flex_api/v2/flex_user.pyr!   +   s0    zFlexUserInstance.__init__FlexUserContextreturnc                 C   s.   | j dk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_asyncr   r   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*   r8   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
        r7   N)r0   update_asyncr9   r)   r)   r*   r;      s
    zFlexUserInstance.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>   s     z,FlexUserInstance.__repr__.<locals>.<genexpr>z'<Twilio.FlexApi.V2.FlexUserInstance {}>joinr$   itemsr@   r&   contextr)   r)   r*   __repr__   s    zFlexUserInstance.__repr__)NN)__name__
__module____qualname____doc__r   r   strr   r   r!   propertyr0   r2   r4   r	   unsetr   objectr8   r;   rK   __classcell__r)   r)   r'   r*   r      s@     
#	





r   c                       s   e Zd Zeeed fddZedddZedddZe	j
e	j
e	j
feeef eeef eeef ed	d
dZe	j
e	j
e	j
feeef eeef eeef ed	ddZedddZ  ZS )r+   )r   r   r   c                    s,   t  | ||d| _djf | 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}N)r    r!   r$   r@   _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   rU   r   r$   r&   r\   r   r)   r)   r*   r2      s    
zFlexUserContext.fetchc                    sJ   t i }d|d< | jjd| j|dI dH }t| j|| jd | jd dS )	r3   rV   rW   rX   rY   Nr   r   r   )r	   r]   r.   r4   rU   r   r$   r^   r)   r)   r*   r4      s    
  zFlexUserContext.fetch_asyncr5   c                 C   s`   t |||d}t i }d|d< d|d< | jjd| j||d}t| j|| jd | jd	 d
S )r6   ZEmailZUserSidZLocale!application/x-www-form-urlencodedContent-TyperV   rW   POSTrZ   r[   datar\   r   r   r   )r	   r]   r.   r8   rU   r   r$   r&   r   r   r   rd   r\   r   r)   r)   r*   r8      s*    
   zFlexUserContext.updatec                    sf   t |||d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 | jd
 dS )r:   r_   r`   ra   rV   rW   rb   rc   Nr   r   r   )r	   r]   r.   r;   rU   r   r$   re   r)   r)   r*   r;     s*    
   zFlexUserContext.update_asyncc                 C   s$   d dd | j D }d|S )r<   r=   c                 s   s   | ]\}}d  ||V  qdS r>   r?   rA   r)   r)   r*   rE   ;  s     z+FlexUserContext.__repr__.<locals>.<genexpr>z&<Twilio.FlexApi.V2.FlexUserContext {}>rF   rI   r)   r)   r*   rK   5  s    zFlexUserContext.__repr__)rL   rM   rN   r   rP   r!   r   r2   r4   r	   rR   r   rS   r8   r;   rK   rT   r)   r)   r'   r*   r+      s,   


*


(r+   c                       sT   e Zd Zed fddZeeedddZeeedddZed	d
dZ	  Z
S )FlexUserList)r   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   s   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  s
      zFlexUserList.getc                 C   s   t | j||dS rg   rh   ri   r)   r)   r*   __call__U  s
      zFlexUserList.__call__r,   c                 C   s   dS )r<   z <Twilio.FlexApi.V2.FlexUserList>r)   r/   r)   r)   r*   rK   `  s    zFlexUserList.__repr__)rL   rM   rN   r   r!   rP   r+   r"   rj   rK   rT   r)   r)   r'   r*   rf   ?  s   	rf   N)rO   r   typingr   r   r   r   r   Ztwilio.baser   r	   Ztwilio.base.instance_contextr
   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   r   r+   rf   r)   r)   r)   r*   <module>   s     