a
    !fPP                     @   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eeeef ee d fddZ	e
dddd	Zedd
dZedddZd dddZd dddZejejfeeef eeef d dddZejejfeeef eeef d dddZed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|p| 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__ a/var/www/html/python-backend/venv/lib/python3.9/site-packages/twilio/rest/trusthub/v1/end_user.pyr   '   s     
zEndUserInstance.__init__EndUserContextreturnc                 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   s
   | j  S )j
        Deletes the EndUserInstance


        :returns: True if delete succeeds, False otherwise
        )r.   deleter-   r&   r&   r'   r0   M   s    zEndUserInstance.deletec                    s   | 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'   r2   V   s    zEndUserInstance.delete_asyncc                 C   s
   | j  S )[
        Fetch the EndUserInstance


        :returns: The fetched EndUserInstance
        )r.   fetchr-   r&   r&   r'   r4   _   s    zEndUserInstance.fetchc                    s   | j  I dH S )u
        Asynchronous coroutine to fetch the EndUserInstance


        :returns: The fetched EndUserInstance
        N)r.   fetch_asyncr-   r&   r&   r'   r6   h   s    zEndUserInstance.fetch_asyncr   r   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:   q   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
        r9   N)r.   update_asyncr;   r&   r&   r'   r=      s    zEndUserInstance.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>       z+EndUserInstance.__repr__.<locals>.<genexpr>z'<Twilio.Trusthub.V1.EndUserInstance {}>joinr!   itemsrB   r#   contextr&   r&   r'   __repr__   s    zEndUserInstance.__repr__)N)__name__
__module____qualname____doc__r   r   strr   r   r   propertyr.   boolr0   r2   r4   r6   r   unsetr   objectr:   r=   rN   __classcell__r&   r&   r$   r'   r      s4    			



r   c                       s   e Zd Zeed fddZedddZedddZe	dd	d
Z
e	dddZejejfeeef eeef e	dddZejejfeeef eeef e	dddZedddZ  ZS )r(   )r   r   c                    s.   t  | d|i| _djf 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}N)r   r   r!   rB   _uri)r#   r   r   r$   r&   r'   r      s    zEndUserContext.__init__r)   c                 C   s   | j jd| jdS )r/   DELETEmethoduri)r,   r0   rY   r-   r&   r&   r'   r0      s    zEndUserContext.deletec                    s   | j jd| jdI dH S )r1   rZ   r[   N)r,   r2   rY   r-   r&   r&   r'   r2      s    zEndUserContext.delete_asyncc                 C   s(   | j jd| jd}t| j || jd dS )r3   GETr[   r   r+   )r,   r4   rY   r   r!   r#   r   r&   r&   r'   r4      s    zEndUserContext.fetchc                    s.   | j jd| jdI dH }t| j || jd dS )r5   r^   r[   Nr   r+   )r,   r6   rY   r   r!   r_   r&   r&   r'   r6      s    zEndUserContext.fetch_asyncr7   c                 C   s@   t |t|d}| jjd| j|d}t| j|| jd dS )r8   FriendlyName
AttributesPOSTr\   r]   datar   r+   )	r   ofr   rW   r,   r:   rY   r   r!   r#   r   r   re   r   r&   r&   r'   r:      s    zEndUserContext.updatec                    sF   t |t|d}| jjd| j|dI dH }t| j|| jd dS )r<   r`   rc   rd   Nr   r+   )	r   rf   r   rW   r,   r=   rY   r   r!   rg   r&   r&   r'   r=   	  s    zEndUserContext.update_asyncc                 C   s$   d dd | j D }d|S )r>   r?   c                 s   s   | ]\}}d  ||V  qdS r@   rA   rC   r&   r&   r'   rG   +  rH   z*EndUserContext.__repr__.<locals>.<genexpr>z&<Twilio.Trusthub.V1.EndUserContext {}>rI   rL   r&   r&   r'   rN   %  s    zEndUserContext.__repr__)rO   rP   rQ   r   rS   r   rU   r0   r2   r   r4   r6   r   rV   r   rW   r:   r=   rN   rX   r&   r&   r$   r'   r(      s(   



