o
    f>hU                     @   s   d Z ddlmZ ddlmZmZmZmZmZmZm	Z	 ddl
mZmZ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 )a  
    This code was generated by
   ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
    |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
    |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \

    Twilio - Trusthub
    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IteratorAsyncIterator)deserialize	serializevalues)InstanceContext)InstanceResource)ListResource)Version)Pagec                       s   e Zd ZdZ	ddedeeef dee f fddZ	e
dd
dZdefddZdefddZdddZdddZejejfdeeef deeef dd fddZejej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 )EndUserInstancea  
    :ivar sid: The unique string created by Twilio to identify the End User resource.
    :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource.
    :ivar friendly_name: The string that you assigned to describe the resource.
    :ivar type: The type of end user of the Bundle resource - can be `individual` or `business`.
    :ivar attributes: The set of parameters that are the attributes of the End Users resource which are listed in the End User Types.
    :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    :ivar url: The absolute URL of the End User resource.
    Nversionpayloadsidc                    s   t  | |d| _|d| _|d| _|d| _|d| _t	|d| _
t	|d| _|d| _d|pA| ji| _d | _d S )	Nr   account_sidfriendly_nametype
attributesdate_createddate_updatedurl)super__init__getr   r   r   r   r   r
   iso8601_datetimer   r   r   	_solution_context)selfr   r   r   	__class__ S/var/www/html/venv/lib/python3.10/site-packages/twilio/rest/trusthub/v1/end_user.pyr   %   s    

zEndUserInstance.__init__returnEndUserContextc                 C   s&   | j du rt| j| 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: EndUserContext for this EndUserInstance
        Nr   r   )r"   r)   _versionr!   r#   r&   r&   r'   _proxy<   s   
zEndUserInstance._proxyc                 C   
   | j  S )j
        Deletes the EndUserInstance


        :returns: True if delete succeeds, False otherwise
        )r-   deleter,   r&   r&   r'   r0   K      
zEndUserInstance.deletec                       | j  I dH S )
        Asynchronous coroutine that deletes the EndUserInstance


        :returns: True if delete succeeds, False otherwise
        N)r-   delete_asyncr,   r&   r&   r'   r4   T      zEndUserInstance.delete_asyncc                 C   r.   )[
        Fetch the EndUserInstance


        :returns: The fetched EndUserInstance
        )r-   fetchr,   r&   r&   r'   r7   ]   r1   zEndUserInstance.fetchc                    r2   )u
        Asynchronous coroutine to fetch the EndUserInstance


        :returns: The fetched EndUserInstance
        N)r-   fetch_asyncr,   r&   r&   r'   r9   f   r5   zEndUserInstance.fetch_asyncr   r   c                 C   s   | j j||dS )5  
        Update the EndUserInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param attributes: The set of parameters that are the attributes of the End User resource which are derived End User Types.

        :returns: The updated EndUserInstance
        r   r   )r-   updater#   r   r   r&   r&   r'   r<   o   s   zEndUserInstance.updatec                    s   | j j||dI dH S )O  
        Asynchronous coroutine to update the EndUserInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param attributes: The set of parameters that are the attributes of the End User resource which are derived End User Types.

        :returns: The updated EndUserInstance
        r;   N)r-   update_asyncr=   r&   r&   r'   r?      s
   zEndUserInstance.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+EndUserInstance.__repr__.<locals>.<genexpr>z'<Twilio.Trusthub.V1.EndUserInstance {}>joinr!   itemsrF   r#   contextr&   r&   r'   __repr__      
zEndUserInstance.__repr__N)r(   r)   )r(   r   )__name__
__module____qualname____doc__r   r   strr   r   r   propertyr-   boolr0   r4   r7   r9   r   unsetr   objectr<   r?   rR   __classcell__r&   r&   r$   r'   r      sF    
	
	
	





r   c                       s   e Zd Zdedef fddZdefddZdefdd	Zde	fd
dZ
de	fddZejejfdeeef deeef de	fddZejej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   c                    s.   t  | d|i| _djdi | j| _dS )z
        Initialize the EndUserContext

        :param version: Version that contains the resource
        :param sid: The unique string created by Twilio to identify the End User resource.
        r   z/EndUsers/{sid}Nr&   )r   r   r!   rF   _uri)r#   r   r   r$   r&   r'   r      s   zEndUserContext.__init__r(   c                 C   s   t i }| jjd| j|dS )r/   DELETEmethoduriheaders)r   ofr+   r0   r_   r#   rd   r&   r&   r'   r0      s   
