o
    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	 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
      /       /
    )deserialize)values)InstanceContext)InstanceResource)ListResource)Pagec                       s   e Zd Z fddZejejejejfddZdddZddd	Zejejejfd
dZ	dd Z
dd Zdd Zdd Z  ZS )UserListc                    s2   t t| | d|i| _djdi | j| _dS )a`  
        Initialize the UserList

        :param Version version: Version that contains the resource
        :param chat_service_sid: The SID of the Conversation Service that the resource is associated with

        :returns: twilio.rest.conversations.v1.service.user.UserList
        :rtype: twilio.rest.conversations.v1.service.user.UserList
        chat_service_sidz"/Services/{chat_service_sid}/UsersN )superr   __init__	_solutionformat_uri)selfversionr	   	__class__r
   m/var/www/html/asistente-voz-ia/venv/lib/python3.10/site-packages/twilio/rest/conversations/v1/service/user.pyr      s   

zUserList.__init__c           	      C   sN   t ||||d}t d|i}| jjd| j||d}t| j|| jd dS )az  
        Create the UserInstance

        :param unicode identity: The string that identifies the resource's User
        :param unicode friendly_name: The string that you assigned to describe the resource
        :param unicode attributes: The JSON Object string that stores application-specific data
        :param unicode role_sid: The SID of a service-level Role to assign to the user
        :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header

        :returns: The created UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserInstance
        )IdentityFriendlyName
AttributesRoleSidX-Twilio-Webhook-EnabledPOSTmethoduridataheadersr	   r	   )r   of_versioncreater   UserInstancer   )	r   identityfriendly_name
attributesrole_sidx_twilio_webhook_enabledr   r   payloadr
   r
   r   r#   #   s   zUserList.createNc                 C   s0   | j ||}| j|d d}| j ||d S )a  
        Streams UserInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, stream() will attempt to read the
                              limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.conversations.v1.service.user.UserInstance]
        	page_size)r+   limit)r"   read_limitspagestream)r   r,   r+   limitsr.   r
   r
   r   r/   =   s   zUserList.streamc                 C   s   t | j||dS )a_  
        Lists UserInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, list() will attempt to read the limit
                              with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.conversations.v1.service.user.UserInstance]
        )r,   r+   )listr/   )r   r,   r+   r
   r
   r   r1   T   s   zUserList.listc                 C   s6   t |||d}| jjd| j|d}t| j|| jS )a  
        Retrieve a single page of UserInstance records from the API.
        Request is executed immediately

        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserPage
        )	PageTokenr   PageSizeGET)r   r   params)r   r!   r"   r.   r   UserPager   )r   
page_tokenpage_numberr+   r   responser
   r
   r   r.   f   s   zUserList.pagec                 C   s"   | j jjd|}t| j || jS )a4  
        Retrieve a specific page of UserInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserPage
        r4   )r"   domaintwiliorequestr6   r   )r   
target_urlr9   r
   r
   r   get_pagey   s
   

zUserList.get_pagec                 C      t | j| jd |dS z
        Constructs a UserContext

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

        :returns: twilio.rest.conversations.v1.service.user.UserContext
        :rtype: twilio.rest.conversations.v1.service.user.UserContext
        r	   r	   sidUserContextr"   r   r   rB   r
   r
   r   get      	zUserList.getc                 C   r?   r@   rC   rE   r
   r
   r   __call__   rG   zUserList.__call__c                 C      dS )z
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        z"<Twilio.Conversations.V1.UserList>r
   r   r
   r
   r   __repr__      zUserList.__repr__)NN)__name__
__module____qualname__r   r   unsetr#   r/   r1   r.   r>   rF   rH   rL   __classcell__r
   r
   r   r   r      s    



r   c                       s,   e Zd Z fddZdd Zdd Z  ZS )r6   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
        :param chat_service_sid: The SID of the Conversation Service that the resource is associated with

        :returns: twilio.rest.conversations.v1.service.user.UserPage
        :rtype: twilio.rest.conversations.v1.service.user.UserPage
        N)r   r6   r   r   )r   r   r9   solutionr   r
   r   r      s   
zUserPage.__init__c                 C   s   t | j|| jd dS )a   
        Build an instance of UserInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.conversations.v1.service.user.UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserInstance
        r	   r    )r$   r"   r   r   r*   r
   r
   r   get_instance   rG   zUserPage.get_instancec                 C   rI   )rJ   z"<Twilio.Conversations.V1.UserPage>r
   rK   r
   r
   r   rL      rM   zUserPage.__repr__)rN   rO   rP   r   rU   rL   rR   r
   r
   r   r   r6      s    r6   c                       sT   e Zd Z fddZejejejejfddZejfddZdd Zd	d
 Z	  Z
S )rD   c                    s4   t t| | ||d| _djdi | j| _dS )a  
        Initialize the UserContext

        :param Version version: Version that contains the resource
        :param chat_service_sid: The SID of the Conversation Service to fetch the resource from
        :param sid: The SID of the User resource to fetch

        :returns: twilio.rest.conversations.v1.service.user.UserContext
        :rtype: twilio.rest.conversations.v1.service.user.UserContext
        rA   z(/Services/{chat_service_sid}/Users/{sid}Nr
   )r   rD   r   r   r   r   )r   r   r	   rB   r   r
   r   r      s   zUserContext.__init__c                 C   sT   t |||d}t d|i}| jjd| j||d}t| j|| jd | jd dS )*  
        Update the UserInstance

        :param unicode friendly_name: The string that you assigned to describe the resource
        :param unicode attributes: The JSON Object string that stores application-specific data
        :param unicode role_sid: The SID of a service-level Role to assign to the user
        :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header

        :returns: The updated UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserInstance
        )r   r   r   r   r   r   r	   rB   rA   )r   r!   r"   updater   r$   r   )r   r&   r'   r(   r)   r   r   r*   r
   r
   r   rW      s   zUserContext.updatec                 C   s"   t d|i}| jjd| j|dS )
        Deletes the UserInstance

        :param UserInstance.WebhookEnabledType x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header

        :returns: True if delete succeeds, False otherwise
        :rtype: bool
        r   DELETE)r   r   r   )r   r!   r"   deleter   )r   r)   r   r
   r
   r   rZ      s   	zUserContext.deletec                 C   s0   | j jd| jd}t| j || jd | jd dS )
        Fetch the UserInstance

        :returns: The fetched UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserInstance
        r4   )r   r   r	   rB   rA   )r"   fetchr   r$   r   rT   r
   r
   r   r\   
  s   zUserContext.fetchc                 C   $   d dd | j D }d|S )rJ    c                 s        | ]\}}d  ||V  qdS z{}={}Nr   .0kvr
   r
   r   	<genexpr>!      z'UserContext.__repr__.<locals>.<genexpr>z(<Twilio.Conversations.V1.UserContext {}>joinr   itemsr   r   contextr
   r
   r   rL        
zUserContext.__repr__)rN   rO   rP   r   r   rQ   rW   rZ   r\   rL   rR   r
   r
   r   r   rD      s    
rD   c                       s  e 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edd Zedd Zedd Zedd Zedd Zejejejejfd d!Zejfd"d#Zd$d% Zd&d' Z  ZS ))r$   c                   @   s   e Zd ZdZdZdS )zUserInstance.WebhookEnabledTypetruefalseN)rN   rO   rP   TRUEFALSEr
   r
   r
   r   WebhookEnabledType'  s    rr   Nc                    s   t t| | |d|d|d|d|d|d|d|d|d	t|d
t|d|dd| _d| _||pL| jd d| _dS )z
        Initialize the UserInstance

        :returns: twilio.rest.conversations.v1.service.user.UserInstance
        :rtype: twilio.rest.conversations.v1.service.user.UserInstance
        rB   account_sidr	   r(   r%   r&   r'   	is_onlineis_notifiabledate_createddate_updatedurl)rB   rs   r	   r(   r%   r&   r'   rt   ru   rv   rw   rx   NrA   )	r   r$   r   rF   r   iso8601_datetime_properties_contextr   )r   r   r*   r	   rB   r   r
   r   r   +  s    zUserInstance.__init__c                 C   s.   | j du rt| j| jd | 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.conversations.v1.service.user.UserContext
        Nr	   rB   rA   )r{   rD   r"   r   rK   r
   r
   r   _proxyH  s   
	zUserInstance._proxyc                 C   
   | j d S )zb
        :returns: The unique string that identifies the resource
        :rtype: unicode
        rB   rz   rK   r
   r
   r   rB   Y     
zUserInstance.sidc                 C   r}   )zd
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        rs   r~   rK   r
   r
   r   rs   a  r   zUserInstance.account_sidc                 C   r}   )z|
        :returns: The SID of the Conversation Service that the resource is associated with
        :rtype: unicode
        r	   r~   rK   r
   r
   r   r	   i  r   zUserInstance.chat_service_sidc                 C   r}   )zh
        :returns: The SID of a service-level Role assigned to the user
        :rtype: unicode
        r(   r~   rK   r
   r
   r   r(   q  r   zUserInstance.role_sidc                 C   r}   )zb
        :returns: The string that identifies the resource's User
        :rtype: unicode
        r%   r~   rK   r
   r
   r   r%   y  r   zUserInstance.identityc                 C   r}   )zi
        :returns: The string that you assigned to describe the resource
        :rtype: unicode
        r&   r~   rK   r
   r
   r   r&     r   zUserInstance.friendly_namec                 C   r}   )zp
        :returns: The JSON Object string that stores application-specific data
        :rtype: unicode
        r'   r~   rK   r
   r
   r   r'     r   zUserInstance.attributesc                 C   r}   )z
        :returns: Whether the User is actively connected to this Conversations Service and online
        :rtype: bool
        rt   r~   rK   r
   r
   r   rt     r   zUserInstance.is_onlinec                 C   r}   )z
        :returns: Whether the User has a potentially valid Push Notification registration for this Conversations Service
        :rtype: bool
        ru   r~   rK   r
   r
   r   ru     r   zUserInstance.is_notifiablec                 C   r}   )zt
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        rv   r~   rK   r
   r
   r   rv     r   zUserInstance.date_createdc                 C   r}   )zy
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        rw   r~   rK   r
   r
   r   rw     r   zUserInstance.date_updatedc                 C   r}   )zR
        :returns: An absolute URL for this user.
        :rtype: unicode
        rx   r~   rK   r
   r
   r   rx     r   zUserInstance.urlc                 C   s   | j j||||dS )rV   )r&   r'   r(   r)   )r|   rW   )r   r&   r'   r(   r)   r
   r
   r   rW     s   zUserInstance.updatec                 C   s   | j j|dS )rX   )r)   )r|   rZ   )r   r)   r
   r
   r   rZ     s   	zUserInstance.deletec                 C   s
   | j  S )r[   )r|   r\   rK   r
   r
   r   r\     s   
zUserInstance.fetchc                 C   r]   )rJ   r^   c                 s   r_   r`   ra   rb   r
   r
   r   rf     rg   z(UserInstance.__repr__.<locals>.<genexpr>z)<Twilio.Conversations.V1.UserInstance {}>rh   rk   r
   r
   r   rL     rm   zUserInstance.__repr__)N)rN   rO   rP   objectrr   r   propertyr|   rB   rs   r	   r(   r%   r&   r'   rt   ru   rv   rw   rx   r   rQ   rW   rZ   r\   rL   rR   r
   r
   r   r   r$   %  sF    













	r$   N)__doc__twilio.baser   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.pager   r   r6   rD   r$   r
   r
   r
   r   <module>   s    'T