r(   c                   @   s2   e Zd Zeeef edddZedddZdS )EndUserPage)r   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'   get_instance0  s    zEndUserPage.get_instancer)   c                 C   s   dS )r>   z <Twilio.Trusthub.V1.EndUserPage>r&   r-   r&   r&   r'   rN   8  s    zEndUserPage.__repr__N)	rO   rP   rQ   r   rS   r   r   ri   rN   r&   r&   r&   r'   rh   /  s   rh   c                       s  e Zd Zed fddZejfeeee	e	f e
dddZejfeeee	e	f e
dddZd%ee ee ee
 d
ddZd&ee ee ee
 d
ddZd'ee ee ee
 d
ddZd(ee ee e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edddZeedddZeedddZeedd d!Zed"d#d$Z  ZS ))EndUserList)r   c                    s   t  | d| _dS )zi
        Initialize the EndUserList

        :param version: Version that contains the resource

        z	/EndUsersN)r   r   rY   )r#   r   r$   r&   r'   r   B  s    zEndUserList.__init__)r   r   r   r*   c                 C   s8   t ||t|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
        ra   Typerb   rc   rd   )r   rf   r   rW   r,   createrY   r   r#   r   r   r   re   r   r&   r&   r'   rm   M  s    zEndUserList.createc                    s>   t ||t|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
        rk   rc   rd   N)r   rf   r   rW   r,   create_asyncrY   r   rn   r&   r&   r'   ro   l  s    zEndUserList.create_asyncN)limit	page_sizer*   c                 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
        rq   rq   rp   )r,   read_limitspagestreamr#   rp   rq   Zlimitsrt   r&   r&   r'   ru     s    zEndUserList.streamc                    s6   | 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
        rq   rr   Nrp   )r,   rs   
page_asyncstream_asyncrv   r&   r&   r'   rx     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
        rp   rq   )listru   r#   rp   rq   r&   r&   r'   rz     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 )Nr&   )rD   recordr&   r&   r'   
<listcomp>  s   z*EndUserList.list_async.<locals>.<listcomp>ry   N)rx   r{   r&   r&   r'   
list_async  s    
zEndUserList.list_async)
page_tokenpage_numberrq   r*   c                 C   s2   t |||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
        Z	PageTokenr   ZPageSizer^   r\   r]   params)r   rf   r,   rt   rY   rh   r#   r   r   rq   re   responser&   r&   r'   rt     s    zEndUserList.pagec                    s8   t |||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   r^   r   N)r   rf   r,   rw   rY   rh   r   r&   r&   r'   rw     s    zEndUserList.page_async)
target_urlr*   c                 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
        r^   )r,   domaintwiliorequestrh   r#   r   r   r&   r&   r'   get_page*  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
        r^   N)r,   r   r   Zrequest_asyncrh   r   r&   r&   r'   get_page_async6  s    	zEndUserList.get_page_async)r   r*   c                 C   s   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   B  s    zEndUserList.getc                 C   s   t | j|dS r   r   r   r&   r&   r'   __call__J  s    zEndUserList.__call__r)   c                 C   s   dS )r>   z <Twilio.Trusthub.V1.EndUserList>r&   r-   r&   r&   r'   rN   R  s    zEndUserList.__repr__)NN)NN)NN)NN) rO   rP   rQ   r   r   r   rV   rS   r   rW   r   rm   ro   r   intr   ru   r	   rx   r   rz   r~   rh   rt   rw   r   r   r(   r   r   rN   rX   r&   r&   r$   r'   rj   A  s   
#
!        





rj   N)rR   r   typingr   r   r   r   r   r   r	   Ztwilio.baser
   r   r   Ztwilio.base.instance_contextr   Ztwilio.base.instance_resourcer   Ztwilio.base.list_resourcer   Ztwilio.base.versionr   Ztwilio.base.pager   r   r(   rh   rj   r&   r&   r&   r'   <module>   s   $  