zEndUserContext.deletec                    s&   t i }| jjd| j|dI dH S )r3   r`   ra   N)r   re   r+   r4   r_   rf   r&   r&   r'   r4      s
   
zEndUserContext.delete_asyncc                 C   s<   t i }d|d< | jjd| j|d}t| j|| jd dS )r6   application/jsonAcceptGETra   r   r*   )r   re   r+   r7   r_   r   r!   r#   rd   r   r&   r&   r'   r7      s   
zEndUserContext.fetchc                    sD   t i }d|d< | jjd| j|dI dH }t| j|| jd dS )r8   rg   rh   ri   ra   Nr   r*   )r   re   r+   r9   r_   r   r!   rj   r&   r&   r'   r9      s   
zEndUserContext.fetch_asyncr   r   c                 C   s\   t |t|d}t i }d|d< d|d< | jjd| j||d}t| j|| jd d	S )
r:   FriendlyName
Attributes!application/x-www-form-urlencodedContent-Typerg   rh   POSTrb   rc   datard   r   r*   )	r   re   r   r]   r+   r<   r_   r   r!   r#   r   r   rr   rd   r   r&   r&   r'   r<      s   

zEndUserContext.updatec                    sd   t |t|d}t i }d|d< d|d< | jjd| j||dI dH }t| j|| jd	 d
S )r>   rk   rn   ro   rg   rh   rp   rq   Nr   r*   )	r   re   r   r]   r+   r?   r_   r   r!   rs   r&   r&   r'   r?     s   

zEndUserContext.update_asyncc                 C   r@   )rA   rB   c                 s   rC   rD   rE   rG   r&   r&   r'   rK   8  rL   z*EndUserContext.__repr__.<locals>.<genexpr>z&<Twilio.Trusthub.V1.EndUserContext {}>rM   rP   r&   r&   r'   rR   2  rS   zEndUserContext.__repr__)rU   rV   rW   r   rY   r   r[   r0   r4   r   r7   r9   r   r\   r   r]   r<   r?   rR   r^   r&   r&   r$   r'   r)      s2    


"


 r)   c                   @   s4   e Zd Zdeeef defddZdefddZdS )EndUserPager   r(   c                 C   s   t | j|S )zm
        Build an instance of EndUserInstance

        :param payload: Payload response from the API
        )r   r+   )r#   r   r&   r&   r'   get_instance>  s   zEndUserPage.get_instancec                 C      dS )rA   z <Twilio.Trusthub.V1.EndUserPage>r&   r,   r&   r&   r'   rR   F     zEndUserPage.__repr__N)	rU   rV   rW   r   rY   r   r   ru   rR   r&   r&   r&   r'   rt   <  s    rt   c                	       s  e Zd Zdef fddZejfdededee	e	f de
fdd	Zejfdededee	e	f de
fd
dZ		d)dee dee dee
 fddZ		d)dee dee dee
 fddZ		d)dee dee dee
 fddZ		d)dee dee de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defddZdedefd d!Zd"edefd#d$Zd"edefd%d&Zdefd'd(Z  ZS )*EndUserListr   c                    s   t  | d| _dS )zi
        Initialize the EndUserList

        :param version: Version that contains the resource

        z	/EndUsersN)r   r   r_   )r#   r   r$   r&   r'   r   Q  s   
zEndUserList.__init__r   r   r   r(   c                 C   sX   t ||t|d}t ddi}d|d< d|d< | jjd| j||d}t| j|S )a  
        Create the EndUserInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param type: The type of end user of the Bundle resource - can be `individual` or `business`.
        :param attributes: The set of parameters that are the attributes of the End User resource which are derived End User Types.

        :returns: The created EndUserInstance
        rl   Typerm   ro   rn   rg   rh   rp   rq   )r   re   r   r]   r+   creater_   r   r#   r   r   r   rr   rd   r   r&   r&   r'   r{   \  s   
zEndUserList.createc                    s`   t ||t|d}t ddi}d|d< d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously create the EndUserInstance

        :param friendly_name: The string that you assigned to describe the resource.
        :param type: The type of end user of the Bundle resource - can be `individual` or `business`.
        :param attributes: The set of parameters that are the attributes of the End User resource which are derived End User Types.

        :returns: The created EndUserInstance
        ry   ro   rn   rg   rh   rp   rq   N)r   re   r   r]   r+   create_asyncr_   r   r|   r&   r&   r'   r}     s   
zEndUserList.create_asyncNlimit	page_sizec                 C   s0   | j ||}| j|d d}| j ||d S )a]  
        Streams EndUserInstance 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   r   r~   )r+   read_limitspagestreamr#   r~   r   limitsr   r&   r&   r'   r     s   zEndUserList.streamc                    s8   | j ||}| j|d dI dH }| j ||d S )al  
        Asynchronously streams EndUserInstance 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 limit: Upper limit for the number of records to return. stream()
                      guarantees to never return more than limit.  Default is no limit
        :param 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
        r   r   Nr~   )r+   r   
page_asyncstream_asyncr   r&   r&   r'   r     s   zEndUserList.stream_asyncc                 C   s   t | j||dS )a  
        Lists EndUserInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        r~   r   )listr   r#   r~   r   r&   r&   r'   r     s   zEndUserList.listc                    s&   dd | j ||dI dH 2 I dH S )a	  
        Asynchronously lists EndUserInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param limit: Upper limit for the number of records to return. list() guarantees
                      never to return more than limit.  Default is no limit
        :param 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: list that will contain up to limit results
        c                    s   g | z3 d H W }|q6 S rT   r&   )rH   recordr&   r&   r'   
<listcomp>  s
    z*EndUserList.list_async.<locals>.<listcomp>r   N)r   r   r&   r&   r'   
list_async  s   
zEndUserList.list_async
page_tokenpage_numberc                 C   sJ   t |||d}t ddi}d|d< | jjd| j||d}t| j|S )as  
        Retrieve a single page of EndUserInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EndUserInstance
        	PageTokenr   PageSizero   rn   rg   rh   ri   rb   rc   paramsrd   )r   re   r+   r   r_   rt   r#   r   r   r   rr   rd   responser&   r&   r'   r   	  s   
zEndUserList.pagec                    sR   t |||d}t ddi}d|d< | jjd| j||dI dH }t| j|S )	a  
        Asynchronously retrieve a single page of EndUserInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EndUserInstance
        r   ro   rn   rg   rh   ri   r   N)r   re   r+   r   r_   rt   r   r&   r&   r'   r   *  s   
zEndUserList.page_async
target_urlc                 C   s   | j jjd|}t| j |S )z
        Retrieve a specific page of EndUserInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EndUserInstance
        ri   )r+   domaintwiliorequestrt   r#   r   r   r&   r&   r'   get_pageK  s   	zEndUserList.get_pagec                    s&   | j jjd|I dH }t| j |S )a  
        Asynchronously retrieve a specific page of EndUserInstance records from the API.
        Request is executed immediately

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

        :returns: Page of EndUserInstance
        ri   N)r+   r   r   request_asyncrt   r   r&   r&   r'   get_page_asyncW  s   	zEndUserList.get_page_asyncr   c                 C      t | j|dS z
        Constructs a EndUserContext

        :param sid: The unique string created by Twilio to identify the End User resource.
        r*   r)   r+   r#   r   r&   r&   r'   r   c     zEndUserList.getc                 C   r   r   r   r   r&   r&   r'   __call__k  r   zEndUserList.__call__c                 C   rv   )rA   z <Twilio.Trusthub.V1.EndUserList>r&   r,   r&   r&   r'   rR   s  rw   zEndUserList.__repr__)NN) rU   rV   rW   r   r   r   r\   rY   r   r]   r   r{   r}   r   intr   r   r	   r   r   r   r   rt   r   r   r   r   r)   r   r   rR   r^   r&   r&   r$   r'   rx   O  s    

'

%







#



!rx   N)rX   r   typingr   r   r   r   r   r   r	   twilio.baser
   r   r   twilio.base.instance_contextr   twilio.base.instance_resourcer   twilio.base.list_resourcer   twilio.base.versionr   twilio.base.pager   r   r)   rt   rx   r&   r&   r&   r'   <module>   s    $   